cabal-version:      1.18
name:               regex-rure
version:            1.0.0.0
license:            AGPL-3
license-file:       COPYING
maintainer:         vamchale@gmail.com
author:             Vanessa McHale
synopsis:           Bindings to Rust's regex library
description:
    Bindings to Rust's regex library, including a higher-level API.

category:           Text, Regex
build-type:         Simple
extra-source-files:
    README.md
    cbits/rure.h

extra-doc-files:    CHANGELOG.md

source-repository head
    type:     git
    location: https://github.com/vmchale/rure

flag cross
    description: Enable to ease cross-compiling
    default:     False
    manual:      True

library
    exposed-modules:
        Regex.Rure
        Regex.Rure.FFI

    hs-source-dirs:   src
    default-language: Haskell2010
    extra-libraries:  rure
    include-dirs:     cbits
    install-includes: cbits/rure.h
    ghc-options:      -Wall
    build-depends:
        base >=4.10.0.0 && <5,
        bytestring >=0.11.0.0

    if !flag(cross)
        build-tool-depends: c2hs:c2hs >=0.26.1

    if impl(ghc >=8.0)
        ghc-options:
            -Wincomplete-uni-patterns -Wincomplete-record-updates
            -Wredundant-constraints -Widentities

    if impl(ghc >=8.4)
        ghc-options: -Wmissing-export-lists

    if impl(ghc >=8.2)
        ghc-options: -Wcpp-undef

    if impl(ghc >=8.10)
        ghc-options: -Wunused-packages

test-suite regex-rure-test
    type:             exitcode-stdio-1.0
    main-is:          Spec.hs
    hs-source-dirs:   test
    default-language: Haskell2010
    other-extensions: OverloadedStrings
    ghc-options:      -Wall
    build-depends:
        base,
        tasty,
        tasty-hunit,
        regex-rure,
        bytestring

    if impl(ghc >=8.0)
        ghc-options:
            -Wincomplete-uni-patterns -Wincomplete-record-updates
            -Wredundant-constraints -Widentities

    if impl(ghc >=8.4)
        ghc-options: -Wmissing-export-lists

    if impl(ghc >=8.2)
        ghc-options: -Wcpp-undef

    if impl(ghc >=8.10)
        ghc-options: -Wunused-packages