hogre 0.1.2 → 0.1.3
raw patch · 2 files changed
+26/−23 lines, 2 filessetup-changed
Files
- Setup.hs +24/−22
- hogre.cabal +2/−1
Setup.hs view
@@ -23,6 +23,9 @@ , instHook = ogreInstHook , cleanHook = ogreCleanHook , haddockHook = ogreHaddockHook+ , hookedPrograms = [simpleProgram "cgen",+ simpleProgram "grgen",+ simpleProgram "cgen-hs"] } err :: String -> IO a@@ -35,15 +38,6 @@ [file] -> return file files -> err $ "Error in extra source files configuration: Exactly one file with the extension \"" ++ ext ++ "\" allowed. Found:\n\t" ++ show files -getProgram :: String -> String -> IO ConfiguredProgram-getProgram src pname = do- mloc <- findProgramLocation normal pname- case mloc of- Nothing -> err $ "Could not find program \"" ++ pname ++ "\".\n" ++ - "Try installing the program from " ++ src ++ ".\n" ++ - "If you've installed the program, make sure the program is in your PATH."- Just loc -> return $ ConfiguredProgram pname Nothing [] (FoundOnSystem loc)- getFiles :: String -> FilePath -> IO [FilePath] getFiles ext dir = map (dir </>) <$> filter (\f -> takeExtension f == (extSeparator:ext)) <$> getDirectoryContents dir@@ -84,17 +78,23 @@ cppfiles <- getFiles "cpp" resCgen includepaths <- getIncludePaths lb let expModules = map fullModuleName ["HOgre", "Types"]- libbuildinfo = BuildInfo True [] [] [] [] - [(Dependency (PackageName "OgreMain")- (laterVersion (Version [1,8] [])))]- [] cppfiles [resCgenHsBase] - (filter (`notElem` expModules) - (map fullModuleName genhsmodulenames))- [] ["OgreMain"] [] includepaths [] [] [] [] [] []- [Dependency (PackageName "base") + libbuildinfo = emptyBuildInfo { buildable = True,+ pkgconfigDepends = + [(Dependency (PackageName "OgreMain")+ (laterVersion (Version [1,8] [])))],+ cSources = cppfiles,+ hsSourceDirs = [resCgenHsBase],+ otherModules = + (filter (`notElem` expModules) + (map fullModuleName genhsmodulenames)),+ extraLibs = ["OgreMain"],+ includeDirs = includepaths,+ targetBuildDepends =+ [Dependency (PackageName "base") (intersectVersionRanges (orLaterVersion (Version [3] [])) (earlierVersion (Version [5] []))),- Dependency (PackageName "haskell98") anyVersion]+ Dependency (PackageName "haskell98") anyVersion]+ } return $ Library expModules True libbuildinfo getConfiguredIncludePaths :: LocalBuildInfo -> [String]@@ -109,7 +109,7 @@ case buildOS of Windows -> return defincludepaths _ -> do- pkgconfig <- getProgram "http://pkg-config.freedesktop.org/" "pkg-config"+ pkgconfig <- getProgram "pkg-config" mogreincpath <- (filter (\w -> take 2 w == "-I") . words) <$> getProgramOutput normal pkgconfig ["--cflags", "OGRE"] case mogreincpath of [] -> do@@ -121,6 +121,8 @@ return defincludepaths (x:_) -> return $ [drop 2 x] +getProgram pn = fst <$> requireProgram normal (simpleProgram pn) defaultProgramConfiguration+ ogreBuildHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO () ogreBuildHook pd lb uh bf = do geniffile <- getSrcFile pd "if"@@ -129,9 +131,9 @@ hiffile <- getSrcFile pd "hif" listfile <- getSrcFile pd "list" winlistfile <- getSrcFile pd "list_win"- cgen <- getProgram "Hackage" "cgen"- grgen <- getProgram "Hackage" "grgen"- cgenhs <- getProgram "Hackage" "cgen-hs"+ cgen <- getProgram "cgen"+ grgen <- getProgram "grgen"+ cgenhs <- getProgram "cgen-hs" let headerlistfile = case buildOS of Windows -> winlistfile _ -> listfile
hogre.cabal view
@@ -1,5 +1,5 @@ Name: hogre-Version: 0.1.2+Version: 0.1.3 Cabal-Version: >= 1.6 License: MIT License-File: LICENSE@@ -33,4 +33,5 @@ if !os(windows) pkgconfig-depends: OGRE extra-libraries: OgreMain+ build-tools: cgen, grgen, cgen-hs