diff options
author | Ben Sima <ben@bsima.me> | 2020-11-28 14:33:56 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-11-30 19:01:38 -0500 |
commit | 46efb70b6a0970c5b1faf448ee2bae469d0f725f (patch) | |
tree | 1332fcf4c0c4c674b8d430f5c0613e4db0e4f8fa /Biz | |
parent | 0d50151f8e3a83a27f2a8c3859a934ec9c616161 (diff) |
Stub guile build and fix namespace in nix build
Diffstat (limited to 'Biz')
-rw-r--r-- | Biz/Bild.hs | 26 | ||||
-rw-r--r-- | Biz/Bot.scm | 4 |
2 files changed, 25 insertions, 5 deletions
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") |