@@ -2,28 +2,26 @@
22, buildPackages, hostPlatform
33}:
44
5−mkDerivation {
5+let
6+ platform = if hostPlatform.useiOSPrebuilt
7+ then hostPlatform.xcodePlatform
8+ else "MacOSX";
9+ sdk = "${buildPackages.darwin.xcode}/Contents/Developer/Platforms/${platform}.platform/Developer/SDKs/${platform}.sdk";
10+
11+in mkDerivation {
612 pname = "jsaddle-wkwebview";
713 version = "0.9.4.0";
814 src = ./.;
915 libraryHaskellDepends = [ aeson base bytestring jsaddle data-default ];
1016
11− # HACK(matthewbauer): Make sure framework is pulled in first so that
12− # CoreFoundation is correct. Eventually we will update
13− # CoreFoundation in Nixpkgs but that has caused some other issues.
14− preBuild = stdenv.lib.optionalString hostPlatform.useiOSPrebuilt ''
15− NIX_CFLAGS_COMPILE="-F${buildPackages.darwin.xcode_8_2}/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks"
17+ # HACK(matthewbauer): This overrides the builtin frameworks from
18+ # Nixpkgs. There should be a more elegant way to do this without
19+ # breaking other cflags - but haven’t found it yet.
20+ preBuild = ''
21+ NIX_CFLAGS_COMPILE="-F${sdk}/System/Library/Frameworks"
1622 '';
1723
18− libraryFrameworkDepends = with buildPackages; if hostPlatform.useiOSPrebuilt then [
19− "${darwin.xcode_8_2}/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System"
20− ] else [
21− darwin.libobjc
22− darwin.apple_sdk.libs.xpc
23− darwin.apple_sdk.frameworks.Foundation
24− darwin.apple_sdk.frameworks.Cocoa
25− darwin.apple_sdk.frameworks.WebKit
26− ];
24+ libraryFrameworkDepends = [ "${sdk}/System" ];
2725 description = "Interface for JavaScript that works with GHCJS and GHC";
2826 license = stdenv.lib.licenses.mit;
2927}