treewide: only access apple_sdk.sdk when sdk < 11
update code to not assume that x64 darwin uses sdk 10.12. These changes want to reach into apple_sdk.sdk to grab a header file which is only required for sdk 10.12.
This commit is contained in:
@@ -236,8 +236,7 @@ in let
|
||||
# https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132
|
||||
++ lib.optional (
|
||||
stdenv.targetPlatform.isDarwin
|
||||
&& !stdenv.targetPlatform.isAarch64
|
||||
&& (lib.versionOlder darwin.apple_sdk.sdk.version "11.0")
|
||||
&& lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0"
|
||||
) ./lldb/cpu_subtype_arm64e_replacement.patch;
|
||||
};
|
||||
|
||||
|
||||
@@ -208,8 +208,7 @@ in let
|
||||
# https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132
|
||||
++ lib.optional (
|
||||
stdenv.targetPlatform.isDarwin
|
||||
&& !stdenv.targetPlatform.isAarch64
|
||||
&& (lib.versionOlder darwin.apple_sdk.sdk.version "11.0")
|
||||
&& lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0"
|
||||
) ./lldb/cpu_subtype_arm64e_replacement.patch;
|
||||
};
|
||||
|
||||
|
||||
@@ -250,8 +250,7 @@ in let
|
||||
# https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132
|
||||
++ lib.optional (
|
||||
stdenv.targetPlatform.isDarwin
|
||||
&& !stdenv.targetPlatform.isAarch64
|
||||
&& (lib.versionOlder darwin.apple_sdk.sdk.version "11.0")
|
||||
&& lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0"
|
||||
) ./lldb/cpu_subtype_arm64e_replacement.patch;
|
||||
};
|
||||
|
||||
|
||||
@@ -251,8 +251,7 @@ in let
|
||||
# https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132
|
||||
++ lib.optional (
|
||||
stdenv.targetPlatform.isDarwin
|
||||
&& !stdenv.targetPlatform.isAarch64
|
||||
&& (lib.versionOlder darwin.apple_sdk.sdk.version "11.0")
|
||||
&& lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0"
|
||||
) ./lldb/cpu_subtype_arm64e_replacement.patch;
|
||||
};
|
||||
|
||||
|
||||
@@ -235,8 +235,7 @@ in let
|
||||
# https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132
|
||||
++ lib.optional (
|
||||
stdenv.targetPlatform.isDarwin
|
||||
&& !stdenv.targetPlatform.isAarch64
|
||||
&& (lib.versionOlder darwin.apple_sdk.sdk.version "11.0")
|
||||
&& lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0"
|
||||
) ./lldb/cpu_subtype_arm64e_replacement.patch;
|
||||
};
|
||||
|
||||
|
||||
@@ -234,8 +234,7 @@ in let
|
||||
# https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132
|
||||
++ lib.optional (
|
||||
stdenv.targetPlatform.isDarwin
|
||||
&& !stdenv.targetPlatform.isAarch64
|
||||
&& (lib.versionOlder darwin.apple_sdk.sdk.version "11.0")
|
||||
&& lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0"
|
||||
) ./lldb/cpu_subtype_arm64e_replacement.patch;
|
||||
};
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ stdenv.mkDerivation (rec {
|
||||
++ lib.optional
|
||||
(
|
||||
stdenv.targetPlatform.isDarwin
|
||||
&& !stdenv.targetPlatform.isAarch64
|
||||
&& lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0"
|
||||
&& (lib.versionAtLeast release_version "15")
|
||||
)
|
||||
(
|
||||
|
||||
@@ -239,8 +239,7 @@ in let
|
||||
# https://github.com/NixOS/nixpkgs/pull/194634#issuecomment-1272129132
|
||||
++ lib.optional (
|
||||
stdenv.targetPlatform.isDarwin
|
||||
&& !stdenv.targetPlatform.isAarch64
|
||||
&& (lib.versionOlder darwin.apple_sdk.sdk.version "11.0")
|
||||
&& lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0"
|
||||
) ./lldb/cpu_subtype_arm64e_replacement.patch;
|
||||
};
|
||||
|
||||
|
||||
@@ -151,7 +151,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
libedit
|
||||
readline
|
||||
] ++ lib.optional (stdenv.isDarwin && !stdenv.isAarch64) (
|
||||
] ++ lib.optional (stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinSdkVersion "11.0") (
|
||||
# this can likely be removed as:
|
||||
# "libproc.h is included in the 10.12 SDK Libsystem and should be identical to this one."
|
||||
# but the package is marked broken on darwin so unable to test
|
||||
|
||||
# Pull a header that contains a definition of proc_pid_rusage().
|
||||
# (We pick just that one because using the other headers from `sdk` is not
|
||||
# compatible with our C++ standard library. This header is already in
|
||||
|
||||
@@ -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";
|
||||
@@ -19,10 +22,10 @@ stdenv.mkDerivation rec {
|
||||
"arm64"
|
||||
}"
|
||||
"-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 ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user