From 6b6277ee90669e8e910fbf6dac2b20e35f9bbed5 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Mon, 2 Sep 2024 19:27:03 -0400 Subject: [PATCH] darwin.xnu: remove and replace with stubs --- .../darwin/apple-source-releases/default.nix | 3 - .../apple-source-releases/macos-11.0.1.nix | 1 - .../apple-source-releases/xnu/default.nix | 163 -- .../xnu/headers-10.12-x86_64.txt | 1320 --------------- .../xnu/headers-11.0-arm64.txt | 1488 ----------------- .../xnu/headers-11.0-x86_64.txt | 1481 ---------------- .../apple-source-releases/xnu/python3.patch | 41 - pkgs/top-level/darwin-packages.nix | 1 + 8 files changed, 1 insertion(+), 4497 deletions(-) delete mode 100644 pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix delete mode 100644 pkgs/os-specific/darwin/apple-source-releases/xnu/headers-10.12-x86_64.txt delete mode 100644 pkgs/os-specific/darwin/apple-source-releases/xnu/headers-11.0-arm64.txt delete mode 100644 pkgs/os-specific/darwin/apple-source-releases/xnu/headers-11.0-x86_64.txt delete mode 100644 pkgs/os-specific/darwin/apple-source-releases/xnu/python3.patch diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix index 2c7a1fc18427..a14ab36f4db8 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix @@ -265,9 +265,6 @@ developerToolsPackages_11_3_1 // macosPackages_11_0_1 // { libresolv = callPackage ./libresolv/package.nix { }; libutil = callPackage ./libutil/package.nix { }; removefile = callPackage ./removefile/package.nix { }; - xnu = if isSdk10_12 then - applePackage "xnu" "osx-10.12.6" "sha256-C8TPQlUT3RbzAy8YnZPNtr70hpaVG9Llv0h42s3NENI=" {} - else macosPackages_11_0_1.xnu; adv_cmds = callPackage ./adv_cmds/package.nix { }; basic_cmds = callPackage ./basic_cmds/package.nix { }; developer_cmds = callPackage ./developer_cmds/package.nix { }; diff --git a/pkgs/os-specific/darwin/apple-source-releases/macos-11.0.1.nix b/pkgs/os-specific/darwin/apple-source-releases/macos-11.0.1.nix index 36398ed16f1b..8a51894ef488 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/macos-11.0.1.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/macos-11.0.1.nix @@ -19,5 +19,4 @@ removefile = applePackage' "removefile" "49.40.3" "macos-11.0.1" "0870ihxpmvj8gg shell_cmds = applePackage' "shell_cmds" "216.40.4" "macos-11.0.1" "0wbysc9lwf1xgl686r3yn95rndcmqlp17zc1ig9gsl5fxyy5bghh" {}; text_cmds = applePackage' "text_cmds" "106" "macos-11.0.1" "17fn35m6i866zjrf8da6cq6crydp6vp4zq0aaab243rv1fx303yy" {}; top = applePackage' "top" "129" "macos-11.0.1" "0d9pqmv3mwkfcv7c05hfvnvnn4rbsl92plr5hsazp854pshzqw2k" {}; -xnu = applePackage' "xnu" "7195.50.7.100.1" "macos-11.0.1" "11zjmpw11rcc6a0xlbwramra1rsr65s4ypnxwpajgbr2c657lipl" {}; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix b/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix deleted file mode 100644 index 20a34e814d42..000000000000 --- a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix +++ /dev/null @@ -1,163 +0,0 @@ -{ appleDerivation', lib, stdenv, stdenvNoCC, buildPackages, pkgsBuildBuild -, bootstrap_cmds, bison, flex -, gnum4, unifdef, perl, python3 -, headersOnly ? true -}: - -appleDerivation' (if headersOnly then stdenvNoCC else stdenv) ( - let arch = if stdenv.hostPlatform.isx86_64 then "x86_64" else "arm64"; - in - { - depsBuildBuild = [ buildPackages.stdenv.cc ]; - - nativeBuildInputs = [ bootstrap_cmds bison flex gnum4 unifdef perl python3 ]; - - patches = lib.optionals (lib.versionOlder stdenv.hostPlatform.darwinSdkVersion "11") [ ./python3.patch ]; - - postPatch = '' - substituteInPlace Makefile \ - --replace "/bin/" "" \ - --replace "MAKEJOBS := " '# MAKEJOBS := ' - - substituteInPlace makedefs/MakeInc.cmd \ - --replace "/usr/bin/" "" \ - --replace "/bin/" "" \ - --replace "-Werror " "" - - substituteInPlace makedefs/MakeInc.def \ - --replace "-c -S -m" "-c -m" - - substituteInPlace makedefs/MakeInc.top \ - --replace "MEMORY_SIZE := " 'MEMORY_SIZE := 1073741824 # ' - - substituteInPlace libkern/kxld/Makefile \ - --replace "-Werror " "" - - substituteInPlace SETUP/kextsymboltool/Makefile \ - --replace "-lstdc++" "-lc++" - - substituteInPlace libsyscall/xcodescripts/mach_install_mig.sh \ - --replace "/usr/include" "/include" \ - --replace "/usr/local/include" "/include" \ - --replace 'MIG=`' "# " \ - --replace 'MIGCC=`' "# " \ - --replace " -o 0" "" \ - --replace '$SRC/$mig' '-I$DSTROOT/include $SRC/$mig' \ - --replace '$SRC/servers/netname.defs' '-I$DSTROOT/include $SRC/servers/netname.defs' \ - --replace '$BUILT_PRODUCTS_DIR/mig_hdr' '$BUILT_PRODUCTS_DIR' - - patchShebangs . - '' + lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinSdkVersion "11") '' - # iig is closed-sourced, we don't have it - # create an empty file to the header instead - # this line becomes: echo "" > $@; echo --header ... - substituteInPlace iokit/DriverKit/Makefile \ - --replace '--def $<' '> $@; echo' - ''; - - PLATFORM = "MacOSX"; - SDKVERSION = "10.11"; - CC = "${stdenv.cc.targetPrefix or ""}cc"; - CXX = "${stdenv.cc.targetPrefix or ""}c++"; - MIG = "mig"; - MIGCOM = "migcom"; - STRIP = "${stdenv.cc.bintools.targetPrefix or ""}strip"; - RANLIB = "${stdenv.cc.bintools.targetPrefix or ""}ranlib"; - NM = "${stdenv.cc.bintools.targetPrefix or ""}nm"; - UNIFDEF = "unifdef"; - DSYMUTIL = "dsymutil"; - HOST_OS_VERSION = "10.10"; - HOST_CC = "${buildPackages.stdenv.cc.targetPrefix or ""}cc"; - HOST_FLEX = "flex"; - HOST_BISON = "bison"; - HOST_GM4 = "m4"; - MIGCC = "${lib.getBin pkgsBuildBuild.stdenv.cc.cc}/bin/clang"; - ARCHS = arch; - ARCH_CONFIGS = arch; - - env.NIX_CFLAGS_COMPILE = "-Wno-error"; - - preBuild = let macosVersion = - "10.0 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 10.10 10.11" + - lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinSdkVersion "11") " 10.12 10.13 10.14 10.15 11.0"; - in '' - # This is a bit of a hack... - mkdir -p sdk/usr/local/libexec - - cat > sdk/usr/local/libexec/availability.pl <