on master help sign in
Merge branch 'develop' into upstream-optparse
commit91eb60e10e0deeb48ffb7a82051dff372ecf4e96 authorAli Abrar <aliabrar@gmail.com> dateTue 8 Oct 2019, 12:49 (7 years ago) parentf40e587c1010c7
3 files changed+28−45
lib/executable-config/default.nix+1−1 lib/executable-config/lookup/default.nix−26 release.nix+27−18
lib/executable-config/default.nix+1−1
@@ -20,7 +20,7 @@ let injectConfig = config: assets: nixpkgs.runCommand "inject-config" {} (''
2020 '');
2121in with nixpkgs.haskell.lib; {
2222 haskellOverlay = self: super: {
23− obelisk-executable-config-lookup = self.callPackage (filterGitSource ./lookup) {};
23+ obelisk-executable-config-lookup = self.callCabal2nix "obelisk-executable-config-lookup" (filterGitSource ./lookup) {};
2424 };
2525 platforms = {
2626 android = {
lib/executable-config/lookup/default.nixdeleted−26
@@ -1,26 +0,0 @@
1−{ hostPlatform, ghc
2−, mkDerivation, base, base64-bytestring, bytestring, filepath, stdenv, text, transformers
3−, transformers-base, ref-tf, primitive, monad-control, reflex, reflex-dom
4−, jsaddle
5−, android-activity ? null, jsaddle-wkwebview ? null, ghcjs-dom ? null
6−}:
7−let isAndroid = hostPlatform.libc == "bionic";
8− isIOS = hostPlatform.isDarwin && hostPlatform.isAarch64;
9− isGhcjs = ghc.isGhcjs or false;
10−in mkDerivation {
11− pname = "obelisk-executable-config-lookup";
12− version = "0.1";
13− src = ./.;
14− libraryHaskellDepends = [
15− base bytestring filepath text transformers transformers-base ref-tf primitive monad-control reflex reflex-dom jsaddle
16− ] ++ (if isAndroid then [
17− android-activity
18− ] else if isIOS then [
19− jsaddle-wkwebview
20− ] else if isGhcjs then [
21− ghcjs-dom
22− ] else [
23− ]);
24− license = stdenv.lib.licenses.bsd3;
25−}
26−
release.nix+27−18
@@ -1,4 +1,7 @@
1−{ self-args ? {}
1+{ self-args ? {
2+ config.android_sdk.accept_license = true;
3+ iosSdkVersion = "10.2";
4+ }
25, local-self ? import ./. self-args
36}:
47
@@ -45,7 +48,7 @@ let
4548 in pkgAttrs: builtins.concatLists (map extractDeps (builtins.attrValues pkgAttrs));
4649
4750 perPlatform = lib.genAttrs cacheBuildSystems (system: let
48− obelisk = import ./. { inherit system; };
51+ obelisk = import ./. (self-args // { inherit system; });
4952 reflex-platform = obelisk.reflex-platform;
5053 ghc = pnameToAttrs
5154 obelisk.haskellPackageSets.ghc
@@ -58,30 +61,36 @@ let
5861 (builtins.attrValues ghcjs)
5962 (concatDepends ghc)
6063 (concatDepends ghcjs)
61− [command serverExeSkeleton iosSkeleton androidSkeleton]
64+ (lib.optional reflex-platform.androidSupport androidSkeleton)
65+ (lib.optional reflex-platform.iosSupport iosSkeleton)
66+ [ command serverSkeletonExe serverSkeletonShell ]
6267 ];
63− command = local-self.command;
64− serverExeSkeleton = (import ./skeleton { obelisk = local-self; }).exe;
65− androidObelisk = import ./. (self-args // {
66− config.android_sdk.accept_license = true;
67− });
68− androidSkeleton = (import ./skeleton { obelisk = androidObelisk; }).android.frontend;
69− iosObelisk = import ./. (self-args // {
70− system = "x86_64-darwin";
71− iosSdkVersion = "10.2";
72− });
73− iosSkeleton = (import ./skeleton { obelisk = iosObelisk; }).ios.frontend;
68+ command = obelisk.command;
69+ skeleton = import ./skeleton { inherit obelisk; };
70+ serverSkeletonExe = skeleton.exe;
71+ # TODO fix nixpkgs so it doesn't try to run the result of haskell shells as setup hooks.
72+ serverSkeletonShell = local-self.nixpkgs.runCommand "shell-safe-for-dep" {} ''
73+ touch "$out"
74+ echo "return" >> "$out"
75+ cat "${skeleton.shells.ghc}" >> "$out"
76+ '';
77+ androidSkeleton = (import ./skeleton { inherit obelisk; }).android.frontend;
78+ iosSkeleton = (import ./skeleton { inherit obelisk; }).ios.frontend;
7479 in {
7580 inherit
7681 command
7782 ghc ghcjs
78− serverExeSkeleton
79− iosSkeleton
80− androidSkeleton;
83+ serverSkeletonExe
84+ serverSkeletonShell
85+ ;
8186 cache = reflex-platform.pinBuildInputs "obelisk-${system}" cachePackages;
87+ } // lib.optionalAttrs reflex-platform.androidSupport {
88+ inherit androidSkeleton;
89+ } // lib.optionalAttrs reflex-platform.iosSupport {
90+ inherit iosSkeleton;
8291 });
8392
84− metaCache = local-self.pinBuildInputs
93+ metaCache = local-self.reflex-platform.pinBuildInputs
8594 "obelisk-everywhere"
8695 (map (a: a.cache) (builtins.attrValues perPlatform));
8796