From 16d91ee628d781c721506b19e3e03bed810327e8 Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Fri, 15 Jan 2021 21:45:37 +0700 Subject: pkgs/os-specific: stdenv.lib -> lib --- pkgs/os-specific/darwin/apple-source-releases/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkgs/os-specific/darwin/apple-source-releases/default.nix') diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix index 14c69b84eb4..12176fd526c 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, fetchzip, pkgs }: +{ lib, stdenv, fetchurl, fetchzip, pkgs }: let # This attrset can in theory be computed automatically, but for that to work nicely we need @@ -152,7 +152,7 @@ let name = "${name}-${version}"; enableParallelBuilding = true; meta = { - platforms = stdenv.lib.platforms.darwin; + platforms = lib.platforms.darwin; }; } // (if attrs ? srcs then {} else { src = fetchApple version sha256 name; @@ -160,7 +160,7 @@ let applePackage = namePath: version: sha256: let - name = builtins.elemAt (stdenv.lib.splitString "/" namePath) 0; + name = builtins.elemAt (lib.splitString "/" namePath) 0; appleDerivation = appleDerivation_ name version sha256; callPackage = pkgs.newScope (packages // pkgs.darwin // { inherit appleDerivation name version; }); in callPackage (./. + "/${namePath}"); @@ -187,7 +187,7 @@ let # There should be an IOVideo here, but they haven't released it :( }; - IOKitSrcs = stdenv.lib.mapAttrs (name: value: if stdenv.lib.isFunction value then value name else value) IOKitSpecs; + IOKitSrcs = lib.mapAttrs (name: value: if lib.isFunction value then value name else value) IOKitSpecs; # Only used for bootstrapping. It’s convenient because it was the last version to come with a real makefile. adv_cmds-boot = applePackage "adv_cmds/boot.nix" "osx-10.5.8" "102ssayxbg9wb35mdmhswbnw0bg7js3pfd8fcbic83c5q3bqa6c6" {}; -- cgit 1.4.1 From 9d5cece352e815982292993083ea0c3d3a17850e Mon Sep 17 00:00:00 2001 From: Monson Shao Date: Wed, 20 Jan 2021 02:02:23 +0800 Subject: darwin: generate apple packages preparing for update macos sdk --- .../darwin/apple-source-releases/default.nix | 61 +++++++++++++++------- .../developer-tools-11.3.1.nix | 8 +++ .../apple-source-releases/generate-sdk-packages.sh | 29 ++++++++++ .../darwin/apple-source-releases/macos-11.0.1.nix | 46 ++++++++++++++++ 4 files changed, 124 insertions(+), 20 deletions(-) create mode 100644 pkgs/os-specific/darwin/apple-source-releases/developer-tools-11.3.1.nix create mode 100755 pkgs/os-specific/darwin/apple-source-releases/generate-sdk-packages.sh create mode 100644 pkgs/os-specific/darwin/apple-source-releases/macos-11.0.1.nix (limited to 'pkgs/os-specific/darwin/apple-source-releases/default.nix') diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix index 12176fd526c..014904ca24d 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix @@ -1,6 +1,9 @@ { lib, stdenv, fetchurl, fetchzip, pkgs }: let + macosPackages_11_0_1 = import ./macos-11.0.1.nix { inherit applePackage'; }; + developerToolsPackages_11_3_1 = import ./developer-tools-11.3.1.nix { inherit applePackage'; }; + # This attrset can in theory be computed automatically, but for that to work nicely we need # import-from-derivation to work properly. Currently it's rather ugly when we try to bootstrap # a stdenv out of something like this. With some care we can probably get rid of this, but for @@ -57,6 +60,9 @@ let libplatform = "125"; mDNSResponder = "625.41.2"; + # IOKit contains a set of packages with different versions, so we don't have a general version + IOKit = ""; + libutil = "43"; libunwind = "35.3"; Librpcsvc = "26"; @@ -135,35 +141,47 @@ let }; }; - fetchApple = version: sha256: name: let + fetchApple' = pname: version: sha256: let # When cross-compiling, fetchurl depends on libiconv, resulting # in an infinite recursion without this. It's not clear why this # worked fine when not cross-compiling - fetch = if name == "libiconv" + fetch = if pname == "libiconv" then stdenv.fetchurlBoot else fetchurl; in fetch { - url = "http://www.opensource.apple.com/tarballs/${name}/${name}-${versions.${version}.${name}}.tar.gz"; + url = "http://www.opensource.apple.com/tarballs/${pname}/${pname}-${version}.tar.gz"; inherit sha256; }; - appleDerivation_ = name: version: sha256: attrs: stdenv.mkDerivation ({ - inherit version; - name = "${name}-${version}"; + fetchApple = sdkName: sha256: pname: let + version = versions.${sdkName}.${pname}; + in fetchApple' pname version sha256; + + appleDerivation' = pname: version: sdkName: sha256: attrs: stdenv.mkDerivation ({ + inherit pname; + version = "${version}-${sdkName}"; + + src = if attrs ? srcs then null else (fetchApple' pname version sha256); + enableParallelBuilding = true; - meta = { - platforms = lib.platforms.darwin; - }; - } // (if attrs ? srcs then {} else { - src = fetchApple version sha256 name; - }) // attrs); - applePackage = namePath: version: sha256: - let - name = builtins.elemAt (lib.splitString "/" namePath) 0; - appleDerivation = appleDerivation_ name version sha256; - callPackage = pkgs.newScope (packages // pkgs.darwin // { inherit appleDerivation name version; }); - in callPackage (./. + "/${namePath}"); + } // attrs // { + meta = (with lib; { + platforms = platforms.darwin; + license = licenses.apsl20; + }) // (attrs.meta or {}); + }); + + applePackage' = namePath: version: sdkName: sha256: let + pname = builtins.head (lib.splitString "/" namePath); + appleDerivation = appleDerivation' pname version sdkName sha256; + callPackage = pkgs.newScope (packages // pkgs.darwin // { inherit appleDerivation; }); + in callPackage (./. + "/${namePath}"); + + applePackage = namePath: sdkName: sha256: let + pname = builtins.head (lib.splitString "/" namePath); + version = versions.${sdkName}.${pname}; + in applePackage' namePath version sdkName sha256; IOKitSpecs = { IOAudioFamily = fetchApple "osx-10.10.5" "0ggq7za3iq8g02j16rj67prqhrw828jsw3ah3bxq8a1cvr55aqnq"; @@ -192,7 +210,8 @@ let # Only used for bootstrapping. It’s convenient because it was the last version to come with a real makefile. adv_cmds-boot = applePackage "adv_cmds/boot.nix" "osx-10.5.8" "102ssayxbg9wb35mdmhswbnw0bg7js3pfd8fcbic83c5q3bqa6c6" {}; - packages = { + # TODO: shorten this list, we should cut down to a minimum set of bootstrap or necessary packages here. + stubPackages = { inherit (adv_cmds-boot) ps locale; architecture = applePackage "architecture" "osx-10.11.6" "1pbpjcd7is69hn8y29i98ci0byik826if8gnp824ha92h90w0fq3" {}; bootstrap_cmds = applePackage "bootstrap_cmds" "dev-tools-7.0" "1v5dv2q3af1xwj5kz0a5g54fd5dm6j4c9dd2g66n4kc44ixyrhp3" {}; @@ -254,6 +273,8 @@ let # TODO(matthewbauer): # To be removed, once I figure out how to build a newer Security version. - Security = applePackage "Security/boot.nix" "osx-10.9.5" "1nv0dczf67dhk17hscx52izgdcyacgyy12ag0jh6nl5hmfzsn8yy" {}; + Security = applePackage "Security/boot.nix" "osx-10.9.5" "1nv0dczf67dhk17hscx52izgdcyacgyy12ag0jh6nl5hmfzsn8yy" {}; }; + + packages = developerToolsPackages_11_3_1 // macosPackages_11_0_1 // stubPackages; in packages diff --git a/pkgs/os-specific/darwin/apple-source-releases/developer-tools-11.3.1.nix b/pkgs/os-specific/darwin/apple-source-releases/developer-tools-11.3.1.nix new file mode 100644 index 00000000000..f57d224615f --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/developer-tools-11.3.1.nix @@ -0,0 +1,8 @@ +# Generated using: ./generate-sdk-packages.sh developer-tools 11.3.1 + +{ applePackage' }: + +{ +bootstrap_cmds = applePackage' "bootstrap_cmds" "116" "developer-tools-11.3.1" "148xpqkf5xzpslqxch5l8h6vsz7sys8sdzk4ghbg9mkcivp8qa03" {}; +developer_cmds = applePackage' "developer_cmds" "66" "developer-tools-11.3.1" "0q08m4cxxwph7gxqravmx13l418p1i050bd46zwksn9j9zpw9mlr" {}; +} diff --git a/pkgs/os-specific/darwin/apple-source-releases/generate-sdk-packages.sh b/pkgs/os-specific/darwin/apple-source-releases/generate-sdk-packages.sh new file mode 100755 index 00000000000..d7c3fc89c52 --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/generate-sdk-packages.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl + +# usage: +# generate-sdk-packages.sh macos 11.0.1 + +cd $(dirname "$0") + +sdkName="$1-$2" +outfile="$sdkName.nix" + +>$outfile echo "# Generated using: ./$(basename "$0") $1 $2 + +{ applePackage' }: + +{" + +parse_line() { + readarray -t -d$'\t' package <<<$2 + local pname=${package[0]} version=${package[1]} + + if [ -d $pname ]; then + sha256=$(nix-prefetch-url "https://opensource.apple.com/tarballs/$pname/$pname-$version.tar.gz") + >>$outfile echo "$pname = applePackage' \"$pname\" \"$version\" \"$sdkName\" \"$sha256\" {};" + fi +} +readarray -s1 -c1 -C parse_line < <(curl -sS "https://opensource.apple.com/text/${sdkName//./}.txt") + +>>$outfile echo '}' 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 new file mode 100644 index 00000000000..517f53e9435 --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/macos-11.0.1.nix @@ -0,0 +1,46 @@ +# Generated using: ./generate-sdk-packages.sh macos 11.0.1 + +{ applePackage' }: + +{ +adv_cmds = applePackage' "adv_cmds" "176" "macos-11.0.1" "0x8c25rh6fnzndbc26vcb65vcxilvqyfvm2klfyci1wr4bh3ixgk" {}; +architecture = applePackage' "architecture" "279" "macos-11.0.1" "1cgp33ywa30max6cyp69kvii299hx2vgwvmy3ms8n4gaq2mkpaky" {}; +basic_cmds = applePackage' "basic_cmds" "55" "macos-11.0.1" "0hvab4b1v5q2x134hdkal0rmz5gsdqyki1vb0dbw4py1bqf0yaw9" {}; +bootstrap_cmds = applePackage' "bootstrap_cmds" "121" "macos-11.0.1" "09bwclws6adxb1ky9q35f4ikddk4mbalmgds0cmqaf7j23qxl3fv" {}; +CommonCrypto = applePackage' "CommonCrypto" "60178.40.2" "macos-11.0.1" "0r3b1mlfmbdzpwn6pbsbfaga3k63gpwcwbhkbi4r09aq82skl02v" {}; +configd = applePackage' "configd" "1109.40.9" "macos-11.0.1" "173i55wfzli9pg2x2rw437hs68h6l4ngss5jfgf18g26zjkjzv5v" {}; +copyfile = applePackage' "copyfile" "173.40.2" "macos-11.0.1" "0qyp15qj3fdb7yx033n57l7s61d70mv17f43yiwcbhx09mmlrp07" {}; +Csu = applePackage' "Csu" "88" "macos-11.0.1" "029lgcyj0i16036h2lcx6fd6r1yf1bkj5dnvz905rh6ncl8skgdr" {}; +diskdev_cmds = applePackage' "diskdev_cmds" "667.40.1" "macos-11.0.1" "1bqwkwkwd556rba5000ap77xrhaf4xnmy83mszd7a0yvl2xlma7j" {}; +dtrace = applePackage' "dtrace" "370.40.1" "macos-11.0.1" "1941yczmn94ng5zlnhf0i5mjw2f4g7znisgvhkhn5f86gxmd98wl" {}; +dyld = applePackage' "dyld" "832.7.1" "macos-11.0.1" "1s77ca6jg20z91qlph59da8j61m97y23vrw48xs4rywdzh4915n0" {}; +eap8021x = applePackage' "eap8021x" "304.40.1" "macos-11.0.1" "1ph3kcpf527s0jqsi60j2sgg3m8h128spf292d8kyc08siz9mf9c" {}; +file_cmds = applePackage' "file_cmds" "321.40.3" "macos-11.0.1" "04789vn1wghclfr3ma3ncg716xdsxfj66hrcxi5h3h1ryag2ycfz" {}; +hfs = applePackage' "hfs" "556.41.1" "macos-11.0.1" "1rhkmn2yj5p4wmi4aajy5hj2h0gxk63s8j4qz4ziy4g4bjpdgwmy" {}; +ICU = applePackage' "ICU" "66108" "macos-11.0.1" "1d76cyyqpwkzjlxfajm4nsglxmfrcafbnjwnjxc3j5w3nw67pqhx" {}; +Libc = applePackage' "Libc" "1439.40.11" "macos-11.0.1" "0d5xlnks4lc9391wg31c9126vflb40lc5ffkgxmf2kpyglac1280" {}; +libclosure = applePackage' "libclosure" "78" "macos-11.0.1" "089i2bl4agpnfplrg23xbzma1674g0w05988nxdps6ghxl4kz66f" {}; +libdispatch = applePackage' "libdispatch" "1271.40.12" "macos-11.0.1" "0z7r42zfb8y48f0nrw0qw7fanfvimycimgnrg3jig101kjvjar98" {}; +libiconv = applePackage' "libiconv" "59" "macos-11.0.1" "0hqbsqggjrr0sv6h70lcr3gabgk9inyc8aq1b30wibgjm6crjwpp" {}; +Libinfo = applePackage' "Libinfo" "542.40.3" "macos-11.0.1" "0y5x6wxd3mwn6my1jdp8qrak3y7x7sgjdmwyw9cvvbn3kg9v6z1p" {}; +Libnotify = applePackage' "Libnotify" "279.40.4" "macos-11.0.1" "0aswflxki877izp6sacv35sydn6a3639cflv3zhs3i7vkfbsvbf5" {}; +libplatform = applePackage' "libplatform" "254.40.4" "macos-11.0.1" "1mhi8n66864y98dr3n0pkqad3aqim800kn9bxzp6h5jf2jni3aql" {}; +libpthread = applePackage' "libpthread" "454.40.3" "macos-11.0.1" "18rb4dqjdf3krzi4hdj5i310gy49ipf01klbkp9g51i02a55gphq" {}; +libresolv = applePackage' "libresolv" "68" "macos-11.0.1" "1ysvg6d28xyaky9sn7giglnsflhjsbj17h3h3i6knlzxnzznpkql" {}; +Librpcsvc = applePackage' "Librpcsvc" "26" "macos-11.0.1" "1zwfwcl9irxl1dlnf2b4v30vdybp0p0r6n6g1pd14zbdci1jcg2k" {}; +Libsystem = applePackage' "Libsystem" "1292.50.1" "macos-11.0.1" "0w16zaigq18jfsnw15pfyz2mkfqdkn0cc16q617kmgw2khld8j7j" {}; +libunwind = applePackage' "libunwind" "200.10" "macos-11.0.1" "1pmymcqpfk7lfxh6zqch429vfpvmd2m1dlg898170pkx5zhxisl2" {}; +libutil = applePackage' "libutil" "58.40.2" "macos-11.0.1" "1hhgashfj9g4vjv02070c5pn818a5n0bh5l81l2pflmvb2rrqs3f" {}; +mDNSResponder = applePackage' "mDNSResponder" "1310.40.42" "macos-11.0.1" "0d0b9wwah9rg7rwrr29dxd6iy0y4rlmss3wcz2wcqmnd2qb9x8my" {}; +network_cmds = applePackage' "network_cmds" "606.40.2" "macos-11.0.1" "1dlslk67npvmxx5m50385kmn3ysxih2iv220hhzkin11f8abdjv7" {}; +objc4 = applePackage' "objc4" "818.2" "macos-11.0.1" "177gmh9m9ajy6mvcd2sf7gqydgljy44n3iih0yqsn1b13j784azx" {}; +PowerManagement = applePackage' "PowerManagement" "1132.50.3" "macos-11.0.1" "1n5yn6sc8w67g8iism6ilkyl33j46gcnlqcaq6k16zkngx6lprba" {}; +ppp = applePackage' "ppp" "877.40.2" "macos-11.0.1" "1z506z8ndvb1lfr4pypfy2bnig6qimhmq3yhjvqwfnliv91965iq" {}; +removefile = applePackage' "removefile" "49.40.3" "macos-11.0.1" "1fhp47awi15f02385r25qgw1ag5z0kr1v3kvgqm3r8i8yysfqvwp" {}; +Security = applePackage' "Security" "59754.41.1" "macos-11.0.1" "00kqgg7k80ba70ar2c02f0q9yrdgqcb56nb9z5g0bxwkvi40ryph" {}; +shell_cmds = applePackage' "shell_cmds" "216.40.4" "macos-11.0.1" "1mvp1fp34kkm4mi85fdn3i0l0gig4c0w09zg2mvkpxcf68cq2f69" {}; +system_cmds = applePackage' "system_cmds" "880.40.5" "macos-11.0.1" "1kys4vwfz4559sspdsfhmxc238nd8qgylqypza3zdzaqhfh7lx2x" {}; +text_cmds = applePackage' "text_cmds" "106" "macos-11.0.1" "0cpnfpllwpx20hbxzg5i5488gcjyi9adnbac1sd5hpv3bq6z1hs5" {}; +top = applePackage' "top" "129" "macos-11.0.1" "1nyz5mvq7js3zhsi3dwxl5fslg6m7nhlgc6p2hr889xgyl5prw8f" {}; +xnu = applePackage' "xnu" "7195.50.7.100.1" "macos-11.0.1" "14wqkqp3lcxgpm1sjnsysybrc4ppzkghwv3mb5nr5v8ml37prkib" {}; +} -- cgit 1.4.1 From 399dbcac6774051ae7c9266eca52d0b7b79c5281 Mon Sep 17 00:00:00 2001 From: Monson Shao Date: Thu, 28 Jan 2021 01:22:35 +0800 Subject: darwin.apple-source-releases: drop sdkName in version --- pkgs/os-specific/darwin/apple-source-releases/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pkgs/os-specific/darwin/apple-source-releases/default.nix') diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix index 014904ca24d..ee93d48165a 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix @@ -158,8 +158,7 @@ let in fetchApple' pname version sha256; appleDerivation' = pname: version: sdkName: sha256: attrs: stdenv.mkDerivation ({ - inherit pname; - version = "${version}-${sdkName}"; + inherit pname version; src = if attrs ? srcs then null else (fetchApple' pname version sha256); -- cgit 1.4.1 From 84410e29df3787f60d16f327e6dc43f5bcba2e4e Mon Sep 17 00:00:00 2001 From: Monson Shao Date: Tue, 12 Jan 2021 05:40:24 +0800 Subject: darwin.bootstrap_cmds: update to 121 --- .../bootstrap_cmds/default.nix | 25 +++++----------------- .../darwin/apple-source-releases/default.nix | 1 - 2 files changed, 5 insertions(+), 21 deletions(-) (limited to 'pkgs/os-specific/darwin/apple-source-releases/default.nix') diff --git a/pkgs/os-specific/darwin/apple-source-releases/bootstrap_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/bootstrap_cmds/default.nix index 27a7f7b3e7c..002709ce2df 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/bootstrap_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/bootstrap_cmds/default.nix @@ -5,25 +5,14 @@ appleDerivation { buildPhase = '' cd migcom.tproj + + # redundant file, don't know why apple not removing it. + rm handler.c + yacc -d parser.y flex --header-file=lexxer.yy.h -o lexxer.yy.c lexxer.l - cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o error.o error.c - cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o global.o global.c - cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o handler.o header.c - cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o header.o header.c - cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o mig.o mig.c - cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o routine.o routine.c - cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o server.o server.c - cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o statement.o statement.c - cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o string.o string.c - cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o type.o type.c - cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o user.o user.c - cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o utils.o utils.c - cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o lexxer.yy.o lexxer.yy.c - cc -Os -pipe -DMIG_VERSION="" -Wall -mdynamic-no-pic -I. -c -o y.tab.o y.tab.c - - cc -dead_strip -o migcom error.o global.o header.o mig.o routine.o server.o statement.o string.o type.o user.o utils.o lexxer.yy.o y.tab.o + cc -std=gnu99 -Os -dead_strip -DMIG_VERSION=\"$pname-$version\" -I. -o migcom *.c ''; installPhase = '' @@ -42,8 +31,4 @@ appleDerivation { --replace '/bin/rmdir' "rmdir" \ --replace 'C=''${MIGCC}' "C=cc" ''; - - meta = { - platforms = lib.platforms.darwin; - }; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix index ee93d48165a..19369432728 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix @@ -213,7 +213,6 @@ let stubPackages = { inherit (adv_cmds-boot) ps locale; architecture = applePackage "architecture" "osx-10.11.6" "1pbpjcd7is69hn8y29i98ci0byik826if8gnp824ha92h90w0fq3" {}; - bootstrap_cmds = applePackage "bootstrap_cmds" "dev-tools-7.0" "1v5dv2q3af1xwj5kz0a5g54fd5dm6j4c9dd2g66n4kc44ixyrhp3" {}; bsdmake = applePackage "bsdmake" "dev-tools-3.2.6" "11a9kkhz5bfgi1i8kpdkis78lhc6b5vxmhd598fcdgra1jw4iac2" {}; CarbonHeaders = applePackage "CarbonHeaders" "osx-10.6.2" "1zam29847cxr6y9rnl76zqmkbac53nx0szmqm9w5p469a6wzjqar" {}; CommonCrypto = applePackage "CommonCrypto" "osx-10.12.6" "0sgsqjcxbdm2g2zfpc50mzmk4b4ldyw7xvvkwiayhpczg1fga4ff" {}; -- cgit 1.4.1 From 145ed3fcbc06a92fba6efd142a957cc6321ecb21 Mon Sep 17 00:00:00 2001 From: Monson Shao Date: Thu, 28 Jan 2021 23:53:29 +0800 Subject: darwin.ICU: update to 66108 and restruct --- .../darwin/apple-source-releases/ICU/clang-5.patch | 22 --------- .../darwin/apple-source-releases/ICU/default.nix | 55 +++++++++++++++++----- .../darwin/apple-source-releases/default.nix | 1 - 3 files changed, 44 insertions(+), 34 deletions(-) delete mode 100644 pkgs/os-specific/darwin/apple-source-releases/ICU/clang-5.patch (limited to 'pkgs/os-specific/darwin/apple-source-releases/default.nix') diff --git a/pkgs/os-specific/darwin/apple-source-releases/ICU/clang-5.patch b/pkgs/os-specific/darwin/apple-source-releases/ICU/clang-5.patch deleted file mode 100644 index fd9df812940..00000000000 --- a/pkgs/os-specific/darwin/apple-source-releases/ICU/clang-5.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/icuSources/i18n/ucoleitr.cpp b/icuSources/i18n/ucoleitr.cpp -index ecc94c9..936452f 100644 ---- a/icuSources/i18n/ucoleitr.cpp -+++ b/icuSources/i18n/ucoleitr.cpp -@@ -320,7 +320,7 @@ ucol_nextProcessed(UCollationElements *elems, - int32_t *ixHigh, - UErrorCode *status) - { -- return (UCollationPCE::UCollationPCE(elems)).nextProcessed(ixLow, ixHigh, status); -+ return (UCollationPCE(elems)).nextProcessed(ixLow, ixHigh, status); - } - - -@@ -384,7 +384,7 @@ ucol_previousProcessed(UCollationElements *elems, - int32_t *ixHigh, - UErrorCode *status) - { -- return (UCollationPCE::UCollationPCE(elems)).previousProcessed(ixLow, ixHigh, status); -+ return (UCollationPCE(elems)).previousProcessed(ixLow, ixHigh, status); - } - - U_NAMESPACE_BEGIN diff --git a/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix b/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix index 761ff3ea925..032b1447463 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix @@ -1,23 +1,56 @@ -{ appleDerivation }: +{ appleDerivation, python3 }: appleDerivation { - patches = [ ./clang-5.patch ]; + nativeBuildInputs = [ python3 ]; postPatch = '' substituteInPlace makefile \ - --replace /usr/bin/ "" \ - --replace '$(ISYSROOT)' "" \ - --replace 'shell xcodebuild -version -sdk' 'shell true' \ - --replace 'shell xcrun -sdk $(SDKPATH) -find' 'shell echo' \ - --replace '-install_name $(libdir)' "-install_name $out/lib/" \ - --replace /usr/local/bin/ /bin/ \ - --replace /usr/lib/ /lib/ \ + --replace "/usr/bin/" "" \ + --replace "xcrun --sdk macosx --find" "echo -n" \ + --replace "xcrun --sdk macosx.internal --show-sdk-path" "echo -n /dev/null" \ + --replace "-install_name " "-install_name $out" + + substituteInPlace icuSources/config/mh-darwin \ + --replace "-install_name " "-install_name $out/" + + # drop using impure /var/db/timezone/icutz + substituteInPlace makefile \ + --replace '-DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\"' "" + + # FIXME: This will cause `ld: warning: OS version (12.0) too small, changing to 13.0.0`, APPLE should fix it. + substituteInPlace makefile \ + --replace "ZIPPERING_LDFLAGS=-Wl,-iosmac_version_min,12.0" "ZIPPERING_LDFLAGS=" + + # skip test for missing encodingSamples data + substituteInPlace icuSources/test/cintltst/ucsdetst.c \ + --replace "&TestMailFilterCSS" "NULL" + + patchShebangs icuSources ''; - makeFlags = [ "DSTROOT=$(out)" ]; + # APPLE is using makefile to save its default configuration and call ./configure, so we hack makeFlags + # instead of configuring ourself, trying to stay abreast of APPLE. + dontConfigure = true; + makeFlags = [ + "DSTROOT=$(out)" + + # remove /usr prefix on include and lib + "PRIVATE_HDR_PREFIX=" + "libdir=/lib/" + + "DATA_INSTALL_DIR=/share/icu/" + "DATA_LOOKUP_DIR=$(DSTROOT)$(DATA_INSTALL_DIR)" + + # hack to use our lower macos version + "MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_MIN_REQUIRED" + "OSX_HOST_VERSION_MIN_STRING=$(MACOSX_DEPLOYMENT_TARGET)" + ]; + + doCheck = true; + checkTarget = "check"; postInstall = '' - mv $out/usr/local/include $out/include + # we don't need all those in usr/local rm -rf $out/usr ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix index 014904ca24d..61d9d452263 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix @@ -226,7 +226,6 @@ let dtrace = applePackage "dtrace" "osx-10.12.6" "0hpd6348av463yqf70n3xkygwmf1i5zza8kps4zys52sviqz3a0l" {}; dyld = applePackage "dyld" "osx-10.12.6" "0q4jmk78b5ajn33blh4agyq6v2a63lpb3fln78az0dy12bnp1qqk" {}; eap8021x = applePackage "eap8021x" "osx-10.11.6" "0iw0qdib59hihyx2275rwq507bq2a06gaj8db4a8z1rkaj1frskh" {}; - ICU = applePackage "ICU" "osx-10.10.5" "1qihlp42n5g4dl0sn0f9pc0bkxy1452dxzf0vr6y5gqpshlzy03p" {}; IOKit = applePackage "IOKit" "osx-10.11.6" "0kcbrlyxcyirvg5p95hjd9k8a01k161zg0bsfgfhkb90kh2s8x00" { inherit IOKitSrcs; }; launchd = applePackage "launchd" "osx-10.9.5" "0w30hvwqq8j5n90s3qyp0fccxflvrmmjnicjri4i1vd2g196jdgj" {}; libauto = applePackage "libauto" "osx-10.9.5" "17z27yq5d7zfkwr49r7f0vn9pxvj95884sd2k6lq6rfaz9gxqhy3" {}; -- cgit 1.4.1 From c12df57435e8c373a7d3bd4a8249a2a9ff51be48 Mon Sep 17 00:00:00 2001 From: Monson Shao Date: Sat, 23 Jan 2021 21:49:13 +0800 Subject: darwin.apple-source-releases: implement headers check --- .../darwin/apple-source-releases/default.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'pkgs/os-specific/darwin/apple-source-releases/default.nix') diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix index 014904ca24d..cb17d66e6a4 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix @@ -165,6 +165,25 @@ let enableParallelBuilding = true; + # In rare cases, APPLE may drop some headers quietly on new release. + doInstallCheck = attrs ? appleHeaders; + passAsFile = [ "appleHeaders" ]; + installCheckPhase = '' + cd $out/include + + result=$(diff -u "$appleHeadersPath" <(find * -type f | sort) --label "Listed in appleHeaders" --label "Found in \$out/include" || true) + + if [ -z "$result" ]; then + echo "Apple header list is matched." + else + echo >&2 "\ + Apple header list is inconsistent, please ensure no header file is unexpectedly dropped. + $result + " + exit 1 + fi + ''; + } // attrs // { meta = (with lib; { platforms = platforms.darwin; -- cgit 1.4.1 From 470640e7fe53ab57396cff6698125f5bf137b4de Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 4 May 2021 00:08:20 -0400 Subject: treewide: Do a number of no-op cleanups for cross and darwin I am taking the non-invasive parts of #110914 to hopefully help out with #111988. In particular: - Use `lib.makeScopeWithSplicing` to make the `darwin` package set have a proper `callPackage`. - Adjust Darwin `stdenv`'s overlays keeping things from the previous stage to not stick around too much. - Expose `binutilsNoLibc` / `darwin.binutilsNoLibc` to hopefully get us closer to a unified LLVM and GCC bootstrap. --- lib/customisation.nix | 8 ++- pkgs/development/interpreters/python/default.nix | 2 + .../darwin/apple-source-releases/default.nix | 49 +++++++++------- pkgs/stdenv/darwin/default.nix | 44 +++++++------- pkgs/top-level/all-packages.nix | 22 +++---- pkgs/top-level/darwin-packages.nix | 67 ++++++++++++++-------- pkgs/top-level/static.nix | 2 +- 7 files changed, 111 insertions(+), 83 deletions(-) (limited to 'pkgs/os-specific/darwin/apple-source-releases/default.nix') diff --git a/lib/customisation.nix b/lib/customisation.nix index 37a7951896b..c17cb0d0f8e 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -219,16 +219,17 @@ rec { /* Like the above, but aims to support cross compilation. It's still ugly, but hopefully it helps a little bit. */ - makeScopeWithSplicing = splicePackages: newScope: otherSplices: keep: f: + makeScopeWithSplicing = splicePackages: newScope: otherSplices: keep: extra: f: let - spliced = splicePackages { + spliced0 = splicePackages { pkgsBuildBuild = otherSplices.selfBuildBuild; pkgsBuildHost = otherSplices.selfBuildHost; pkgsBuildTarget = otherSplices.selfBuildTarget; pkgsHostHost = otherSplices.selfHostHost; pkgsHostTarget = self; # Not `otherSplices.selfHostTarget`; pkgsTargetTarget = otherSplices.selfTargetTarget; - } // keep self; + }; + spliced = extra spliced0 // spliced0 // keep self; self = f self // { newScope = scope: newScope (spliced // scope); callPackage = newScope spliced; # == self.newScope {}; @@ -239,6 +240,7 @@ rec { newScope otherSplices keep + extra (lib.fixedPoints.extends g f); packages = f; }; diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index d74e017d830..5f13418aa58 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -69,6 +69,7 @@ with pkgs; recursivePthLoader ; }; + extra = _: {}; optionalExtensions = cond: as: if cond then as else []; python2Extension = import ../../../top-level/python2-packages.nix; extensions = lib.composeManyExtensions ((optionalExtensions (!self.isPy3k) [python2Extension]) ++ [ overrides ]); @@ -77,6 +78,7 @@ with pkgs; pkgs.newScope otherSplices keep + extra (lib.extends extensions pythonPackagesFun)) { overrides = packageOverrides; diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix index 23434931542..3e431810f20 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix @@ -1,9 +1,6 @@ -{ lib, stdenv, fetchurl, fetchzip, pkgs }: +{ lib, stdenv, stdenvNoCC, fetchurl, fetchzip, pkgs }: let - macosPackages_11_0_1 = import ./macos-11.0.1.nix { inherit applePackage'; }; - developerToolsPackages_11_3_1 = import ./developer-tools-11.3.1.nix { inherit applePackage'; }; - # This attrset can in theory be computed automatically, but for that to work nicely we need # import-from-derivation to work properly. Currently it's rather ugly when we try to bootstrap # a stdenv out of something like this. With some care we can probably get rid of this, but for @@ -190,17 +187,6 @@ let }) // (attrs.meta or {}); }); - applePackage' = namePath: version: sdkName: sha256: let - pname = builtins.head (lib.splitString "/" namePath); - appleDerivation = appleDerivation' pname version sdkName sha256; - callPackage = pkgs.newScope (packages // pkgs.darwin // { inherit appleDerivation; }); - in callPackage (./. + "/${namePath}"); - - applePackage = namePath: sdkName: sha256: let - pname = builtins.head (lib.splitString "/" namePath); - version = versions.${sdkName}.${pname}; - in applePackage' namePath version sdkName sha256; - IOKitSpecs = { IOAudioFamily = fetchApple "osx-10.10.5" "0ggq7za3iq8g02j16rj67prqhrw828jsw3ah3bxq8a1cvr55aqnq"; IOFireWireFamily = fetchApple "osx-10.10.5" "059qa1m668kwvchl90cqcx35b31zaqdg61zi11y1imn5s389y2g1"; @@ -225,11 +211,35 @@ let IOKitSrcs = lib.mapAttrs (name: value: if lib.isFunction value then value name else value) IOKitSpecs; +in + +# darwin package set +self: + +let + macosPackages_11_0_1 = import ./macos-11.0.1.nix { inherit applePackage'; }; + developerToolsPackages_11_3_1 = import ./developer-tools-11.3.1.nix { inherit applePackage'; }; + + applePackage' = namePath: version: sdkName: sha256: + let + pname = builtins.head (lib.splitString "/" namePath); + appleDerivation = appleDerivation' pname version sdkName sha256; + callPackage = self.newScope { inherit appleDerivation; }; + in callPackage (./. + "/${namePath}"); + + applePackage = namePath: sdkName: sha256: let + pname = builtins.head (lib.splitString "/" namePath); + version = versions.${sdkName}.${pname}; + in applePackage' namePath version sdkName sha256; + # Only used for bootstrapping. It’s convenient because it was the last version to come with a real makefile. adv_cmds-boot = applePackage "adv_cmds/boot.nix" "osx-10.5.8" "102ssayxbg9wb35mdmhswbnw0bg7js3pfd8fcbic83c5q3bqa6c6" {}; - # TODO: shorten this list, we should cut down to a minimum set of bootstrap or necessary packages here. - stubPackages = { +in + +developerToolsPackages_11_3_1 // macosPackages_11_0_1 // { + # TODO: shorten this list, we should cut down to a minimum set of bootstrap or necessary packages here. + inherit (adv_cmds-boot) ps locale; architecture = applePackage "architecture" "osx-10.11.6" "1pbpjcd7is69hn8y29i98ci0byik826if8gnp824ha92h90w0fq3" {}; bsdmake = applePackage "bsdmake" "dev-tools-3.2.6" "11a9kkhz5bfgi1i8kpdkis78lhc6b5vxmhd598fcdgra1jw4iac2" {}; @@ -290,7 +300,4 @@ let # TODO(matthewbauer): # To be removed, once I figure out how to build a newer Security version. Security = applePackage "Security/boot.nix" "osx-10.9.5" "1nv0dczf67dhk17hscx52izgdcyacgyy12ag0jh6nl5hmfzsn8yy" {}; - }; - - packages = developerToolsPackages_11_3_1 // macosPackages_11_0_1 // stubPackages; -in packages +} diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 227f53b02cc..fcfab9bff5d 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -176,13 +176,13 @@ in rec { ''; }; - darwin = super.darwin // { + darwin = super.darwin.overrideScope (selfDarwin: superDarwin: { Libsystem = stdenv.mkDerivation { name = "bootstrap-stage0-Libsystem"; buildCommand = '' mkdir -p $out - cp -r ${self.darwin.darwin-stubs}/usr/lib $out/lib + cp -r ${selfDarwin.darwin-stubs}/usr/lib $out/lib chmod -R +w $out/lib substituteInPlace $out/lib/libSystem.B.tbd --replace /usr/lib/system $out/lib/system @@ -201,7 +201,7 @@ in rec { ''; }; - darwin-stubs = super.darwin.darwin-stubs.override { inherit (self) stdenv fetchurl; }; + darwin-stubs = superDarwin.darwin-stubs.override { inherit (self) stdenv fetchurl; }; dyld = { name = "bootstrap-stage0-dyld"; @@ -220,10 +220,10 @@ in rec { nativeTools = false; nativeLibc = false; inherit (self) buildPackages coreutils gnugrep; - libc = self.pkgs.darwin.Libsystem; + libc = selfDarwin.Libsystem; bintools = { name = "bootstrap-stage0-binutils"; outPath = bootstrapTools; }; }; - }; + }); llvmPackages_7 = { clang-unwrapped = stdenv.mkDerivation { @@ -291,12 +291,12 @@ in rec { }); in { inherit tools libraries; } // tools // libraries); - darwin = super.darwin // { + darwin = super.darwin.overrideScope (selfDarwin: _: { binutils = darwin.binutils.override { coreutils = self.coreutils; - libc = self.darwin.Libsystem; + libc = selfDarwin.Libsystem; }; - }; + }); }; in with prevStage; stageFun 1 prevStage { extraPreHook = "export NIX_CFLAGS_COMPILE+=\" -F${bootstrapTools}/Library/Frameworks\""; @@ -337,11 +337,11 @@ in rec { }); in { inherit tools libraries; } // tools // libraries); - darwin = super.darwin // { + darwin = super.darwin.overrideScope (_: _: { inherit (darwin) binutils dyld Libsystem xnu configd ICU libdispatch libclosure launchd CF darwin-stubs; - }; + }); }; in with prevStage; stageFun 2 prevStage { extraPreHook = '' @@ -382,11 +382,11 @@ in rec { }); in { inherit libraries; } // libraries); - darwin = super.darwin // { + darwin = super.darwin.overrideScope (_: _: { inherit (darwin) dyld Libsystem xnu configd libdispatch libclosure launchd libiconv locale darwin-stubs; - }; + }); }; in with prevStage; stageFun 3 prevStage { shell = "${pkgs.bash}/bin/bash"; @@ -442,14 +442,14 @@ in rec { }); in { inherit tools libraries; } // tools // libraries); - darwin = super.darwin // rec { + darwin = super.darwin.overrideScope (_: superDarwin: { inherit (darwin) dyld Libsystem libiconv locale darwin-stubs; - CF = super.darwin.CF.override { + CF = superDarwin.CF.override { inherit libxml2; python3 = prevStage.python3; }; - }; + }); }; in with prevStage; stageFun 4 prevStage { shell = "${pkgs.bash}/bin/bash"; @@ -480,11 +480,11 @@ in rec { }); in { inherit tools libraries; } // tools // libraries); - darwin = super.darwin // { + darwin = super.darwin.overrideScope (_: _: { inherit (darwin) dyld ICU Libsystem libiconv; } // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) { inherit (darwin) binutils binutils-unwrapped cctools; - }; + }); } // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) { # Need to get rid of these when cross-compiling. inherit binutils binutils-unwrapped; @@ -537,14 +537,14 @@ in rec { ]); overrides = lib.composeExtensions persistent (self: super: { + darwin = super.darwin.overrideScope (_: superDarwin: { + inherit (prevStage.darwin) CF darwin-stubs; + xnu = superDarwin.xnu.override { inherit (prevStage) python3; }; + }); + } // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) { clang = cc; llvmPackages = super.llvmPackages // { clang = cc; }; inherit cc; - - darwin = super.darwin // { - inherit (prevStage.darwin) CF darwin-stubs; - xnu = super.darwin.xnu.override { inherit (prevStage) python3; }; - }; }); }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 63de087f73f..e2fc45fe5c4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10395,15 +10395,7 @@ in # The GCC used to build libc for the target platform. Normal gccs will be # built with, and use, that cross-compiled libc. gccCrossStageStatic = assert stdenv.targetPlatform != stdenv.hostPlatform; let - libcCross1 = - if stdenv.targetPlatform.libc == "msvcrt" then targetPackages.windows.mingw_w64_headers - else if stdenv.targetPlatform.libc == "libSystem" then darwin.xcode - else if stdenv.targetPlatform.libc == "nblibc" then netbsd.headers - else null; - binutils1 = wrapBintoolsWith { - bintools = binutils-unwrapped; - libc = libcCross1; - }; + libcCross1 = binutilsNoLibc.libc; in wrapCCWith { cc = gccFun { # copy-pasted @@ -10416,10 +10408,10 @@ in crossStageStatic = true; langCC = false; libcCross = libcCross1; - targetPackages.stdenv.cc.bintools = binutils1; + targetPackages.stdenv.cc.bintools = binutilsNoLibc; enableShared = false; }; - bintools = binutils1; + bintools = binutilsNoLibc; libc = libcCross1; extraPackages = []; }; @@ -12532,6 +12524,14 @@ in gold = false; }; }); + binutilsNoLibc = wrapBintoolsWith { + bintools = binutils-unwrapped; + libc = + /**/ if stdenv.targetPlatform.libc == "msvcrt" then targetPackages.windows.mingw_w64_headers + else if stdenv.targetPlatform.libc == "libSystem" then darwin.xcode + else if stdenv.targetPlatform.libc == "nblibc" then targetPackages.netbsdCross.headers + else null; + }; bison = callPackage ../development/tools/parsing/bison { }; diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix index 3ece95c5845..5275a6f3123 100644 --- a/pkgs/top-level/darwin-packages.nix +++ b/pkgs/top-level/darwin-packages.nix @@ -1,27 +1,44 @@ -{ buildPackages, pkgs, targetPackages -, darwin, stdenv, callPackage, callPackages, newScope +{ lib +, buildPackages, pkgs, targetPackages +, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget, pkgsHostHost, pkgsTargetTarget +, stdenv, splicePackages, newScope }: let - apple-source-releases = callPackage ../os-specific/darwin/apple-source-releases { }; + otherSplices = { + selfBuildBuild = pkgsBuildBuild.darwin; + selfBuildHost = pkgsBuildHost.darwin; + selfBuildTarget = pkgsBuildTarget.darwin; + selfHostHost = pkgsHostHost.darwin; + selfTargetTarget = pkgsTargetTarget.darwin or {}; # might be missing + }; - impure-cmds = callPackage ../os-specific/darwin/impure-cmds { }; in -(impure-cmds // apple-source-releases // { +lib.makeScopeWithSplicing splicePackages newScope otherSplices (_: {}) (spliced: spliced.apple_sdk.frameworks) (self: let + inherit (self) mkDerivation callPackage; - callPackage = newScope (darwin.apple_sdk.frameworks // darwin); + # Must use pkgs.callPackage to avoid infinite recursion. - stdenvNoCF = stdenv.override { - extraBuildInputs = []; + apple-source-releases = pkgs.callPackage ../os-specific/darwin/apple-source-releases { } self; + + impure-cmds = pkgs.callPackage ../os-specific/darwin/impure-cmds { }; + + apple_sdk = pkgs.callPackage ../os-specific/darwin/apple-sdk { + inherit (buildPackages.darwin) print-reexports; + inherit (self) darwin-stubs; }; +in + +impure-cmds // apple-source-releases // { - apple_sdk = callPackage ../os-specific/darwin/apple-sdk { - inherit (darwin) darwin-stubs print-reexports; + inherit apple_sdk; + + stdenvNoCF = stdenv.override { + extraBuildInputs = []; }; binutils-unwrapped = callPackage ../os-specific/darwin/binutils { - inherit (darwin) cctools; inherit (pkgs) binutils-unwrapped; inherit (pkgs.llvmPackages_7) llvm clang-unwrapped; }; @@ -31,17 +48,21 @@ in if stdenv.targetPlatform != stdenv.hostPlatform then pkgs.libcCross else pkgs.stdenv.cc.libc; - bintools = darwin.binutils-unwrapped; + bintools = self.binutils-unwrapped; + }; + + binutilsNoLibc = pkgs.wrapBintoolsWith { + libc = null; + bintools = self.binutils-unwrapped; }; cctools = callPackage ../os-specific/darwin/cctools/port.nix { - inherit (darwin) libobjc maloader libtapi; stdenv = if stdenv.isDarwin then stdenv else pkgs.libcxxStdenv; libcxxabi = pkgs.libcxxabi; }; # TODO: remove alias. - cf-private = darwin.apple_sdk.frameworks.CoreFoundation; + cf-private = self.apple_sdk.frameworks.CoreFoundation; DarwinTools = callPackage ../os-specific/darwin/DarwinTools { }; @@ -50,15 +71,13 @@ in print-reexports = callPackage ../os-specific/darwin/apple-sdk/print-reexports { }; maloader = callPackage ../os-specific/darwin/maloader { - inherit (darwin) opencflite; }; insert_dylib = callPackage ../os-specific/darwin/insert_dylib { }; - iosSdkPkgs = darwin.callPackage ../os-specific/darwin/xcode/sdk-pkgs.nix { + iosSdkPkgs = callPackage ../os-specific/darwin/xcode/sdk-pkgs.nix { buildIosSdk = buildPackages.darwin.iosSdkPkgs.sdk; targetIosSdkPkgs = targetPackages.darwin.iosSdkPkgs; - xcode = darwin.xcode; inherit (pkgs.llvmPackages) clang-unwrapped; }; @@ -70,13 +89,13 @@ in opencflite = callPackage ../os-specific/darwin/opencflite { }; - stubs = callPackages ../os-specific/darwin/stubs { }; + stubs = pkgs.callPackages ../os-specific/darwin/stubs { }; - trash = darwin.callPackage ../os-specific/darwin/trash { }; + trash = callPackage ../os-specific/darwin/trash { }; usr-include = callPackage ../os-specific/darwin/usr-include { }; - inherit (callPackages ../os-specific/darwin/xcode { }) + inherit (pkgs.callPackages ../os-specific/darwin/xcode { }) xcode_8_1 xcode_8_2 xcode_9_1 xcode_9_2 xcode_9_4 xcode_9_4_1 xcode_10_2 xcode_10_2_1 xcode_10_3 @@ -85,10 +104,10 @@ in CoreSymbolication = callPackage ../os-specific/darwin/CoreSymbolication { }; - CF = callPackage ../os-specific/darwin/swift-corelibs/corefoundation.nix { inherit (darwin) objc4 ICU; }; + CF = callPackage ../os-specific/darwin/swift-corelibs/corefoundation.nix { }; # As the name says, this is broken, but I don't want to lose it since it's a direction we want to go in - # libdispatch-broken = callPackage ../os-specific/darwin/swift-corelibs/libdispatch.nix { inherit (darwin) apple_sdk_sierra xnu; }; + # libdispatch-broken = callPackage ../os-specific/darwin/swift-corelibs/libdispatch.nix { }; darling = callPackage ../os-specific/darwin/darling/default.nix { }; @@ -96,8 +115,6 @@ in ios-deploy = callPackage ../os-specific/darwin/ios-deploy {}; - discrete-scroll = callPackage ../os-specific/darwin/discrete-scroll { - inherit (darwin.apple_sdk.frameworks) Cocoa; - }; + discrete-scroll = callPackage ../os-specific/darwin/discrete-scroll { }; }) diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix index e73eba8e142..32559c0e799 100644 --- a/pkgs/top-level/static.nix +++ b/pkgs/top-level/static.nix @@ -25,7 +25,7 @@ self: super: let }; in stdenv // { mkDerivation = args: stdenv.mkDerivation (args // { NIX_CFLAGS_LINK = toString (args.NIX_CFLAGS_LINK or "") - + optionalString stdenv.cc.isGNU " -static-libgcc"; + + optionalString (stdenv_.cc.isGNU or false) " -static-libgcc"; nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ (makeSetupHook { substitutions = { libsystem = "${stdenv.cc.libc}/lib/libSystem.B.dylib"; -- cgit 1.4.1 From 7bba32a069ae9b96e8d78f4d0bb4561f1677fd20 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 6 May 2021 15:56:46 -0400 Subject: darwin packages: Get ready for cross If things build fine with `stdenvNoCC`, let them use that. If tools might be prefixed, prepare for that, either by directly splicing or just using the env vars provided by the wrapper setup-hooks. Co-authored-by: Dmitry Kalinkin --- .../CarbonHeaders/default.nix | 4 +- .../apple-source-releases/CommonCrypto/default.nix | 4 +- .../darwin/apple-source-releases/Csu/default.nix | 7 +- .../darwin/apple-source-releases/IOKit/default.nix | 4 +- .../darwin/apple-source-releases/Libc/825_40_1.nix | 4 +- .../darwin/apple-source-releases/Libc/default.nix | 4 +- .../apple-source-releases/Libinfo/default.nix | 4 +- .../darwin/apple-source-releases/Libm/default.nix | 4 +- .../apple-source-releases/Libnotify/default.nix | 4 +- .../apple-source-releases/Libsystem/default.nix | 24 ++-- .../darwin/apple-source-releases/Security/boot.nix | 4 +- .../apple-source-releases/architecture/default.nix | 4 +- .../bootstrap_cmds/default.nix | 15 ++- .../apple-source-releases/configd/default.nix | 148 ++++++++++----------- .../apple-source-releases/copyfile/default.nix | 4 +- .../darwin/apple-source-releases/default.nix | 22 +-- .../darwin/apple-source-releases/dyld/default.nix | 4 +- .../apple-source-releases/eap8021x/default.nix | 4 +- .../darwin/apple-source-releases/hfs/default.nix | 4 +- .../apple-source-releases/launchd/default.nix | 4 +- .../apple-source-releases/libclosure/default.nix | 4 +- .../apple-source-releases/libdispatch/default.nix | 4 +- .../apple-source-releases/libplatform/default.nix | 4 +- .../apple-source-releases/libpthread/default.nix | 4 +- .../apple-source-releases/libresolv/default.nix | 67 +++++----- .../apple-source-releases/libutil/default.nix | 4 +- .../mDNSResponder/default.nix | 4 +- .../darwin/apple-source-releases/ppp/default.nix | 4 +- .../apple-source-releases/removefile/default.nix | 4 +- .../darwin/apple-source-releases/xnu/default.nix | 20 +-- pkgs/os-specific/darwin/darwin-stubs/default.nix | 4 +- pkgs/stdenv/darwin/default.nix | 2 +- 32 files changed, 214 insertions(+), 187 deletions(-) (limited to 'pkgs/os-specific/darwin/apple-source-releases/default.nix') diff --git a/pkgs/os-specific/darwin/apple-source-releases/CarbonHeaders/default.nix b/pkgs/os-specific/darwin/apple-source-releases/CarbonHeaders/default.nix index b53c5985a21..25e1df3773d 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/CarbonHeaders/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/CarbonHeaders/default.nix @@ -1,6 +1,6 @@ -{ lib, appleDerivation }: +{ lib, appleDerivation', stdenvNoCC }: -appleDerivation { +appleDerivation' stdenvNoCC { dontBuild = true; installPhase = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/CommonCrypto/default.nix b/pkgs/os-specific/darwin/apple-source-releases/CommonCrypto/default.nix index 476a77c59d7..36013fe307c 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/CommonCrypto/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/CommonCrypto/default.nix @@ -1,6 +1,6 @@ -{ lib, appleDerivation }: +{ lib, appleDerivation', stdenvNoCC }: -appleDerivation { +appleDerivation' stdenvNoCC { installPhase = '' mkdir -p $out/include/CommonCrypto cp include/* $out/include/CommonCrypto diff --git a/pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix index e3b3179d4a3..ac09a282f51 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix @@ -1,13 +1,14 @@ -{ lib, appleDerivation }: +{ lib, appleDerivation', stdenv }: + +appleDerivation' stdenv { -appleDerivation { prePatch = '' substituteInPlace Makefile \ --replace /usr/lib /lib \ --replace /usr/local/lib /lib \ --replace /usr/bin "" \ --replace /bin/ "" \ - --replace "CC = " "CC = cc #" \ + --replace "CC = " "#" \ --replace "SDK_DIR = " "SDK_DIR = . #" \ # Mac OS didn't support rpaths back before 10.5, but we don't care about it. diff --git a/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix b/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix index 0ba61ccb491..085d223bd04 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix @@ -1,7 +1,7 @@ -{ lib, appleDerivation, IOKitSrcs, xnu, darwin-stubs }: +{ lib, appleDerivation', stdenv, IOKitSrcs, xnu, darwin-stubs }: # Someday it'll make sense to split these out into their own packages, but today is not that day. -appleDerivation { +appleDerivation' stdenv { srcs = lib.attrValues IOKitSrcs; sourceRoot = "."; diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libc/825_40_1.nix b/pkgs/os-specific/darwin/apple-source-releases/Libc/825_40_1.nix index 29aa3d64cb0..c9202b53658 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libc/825_40_1.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libc/825_40_1.nix @@ -1,6 +1,6 @@ -{ appleDerivation, ed, unifdef }: +{ appleDerivation', stdenvNoCC, ed, unifdef }: -appleDerivation { +appleDerivation' stdenvNoCC { nativeBuildInputs = [ ed unifdef ]; installPhase = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix index 3554a2e15b0..9bec0b103c9 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix @@ -1,6 +1,6 @@ -{ appleDerivation, ed, unifdef, Libc_old, Libc_10-9 }: +{ appleDerivation', stdenvNoCC, ed, unifdef, Libc_old, Libc_10-9 }: -appleDerivation { +appleDerivation' stdenvNoCC { nativeBuildInputs = [ ed unifdef ]; # TODO: asl.h actually comes from syslog project now diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libinfo/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libinfo/default.nix index 5481ae74d38..789e536b8a7 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libinfo/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libinfo/default.nix @@ -1,6 +1,6 @@ -{ appleDerivation }: +{ appleDerivation', stdenvNoCC }: -appleDerivation { +appleDerivation' stdenvNoCC { installPhase = '' substituteInPlace xcodescripts/install_files.sh \ --replace "/usr/local/" "/" \ diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libm/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libm/default.nix index df5f6b7b8fd..6e6712f375e 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libm/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libm/default.nix @@ -1,6 +1,6 @@ -{ appleDerivation }: +{ appleDerivation', stdenvNoCC }: -appleDerivation { +appleDerivation' stdenvNoCC { installPhase = '' mkdir -p $out/include diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libnotify/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libnotify/default.nix index 2ee80d70264..969e64427c9 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libnotify/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libnotify/default.nix @@ -1,6 +1,6 @@ -{ appleDerivation }: +{ appleDerivation', stdenvNoCC }: -appleDerivation { +appleDerivation' stdenvNoCC { installPhase = '' mkdir -p $out/include cp notify.h $out/include diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix index 2c98dd35e39..cb85566b512 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix @@ -1,9 +1,13 @@ -{ lib, appleDerivation, cpio, xnu, Libc, Libm, libdispatch, cctools, Libinfo +{ lib, stdenv, buildPackages +, appleDerivation', cpio, xnu, Libc, Libm, libdispatch, Libinfo , dyld, Csu, architecture, libclosure, CarbonHeaders, ncurses, CommonCrypto -, copyfile, removefile, libresolv, Libnotify, libplatform, libpthread -, mDNSResponder, launchd, libutil, hfs, darling, darwin-stubs }: +, copyfile, removefile, libresolvHeaders, libresolv, Libnotify, libplatform, libpthread +, mDNSResponder, launchd, libutilHeaders, hfsHeaders, darling, darwin-stubs +, headersOnly ? false +, withLibresolv ? !headersOnly +}: -appleDerivation { +appleDerivation' stdenv { dontBuild = true; dontFixup = true; @@ -21,13 +25,13 @@ appleDerivation { for dep in ${Libc} ${Libm} ${Libinfo} ${dyld} ${architecture} \ ${libclosure} ${CarbonHeaders} ${libdispatch} ${ncurses.dev} \ - ${CommonCrypto} ${copyfile} ${removefile} ${libresolv} \ + ${CommonCrypto} ${copyfile} ${removefile} ${libresolvHeaders} \ ${Libnotify} ${libplatform} ${mDNSResponder} ${launchd} \ - ${libutil} ${libpthread} ${hfs}; do + ${libutilHeaders} ${libpthread} ${hfsHeaders}; do (cd $dep/include && find . -name '*.h' | cpio -pdm $out/include) done - (cd ${cctools.dev}/include/mach-o && find . -name '*.h' | cpio -pdm $out/include/mach-o) + (cd ${buildPackages.darwin.cctools.dev}/include/mach-o && find . -name '*.h' | cpio -pdm $out/include/mach-o) mkdir -p $out/include/os @@ -84,6 +88,7 @@ appleDerivation { #define TARGET_RT_64_BIT 1 #endif /* __TARGETCONDITIONALS__ */ EOF + '' + lib.optionalString (!headersOnly) '' # The startup object files cp ${Csu}/lib/* $out/lib @@ -101,14 +106,15 @@ appleDerivation { for name in c dbm dl info m mx poll proc pthread rpcsvc util gcc_s.10.4 gcc_s.10.5; do ln -s libSystem.tbd $out/lib/lib$name.tbd done + '' + lib.optionalString withLibresolv '' # This probably doesn't belong here, but we want to stay similar to glibc, which includes resolv internally... cp ${libresolv}/lib/libresolv.9.dylib $out/lib/libresolv.9.dylib - resolv_libSystem=$(otool -L "$out/lib/libresolv.9.dylib" | tail -n +3 | grep -o "$NIX_STORE.*-\S*") || true + resolv_libSystem=$(${stdenv.cc.bintools.targetPrefix}otool -L "$out/lib/libresolv.9.dylib" | tail -n +3 | grep -o "$NIX_STORE.*-\S*") || true echo $libs chmod +w $out/lib/libresolv.9.dylib - install_name_tool \ + ${stdenv.cc.bintools.targetPrefix}install_name_tool \ -id $out/lib/libresolv.9.dylib \ -change "$resolv_libSystem" /usr/lib/libSystem.dylib \ $out/lib/libresolv.9.dylib diff --git a/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix b/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix index b819057f0c1..bb09adce252 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix @@ -1,6 +1,6 @@ -{ appleDerivation, darwin-stubs }: +{ appleDerivation', stdenv, darwin-stubs }: -appleDerivation { +appleDerivation' stdenv { phases = [ "unpackPhase" "installPhase" ]; __propagatedImpureHostDeps = [ diff --git a/pkgs/os-specific/darwin/apple-source-releases/architecture/default.nix b/pkgs/os-specific/darwin/apple-source-releases/architecture/default.nix index 74327bc4c42..e0e27255b72 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/architecture/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/architecture/default.nix @@ -1,6 +1,6 @@ -{ lib, appleDerivation }: +{ lib, appleDerivation', stdenvNoCC }: -appleDerivation { +appleDerivation' stdenvNoCC { dontBuild = true; postPatch = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/bootstrap_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/bootstrap_cmds/default.nix index 800da92dae9..ff98ed88804 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/bootstrap_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/bootstrap_cmds/default.nix @@ -1,4 +1,13 @@ -{ lib, stdenv, appleDerivation, bison, flex }: +{ lib, appleDerivation, stdenv, bison, flex }: + +let + + # Hard to get CC to pull this off without infinite recursion + targetTargetPrefix = lib.optionalString + (with stdenv; hostPlatform != targetPlatform) + (stdenv.targetPlatform.config + "-"); + +in appleDerivation { nativeBuildInputs = [ bison flex ]; @@ -12,7 +21,7 @@ appleDerivation { yacc -d parser.y flex --header-file=lexxer.yy.h -o lexxer.yy.c lexxer.l - cc -std=gnu99 -Os -dead_strip -DMIG_VERSION=\"$pname-$version\" -I. -o migcom *.c + $CC -std=gnu99 -Os -dead_strip -DMIG_VERSION=\"$pname-$version\" -I. -o migcom *.c ''; installPhase = '' @@ -29,6 +38,6 @@ appleDerivation { --replace 'arch=`/usr/bin/arch`' 'arch=${stdenv.targetPlatform.darwinArch}' \ --replace '/usr/bin/' "" \ --replace '/bin/rmdir' "rmdir" \ - --replace 'C=''${MIGCC}' "C=cc" + --replace 'C=''${MIGCC}' "C=${targetTargetPrefix}cc" ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix index 20168d24dd7..879d3a7b5f7 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix @@ -1,6 +1,6 @@ -{ stdenv, appleDerivation, launchd, bootstrap_cmds, xnu, ppp, IOKit, eap8021x, Security }: +{ stdenv, appleDerivation', launchd, bootstrap_cmds, xnu, ppp, IOKit, eap8021x, Security }: -appleDerivation { +appleDerivation' stdenv { meta.broken = stdenv.cc.nativeLibc; nativeBuildInputs = [ bootstrap_cmds ]; @@ -127,78 +127,78 @@ appleDerivation { mig -arch x86_64 -header derived/helper.h -user derived/helperUser.c -sheader /dev/null -server /dev/null helper/helper.defs mig -arch x86_64 -header derived/pppcontroller.h -user derived/pppcontrollerUser.c -sheader /dev/null -server /dev/null pppcontroller.defs - cc -I. -Ihelper -Iderived -F. -c SCSchemaDefinitions.c -o SCSchemaDefinitions.o - cc -I. -Ihelper -Iderived -F. -c SCD.c -o SCD.o - cc -I. -Ihelper -Iderived -F. -c SCDKeys.c -o SCDKeys.o - cc -I. -Ihelper -Iderived -F. -c SCDPrivate.c -o SCDPrivate.o - cc -I. -Ihelper -Iderived -F. -c SCDPlugin.c -o SCDPlugin.o - cc -I. -Ihelper -Iderived -F. -c CaptiveNetwork.c -o CaptiveNetwork.o - cc -I. -Ihelper -Iderived -F. -c SCDOpen.c -o SCDOpen.o - cc -I. -Ihelper -Iderived -F. -c SCDList.c -o SCDList.o - cc -I. -Ihelper -Iderived -F. -c SCDAdd.c -o SCDAdd.o - cc -I. -Ihelper -Iderived -F. -c SCDGet.c -o SCDGet.o - cc -I. -Ihelper -Iderived -F. -c SCDSet.c -o SCDSet.o - cc -I. -Ihelper -Iderived -F. -c SCDRemove.c -o SCDRemove.o - cc -I. -Ihelper -Iderived -F. -c SCDNotify.c -o SCDNotify.o - cc -I. -Ihelper -Iderived -F. -c SCDNotifierSetKeys.c -o SCDNotifierSetKeys.o - cc -I. -Ihelper -Iderived -F. -c SCDNotifierAdd.c -o SCDNotifierAdd.o - cc -I. -Ihelper -Iderived -F. -c SCDNotifierRemove.c -o SCDNotifierRemove.o - cc -I. -Ihelper -Iderived -F. -c SCDNotifierGetChanges.c -o SCDNotifierGetChanges.o - cc -I. -Ihelper -Iderived -F. -c SCDNotifierWait.c -o SCDNotifierWait.o - cc -I. -Ihelper -Iderived -F. -c SCDNotifierInformViaCallback.c -o SCDNotifierInformViaCallback.o - cc -I. -Ihelper -Iderived -F. -c SCDNotifierInformViaFD.c -o SCDNotifierInformViaFD.o - cc -I. -Ihelper -Iderived -F. -c SCDNotifierInformViaSignal.c -o SCDNotifierInformViaSignal.o - cc -I. -Ihelper -Iderived -F. -c SCDNotifierCancel.c -o SCDNotifierCancel.o - cc -I. -Ihelper -Iderived -F. -c SCDSnapshot.c -o SCDSnapshot.o - cc -I. -Ihelper -Iderived -F. -c SCP.c -o SCP.o - cc -I. -Ihelper -Iderived -F. -c SCPOpen.c -o SCPOpen.o - cc -I. -Ihelper -Iderived -F. -c SCPLock.c -o SCPLock.o - cc -I. -Ihelper -Iderived -F. -c SCPUnlock.c -o SCPUnlock.o - cc -I. -Ihelper -Iderived -F. -c SCPList.c -o SCPList.o - cc -I. -Ihelper -Iderived -F. -c SCPGet.c -o SCPGet.o - cc -I. -Ihelper -Iderived -F. -c SCPAdd.c -o SCPAdd.o - cc -I. -Ihelper -Iderived -F. -c SCPSet.c -o SCPSet.o - cc -I. -Ihelper -Iderived -F. -c SCPRemove.c -o SCPRemove.o - cc -I. -Ihelper -Iderived -F. -c SCPCommit.c -o SCPCommit.o - cc -I. -Ihelper -Iderived -F. -c SCPApply.c -o SCPApply.o - cc -I. -Ihelper -Iderived -F. -c SCPPath.c -o SCPPath.o - cc -I. -Ihelper -Iderived -F. -c SCDConsoleUser.c -o SCDConsoleUser.o - cc -I. -Ihelper -Iderived -F. -c SCDHostName.c -o SCDHostName.o - cc -I. -Ihelper -Iderived -F. -c SCLocation.c -o SCLocation.o - cc -I. -Ihelper -Iderived -F. -c SCNetwork.c -o SCNetwork.o - cc -I. -Ihelper -Iderived -F. -c derived/pppcontrollerUser.c -o pppcontrollerUser.o - cc -I. -Ihelper -Iderived -F. -c SCNetworkConnection.c -o SCNetworkConnection.o - cc -I. -Ihelper -Iderived -F. -c SCNetworkConnectionPrivate.c -o SCNetworkConnectionPrivate.o - cc -I. -Ihelper -Iderived -I../dnsinfo -F. -c SCNetworkReachability.c -o SCNetworkReachability.o - cc -I. -Ihelper -Iderived -F. -c SCProxies.c -o SCProxies.o - cc -I. -Ihelper -Iderived -F. -c DHCP.c -o DHCP.o - cc -I. -Ihelper -Iderived -F. -c moh.c -o moh.o - cc -I. -Ihelper -Iderived -F. -c DeviceOnHold.c -o DeviceOnHold.o - cc -I. -Ihelper -Iderived -I $HACK -F. -c LinkConfiguration.c -o LinkConfiguration.o - cc -I. -Ihelper -Iderived -F. -c dy_framework.c -o dy_framework.o - cc -I. -Ihelper -Iderived -I $HACK -F. -c VLANConfiguration.c -o VLANConfiguration.o - cc -I. -Ihelper -Iderived -F. -c derived/configUser.c -o configUser.o - cc -I. -Ihelper -Iderived -F. -c SCPreferencesPathKey.c -o SCPreferencesPathKey.o - cc -I. -Ihelper -Iderived -I../dnsinfo -F. -c derived/shared_dns_infoUser.c -o shared_dns_infoUser.o - cc -I. -Ihelper -Iderived -F. -c SCNetworkConfigurationInternal.c -o SCNetworkConfigurationInternal.o - cc -I. -Ihelper -Iderived -F. -c SCNetworkInterface.c -o SCNetworkInterface.o - cc -I. -Ihelper -Iderived -F. -c SCNetworkProtocol.c -o SCNetworkProtocol.o - cc -I. -Ihelper -Iderived -F. -c SCNetworkService.c -o SCNetworkService.o - cc -I. -Ihelper -Iderived -F. -c SCNetworkSet.c -o SCNetworkSet.o - cc -I. -Ihelper -Iderived -I $HACK -F. -c BondConfiguration.c -o BondConfiguration.o - cc -I. -Ihelper -Iderived -I $HACK -F. -c BridgeConfiguration.c -o BridgeConfiguration.o - cc -I. -Ihelper -Iderived -F. -c helper/SCHelper_client.c -o SCHelper_client.o - cc -I. -Ihelper -Iderived -F. -c SCPreferencesKeychainPrivate.c -o SCPreferencesKeychainPrivate.o - cc -I. -Ihelper -Iderived -F. -c SCNetworkSignature.c -o SCNetworkSignature.o - cc -I. -Ihelper -Iderived -F. -c VPNPrivate.c -o VPNPrivate.o - cc -I. -Ihelper -Iderived -F. -c VPNConfiguration.c -o VPNConfiguration.o - cc -I. -Ihelper -Iderived -F. -c VPNTunnel.c -o VPNTunnel.o - cc -I. -Ihelper -Iderived -F. -c derived/helperUser.c -o helperUser.o - cc -I. -Ihelper -Iderived -F. -c reachability/SCNetworkReachabilityServer_client.c -o SCNetworkReachabilityServer_client.o - cc -I. -Ihelper -Iderived -F. -c reachability/rb.c -o rb.o - cc -I. -Ihelper -Iderived -F. -c derived/SystemConfiguration_vers.c -o SystemConfiguration_vers.o - - cc -dynamiclib *.o -install_name $out/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration -dead_strip -framework CoreFoundation -single_module -o SystemConfiguration.framework/SystemConfiguration + $CC -I. -Ihelper -Iderived -F. -c SCSchemaDefinitions.c -o SCSchemaDefinitions.o + $CC -I. -Ihelper -Iderived -F. -c SCD.c -o SCD.o + $CC -I. -Ihelper -Iderived -F. -c SCDKeys.c -o SCDKeys.o + $CC -I. -Ihelper -Iderived -F. -c SCDPrivate.c -o SCDPrivate.o + $CC -I. -Ihelper -Iderived -F. -c SCDPlugin.c -o SCDPlugin.o + $CC -I. -Ihelper -Iderived -F. -c CaptiveNetwork.c -o CaptiveNetwork.o + $CC -I. -Ihelper -Iderived -F. -c SCDOpen.c -o SCDOpen.o + $CC -I. -Ihelper -Iderived -F. -c SCDList.c -o SCDList.o + $CC -I. -Ihelper -Iderived -F. -c SCDAdd.c -o SCDAdd.o + $CC -I. -Ihelper -Iderived -F. -c SCDGet.c -o SCDGet.o + $CC -I. -Ihelper -Iderived -F. -c SCDSet.c -o SCDSet.o + $CC -I. -Ihelper -Iderived -F. -c SCDRemove.c -o SCDRemove.o + $CC -I. -Ihelper -Iderived -F. -c SCDNotify.c -o SCDNotify.o + $CC -I. -Ihelper -Iderived -F. -c SCDNotifierSetKeys.c -o SCDNotifierSetKeys.o + $CC -I. -Ihelper -Iderived -F. -c SCDNotifierAdd.c -o SCDNotifierAdd.o + $CC -I. -Ihelper -Iderived -F. -c SCDNotifierRemove.c -o SCDNotifierRemove.o + $CC -I. -Ihelper -Iderived -F. -c SCDNotifierGetChanges.c -o SCDNotifierGetChanges.o + $CC -I. -Ihelper -Iderived -F. -c SCDNotifierWait.c -o SCDNotifierWait.o + $CC -I. -Ihelper -Iderived -F. -c SCDNotifierInformViaCallback.c -o SCDNotifierInformViaCallback.o + $CC -I. -Ihelper -Iderived -F. -c SCDNotifierInformViaFD.c -o SCDNotifierInformViaFD.o + $CC -I. -Ihelper -Iderived -F. -c SCDNotifierInformViaSignal.c -o SCDNotifierInformViaSignal.o + $CC -I. -Ihelper -Iderived -F. -c SCDNotifierCancel.c -o SCDNotifierCancel.o + $CC -I. -Ihelper -Iderived -F. -c SCDSnapshot.c -o SCDSnapshot.o + $CC -I. -Ihelper -Iderived -F. -c SCP.c -o SCP.o + $CC -I. -Ihelper -Iderived -F. -c SCPOpen.c -o SCPOpen.o + $CC -I. -Ihelper -Iderived -F. -c SCPLock.c -o SCPLock.o + $CC -I. -Ihelper -Iderived -F. -c SCPUnlock.c -o SCPUnlock.o + $CC -I. -Ihelper -Iderived -F. -c SCPList.c -o SCPList.o + $CC -I. -Ihelper -Iderived -F. -c SCPGet.c -o SCPGet.o + $CC -I. -Ihelper -Iderived -F. -c SCPAdd.c -o SCPAdd.o + $CC -I. -Ihelper -Iderived -F. -c SCPSet.c -o SCPSet.o + $CC -I. -Ihelper -Iderived -F. -c SCPRemove.c -o SCPRemove.o + $CC -I. -Ihelper -Iderived -F. -c SCPCommit.c -o SCPCommit.o + $CC -I. -Ihelper -Iderived -F. -c SCPApply.c -o SCPApply.o + $CC -I. -Ihelper -Iderived -F. -c SCPPath.c -o SCPPath.o + $CC -I. -Ihelper -Iderived -F. -c SCDConsoleUser.c -o SCDConsoleUser.o + $CC -I. -Ihelper -Iderived -F. -c SCDHostName.c -o SCDHostName.o + $CC -I. -Ihelper -Iderived -F. -c SCLocation.c -o SCLocation.o + $CC -I. -Ihelper -Iderived -F. -c SCNetwork.c -o SCNetwork.o + $CC -I. -Ihelper -Iderived -F. -c derived/pppcontrollerUser.c -o pppcontrollerUser.o + $CC -I. -Ihelper -Iderived -F. -c SCNetworkConnection.c -o SCNetworkConnection.o + $CC -I. -Ihelper -Iderived -F. -c SCNetworkConnectionPrivate.c -o SCNetworkConnectionPrivate.o + $CC -I. -Ihelper -Iderived -I../dnsinfo -F. -c SCNetworkReachability.c -o SCNetworkReachability.o + $CC -I. -Ihelper -Iderived -F. -c SCProxies.c -o SCProxies.o + $CC -I. -Ihelper -Iderived -F. -c DHCP.c -o DHCP.o + $CC -I. -Ihelper -Iderived -F. -c moh.c -o moh.o + $CC -I. -Ihelper -Iderived -F. -c DeviceOnHold.c -o DeviceOnHold.o + $CC -I. -Ihelper -Iderived -I $HACK -F. -c LinkConfiguration.c -o LinkConfiguration.o + $CC -I. -Ihelper -Iderived -F. -c dy_framework.c -o dy_framework.o + $CC -I. -Ihelper -Iderived -I $HACK -F. -c VLANConfiguration.c -o VLANConfiguration.o + $CC -I. -Ihelper -Iderived -F. -c derived/configUser.c -o configUser.o + $CC -I. -Ihelper -Iderived -F. -c SCPreferencesPathKey.c -o SCPreferencesPathKey.o + $CC -I. -Ihelper -Iderived -I../dnsinfo -F. -c derived/shared_dns_infoUser.c -o shared_dns_infoUser.o + $CC -I. -Ihelper -Iderived -F. -c SCNetworkConfigurationInternal.c -o SCNetworkConfigurationInternal.o + $CC -I. -Ihelper -Iderived -F. -c SCNetworkInterface.c -o SCNetworkInterface.o + $CC -I. -Ihelper -Iderived -F. -c SCNetworkProtocol.c -o SCNetworkProtocol.o + $CC -I. -Ihelper -Iderived -F. -c SCNetworkService.c -o SCNetworkService.o + $CC -I. -Ihelper -Iderived -F. -c SCNetworkSet.c -o SCNetworkSet.o + $CC -I. -Ihelper -Iderived -I $HACK -F. -c BondConfiguration.c -o BondConfiguration.o + $CC -I. -Ihelper -Iderived -I $HACK -F. -c BridgeConfiguration.c -o BridgeConfiguration.o + $CC -I. -Ihelper -Iderived -F. -c helper/SCHelper_client.c -o SCHelper_client.o + $CC -I. -Ihelper -Iderived -F. -c SCPreferencesKeychainPrivate.c -o SCPreferencesKeychainPrivate.o + $CC -I. -Ihelper -Iderived -F. -c SCNetworkSignature.c -o SCNetworkSignature.o + $CC -I. -Ihelper -Iderived -F. -c VPNPrivate.c -o VPNPrivate.o + $CC -I. -Ihelper -Iderived -F. -c VPNConfiguration.c -o VPNConfiguration.o + $CC -I. -Ihelper -Iderived -F. -c VPNTunnel.c -o VPNTunnel.o + $CC -I. -Ihelper -Iderived -F. -c derived/helperUser.c -o helperUser.o + $CC -I. -Ihelper -Iderived -F. -c reachability/SCNetworkReachabilityServer_client.c -o SCNetworkReachabilityServer_client.o + $CC -I. -Ihelper -Iderived -F. -c reachability/rb.c -o rb.o + $CC -I. -Ihelper -Iderived -F. -c derived/SystemConfiguration_vers.c -o SystemConfiguration_vers.o + + $CC -dynamiclib *.o -install_name $out/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration -dead_strip -framework CoreFoundation -single_module -o SystemConfiguration.framework/SystemConfiguration popd >/dev/null ''; diff --git a/pkgs/os-specific/darwin/apple-source-releases/copyfile/default.nix b/pkgs/os-specific/darwin/apple-source-releases/copyfile/default.nix index 7e1dc5309b1..5e7f38e84d7 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/copyfile/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/copyfile/default.nix @@ -1,6 +1,6 @@ -{ appleDerivation }: +{ appleDerivation', stdenvNoCC }: -appleDerivation { +appleDerivation' stdenvNoCC { dontBuild = true; installPhase = '' mkdir -p $out/include/ diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix index 3e431810f20..5e098926d29 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, stdenvNoCC, fetchurl, fetchzip, pkgs }: +{ lib, stdenv, fetchurl, fetchzip, pkgs }: let # This attrset can in theory be computed automatically, but for that to work nicely we need @@ -154,7 +154,7 @@ let version = versions.${sdkName}.${pname}; in fetchApple' pname version sha256; - appleDerivation' = pname: version: sdkName: sha256: attrs: stdenv.mkDerivation ({ + appleDerivation'' = stdenv: pname: version: sdkName: sha256: attrs: stdenv.mkDerivation ({ inherit pname version; src = if attrs ? srcs then null else (fetchApple' pname version sha256); @@ -223,8 +223,9 @@ let applePackage' = namePath: version: sdkName: sha256: let pname = builtins.head (lib.splitString "/" namePath); - appleDerivation = appleDerivation' pname version sdkName sha256; - callPackage = self.newScope { inherit appleDerivation; }; + appleDerivation' = stdenv: appleDerivation'' stdenv pname version sdkName sha256; + appleDerivation = appleDerivation' stdenv; + callPackage = self.newScope { inherit appleDerivation' appleDerivation; }; in callPackage (./. + "/${namePath}"); applePackage = namePath: sdkName: sha256: let @@ -272,17 +273,16 @@ developerToolsPackages_11_3_1 // macosPackages_11_0_1 // { libplatform = applePackage "libplatform" "osx-10.12.6" "0rh1f5ybvwz8s0nwfar8s0fh7jbgwqcy903cv2x8m15iq1x599yn" {}; libpthread = applePackage "libpthread" "osx-10.12.6" "1j6541rcgjpas1fc77ip5krjgw4bvz6jq7bq7h9q7axb0jv2ns6c" {}; libresolv = applePackage "libresolv" "osx-10.12.6" "077j6ljfh7amqpk2146rr7dsz5vasvr3als830mgv5jzl7l6vz88" {}; - Libsystem = applePackage "Libsystem" "osx-10.12.6" "1082ircc1ggaq3wha218vmfa75jqdaqidsy1bmrc4ckfkbr3bwx2" { - libutil = pkgs.darwin.libutil.override { headersOnly = true; }; - hfs = pkgs.darwin.hfs.override { headersOnly = true; }; - }; + Libsystem = applePackage "Libsystem" "osx-10.12.6" "1082ircc1ggaq3wha218vmfa75jqdaqidsy1bmrc4ckfkbr3bwx2" {}; libutil = applePackage "libutil" "osx-10.12.6" "0lqdxaj82h8yjbjm856jjz9k2d96k0viimi881akfng08xk1246y" {}; libunwind = applePackage "libunwind" "osx-10.12.6" "0miffaa41cv0lzf8az5k1j1ng8jvqvxcr4qrlkf3xyj479arbk1b" {}; mDNSResponder = applePackage "mDNSResponder" "osx-10.12.6" "02ms1p8zlgmprzn65jzr7yaqxykh3zxjcrw0c06aayim6h0dsqfy" {}; objc4 = applePackage "objc4" "osx-10.12.6" "1cj1vhbcs9pkmag2ms8wslagicnq9bxi2qjkszmp3ys7z7ccrbwz" {}; ppp = applePackage "ppp" "osx-10.12.6" "1kcc2nc4x1kf8sz0a23i6nfpvxg381kipi0qdisrp8x9z2gbkxb8" {}; removefile = applePackage "removefile" "osx-10.12.6" "0jzjxbmxgjzhssqd50z7kq9dlwrv5fsdshh57c0f8mdwcs19bsyx" {}; - xnu = applePackage "xnu" "osx-10.12.6" "1sjb0i7qzz840v2h4z3s4jyjisad4r5yyi6sg8pakv3wd81i5fg5" {}; + xnu = applePackage "xnu" "osx-10.12.6" "1sjb0i7qzz840v2h4z3s4jyjisad4r5yyi6sg8pakv3wd81i5fg5" { + python3 = pkgs.buildPackages.buildPackages.python3; # TODO(@Ericson2314) this shouldn't be needed. + }; hfs = applePackage "hfs" "osx-10.12.6" "1mj3xvqpq1mgd80b6kl1s04knqnap7hccr0gz8rjphalq14rbl5g" {}; Librpcsvc = applePackage "Librpcsvc" "osx-10.11.6" "1zwfwcl9irxl1dlnf2b4v30vdybp0p0r6n6g1pd14zbdci1jcg2k" {}; adv_cmds = applePackage "adv_cmds" "osx-10.11.6" "12gbv35i09aij9g90p6b3x2f3ramw43qcb2gjrg8lzkzmwvcyw9q" {}; @@ -297,6 +297,10 @@ developerToolsPackages_11_3_1 // macosPackages_11_0_1 // { top = applePackage "top" "osx-10.11.6" "0i9120rfwapgwdvjbfg0ya143i29s1m8zbddsxh39pdc59xnsg5l" {}; PowerManagement = applePackage "PowerManagement" "osx-10.11.6" "1llimhvp0gjffd47322lnjq7cqwinx0c5z7ikli04ad5srpa68mh" {}; + libutilHeaders = pkgs.darwin.libutil.override { headersOnly = true; }; + hfsHeaders = pkgs.darwin.hfs.override { headersOnly = true; }; + libresolvHeaders= pkgs.darwin.libresolv.override { headersOnly = true; }; + # TODO(matthewbauer): # To be removed, once I figure out how to build a newer Security version. Security = applePackage "Security/boot.nix" "osx-10.9.5" "1nv0dczf67dhk17hscx52izgdcyacgyy12ag0jh6nl5hmfzsn8yy" {}; diff --git a/pkgs/os-specific/darwin/apple-source-releases/dyld/default.nix b/pkgs/os-specific/darwin/apple-source-releases/dyld/default.nix index 01d44d22f5e..ca3b70cd092 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/dyld/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/dyld/default.nix @@ -1,6 +1,6 @@ -{ lib, appleDerivation }: +{ lib, appleDerivation', stdenvNoCC }: -appleDerivation { +appleDerivation' stdenvNoCC { installPhase = '' mkdir -p $out/lib $out/include ln -s /usr/lib/dyld $out/lib/dyld diff --git a/pkgs/os-specific/darwin/apple-source-releases/eap8021x/default.nix b/pkgs/os-specific/darwin/apple-source-releases/eap8021x/default.nix index b24d94b9d70..f5c47f01d37 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/eap8021x/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/eap8021x/default.nix @@ -1,6 +1,6 @@ -{ appleDerivation }: +{ appleDerivation', stdenv }: -appleDerivation { +appleDerivation' stdenv { dontBuild = true; installPhase = '' mkdir -p $out/Library/Frameworks/EAP8021X.framework/Headers diff --git a/pkgs/os-specific/darwin/apple-source-releases/hfs/default.nix b/pkgs/os-specific/darwin/apple-source-releases/hfs/default.nix index 58bac765a95..093e8525e58 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/hfs/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/hfs/default.nix @@ -1,6 +1,6 @@ -{ appleDerivation, lib, headersOnly ? true }: +{ appleDerivation', stdenv, stdenvNoCC, lib, headersOnly ? true }: -appleDerivation { +appleDerivation' (if headersOnly then stdenvNoCC else stdenv) { installPhase = lib.optionalString headersOnly '' mkdir -p $out/include/hfs cp core/*.h $out/include/hfs diff --git a/pkgs/os-specific/darwin/apple-source-releases/launchd/default.nix b/pkgs/os-specific/darwin/apple-source-releases/launchd/default.nix index c882b83d0a3..67e051d5685 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/launchd/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/launchd/default.nix @@ -1,6 +1,6 @@ -{ appleDerivation }: +{ appleDerivation', stdenvNoCC }: -appleDerivation { +appleDerivation' stdenvNoCC { # No clue why the same file has two different names. Ask Apple! installPhase = '' mkdir -p $out/include/ $out/include/servers diff --git a/pkgs/os-specific/darwin/apple-source-releases/libclosure/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libclosure/default.nix index d42a288208c..976658b7e5d 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libclosure/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libclosure/default.nix @@ -1,6 +1,6 @@ -{ appleDerivation }: +{ appleDerivation', stdenvNoCC }: -appleDerivation { +appleDerivation' stdenvNoCC { installPhase = '' mkdir -p $out/include cp *.h $out/include/ diff --git a/pkgs/os-specific/darwin/apple-source-releases/libdispatch/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libdispatch/default.nix index 3b9d4a34cc6..e91ee86cde0 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libdispatch/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libdispatch/default.nix @@ -1,6 +1,6 @@ -{ appleDerivation }: +{ appleDerivation', stdenvNoCC }: -appleDerivation { +appleDerivation' stdenvNoCC { dontConfigure = true; dontBuild = true; installPhase = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/libplatform/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libplatform/default.nix index 9acbcb212e4..39c80196269 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libplatform/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libplatform/default.nix @@ -1,6 +1,6 @@ -{ appleDerivation }: +{ appleDerivation', stdenvNoCC }: -appleDerivation { +appleDerivation' stdenvNoCC { installPhase = '' mkdir $out cp -r include $out/include diff --git a/pkgs/os-specific/darwin/apple-source-releases/libpthread/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libpthread/default.nix index 20eccd82059..3d62270d76c 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libpthread/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libpthread/default.nix @@ -1,6 +1,6 @@ -{ lib, appleDerivation, libdispatch, xnu }: +{ lib, appleDerivation', stdenvNoCC, libdispatch, xnu }: -appleDerivation { +appleDerivation' stdenvNoCC { propagatedBuildInputs = [ libdispatch xnu ]; installPhase = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/libresolv/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libresolv/default.nix index f3c7558cfc6..53fc019768d 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libresolv/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libresolv/default.nix @@ -1,37 +1,39 @@ -{ appleDerivation, Libinfo, configd, mDNSResponder }: +{ lib, appleDerivation', stdenv, stdenvNoCC, Libinfo, configd, mDNSResponder +, headersOnly ? false +}: -appleDerivation { - buildInputs = [ Libinfo configd mDNSResponder ]; +appleDerivation' (if headersOnly then stdenvNoCC else stdenv) { + buildInputs = lib.optionals (!headersOnly) [ Libinfo configd mDNSResponder ]; - buildPhase = '' - cc -I. -c dns_util.c - cc -I. -c dns.c - cc -I. -c dns_async.c - cc -I. -c base64.c - cc -I. -c dst_api.c - cc -I. -c dst_hmac_link.c - cc -I. -c dst_support.c - cc -I. -c ns_date.c - cc -I. -c ns_name.c - cc -I. -c ns_netint.c - cc -I. -c ns_parse.c - cc -I. -c ns_print.c - cc -I. -c ns_samedomain.c - cc -I. -c ns_sign.c - cc -I. -c ns_ttl.c - cc -I. -c ns_verify.c - cc -I. -c res_comp.c - cc -I. -c res_data.c - cc -I. -c res_debug.c - cc -I. -c res_findzonecut.c - cc -I. -c res_init.c - cc -I. -c res_mkquery.c - cc -I. -c res_mkupdate.c - cc -I. -c res_query.c - cc -I. -c res_send.c - cc -I. -c res_sendsigned.c - cc -I. -c res_update.c - cc -dynamiclib -install_name $out/lib/libresolv.9.dylib -current_version 1.0.0 -compatibility_version 1.0.0 -o libresolv.9.dylib *.o + buildPhase = lib.optionalString (!headersOnly) '' + $CC -I. -c dns_util.c + $CC -I. -c dns.c + $CC -I. -c dns_async.c + $CC -I. -c base64.c + $CC -I. -c dst_api.c + $CC -I. -c dst_hmac_link.c + $CC -I. -c dst_support.c + $CC -I. -c ns_date.c + $CC -I. -c ns_name.c + $CC -I. -c ns_netint.c + $CC -I. -c ns_parse.c + $CC -I. -c ns_print.c + $CC -I. -c ns_samedomain.c + $CC -I. -c ns_sign.c + $CC -I. -c ns_ttl.c + $CC -I. -c ns_verify.c + $CC -I. -c res_comp.c + $CC -I. -c res_data.c + $CC -I. -c res_debug.c + $CC -I. -c res_findzonecut.c + $CC -I. -c res_init.c + $CC -I. -c res_mkquery.c + $CC -I. -c res_mkupdate.c + $CC -I. -c res_query.c + $CC -I. -c res_send.c + $CC -I. -c res_sendsigned.c + $CC -I. -c res_update.c + $CC -dynamiclib -install_name $out/lib/libresolv.9.dylib -current_version 1.0.0 -compatibility_version 1.0.0 -o libresolv.9.dylib *.o ''; installPhase = '' @@ -42,6 +44,7 @@ appleDerivation { cp nameser.h $out/include ln -s ../nameser.h $out/include/arpa cp resolv.h $out/include + '' + lib.optionalString (!headersOnly) '' cp libresolv.9.dylib $out/lib ln -s libresolv.9.dylib $out/lib/libresolv.dylib diff --git a/pkgs/os-specific/darwin/apple-source-releases/libutil/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libutil/default.nix index ea9ca75e7e5..e7c8a6b1113 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libutil/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libutil/default.nix @@ -1,9 +1,9 @@ -{ lib, appleDerivation, xcbuildHook +{ lib, stdenv, stdenvNoCC, appleDerivation', xcbuildHook # headersOnly is true when building for libSystem , headersOnly ? false }: -appleDerivation { +appleDerivation' (if headersOnly then stdenvNoCC else stdenv) { nativeBuildInputs = lib.optional (!headersOnly) xcbuildHook; prePatch = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/mDNSResponder/default.nix b/pkgs/os-specific/darwin/apple-source-releases/mDNSResponder/default.nix index f17ed785360..64de728805f 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/mDNSResponder/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/mDNSResponder/default.nix @@ -1,6 +1,6 @@ -{ appleDerivation }: +{ appleDerivation', stdenvNoCC }: -appleDerivation { +appleDerivation' stdenvNoCC { phases = [ "unpackPhase" "installPhase" ]; installPhase = '' diff --git a/pkgs/os-specific/darwin/apple-source-releases/ppp/default.nix b/pkgs/os-specific/darwin/apple-source-releases/ppp/default.nix index 5668c376130..4ced564ffb7 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/ppp/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/ppp/default.nix @@ -1,6 +1,6 @@ -{ appleDerivation }: +{ appleDerivation', stdenv }: -appleDerivation { +appleDerivation' stdenv { dontBuild = true; installPhase = '' mkdir -p $out/include/ppp diff --git a/pkgs/os-specific/darwin/apple-source-releases/removefile/default.nix b/pkgs/os-specific/darwin/apple-source-releases/removefile/default.nix index 0b2c1c9c7dc..611f445e1ec 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/removefile/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/removefile/default.nix @@ -1,6 +1,6 @@ -{ appleDerivation }: +{ appleDerivation', stdenvNoCC }: -appleDerivation { +appleDerivation' stdenvNoCC { installPhase = '' mkdir -p $out/include/ cp removefile.h checkint.h $out/include/ diff --git a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix b/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix index 9892814468e..90f572d3940 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix @@ -1,8 +1,12 @@ -{ appleDerivation, lib, bootstrap_cmds, bison, flex +{ appleDerivation', lib, stdenv, stdenvNoCC, buildPackages +, bootstrap_cmds, bison, flex , gnum4, unifdef, perl, python3 -, headersOnly ? true }: +, headersOnly ? true +}: + +appleDerivation' (if headersOnly then stdenvNoCC else stdenv) ({ + depsBuildBuild = [ buildPackages.stdenv.cc ]; -appleDerivation ({ nativeBuildInputs = [ bootstrap_cmds bison flex gnum4 unifdef perl python3 ]; patches = [ ./python3.patch ]; @@ -44,16 +48,16 @@ appleDerivation ({ PLATFORM = "MacOSX"; SDKVERSION = "10.11"; - CC = "cc"; - CXX = "c++"; + CC = "${stdenv.cc.targetPrefix or ""}cc"; + CXX = "${stdenv.cc.targetPrefix or ""}c++"; MIG = "mig"; MIGCOM = "migcom"; - STRIP = "strip"; - NM = "nm"; + STRIP = "${stdenv.cc.bintools.targetPrefix or ""}strip"; + NM = "${stdenv.cc.bintools.targetPrefix or ""}nm"; UNIFDEF = "unifdef"; DSYMUTIL = "dsymutil"; HOST_OS_VERSION = "10.10"; - HOST_CC = "cc"; + HOST_CC = "${buildPackages.stdenv.cc.targetPrefix or ""}cc"; HOST_FLEX = "flex"; HOST_BISON = "bison"; HOST_GM4 = "m4"; diff --git a/pkgs/os-specific/darwin/darwin-stubs/default.nix b/pkgs/os-specific/darwin/darwin-stubs/default.nix index aa946eb5bf0..6e3439455cc 100644 --- a/pkgs/os-specific/darwin/darwin-stubs/default.nix +++ b/pkgs/os-specific/darwin/darwin-stubs/default.nix @@ -1,6 +1,6 @@ -{ stdenv, fetchurl }: +{ stdenvNoCC, fetchurl }: -stdenv.mkDerivation { +stdenvNoCC.mkDerivation { pname = "darwin-stubs"; version = "10.12"; diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index c2db758bbea..6ccebd20ade 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -201,7 +201,7 @@ in rec { ''; }; - darwin-stubs = superDarwin.darwin-stubs.override { inherit (self) stdenv fetchurl; }; + darwin-stubs = superDarwin.darwin-stubs.override { inherit (self) stdenvNoCC fetchurl; }; dyld = { name = "bootstrap-stage0-dyld"; -- cgit 1.4.1