Randy Eckenrode
2024-10-10 16:23:15 -04:00
parent a32fcaa3ca
commit 7b84d8950c
3 changed files with 42 additions and 12 deletions
@@ -15,18 +15,13 @@ 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')
libutil = host_cc.find_library('util')
libxo = dependency('libxo')
xargs_deps = [ ]
# Versions of macOS prior to 11.0 do not support `strtonum` or `rpmatch`
if not host_cc.has_function('strtonum', prefix : '#include <stdlib.h>')
xargs_deps += [ dependency('libbsd-overlay') ]
endif
# Generators
bison = generator(
@@ -52,7 +47,6 @@ single_file_cmds = [
'kill',
'killall',
'lastcomm',
'lockf',
'logname',
'mktemp',
'nice',
@@ -263,6 +257,14 @@ foreach manpage : [ 'concatdb', 'mklocatedb' ]
)
endforeach
executable(
'lockf',
dependencies : [ libbsd ],
install : true,
sources : [ 'lockf/lockf.c' ],
)
install_man('lockf/lockf.1')
# Building `sh` requires several custom targets to generate files it needs.
bash_bin = find_program('bash')
@@ -344,6 +346,13 @@ install_man('sh/sh.1')
# )
# install_man('su/su.1')
executable(
'stdbuf',
install : true,
sources : [ 'stdbuf/stdbuf.c' ],
)
install_man('stdbuf/stdbuf.1')
executable(
'[',
install : true,
@@ -406,7 +415,7 @@ install_man('who/who.1')
executable(
'xargs',
dependencies : xargs_deps,
dependencies : [ libbsd ],
include_directories : 'xargs',
install : true,
sources : [
@@ -2,8 +2,8 @@
lib,
apple-sdk,
bison,
buildPackages,
clang,
fetchurl,
libbsd,
libedit,
libresolv,
@@ -17,6 +17,15 @@
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";
@@ -26,7 +35,7 @@ mkAppleDerivation {
"man"
];
xcodeHash = "sha256-JXK5hIsNDjCh7n39IWvHK8O0A3ItBttDlnN1YmAn6y8=";
xcodeHash = "sha256-26N7AZV/G+ryc2Nu1v91rEdb1a6jDpnj6t5rzEG2YA4=";
postPatch =
''
@@ -40,6 +49,18 @@ mkAppleDerivation {
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` thats 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
'';
env.NIX_CFLAGS_COMPILE = "-I${launchd}/liblaunch";
@@ -92,8 +92,8 @@
"version": "75"
},
"shell_cmds": {
"hash": "sha256-kmEOprkiJGMVcl7yHkGX8ymk/5KjE99gWuF8j2hK5hY=",
"version": "187"
"hash": "sha256-bcu9NNS7NW5oc5yrOk+GxZcQo0AP0+mOnph9HhLdRts=",
"version": "319.0.1"
},
"system_cmds": {
"hash": "sha256-qFp9nkzsq9uQ7zoyfvO+3gvDlc7kaPvn6luvmO/Io30=",