@@ -21,63 +21,58 @@ pathDirs :
2121 {auto _ : HasIO io}
2222 -> {auto _ : PackDirs}
2323 -> {auto e : Env}
24- -> (pre : String )
24+ -> (pre : Path Abs )
2525 -> (pth : PkgName -> Hash -> Package -> Path Abs)
26- -> EitherT PackErr io String
26+ -> EitherT PackErr io ( List ( Path Abs ))
2727pathDirs pre pth = do
2828 rs <- traverse resolveLib (keys e. all )
2929 ps <- filterM (\ r => exists $ pth r. name r. hash r. pkg) rs
3030 let ps' : = filter (not . isCorePkg . value . name) ps
31- pure $
32- fastConcat
33- . intersperse " :"
34- . (pre :: )
35- $ map (\ r => " \{pth r.name r.hash r.pkg}" ) ps'
31+ pure $ (pre :: ) $ map (\ r => pth r. name r. hash r. pkg) ps'
3632
3733||| Directories to be listed in the `IDRIS2_PACKAGE_PATH` variable, so
3834||| that Idris finds all libraries installed by pack in custom locations.
3935export
40- packagePathDirs : HasIO io => Env -> EitherT PackErr io String
41- packagePathDirs _ = pathDirs " \{ idrisInstallDir} " pkgPathDir
36+ packagePathDirs : HasIO io => Env -> EitherT PackErr io ( List (Path Abs))
37+ packagePathDirs _ = pathDirs idrisInstallDir pkgPathDir
4238
4339||| Directories to be listed in the `IDRIS2_LIBS` variable, so
4440||| that Idris finds all `.so` files installed by pack in custom locations.
4541export
46- packageLibDirs : HasIO io => Env -> EitherT PackErr io String
47- packageLibDirs _ = pathDirs " \{ idrisLibDir} " pkgLibDir
42+ packageLibDirs : HasIO io => Env -> EitherT PackErr io ( List (Path Abs))
43+ packageLibDirs _ = pathDirs idrisLibDir pkgLibDir
4844
4945||| Directories to be listed in the `IDRIS2_DATA` variable, so
5046||| that Idris finds all support files installed by pack in custom locations.
5147export
52- packageDataDirs : HasIO io => Env -> EitherT PackErr io String
53- packageDataDirs _ = pathDirs " \{ idrisDataDir} " pkgDataDir
48+ packageDataDirs : HasIO io => Env -> EitherT PackErr io ( List (Path Abs))
49+ packageDataDirs _ = pathDirs idrisDataDir pkgDataDir
5450
5551||| `IDRIS2_PACKAGE_PATH` variable to be used with Idris, so
5652||| that it finds all libraries installed by pack in custom locations.
5753export
58- packagePath : HasIO io => Env => EitherT PackErr io (String, String)
59- packagePath =
60- (" IDRIS2_PACKAGE_PATH" ,) <$> packagePathDirs % search
54+ packagePath : HasIO io => Env => EitherT PackErr io EnvVar
55+ packagePath = IdrisPackagePathVar <$> packagePathDirs % search
6156
6257||| `IDRIS2_LIBS` variable to be used with Idris, so
6358||| that it finds all `.so` files installed by pack in custom locations.
6459export
65- libPath : HasIO io => Env => EitherT PackErr io (String, String)
66- libPath = ( " IDRIS2_LIBS " ,) <$> packageLibDirs % search
60+ libPath : HasIO io => Env => EitherT PackErr io EnvVar
61+ libPath = IdrisLibsVar <$> packageLibDirs % search
6762
6863||| `IDRIS2_DATA` variable to be used with Idris, so
6964||| that it finds all support files installed by pack in custom locations.
7065export
71- dataPath : HasIO io => Env => EitherT PackErr io (String, String)
72- dataPath = ( " IDRIS2_DATA " ,) <$> packageDataDirs % search
66+ dataPath : HasIO io => Env => EitherT PackErr io EnvVar
67+ dataPath = IdrisDataVar <$> packageDataDirs % search
7368
7469||| This unifies `packagePath`, `libPath` and `dataPath`,
7570||| to generate an environment necessary to build packages with Idris
7671||| the dependencies of which are handled by pack.
7772export
78- buildEnv : HasIO io => Env => EitherT PackErr io (List (String,String) )
73+ buildEnv : HasIO io => Env => EitherT PackErr io (List EnvVar )
7974buildEnv =
80- let pre : = if useRacket then [("IDRIS2_CG", "racket") ] else []
75+ let pre : = if useRacket then [IdrisCGVar Racket ] else []
8176 in (pre ++ ) <$> sequence [packagePath, libPath, dataPath]
8277
8378||| Idris executable loading the given package plus the
@@ -87,7 +82,7 @@ idrisWithPkg :
8782 {auto _ : HasIO io}
8883 -> {auto _ : IdrisEnv}
8984 -> ResolvedLib t
90- -> EitherT PackErr io (CmdArgList , List ( String , String ) )
85+ -> EitherT PackErr io (CmdArgList , List EnvVar )
9186idrisWithPkg rl =
9287 (idrisWithCG ++ [" -p" , name rl],) <$> buildEnv
9388
@@ -98,7 +93,7 @@ idrisWithPkgs :
9893 {auto _ : HasIO io}
9994 -> {auto _ : IdrisEnv}
10095 -> List (ResolvedLib t)
101- -> EitherT PackErr io (CmdArgList , List ( String , String ) )
96+ -> EitherT PackErr io (CmdArgList , List EnvVar )
10297idrisWithPkgs [] = pure (idrisWithCG, [])
10398idrisWithPkgs pkgs =
10499 let ps = concatMap (\ p => [" -p" , name p]) pkgs
@@ -221,7 +216,7 @@ export covering
221216libPkg :
222217 {auto _ : HasIO io}
223218 -> {auto e : IdrisEnv}
224- -> (env : List (String,String) )
219+ -> (env : List EnvVar )
225220 -> (logLevel : LogLevel)
226221 -> (cleanBuild : Bool )
227222 -> (cmd : CmdArgList)
@@ -276,15 +271,15 @@ idrisCleanup =
276271
277272idrisBootstrapWithStage3 : HasIO io => (e : Env) => Path Abs -> EitherT PackErr io ()
278273idrisBootstrapWithStage3 dir = do
279- let bootstrappedPrefixVar = mkPrefixVar dir
274+ let bootstrappedPrefixVar = PrefixVar dir
280275 sysAndLog Build [" make" , bootstrapCmd, bootstrappedPrefixVar, schemeVar]
281276 debug " Install bootstrapped Idris..."
282277 sysAndLog Build [" make" , " bootstrap-install" , bootstrappedPrefixVar, schemeVar]
283278 idrisCleanup
284279
285280 debug " Stage 3: Rebuilding Idris..."
286- let idrisBootVar = mkIdrisBootVar $ dir /> " bin" /> " idris2"
287- let idrisDataVar = mkIdrisDataVar $ dir /> idrisDir /> " support"
281+ let idrisBootVar = IdrisBootVar $ dir /> " bin" /> " idris2"
282+ let idrisDataVar = IdrisDataVar [ dir /> idrisDir /> " support" ]
288283 sysAndLog Build [" make" , " idris2-exec" , prefixVar, idrisBootVar, idrisDataVar, schemeVar]
289284
290285 ignoreError $ sysAndLog Build [" rm" , " -rf" , dir]
@@ -461,7 +456,7 @@ installDocs rl = case rl.status of
461456 let docsDir : Path Abs
462457 docsDir = buildPath rl. desc /> " docs"
463458
464- pre : List (String,String)
459+ pre : List EnvVar
465460 pre = libInstallPrefix rl
466461
467462 htmlDir : Path Abs
0 commit comments