[commit: packages/time] master: clean up .cabal; first attempt at Windows compilability (1e426ff)

git at git.haskell.org git at git.haskell.org
Sun Dec 20 07:52:26 UTC 2015


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

On branch  : master
Link       : http://git.haskell.org/packages/time.git/commitdiff/1e426fff781e9bee333e4c1d0ffe28ebbe9360b4

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

commit 1e426fff781e9bee333e4c1d0ffe28ebbe9360b4
Author: Ashley Yakeley <ashley at semantic.org>
Date:   Thu Apr 16 23:36:49 2009 -0700

    clean up .cabal; first attempt at Windows compilability
    
    darcs-hash:20090417063649-ac6dd-223499b4d550028c3f5cc97094745c4eb72ca60e


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

1e426fff781e9bee333e4c1d0ffe28ebbe9360b4
 Setup.hs         |  6 +++--
 include/HsTime.h |  4 ++++
 time.cabal       | 69 +++++++++++++++++++++++++++++++-------------------------
 3 files changed, 46 insertions(+), 33 deletions(-)

diff --git a/Setup.hs b/Setup.hs
index 2211a91..ac50db8 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -7,10 +7,12 @@ import Distribution.Simple.LocalBuildInfo
 import Distribution.Simple.Utils
 import System.Cmd
 import System.Directory
+import System.Info
 
 main :: IO ()
-main = do let hooks = autoconfUserHooks { runTests = runTestScript }
-          defaultMainWithHooks hooks
+main = if os == "windows"
+ then defaultMain
+ else let hooks = autoconfUserHooks { runTests = runTestScript } in defaultMainWithHooks hooks
 
 withCurrentDirectory :: FilePath -> IO a -> IO a
 withCurrentDirectory path f = do
diff --git a/include/HsTime.h b/include/HsTime.h
index c02cc53..12d45bd 100644
--- a/include/HsTime.h
+++ b/include/HsTime.h
@@ -1,6 +1,9 @@
 #ifndef __HSTIME_H__
 #define __HSTIME_H__
 
+#if defined(_MSC_VER) || defined(__MINGW32__) || defined(_WIN32)
+#else
+
 #include "HsTimeConfig.h"
 // Otherwise these clash with similar definitions from other packages:
 #undef PACKAGE_BUGREPORT
@@ -12,6 +15,7 @@
 #if HAVE_TIME_H
 #include <time.h>
 #endif
+#endif
 
 long int get_current_timezone_seconds (time_t,int* pdst,char const* * pname);
 
diff --git a/time.cabal b/time.cabal
index 84b17b5..2850397 100644
--- a/time.cabal
+++ b/time.cabal
@@ -1,36 +1,42 @@
-Name:		time
-Version:	1.1.2.3
-Stability:	stable
-License:	BSD3
-License-File:	LICENSE
-Author:		Ashley Yakeley
-Maintainer:	<ashley at semantic.org>
-Homepage:	http://semantic.org/TimeLib/
-Synopsis:	 A time library
-Description: A time library
-Category:   System
-Build-Type:     Custom
-Cabal-Version:  >=1.2
+name:           time
+version:        1.1.2.4
+stability:      stable
+license:        BSD3
+license-file:   LICENSE
+author:         Ashley Yakeley
+maintainer:     <ashley at semantic.org>
+homepage:       http://semantic.org/TimeLib/
+synopsis:       A time library
+description:    A time library
+category:       System
+build-type:  Custom
+cabal-version:   >=1.2
 x-follows-version-policy:
 
-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
+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
 
-Flag split-base
+flag split-base
 
-Library {
-    Build-Depends: base >= 2
+library
+{
+    build-depends:    base >= 2
     if flag(split-base)
-       Build-Depends: base >= 3, old-locale
+        Build-Depends: base >= 3, old-locale
     else
-       Build-Depends: base < 3
+        Build-Depends: base < 3
     if os(windows)
         Build-Depends: Win32
-    Exposed-Modules:
+    exposed-modules:
         Data.Time.Calendar,
         Data.Time.Calendar.MonthDay,
         Data.Time.Calendar.OrdinalDate,
@@ -43,9 +49,9 @@ Library {
         Data.Time.LocalTime,
         Data.Time.Format,
         Data.Time
-    Extensions:	ForeignFunctionInterface, CPP
-    C-Sources:	cbits/HsTime.c
-    Other-Modules:
+    extensions:    ForeignFunctionInterface, CPP
+    c-sources:    cbits/HsTime.c
+    other-modules:
         Data.Time.Calendar.Private,
         Data.Time.Calendar.Days,
         Data.Time.Calendar.Gregorian,
@@ -58,8 +64,9 @@ Library {
         Data.Time.LocalTime.TimeOfDay,
         Data.Time.LocalTime.LocalTime,
         Data.Time.Format.Parse
-    Include-Dirs:	include
-    Install-Includes:
-        HsTime.h HsTimeConfig.h
+    include-dirs:    include
+    install-includes:
+        HsTime.h
+        HsTimeConfig.h
 }
 



More information about the ghc-commits mailing list