cabal-version:       2.4

name:                base64
version:             0.1.0.0
synopsis:            RFC 4648-compliant padded and unpadded base64 and base64url encodings
description:
  RFC 4648-compliant padded and unpadded base64 and base64url encoding and decoding.
homepage:            https://github.com/emilypi/base64
bug-reports:         https://github.com/emilypi/base64/issues
license:             BSD-3-Clause
license-file:        LICENSE
author:              Emily Pillmore
maintainer:          emilypi@cohomolo.gy
copyright:           (c) 2019 Emily Pillmore
category:            Data
build-type:          Simple
extra-source-files:
  CHANGELOG.md
  README.md

tested-with:         GHC ==8.8.1 || ==8.6.5 || ==8.6.3 || ==8.4.4 || ==8.4.3 || ==8.2.2

source-repository head
  type:     git
  location: https://github.com/emilypi/base64.git


flag optics
  description: Enable optics for base64-encoding text and bytestrings
  manual: True
  default: True

flag perf-flags
  description: Performance tuning flags and information
  manual: True
  default: False


library
  exposed-modules:     Data.ByteString.Base64
                     , Data.ByteString.Base64.URL

                     , Data.Text.Encoding.Base64
                     , Data.Text.Encoding.Base64.URL

  other-modules:       Data.ByteString.Base64.Internal

  build-depends:       base       >=4.10 && <5
                     , bytestring
                     , deepseq
                     , text

  hs-source-dirs:      src
  default-language:    Haskell2010
  ghc-options:         -Wall

  if flag(optics)
    exposed-modules:   Data.ByteString.Base64.Lens
                     , Data.Text.Encoding.Base64.Lens
    build-depends:     lens ^>= 4.18

  if flag(perf-flags)
    ghc-options:       -ddump-simpl
                       -ddump-to-file
                       -ddump-stranal


test-suite tasty
  default-language:    Haskell2010
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  main-is:             Base64Tests.hs
  build-depends:       base >=4.10 && <5
                     , base64
                     , base64-bytestring
                     , random-bytestring
                     , tasty
                     , tasty-hunit
                     , text

  ghc-options:       -Wall -threaded -with-rtsopts=-N

benchmark bench
  default-language:    Haskell2010
  type:                exitcode-stdio-1.0
  hs-source-dirs:      benchmarks
  main-is:             Base64Bench.hs
  build-depends:       base >=4.10 && <5
                     , base64
                     , base64-bytestring
                     , bytestring
                     , deepseq
                     , criterion
                     , memory
                     , random-bytestring
                     , text

  ghc-options:
    -Wall
    -threaded
    -rtsopts
    -with-rtsopts=-N