diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2017-12-29 15:28:56 -0500 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2017-12-29 15:28:56 -0500 |
commit | bc3a6e260a9fc9924f86c36fc522a996df5d3e26 (patch) | |
tree | 21f852d980f96e4e89e4402b5bed5e9eea7b4db4 /pkgs/os-specific | |
parent | 5d336d36bb0cb20d8966e9e426f8621629ac6e03 (diff) | |
parent | 3afe325a3e2f906ba512fb7a2f28f79496711592 (diff) |
Merge commit '3afe325a3e2f906ba512fb7a2f28f79496711592' into mingw32-w64-fix
Diffstat (limited to 'pkgs/os-specific')
71 files changed, 821 insertions, 401 deletions
diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix index 9a6624104f45..5a58410ae926 100644 --- a/pkgs/os-specific/darwin/apple-sdk/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk/default.nix @@ -198,23 +198,29 @@ in rec { }; overrides = super: { - QuartzCore = stdenv.lib.overrideDerivation super.QuartzCore (drv: { - installPhase = drv.installPhase + '' - f="$out/Library/Frameworks/QuartzCore.framework/Headers/CoreImage.h" - substituteInPlace "$f" \ - --replace "QuartzCore/../Frameworks/CoreImage.framework/Headers" "CoreImage" - ''; + AppKit = stdenv.lib.overrideDerivation super.AppKit (drv: { + __propagatedImpureHostDeps = drv.__propagatedImpureHostDeps ++ [ + "/System/Library/PrivateFrameworks/" + ]; }); - CoreServices = stdenv.lib.overrideDerivation super.CoreServices (drv: { - __propagatedSandboxProfile = drv.__propagatedSandboxProfile ++ ['' - (allow mach-lookup (global-name "com.apple.CoreServices.coreservicesd")) - '']; + CoreMedia = stdenv.lib.overrideDerivation super.CoreMedia (drv: { + __propagatedImpureHostDeps = drv.__propagatedImpureHostDeps ++ [ + "/System/Library/Frameworks/CoreImage.framework" + ]; }); Security = stdenv.lib.overrideDerivation super.Security (drv: { setupHook = ./security-setup-hook.sh; }); + + QuartzCore = stdenv.lib.overrideDerivation super.QuartzCore (drv: { + installPhase = drv.installPhase + '' + f="$out/Library/Frameworks/QuartzCore.framework/Headers/CoreImage.h" + substituteInPlace "$f" \ + --replace "QuartzCore/../Frameworks/CoreImage.framework/Headers" "CoreImage" + ''; + }); }; bareFrameworks = stdenv.lib.mapAttrs framework (import ./frameworks.nix { 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 8dcf28a59094..7fd32a64fe57 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix @@ -1,25 +1,23 @@ { stdenv, appleDerivation }: appleDerivation { - postUnpack = '' - substituteInPlace $sourceRoot/Makefile \ - --replace "/usr/lib" "/lib" \ - --replace "/usr/local/lib" "/lib" \ - --replace "/usr/bin" "" \ - --replace "/bin/" "" \ + prePatch = '' + substituteInPlace Makefile \ + --replace /usr/lib /lib \ + --replace /usr/local/lib /lib \ + --replace /usr/bin "" \ + --replace /bin/ "" \ --replace "CC = " "CC = cc #" \ - --replace "SDK_DIR = " "SDK_DIR = . #" - ''; - - # Mac OS didn't support rpaths back before 10.5, and this package intentionally builds stubs targeting versions prior to that - NIX_DONT_SET_RPATH = "1"; - NIX_NO_SELF_RPATH = "1"; + --replace "SDK_DIR = " "SDK_DIR = . #" \ - installPhase = '' - export DSTROOT=$out - make install + # Mac OS didn't support rpaths back before 10.5, but we don't care about it. + substituteInPlace Makefile \ + --replace -mmacosx-version-min=10.4 -mmacosx-version-min=10.6 \ + --replace -mmacosx-version-min=10.5 -mmacosx-version-min=10.6 ''; + installFlags = [ "DSTROOT=$(out)" ]; + meta = with stdenv.lib; { description = "Apple's common startup stubs for darwin"; maintainers = with maintainers; [ copumpkin ]; 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 3d7e59f15547..28406c9751dc 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix @@ -23,7 +23,7 @@ appleDerivation rec { (cd $dep/include && find . -name '*.h' | cpio -pdm $out/include) done - (cd ${cctools}/include/mach-o && find . -name '*.h' | cpio -pdm $out/include/mach-o) + (cd ${cctools.dev}/include/mach-o && find . -name '*.h' | cpio -pdm $out/include/mach-o) cat <<EOF > $out/include/TargetConditionals.h #ifndef __TARGETCONDITIONALS__ 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 2b31b0420402..20168d24dd71 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix @@ -8,10 +8,6 @@ appleDerivation { propagatedBuildInputs = [ Security ]; - propagatedSandboxProfile = '' - (allow mach-lookup (global-name "com.apple.SystemConfiguration.configd")) - ''; - patchPhase = '' HACK=$PWD/hack mkdir $HACK diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix index 965632b5788d..478f9e7e303f 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix @@ -42,6 +42,7 @@ let adv_cmds = "163"; file_cmds = "264.1.1"; shell_cmds = "187"; + system_cmds = "550.6"; }; "osx-10.11.5" = { Libc = "1082.50.1"; # 10.11.6 still unreleased :/ @@ -240,6 +241,7 @@ let network_cmds = applePackage "network_cmds" "osx-10.11.6" "0lhi9wz84qr1r2ab3fb4nvmdg9gxn817n5ldg7zw9gnf3wwn42kw" {}; file_cmds = applePackage "file_cmds" "osx-10.11.6" "1zfxbmasps529pnfdjvc13p7ws2cfx8pidkplypkswyff0nff4wp" {}; shell_cmds = applePackage "shell_cmds" "osx-10.11.6" "0084k271v66h4jqp7q7rmjvv7w4mvhx3aq860qs8jbd30canm86n" {}; + system_cmds = applePackage "system_cmds" "osx-10.11.6" "1h46j2c5v02pkv5d9fyv6cpgyg0lczvwicrx6r9s210cl03l77jl" {}; libsecurity_apple_csp = libsecPackage "libsecurity_apple_csp" "osx-10.7.5" "1ngyn1ik27n4x981px3kfd1z1n8zx7r5w812b6qfjpy5nw4h746w" {}; libsecurity_apple_cspdl = libsecPackage "libsecurity_apple_cspdl" "osx-10.7.5" "1svqa5fhw7p7njzf8bzg7zgc5776aqjhdbnlhpwmr5hmz5i0x8r7" {}; diff --git a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix new file mode 100644 index 000000000000..2247ef3ddd2f --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix @@ -0,0 +1,37 @@ +{ stdenv, appleDerivation, xcbuild }: + +appleDerivation rec { + # xcbuild fails with: + # /nix/store/fc0rz62dh8vr648qi7hnqyik6zi5sqx8-xcbuild-wrapper/nix-support/setup-hook: line 1: 9083 Segmentation fault: 11 xcodebuild OTHER_CFLAGS="$NIX_CFLAGS_COMPILE" OTHER_CPLUSPLUSFLAGS="$NIX_CFLAGS_COMPILE" OTHER_LDFLAGS="$NIX_LDFLAGS" build + # buildInputs = [ xcbuild ]; + + # # temporary install phase until xcodebuild has "install" support + # installPhase = '' + # mkdir -p $out/bin/ + # install system_cmds-*/Build/Products/Release/* $out/bin/ + + # for n in 1 5 8; do + # mkdir -p $out/share/man/man$n + # install */*.$n $out/share/man/man$n + # done + # ''; + + # For now we just build sysctl because that's all I need... Please open a + # PR if you need any other utils before we fix the xcodebuild. + buildPhase = "cc sysctl.tproj/sysctl.c -o sysctl"; + + installPhase = + '' + mkdir -p $out/bin + install sysctl $out/bin + for n in 5 8; do + mkdir -p $out/share/man/man$n + install sysctl.tproj/*.$n $out/share/man/man$n + done + ''; + + meta = { + platforms = stdenv.lib.platforms.darwin; + maintainers = with stdenv.lib.maintainers; [ shlevy ]; + }; +} 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 0ce9c54e48c4..2c7da5be6e4c 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix @@ -1,9 +1,9 @@ -{ stdenv, appleDerivation, fetchzip, bootstrap_cmds, bison, flex, gnum4, unifdef, perl }: +{ stdenv, appleDerivation, fetchzip, bootstrap_cmds, bison, flex, gnum4, unifdef, perl, python }: appleDerivation { phases = [ "unpackPhase" "patchPhase" "installPhase" ]; - buildInputs = [ bootstrap_cmds bison flex gnum4 unifdef perl ]; + buildInputs = [ bootstrap_cmds bison flex gnum4 unifdef perl python ]; patchPhase = '' substituteInPlace Makefile \ diff --git a/pkgs/os-specific/darwin/binutils/default.nix b/pkgs/os-specific/darwin/binutils/default.nix index 5fc0db44f860..613606b50358 100644 --- a/pkgs/os-specific/darwin/binutils/default.nix +++ b/pkgs/os-specific/darwin/binutils/default.nix @@ -3,24 +3,24 @@ }: # Make sure both underlying packages claim to have prepended their binaries -# with the same prefix. -assert binutils-raw.prefix == cctools.prefix; +# with the same targetPrefix. +assert binutils-raw.targetPrefix == cctools.targetPrefix; let - inherit (binutils-raw) prefix; + inherit (binutils-raw) targetPrefix; cmds = [ "ar" "ranlib" "as" "dsymutil" "install_name_tool" "ld" "strip" "otool" "lipo" "nm" "strings" "size" ]; in -# TODO loop over prefixed binaries too +# TODO loop over targetPrefixed binaries too stdenv.mkDerivation { - name = "${prefix}cctools-binutils-darwin"; + name = "${targetPrefix}cctools-binutils-darwin"; buildCommand = '' mkdir -p $out/bin $out/include - ln -s ${binutils-raw.out}/bin/${prefix}c++filt $out/bin/${prefix}c++filt + ln -s ${binutils-raw.out}/bin/${targetPrefix}c++filt $out/bin/${targetPrefix}c++filt # We specifically need: # - ld: binutils doesn't provide it on darwin @@ -33,26 +33,17 @@ stdenv.mkDerivation { # - strip: the binutils one seems to break mach-o files # - lipo: gcc build assumes it exists # - nm: the gnu one doesn't understand many new load commands - for i in ${stdenv.lib.concatStringsSep " " (builtins.map (e: prefix + e) cmds)}; do + for i in ${stdenv.lib.concatStringsSep " " (builtins.map (e: targetPrefix + e) cmds)}; do ln -sf "${cctools}/bin/$i" "$out/bin/$i" done - for i in ${stdenv.lib.getDev binutils-raw}/include/*.h; do - ln -s "$i" "$out/include/$(basename $i)" - done - - for i in ${cctools}/include/*; do - ln -s "$i" "$out/include/$(basename $i)" - done - # FIXME: this will give us incorrect man pages for bits of cctools ln -s ${binutils-raw.out}/share $out/share - ln -s ${binutils-raw.out}/lib $out/lib ln -s ${cctools}/libexec $out/libexec ''; passthru = { - inherit prefix; + inherit targetPrefix; }; } diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix index 1f2e7c143780..bcca11d66b19 100644 --- a/pkgs/os-specific/darwin/cctools/port.nix +++ b/pkgs/os-specific/darwin/cctools/port.nix @@ -5,9 +5,9 @@ }: let - # The prefix prepended to binary names to allow multiple binuntils on the + # The targetPrefix prepended to binary names to allow multiple binuntils on the # PATH to both be usable. - prefix = stdenv.lib.optionalString + targetPrefix = stdenv.lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; in @@ -19,7 +19,7 @@ assert (!hostPlatform.isDarwin) -> (maloader != null && xctoolchain != null); let baseParams = rec { - name = "${prefix}cctools-port-${version}"; + name = "${targetPrefix}cctools-port-${version}"; version = "895"; src = fetchFromGitHub { @@ -29,6 +29,8 @@ let sha256 = "0l45mvyags56jfi24rawms8j2ihbc45mq7v13pkrrwppghqrdn52"; }; + outputs = [ "out" "dev" ]; + nativeBuildInputs = [ autoconf automake libtool_2 ]; buildInputs = [ libuuid ] ++ # Only need llvm and clang if the stdenv isn't already clang-based (TODO: just make a stdenv.cc.isClang) @@ -39,9 +41,15 @@ let ./ld-rpath-nonfinal.patch ./ld-ignore-rpath-link.patch ]; + __propagatedImpureHostDeps = [ + # As far as I can tell, otool from cctools is the only thing that depends on these two, and we should fix them + "/usr/lib/libobjc.A.dylib" + "/usr/lib/libobjc.dylib" + ]; + enableParallelBuilding = true; - # TODO(@Ericson2314): Always pass "--target" and always prefix. + # TODO(@Ericson2314): Always pass "--target" and always targetPrefix. configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = stdenv.lib.optionals (!stdenv.isDarwin) [ "CXXFLAGS=-I${libcxx}/include/c++/v1" @@ -105,7 +113,7 @@ let ''; passthru = { - inherit prefix; + inherit targetPrefix; }; meta = { |