Merge #121772: gcc*: do not modify code in prePatch

+49 -50
+9 -9
pkgs/development/compilers/gcc/10/default.nix
··· 103 103 104 104 hardeningDisable = [ "format" "pie" ]; 105 105 106 + postPatch = '' 107 + configureScripts=$(find . -name configure) 108 + for configureScript in $configureScripts; do 109 + patchShebangs $configureScript 110 + done 111 + '' 106 112 # This should kill all the stdinc frameworks that gcc and friends like to 107 113 # insert into default search paths. 108 - prePatch = lib.optionalString hostPlatform.isDarwin '' 114 + + lib.optionalString hostPlatform.isDarwin '' 109 115 substituteInPlace gcc/config/darwin-c.c \ 110 116 --replace 'if (stdinc)' 'if (0)' 111 117 ··· 114 120 115 121 substituteInPlace libgfortran/configure \ 116 122 --replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname" 117 - ''; 118 - 119 - postPatch = '' 120 - configureScripts=$(find . -name configure) 121 - for configureScript in $configureScripts; do 122 - patchShebangs $configureScript 123 - done 124 - '' + ( 123 + '' 124 + + ( 125 125 if targetPlatform != hostPlatform || stdenv.cc.libc != null then 126 126 # On NixOS, use the right path to the dynamic linker instead of 127 127 # `/lib/ld*.so'.
+9 -9
pkgs/development/compilers/gcc/11/default.nix
··· 103 103 104 104 hardeningDisable = [ "format" "pie" ]; 105 105 106 + postPatch = '' 107 + configureScripts=$(find . -name configure) 108 + for configureScript in $configureScripts; do 109 + patchShebangs $configureScript 110 + done 111 + '' 106 112 # This should kill all the stdinc frameworks that gcc and friends like to 107 113 # insert into default search paths. 108 - prePatch = lib.optionalString hostPlatform.isDarwin '' 114 + + lib.optionalString hostPlatform.isDarwin '' 109 115 substituteInPlace gcc/config/darwin-c.c \ 110 116 --replace 'if (stdinc)' 'if (0)' 111 117 ··· 114 120 115 121 substituteInPlace libgfortran/configure \ 116 122 --replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname" 117 - ''; 118 - 119 - postPatch = '' 120 - configureScripts=$(find . -name configure) 121 - for configureScript in $configureScripts; do 122 - patchShebangs $configureScript 123 - done 124 - '' + ( 123 + '' 124 + + ( 125 125 if targetPlatform != hostPlatform || stdenv.cc.libc != null then 126 126 # On NixOS, use the right path to the dynamic linker instead of 127 127 # `/lib/ld*.so'.
+4 -5
pkgs/development/compilers/gcc/6/default.nix
··· 154 154 155 155 hardeningDisable = [ "format" "pie" ]; 156 156 157 - prePatch = 157 + postPatch = 158 158 # This should kill all the stdinc frameworks that gcc and friends like to 159 159 # insert into default search paths. 160 160 lib.optionalString hostPlatform.isDarwin '' ··· 166 166 167 167 substituteInPlace libgfortran/configure \ 168 168 --replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname" 169 - ''; 170 - 171 - postPatch = 169 + '' 170 + + ( 172 171 if targetPlatform != hostPlatform || stdenv.cc.libc != null then 173 172 # On NixOS, use the right path to the dynamic linker instead of 174 173 # `/lib/ld*.so'. ··· 191 190 sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR' 192 191 '' 193 192 ) 194 - else null; 193 + else ""); 195 194 196 195 inherit noSysDirs staticCompiler langJava crossStageStatic 197 196 libcCross crossMingw;
+9 -9
pkgs/development/compilers/gcc/7/default.nix
··· 114 114 115 115 hardeningDisable = [ "format" "pie" ]; 116 116 117 + postPatch = '' 118 + configureScripts=$(find . -name configure) 119 + for configureScript in $configureScripts; do 120 + patchShebangs $configureScript 121 + done 122 + '' 117 123 # This should kill all the stdinc frameworks that gcc and friends like to 118 124 # insert into default search paths. 119 - prePatch = lib.optionalString hostPlatform.isDarwin '' 125 + + lib.optionalString hostPlatform.isDarwin '' 120 126 substituteInPlace gcc/config/darwin-c.c \ 121 127 --replace 'if (stdinc)' 'if (0)' 122 128 ··· 125 131 126 132 substituteInPlace libgfortran/configure \ 127 133 --replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname" 128 - ''; 129 - 130 - postPatch = '' 131 - configureScripts=$(find . -name configure) 132 - for configureScript in $configureScripts; do 133 - patchShebangs $configureScript 134 - done 135 - '' + ( 134 + '' 135 + + ( 136 136 if targetPlatform != hostPlatform || stdenv.cc.libc != null then 137 137 # On NixOS, use the right path to the dynamic linker instead of 138 138 # `/lib/ld*.so'.
+9 -9
pkgs/development/compilers/gcc/8/default.nix
··· 101 101 102 102 hardeningDisable = [ "format" "pie" ]; 103 103 104 + postPatch = '' 105 + configureScripts=$(find . -name configure) 106 + for configureScript in $configureScripts; do 107 + patchShebangs $configureScript 108 + done 109 + '' 104 110 # This should kill all the stdinc frameworks that gcc and friends like to 105 111 # insert into default search paths. 106 - prePatch = lib.optionalString hostPlatform.isDarwin '' 112 + + lib.optionalString hostPlatform.isDarwin '' 107 113 substituteInPlace gcc/config/darwin-c.c \ 108 114 --replace 'if (stdinc)' 'if (0)' 109 115 ··· 112 118 113 119 substituteInPlace libgfortran/configure \ 114 120 --replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname" 115 - ''; 116 - 117 - postPatch = '' 118 - configureScripts=$(find . -name configure) 119 - for configureScript in $configureScripts; do 120 - patchShebangs $configureScript 121 - done 122 - '' + ( 121 + '' 122 + + ( 123 123 if targetPlatform != hostPlatform || stdenv.cc.libc != null then 124 124 # On NixOS, use the right path to the dynamic linker instead of 125 125 # `/lib/ld*.so'.
+9 -9
pkgs/development/compilers/gcc/9/default.nix
··· 117 117 118 118 hardeningDisable = [ "format" "pie" ]; 119 119 120 + postPatch = '' 121 + configureScripts=$(find . -name configure) 122 + for configureScript in $configureScripts; do 123 + patchShebangs $configureScript 124 + done 125 + '' 120 126 # This should kill all the stdinc frameworks that gcc and friends like to 121 127 # insert into default search paths. 122 - prePatch = lib.optionalString hostPlatform.isDarwin '' 128 + + lib.optionalString hostPlatform.isDarwin '' 123 129 substituteInPlace gcc/config/darwin-c.c \ 124 130 --replace 'if (stdinc)' 'if (0)' 125 131 ··· 128 134 129 135 substituteInPlace libgfortran/configure \ 130 136 --replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname" 131 - ''; 132 - 133 - postPatch = '' 134 - configureScripts=$(find . -name configure) 135 - for configureScript in $configureScripts; do 136 - patchShebangs $configureScript 137 - done 138 - '' + ( 137 + '' 138 + + ( 139 139 if targetPlatform != hostPlatform || stdenv.cc.libc != null then 140 140 # On NixOS, use the right path to the dynamic linker instead of 141 141 # `/lib/ld*.so'.