push sheeet
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

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,223 @@
# Build settings based on the upstream Xcode project.
# See: https://github.com/apple-oss-distributions/diskdev_cmds/blob/main/diskdev_cmds.xcodeproj/project.pbxproj
# Project settings
project('diskdev_cmds', 'c', 'objc', version : '@version@')
# Dependencies
cc = meson.get_compiler('c')
apfs = dependency('appleframeworks', modules : 'APFS')
removefile = cc.find_library('removefile')
# Static Libraries
libdisk = declare_dependency(
include_directories : 'disklib',
link_with : static_library(
'disk',
include_directories : 'disklib',
sources : [
'disklib/dkcksum.c',
'disklib/dkdisklabel.c',
'disklib/dkopen.c',
'disklib/dksecsize.c',
'disklib/fskit_support.m',
'disklib/preen.c',
'disklib/vfslist.c',
],
),
)
# Binaries
# Note: newfs_fskit and fsck_fskit require private entitlements. They are not built.
executable(
'dev_mkdb',
install : true,
sources : [ 'dev_mkdb.tproj/dev_mkdb.c' ],
)
install_man('dev_mkdb.tproj/dev_mkdb.8')
executable(
'dirs_cleaner',
dependencies : [ removefile ],
install : true,
install_dir : get_option('libexecdir'),
sources : [ 'dirs_cleaner/dirs_cleaner.c' ],
)
install_man('dirs_cleaner/dirs_cleaner.8')
executable(
'edquota',
dependencies : [ libdisk ],
install : true,
sources : [ 'edquota.tproj/edquota.c' ],
)
install_man('edquota.tproj/edquota.8')
executable(
'fdisk',
install : true,
sources : [
'fdisk.tproj/auto.c',
'fdisk.tproj/cmd.c',
'fdisk.tproj/disk.c',
'fdisk.tproj/fdisk.c',
'fdisk.tproj/getrawpartition.c',
'fdisk.tproj/mbr.c',
'fdisk.tproj/misc.c',
'fdisk.tproj/opendev.c',
'fdisk.tproj/part.c',
'fdisk.tproj/user.c',
],
)
install_man('fdisk.tproj/fdisk.8')
executable(
'fsck',
include_directories : [ 'edt_fstab', 'fsck.tproj' ],
install : true,
sources : [
'edt_fstab/edt_fstab.c',
'fsck.tproj/fsck.c',
],
)
install_man('fsck.tproj/fsck.8')
foreach fstyp : [ 'fstyp', 'fstyp_msdos', 'fstyp_ntfs', 'fstyp_udf' ]
executable(
f'@fstyp@',
install : true,
sources : [ f'fstyp.tproj/@fstyp@.c' ],
)
install_man(f'fstyp.tproj/@fstyp@.8')
endforeach
install_man('fuser.tproj/fuser.1')
executable(
'mount',
c_args : [
# https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/bsd/sys/mount.h#L107
'-DMNT_EXT_ROOT_DATA_VOL=0x00000001',
# https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/bsd/sys/mount.h#L108
'-DMNT_EXT_FSKIT=0x00000002',
# https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/bsd/sys/mount.h#L337
'-DMNT_NOFOLLOW=0x08000000',
# https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/bsd/sys/mount.h#L340
'-DMNT_STRICTATIME=0x80000000',
# https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/bsd/sys/attr.h#L300
'-DVOL_CAP_FMT_SEALED=0x02000000',
],
dependencies : [ apfs, libdisk ],
include_directories : [ 'edt_fstab', 'fsck.tproj', 'mount_flags_dir' ],
install : true,
link_args : host_machine.cpu_family() == 'x86_64' ? [ '-Wl,-undefined,dynamic_lookup' ] : [ ],
sources : [
'edt_fstab/edt_fstab.c',
'mount.tproj/mount.c',
'mount.tproj/mount_tmpfs.c',
'mount_flags_dir/mount_flags.c',
],
)
install_man(
'mount.tproj/fstab.5',
'mount.tproj/mount.8',
)
# executable(
# 'mount_devfs',
# install : true,
# sources : [ 'mount_devfs.tproj/mount_devfs.c' ],
# )
# executable(
# 'mount_fdesc',
# install : true,
# sources : [ 'mount_fdesc.tproj/mount_fdesc.c' ],
# )
# install_man('mount_fdesc.tproj/mount_fdesc.8')
executable(
'quota',
install : true,
sources : [ 'quota.tproj/quota.c' ],
)
install_man('quota.tproj/quota.1')
executable(
'quotacheck',
dependencies : [ libdisk ],
install : true,
sources : [
'quotacheck.tproj/hfs_quotacheck.c',
'quotacheck.tproj/quotacheck.c',
],
)
install_man('quotacheck.tproj/quotacheck.8')
executable(
'quotaon',
install : true,
sources : [ 'quotaon.tproj/quotaon.c' ],
)
install_man('quotaon.tproj/quotaon.8')
install_symlink(
'quotaoff',
install_dir : get_option('bindir'),
pointing_to : 'quotaon',
)
executable(
'repquota',
install : true,
sources : [ 'repquota.tproj/repquota.c' ],
)
install_man('repquota.tproj/repquota.8')
executable(
'setclass',
install : true,
sources : [ 'setclass.tproj/setclass.c' ],
)
install_man('setclass.tproj/setclass.8')
# tmp_cleaner
install_man('tmp_cleaner/tmp_cleaner.8')
executable(
'umount',
dependencies : [ libdisk ],
include_directories : 'edt_fstab',
install : true,
sources : [
'edt_fstab/edt_fstab.c',
'umount.tproj/umount.c',
],
)
install_man('umount.tproj/umount.8')
executable(
'vsdbutil',
c_args : [
# https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/bsd/sys/mount.h#L107
'-DMNT_EXT_ROOT_DATA_VOL=0x00000001',
# https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/bsd/sys/mount.h#L108
'-DMNT_EXT_FSKIT=0x00000002',
# https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/bsd/sys/mount.h#L337
'-DMNT_NOFOLLOW=0x08000000',
# https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/bsd/sys/mount.h#L340
'-DMNT_STRICTATIME=0x80000000',
# https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/bsd/sys/attr.h#L300
'-DVOL_CAP_FMT_SEALED=0x02000000',
],
dependencies : [ apfs ],
install : true,
sources : [
'mount_flags_dir/mount_flags.c',
'vsdbutil.tproj/vsdbutil_main.c',
],
)
install_man('vsdbutil.tproj/vsdbutil.8')

