cabal-version:       >=1.12

name:                unix-recursive
version:             0.1.0.1
synopsis:            Fast and flexible primitives for recursive file system IO on Posix systems
description:
    Blazingly fast functions for recursive file system operations.
    Utilizing lazy IO for constant space & computation efficiant bindigns to Posix dirstream api.

bug-reports:         https://github.com/turboMaCk/unix-recursive/issues
license:             BSD3
license-file:        LICENSE
author:              Marek Fajkus <marek.faj@gmail.com>
maintainer:          Marek Fajkus <marek.faj@gmail.com>
copyright:           2021 Marek Fajkus
stability:           experimental
category:            System, Filesystem
build-type:          Simple
extra-source-files:  README.md
                   , ChangeLog.md
                   , docs/*.png
homepage:            https://github.com/turboMaCk/unix-recursive

source-repository head
  type: git
  location: https://github.com/turboMaCk/unix-recursive

Flag bin
  default: False
  manual: True

library
    exposed-modules:      System.Posix.Recursive
                        , System.Posix.Recursive.Unsafe
                        , System.Posix.Recursive.ByteString
                        , System.Posix.Recursive.ByteString.Unsafe
    other-modules:        Paths_unix_recursive
    hs-source-dirs:       .
    build-depends:        base >=4.7 && <5
                        , unix
                        , bytestring
    default-language:     Haskell2010
    default-extensions:   OverloadedStrings
                        , RecordWildCards
                        , ScopedTypeVariables

executable dir-traverse-bin
    main-is:            dir-traverse.hs
    hs-source-dirs:     bin
    ghc-options:        -threaded -rtsopts -with-rtsopts=-N -Wall
    build-depends:      base >=4.7 && <5
                      , dir-traverse == 0.2.3.0
    default-language:   Haskell2010
    if !flag(bin)
        buildable: False

executable dirstream-bin
    main-is:            dirstream.hs
    hs-source-dirs:     bin
    ghc-options:        -threaded -rtsopts -with-rtsopts=-N -Wall
    build-depends:      base >=4.7 && <5
                      , dirstream
                      , pipes
                      , pipes-safe
                      , system-filepath
                      , directory
    default-language:   Haskell2010
    if !flag(bin)
        buildable: False

executable unix-recursive-string-bin
    main-is:            unix-recursive-string.hs
    other-modules:      Paths_unix_recursive
    hs-source-dirs:     bin
    ghc-options:        -threaded -rtsopts -with-rtsopts=-N -Wall
    build-depends:      base >=4.7 && <5
                      , unix-recursive
                      , unix
    default-language:   Haskell2010
    if !flag(bin)
        buildable: False

executable unix-recursive-bytestring-bin
    main-is:            unix-recursive-bytestring.hs
    other-modules:      Paths_unix_recursive
    hs-source-dirs:     bin
    ghc-options:        -threaded -rtsopts -with-rtsopts=-N -Wall
    build-depends:      base >=4.7 && <5
                      , unix-recursive
                      , unix
                      , utf8-string
    default-language:   Haskell2010
    if !flag(bin)
        buildable: False

benchmark unix-recursive-bench
    type:               exitcode-stdio-1.0
    main-is:            Bench.hs
    hs-source-dirs:     bench
    default-language:   Haskell2010
    ghc-options:        -Wall
    build-depends:      base >=4.7 && <5
                      , unix-recursive
                      , criterion
                      , dir-traverse == 0.2.3.0

test-suite unix-recursive-test
    type:               exitcode-stdio-1.0
    main-is:            Spec.hs
    other-modules:      Paths_unix_recursive
                      , Spec.Listing
    hs-source-dirs:     test
    ghc-options:        -threaded -rtsopts -with-rtsopts=-N -Wall
    build-depends:      base >=4.7 && <5
                      , unix-recursive
                      , hspec
                      , bytestring
                      , unix
    default-language:   Haskell2010