[commit: packages/time] master: Use configurations rather than Setup.hs hacks (5b0af2b)

git at git.haskell.org git at git.haskell.org
Sun Dec 20 07:51:36 UTC 2015


Repository : ssh://git@git.haskell.org/time

On branch  : master
Link       : http://git.haskell.org/packages/time.git/commitdiff/5b0af2be4901a466c6daf2895b242eaf46e70870

>---------------------------------------------------------------

commit 5b0af2be4901a466c6daf2895b242eaf46e70870
Author: Ian Lynagh <igloo at earth.li>
Date:   Sun Jul 29 14:38:33 2007 -0700

    Use configurations rather than Setup.hs hacks
    
    darcs-hash:20070729213833-3fd76-865c6cb804d9768e5712cfe6bb5cd1f77340eda9


>---------------------------------------------------------------

5b0af2be4901a466c6daf2895b242eaf46e70870
 Setup.hs   | 13 +---------
 time.cabal | 85 ++++++++++++++++++++++++++++++++++----------------------------
 2 files changed, 47 insertions(+), 51 deletions(-)

diff --git a/Setup.hs b/Setup.hs
index e8a005c..d57f1c9 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -11,10 +11,7 @@ import System.Directory
 import System.Info
 
 main :: IO ()
-main = do let hooks = defaultUserHooks {
-                  confHook = add_Win32_dep
-                           $ confHook defaultUserHooks,
-                  runTests = runTestScript }
+main = do let hooks = defaultUserHooks { runTests = runTestScript }
           defaultMainWithHooks hooks
 
 withCurrentDirectory :: FilePath -> IO a -> IO a
@@ -29,11 +26,3 @@ runTestScript _args _flag _pd _lbi
 
 type ConfHook = PackageDescription -> ConfigFlags -> IO LocalBuildInfo
 
--- XXX Hideous hack
-add_Win32_dep :: ConfHook -> ConfHook
-add_Win32_dep f pd cf
- = do let pd' = if os == "mingw32"
-                then pd { buildDepends = Dependency "Win32" AnyVersion
-                                       : buildDepends pd }
-                else pd
-      f pd' cf
diff --git a/time.cabal b/time.cabal
index cb9b6ca..e32a126 100644
--- a/time.cabal
+++ b/time.cabal
@@ -7,42 +7,49 @@ Author:		Ashley Yakeley
 Maintainer:	<ashley at semantic.org>
 Homepage:	http://semantic.org/TimeLib/
 Category:
-Build-Depends:	base, old-locale
-Synopsis:	time library
-Exposed-Modules:
-	Data.Time.Calendar,
-	Data.Time.Calendar.MonthDay,
-	Data.Time.Calendar.OrdinalDate,
-	Data.Time.Calendar.WeekDate,
-	Data.Time.Calendar.Julian,
-	Data.Time.Calendar.Easter,
-	Data.Time.Clock,
-	Data.Time.Clock.POSIX,
-	Data.Time.Clock.TAI,
-	Data.Time.LocalTime,
-	Data.Time.Format,
-	Data.Time
-Extensions:	ForeignFunctionInterface, CPP
-C-Sources:	cbits/HsTime.c
-Other-Modules:
-	Data.Time.Calendar.Private,
-	Data.Time.Calendar.Days,
-	Data.Time.Calendar.Gregorian,
-	Data.Time.Calendar.JulianYearDay,
-	Data.Time.Clock.Scale,
-	Data.Time.Clock.UTC,
-	Data.Time.Clock.CTimeval,
-	Data.Time.Clock.UTCDiff,
-	Data.Time.LocalTime.TimeZone,
-	Data.Time.LocalTime.TimeOfDay,
-	Data.Time.LocalTime.LocalTime,
-	Data.Time.Format.Parse
-Extra-Source-Files:
-	aclocal.m4 configure.ac configure
-	include/HsTime.h include/HsTimeConfig.h.in
-Extra-Tmp-Files:
-	config.log config.status autom4te.cache
-	include/HsTimeConfig.h
-Include-Dirs:	include
-Install-Includes:
-	HsTime.h HsTimeConfig.h
+
+Library {
+    Build-Depends: base, old-locale
+    if os(mingw32) {
+        Build-Depends: Win32
+    }
+    Synopsis:	time library
+    Exposed-Modules:
+    	Data.Time.Calendar,
+    	Data.Time.Calendar.MonthDay,
+    	Data.Time.Calendar.OrdinalDate,
+    	Data.Time.Calendar.WeekDate,
+    	Data.Time.Calendar.Julian,
+    	Data.Time.Calendar.Easter,
+    	Data.Time.Clock,
+    	Data.Time.Clock.POSIX,
+    	Data.Time.Clock.TAI,
+    	Data.Time.LocalTime,
+    	Data.Time.Format,
+    	Data.Time
+    Extensions:	ForeignFunctionInterface, CPP
+    C-Sources:	cbits/HsTime.c
+    Other-Modules:
+    	Data.Time.Calendar.Private,
+    	Data.Time.Calendar.Days,
+    	Data.Time.Calendar.Gregorian,
+    	Data.Time.Calendar.JulianYearDay,
+    	Data.Time.Clock.Scale,
+    	Data.Time.Clock.UTC,
+    	Data.Time.Clock.CTimeval,
+    	Data.Time.Clock.UTCDiff,
+    	Data.Time.LocalTime.TimeZone,
+    	Data.Time.LocalTime.TimeOfDay,
+    	Data.Time.LocalTime.LocalTime,
+    	Data.Time.Format.Parse
+    Extra-Source-Files:
+    	aclocal.m4 configure.ac configure
+    	include/HsTime.h include/HsTimeConfig.h.in
+    Extra-Tmp-Files:
+    	config.log config.status autom4te.cache
+    	include/HsTimeConfig.h
+    Include-Dirs:	include
+    Install-Includes:
+    	HsTime.h HsTimeConfig.h
+}
+



More information about the ghc-commits mailing list