[Pkg-haskell-commits] [SCM] Data type conversions branch, master, updated. debian/1.0.6-3-16-gddc32a1

John Goerzen jgoerzen at complete.org
Wed Feb 17 17:07:51 UTC 2010


The following commit has been merged in the master branch:
commit ad3509ec5896012ca8bef37bd140e394b168a432
Author: Marc Weber <marco-oweber at gmx.de>
Date:   Sun Nov 29 06:07:06 2009 +0100

    convertible - patch for time >= 1.1.3
    
    Hi John,
    
    I've got a small patch for you which makes your library compile with
    time >= 1.1.3
    
    The issue has been that time defines two instances itself now.
    
    I solved it by adding CPP statements.
    
    If you do have a public repository location consider adding it to the
    .cabal file.
    
    Marc Weber

diff --git a/Data/Convertible/Instances/Time.hs b/Data/Convertible/Instances/Time.hs
index 84c481e..6285473 100644
--- a/Data/Convertible/Instances/Time.hs
+++ b/Data/Convertible/Instances/Time.hs
@@ -32,7 +32,9 @@ import Data.Time
 import Data.Time.Clock
 import Data.Time.Clock.POSIX
 import Data.Time.Calendar.OrdinalDate
+#ifndef TIME_GT_113
 import Data.Typeable
+#endif
 import Data.Ratio
 import Foreign.C.Types
 
@@ -58,11 +60,13 @@ instance Convertible Integer ST.ClockTime where
 
 ------------------------------ POSIX and UTC times
 
+#ifndef TIME_GT_113
 instance Typeable NominalDiffTime where
     typeOf _ = mkTypeName "NominalDiffTime"
 
 instance Typeable UTCTime where
     typeOf _ = mkTypeName "UTCTime"
+#endif
 
 {- Covered under Real a
 instance Convertible Rational POSIXTime where
diff --git a/convertible.cabal b/convertible.cabal
index a384527..e00d32e 100644
--- a/convertible.cabal
+++ b/convertible.cabal
@@ -40,10 +40,18 @@ flag buildtests
   description: Build the executable to run unit tests
   default: False
 
+flag time_gte_113
+  description: time > 1.1.3 has defined some more instances so omit them here
+
 library
   if flag(splitBase)
-    Build-Depends: base>=3 && <4, old-time, time>=1.1.2.4 && <1.1.3,
+    Build-Depends: base>=3 && <5, old-time, time>=1.1.2.4 && <=1.1.4,
      bytestring, containers, old-locale
+    if flag(time_gte_113)
+      Build-Depends: time>=1.1.3
+      CPP-OPTIONS: -DTIME_GT_113
+    else
+      Build-Depends: time<1.1.3
   else
     Build-Depends: base<3
   Build-Depends: mtl

-- 
Data type conversions



More information about the Pkg-haskell-commits mailing list