diff options
Diffstat (limited to 'pkgs/os-specific/darwin')
6 files changed, 117 insertions, 33 deletions
diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix index 5a58410ae926..7f6f0cdd0c48 100644 --- a/pkgs/os-specific/darwin/apple-sdk/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk/default.nix @@ -210,6 +210,13 @@ in rec { ]; }); + CoreMIDI = stdenv.lib.overrideDerivation super.CoreMIDI (drv: { + __propagatedImpureHostDeps = drv.__propagatedImpureHostDeps ++ [ + "/System/Library/PrivateFrameworks/" + ]; + setupHook = ./private-frameworks-setup-hook.sh; + }); + Security = stdenv.lib.overrideDerivation super.Security (drv: { setupHook = ./security-setup-hook.sh; }); diff --git a/pkgs/os-specific/darwin/apple-sdk/private-frameworks-setup-hook.sh b/pkgs/os-specific/darwin/apple-sdk/private-frameworks-setup-hook.sh new file mode 100644 index 000000000000..fbd977f8552d --- /dev/null +++ b/pkgs/os-specific/darwin/apple-sdk/private-frameworks-setup-hook.sh @@ -0,0 +1,8 @@ +addPrivateFrameworks() { + flag="-F/System/Library/PrivateFrameworks" + if [[ "$NIX_CFLAGS_COMPILE" != *$flag* ]]; then + NIX_CFLAGS_COMPILE+=" $flag" + fi +} + +addEnvHooks "$hostOffset" addPrivateFrameworks diff --git a/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix index 13b6156492bb..d9b3dfb74049 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix @@ -14,6 +14,8 @@ appleDerivation { -Wl,-reexport_library -Wl,$out/lib/libcharset.dylib ''; + setup-hook = ../../../../development/libraries/libiconv/setup-hook.sh; + meta = { platforms = stdenv.lib.platforms.darwin; }; 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 index 2247ef3ddd2f..2579b0b6a0a6 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix @@ -1,37 +1,104 @@ -{ stdenv, appleDerivation, xcbuild }: +{ stdenv, appleDerivation, xcbuild, lib, hostPlatform +, Librpcsvc, apple_sdk, pam, CF, openbsm }: 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 + # see issue facebook/xcbuild#188 # 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 + buildInputs = [ Librpcsvc apple_sdk.frameworks.OpenDirectory pam CF + apple_sdk.frameworks.IOKit openbsm ]; + # NIX_CFLAGS_COMPILE = lib.optionalString hostPlatform.isi686 "-D__i386__" + # + lib.optionalString hostPlatform.isx86_64 "-D__x86_64__" + # + lib.optionalString hostPlatform.isArm "-D__arm__"; + NIX_CFLAGS_COMPILE = [ "-DDAEMON_UID=1" + "-DDAEMON_GID=1" + "-DDEFAULT_AT_QUEUE=\'a\'" + "-DDEFAULT_BATCH_QUEUE=\'b\'" + "-DPERM_PATH=\"/usr/lib/cron/\"" + "-DOPEN_DIRECTORY" + "-DNO_DIRECT_RPC" + "-DAPPLE_GETCONF_UNDERSCORE" + "-DAPPLE_GETCONF_SPEC" + "-DUSE_PAM" + "-DUSE_BSM_AUDIT" + "-D_PW_NAME_LEN=MAXLOGNAME" + "-D_PW_YPTOKEN=\"__YP!\"" + "-DAHZV1=64 " + "-DAU_SESSION_FLAG_HAS_TTY=0x4000" + "-DAU_SESSION_FLAG_HAS_AUTHENTICATED=0x4000" + ] ++ lib.optional (!stdenv.isLinux) " -D__FreeBSD__ "; + + patchPhase = '' + substituteInPlace login.tproj/login.c \ + --replace bsm/audit_session.h bsm/audit.h + substituteInPlace login.tproj/login_audit.c \ + --replace bsm/audit_session.h bsm/audit.h + ''; + + buildPhase = '' + for dir in *.tproj; do + name=$(basename $dir) + name=''${name%.tproj} + + CFLAGS="" + case $name in + arch) CFLAGS="-framework CoreFoundation";; + atrun) CFLAGS="-Iat.tproj";; + chkpasswd) + CFLAGS="-framework OpenDirectory -framework CoreFoundation -lpam";; + getconf) + for f in getconf.tproj/*.gperf; do + cfile=''${f%.gperf}.c + LC_ALL=C awk -f getconf.tproj/fake-gperf.awk $f > $cfile + done + ;; + iostat) CFLAGS="-framework IOKit -framework CoreFoundation";; + login) CFLAGS="-lbsm -lpam";; + nvram) CFLAGS="-framework CoreFoundation -framework IOKit";; + sadc) CFLAGS="-framework IOKit -framework CoreFoundation";; + sar) CFLAGS="-Isadc.tproj";; + esac + + echo "Building $name" + + case $name in + + # These are all broken currently. + arch) continue;; + chpass) continue;; + dirhelper) continue;; + dynamic_pager) continue;; + fs_usage) continue;; + latency) continue;; + pagesize) continue;; + passwd) continue;; + reboot) continue;; + sc_usage) continue;; + shutdown) continue;; + trace) continue;; + + *) cc $dir/*.c -I''${dir} $CFLAGS -o $name ;; + esac + done + ''; + + installPhase = '' + for dir in *.tproj; do + name=$(basename $dir) + name=''${name%.tproj} + [ -x $name ] && install -D $name $out/bin/$name + for n in 1 2 3 4 5 6 7 8 9; do + for f in $dir/*.$n; do + install -D $f $out/share/man/man$n/$(basename $f) + done done - ''; + done + ''; meta = { platforms = stdenv.lib.platforms.darwin; - maintainers = with stdenv.lib.maintainers; [ shlevy ]; + maintainers = with stdenv.lib.maintainers; [ shlevy matthewbauer ]; }; } diff --git a/pkgs/os-specific/darwin/binutils/default.nix b/pkgs/os-specific/darwin/binutils/default.nix index 1fff4915da3c..21d64979d7ea 100644 --- a/pkgs/os-specific/darwin/binutils/default.nix +++ b/pkgs/os-specific/darwin/binutils/default.nix @@ -1,13 +1,13 @@ -{ stdenv, binutils-raw, cctools +{ stdenv, binutils-unwrapped, cctools , hostPlatform, targetPlatform }: # Make sure both underlying packages claim to have prepended their binaries # with the same targetPrefix. -assert binutils-raw.targetPrefix == cctools.targetPrefix; +assert binutils-unwrapped.targetPrefix == cctools.targetPrefix; let - inherit (binutils-raw) targetPrefix; + inherit (binutils-unwrapped) targetPrefix; cmds = [ "ar" "ranlib" "as" "dsymutil" "install_name_tool" "ld" "strip" "otool" "lipo" "nm" "strings" "size" @@ -21,7 +21,7 @@ stdenv.mkDerivation { buildCommand = '' mkdir -p $out/bin $out/include - ln -s ${binutils-raw.bintools.out}/bin/${targetPrefix}c++filt $out/bin/${targetPrefix}c++filt + ln -s ${binutils-unwrapped.out}/bin/${targetPrefix}c++filt $out/bin/${targetPrefix}c++filt # We specifically need: # - ld: binutils doesn't provide it on darwin @@ -38,15 +38,15 @@ stdenv.mkDerivation { ln -sf "${cctools}/bin/$i" "$out/bin/$i" done - ln -s ${binutils-raw.bintools.out}/share $out/share + ln -s ${binutils-unwrapped.out}/share $out/share ln -s ${cctools}/libexec $out/libexec mkdir -p "$info/nix-support" "$man/nix-support" - printWords ${binutils-raw.bintools.info} \ + printWords ${binutils-unwrapped.info} \ >> $info/nix-support/propagated-build-inputs # FIXME: cctools missing man pages - printWords ${binutils-raw.bintools.man} \ + printWords ${binutils-unwrapped.man} \ >> $man/nix-support/propagated-build-inputs ''; diff --git a/pkgs/os-specific/darwin/opencflite/default.nix b/pkgs/os-specific/darwin/opencflite/default.nix index 09a346e4446d..960e0677da1e 100644 --- a/pkgs/os-specific/darwin/opencflite/default.nix +++ b/pkgs/os-specific/darwin/opencflite/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "0jgmzs0ycl930hmzcvx0ykryik56704yw62w394q1q3xw5kkjn9v"; }; - configureFlags = [ "--with-uuid=${libuuid}" ]; + configureFlags = [ "--with-uuid=${libuuid.dev}" ]; buildInputs = [ icu tzdata.dev ]; enableParallelBuilding = true; |