packages feed

erebos-0.2.2: erebos.cabal

Cabal-Version:       3.0

Name:                erebos
Version:             0.2.2
Synopsis:            Decentralized messaging and synchronization
Description:
    Library and simple CLI interface implementing the Erebos identity
    management, decentralized messaging and synchronization protocol, along
    with local storage.

    Erebos identity is based on locally stored cryptographic keys, all
    communication is end-to-end encrypted. Multiple devices can be attached to
    the same identity, after which they function interchangeably, without any
    one being in any way "primary"; messages and other state data are then
    synchronized automatically whenever the devices are able to connect with
    one another.

    See README for usage of the CLI tool.
License:             BSD-3-Clause
License-File:        LICENSE
Homepage:            https://erebosprotocol.net/erebos
Author:              Roman Smrž <roman.smrz@seznam.cz>
Maintainer:          roman.smrz@seznam.cz
Category:            Network
Stability:           experimental
Build-type:          Simple
Extra-Doc-Files:
    README.md
    CHANGELOG.md
Extra-Source-Files:
    src/Erebos/ICE/pjproject.h
    src/Erebos/Network/ifaddrs.h

Flag ice
    Description:    Enable peer discovery with ICE support using pjproject

Flag cryptonite
    description:    Use deprecated 'cryptonite' package
    default: False

source-repository head
    type:       git
    location:   https://code.erebosprotocol.net/erebos

common common
    ghc-options:
        -Wall
        -Wno-x-partial
        -fdefer-typed-holes

    build-depends:
        base ^>= { 4.15, 4.16, 4.17, 4.18, 4.19, 4.20, 4.21 },

    default-extensions:
        DefaultSignatures
        ExistentialQuantification
        FlexibleContexts
        FlexibleInstances
        FunctionalDependencies
        GeneralizedNewtypeDeriving
        ImportQualifiedPost
        LambdaCase
        MultiWayIf
        RankNTypes
        RecordWildCards
        ScopedTypeVariables
        StandaloneDeriving
        TypeOperators
        TupleSections
        TypeApplications
        TypeFamilies
        TypeFamilyDependencies

    other-extensions:
        CPP
        ForeignFunctionInterface
        OverloadedStrings
        RecursiveDo
        TemplateHaskell
        UndecidableInstances

    if flag(ice)
        cpp-options: -DENABLE_ICE_SUPPORT

library
    import: common
    default-language:    Haskell2010

    hs-source-dirs:      src
    exposed-modules:
        Erebos.Attach
        Erebos.Chatroom
        Erebos.Contact
        Erebos.Conversation
        Erebos.DirectMessage
        Erebos.Discovery
        Erebos.Error
        Erebos.Identity
        Erebos.Invite
        Erebos.Network
        Erebos.Object
        Erebos.Object.Deferred
        Erebos.Pairing
        Erebos.PubKey
        Erebos.Service
        Erebos.Service.Stream
        Erebos.Set
        Erebos.State
        Erebos.Storable
        Erebos.Storage
        Erebos.Storage.Backend
        Erebos.Storage.Graph
        Erebos.Storage.Head
        Erebos.Storage.Key
        Erebos.Storage.Merge
        Erebos.Sync
        Erebos.TextFormat
        Erebos.TextFormat.Ansi

    other-modules:
        Erebos.Conversation.Class
        Erebos.Flow
        Erebos.Network.Address
        Erebos.Network.Channel
        Erebos.Network.Protocol
        Erebos.Object.Internal
        Erebos.Storable.Internal
        Erebos.Storage.Disk
        Erebos.Storage.Internal
        Erebos.Storage.Memory
        Erebos.Storage.Platform
        Erebos.TextFormat.Types
        Erebos.UUID
        Erebos.Util

    c-sources:
        src/Erebos/Network/ifaddrs.c
    include-dirs:
        src
    includes:
        src/Erebos/Network/ifaddrs.h

    if flag(ice)
        other-modules:
            Erebos.ICE
        c-sources:
            src/Erebos/ICE/pjproject.c
        include-dirs:
            src/Erebos/ICE
        includes:
            src/Erebos/ICE/pjproject.h
        build-tool-depends:  c2hs:c2hs
        pkgconfig-depends:   libpjproject >= 2.9

    build-depends:
        async >=2.2 && <2.3,
        binary >=0.8 && <0.11,
        bytestring >=0.10 && <0.13,
        clock >=0.8 && < 0.9,
        containers ^>= { 0.6, 0.7, 0.8 },
        deepseq >= 1.4 && <1.6,
        directory >= 1.3 && <1.4,
        filepath >=1.4 && <1.6,
        fsnotify ^>= { 0.3, 0.4 },
        hashable ^>= { 1.3, 1.4, 1.5 },
        hashtables ^>= { 1.2, 1.3, 1.4 },
        iproute >=1.7.12 && <1.8,
        memory >=0.14 && <0.19,
        mtl ^>= { 2.2.2, 2.3 },
        network ^>= { 3.1, 3.2 },
        stm >=2.5 && <2.6,
        text >= 1.2 && <2.2,
        time ^>= { 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16 },
        uuid-types ^>= { 1.0.4 },
        zlib >=0.6 && <0.8

    if !flag(cryptonite)
        build-depends:
            crypton ^>= { 0.34, 1.0 },
    else
        build-depends:
            cryptonite >=0.25 && <0.31,

    if os(windows)
        hs-source-dirs: src/windows
        build-depends:
            Win32 ^>= { 2.14 },
    else
        hs-source-dirs: src/unix
        build-depends:
            unix ^>= { 2.7, 2.8 },

executable erebos
    import: common
    default-language:    Haskell2010
    hs-source-dirs:      main
    ghc-options:         -threaded

    main-is:             Main.hs
    other-modules:
        Paths_erebos
        State
        Terminal
        Test
        Test.Service
        Version
        Version.Git
        WebSocket
    autogen-modules:
        Paths_erebos

    build-depends:
        ansi-terminal ^>= { 0.11, 1.0, 1.1 },
        bytestring,
        directory,
        erebos,
        mtl,
        network,
        process >=1.6 && <1.7,
        stm,
        template-haskell ^>= { 2.17, 2.18, 2.19, 2.20, 2.21, 2.22, 2.23 },
        text,
        time,
        transformers >= 0.5 && <0.7,
        uuid-types,
        websockets ^>= { 0.12.7, 0.13 },

    if !flag(cryptonite)
        build-depends:
            crypton,
    else
        build-depends:
            cryptonite,