diff options
Diffstat (limited to 'Biz/Bild')
-rw-r--r-- | Biz/Bild/Rules.nix | 34 | ||||
-rw-r--r-- | Biz/Bild/ShellHook.sh | 2 |
2 files changed, 21 insertions, 15 deletions
diff --git a/Biz/Bild/Rules.nix b/Biz/Bild/Rules.nix index e76d7a2..2a1a4d1 100644 --- a/Biz/Bild/Rules.nix +++ b/Biz/Bild/Rules.nix @@ -28,9 +28,9 @@ let module = builtins.replaceStrings ["/" ".hs"] ["." ""] relpath; # file contents content = builtins.readFile main; - # search for the ': exe' declaration - exe = builtins.head (lib.lists.flatten (removeNull - (map (builtins.match "^-- : exe ([[:alnum:]._-]*)$") + # search for the ': out' declaration + out = builtins.head (lib.lists.flatten (removeNull + (map (builtins.match "^-- : out ([[:alnum:]._-]*)$") (lines content)))); # collect all of the ': dep' declarations deps = lib.lists.flatten (removeNull @@ -38,7 +38,7 @@ let (lines content))); sysdeps = lib.lists.flatten (removeNull - (map (builtins.match "^-- : sys ([[:alum:]._-]*)$") + (map (builtins.match "^-- : sys ([[:alnum:]._-]*)$") (lines content))); }; @@ -59,16 +59,18 @@ in { ghc = ghc_ data.deps; in stdenv.mkDerivation { name = data.module; - src = ../.; + src = ../../.; nativeBuildInputs = [ ghc ] ++ depsToPackageSet nixpkgs data.sysdeps; strictDeps = true; buildPhase = '' mkdir -p $out/bin # compile with ghc - ${ghc}/bin/ghc -Werror -Weverything -i. \ - --make ${main} \ - -main-is ${data.module} \ - -o $out/bin/${data.exe} + ${ghc}/bin/ghc \ + -Werror \ + -i. \ + --make ${main} \ + -main-is ${data.module} \ + -o $out/bin/${data.out} ''; # the install process was handled above installPhase = "exit 0"; @@ -80,19 +82,21 @@ in { ghcjs = ghcjs_ data.deps; in stdenv.mkDerivation { name = data.module; - src = ../.; + src = ../../.; nativeBuildInputs = [ ghcjs ]; strictDeps = true; buildPhase = '' mkdir -p $out/static # compile with ghcjs - ${ghcjs}/bin/ghcjs -Werror -Weverything -i. \ - --make ${main} \ - -main-is ${data.module} \ - -o ${data.exe} + ${ghcjs}/bin/ghcjs \ + -Werror \ + -i. \ + --make ${main} \ + -main-is ${data.module} \ + -o ${data.out} # optimize js output ${pkgs.closurecompiler}/bin/closure-compiler \ - ${data.exe}/all.js > $out/static/${data.exe} + ${data.out}/all.js > $out/static/${data.out} ''; installPhase = "exit 0"; } // { env = ghcjs; }; diff --git a/Biz/Bild/ShellHook.sh b/Biz/Bild/ShellHook.sh index 89751d3..0fc1781 100644 --- a/Biz/Bild/ShellHook.sh +++ b/Biz/Bild/ShellHook.sh @@ -13,6 +13,8 @@ function help() { echo " ship lint, bild, and push one (or all) namespace(s)" } +alias runghc="runghc --ghc-arg=-i$BIZ_ROOT" + function bild() { runghc Biz.Bild $@ } |