From 5f45fb3ae986119b4360613901a1c033a2ee327e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 13 Feb 2008 14:23:09 +0000 Subject: * substitute() in stdenv: use the replace program instead of awful sed hackery. * Some indentation fixes in setup.sh. svn path=/nixpkgs/branches/stdenv-updates/; revision=10658 --- pkgs/stdenv/generic/builder.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'pkgs/stdenv/generic/builder.sh') diff --git a/pkgs/stdenv/generic/builder.sh b/pkgs/stdenv/generic/builder.sh index ee2dbb3d0f9e..2a74f038dca0 100644 --- a/pkgs/stdenv/generic/builder.sh +++ b/pkgs/stdenv/generic/builder.sh @@ -8,14 +8,17 @@ source $stdenv/setup mkdir $out -substitute "$setup" "$out/setup" \ - --subst-var preHook \ - --subst-var postHook \ - --subst-var initialPath \ - --subst-var gcc \ - --subst-var shell \ - --subst-var-by param1 "$p1" \ - --subst-var-by param2 "$p2" \ - --subst-var-by param3 "$p3" \ - --subst-var-by param4 "$p4" \ - --subst-var-by param5 "$p5" +# Can't use substitute() here, because replace may not have been +# built yet (in the bootstrap). +sed \ + -e "s^@preHook@^$preHook^" \ + -e "s^@postHook@^$postHook^" \ + -e "s^@initialPath@^$initialPath^" \ + -e "s^@gcc@^$gcc^" \ + -e "s^@shell@^$shell^" \ + -e "s^@param1@^$p1^" \ + -e "s^@param2@^$p2^" \ + -e "s^@param3@^$p3^" \ + -e "s^@param4@^$p4^" \ + -e "s^@param5@^$p5^" \ + < "$setup" > "$out/setup" -- cgit 1.4.1 From 89815eb9a00150c34edcc5872bbc93b9122decdc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 13 Feb 2008 19:41:37 +0000 Subject: * gcc-wrapper: Propagate the wrapped gcc, binutils and glibc to the user environment. (NIXPKGS-63) svn path=/nixpkgs/branches/stdenv-updates/; revision=10664 --- pkgs/build-support/gcc-wrapper/builder.sh | 22 +++++++++++++++------- pkgs/development/libraries/glibc-2.7/builder.sh | 2 +- pkgs/stdenv/generic/builder.sh | 20 ++++++++++---------- 3 files changed, 26 insertions(+), 18 deletions(-) (limited to 'pkgs/stdenv/generic/builder.sh') diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh index c263b3f330ed..7a2f9c20f27f 100644 --- a/pkgs/build-support/gcc-wrapper/builder.sh +++ b/pkgs/build-support/gcc-wrapper/builder.sh @@ -53,13 +53,13 @@ doSubstitute() { # Can't use substitute() here, because replace may not have been # built yet (in the bootstrap). sed \ - -e "s^@out@^$out^" \ - -e "s^@shell@^$shell^" \ - -e "s^@gcc@^$gcc^" \ - -e "s^@gccProg@^$gccProg^" \ - -e "s^@binutils@^$binutils^" \ - -e "s^@libc@^$libc^" \ - -e "s^@ld@^$ldPath/ld^" \ + -e "s^@out@^$out^g" \ + -e "s^@shell@^$shell^g" \ + -e "s^@gcc@^$gcc^g" \ + -e "s^@gccProg@^$gccProg^g" \ + -e "s^@binutils@^$binutils^g" \ + -e "s^@libc@^$libc^g" \ + -e "s^@ld@^$ldPath/ld^g" \ < "$src" > "$dst" } @@ -111,3 +111,11 @@ doSubstitute "$addFlags" "$out/nix-support/add-flags.sh" doSubstitute "$setupHook" "$out/nix-support/setup-hook" cp -p $utils $out/nix-support/utils.sh + + +# Propagate the wrapped gcc so that if you install the wrapper, you get +# tools like gcov, the manpages, etc. as well (including for binutils +# and Glibc). +if test -z "$nativeTools"; then + echo $gcc $binutils $libc > $out/nix-support/propagated-user-env-packages +fi diff --git a/pkgs/development/libraries/glibc-2.7/builder.sh b/pkgs/development/libraries/glibc-2.7/builder.sh index 2418d0bf3657..f9b9c6b87aa1 100644 --- a/pkgs/development/libraries/glibc-2.7/builder.sh +++ b/pkgs/development/libraries/glibc-2.7/builder.sh @@ -14,7 +14,7 @@ preConfigure() { for i in configure io/ftwtest-sh; do # Can't use substituteInPlace here because replace hasn't been # built yet in the bootstrap. - sed -i "$i" -e "s^/bin/pwd^$(type -tP pwd)^" + sed -i "$i" -e "s^/bin/pwd^$PWD_P^g" done # In the glibc 2.6/2.7 tarballs C-translit.h is a little bit older diff --git a/pkgs/stdenv/generic/builder.sh b/pkgs/stdenv/generic/builder.sh index 2a74f038dca0..f772b1cc19b3 100644 --- a/pkgs/stdenv/generic/builder.sh +++ b/pkgs/stdenv/generic/builder.sh @@ -11,14 +11,14 @@ mkdir $out # Can't use substitute() here, because replace may not have been # built yet (in the bootstrap). sed \ - -e "s^@preHook@^$preHook^" \ - -e "s^@postHook@^$postHook^" \ - -e "s^@initialPath@^$initialPath^" \ - -e "s^@gcc@^$gcc^" \ - -e "s^@shell@^$shell^" \ - -e "s^@param1@^$p1^" \ - -e "s^@param2@^$p2^" \ - -e "s^@param3@^$p3^" \ - -e "s^@param4@^$p4^" \ - -e "s^@param5@^$p5^" \ + -e "s^@preHook@^$preHook^g" \ + -e "s^@postHook@^$postHook^g" \ + -e "s^@initialPath@^$initialPath^g" \ + -e "s^@gcc@^$gcc^g" \ + -e "s^@shell@^$shell^g" \ + -e "s^@param1@^$p1^g" \ + -e "s^@param2@^$p2^g" \ + -e "s^@param3@^$p3^g" \ + -e "s^@param4@^$p4^g" \ + -e "s^@param5@^$p5^g" \ < "$setup" > "$out/setup" -- cgit 1.4.1