on master help sign in
Cleanup jsaddle-wkwebview/default.nix

Sorry about this - previously the MacOS build was broken. The hack is hard to get rid of.

commite03de8e1fa62f476bdf54f0d7565064edcae66a1 authorMatthew Bauer <mjbauer95@gmail.com> dateThu 28 Jun 2018, 14:00 (8 years ago) parente20a63b
1 file changed+16−13
jsaddle-wkwebview/default.nix+16−13
jsaddle-wkwebview/default.nix+16−13
@@ -2,26 +2,29 @@
22, buildPackages, hostPlatform
33}:
44
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 {
5+mkDerivation {
126 pname = "jsaddle-wkwebview";
137 version = "0.9.4.0";
148 src = ./.;
159 libraryHaskellDepends = [ aeson base bytestring jsaddle data-default ];
1610
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"
11+ # HACK(matthewbauer): Can’t figure out why cf-private framework is
12+ # not getting pulled in correctly. Has something
13+ # to with how headers are looked up in xcode.
14+ preBuild = stdenv.lib.optionalString (!hostPlatform.useiOSPrebuilt) ''
15+ mkdir include
16+ ln -s ${buildPackages.darwin.cf-private}/Library/Frameworks/CoreFoundation.framework/Headers include/CoreFoundation
17+ export NIX_CFLAGS_COMPILE="-I$PWD/include $NIX_CFLAGS_COMPILE"
2218 '';
2319
24− libraryFrameworkDepends = [ "${sdk}/System" ];
20+ libraryFrameworkDepends =
21+ stdenv.lib.optional (hostPlatform.useiOSPrebuilt)
22+ "${buildPackages.darwin.xcode}/Contents/Developer/Platforms/${hostPlatform.xcodePlatform}.platform/Developer/SDKs/${hostPlatform.xcodePlatform}.sdk/System"
23+ ++ stdenv.lib.optional (!hostPlatform.useiOSPrebuilt)
24+ (with buildPackages.darwin; with apple_sdk.frameworks; [
25+ Cocoa
26+ WebKit
27+ ]);
2528 description = "Interface for JavaScript that works with GHCJS and GHC";
2629 license = stdenv.lib.licenses.mit;
2730}