Modernize and refactor `haskell2010.cabal`
authorHerbert Valerio Riedel <hvr@gnu.org>
Sat, 26 Oct 2013 19:09:04 +0000 (21:09 +0200)
committerHerbert Valerio Riedel <hvr@gnu.org>
Sat, 26 Oct 2013 19:41:15 +0000 (21:41 +0200)
 - Update to `cabal-version>=0.10`
 - add missing `Setup.hs`
 - add `Prelude` category
 - set proper version constraints
 - order module list according to H2010 report TOC
 - update homepage & bug-reports URL

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Setup.hs [new file with mode: 0644]
haskell2010.cabal

diff --git a/Setup.hs b/Setup.hs
new file mode 100644 (file)
index 0000000..9a994af
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
index 8f9dee3..35d10a0 100644 (file)
@@ -1,69 +1,97 @@
-name:          haskell2010
-version:       1.1.1.1
+name:           haskell2010
+version:        1.1.1.1
 -- GHC 7.6.1 released with 1.1.1.0
 -- GHC 7.6.1 released with 1.1.1.0
-license:       BSD3
-license-file:  LICENSE
-maintainer:    libraries@haskell.org
-bug-reports: http://hackage.haskell.org/trac/ghc/newticket?component=libraries/haskell2010
-synopsis:      Compatibility with Haskell 2010
-category:   Haskell2010
-description:
-        This package provides exactly the library modules defined by
-        the Haskell 2010 standard.
-homepage:      http://www.haskell.org/definition/
+license:        BSD3
+license-file:   LICENSE
+maintainer:     libraries@haskell.org
+bug-reports:    http://ghc.haskell.org/trac/ghc/newticket?component=libraries/haskell2010
+synopsis:       Compatibility with Haskell 2010
+category:       Haskell2010, Prelude
+homepage:       http://www.haskell.org/onlinereport/haskell2010/
 build-type:     Simple
 build-type:     Simple
-Cabal-Version: >= 1.6
+Cabal-Version:  >=1.10
+description:
+    This package provides exactly the library modules defined by
+    the <http://www.haskell.org/onlinereport/haskell2010/ Haskell 2010 standard>.
+
+source-repository head
+    type:     git
+    location: http://git.haskell.org/packages/haskell2010.git
+
+source-repository this
+    type:     git
+    location: http://git.haskell.org/packages/haskell2010.git
+    tag:      haskell2010-1.1.1.1-release
 
 Library
 
 Library
-    build-depends:     base >= 4.5 && < 5, array
+    default-language: Haskell2010
+    other-extensions:
+        BangPatterns
+        CPP
+        NoImplicitPrelude
+        Safe
+        Trustworthy
+    if impl(ghc)
+        other-extensions: Safe, Trustworthy
+
+    build-depends:
+        array >= 0.5 && < 0.6,
+        base  >= 4.7 && < 4.8
 
     -- this hack adds a dependency on ghc-prim for Haddock.  The GHC
     -- build system doesn't seem to track transitive dependencies when
     -- running Haddock, and if we don't do this then Haddock can't
     -- find the docs for things defined in ghc-prim.
 
     -- this hack adds a dependency on ghc-prim for Haddock.  The GHC
     -- build system doesn't seem to track transitive dependencies when
     -- running Haddock, and if we don't do this then Haddock can't
     -- find the docs for things defined in ghc-prim.
-    if impl(ghc) {
-       build-depends: ghc-prim
-    }
+    if impl(ghc)
+        build-depends: ghc-prim >= 0.3.1 && < 0.4
+
+    -- haskell2010 is a "hidden" package
+    exposed: False
 
 
+    -- The modules below are listed in the order they occur in the
+    -- "Haskell 2010 Language Report" table of contents.
     exposed-modules:
     exposed-modules:
-        Data.Array,
-        Data.Char,
-        Data.Complex,
-        System.IO,
-        System.IO.Error,
-        Data.Ix,
-        Data.List,
-        Data.Maybe,
-        Control.Monad,
-        Data.Ratio,
-        System.Environment,
-        System.Exit,
-        Numeric,
-        Prelude,
+        -- chapter 9 "Standard Prelude"
+        -- http://www.haskell.org/onlinereport/haskell2010/haskellch9.html
+        Prelude
 
 
-        -- FFI modules
-        Data.Int,
-        Data.Word,
-        Data.Bits,
+        -- Part II "The Haskell 2010 Libraries"
+        -- http://www.haskell.org/onlinereport/haskell2010/haskellpa2.html
+        --
+        -- chapter [13..23]
+        Control.Monad
+        Data.Array
+        Data.Bits
+        Data.Char
+        Data.Complex
+        Data.Int
+        Data.Ix
+        Data.List
+        Data.Maybe
+        Data.Ratio
+        Data.Word
 
 
-        Foreign,
-        Foreign.Ptr,
-        Foreign.ForeignPtr,
-        Foreign.StablePtr,
-        Foreign.Storable,
-        Foreign.C,
-        Foreign.C.Error,
-        Foreign.C.String,
-        Foreign.C.Types,
-        Foreign.Marshal,
-        Foreign.Marshal.Alloc,
-        Foreign.Marshal.Array,
-        Foreign.Marshal.Error,
+        -- FFI modules, chapter [24..37]
+        Foreign
+        Foreign.C
+        Foreign.C.Error
+        Foreign.C.String
+        Foreign.C.Types
+        Foreign.ForeignPtr
+        Foreign.Marshal
+        Foreign.Marshal.Alloc
+        Foreign.Marshal.Array
+        Foreign.Marshal.Error
         Foreign.Marshal.Utils
         Foreign.Marshal.Utils
-    exposed: False
-    extensions: PackageImports, CPP
+        Foreign.Ptr
+        Foreign.StablePtr
+        Foreign.Storable
 
 
-source-repository head
-    type:     git
-    location: http://git.haskell.org/packages/haskell2010.git
+        -- chapter [38..42]
+        Numeric
+        System.Environment
+        System.Exit
+        System.IO
+        System.IO.Error
 
 
+    ghc-options: -Wall