on master help sign in
Install packages in sub-directory of Idris' data dir.
8932658Jan de Muijnck-Hughes
CHANGELOG.md+2
@@ -30,6 +30,8 @@
30
30
31* `return`, which has been an alias for `pure` for many releases, is now deprecated.
31* `return`, which has been an alias for `pure` for many releases, is now deprecated.
32
32
33+* Idris packages are now installed within a sub-directory `libs` of Idris' data directory, before they were installed in the directory's root.
34+
33## Tool updates
35## Tool updates
34
36
35* Idris' documentation system now displays the documentation for auto
37* Idris' documentation system now displays the documentation for auto
Setup.hs+3−2
@@ -254,8 +254,9 @@ idrisInstall verbosity copy pkg local = unless (execOnly (configFlags local)) $
254 target = datadir $ L.absoluteInstallDirs pkg local copy
254 target = datadir $ L.absoluteInstallDirs pkg local copy
255
255
256 installStdLib = do
256 installStdLib = do
257+ let target' = target </> "libs"
257− putStrLn $ "Installing libraries in " ++ target
258+ putStrLn $ "Installing libraries in " ++ target'
258− makeInstall "libs" target
259+ makeInstall "libs" target'
259
260
260 installRTS = do
261 installRTS = do
261 let target' = target </> "rts"
262 let target' = target </> "rts"
src/IRTS/System.hs+7−2
@@ -32,8 +32,13 @@ import Paths_idris
32#endif
32#endif
33
33
34overrideDataDirWith :: String -> IO FilePath
34overrideDataDirWith :: String -> IO FilePath
35−overrideDataDirWith envVar = do envValue <- lookupEnv envVar
35+overrideDataDirWith envVar = do
36+ envValue <- lookupEnv envVar
37+ case envValue of
38+ Nothing -> do
36− maybe getDataDir return envValue
39+ ddir <- getDataDir
40+ return (ddir </> "libs")
41+ Just ddir -> return ddir
37
42
38getCC :: IO String
43getCC :: IO String
39getCC = fromMaybe "gcc" <$> lookupEnv "IDRIS_CC"
44getCC = fromMaybe "gcc" <$> lookupEnv "IDRIS_CC"