packages feed

libconfig-0.2.0.0: libconfig.cabal

name:                libconfig
version:             0.2.0.0
synopsis:            Haskell bindings to libconfig
description:
            Low-level FFI bindings to the <http://www.hyperrealm.com/libconfig/ libconfig>
            configuration file library.
            .
            This binding is very low-level at the moment, but higher-level safe
            interfaces are planned.
            .
            This library only binds to version 1.4.9 of the libconfig
            library, which is known as @libconfig9@ in Debian-like
            distributions, including Ubuntu.  It will not work with
            older versions of libconfig, including the @libconfig8@
            distributed in Ubuntu 12.04.

license:             BSD3
license-file:        LICENSE
author:              Matthew Peddie
maintainer:          mpeddie@gmail.com
copyright:           2015 Matthew Peddie <mpeddie@gmail.com>
category:            Language
build-type:          Simple
cabal-version:       >=1.10

source-repository head
  type:           git
  location:       git@github.com/peddie/libconfig-haskell

flag prisms
     description:     Build prisms along with lenses (adds a dependency on @profunctors@).
                      .
                      If tests are enabled, this also adds a
                      dependency on @lens@ for the test suite.
                      .
                      If this flag is disabled, no lens tests will be
                      run.  This is suboptimal but simpler than adding
                      another cabal flag.
     default:         True

flag binary
     description:     Provide instances for Data.Binary.Binary from
                      the @binary@ package.  This is done by Generics
                      and will not work on GHCs older than 7.8,
                      because they are pinned to binary version 0.5 or
                      older.
     default:         True

flag cereal
     description:     Provide instances for Data.Serialize.Serialize
                      from the @cereal@ package
     default:         True

library
  exposed-modules:     Language.Libconfig
                     , Language.Libconfig.Bindings
                     , Language.Libconfig.Types
                     , Language.Libconfig.Decode
                     , Language.Libconfig.Encode
                     , Language.Libconfig.Optics

  extra-libraries:     config
  if flag(prisms) && flag(binary) && flag(cereal)
    build-depends:       base >=4.6 && <4.9
                       , text >= 1.1 && < 1.3
                       , hashable >= 1.2 && < 1.3
                       , deepseq >= 1.3
                       , transformers >= 0.3
                       , profunctors >= 4 && < 5
                       , binary >= 0.5 && < 0.8
                       , text-binary >= 0.1
                       , cereal >= 0.4 && < 0.5
                       , cereal-text >= 0.1
    cpp-options:  -DDEFINE_PRISMS -DBINARY_INSTANCES -DCEREAL_INSTANCES
  else
    if flag(prisms) && flag(binary)
      build-depends:       base >=4.6 && <4.9
                         , text >= 1.1 && < 1.3
                         , hashable >= 1.2 && < 1.3
                         , deepseq >= 1.3
                         , transformers >= 0.3
                         , profunctors >= 4 && < 5
                         , binary >= 0.5 && < 0.8
                         , text-binary >= 0.1
      cpp-options:  -DDEFINE_PRISMS -DBINARY_INSTANCES
    else
      if flag(prisms) && flag(cereal)
        build-depends:       base >=4.6 && <4.9
                           , text >= 1.1 && < 1.3
                           , hashable >= 1.2 && < 1.3
                           , deepseq >= 1.3
                           , transformers >= 0.3
                           , profunctors >= 4 && < 5
                           , cereal >= 0.4 && < 0.5
                           , cereal-text >= 0.1
        cpp-options:  -DDEFINE_PRISMS -DCEREAL_INSTANCES
      else
        if flag(binary) && flag(cereal)
          build-depends:       base >=4.6 && <4.9
                             , text >= 1.1 && < 1.3
                             , hashable >= 1.2 && < 1.3
                             , deepseq >= 1.3
                             , transformers >= 0.3
                             , binary >= 0.5 && < 0.8
                             , text-binary >= 0.1
                             , cereal >= 0.4 && < 0.5
                             , cereal-text >= 0.1
          cpp-options:  -DBINARY_INSTANCES -DCEREAL_INSTANCES
        else
          if flag(prisms)
            build-depends:       base >=4.6 && <4.9
                               , text >= 1.1 && < 1.3
                               , hashable >= 1.2 && < 1.3
                               , deepseq >= 1.3
                               , transformers >= 0.3
                               , profunctors >= 4 && < 5
            cpp-options:  -DDEFINE_PRISMS
          else
            if flag(binary)
              build-depends:       base >=4.6 && <4.9
                                 , text >= 1.1 && < 1.3
                                 , hashable >= 1.2 && < 1.3
                                 , deepseq >= 1.3
                                 , transformers >= 0.3
                                 , binary >= 0.5 && < 0.8
                                 , text-binary >= 0.1
              cpp-options:  -DBINARY_INSTANCES
            else
              if flag(cereal)
                build-depends:       base >=4.6 && <4.9
                                   , text >= 1.1 && < 1.3
                                   , hashable >= 1.2 && < 1.3
                                   , deepseq >= 1.3
                                   , transformers >= 0.3
                                   , cereal >= 0.4 && < 0.5
                                   , cereal-text >= 0.1
                cpp-options:  -DCEREAL_INSTANCES
              else
                build-depends:       base >=4.6 && <4.9
                                   , text >= 1.1 && < 1.3
                                   , hashable >= 1.2 && < 1.3
                                   , deepseq >= 1.3
                                   , transformers >= 0.3


  hs-source-dirs:      src
  build-tools:         c2hs
  default-language:    Haskell2010

test-suite doctest
  type: exitcode-stdio-1.0
  default-language: Haskell2010
  hs-source-dirs: test
  ghc-options: -threaded -Wall -O2
  main-is: doctest.hs
  if flag(prisms)
    cpp-options: -DDEFINE_PRISMS
    build-depends: base
                 , libconfig
                 , doctest >= 0.9.9
                 , doctest-prop >= 0.2
                 , lens >= 4.7
  else
    build-depends: base
                 , libconfig
                 , doctest >= 0.9.9
                 , doctest-prop >= 0.2