1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-24 14:41:17 +00:00

darwin.DarwinTools: remove reference to CFPriv.h

Fixes build on aarch64-darwin.
This commit is contained in:
Andrew Childs 2021-04-19 13:11:17 +09:00
parent c022642fec
commit 3706fe567b
2 changed files with 24 additions and 1 deletions

View file

@ -8,7 +8,11 @@ stdenv.mkDerivation rec {
sha256 = "0hh4jl590jv3v830p77r3jcrnpndy7p2b8ajai3ldpnx2913jfhp";
};
patchPhase = ''
patches = [
./sw_vers-CFPriv.patch
];
postPatch = ''
substituteInPlace Makefile \
--replace gcc cc
'';

View file

@ -0,0 +1,19 @@
--- a/sw_vers.c 2021-04-19 13:06:50.131346864 +0900
+++ b/sw_vers.c 2021-04-19 13:07:32.481967474 +0900
@@ -28,7 +28,15 @@
*/
#include <CoreFoundation/CoreFoundation.h>
-#include <CoreFoundation/CFPriv.h>
+
+// Avoid dependency on CoreFoundation/CFPriv, which no longer appears to be
+// part of the upstream sdk.
+
+CFDictionaryRef _CFCopyServerVersionDictionary(void);
+CFDictionaryRef _CFCopySystemVersionDictionary(void);
+extern CFStringRef _kCFSystemVersionProductNameKey;
+extern CFStringRef _kCFSystemVersionProductVersionKey;
+extern CFStringRef _kCFSystemVersionBuildVersionKey;
void usage(char *progname) {
fprintf(stderr, "Usage: %s [-productName|-productVersion|-buildVersion]\n", progname);