summaryrefslogtreecommitdiff
path: root/Biz/Bild.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2023-08-03 22:39:27 -0400
committerBen Sima <ben@bsima.me>2023-08-03 22:41:16 -0400
commitb8cdef27e76d37f8857e0f93e427eb9119ffb153 (patch)
tree87b52b5335d8481d147eee9fd388f8824e7ebd78 /Biz/Bild.hs
parent88af507c33ab32ae23e35bde9cd7fbbc0d534390 (diff)
Add packageSet argument
Diffstat (limited to 'Biz/Bild.hs')
-rw-r--r--Biz/Bild.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/Biz/Bild.hs b/Biz/Bild.hs
index 5c28964..a538f98 100644
--- a/Biz/Bild.hs
+++ b/Biz/Bild.hs
@@ -245,6 +245,8 @@ data Target = Target
namespace :: Namespace,
-- | Absolute path to file
path :: FilePath,
+ -- | Name of the packageset in Bild.nix to pull langdeps from
+ packageSet :: Text,
-- | Language-specific dependencies, required during compilation
langdeps :: Set Meta.Dep,
-- | Local source files on which this target depends
@@ -424,6 +426,7 @@ analyze hmap ns = case Map.lookup ns hmap of
compiler = Gcc,
builder = Local user,
out = pout,
+ packageSet = "", -- none, or maybe I should make cPackages?
compilerFlags =
concat
[ [o, dir, str absPath]
@@ -450,6 +453,7 @@ analyze hmap ns = case Map.lookup ns hmap of
{ builder = Local user,
wrapper = Nothing,
compiler = Ghc,
+ packageSet = "ghcWith",
compilerFlags =
[ "-Werror",
"-i$src",
@@ -484,6 +488,7 @@ analyze hmap ns = case Map.lookup ns hmap of
{ sysdeps = Set.empty,
wrapper = Nothing,
compiler = Sbcl,
+ packageSet = "sbclWith",
compilerFlags =
map
Text.pack
@@ -517,6 +522,7 @@ analyze hmap ns = case Map.lookup ns hmap of
out = Meta.None,
outPath = outToPath Meta.None,
srcs = Set.singleton absPath,
+ packageSet = "",
..
}
|> Just
@@ -527,6 +533,7 @@ analyze hmap ns = case Map.lookup ns hmap of
{ langdeps = pdep,
sysdeps = psys,
compiler = Guile,
+ packageSet = "guilePackages",
compilerFlags =
[ "compile",
"--r7rs",
@@ -562,6 +569,7 @@ analyze hmap ns = case Map.lookup ns hmap of
Meta.detectOut (Meta.out "//") contentLines |> \out ->
Target
{ langdeps = Set.empty,
+ packageSet = "rustPackages",
wrapper = Nothing,
sysdeps = Set.empty,
compiler = Rustc,
@@ -835,7 +843,7 @@ nixBuild loud Target {..} =
args =
[ argstr "srcs" <| unwords <| map str <| (root </> path) : Set.toList srcs,
argstr "root" <| str root,
- argstr "packageSet" "ghcWith",
+ argstr "packageSet" packageSet,
(argstr "langDeps" <| unwords <| map str <| Set.toList langdeps) <|> mempty,
argstr "name" <| str <| outname out,
argstr "main" <| str path,