diff options
Diffstat (limited to 'pkgs/os-specific/darwin/pam-reattach/default.nix')
-rw-r--r-- | pkgs/os-specific/darwin/pam-reattach/default.nix | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/pkgs/os-specific/darwin/pam-reattach/default.nix b/pkgs/os-specific/darwin/pam-reattach/default.nix index 4350865080f00..b077ac031b62c 100644 --- a/pkgs/os-specific/darwin/pam-reattach/default.nix +++ b/pkgs/os-specific/darwin/pam-reattach/default.nix @@ -1,5 +1,8 @@ { lib, stdenv, fetchFromGitHub, cmake, openpam, darwin }: +let + sdkOlderThan11 = lib.versionOlder stdenv.hostPlatform.darwinSdkVersion "11.0"; +in stdenv.mkDerivation rec { pname = "pam_reattach"; version = "1.3"; @@ -12,17 +15,12 @@ stdenv.mkDerivation rec { }; cmakeFlags = [ - "-DCMAKE_OSX_ARCHITECTURES=${ - if stdenv.hostPlatform.system == "x86_64-darwin" then - "x86_64" - else - "arm64" - }" + "-DCMAKE_OSX_ARCHITECTURES=${stdenv.hostPlatform.darwinArch}" "-DENABLE_CLI=ON" - ] ++ lib.optional (!stdenv.isAarch64) "-DCMAKE_LIBRARY_PATH=${darwin.apple_sdk.sdk}/usr/lib"; + ] ++ lib.optional sdkOlderThan11 "-DCMAKE_LIBRARY_PATH=${darwin.apple_sdk.sdk}/usr/lib"; buildInputs = [ openpam ] - ++ lib.optional (!stdenv.isAarch64) darwin.apple_sdk.sdk; + ++ lib.optional sdkOlderThan11 darwin.apple_sdk.sdk; nativeBuildInputs = [ cmake ]; |