1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00
semantic/Setup.hs
2015-12-17 13:37:24 -05:00

26 lines
953 B
Haskell

import Data.Maybe
import qualified Distribution.PackageDescription as P
import Distribution.Simple
import Distribution.Simple.LocalBuildInfo
import Distribution.Simple.Setup
import System.Directory
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 in do
dir <- getCurrentDirectory
return localBuildInfo {
localPkgDescr = packageDescription {
P.library = Just $ library {
P.libBuildInfo = libraryBuildInfo {
P.extraLibDirs = (dir ++ "/prototype/External/tree-sitter/out/Release") : P.extraLibDirs libraryBuildInfo
}
}
}
}