Skip to content
Snippets Groups Projects
Commit 3bf3d4c9 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel :man_dancing:
Browse files

Refactor .cabal to use sub-lib for vendored lib

A practical benefit is that we can control the build-depends and also
avoid some recompilation between library and test-suite.
parent 49f6fad5
No related branches found
No related tags found
5 merge requests!38Make --no-tmp-comp-dir the default,!37Adapt to latest xhtml version, various optimizations,!31Support HsToken in DataDecl and ClassDecl,!12Drop orphan instance when defined upstream.,!10Haddock interfaces produced from `.hi` files
...@@ -24,9 +24,11 @@ library ...@@ -24,9 +24,11 @@ library
base >= 4.5 && < 4.11 base >= 4.5 && < 4.11
, bytestring >= 0.9.2.1 && < 0.11 , bytestring >= 0.9.2.1 && < 0.11
, transformers >= 0.3.0 && < 0.6 , transformers >= 0.3.0 && < 0.6
, deepseq >= 1.3 && < 1.5
hs-source-dirs: src, vendor/attoparsec-0.13.1.0 -- internal sub-lib
build-depends: attoparsec
hs-source-dirs: src
ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2 ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2
exposed-modules: exposed-modules:
...@@ -37,10 +39,31 @@ library ...@@ -37,10 +39,31 @@ library
Documentation.Haddock.Utf8 Documentation.Haddock.Utf8
other-modules: other-modules:
Data.Attoparsec Documentation.Haddock.Parser.Util
ghc-options: -Wall
if impl(ghc >= 8.0)
ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances
library attoparsec
default-language: Haskell2010
build-depends:
base >= 4.5 && < 4.11
, bytestring >= 0.9.2.1 && < 0.11
, deepseq >= 1.3 && < 1.5
hs-source-dirs: vendor/attoparsec-0.13.1.0
-- NB: haddock-library needs only small part of lib:attoparsec
-- internally, so we only bundle that subset here
exposed-modules:
Data.Attoparsec.ByteString Data.Attoparsec.ByteString
Data.Attoparsec.ByteString.Buffer
Data.Attoparsec.ByteString.Char8 Data.Attoparsec.ByteString.Char8
other-modules:
Data.Attoparsec
Data.Attoparsec.ByteString.Buffer
Data.Attoparsec.ByteString.FastSet Data.Attoparsec.ByteString.FastSet
Data.Attoparsec.ByteString.Internal Data.Attoparsec.ByteString.Internal
Data.Attoparsec.Combinator Data.Attoparsec.Combinator
...@@ -48,7 +71,8 @@ library ...@@ -48,7 +71,8 @@ library
Data.Attoparsec.Internal.Fhthagn Data.Attoparsec.Internal.Fhthagn
Data.Attoparsec.Internal.Types Data.Attoparsec.Internal.Types
Data.Attoparsec.Number Data.Attoparsec.Number
Documentation.Haddock.Parser.Util
ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2
ghc-options: -Wall ghc-options: -Wall
if impl(ghc >= 8.0) if impl(ghc >= 8.0)
...@@ -56,6 +80,7 @@ library ...@@ -56,6 +80,7 @@ library
else else
build-depends: semigroups ^>= 0.18.3, fail ^>= 4.9.0.0 build-depends: semigroups ^>= 0.18.3, fail ^>= 4.9.0.0
test-suite spec test-suite spec
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
default-language: Haskell2010 default-language: Haskell2010
...@@ -63,22 +88,12 @@ test-suite spec ...@@ -63,22 +88,12 @@ test-suite spec
hs-source-dirs: hs-source-dirs:
test test
, src , src
, vendor/attoparsec-0.13.1.0
ghc-options: -Wall ghc-options: -Wall
cpp-options: cpp-options:
-DTEST -DTEST
other-modules: other-modules:
Data.Attoparsec.ByteString
Data.Attoparsec.ByteString.Buffer
Data.Attoparsec.ByteString.Char8
Data.Attoparsec.ByteString.FastSet
Data.Attoparsec.ByteString.Internal
Data.Attoparsec.Combinator
Data.Attoparsec.Internal
Data.Attoparsec.Internal.Fhthagn
Data.Attoparsec.Internal.Types
Documentation.Haddock.Doc Documentation.Haddock.Doc
Documentation.Haddock.Parser Documentation.Haddock.Parser
Documentation.Haddock.Parser.Monad Documentation.Haddock.Parser.Monad
...@@ -89,18 +104,24 @@ test-suite spec ...@@ -89,18 +104,24 @@ test-suite spec
Documentation.Haddock.Utf8 Documentation.Haddock.Utf8
Documentation.Haddock.Utf8Spec Documentation.Haddock.Utf8Spec
build-depends:
base-compat ^>= 0.9.3
, transformers >= 0.3.0 && < 0.6
, hspec ^>= 2.4.4
, QuickCheck ^>= 2.10
-- internal sub-lib
build-depends: attoparsec
-- Versions for the dependencies below are transitively pinned by
-- dependency on haddock-library:lib:attoparsec
build-depends: build-depends:
base base
, bytestring , bytestring
, transformers
, deepseq , deepseq
, base-compat
, hspec
, QuickCheck == 2.*
build-tool-depends: build-tool-depends:
hspec-discover:hspec-discover hspec-discover:hspec-discover ^>= 2.4.4
source-repository head source-repository head
type: git type: git
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment