Merge pull request #179971 from jiegec/network-cmds-aarch64-darwin-staging

darwin.network_cmds: fix build on aarch64-darwin
This commit is contained in:
Uri Baghin 2022-08-02 12:36:20 +10:00 committed by GitHub
commit 3b62a2b3cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View file

@ -293,7 +293,9 @@ developerToolsPackages_11_3_1 // macosPackages_11_0_1 // {
diskdev_cmds = applePackage "diskdev_cmds" "osx-10.11.6" "1ssdyiaq5m1zfy96yy38yyknp682ki6bvabdqd5z18fa0rv3m2ar" {
macosPackages_11_0_1 = macosPackages_11_0_1;
};
network_cmds = applePackage "network_cmds" "osx-10.11.6" "0lhi9wz84qr1r2ab3fb4nvmdg9gxn817n5ldg7zw9gnf3wwn42kw" {};
network_cmds = if stdenv.isx86_64 then
applePackage "network_cmds" "osx-10.11.6" "0lhi9wz84qr1r2ab3fb4nvmdg9gxn817n5ldg7zw9gnf3wwn42kw" {}
else macosPackages_11_0_1.network_cmds;
file_cmds = applePackage "file_cmds" "osx-10.11.6" "1zfxbmasps529pnfdjvc13p7ws2cfx8pidkplypkswyff0nff4wp" {};
shell_cmds = applePackage "shell_cmds" "osx-10.11.6" "0084k271v66h4jqp7q7rmjvv7w4mvhx3aq860qs8jbd30canm86n" {};
system_cmds = applePackage "system_cmds" "osx-10.11.6" "1h46j2c5v02pkv5d9fyv6cpgyg0lczvwicrx6r9s210cl03l77jl" {};

View file

@ -1,11 +1,13 @@
{ lib, appleDerivation, xcbuildHook
{ lib, appleDerivation, xcbuildHook, stdenv
, libressl_3_4, Librpcsvc, xnu, libpcap, developer_cmds }:
appleDerivation {
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ libressl_3_4 xnu Librpcsvc libpcap developer_cmds ];
NIX_CFLAGS_COMPILE = " -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/";
# Work around error from <stdio.h> on aarch64-darwin:
# error: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
NIX_CFLAGS_COMPILE = "-Wno-error=undef-prefix -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/";
# "spray" requires some files that aren't compiling correctly in xcbuild.
# "rtadvd" seems to fail with some missing constants.
@ -16,6 +18,10 @@ appleDerivation {
--replace "7216D34D0EE89FEC00AE70E4 /* PBXTargetDependency */," "" \
--replace "72CD1D9C0EE8C47C005F825D /* PBXTargetDependency */," "" \
--replace "7216D2C20EE89ADF00AE70E4 /* PBXTargetDependency */," ""
'' + lib.optionalString stdenv.isAarch64 ''
# "unbound" does not build on aarch64
substituteInPlace network_cmds.xcodeproj/project.pbxproj \
--replace "71D958C51A9455A000C9B286 /* PBXTargetDependency */," ""
'';
# temporary install phase until xcodebuild has "install" support