diff --git a/Setup.hs b/Setup.hs index 52286a2..804d287 100644 --- a/Setup.hs +++ b/Setup.hs @@ -12,6 +12,7 @@ import Distribution.Simple import Distribution.Simple.Setup (configConfigurationsFlags) import Distribution.PackageDescription import Distribution.Simple.LocalBuildInfo +import Distribution.Utils.Path (makeSymbolicPath) @@ -48,11 +49,11 @@ configureWithGdalConfig lbi flags = do . (if hasCurl || hasPg then (++["ssl","crypto"]) else id) $ gdalLibs updBinfo bi = bi { extraLibDirs = extraLibDirs bi - ++ gdalLibDirs - ++ catMaybes staticDirs + ++ map makeSymbolicPath gdalLibDirs + ++ map makeSymbolicPath (catMaybes staticDirs) , extraLibs = extraLibs bi ++ (if isStatic then gdalLibsStatic else gdalLibs) - , includeDirs = includeDirs bi ++ gdalInclude + , includeDirs = includeDirs bi ++ map makeSymbolicPath gdalInclude } -- | appendGeos: makes sure 'geos_c' is included before 'geos' so symbols -- can be resolved when linking statically diff --git a/src/GDAL/Internal/GDAL.chs b/src/GDAL/Internal/GDAL.chs index 772ce4e..7374e64 100644 --- a/src/GDAL/Internal/GDAL.chs +++ b/src/GDAL/Internal/GDAL.chs @@ -179,7 +179,7 @@ import Control.Arrow (second) import Control.Applicative (Applicative(..), liftA2) import Control.Exception (Exception(..)) import Control.DeepSeq (NFData(..)) -import Control.Monad (liftM2, when, (>=>), (<=<)) +import Control.Monad (liftM2, void, when, (>=>), (<=<)) import Control.Monad.Catch (MonadThrow, throwM) import Control.Monad.Trans (lift) import Control.Monad.IO.Class (MonadIO(liftIO)) @@ -517,7 +517,7 @@ newDatasetHandle act = do | p==nullDatasetH = Just (fromMaybe (GDALBindingException NullDataset) exc) | otherwise = Nothing - free = {#call GDALClose as ^#} + free = void . {#call GDALClose as ^#} unsafeFromHandle :: DatasetH -> Dataset s a t unsafeFromHandle h = Dataset (Nothing,h) @@ -534,7 +534,7 @@ createMem createMem = create "Mem" "" flushCache :: RWDataset s a -> GDAL s () -flushCache = liftIO . {#call GDALFlushCache as ^#} . unDataset +flushCache = liftIO . void . {#call GDALFlushCache as ^#} . unDataset datasetDriver :: Dataset s a t -> Driver t' datasetDriver ds = diff --git a/src/GDAL/Internal/VRT.chs b/src/GDAL/Internal/VRT.chs index a3df5e6..d07c424 100644 --- a/src/GDAL/Internal/VRT.chs +++ b/src/GDAL/Internal/VRT.chs @@ -26,7 +26,7 @@ import GDAL.Internal.Util {#import GDAL.Internal.GDAL#} import OGR (Envelope(..)) -import Control.Monad (unless) +import Control.Monad (unless, void) import Control.Exception (SomeException, catch) import Control.Monad.Catch (throwM) import Control.Monad.IO.Class (MonadIO(liftIO)) @@ -62,7 +62,7 @@ createVRT (nx:+:ny) f = do liftIO ({#call VRTFlushCache as ^#} vDs) return (Dataset (Just rk, coerce vDs)) where - close_ = {#call GDALClose as ^#} . coerce + close_ = void . {#call GDALClose as ^#} . coerce create_ = {#call unsafe VRTCreate as ^#} (fromIntegral nx) (fromIntegral ny)