hsqml 0.2.0.2 → 0.2.0.3
raw patch · 4 files changed
+37/−10 lines, 4 filessetup-changed
Files
- CHANGELOG +5/−0
- LICENSE +1/−1
- Setup.hs +22/−7
- hsqml.cabal +9/−2
CHANGELOG view
@@ -1,5 +1,10 @@ HsQML - Release History +release-0.2.0.3 - 2014.02.01++ * Added mechanism to force enable GHCi workaround library. + * Fixed reference name of extra GHCi library on Windows.+ release-0.2.0.2 - 2014.01.18 * Added support for Cabal 1.18 API.
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c)2010-2012, Robin KAY+Copyright (c)2010-2014, Robin KAY All rights reserved.
Setup.hs view
@@ -71,6 +71,13 @@ copyHook = copyWithQt, instHook = instWithQt, regHook = regWithQt} +getCustomFlag :: String -> PackageDescription -> Bool+getCustomFlag name pkgDesc =+ fromMaybe False $ do+ lib <- library pkgDesc+ str <- lookup name $ customFieldsBI $ libBuildInfo lib+ simpleParse str+ confWithQt :: (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo confWithQt (gpd,hbi) flags = do@@ -83,9 +90,16 @@ condLib' = mapCondTree fixCondLib condLib gpd' = gpd {condLibrary = Just $ condLib'} lbi <- confHook simpleUserHooks (gpd',hbi) flags+ -- Find Qt moc program and store in database (_,_,db') <- requireProgramVersion verb mocProgram qtVersionRange (withPrograms lbi)- return $ lbi {withPrograms = db'}+ -- Force enable GHCi workaround library if flag set and not using shared libs + let forceGHCiLib =+ (getCustomFlag "x-force-ghci-lib" $ localPkgDescr lbi) &&+ (not $ withSharedLib lbi)+ -- Update LocalBuildInfo+ return lbi {withPrograms = db',+ withGHCiLib = withGHCiLib lbi || forceGHCiLib} mapCondTree :: (a -> a) -> CondTree v c a -> CondTree v c a mapCondTree f (CondNode val cnstr cs) =@@ -143,10 +157,7 @@ needsGHCiFix :: PackageDescription -> LocalBuildInfo -> Bool needsGHCiFix pkgDesc lbi =- (withGHCiLib lbi &&) $ fromMaybe False $ do- lib <- library pkgDesc- str <- lookup "x-separate-cbits" $ customFieldsBI $ libBuildInfo lib- simpleParse str+ withGHCiLib lbi && getCustomFlag "x-separate-cbits" pkgDesc mkGHCiFixLibPkgId :: PackageDescription -> PackageIdentifier mkGHCiFixLibPkgId pkgDesc =@@ -158,6 +169,11 @@ mkGHCiFixLibName pkgDesc = ("lib" ++ display (mkGHCiFixLibPkgId pkgDesc)) <.> dllExtension +mkGHCiFixLibRefName :: PackageDescription -> String+mkGHCiFixLibRefName pkgDesc =+ prefix ++ display (mkGHCiFixLibPkgId pkgDesc)+ where prefix = if dllExtension == "dll" then "lib" else ""+ buildGHCiFix :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> IO () buildGHCiFix verb pkgDesc lbi lib = do@@ -221,8 +237,7 @@ verb pkg lib lbi clbi inplace dist let instPkgInfo' = if (needsGHCiFix pkg lbi) then instPkgInfo {I.extraGHCiLibraries =- (display $ mkGHCiFixLibPkgId pkg) :- I.extraGHCiLibraries instPkgInfo}+ mkGHCiFixLibRefName pkg : I.extraGHCiLibraries instPkgInfo} else instPkgInfo case flagToMaybe $ regGenPkgConf flags of Just regFile -> do
hsqml.cabal view
@@ -1,10 +1,10 @@ Name: hsqml-Version: 0.2.0.2+Version: 0.2.0.3 Cabal-version: >= 1.14 Build-type: Custom License: BSD3 License-file: LICENSE-Copyright: (c) 2010-2013 Robin KAY+Copyright: (c) 2010-2014 Robin KAY Author: Robin KAY Maintainer: komadori@gekkou.co.uk Stability: experimental@@ -27,6 +27,11 @@ Build test executable with the threaded RTS. Default: True +Flag ForceGHCiLib+ Description:+ Force enable GHCi workaround library if not using shared libraries.+ Default: True+ Library Default-language: Haskell2010 Build-depends:@@ -66,6 +71,8 @@ cbits/HsQMLWindow.h X-separate-cbits: True Build-tools: c2hs+ if flag(ForceGHCiLib)+ X-force-ghci-lib: True if os(windows) && !flag(UsePkgConfig) Include-dirs: /QT_ROOT/include Extra-libraries: QtCore4, QtGui4, QtScript4, QtDeclarative4, stdc++