2016-01-08 21:24:25 +03:00
|
|
|
import Data.Maybe
|
|
|
|
import qualified Distribution.PackageDescription as P
|
2015-11-18 01:44:16 +03:00
|
|
|
import Distribution.Simple
|
2016-01-08 21:24:25 +03:00
|
|
|
import Distribution.Simple.LocalBuildInfo
|
|
|
|
import Distribution.Simple.Setup
|
|
|
|
import System.Directory
|
|
|
|
import System.Process
|
|
|
|
|
|
|
|
main = defaultMainWithHooks simpleUserHooks { confHook = conf }
|
|
|
|
|
|
|
|
conf :: (P.GenericPackageDescription, P.HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo
|
|
|
|
conf x flags = do
|
|
|
|
localBuildInfo <- confHook simpleUserHooks x flags
|
|
|
|
let packageDescription = localPkgDescr localBuildInfo
|
|
|
|
library = fromJust $ P.library packageDescription
|
|
|
|
libraryBuildInfo = P.libBuildInfo library
|
|
|
|
relativeIncludeDirs = [ "common", "i18n" ] in do
|
|
|
|
dir <- getCurrentDirectory
|
2016-02-29 17:37:36 +03:00
|
|
|
let icuLibDir = dir ++ "/vendor/icu/lib"
|
|
|
|
let icuSourceDir = dir ++ "/vendor/icu/source/"
|
2016-01-08 21:24:25 +03:00
|
|
|
return localBuildInfo {
|
|
|
|
localPkgDescr = packageDescription {
|
|
|
|
P.library = Just $ library {
|
|
|
|
P.libBuildInfo = libraryBuildInfo {
|
2016-02-29 17:37:36 +03:00
|
|
|
P.extraLibDirs = icuLibDir : P.extraLibDirs libraryBuildInfo,
|
|
|
|
P.includeDirs = ((icuSourceDir ++) <$> relativeIncludeDirs) ++ P.includeDirs libraryBuildInfo
|
2016-01-08 21:24:25 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|