@@ -23,6 +23,7 @@ import Control.Monad.State.Strict
23import Control.Applicative
23import Control.Applicative
24import System.FilePath (takeFileName, isValid)
24import System.FilePath (takeFileName, isValid)
25import Data.Maybe (isNothing, fromJust)
25import Data.Maybe (isNothing, fromJust)
26+import Data.List (union)
27import Util.System
28import Util.System
@@ -30,6 +31,7 @@ type PParser = StateT PkgDesc IdrisInnerParser
31data PkgDesc = PkgDesc {
32data PkgDesc = PkgDesc {
32 pkgname :: String -- ^ Name associated with a package.
33 pkgname :: String -- ^ Name associated with a package.
34+ , pkgdeps :: [String] -- ^ List of packages this package depends on.
33 , pkgbrief :: Maybe String -- ^ Brief description of the package.
35 , pkgbrief :: Maybe String -- ^ Brief description of the package.
34 , pkgversion :: Maybe String -- ^ Version string to associate with the package.
36 , pkgversion :: Maybe String -- ^ Version string to associate with the package.
35 , pkgreadme :: Maybe String -- ^ Location of the README file.
37 , pkgreadme :: Maybe String -- ^ Location of the README file.
@@ -52,7 +54,7 @@ data PkgDesc = PkgDesc {
53-- | Default settings for package descriptions.
55-- | Default settings for package descriptions.
54defaultPkg :: PkgDesc
56defaultPkg :: PkgDesc
55−defaultPkg = PkgDesc "" Nothing Nothing Nothing Nothing
57+defaultPkg = PkgDesc "" [] Nothing Nothing Nothing Nothing
56 Nothing Nothing Nothing Nothing
58 Nothing Nothing Nothing Nothing
57 Nothing [] [] Nothing [] "" [] (sUN "") Nothing []
59 Nothing [] [] Nothing [] "" [] (sUN "") Nothing []
@@ -169,7 +171,9 @@ pClause = do reserved "executable"; lchar '=';
169 ps <- sepBy1 (fst <$> identifier) (lchar ',')
171 ps <- sepBy1 (fst <$> identifier) (lchar ',')
170 st <- get
172 st <- get
171 let pkgs = pureArgParser $ concatMap (\x -> ["-p", x]) ps
173 let pkgs = pureArgParser $ concatMap (\x -> ["-p", x]) ps
175+ put (st { pkgdeps = ps `union` (pkgdeps st)
172− put (st {idris_opts = pkgs ++ idris_opts st})
176+ , idris_opts = pkgs ++ idris_opts st})
174 <|> do reserved "modules"; lchar '=';
178 <|> do reserved "modules"; lchar '=';
175 ms <- sepBy1 (fst <$> iName []) (lchar ',')
179 ms <- sepBy1 (fst <$> iName []) (lchar ',')