diff options
Diffstat (limited to 'Biz/Bild/Meta.hs')
-rw-r--r-- | Biz/Bild/Meta.hs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Biz/Bild/Meta.hs b/Biz/Bild/Meta.hs index 5549cb3..ad5fdd6 100644 --- a/Biz/Bild/Meta.hs +++ b/Biz/Bild/Meta.hs @@ -14,14 +14,17 @@ import qualified Text.Regex.Applicative as Regex -- | A third-party dependency. This gets mapped to some name in nixpkgs, -- prefixed by package set like @haskellPackages@ or --- @python3Packages@. Currently this prefix is implicit, but it should be added --- here as part of a tuple or something. +-- @python3Packages@. type Dep = String -- | This is a system-level requirement, the string gets mapped to a name in --- nixpkgs at the top level, like @pkgs.thing@. If I add the package set prefix to 'Dep', then this can just become literally @(Sys, "thing")@. +-- nixpkgs at the top level, like @pkgs.thing@. type Sys = String +-- | A run-time dependency. This is some executable that will be placed on +-- @PATH@. This gets selected from @bild.pkgs@, so it must be exported there. +type Run = String + -- | An arbitrary compiler argument that may get added to the compilation -- command. Should be used sparingly, and not all builds will support this. type Arg = String @@ -40,7 +43,8 @@ data Parsed = Parsed { pdep :: Set Dep, parg :: Set Arg, pout :: Out, - psys :: Set Sys + psys :: Set Sys, + prun :: Set Run } detect :: Ord a => Regex.RE Char a -> [Text] -> Set a @@ -69,6 +73,7 @@ detectAll m cl = Parsed {..} pdep = detect_ dep psys = detect_ sys parg = detect_ arg + prun = detect_ run dep :: [Char] -> Regex.RE Char Dep dep comment = @@ -96,3 +101,8 @@ arg :: [Char] -> Regex.RE Char Arg arg comment = Regex.string (comment ++ " : arg ") *> Regex.many Regex.anySym + +run :: [Char] -> Regex.RE Char Run +run comment = + Regex.string (comment ++ " : run ") + *> Regex.many Regex.anySym |