@@ -1,6 +1,4 @@
1−{ mkDerivation, stdenv, aeson, base, bytestring, jsaddle, data-default
1+{ mkDerivation, lib, stdenv, aeson, base, bytestring, jsaddle, data-default, pkgs }:
2−, buildPackages, hostPlatform
5mkDerivation {
3mkDerivation {
6 pname = "jsaddle-wkwebview";
4 pname = "jsaddle-wkwebview";
@@ -8,23 +6,15 @@ mkDerivation {
9 libraryHaskellDepends = [ aeson base bytestring jsaddle data-default ];
7 libraryHaskellDepends = [ aeson base bytestring jsaddle data-default ];
11− # HACK(matthewbauer): Can’t figure out why cf-private framework is
9+ # Xcode is needed for iOS; macOS SDK is used otherwise
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) ''
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"
20 libraryFrameworkDepends =
10 libraryFrameworkDepends =
21− stdenv.lib.optional (hostPlatform.useiOSPrebuilt)
11+ if stdenv.hostPlatform.useiOSPrebuilt then
22− "${buildPackages.darwin.xcode}/Contents/Developer/Platforms/${hostPlatform.xcodePlatform}.platform/Developer/SDKs/${hostPlatform.xcodePlatform}.sdk/System"
12+ "${pkgs.darwin.xcode}/Contents/Developer/Platforms/${stdenv.hostPlatform.xcodePlatform}.platform/Developer/SDKs/${stdenv.hostPlatform.xcodePlatform}.sdk/System"
23− ++ stdenv.lib.optional (!hostPlatform.useiOSPrebuilt)
24− (with buildPackages.darwin; with apple_sdk.frameworks; [
13+ else (with pkgs.darwin.apple_sdk.frameworks; [ Cocoa WebKit ]);
26− WebKit
15+ # cf-private is needed for NSURL (_OBJC_CLASS_$_NSURL) symbols
27− ]);
16+ buildDepends = lib.optional (!stdenv.hostPlatform.useiOSPrebuilt) [ pkgs.darwin.cf-private ];
28 description = "Interface for JavaScript that works with GHCJS and GHC";
18 description = "Interface for JavaScript that works with GHCJS and GHC";
29 license = stdenv.lib.licenses.mit;
19 license = stdenv.lib.licenses.mit;