Move qtah's "extra-libraries: qtah" to Setup.hs.

This is a required part of moving to GHC and Cabal's new dynamic library
directory split[1], and also fixes an issue with cabal2nix (and possibly
other systems parsing qtah.cabal), because the setup file is needed to
actually be able to find libqtah.so.  It seems better to inject the
dependency on libqtah.so at the same time as saying where it can be
found, not before.

[1] #27
[2] !13
parent 75a3e8ee
......@@ -37,6 +37,7 @@ import Distribution.PackageDescription (
PackageDescription,
emptyBuildInfo,
extraLibDirs,
extraLibs,
package,
#if MIN_VERSION_Cabal(2,0,0)
FlagName, mkFlagName,
......@@ -175,7 +176,13 @@ storeQtahCppLibDir libDir = do
addLibDir :: IO HookedBuildInfo
addLibDir = do
qtahCppLibDir <- readFile qtahCppLibDirFile
return (Just emptyBuildInfo {extraLibDirs = [qtahCppLibDir]}, [])
-- We add qtah to extra-libraries here, because we only know its path now,
-- after the configure step. If we put "extra-libraries: qtah" in qtah.cabal,
-- then "cabal configure" fails because it can't find libqtah.so.
return (Just emptyBuildInfo { extraLibDirs = [qtahCppLibDir]
, extraLibs = ["qtah"]
},
[])
generatorProgram :: Program
generatorProgram = simpleProgram "qtah-generator"
......
......@@ -372,7 +372,8 @@ library
hs-source-dirs: src
ghc-options: -W -fwarn-incomplete-patterns -fwarn-unused-do-bind
default-language: Haskell2010
extra-libraries: qtah
-- There would be an "extra-libraries: qtah" here, but we need to add it from
-- Setup.hs instead.
test-suite test-qtah
type: exitcode-stdio-1.0
......@@ -388,7 +389,6 @@ test-suite test-qtah
hs-source-dirs: tests
ghc-options: -W -fwarn-incomplete-patterns -fwarn-unused-do-bind -dynamic
default-language: Haskell2010
extra-libraries: qtah
custom-setup
setup-depends:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment