From e45b366ca8b9caa4fe0087e5c4fb1720472d9c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 18 Oct 2026 10:13:30 +0200 Subject: Refactor code to support multiple crypto backends --- erebos.cabal | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'erebos.cabal') 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, -- cgit v1.2.3