@@ -2,26 +2,29 @@
2, buildPackages, hostPlatform
2, buildPackages, hostPlatform
6− platform = if hostPlatform.useiOSPrebuilt
7− then hostPlatform.xcodePlatform
9− sdk = "${buildPackages.darwin.xcode}/Contents/Developer/Platforms/${platform}.platform/Developer/SDKs/${platform}.sdk";
11−in mkDerivation {
5+mkDerivation {
12 pname = "jsaddle-wkwebview";
6 pname = "jsaddle-wkwebview";
13 version = "0.9.4.0";
7 version = "0.9.4.0";
14 src = ./.;
8 src = ./.;
15 libraryHaskellDepends = [ aeson base bytestring jsaddle data-default ];
9 libraryHaskellDepends = [ aeson base bytestring jsaddle data-default ];
17− # HACK(matthewbauer): This overrides the builtin frameworks from
11+ # HACK(matthewbauer): Can’t figure out why cf-private framework is
18− # Nixpkgs. There should be a more elegant way to do this without
12+ # not getting pulled in correctly. Has something
19− # breaking other cflags - but haven’t found it yet.
13+ # to with how headers are looked up in xcode.
20− preBuild = ''
14+ preBuild = stdenv.lib.optionalString (!hostPlatform.useiOSPrebuilt) ''
21− NIX_CFLAGS_COMPILE="-F${sdk}/System/Library/Frameworks"
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"
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 description = "Interface for JavaScript that works with GHCJS and GHC";
28 description = "Interface for JavaScript that works with GHCJS and GHC";
26 license = stdenv.lib.licenses.mit;
29 license = stdenv.lib.licenses.mit;