diff --git a/LibClang.cabal b/LibClang.cabal index 98c3170..dd56f39 100644 --- a/LibClang.cabal +++ b/LibClang.cabal @@ -46,7 +46,7 @@ Library resourcet >= 1.1 && < 1.2, text >= 1.1 && < 1.3, time >= 1.4 && < 1.6, - transformers >= 0.3 && < 0.5, + transformers >= 0.3, transformers-base >= 0.4 && < 0.5, vector >= 0.10 && < 0.11 hs-source-dirs: src diff --git a/Setup.hs b/Setup.hs index dc7e704..b809847 100644 --- a/Setup.hs +++ b/Setup.hs @@ -1,5 +1,6 @@ {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} +{-# LANGUAGE CPP #-} import Control.Exception import Control.Monad @@ -8,7 +9,9 @@ import Data.List (isPrefixOf) import Distribution.PackageDescription import Distribution.Verbosity import Distribution.Simple -import Distribution.Simple.BuildPaths +#if MIN_VERSION_Cabal(1,24,0) +import Distribution.Simple.BuildPaths hiding (mkLibName) +#endif import Distribution.Simple.LocalBuildInfo import Distribution.Simple.Setup import Distribution.Simple.Utils @@ -197,8 +200,11 @@ libClangBuildHook pkg lbi usrHooks flags = do -- Merge the libclang static libraries into each Haskell static library. forM_ componentLibs $ \componentLib -> do when (withVanillaLib lbi') $ +#if MIN_VERSION_Cabal(1,24,0) + mergeLibs $ mkLibName (getHSLibraryName componentLib) +#else mergeLibs $ mkLibName componentLib - +#endif when (withProfLib lbi') $ mergeLibs $ mkProfLibName componentLib @@ -263,14 +269,29 @@ runAr v lbi args script = progWithStdin prog = (programInvocation prog args') { progInvokeInput = Just script } args' = if v >= deafening then "-v" : args else args +#if MIN_VERSION_Cabal(1,24,0) +mkLibName :: String -> String +mkLibName lname = + "lib" ++ lname <.> "a" +#endif + mkStaticLib :: String -> String +#if MIN_VERSION_Cabal(1,24,0) +mkStaticLib lname = mkLibName lname +#else mkStaticLib lname = mkLibName (LibraryName lname) +#endif mkSharedLib :: String -> String mkSharedLib lname = "lib" ++ lname <.> dllExtension +#if MIN_VERSION_Cabal(1,24,0) +componentLibNames :: (ComponentName, ComponentLocalBuildInfo, [ComponentName]) -> [UnitId] +componentLibNames (_, LibComponentLocalBuildInfo {..}, _) = [componentUnitId] +#else componentLibNames :: (ComponentName, ComponentLocalBuildInfo, [ComponentName]) -> [LibraryName] componentLibNames (_, LibComponentLocalBuildInfo {..}, _) = componentLibraries +#endif componentLibNames _ = [] confProgram, libtoolProgram, makeProgram, swVersProgram :: Program diff --git a/src/Clang/Internal/FFI.chs b/src/Clang/Internal/FFI.chs index 068eea8..317d1bb 100644 --- a/src/Clang/Internal/FFI.chs +++ b/src/Clang/Internal/FFI.chs @@ -2451,7 +2451,6 @@ instance Hashable (Cursor s) where kindHash = hashWithSalt salt (fromEnum k) pAsInt = fromIntegral (ptrToIntPtr p) :: Int in hashWithSalt kindHash pAsInt - {-# INLINE hash #-} -- CXCursor clang_getNullCursor(void); getNullCursor :: ClangBase m => ClangT s m (Cursor s)