aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Richardson <brichardson@structint.com>2020-06-14 19:18:26 -0700
committerBrad Richardson <brichardson@structint.com>2020-06-14 19:18:26 -0700
commit91a649cdd80bf1062a03bcbc58715789ae0d3422 (patch)
treeebf45660e59a78d81259601d0bef0419c30b586b
parent778fb0e8e2e97e57deff3daf781329ae0976fb31 (diff)
downloadfpm-91a649cdd80bf1062a03bcbc58715789ae0d3422.tar.gz
fpm-91a649cdd80bf1062a03bcbc58715789ae0d3422.zip
Try escaping the colon in buildscript BUILD_DIR
-rw-r--r--package.yaml1
-rw-r--r--src/Build.hs6
2 files changed, 6 insertions, 1 deletions
diff --git a/package.yaml b/package.yaml
index ece47c9..7cf11c6 100644
--- a/package.yaml
+++ b/package.yaml
@@ -25,6 +25,7 @@ dependencies:
- directory
- extra
- filepath
+- MissingH
- optparse-applicative
- process
- shake
diff --git a/src/Build.hs b/src/Build.hs
index ce1f161..96b58ab 100644
--- a/src/Build.hs
+++ b/src/Build.hs
@@ -15,6 +15,7 @@ import Data.Char ( isAsciiLower
import Data.List ( intercalate
, isSuffixOf
)
+import Data.List.Utils (replace)
import qualified Data.Map as Map
import Data.Maybe ( fromMaybe
, mapMaybe
@@ -385,7 +386,7 @@ buildWithScript script projectDirectory buildDirectory compiler flags libraryNam
absoluteLibraryDirectories <- mapM makeAbsolute otherLibraryDirectories
setEnv "FC" compiler
setEnv "FFLAGS" (intercalate " " flags)
- setEnv "BUILD_DIR" absoluteBuildDirectory
+ setEnv "BUILD_DIR" (escapeColon absoluteBuildDirectory)
setEnv "INCLUDE_DIRS" (intercalate " " absoluteLibraryDirectories)
let archiveFile = absoluteBuildDirectory </> "lib" ++ libraryName <.> "a"
withCurrentDirectory
@@ -401,3 +402,6 @@ isMakefile script | script == "Makefile" = True
| script == "makefile" = True
| ".mk" `isSuffixOf` script = True
| otherwise = False
+
+escapeColon :: String -> String
+escapeColon = replace ":" "\\:"