on master help sign in
Merge branch 'develop' into cn-add-encodeToText
commit5e0b1d186db977c0594dd42a3b89115d8aaa112a authorAli Abrar <aliabrar@gmail.com> dateFri 11 Oct 2019, 11:26 (7 years ago) parentaf96ad989fa36c
7 files changed+38−75
README.md+2−2 default.nix+3−23 dep/reflex-platform/github.json+2−2 lib/executable-config/default.nix+1−1 lib/executable-config/lookup/default.nix−26 lib/route/src/Obelisk/Route/Frontend.hs+3−3 release.nix+27−18
README.md+2−2
@@ -326,9 +326,9 @@ This command will accomplish the following:
3263261. Build a Signed Android apk for your application
3273271. Deploy the Signed apk to your connected Android device
328328
329−In the event that you change your key or keystore password, you will have to update your credentials within the JSON object found in `android_keytool_config.json`
329+In the event that you change your key or keystore password, you will have to update your credentials within the JSON object found in `android_keytool_config.json`.
330330
331−Additional documentation on java key stores can be found [here] (https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html)
331+Additional documentation on Java key stores can be found [here](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html).
332332
333333This should copy over and install the application on your device (if you see a "*signatures do not match*" error, simply uninstall the previous app from the device before retrying the deploy). The name of the installed application will be what you have specified for `android.displayName` in the `default.nix`.
334334
default.nix+3−23
@@ -49,8 +49,8 @@ let
4949 in {
5050 obelisk-executable-config-inject = pkgs.obeliskExecutableConfig.platforms.web.inject self;
5151
52− obelisk-asset-manifest = self.callCabal2nix "obelisk-asset-manifest" (hackGet ./lib/asset + "/manifest") {};
53− obelisk-asset-serve-snap = self.callCabal2nix "obelisk-asset-serve-snap" (hackGet ./lib/asset + "/serve-snap") {};
52+ obelisk-asset-manifest = self.callCabal2nix "obelisk-asset-manifest" (cleanSource ./lib/asset/manifest) {};
53+ obelisk-asset-serve-snap = self.callCabal2nix "obelisk-asset-serve-snap" (cleanSource ./lib/asset/serve-snap) {};
5454 obelisk-backend = self.callCabal2nix "obelisk-backend" (cleanSource ./lib/backend) {};
5555 obelisk-cliapp = self.callCabal2nix "obelisk-cliapp" (cleanSource ./lib/cliapp) {};
5656 obelisk-command = self.callCabal2nix "obelisk-command" (cleanSource ./lib/command) {};
@@ -65,31 +65,11 @@ let
6565 (self: super: let
6666 pkgs = self.callPackage ({ pkgs }: pkgs) {};
6767 haskellLib = pkgs.haskell.lib;
68− #TODO: Upstream
69− # Modify a Haskell package to add completion scripts for the given
70− # executable produced by it. These completion scripts will be picked up
71− # automatically if the resulting derivation is installed, e.g. by
72− # `nix-env -i`.
73− addOptparseApplicativeCompletionScripts = exeName: pkg: haskellLib.overrideCabal pkg (drv: {
74− postInstall = (drv.postInstall or "") + ''
75− BASH_COMP_DIR="$out/share/bash-completion/completions"
76− mkdir -p "$BASH_COMP_DIR"
77− "$out/bin/${exeName}" --bash-completion-script "$out/bin/${exeName}" >"$BASH_COMP_DIR/ob"
78−
79− ZSH_COMP_DIR="$out/share/zsh/vendor-completions"
80− mkdir -p "$ZSH_COMP_DIR"
81− "$out/bin/${exeName}" --zsh-completion-script "$out/bin/${exeName}" >"$ZSH_COMP_DIR/_ob"
82−
83− FISH_COMP_DIR="$out/share/fish/vendor_completions.d"
84− mkdir -p "$FISH_COMP_DIR"
85− "$out/bin/${exeName}" --fish-completion-script "$out/bin/${exeName}" >"$FISH_COMP_DIR/ob.fish"
86− '';
87− });
8868 in {
8969 # Dynamic linking with split objects dramatically increases startup time (about
9070 # 0.5 seconds on a decent machine with SSD), so we do `justStaticExecutables`.
9171 obelisk-command = haskellLib.overrideCabal
92− (addOptparseApplicativeCompletionScripts "ob"
72+ (haskellLib.addOptparseApplicativeCompletionScripts "ob"
9373 (haskellLib.justStaticExecutables super.obelisk-command))
9474 (drv: {
9575 buildTools = (drv.buildTools or []) ++ [ pkgs.buildPackages.makeWrapper ];
dep/reflex-platform/github.json+2−2
@@ -2,6 +2,6 @@
22 "owner": "reflex-frp",
33 "repo": "reflex-platform",
44 "branch": "develop",
5− "rev": "9e306f72ed0dbcdccce30a4ba0eb37aa03cf91e3",
6− "sha256": "1crlwfw6zsx2izwsd57i5651p5pfyrpkfjwp6fc1yd4q4d4n7g2m"
5+ "rev": "b75dfe258c31eb1688090d121f33b62a07071589",
6+ "sha256": "0isvqn6y8nnfb4a3nabjsafrz4mfa01vhkn6i61idh6zfb8gciqf"
77}
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−
lib/route/src/Obelisk/Route/Frontend.hs+3−3
@@ -500,10 +500,10 @@ runRouteViewT routeEncoder switchover useHash a = do
500500routeLink
501501 :: forall t m a route.
502502 ( DomBuilder t m
503− , RouteToUrl (R route) m
504− , SetRoute t (R route) m
503+ , RouteToUrl route m
504+ , SetRoute t route m
505505 )
506− => R route -- ^ Target route
506+ => route -- ^ Target route
507507 -> m a -- ^ Child widget
508508 -> m a
509509routeLink r w = do
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