10 # The 10.12 SDK doesn’t have the files needed in the same places or possibly at all.
11 # Just use the 11.x SDK to make things easier.
12 xnu = apple-sdk_11.sourceRelease "xnu";
14 privateHeaders = stdenvNoCC.mkDerivation {
15 name = "removefile-deps-private-headers";
18 mkdir -p "$out/include/apfs"
19 # APFS group is 'J' per https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/bsd/vfs/vfs_fsevents.c#L1054
20 cat <<EOF > "$out/include/apfs/apfs_fsctl.h"
23 #include <sys/ioccom.h>
24 struct xdstream_obj_id {
26 uint64_t xdi_xdtream_obj_id;
28 #define APFS_CLEAR_PURGEABLE 0
29 #define APFSIOC_MARK_PURGEABLE _IOWR('J', 68, uint64_t)
30 #define APFSIOC_XDSTREAM_OBJ_ID _IOR('J', 35, struct xdstream_obj_id)
36 releaseName = "removefile";
44 xcodeHash = "sha256-pE92mVI0KTHOVKBA4T5R1rHy5//uipOimas7DaTVe0U=";
47 # Disable experimental bounds safety stuff that’s not available in LLVM 16.
48 substituteInPlace removefile.h \
49 --replace-fail '__ptrcheck_abi_assume_single()' "" \
50 --replace-fail '__unsafe_indexable' ""
53 env.NIX_CFLAGS_COMPILE = "-I${privateHeaders}/include";
55 meta.description = "Darwin file removing library";