tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
darwin.cctools: 949.0.1 -> 973.0.1
Stéphan Kochen
3 years ago
71b05ecc
9e2d4286
+116
-20
2 changed files
expand all
collapse all
unified
split
pkgs
os-specific
darwin
cctools
darwin-no-memstream.patch
port.nix
+21
pkgs/os-specific/darwin/cctools/darwin-no-memstream.patch
···
1
1
+
MacOS SDKs before 10.13 don't support open_memstream. This is already replaced
2
2
+
by a runtime check in cctools-port, but because we build with SDK 10.12 by
3
3
+
default, linking still fails for us. Disable it entirely here.
4
4
+
5
5
+
--- a/cctools/include/stuff/diagnostics.h
6
6
+
+++ b/cctools/include/stuff/diagnostics.h
7
7
+
@@ -60,13 +60,6 @@ void diagnostics_log_msg(enum diagnostic_level level, const char* message);
8
8
+
*/
9
9
+
void diagnostics_write(void);
10
10
+
11
11
+
-#if defined(__APPLE__ ) && defined(__has_builtin)
12
12
+
-# if __has_builtin(__builtin_available)
13
13
+
-# define HAVE_OPENMEMSTREAM_RUNTIME __builtin_available(macOS 10.13, *)
14
14
+
-# endif
15
15
+
-#endif
16
16
+
-#ifndef HAVE_OPENMEMSTREAM_RUNTIME
17
17
+
-# define HAVE_OPENMEMSTREAM_RUNTIME 1
18
18
+
-#endif
19
19
+
+#define HAVE_OPENMEMSTREAM_RUNTIME 0
20
20
+
21
21
+
#endif /* diagnostics_h */
+95
-20
pkgs/os-specific/darwin/cctools/port.nix
···
19
19
20
20
stdenv.mkDerivation {
21
21
pname = "${targetPrefix}cctools-port";
22
22
-
version = "949.0.1";
22
22
+
version = "973.0.1";
23
23
24
24
src = fetchFromGitHub {
25
25
owner = "tpoechtrager";
26
26
repo = "cctools-port";
27
27
-
rev = "43f32a4c61b5ba7fde011e816136c550b1b3146f";
28
28
-
sha256 = "10yc5smiczzm62q6ijqccc58bwmfhc897f3bwa5i9j98csqsjj0k";
27
27
+
# This is the commit before: https://github.com/tpoechtrager/cctools-port/pull/114
28
28
+
# That specific change causes trouble for us (see the PR discussion), but
29
29
+
# is also currently the last commit on master at the time of writing, so we
30
30
+
# can just go back one step.
31
31
+
rev = "457dc6ddf5244ebf94f28e924e3a971f1566bd66";
32
32
+
sha256 = "0ns12q7vg9yand4dmdsps1917cavfbw67yl5q7bm6kb4ia5kkx13";
29
33
};
30
34
31
35
outputs = [ "out" "dev" "man" ];
···
35
39
++ lib.optionals stdenv.isDarwin [ libobjc ]
36
40
++ lib.optional enableTapiSupport libtapi;
37
41
38
38
-
patches = [ ./ld-ignore-rpath-link.patch ./ld-rpath-nonfinal.patch ];
42
42
+
patches = [
43
43
+
./ld-ignore-rpath-link.patch
44
44
+
./ld-rpath-nonfinal.patch
45
45
+
]
46
46
+
++ lib.optional stdenv.isDarwin ./darwin-no-memstream.patch;
39
47
40
48
__propagatedImpureHostDeps = [
41
49
# As far as I can tell, otool from cctools is the only thing that depends on these two, and we should fix them
···
64
72
--replace "-isystem /usr/local/include -isystem /usr/pkg/include" "" \
65
73
--replace "-L/usr/local/lib" "" \
66
74
67
67
-
substituteInPlace cctools/include/Makefile \
68
68
-
--replace "/bin/" ""
75
75
+
# Appears to use new libdispatch API not available in macOS SDK 10.12.
76
76
+
substituteInPlace cctools/ld64/src/ld/libcodedirectory.c \
77
77
+
--replace "#define LIBCD_PARALLEL 1" ""
69
78
70
79
patchShebangs tools
71
80
sed -i -e 's/which/type -P/' tools/*.sh
72
81
73
73
-
# Workaround for https://www.sourceware.org/bugzilla/show_bug.cgi?id=11157
74
74
-
cat > cctools/include/unistd.h <<EOF
75
75
-
#ifdef __block
76
76
-
# undef __block
77
77
-
# include_next "unistd.h"
78
78
-
# define __block __attribute__((__blocks__(byref)))
79
79
-
#else
80
80
-
# include_next "unistd.h"
81
81
-
#endif
82
82
-
EOF
83
83
-
84
82
cd cctools
85
83
'';
86
84
87
85
preInstall = ''
88
88
-
pushd include
89
89
-
make DSTROOT=$out/include RC_OS=common install
86
86
+
installManPage ar/ar.{1,5}
87
87
+
88
88
+
# The makefile rules for installing headers are missing in 973.0.1.
89
89
+
# The below is derived from 949.0.1.
90
90
+
mkdir -p $dev/include/mach-o/i386
91
91
+
mkdir -p $dev/include/mach-o/ppc
92
92
+
mkdir -p $dev/include/mach-o/x86_64
93
93
+
mkdir -p $dev/include/mach-o/arm
94
94
+
mkdir -p $dev/include/mach-o/arm64
95
95
+
mkdir -p $dev/include/mach-o/m68k
96
96
+
mkdir -p $dev/include/mach-o/sparc
97
97
+
mkdir -p $dev/include/mach-o/hppa
98
98
+
mkdir -p $dev/include/mach-o/i860
99
99
+
mkdir -p $dev/include/mach-o/m88k
100
100
+
mkdir -p $dev/include/dyld
101
101
+
mkdir -p $dev/include/cbt
102
102
+
103
103
+
pushd include/mach-o
104
104
+
install -c -m 444 arch.h ldsyms.h reloc.h \
105
105
+
stab.h loader.h fat.h swap.h getsect.h nlist.h \
106
106
+
ranlib.h $dev/include/mach-o
107
107
+
popd
108
108
+
109
109
+
pushd include/mach-o/i386
110
110
+
install -c -m 444 swap.h \
111
111
+
$dev/include/mach-o/i386
112
112
+
popd
113
113
+
114
114
+
pushd include/mach-o/ppc
115
115
+
install -c -m 444 reloc.h swap.h \
116
116
+
$dev/include/mach-o/ppc
117
117
+
popd
118
118
+
119
119
+
pushd include/mach-o/x86_64
120
120
+
install -c -m 444 reloc.h \
121
121
+
$dev/include/mach-o/x86_64
122
122
+
popd
123
123
+
124
124
+
pushd include/mach-o/arm
125
125
+
install -c -m 444 reloc.h \
126
126
+
$dev/include/mach-o/arm
127
127
+
popd
128
128
+
129
129
+
pushd include/mach-o/arm64
130
130
+
install -c -m 444 reloc.h \
131
131
+
$dev/include/mach-o/arm64
132
132
+
popd
133
133
+
134
134
+
pushd include/mach-o/m68k
135
135
+
install -c -m 444 swap.h \
136
136
+
$dev/include/mach-o/m68k
137
137
+
popd
138
138
+
139
139
+
pushd include/mach-o/sparc
140
140
+
install -c -m 444 reloc.h swap.h \
141
141
+
$dev/include/mach-o/sparc
90
142
popd
91
143
92
92
-
installManPage ar/ar.{1,5}
144
144
+
pushd include/mach-o/hppa
145
145
+
install -c -m 444 reloc.h swap.h \
146
146
+
$dev/include/mach-o/hppa
147
147
+
popd
148
148
+
149
149
+
pushd include/mach-o/i860
150
150
+
install -c -m 444 reloc.h swap.h \
151
151
+
$dev/include/mach-o/i860
152
152
+
popd
153
153
+
154
154
+
pushd include/mach-o/m88k
155
155
+
install -c -m 444 reloc.h swap.h \
156
156
+
$dev/include/mach-o/m88k
157
157
+
popd
158
158
+
159
159
+
pushd include/stuff
160
160
+
install -c -m 444 bool.h \
161
161
+
$dev/include/dyld
162
162
+
popd
163
163
+
164
164
+
pushd include/cbt
165
165
+
install -c -m 444 libsyminfo.h \
166
166
+
$dev/include/cbt
167
167
+
popd
93
168
'';
94
169
95
170
passthru = {