on master help sign in
Use generic xcode in jsaddle-wkwebview
0ca3c2eMatthew Bauer
jsaddle-wkwebview/default.nix+13−15
@@ -2,28 +2,26 @@
2, buildPackages, hostPlatform
2, buildPackages, hostPlatform
3}:
3}:
4
4
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+
5−mkDerivation {
11+in mkDerivation {
6 pname = "jsaddle-wkwebview";
12 pname = "jsaddle-wkwebview";
7 version = "0.9.4.0";
13 version = "0.9.4.0";
8 src = ./.;
14 src = ./.;
9 libraryHaskellDepends = [ aeson base bytestring jsaddle data-default ];
15 libraryHaskellDepends = [ aeson base bytestring jsaddle data-default ];
10
16
11− # HACK(matthewbauer): Make sure framework is pulled in first so that
17+ # HACK(matthewbauer): This overrides the builtin frameworks from
12− # CoreFoundation is correct. Eventually we will update
18+ # Nixpkgs. There should be a more elegant way to do this without
13− # CoreFoundation in Nixpkgs but that has caused some other issues.
19+ # breaking other cflags - but haven’t found it yet.
14− preBuild = stdenv.lib.optionalString hostPlatform.useiOSPrebuilt ''
20+ preBuild = ''
15− NIX_CFLAGS_COMPILE="-F${buildPackages.darwin.xcode_8_2}/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks"
21+ NIX_CFLAGS_COMPILE="-F${sdk}/System/Library/Frameworks"
16 '';
22 '';
17
23
18− libraryFrameworkDepends = with buildPackages; if hostPlatform.useiOSPrebuilt then [
24+ libraryFrameworkDepends = [ "${sdk}/System" ];
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− ];
27 description = "Interface for JavaScript that works with GHCJS and GHC";
25 description = "Interface for JavaScript that works with GHCJS and GHC";
28 license = stdenv.lib.licenses.mit;
26 license = stdenv.lib.licenses.mit;
29}
27}