forked from GitHub/gf-rgl
Haskell/Shell build scripts handle multiple paths in GF_LIB_PATH (pick first)
Not implemented for Batch
This commit is contained in:
1
Make.bat
1
Make.bat
@@ -29,6 +29,7 @@ goto Loop
|
|||||||
|
|
||||||
REM Try to determine install location
|
REM Try to determine install location
|
||||||
if "%dest%"=="" (
|
if "%dest%"=="" (
|
||||||
|
REM TODO Separate paths with search path separator ; and pick first one
|
||||||
set dest=%GF_LIB_PATH%
|
set dest=%GF_LIB_PATH%
|
||||||
)
|
)
|
||||||
if "%dest%"=="" (
|
if "%dest%"=="" (
|
||||||
|
|||||||
4
Make.hs
4
Make.hs
@@ -9,7 +9,7 @@ import System.IO.Error (catchIOError)
|
|||||||
import System.Exit (ExitCode(..),exitFailure)
|
import System.Exit (ExitCode(..),exitFailure)
|
||||||
import System.Environment (getArgs,lookupEnv)
|
import System.Environment (getArgs,lookupEnv)
|
||||||
import System.Process (rawSystem)
|
import System.Process (rawSystem)
|
||||||
import System.FilePath ((</>)) -- ,takeFileName,addExtension,dropExtension)
|
import System.FilePath ((</>),splitSearchPath) -- ,takeFileName,addExtension,dropExtension)
|
||||||
import System.Directory (createDirectoryIfMissing,copyFile,getDirectoryContents,removeDirectoryRecursive,findFile)
|
import System.Directory (createDirectoryIfMissing,copyFile,getDirectoryContents,removeDirectoryRecursive,findFile)
|
||||||
#if __GLASGOW_HASKELL__>=800
|
#if __GLASGOW_HASKELL__>=800
|
||||||
import System.Directory (getModificationTime,setModificationTime)
|
import System.Directory (getModificationTime,setModificationTime)
|
||||||
@@ -119,7 +119,7 @@ mkInfo = do
|
|||||||
-- Look for install location in a few different places
|
-- Look for install location in a few different places
|
||||||
let mflag = getFlag destination_flag args
|
let mflag = getFlag destination_flag args
|
||||||
mbuilt <- catchIOError (readFile "../gf-core/DATA_DIR" >>= \d -> return (Just (d </> "lib"))) (\e -> return Nothing)
|
mbuilt <- catchIOError (readFile "../gf-core/DATA_DIR" >>= \d -> return (Just (d </> "lib"))) (\e -> return Nothing)
|
||||||
menvar <- lookupEnv "GF_LIB_PATH"
|
menvar <- lookupEnv "GF_LIB_PATH" >>= return . fmap (head . splitSearchPath)
|
||||||
let
|
let
|
||||||
inst_dir =
|
inst_dir =
|
||||||
case catMaybes [mflag,menvar,mbuilt] of
|
case catMaybes [mflag,menvar,mbuilt] of
|
||||||
|
|||||||
2
Make.sh
2
Make.sh
@@ -36,7 +36,7 @@ done
|
|||||||
|
|
||||||
# Try to determine install location
|
# Try to determine install location
|
||||||
if [ -z "$dest" ]; then
|
if [ -z "$dest" ]; then
|
||||||
dest="$GF_LIB_PATH"
|
dest=$(echo "$GF_LIB_PATH" | sed 's/:.*$//')
|
||||||
fi
|
fi
|
||||||
if [ -z "$dest" ] && [ -f "../gf-core/DATA_DIR" ]; then
|
if [ -z "$dest" ] && [ -f "../gf-core/DATA_DIR" ]; then
|
||||||
dest=$(cat ../gf-core/DATA_DIR)
|
dest=$(cat ../gf-core/DATA_DIR)
|
||||||
|
|||||||
Reference in New Issue
Block a user