diff --git a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/meson.build.in b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/meson.build.in index 69b7d270f17b..66fa5116bf0d 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/meson.build.in +++ b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/meson.build.in @@ -4,8 +4,6 @@ # Project settings project('adv_cmds', 'c', 'cpp', version : '@version@') -sdk_version = get_option('sdk_version') - # Dependencies cc = meson.get_compiler('c') @@ -190,8 +188,7 @@ install_man('ps/ps.1') executable( 'stty', - build_by_default : sdk_version.version_compare('>=11.3'), - install : sdk_version.version_compare('>=11.3'), + install : true, sources : [ 'stty/cchar.c', 'stty/gfmt.c', @@ -202,9 +199,7 @@ executable( 'stty/util.c', ], ) -if sdk_version.version_compare('>=11.3') - install_man('stty/stty.1') -endif +install_man('stty/stty.1') executable( 'tabs', diff --git a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/meson.options b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/meson.options deleted file mode 100644 index 8c4ce874c64c..000000000000 --- a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/meson.options +++ /dev/null @@ -1 +0,0 @@ -option('sdk_version', type : 'string') diff --git a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/package.nix b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/package.nix index 646351716678..f994ab88d029 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/package.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/package.nix @@ -1,7 +1,6 @@ { lib, apple-sdk, - apple-sdk_11, bison, flex, libxo, @@ -12,9 +11,9 @@ }: let - Libc = apple-sdk_11.sourceRelease "Libc"; - libplatform = apple-sdk_11.sourceRelease "libplatform"; - xnu = apple-sdk_11.sourceRelease "xnu"; + Libc = apple-sdk.sourceRelease "Libc"; + libplatform = apple-sdk.sourceRelease "libplatform"; + xnu = apple-sdk.sourceRelease "xnu"; privateHeaders = stdenvNoCC.mkDerivation { name = "adv_cmds-deps-private-headers"; @@ -41,11 +40,6 @@ mkAppleDerivation { xcodeHash = "sha256-2p/JyMPw6acHphvzkaJXPXGwxCUEoxryCejww5kPHvQ="; - patches = [ - # Use older API when running on systems prior to 11.3. - ./patches/0001-Fall-back-to-task_read_pid-on-older-systems.patch - ]; - postPatch = '' # Meson generators require using @BASENAME@ in the output. substituteInPlace mklocale/lex.l \ @@ -67,8 +61,6 @@ mkAppleDerivation { env.NIX_CFLAGS_COMPILE = "-I${privateHeaders}/include"; buildInputs = [ - # Use the 11.3 SDK because CMake depends on adv_cmds.ps, so it can’t simply be omitted when using an older SDK. - apple-sdk_11 libxo ncurses ]; @@ -79,12 +71,6 @@ mkAppleDerivation { pkg-config ]; - mesonFlags = [ - # Even though adv_cmds is built with a newer SDK, the default SDK is still the deployment target. - # Don’t build packages that use newer APIs unnecessarily. - (lib.mesonOption "sdk_version" (lib.getVersion apple-sdk)) - ]; - postInstall = '' moveToOutput bin/ps "$ps" ln -s "$ps/bin/ps" "$out/bin/ps" diff --git a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/patches/0001-Fall-back-to-task_read_pid-on-older-systems.patch b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/patches/0001-Fall-back-to-task_read_pid-on-older-systems.patch deleted file mode 100644 index 8e5f344f6490..000000000000 --- a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/patches/0001-Fall-back-to-task_read_pid-on-older-systems.patch +++ /dev/null @@ -1,38 +0,0 @@ -From c05a83d29349c6ae2fd8084a48ea51c8e8bf23f2 Mon Sep 17 00:00:00 2001 -From: Randy Eckenrode -Date: Sun, 18 Aug 2024 10:29:16 -0400 -Subject: [PATCH] Fall back to `task_read_pid` on older systems - ---- - ps/tasks.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/ps/tasks.c b/ps/tasks.c -index d2fcb07..068c985 100644 ---- a/ps/tasks.c -+++ b/ps/tasks.c -@@ -25,8 +25,6 @@ - #include - #include - --extern kern_return_t task_read_for_pid(task_port_t task, pid_t pid, task_port_t *target); -- - #define STATE_MAX 7 - - int -@@ -98,7 +96,11 @@ int get_task_info (KINFO *ki) - ki->state = STATE_MAX; - - pid = KI_PROC(ki)->p_pid; -- error = task_read_for_pid(mach_task_self(), pid, &ki->task); -+ if (__builtin_available(macos 11.3, *)) { -+ error = task_read_for_pid(mach_task_self(), pid, &ki->task); -+ } else { -+ error = task_for_pid(mach_task_self(), pid, &ki->task); -+ } - if (error != KERN_SUCCESS) { - #ifdef DEBUG - mach_error("Error calling task_read_for_pid()", error); --- -2.44.1 - diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 63050dd3f423..46157f4385d3 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -681,12 +681,6 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check postLinkSignHook = prevStage.darwin.postLinkSignHook.override { inherit (selfDarwin) sigtool; }; - adv_cmds = superDarwin.adv_cmds.override { - # Break an infinite recursion between CMake and libtapi. CMake requires adv_cmds.ps, and adv_cmds - # requires a newer SDK that requires libtapi to build, which requires CMake. - inherit (prevStage) apple-sdk_11; - }; - # Rewrap binutils with the real libSystem binutils = superDarwin.binutils.override { inherit (self) coreutils;