forked from GitHub/gf-rgl
revert the change. GF_LIB_PATH needs to be checked
This commit is contained in:
12
Setup.bat
12
Setup.bat
@@ -27,9 +27,21 @@ REM Check command line options
|
|||||||
goto Loop
|
goto Loop
|
||||||
:Continue
|
:Continue
|
||||||
|
|
||||||
|
REM Try to determine install location
|
||||||
|
if "%dest%"=="" (
|
||||||
|
REM Separate paths with search path separator ; and pick first one
|
||||||
|
for %%p in ("%GF_LIB_PATH:;=";"%") do (
|
||||||
|
set dest=%%~p
|
||||||
|
goto BreakLibPath
|
||||||
|
)
|
||||||
|
)
|
||||||
|
:BreakLibPath
|
||||||
|
|
||||||
if "%dest%"=="" (
|
if "%dest%"=="" (
|
||||||
echo Unable to determine where to install the RGL. Please do one of the following:
|
echo Unable to determine where to install the RGL. Please do one of the following:
|
||||||
echo - Pass the --dest=... flag to this script
|
echo - Pass the --dest=... flag to this script
|
||||||
|
echo - Set the GF_LIB_PATH environment variable
|
||||||
|
REM echo - Compile & install GF from the gf-core repository (must be in same directory as gf-rgl)
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
6
Setup.hs
6
Setup.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,readProcess)
|
import System.Process (rawSystem,readProcess)
|
||||||
import System.FilePath ((</>))
|
import System.FilePath ((</>),splitSearchPath)
|
||||||
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)
|
||||||
@@ -60,6 +60,7 @@ errLocation :: String
|
|||||||
errLocation = unlines $
|
errLocation = unlines $
|
||||||
[ "Unable to determine where to install the RGL. Please do one of the following:"
|
[ "Unable to determine where to install the RGL. Please do one of the following:"
|
||||||
, " - Pass the " ++ destination_flag ++ "... flag to this script"
|
, " - Pass the " ++ destination_flag ++ "... flag to this script"
|
||||||
|
, " - Set the GF_LIB_PATH environment variable"
|
||||||
, " - Compile & install GF from the gf-core repository"
|
, " - Compile & install GF from the gf-core repository"
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -118,10 +119,11 @@ mkInfo = do
|
|||||||
let gf = maybe default_gf id (getFlag gf_flag args)
|
let gf = maybe default_gf id (getFlag gf_flag args)
|
||||||
-- 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
|
||||||
|
menvar <- lookupEnv "GF_LIB_PATH" >>= return . fmap (head . splitSearchPath)
|
||||||
mbuilt <- catchIOError (readProcess gf ["--version"] "" >>= return . getPath) (\e -> return Nothing)
|
mbuilt <- catchIOError (readProcess gf ["--version"] "" >>= return . getPath) (\e -> return Nothing)
|
||||||
let
|
let
|
||||||
inst_dir =
|
inst_dir =
|
||||||
case catMaybes [mflag,mbuilt] of
|
case catMaybes [mflag,menvar,mbuilt] of
|
||||||
[] -> Nothing
|
[] -> Nothing
|
||||||
p:_ -> Just p
|
p:_ -> Just p
|
||||||
let verbose = verbose_switch `elem` args || verbose_switch_short `elem` args
|
let verbose = verbose_switch `elem` args || verbose_switch_short `elem` args
|
||||||
|
|||||||
4
Setup.sh
4
Setup.sh
@@ -35,6 +35,9 @@ for arg in "$@"; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Try to determine install location
|
# Try to determine install location
|
||||||
|
if [ -z "$dest" ]; then
|
||||||
|
dest=$(echo "$GF_LIB_PATH" | sed 's/:.*$//')
|
||||||
|
fi
|
||||||
if [ -z "$dest" ] && [ "$(gf --version | tail -1 | cut -c -14)" == "Shared folder:" ]; then
|
if [ -z "$dest" ] && [ "$(gf --version | tail -1 | cut -c -14)" == "Shared folder:" ]; then
|
||||||
dest=$(gf --version | tail -1 | cut -c 16-)
|
dest=$(gf --version | tail -1 | cut -c 16-)
|
||||||
if [ -n "$dest" ]; then dest="${dest}/lib"; fi
|
if [ -n "$dest" ]; then dest="${dest}/lib"; fi
|
||||||
@@ -42,6 +45,7 @@ fi
|
|||||||
if [ -z "$dest" ]; then
|
if [ -z "$dest" ]; then
|
||||||
echo "Unable to determine where to install the RGL. Please do one of the following:"
|
echo "Unable to determine where to install the RGL. Please do one of the following:"
|
||||||
echo " - Pass the --dest=... flag to this script"
|
echo " - Pass the --dest=... flag to this script"
|
||||||
|
echo " - Set the GF_LIB_PATH environment variable"
|
||||||
echo " - Compile & install GF from the gf-core repository"
|
echo " - Compile & install GF from the gf-core repository"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user