From 587e4ebdcfc4d8d8b1b9e6e84a4d2d5d785fd9f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 11 Nov 2026 21:44:43 +0100 Subject: Cabal flag to disable network socket support --- erebos.cabal | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'erebos.cabal') diff --git a/erebos.cabal b/erebos.cabal index 33137ce..ae39aa0 100644 --- a/erebos.cabal +++ b/erebos.cabal @@ -35,6 +35,10 @@ Extra-Source-Files: flag ice Description: Enable peer discovery with ICE support using pjproject +flag sockets + description: Enable IP networking using sockets + default: True + flag crypton description: Use 'crypton' package as crypto backend default: True @@ -76,6 +80,8 @@ common common default-extensions: DefaultSignatures DataKinds + EmptyCase + EmptyDataDeriving ExistentialQuantification FlexibleContexts FlexibleInstances @@ -160,12 +166,14 @@ library Erebos.Util Service - c-sources: - src/Erebos/Network/ifaddrs.c include-dirs: src - includes: - src/Erebos/Network/ifaddrs.h + + if flag(sockets) + c-sources: + src/Erebos/Network/ifaddrs.c + includes: + src/Erebos/Network/ifaddrs.h if flag(ice) other-modules: @@ -191,15 +199,19 @@ library 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, 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(sockets) + build-depends: + iproute ^>= { 1.7.12 }, + network ^>= { 3.1, 3.2 }, + cpp-options: -DENABLE_SOCKETS + if flag(crypton) if flag(cryptonite) || flag(crypto-reflibs) build-depends: @@ -286,6 +298,9 @@ executable erebos hs-source-dirs: main ghc-options: -threaded + if !flag(sockets) + buildable: False + main-is: Main.hs other-modules: Paths_erebos -- cgit v1.2.3