on master help sign in
Install packages in sub-directory of Idris' data dir.
commit893265894630ce9ce48c06b352cbd12713630045 authorJan de Muijnck-Hughes <jfdm@st-andrews.ac.uk> dateFri 9 Sep 2016, 22:56 (10 years ago) parent72ab227
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"