name: simplex-chat
version: 5.8.1.0
#synopsis:
#description:
homepage: https://github.com/simplex-chat/simplex-chat#readme
license: AGPL-3
author: simplex.chat
maintainer: chat@simplex.chat
copyright: 2020-22 simplex.chat
category: Web, System, Services, Cryptography
extra-source-files:
  - README.md
  - cabal.project

dependencies:
  - aeson == 2.2.*
  - ansi-terminal >= 0.10 && < 0.12
  - async == 2.2.*
  - attoparsec == 0.14.*
  - base >= 4.7 && < 5
  - base64-bytestring >= 1.0 && < 1.3
  - composition == 1.0.*
  - constraints >= 0.12 && < 0.14
  - containers == 0.6.*
  - crypton == 0.34.*
  - data-default >= 0.7 && < 0.8
  - directory == 1.3.*
  - direct-sqlcipher == 2.3.*
  - email-validate == 2.3.*
  - exceptions == 0.10.*
  - filepath == 1.4.*
  - http-types == 0.12.*
  - http2 >= 4.2.2 && < 4.3
  - memory == 0.18.*
  - mtl >= 2.3.1 && < 3.0
  - network >= 3.1.2.7 && < 3.2
  - network-transport == 0.5.6
  - optparse-applicative >= 0.15 && < 0.17
  - random >= 1.1 && < 1.3
  - record-hasfield == 1.0.*
  - simple-logger == 0.1.*
  - simplexmq >= 5.0
  - socks == 0.6.*
  - sqlcipher-simple == 0.4.*
  - stm == 2.5.*
  - terminal == 0.2.*
  - time == 1.12.*
  - tls >= 1.7.0 && < 1.8
  - unliftio == 0.2.*
  - unliftio-core == 0.2.*
  - zip == 2.0.*

flags:
  swift:
    description: Enable swift JSON format
    manual: True
    default: False

when:
  - condition: flag(swift)
    cpp-options:
      - -DswiftJSON
  - condition: impl(ghc >= 9.6.2)
    dependencies:
      - bytestring == 0.11.*
      - process == 1.6.*
      - template-haskell == 2.20.*
      - text >= 2.0.1 && < 2.2
  - condition: impl(ghc < 9.6.2)
    dependencies:
      - bytestring == 0.10.*
      - process >= 1.6 && < 1.6.18
      - template-haskell == 2.16.*
      - text >= 1.2.3.0 && < 1.3

library:
  source-dirs: src

executables:
  simplex-chat:
    source-dirs: apps/simplex-chat
    main: Main.hs
    dependencies:
      - simplex-chat
      - network == 3.1.*
      - websockets == 0.12.*
    ghc-options:
      - -threaded

  simplex-bot:
    source-dirs: apps/simplex-bot
    main: Main.hs
    dependencies:
      - simplex-chat
    ghc-options:
      - -threaded

  simplex-bot-advanced:
    source-dirs: apps/simplex-bot-advanced
    main: Main.hs
    dependencies:
      - simplex-chat
    ghc-options:
      - -threaded

  simplex-broadcast-bot:
    source-dirs:
      - apps/simplex-broadcast-bot
      - apps/simplex-broadcast-bot/src
    main: Main.hs
    dependencies:
      - simplex-chat
    ghc-options:
      - -threaded

  simplex-directory-service:
    source-dirs:
      - apps/simplex-directory-service
      - apps/simplex-directory-service/src
    main: Main.hs
    dependencies:
      - simplex-chat
    ghc-options:
      - -threaded

tests:
  simplex-chat-test:
    source-dirs:
      - tests
      - apps/simplex-broadcast-bot/src
      - apps/simplex-directory-service/src
    main: Test.hs
    when:
      - condition: impl(ghc >= 9.6.2)
        dependencies:
          - hspec == 2.11.*
      - condition: impl(ghc < 9.6.2)
        dependencies:
          - hspec == 2.7.*
    dependencies:
      - QuickCheck == 2.14.*
      - simplex-chat
      - async == 2.2.*
      - deepseq == 1.4.*
      - generic-random == 1.5.*
      - network == 3.1.*
      - silently == 1.2.*
      - stm == 2.5.*
    ghc-options:
      - -threaded

ghc-options:
  # - -haddock
  - -O2
  - -Weverything
  - -Wno-missing-exported-signatures
  - -Wno-missing-import-lists
  - -Wno-missed-specialisations
  - -Wno-all-missed-specialisations
  - -Wno-unsafe
  - -Wno-safe
  - -Wno-missing-local-signatures
  - -Wno-missing-kind-signatures
  - -Wno-missing-deriving-strategies
  - -Wno-monomorphism-restriction
  - -Wno-prepositive-qualified-module
  - -Wno-unused-packages
  - -Wno-implicit-prelude
  - -Wno-missing-safe-haskell-mode
  - -Wno-missing-export-lists
  - -Wno-partial-fields
  - -Wcompat
  - -Werror=incomplete-record-updates
  - -Werror=incomplete-patterns
  - -Werror=missing-methods
  - -Werror=incomplete-uni-patterns
  - -Werror=tabs
  - -Wredundant-constraints
  - -Wincomplete-record-updates
  - -Wunused-type-patterns

default-extensions:
  - StrictData
