diff options
| author | Emily <vcs@emily.moe> | 2024-10-05 19:09:03 +0100 |
|---|---|---|
| committer | Emily <vcs@emily.moe> | 2024-11-07 23:05:26 +0000 |
| commit | 39d8a91ddf809990dab8ba0c4782e913b0ef10fa (patch) | |
| tree | 0fa4f86906c3c5ab5e6c17d557b835809eb9895f | |
| parent | darwin.removefile: remove code for macOS < 11 (diff) | |
| download | nixpkgs-39d8a91ddf809990dab8ba0c4782e913b0ef10fa.tar.gz | |
darwin.shell_cmds: remove code for macOS < 11
| -rw-r--r-- | pkgs/os-specific/darwin/apple-source-releases/shell_cmds/meson.build.in | 3 | ||||
| -rw-r--r-- | pkgs/os-specific/darwin/apple-source-releases/shell_cmds/package.nix | 62 |
2 files changed, 18 insertions, 47 deletions
diff --git a/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/meson.build.in b/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/meson.build.in index 33612f0cd1f9..d3582b5013f3 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/meson.build.in +++ b/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/meson.build.in @@ -15,7 +15,6 @@ host_cxx = meson.get_compiler('cpp') # pam = cc.find_library('pam') -libbsd = dependency('libbsd-overlay', required : false) libedit = dependency('libedit') libresolv = host_cc.find_library('resolv') libsbuf = host_cc.find_library('sbuf') @@ -259,7 +258,6 @@ endforeach executable( 'lockf', - dependencies : [ libbsd ], install : true, sources : [ 'lockf/lockf.c' ], ) @@ -415,7 +413,6 @@ install_man('who/who.1') executable( 'xargs', - dependencies : [ libbsd ], include_directories : 'xargs', install : true, sources : [ diff --git a/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/package.nix b/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/package.nix index 98c83c1b6306..9d8cd9be2e53 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/package.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/package.nix @@ -4,7 +4,6 @@ bison, clang, fetchurl, - libbsd, libedit, libresolv, libsbuf, @@ -17,15 +16,6 @@ let # nohup requires vproc_priv.h from launchd launchd = apple-sdk.sourceRelease "launchd"; - - oldTime_c = fetchurl { - url = "https://github.com/apple-oss-distributions/shell_cmds/raw/shell_cmds-207.11.1/time/time.c"; - hash = "sha256-f7aRwIaKq6r37jpw0V+1Z/sZs5Rm7vy2S774HNBnwmY="; - }; - oldTime_1 = fetchurl { - url = "https://github.com/apple-oss-distributions/shell_cmds/raw/shell_cmds-207.11.1/time/time.1"; - hash = "sha256-ZIbNJPHLQVGq2tdUB6j0DEp9Hie+XUZkfuQm676Vpwc="; - }; in mkAppleDerivation { releaseName = "shell_cmds"; @@ -37,31 +27,18 @@ mkAppleDerivation { xcodeHash = "sha256-26N7AZV/G+ryc2Nu1v91rEdb1a6jDpnj6t5rzEG2YA4="; - postPatch = - '' - # Fix `mktemp` templates - substituteInPlace sh/mkbuiltins \ - --replace-fail '-t ka' '-t ka.XXXXXX' - substituteInPlace sh/mktokens \ - --replace-fail '-t ka' '-t ka.XXXXXX' + postPatch = '' + # Fix `mktemp` templates + substituteInPlace sh/mkbuiltins \ + --replace-fail '-t ka' '-t ka.XXXXXX' + substituteInPlace sh/mktokens \ + --replace-fail '-t ka' '-t ka.XXXXXX' - # Update `/etc/locate.rc` paths to point to the store. - for path in locate/locate/locate.updatedb.8 locate/locate/locate.rc locate/locate/updatedb.sh; do - substituteInPlace $path --replace-fail '/etc/locate.rc' "$out/etc/locate.rc" - done - '' - # Use an older version of `time.c` that’s compatible with the 10.12 SDK. - + lib.optionalString (lib.versionOlder (lib.getVersion apple-sdk) "10.13") '' - cp '${oldTime_c}' time/time.c - cp '${oldTime_1}' time/time.1 - '' - + lib.optionalString (lib.versionOlder (lib.getVersion apple-sdk) "11.0") '' - # `rpmatch` was added in 11.0, so revert it to a simpler check on older SDKs. - substituteInPlace find/misc.c \ - --replace-fail 'return (rpmatch(resp) == 1);' "return (resp[0] == 'y');" - # Add missing header for older SDKs. - sed -e '1i #include <sys/time.h>' -i w/proc_compare.c - ''; + # Update `/etc/locate.rc` paths to point to the store. + for path in locate/locate/locate.updatedb.8 locate/locate/locate.rc locate/locate/updatedb.sh; do + substituteInPlace $path --replace-fail '/etc/locate.rc' "$out/etc/locate.rc" + done + ''; env.NIX_CFLAGS_COMPILE = "-I${launchd}/liblaunch"; @@ -72,16 +49,13 @@ mkAppleDerivation { pkg-config ]; - buildInputs = - [ - libedit - libresolv - libsbuf - libutil - libxo - ] - # xargs needs `strtonum`, which was added in 11.0. - ++ lib.optionals (lib.versionOlder (lib.getVersion apple-sdk) "11.0") [ libbsd ]; + buildInputs = [ + libedit + libresolv + libsbuf + libutil + libxo + ]; postInstall = '' # Patch the shebangs to use `sh` from shell_cmds. |
