Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 88ed9271bdb4
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b8b7b32141fc
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on May 26, 2017

  1. apple-sdk: 10.9 -> 10.10

    This is a slightly less ambitious version of the (now reverted) commit
    377cef8, which had a bunch of issues
    that I don't have time to resolve right now.
    
    (cherry picked from commit 59b795c)
    copumpkin authored and shlevy committed May 26, 2017
    Copy the full SHA
    96a5ae5 View commit details
  2. darwin: add setup-hook to fix CF references

    (cherry picked from commit 04fa8e0)
    LnL7 authored and shlevy committed May 26, 2017
    Copy the full SHA
    a6f1faf View commit details
  3. darwin-frameworks: don't use pure CF

    (cherry picked from commit 97a3e7c)
    LnL7 authored and shlevy committed May 26, 2017
    Copy the full SHA
    b8b7b32 View commit details
31 changes: 31 additions & 0 deletions pkgs/build-support/setup-hooks/fix-darwin-frameworks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# On Mac OS X, frameworks are linked to the system CoreFoundation but
# dynamic libraries built with nix use a pure version of CF this
# causes segfaults for binaries that depend on it at runtime. This
# can be solved in two ways.
# 1. Rewrite references to the pure CF using this setup hook, this
# works for the simple case but this can still cause problems if other
# dependencies (eg. python) use the pure CF.
# 2. Create a wrapper for the binary that sets DYLD_FRAMEWORK_PATH to
# /System/Library/Frameworks. This will make everything load the
# system's CoreFoundation framework while still keeping the
# dependencies pure for other packages.

fixupOutputHooks+=('fixDarwinFrameworksIn $prefix')

fixDarwinFrameworks() {
local systemPrefix='/System/Library/Frameworks'

for fn in "$@"; do
if [ -L "$fn" ]; then continue; fi
echo "$fn: fixing dylib"

for framework in $(otool -L "$fn" | awk '/CoreFoundation\.framework/ {print $1}'); do
install_name_tool -change "$framework" "$systemPrefix/CoreFoundation.framework/Versions/A/CoreFoundation" "$fn" >&2
done
done
}

fixDarwinFrameworksIn() {
local dir="$1"
fixDarwinFrameworks $(find "$dir" -name "*.dylib")
}
27 changes: 22 additions & 5 deletions pkgs/os-specific/darwin/apple-sdk/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
{ stdenv, fetchurl, xar, gzip, cpio, pkgs }:
{ stdenv, fetchurl, xar, xz, cpio, pkgs, python }:

let
# TODO: make this available to other packages and generalize the unpacking a bit
# from https://gist.github.com/pudquick/ff412bcb29c9c1fa4b8d
# This isn't needed until we get to SDK 10.11, but that presents other challenges
# unpbzx = fetchurl {
# url = "https://gist.githubusercontent.com/pudquick/ff412bcb29c9c1fa4b8d/raw/24b25538ea8df8d0634a2a6189aa581ccc6a5b4b/parse_pbzx2.py";
# sha256 = "0jgp6qbfl36i0jlz7as5zk2w20z4ca8wlrhdw49lwsld6wi3rfhc";
# };

# sadly needs to be exported because security_tool needs it
sdk = stdenv.mkDerivation rec {
version = "10.9";
version = "10.10";
name = "MacOS_SDK-${version}";

# This URL comes from https://swscan.apple.com/content/catalogs/others/index-10.10.merged-1.sucatalog, which we found by:
# 1. Google: site:swscan.apple.com and look for a name that seems appropriate for your version
# 2. In the resulting file, search for a file called DevSDK ending in .pkg
# 3. ???
# 4. Profit
src = fetchurl {
url = "http://swcdn.apple.com/content/downloads/27/02/031-06182/xxog8vxu8i6af781ivf4uhy6yt1lslex34/DevSDK_OSX109.pkg";
sha256 = "16b7aplha5573yl1d44nl2yxzp0w2hafihbyh7930wrcvba69iy4";
url = "http://swcdn.apple.com/content/downloads/22/52/031-45139/hcjjv7cm4n6yqk56ict73qqw15ikm5iaql/DevSDK_OSX1010.pkg";
sha256 = "08bxa93zw7r4vzs28j9giq2qyk3b68ky6jx1bb9850gflr3nvgq1";
};

buildInputs = [ xar gzip cpio ];
buildInputs = [ xar xz cpio python ];

phases = [ "unpackPhase" "installPhase" "fixupPhase" ];

@@ -114,11 +127,15 @@ let
popd >/dev/null
}
linkFramework "${name}.framework"
'';

propagatedBuildInputs = deps;

# don't use pure CF for dylibs that depend on frameworks
setupHook = ../../../build-support/setup-hooks/fix-darwin-frameworks.sh;

# allows building the symlink tree
__impureHostDeps = [ "/System/Library/Frameworks/${name}.framework" ];

3 changes: 3 additions & 0 deletions pkgs/os-specific/darwin/apple-sdk/frameworks.nix
Original file line number Diff line number Diff line change
@@ -52,6 +52,7 @@ with frameworks; with libs; {
GSS = [];
GameController = [];
GameKit = [ Foundation ];
Hypervisor = [];
ICADevices = [ Carbon CF IOBluetooth ];
IMServicePlugIn = [];
IOBluetoothUI = [ IOBluetooth ];
@@ -117,4 +118,6 @@ with frameworks; with libs; {
OpenDirectory = [];
Quartz = [ QuickLook QTKit ];
QuartzCore = [ ApplicationServices CF CoreVideo OpenCL ];

vmnet = [];
}
5 changes: 4 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -307,6 +307,8 @@ with pkgs;

fixDarwinDylibNames = makeSetupHook { } ../build-support/setup-hooks/fix-darwin-dylib-names.sh;

fixDarwinFrameworks = makeSetupHook { } ../build-support/setup-hooks/fix-darwin-frameworks.sh;

keepBuildTree = makeSetupHook { } ../build-support/setup-hooks/keep-build-tree.sh;

enableGCOVInstrumentation = makeSetupHook { } ../build-support/setup-hooks/enable-coverage-instrumentation.sh;
@@ -8687,7 +8689,8 @@ with pkgs;
libusb = callPackage ../development/libraries/libusb {};

libusb1 = callPackage ../development/libraries/libusb1 {
inherit (darwin) libobjc IOKit;
inherit (darwin) libobjc;
inherit (darwin.apple_sdk.frameworks) IOKit;
};

libusbmuxd = callPackage ../development/libraries/libusbmuxd { };