Files
nixpkgs/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

87 lines
1.7 KiB
Nix

{
lib,
apple-sdk,
bison,
flex,
libxo,
mkAppleDerivation,
ncurses,
pkg-config,
stdenvNoCC,
}:
let
Libc = apple-sdk.sourceRelease "Libc";
libplatform = apple-sdk.sourceRelease "libplatform";
xnu = apple-sdk.sourceRelease "xnu";
privateHeaders = stdenvNoCC.mkDerivation {
name = "adv_cmds-deps-private-headers";
buildCommand = ''
install -D -m644 -t "$out/include" \
'${libplatform}/private/_simple.h' \
'${Libc}/nls/FreeBSD/msgcat.h'
install -D -m644 -t "$out/include/System/sys" \
'${xnu}/bsd/sys/persona.h' \
'${xnu}/bsd/sys/proc.h'
'';
};
in
mkAppleDerivation {
releaseName = "adv_cmds";
outputs = [
"out"
"ps"
"man"
];
xcodeHash = "sha256-2p/JyMPw6acHphvzkaJXPXGwxCUEoxryCejww5kPHvQ=";
postPatch = ''
# Meson generators require using @BASENAME@ in the output.
substituteInPlace mklocale/lex.l \
--replace-fail y.tab.h yacc.tab.h
substituteInPlace genwrap/lex.l \
--replace-fail y.tab.h genwrap.tab.h
substituteInPlace colldef/scan.l \
--replace-fail y.tab.h parse.tab.h
find localedef -name '*.c' -exec sed -e 's/parser.h/parser.tab.h/' -i {} \;
# Fix paths to point to the store
for file in genwrap.c genwrap.8; do
substituteInPlace genwrap/$file \
--replace-fail '/usr/local' "$out"
done
'';
env.NIX_CFLAGS_COMPILE = "-I${privateHeaders}/include";
buildInputs = [
libxo
ncurses
];
nativeBuildInputs = [
bison
flex
pkg-config
];
postInstall = ''
moveToOutput bin/ps "$ps"
ln -s "$ps/bin/ps" "$out/bin/ps"
'';
meta = {
description = "Advanced commands package for Darwin";
license = [
lib.licenses.apsl10
lib.licenses.apsl20
];
};
}