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

Location haskell-gi

parent e8cc968f
No related branches found
No related tags found
1 merge request!26Location migration
......@@ -43,7 +43,7 @@ index 7f863e8..8930a5a 100644
containers,
directory,
diff --git a/lib/Data/GI/CodeGen/CabalHooks.hs b/lib/Data/GI/CodeGen/CabalHooks.hs
index 23735c2..5fec8a5 100644
index 23735c2..d8672ff 100644
--- a/lib/Data/GI/CodeGen/CabalHooks.hs
+++ b/lib/Data/GI/CodeGen/CabalHooks.hs
@@ -1,17 +1,31 @@
......@@ -103,7 +103,7 @@ index 23735c2..5fec8a5 100644
-
-type ConfHook = (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags
- -> IO LocalBuildInfo
+import Distribution.Utils.Path (getSymbolicPath)
+import Distribution.Utils.Path
+import qualified Data.List.NonEmpty as NE
-- | Included overrides file.
......@@ -182,7 +182,7 @@ index 23735c2..5fec8a5 100644
+ noBuildHooks
+ { preBuildComponentRules = Just $ rules (static ()) $ \pbci -> do
+ let
+ sourcesDir = getSymbolicPath $ autogenComponentModulesDir (pbci.localBuildInfo) (pbci.targetInfo.targetCLBI)
+ sourcesDir = autogenComponentModulesDir (pbci.localBuildInfo) (pbci.targetInfo.targetCLBI)
+ cmd = mkCommand (static Dict) (static \(sourcesDir,version,verbosity,pkgVersion,pkgName,overridesFile,outputDir,name,inheritedOverrides) -> do
+ -- We need to call generateModule every time we want to
+ -- regenerate the build tree, since we have just one rule for
......@@ -200,7 +200,7 @@ index 23735c2..5fec8a5 100644
+ -- location, and to the module names of the declared `Results`.
+ _ <- writeModuleTree verbosity (Just sourcesDir) moduleInfo
+
+ genConfigModule sourcesDir outputDir name givenOvs) (sourcesDir,version,verbosity,pkgVersion,pkgName,overridesFile,outputDir,name,inheritedOverrides)
+ genConfigModule sourcesDir outputDir name givenOvs) (getSymbolicPath sourcesDir,version,verbosity,pkgVersion,pkgName,overridesFile,outputDir,name,inheritedOverrides)
+
+ -- We need to call generateModuleInfo a second time at build
+ -- time, even if we've already computed this at configure for
......@@ -213,7 +213,7 @@ index 23735c2..5fec8a5 100644
+ let em' = genModulesFromInfo name moduleInfo
+
+ registerRule_ "rule1" $
+ staticRule cmd [] (NE.fromList $ map (\mn -> (sourcesDir, MN.toFilePath mn <> ".hs")) em')
+ staticRule cmd [] (NE.fromList $ map (\mn -> Location sourcesDir (moduleNameSymbolicPath mn <.> "hs")) em')
+ }
+ }
+
......
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