summaryrefslogtreecommitdiff
path: root/erebos.cabal
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-10-18 10:13:30 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2026-10-23 23:26:21 +0200
commite45b366ca8b9caa4fe0087e5c4fb1720472d9c23 (patch)
tree284f7cca2d3d58482ea459bd3b80c585a0fa7c72 /erebos.cabal
parent552cb773ce9d8472530e123e926493b3dd1e658f (diff)
Refactor code to support multiple crypto backendsHEADmaster
Diffstat (limited to 'erebos.cabal')
-rw-r--r--erebos.cabal28
1 files changed, 21 insertions, 7 deletions
diff --git a/erebos.cabal b/erebos.cabal
index e9b8488..ba2b5d2 100644
--- a/erebos.cabal
+++ b/erebos.cabal
@@ -31,11 +31,15 @@ Extra-Source-Files:
src/Erebos/ICE/pjproject.h
src/Erebos/Network/ifaddrs.h
-Flag ice
+flag ice
Description: Enable peer discovery with ICE support using pjproject
-Flag cryptonite
- description: Use deprecated 'cryptonite' package
+flag crypton
+ description: Use 'crypton' package as crypto backend
+ default: True
+
+flag cryptonite
+ description: Use deprecated 'cryptonite' package as crypto backed
default: False
source-repository head
@@ -119,6 +123,7 @@ library
Erebos.TextFormat.Ansi
other-modules:
+ Crypto
Erebos.Conversation.Class
Erebos.Flow
Erebos.Network.Address
@@ -177,12 +182,20 @@ library
uuid-types ^>= { 1.0.4 },
zlib >=0.6 && <0.8
- if !flag(cryptonite)
+ if flag(crypton)
build-depends:
crypton ^>= { 0.34, 1.0 },
- else
+ hs-source-dirs:
+ src/crypto/crypton
+
+ elif flag(cryptonite)
build-depends:
cryptonite >=0.25 && <0.31,
+ hs-source-dirs:
+ src/crypto/crypton
+
+ else
+ build-depends: base < 0
if os(windows)
hs-source-dirs: src/windows
@@ -229,9 +242,10 @@ executable erebos
uuid-types,
websockets ^>= { 0.12.7, 0.13 },
- if !flag(cryptonite)
+ if flag(crypton)
build-depends:
crypton,
- else
+
+ elif flag(cryptonite)
build-depends:
cryptonite,