tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
Merge #121772: gcc*: do not modify code in prePatch
Vladimír Čunát
4 years ago
79762fcb
6d128786
+49
-50
6 changed files
expand all
collapse all
unified
split
pkgs
development
compilers
gcc
10
default.nix
11
default.nix
6
default.nix
7
default.nix
8
default.nix
9
default.nix
+9
-9
pkgs/development/compilers/gcc/10/default.nix
···
103
103
104
104
hardeningDisable = [ "format" "pie" ];
105
105
106
106
+
postPatch = ''
107
107
+
configureScripts=$(find . -name configure)
108
108
+
for configureScript in $configureScripts; do
109
109
+
patchShebangs $configureScript
110
110
+
done
111
111
+
''
106
112
# This should kill all the stdinc frameworks that gcc and friends like to
107
113
# insert into default search paths.
108
108
-
prePatch = lib.optionalString hostPlatform.isDarwin ''
114
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
117
-
'';
118
118
-
119
119
-
postPatch = ''
120
120
-
configureScripts=$(find . -name configure)
121
121
-
for configureScript in $configureScripts; do
122
122
-
patchShebangs $configureScript
123
123
-
done
124
124
-
'' + (
123
123
+
''
124
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
106
+
postPatch = ''
107
107
+
configureScripts=$(find . -name configure)
108
108
+
for configureScript in $configureScripts; do
109
109
+
patchShebangs $configureScript
110
110
+
done
111
111
+
''
106
112
# This should kill all the stdinc frameworks that gcc and friends like to
107
113
# insert into default search paths.
108
108
-
prePatch = lib.optionalString hostPlatform.isDarwin ''
114
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
117
-
'';
118
118
-
119
119
-
postPatch = ''
120
120
-
configureScripts=$(find . -name configure)
121
121
-
for configureScript in $configureScripts; do
122
122
-
patchShebangs $configureScript
123
123
-
done
124
124
-
'' + (
123
123
+
''
124
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
157
-
prePatch =
157
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
169
-
'';
170
170
-
171
171
-
postPatch =
169
169
+
''
170
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
194
-
else null;
193
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
117
+
postPatch = ''
118
118
+
configureScripts=$(find . -name configure)
119
119
+
for configureScript in $configureScripts; do
120
120
+
patchShebangs $configureScript
121
121
+
done
122
122
+
''
117
123
# This should kill all the stdinc frameworks that gcc and friends like to
118
124
# insert into default search paths.
119
119
-
prePatch = lib.optionalString hostPlatform.isDarwin ''
125
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
128
-
'';
129
129
-
130
130
-
postPatch = ''
131
131
-
configureScripts=$(find . -name configure)
132
132
-
for configureScript in $configureScripts; do
133
133
-
patchShebangs $configureScript
134
134
-
done
135
135
-
'' + (
134
134
+
''
135
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
104
+
postPatch = ''
105
105
+
configureScripts=$(find . -name configure)
106
106
+
for configureScript in $configureScripts; do
107
107
+
patchShebangs $configureScript
108
108
+
done
109
109
+
''
104
110
# This should kill all the stdinc frameworks that gcc and friends like to
105
111
# insert into default search paths.
106
106
-
prePatch = lib.optionalString hostPlatform.isDarwin ''
112
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
115
-
'';
116
116
-
117
117
-
postPatch = ''
118
118
-
configureScripts=$(find . -name configure)
119
119
-
for configureScript in $configureScripts; do
120
120
-
patchShebangs $configureScript
121
121
-
done
122
122
-
'' + (
121
121
+
''
122
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
120
+
postPatch = ''
121
121
+
configureScripts=$(find . -name configure)
122
122
+
for configureScript in $configureScripts; do
123
123
+
patchShebangs $configureScript
124
124
+
done
125
125
+
''
120
126
# This should kill all the stdinc frameworks that gcc and friends like to
121
127
# insert into default search paths.
122
122
-
prePatch = lib.optionalString hostPlatform.isDarwin ''
128
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
131
-
'';
132
132
-
133
133
-
postPatch = ''
134
134
-
configureScripts=$(find . -name configure)
135
135
-
for configureScript in $configureScripts; do
136
136
-
patchShebangs $configureScript
137
137
-
done
138
138
-
'' + (
137
137
+
''
138
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'.