diff options
Diffstat (limited to 'Biz/Bild/Rules.nix')
-rw-r--r-- | Biz/Bild/Rules.nix | 34 |
1 files changed, 19 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; }; |