Files
nixpkgs/pkgs/os-specific/darwin/apple-source-releases/removefile/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

53 lines
1.3 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
apple-sdk,
mkAppleDerivation,
stdenvNoCC,
}:
let
xnu = apple-sdk.sourceRelease "xnu";
privateHeaders = stdenvNoCC.mkDerivation {
name = "removefile-deps-private-headers";
buildCommand = ''
mkdir -p "$out/include/apfs"
# APFS group is 'J' per https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/bsd/vfs/vfs_fsevents.c#L1054
cat <<EOF > "$out/include/apfs/apfs_fsctl.h"
#pragma once
#include <stdint.h>
#include <sys/ioccom.h>
struct xdstream_obj_id {
char* xdi_name;
uint64_t xdi_xdtream_obj_id;
};
#define APFS_CLEAR_PURGEABLE 0
#define APFSIOC_MARK_PURGEABLE _IOWR('J', 68, uint64_t)
#define APFSIOC_XDSTREAM_OBJ_ID _IOR('J', 35, struct xdstream_obj_id)
EOF
'';
};
in
mkAppleDerivation {
releaseName = "removefile";
outputs = [
"out"
"dev"
"man"
];
xcodeHash = "sha256-pE92mVI0KTHOVKBA4T5R1rHy5//uipOimas7DaTVe0U=";
postPatch = ''
# Disable experimental bounds safety stuff thats not available in LLVM 16.
substituteInPlace removefile.h \
--replace-fail '__ptrcheck_abi_assume_single()' "" \
--replace-fail '__unsafe_indexable' ""
'';
env.NIX_CFLAGS_COMPILE = "-I${privateHeaders}/include";
meta.description = "Darwin file removing library";
}