on master help sign in
Merge pull request #3418 from jfdm/add-lib-to-libdir-path

Install packages in sub-directory of Idris' data dir.

commitd5ec3d279f966ff963959171f3e5b7ca9ad7b3e8 authorJan de Muijnck-Hughes <jfdm@users.noreply.github.com> dateSat 10 Sep 2016, 09:00 (10 years ago) parent425e3ee8932658
3 files changed+12−4
CHANGELOG.md+2 Setup.hs+3−2 src/IRTS/System.hs+7−2
CHANGELOG.md+2
@@ -30,6 +30,8 @@
3030
3131* `return`, which has been an alias for `pure` for many releases, is now deprecated.
3232
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+
3335## Tool updates
3436
3537* 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)) $
254254 target = datadir $ L.absoluteInstallDirs pkg local copy
255255
256256 installStdLib = do
257− putStrLn $ "Installing libraries in " ++ target
258− makeInstall "libs" target
257+ let target' = target </> "libs"
258+ putStrLn $ "Installing libraries in " ++ target'
259+ makeInstall "libs" target'
259260
260261 installRTS = do
261262 let target' = target </> "rts"
src/IRTS/System.hs+7−2
@@ -32,8 +32,13 @@ import Paths_idris
3232#endif
3333
3434overrideDataDirWith :: String -> IO FilePath
35−overrideDataDirWith envVar = do envValue <- lookupEnv envVar
36− maybe getDataDir return envValue
35+overrideDataDirWith envVar = do
36+ envValue <- lookupEnv envVar
37+ case envValue of
38+ Nothing -> do
39+ ddir <- getDataDir
40+ return (ddir </> "libs")
41+ Just ddir -> return ddir
3742
3843getCC :: IO String
3944getCC = fromMaybe "gcc" <$> lookupEnv "IDRIS_CC"