From da3ae0231aa2433f6f3711e57020456dc27e26e5 Mon Sep 17 00:00:00 2001 From: Ivan Babrou Date: Fri, 5 Feb 2021 23:00:44 -0800 Subject: [PATCH] apple-source-releases: make it compile on aarch64 --- .../darwin/apple-source-releases/system_cmds/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix index 34d093b7cc00..d42d142ef6ee 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix @@ -1,5 +1,5 @@ { stdenv, appleDerivation, lib -, Librpcsvc, apple_sdk, pam, CF, openbsm }: +, libutil, Librpcsvc, apple_sdk, pam, CF, openbsm }: appleDerivation { # xcbuild fails with: @@ -7,7 +7,7 @@ appleDerivation { # see issue facebook/xcbuild#188 # buildInputs = [ xcbuild ]; - buildInputs = [ Librpcsvc apple_sdk.frameworks.OpenDirectory pam CF + buildInputs = [ libutil Librpcsvc apple_sdk.frameworks.OpenDirectory pam CF apple_sdk.frameworks.IOKit openbsm ]; # NIX_CFLAGS_COMPILE = lib.optionalString hostPlatform.isi686 "-D__i386__" # + lib.optionalString hostPlatform.isx86_64 "-D__x86_64__" @@ -35,6 +35,11 @@ appleDerivation { --replace bsm/audit_session.h bsm/audit.h substituteInPlace login.tproj/login_audit.c \ --replace bsm/audit_session.h bsm/audit.h + '' + lib.optionalString stdenv.isAarch64 '' + substituteInPlace sysctl.tproj/sysctl.c \ + --replace "GPROF_STATE" "0" + substituteInPlace login.tproj/login.c \ + --replace "defined(__arm__)" "defined(__arm__) || defined(__arm64__)" ''; buildPhase = ''