packages feed

hercules-ci-cnix-store-0.2.1.0: hercules-ci-cnix-store.cabal

cabal-version: 2.4

name:           hercules-ci-cnix-store
version:        0.2.1.0
synopsis:       Haskell bindings for Nix's libstore
category:       Nix
homepage:       https://docs.hercules-ci.com
bug-reports:    https://github.com/hercules-ci/hercules-ci-agent/issues
author:         Hercules CI contributors
maintainer:     info@hercules-ci.com
copyright:      2018-2020 Hercules CI
license:        Apache-2.0
build-type:     Simple
extra-source-files:
    CHANGELOG.md
    test/data/*.drv
    compat-2.3/include/*.hh
    compat-2.3/include/nix/*.hh
    compat-2.4/include/*.hh

source-repository head
  type: git
  location: https://github.com/hercules-ci/hercules-ci-agent

flag nix-2_4
  description: Build for Nix >=2.4pre*
  default: False

-- match the C++ language standard Nix is using
common cxx-opts
  cxx-options:
    -std=c++17
    -Wall
  extra-libraries: stdc++

  if os(darwin)
    -- avoid https://gitlab.haskell.org/ghc/ghc/issues/11829
    ld-options:  -Wl,-keep_dwarf_unwind

  if impl(ghc >= 8.10)
    ghc-options:
      -optcxx-std=c++17
      -optcxx-Wall
  else
    ghc-options:
      -optc-std=c++17
      -optc-Wall
    if os(darwin)
      ghc-options: -pgmc=clang++

library
  import: cxx-opts
  exposed-modules:
      Hercules.CNix
      Hercules.CNix.Encapsulation
      Hercules.CNix.Settings
      Hercules.CNix.Std.Set
      Hercules.CNix.Std.String
      Hercules.CNix.Std.String.Context
      Hercules.CNix.Std.String.Instances
      Hercules.CNix.Std.Vector
      Hercules.CNix.Store
      Hercules.CNix.Store.Context
      Hercules.CNix.Store.Instances
      Hercules.CNix.Util
  include-dirs:
      include
  if flag(nix-2_4)
    include-dirs:
        compat-2.4/include
    cpp-options:
        -DNIX_2_4
    pkgconfig-depends:
        nix-store >= 2.4
      , nix-main >= 2.4
  else
    include-dirs:
        compat-2.3/include
    pkgconfig-depends:
        nix-store >= 2.0 && <2.4
      , nix-main >= 2.0 && <2.4
    cxx-sources:
        compat-2.3/derivation-output.cxx
        compat-2.3/path.cxx
    install-includes:
        nix/path-info.hh
        nix/path.hh
        nix/path-compat.hh
        nix/derivation-output.hh
        nix/content-address.hh

  install-includes:
      hercules-ci-cnix/store.hxx
      nix-compat.hh

  hs-source-dirs: src
  build-depends:
      base >= 4.7 && <5
    , inline-c
    , inline-c-cpp
    , bytestring
    , conduit
    , containers
    , protolude
    , template-haskell
    , unix
    , unliftio-core
    , vector
  extra-libraries:
      boost_context
  default-language: Haskell2010
  default-extensions: DeriveGeneric DeriveTraversable DisambiguateRecordFields FlexibleContexts InstanceSigs LambdaCase MultiParamTypeClasses NoImplicitPrelude OverloadedStrings RankNTypes TupleSections TypeApplications TypeOperators
  ghc-options:
    -Werror=incomplete-patterns -Werror=missing-fields
    -Wall
    -fwarn-tabs
    -fwarn-unused-imports
    -fwarn-missing-signatures
    -fwarn-name-shadowing
    -fwarn-incomplete-patterns

test-suite test
  type: exitcode-stdio-1.0
  main-is: TestMain.hs
  other-modules:
      Spec
      Hercules.CNix.Std.SetSpec
      Hercules.CNix.Store.DerivationSpec
      Hercules.CNix.Store.TestUtil
  hs-source-dirs:
      test
  default-extensions: DeriveGeneric DeriveTraversable DisambiguateRecordFields FlexibleContexts InstanceSigs LambdaCase MultiParamTypeClasses NoImplicitPrelude OverloadedStrings RankNTypes TupleSections TypeApplications TypeOperators
  ghc-options: -Werror=incomplete-patterns -Werror=missing-fields -Wall -fwarn-tabs -fwarn-unused-imports -fwarn-missing-signatures -fwarn-name-shadowing -fwarn-incomplete-patterns -threaded -rtsopts -with-rtsopts=-N
  build-depends:
    , base
    , bytestring
    , containers
    , exceptions
    , hercules-ci-cnix-store
    , hspec
    , inline-c
    , inline-c-cpp
    , protolude
    , temporary
    , text
  build-tool-depends:
      hspec-discover:hspec-discover
  default-language: Haskell2010