From 32f5febdc38d737ff6a6a36a8837eff6e3074ce7 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Sat, 21 Sep 2024 23:39:55 -0400 Subject: [PATCH] darwin.file_cmds: 264.1.1 -> 448.0.3 https://github.com/apple-oss-distributions/file_cmds/compare/file_cmds-264.1.1...file_cmds-448.0.3 --- .../file_cmds/meson.build.in | 12 +++++-- .../file_cmds/package.nix | 4 ++- ...-missing-ifdef-for-private-APFS-APIs.patch | 33 +++++++++++++++++++ .../apple-source-releases/versions.json | 4 +-- 4 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 pkgs/os-specific/darwin/apple-source-releases/file_cmds/patches/0002-Add-missing-ifdef-for-private-APFS-APIs.patch diff --git a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/meson.build.in b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/meson.build.in index c7a6047e6a43..170f9ac24243 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/meson.build.in +++ b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/meson.build.in @@ -3,7 +3,10 @@ # Project settings project('file_cmds', 'c', version : '@version@') - +add_global_arguments( + '-DTARGET_OS_BRIDGE=0', + language : 'c', +) # Dependencies cc = meson.get_compiler('c') @@ -210,9 +213,14 @@ install_symlink( executable( 'install-bin', # Meson reserves the name “install”, so use a different name and rename in install phase. + c_args : utimensat_c_args, dependencies : [ copyfile ], install : true, - sources: [ 'install/xinstall.c' ], + link_args : compat_link_args, + sources: [ + 'install/xinstall.c', + utimensat_sources, + ], ) install_man('install/install.1') diff --git a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/package.nix b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/package.nix index 829e9c0ac1e0..a4751bf0757a 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/package.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/package.nix @@ -101,11 +101,13 @@ mkAppleDerivation { "xattr" ]; - xcodeHash = "sha256-Q5Pw/Tl1Ar47VsoIxR229GabyDcA11sTrLtE/A3k2gg="; + xcodeHash = "sha256-u23AoLa7J0eFtf4dXKkVO59eYL2I3kRsHcWPfT03MCU="; patches = [ # Fixes build of ls ./patches/0001-Add-missing-extern-unix2003_compat-to-ls.patch + # Add missing conditional to avoid using private APFS APIs that we lack headers for using. + ./patches/0002-Add-missing-ifdef-for-private-APFS-APIs.patch # Add implementations of missing functions for older SDKs ./patches/0003-Add-implementations-of-missing-APIs-for-older-SDKs.patch ]; diff --git a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/patches/0002-Add-missing-ifdef-for-private-APFS-APIs.patch b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/patches/0002-Add-missing-ifdef-for-private-APFS-APIs.patch new file mode 100644 index 000000000000..d353afbe5636 --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/patches/0002-Add-missing-ifdef-for-private-APFS-APIs.patch @@ -0,0 +1,33 @@ +From c40768a7a0cd4bcc75a408880e79135ad33292b5 Mon Sep 17 00:00:00 2001 +From: Randy Eckenrode +Date: Sat, 7 Sep 2024 09:44:20 -0400 +Subject: [PATCH 2/3] Add missing #ifdef for private APFS APIs + +--- + mtree/commoncrypto.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/mtree/commoncrypto.c b/mtree/commoncrypto.c +index 75790dd..e04d1c6 100644 +--- a/mtree/commoncrypto.c ++++ b/mtree/commoncrypto.c +@@ -254,6 +254,7 @@ get_xdstream_privateid(char *path, char *buf) { + nextName += strlen(name) + 1; + } + ++#ifdef APFSIOC_XDSTREAM_OBJ_ID + for (int i = 0; i < xattrIndex; i++) { + char *name = xattrs[i]; + // System volume has stream based xattrs only in form of resource forks +@@ -275,7 +276,7 @@ get_xdstream_privateid(char *path, char *buf) { + } + } + } +- ++#endif + ai->xdstream_priv_id = xd_obj_id; + // insert a dummy value as digest is not used in presence of mflag + ai->digest = "authapfs"; +-- +2.46.0 + diff --git a/pkgs/os-specific/darwin/apple-source-releases/versions.json b/pkgs/os-specific/darwin/apple-source-releases/versions.json index 67ef833a213c..86cb880470b9 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/versions.json +++ b/pkgs/os-specific/darwin/apple-source-releases/versions.json @@ -44,8 +44,8 @@ "version": "66" }, "file_cmds": { - "hash": "sha256-JYy6HwmultKeZtLfaysbsyLoWg+OaTh7eJu54JkJC0Q=", - "version": "264.1.1" + "hash": "sha256-/79jS//IBZiQBumGA60lKDmddQCzl/r8QnviD6lGXNg=", + "version": "448.0.3" }, "libiconv": { "hash": "sha256-TGt6rsU52ztfW2rCqwnhMAExLbexI/59IoDOGY+XGu0=",