View File

@@ -0,0 +1,68 @@
{
lib,
apple-sdk,
libutil,
mkAppleDerivation,
removefile,
stdenvNoCC,
}:
let
Libc = apple-sdk.sourceRelease "Libc";
xnu = apple-sdk.sourceRelease "xnu";
privateHeaders = stdenvNoCC.mkDerivation {
name = "diskdev_cmds-deps-private-headers";
buildCommand = ''
for dir in arm i386 machine sys; do
install -D -t "$out/include/$dir" '${xnu}'"/bsd/$dir/disklabel.h"
done
install -D -t "$out/include/os" \
'${Libc}/os/api.h' \
'${Libc}/os/variant_private.h' \
'${Libc}/libdarwin/h/bsd.h' \
'${Libc}/libdarwin/h/errno.h'
install -D -t "$out/include/System/sys" \
'${xnu}/bsd/sys/fsctl.h' \
'${xnu}/bsd/sys/reason.h'
install -D -t "$out/include/System/uuid" \
'${Libc}/uuid/namespace.h'
mkdir -p "$out/include/APFS"
touch "$out/include/APFS/APFS.h"
touch "$out/include/APFS/APFSConstants.h"
substituteInPlace "$out/include/os/variant_private.h" \
--replace-fail ', bridgeos(4.0)' "" \
--replace-fail ', bridgeos' ""
'';
};
in
mkAppleDerivation {
releaseName = "diskdev_cmds";
outputs = [
"out"
"man"
];
xcodeHash = "sha256-P2dg3B5pU2ayasMHIM5nI0iG+YDdYQNcEpnJzZxm1kw=";
postPatch =
# Fix incompatible pointer to integer conversion. The last parameter is size_t not a pointer.
# https://developer.apple.com/documentation/kernel/1387446-sysctlbyname
''
substituteInPlace mount.tproj/mount.c \
--replace-fail 'sysctlbyname ("vfs.generic.apfs.rosp", &is_rosp, &rospsize, NULL, NULL);' 'sysctlbyname ("vfs.generic.apfs.rosp", &is_rosp, &rospsize, NULL, 0);'
'';
env.NIX_CFLAGS_COMPILE = "-I${privateHeaders}/include";
buildInputs = [
apple-sdk.privateFrameworksHook
libutil
removefile
];
meta.description = "Disk commands for Darwin";
}