diff options
Diffstat (limited to 'pkgs/os-specific/darwin/apple-source-releases')
8 files changed, 200 insertions, 9 deletions
diff --git a/pkgs/os-specific/darwin/apple-source-releases/Librpcsvc/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Librpcsvc/default.nix new file mode 100644 index 000000000000..512ec6253c78 --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/Librpcsvc/default.nix @@ -0,0 +1,24 @@ +{ stdenv, appleDerivation, developer_cmds }: + +appleDerivation rec { + phases = [ "unpackPhase" "installPhase" ]; + + buildInputs = [ developer_cmds ]; + + installPhase = '' + export DSTROOT=$out + export SRCROOT=$PWD + export OBJROOT=$PWD + + . ./xcodescripts/install_rpcsvc.sh + + mv $out/usr/* $out + rmdir $out/usr/ + ''; + + meta = with stdenv.lib; { + maintainers = with maintainers; [ matthewbauer ]; + platforms = platforms.darwin; + license = licenses.apsl20; + }; +} 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 aac213bb8047..92c54d9b679e 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix @@ -56,9 +56,8 @@ appleDerivation rec { # The startup object files cp ${Csu}/lib/* $out/lib - # Narrowly speaking, these would work if we re-exported libsystem_c and libsystem_kernel, - # but we also need to run the original central libsystem constructor (which initializes - # a ton of crap for its consitutent libraries) so we link against the central library here. + # We can't re-exported libsystem_c and libsystem_kernel directly, + # so we link against the central library here. mkdir -p $out/lib/system ld -macosx_version_min 10.7 -arch x86_64 -dylib \ -o $out/lib/system/libsystem_c.dylib \ @@ -70,8 +69,14 @@ appleDerivation rec { /usr/lib/libSystem.dylib \ -reexported_symbols_list ${./system_kernel_symbols} - libs=$(otool -arch x86_64 -L /usr/lib/libSystem.dylib | tail -n +3 | awk '{ print $1 }') + # The umbrella libSystem also exports some symbols, + # but we don't want to pull in everything from the other libraries. + ld -macosx_version_min 10.7 -arch x86_64 -dylib \ + -o $out/lib/libSystem_internal.dylib \ + /usr/lib/libSystem.dylib \ + -reexported_symbols_list ${./system_symbols} + libs=$(otool -arch x86_64 -L /usr/lib/libSystem.dylib | tail -n +3 | awk '{ print $1 }') for i in $libs; do if [ "$i" != "/usr/lib/system/libsystem_kernel.dylib" ] && [ "$i" != "/usr/lib/system/libsystem_c.dylib" ]; then @@ -79,14 +84,13 @@ appleDerivation rec { fi done - ld -macosx_version_min 10.7 \ - -arch x86_64 \ - -dylib \ + ld -macosx_version_min 10.7 -arch x86_64 -dylib \ -o $out/lib/libSystem.B.dylib \ -compatibility_version 1.0 \ -current_version 1226.10.1 \ -reexport_library $out/lib/system/libsystem_c.dylib \ -reexport_library $out/lib/system/libsystem_kernel.dylib \ + -reexport_library $out/lib/libSystem_internal.dylib \ $args ln -s libSystem.B.dylib $out/lib/libSystem.dylib diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_symbols b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_symbols new file mode 100644 index 000000000000..75a00acac493 --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_symbols @@ -0,0 +1 @@ +_mach_init_routine diff --git a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/xcode.nix b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/xcode.nix new file mode 100644 index 000000000000..254b4a231c22 --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/xcode.nix @@ -0,0 +1,47 @@ +{ stdenv, appleDerivation, fetchurl, xcbuild, libcxx }: + +appleDerivation { + + # pkill requires special private headers that are unavailable in + # NixPkgs. These ones are needed: + # - xpc/xpxc.h + # - os/base_private.h + # - _simple.h + # We disable it here for now. TODO: build pkill inside adv_cmds + + # We also disable locale here because of some issues with a missing + # "lstdc++". + patchPhase = '' + substituteInPlace adv_cmds.xcodeproj/project.pbxproj \ + --replace "FD201DC214369B4200906237 /* pkill.c in Sources */," "" \ + --replace "FDF278D60FC6204E00D7A3C6 /* locale.cc in Sources */," "" + ''; + + # temporary install phase until xcodebuild has "install" support + installPhase = '' + mkdir -p $out/bin/ + install adv_cmds-*/Build/Products/Release/* $out/bin/ + + for n in 1 8; do + mkdir -p $out/share/man/man$n + install */*.$n $out/share/man/man$n + done + + mkdir -p $out/System/Library/LaunchDaemons + install fingerd/finger.plist $out/System/Library/LaunchDaemons + + # from variant_links.sh + # ln -s $out/bin/pkill $out/bin/pgrep + # ln -s $out/share/man/man1/pkill.1 $out/share/man/man1/pgrep.1 + ''; + + buildInputs = [ xcbuild libcxx ]; + + # temporary fix for iostream issue + NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + + meta = { + platforms = stdenv.lib.platforms.darwin; + maintainers = with stdenv.lib.maintainers; [ matthewbauer ]; + }; +} diff --git a/pkgs/os-specific/darwin/apple-source-releases/basic_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/basic_cmds/default.nix new file mode 100644 index 000000000000..9e8b78e57d6c --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/basic_cmds/default.nix @@ -0,0 +1,29 @@ +{ stdenv, appleDerivation, fetchurl, xcbuild }: + +appleDerivation rec { + buildInputs = [ xcbuild ]; + + # These PBXcp calls should be patched in xcbuild to allow them to + # automatically be prefixed. + patchPhase = '' + substituteInPlace basic_cmds.xcodeproj/project.pbxproj \ + --replace "dstPath = /usr/share/man/man1;" "dstPath = $out/share/man/man1;" \ + --replace "dstPath = /usr/share/man/man5;" "dstPath = $out/share/man/man5;" + ''; + + # temporary install phase until xcodebuild has "install" support + installPhase = '' + mkdir -p $out/bin/ + install basic_cmds-*/Build/Products/Release/* $out/bin/ + + for n in 1; do + mkdir -p $out/share/man/man$n + install */*.$n $out/share/man/man$n + done + ''; + + meta = { + platforms = stdenv.lib.platforms.darwin; + maintainers = with stdenv.lib.maintainers; [ matthewbauer ]; + }; +} diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix index 8625ac72c104..c63d7465a13d 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 }: +{ stdenv, fetchurl, fetchzip, pkgs, fetchurlBoot }: let # This attrset can in theory be computed automatically, but for that to work nicely we need @@ -34,6 +34,11 @@ let libutil = "43"; libunwind = "35.3"; + Librpcsvc = "26"; + developer_cmds= "62"; + network_cmds = "481.20.1"; + basic_cmds = "55"; + adv_cmds = "163"; }; "osx-10.11.5" = { Libc = "1082.50.1"; # 10.11.6 still unreleased :/ @@ -123,7 +128,14 @@ let }; }; - fetchApple = version: sha256: name: fetchurl { + fetchApple = version: sha256: name: 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" + then fetchurlBoot + else fetchurl; + in fetch { url = "http://www.opensource.apple.com/tarballs/${name}/${name}-${versions.${version}.${name}}.tar.gz"; inherit sha256; }; @@ -214,6 +226,11 @@ let removefile = applePackage "removefile" "osx-10.11.6" "1b6r74ry3k01kypvlaclf33fha15pcm0kzx9zrymlg66wg0s0i3r" {}; Security = applePackage "Security" "osx-10.9.5" "1nv0dczf67dhk17hscx52izgdcyacgyy12ag0jh6nl5hmfzsn8yy" {}; xnu = applePackage "xnu" "osx-10.11.6" "0yhziq4dqqcbjpf6vyqn8xhwva2zb525gndkx8cp8alzwp76jnr9" {}; + Librpcsvc = applePackage "Librpcsvc" "osx-10.11.6" "1zwfwcl9irxl1dlnf2b4v30vdybp0p0r6n6g1pd14zbdci1jcg2k" {}; + adv_cmds = applePackage "adv_cmds/xcode.nix" "osx-10.11.6" "12gbv35i09aij9g90p6b3x2f3ramw43qcb2gjrg8lzkzmwvcyw9q" {}; + basic_cmds = applePackage "basic_cmds" "osx-10.11.6" "0hvab4b1v5q2x134hdkal0rmz5gsdqyki1vb0dbw4py1bqf0yaw9" {}; + developer_cmds = applePackage "developer_cmds" "osx-10.11.6" "1r9c2b6dcl22diqf90x58psvz797d3lxh4r2wppr7lldgbgn24di" {}; + network_cmds = applePackage "network_cmds" "osx-10.11.6" "0lhi9wz84qr1r2ab3fb4nvmdg9gxn817n5ldg7zw9gnf3wwn42kw" {}; 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/developer_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix new file mode 100644 index 000000000000..67fbf83496ed --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl, appleDerivation, xcbuild }: + +appleDerivation rec { + buildInputs = [ xcbuild ]; + + patchPhase = '' + substituteInPlace rpcgen/rpc_main.c \ + --replace "/usr/bin/cpp" "${stdenv.cc}/bin/cpp" + ''; + + # temporary install phase until xcodebuild has "install" support + installPhase = '' + mkdir -p $out/bin/ + install developer_cmds-*/Build/Products/Release/* $out/bin/ + + for n in 1; do + mkdir -p $out/share/man/man$n + install */*.$n $out/share/man/man$n + done + ''; + + meta = { + platforms = stdenv.lib.platforms.darwin; + maintainers = with stdenv.lib.maintainers; [ matthewbauer ]; + }; +} diff --git a/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix new file mode 100644 index 000000000000..357a87689a03 --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix @@ -0,0 +1,43 @@ +{ stdenv, appleDerivation, xcbuild, openssl, Librpcsvc, xnu, libpcap, developer_cmds }: + +appleDerivation rec { + buildInputs = [ xcbuild openssl xnu Librpcsvc libpcap developer_cmds ]; + + NIX_CFLAGS_COMPILE = " -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/"; + + # "spray" requires some files that aren't compiling correctly in xcbuild. + # "rtadvd" seems to fail with some missing constants. + # We disable spray and rtadvd here for now. + patchPhase = '' + substituteInPlace network_cmds.xcodeproj/project.pbxproj \ + --replace "7294F0EA0EE8BAC80052EC88 /* PBXTargetDependency */," "" \ + --replace "7216D34D0EE89FEC00AE70E4 /* PBXTargetDependency */," "" + ''; + + # temporary install phase until xcodebuild has "install" support + installPhase = '' + mkdir -p $out/bin/ + install network_cmds-*/Build/Products/Release/* $out/bin/ + + for n in 1 5; do + mkdir -p $out/share/man/man$n + install */*.$n $out/share/man/man$n + done + + # TODO: patch files to load from $out/ instead of /usr/ + + # mkdir -p $out/etc/ + # install rtadvd.tproj/rtadvd.conf ip6addrctl.tproj/ip6addrctl.conf $out/etc/ + + # mkdir -p $out/local/OpenSourceVersions/ + # install network_cmds.plist $out/local/OpenSourceVersions/ + + # mkdir -p $out/System/Library/LaunchDaemons + # install kdumpd.tproj/com.apple.kdumpd.plist $out/System/Library/LaunchDaemons + ''; + + meta = { + platforms = stdenv.lib.platforms.darwin; + maintainers = with stdenv.lib.maintainers; [ matthewbauer ]; + }; +} |