Skip to content
Snippets Groups Projects
Verified Commit c86314b8 authored by Rodrigo Mesquita's avatar Rodrigo Mesquita :seedling:
Browse files

Location ghc-paths

parent 581f09ae
No related branches found
No related tags found
1 merge request!26Location migration
......@@ -116,7 +116,7 @@ index f2d1733..0000000
-stripPrefix _ _ = Nothing
diff --git a/SetupHooks.hs b/SetupHooks.hs
new file mode 100644
index 0000000..f783b22
index 0000000..64612e0
--- /dev/null
+++ b/SetupHooks.hs
@@ -0,0 +1,111 @@
......@@ -138,7 +138,7 @@ index 0000000..f783b22
+import Distribution.Simple.SetupHooks
+import Distribution.Types.TargetInfo
+import Distribution.Simple.BuildPaths
+import Distribution.Utils.Path (getSymbolicPath)
+import Distribution.Utils.Path (getSymbolicPath, makeRelativePathEx, (</>))
+
+import Control.Monad.IO.Class
+import Data.Char
......@@ -147,7 +147,7 @@ index 0000000..f783b22
+import Data.IORef
+import System.Directory
+import System.Exit
+import System.FilePath
+import System.FilePath hiding ((</>))
+import System.IO
+import Control.Monad
+
......@@ -169,8 +169,8 @@ index 0000000..f783b22
+pathsResult :: LocalBuildInfo -> TargetInfo -> Location
+pathsResult lbi tgt =
+ -- We want the symbolic path relative to the package.
+ let autogendir = getSymbolicPath $ autogenComponentModulesDir lbi (targetCLBI tgt)
+ in (autogendir, pathsModulePath)
+ let autogendir = autogenComponentModulesDir lbi (targetCLBI tgt)
+ in Location autogendir (makeRelativePathEx pathsModulePath)
+
+createPathsModule :: PreBuildComponentInputs -> IO ()
+createPathsModule
......@@ -205,7 +205,7 @@ index 0000000..f783b22
+ ; ghc_pkg <- canonicalizePath ghc_pkg0
+ ; ghc <- canonicalizePath ghc0
+ ; case pathsResult lbi tgt of
+ (base, fp) -> writePathsModule (base </> fp) (Paths { .. })
+ Location base fp -> writePathsModule (getSymbolicPath $ base </> fp) (Paths { .. })
+ }
+ | otherwise
+ = return ()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment