From 46efb70b6a0970c5b1faf448ee2bae469d0f725f Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 28 Nov 2020 14:33:56 -0500 Subject: Stub guile build and fix namespace in nix build --- Biz/Bild.hs | 26 +++++++++++++++++++++----- Biz/Bot.scm | 4 ++++ 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 Biz/Bot.scm (limited to 'Biz') diff --git a/Biz/Bild.hs b/Biz/Bild.hs index 3334952..35ba7f0 100644 --- a/Biz/Bild.hs +++ b/Biz/Bild.hs @@ -139,7 +139,7 @@ type Dep = String type Out = String -data Compiler = Ghc | Ghcjs | Nix +data Compiler = Ghc | Ghcjs | Guile | Nix deriving (Show) data Target = Target @@ -186,7 +186,7 @@ analyze s = do ".nix" -> return Target - { namespace = s, + { namespace = reps root "" path |> List.stripPrefix "/" |> require "namespace", path = path, deps = [], compiler = Nix, @@ -200,10 +200,20 @@ analyze s = do "/.ssh/id_rsa" ] } + ".scm" -> + return + Target + { namespace = reps root "" path |> List.stripPrefix "/" |> require "namespace", + path = path, + deps = [], + compiler = Guile, + out = "", + builder = user <> "@localhost" + } e -> panic <| "bild does not know this extension: " <> Text.pack e build :: Target -> IO () -build Target {..} = do +build target@Target {..} = do root <- Env.getEnv "BIZ_ROOT" case compiler of Ghc -> do @@ -246,18 +256,24 @@ build Target {..} = do "-o", outDir out ] + Guile -> do + putText <| "bild: dev: guile: " <> Text.pack namespace + let outDir = root "_/bild/dev/bin" + Dir.createDirectoryIfMissing True outDir + putText <| "bild: dev: local: " <> Text.pack builder + putText "bild: guile TODO" + putText <| show target Nix -> do putText <| "bild: nix: " <> Text.pack namespace cwd <- Dir.getCurrentDirectory let outDir = root "_/bild/nix" Dir.createDirectoryIfMissing True outDir - let qualifiedTarget = reps root "" cwd namespace putText <| "bild: nix: remote: " <> Text.pack builder Process.callProcess "nix-build" [ path, "-o", - outDir qualifiedTarget, + outDir namespace, -- Set default arguments to nix functions "--arg", "bild", diff --git a/Biz/Bot.scm b/Biz/Bot.scm new file mode 100644 index 0000000..7ed413a --- /dev/null +++ b/Biz/Bot.scm @@ -0,0 +1,4 @@ + + + +(display "hello") -- cgit v1.2.3