Merge pull request #263778 from reckenrode/diskdev_cmds-fix

darwin.diskdev_cmds: fix build with clang 16
This commit is contained in:
Weijia Wang
2023-10-27 17:02:36 +02:00
committed by GitHub
2 changed files with 17 additions and 1 deletions
@@ -5,12 +5,17 @@ let
xnu-src = if stdenv.isAarch64 then macosPackages_11_0_1.xnu.src else xnu.src;
arch = if stdenv.isAarch64 then "arm" else "i386";
in appleDerivation {
patches = [
# Fixes a build failure with newer versions of clang that make implicit int an error.
./fix-implicit-int.patch
];
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ libutil ];
env.NIX_CFLAGS_COMPILE = "-I.";
NIX_LDFLAGS = "-lutil";
patchPhase = ''
prePatch = ''
# ugly hacks for missing headers
# most are bsd related - probably should make this a drv
unpackFile ${Libc.src}
@@ -0,0 +1,11 @@
diff -ur a/diskdev_cmds.xcodeproj/project.pbxproj b/diskdev_cmds.xcodeproj/project.pbxproj
--- a/quota.tproj/quota.c 2021-10-06 01:13:40.000000000 -0400
+++ b/quota.tproj/quota.c 2023-10-27 08:24:05.960965958 -0400
@@ -115,6 +115,7 @@
int
main(argc, argv)
+ int argc;
char *argv[];
{
int ngroups;