on master help sign in
Update jsaddle-wkwebview to work with newer Nixpkgs
commitcf8445ba39cc7f3b1c2d8ce09848e9cf71beeae2 authorMatthew Bauer <mjbauer95@gmail.com> dateThu 18 Jul 2019, 21:34 (7 years ago) parent176a073
1 file changed+9−19
jsaddle-wkwebview/default.nix+9−19
jsaddle-wkwebview/default.nix+9−19
@@ -1,6 +1,4 @@
1−{ mkDerivation, stdenv, aeson, base, bytestring, jsaddle, data-default
2−, buildPackages, hostPlatform
3−}:
1+{ mkDerivation, lib, stdenv, aeson, base, bytestring, jsaddle, data-default, pkgs }:
42
53mkDerivation {
64 pname = "jsaddle-wkwebview";
@@ -8,23 +6,15 @@ mkDerivation {
86 src = ./.;
97 libraryHaskellDepends = [ aeson base bytestring jsaddle data-default ];
108
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"
18− '';
19−
9+ # Xcode is needed for iOS; macOS SDK is used otherwise
2010 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− ]);
11+ if stdenv.hostPlatform.useiOSPrebuilt then
12+ "${pkgs.darwin.xcode}/Contents/Developer/Platforms/${stdenv.hostPlatform.xcodePlatform}.platform/Developer/SDKs/${stdenv.hostPlatform.xcodePlatform}.sdk/System"
13+ else (with pkgs.darwin.apple_sdk.frameworks; [ Cocoa WebKit ]);
14+
15+ # cf-private is needed for NSURL (_OBJC_CLASS_$_NSURL) symbols
16+ buildDepends = lib.optional (!stdenv.hostPlatform.useiOSPrebuilt) [ pkgs.darwin.cf-private ];
17+
2818 description = "Interface for JavaScript that works with GHCJS and GHC";
2919 license = stdenv.lib.licenses.mit;
3020}