From e74ab26b44e0794e02581e020cf4c868d5cddd43 Mon Sep 17 00:00:00 2001 From: Dennis Frieberg Date: Wed, 23 Sep 2020 14:08:27 +0200 Subject: [PATCH] added flgas for conditional compilation of available backends --- package.yaml | 26 ++++++++++++++++++++++++-- tickLeisteServer.cabal | 32 ++++++++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/package.yaml b/package.yaml index 6eb24b7..135a8c2 100644 --- a/package.yaml +++ b/package.yaml @@ -19,6 +19,24 @@ extra-source-files: # common to point users to the README.md file. description: Please see the README on GitHub at +flags: + http: + description: Build with http support + manual: true + default: true + https: + description: Build with https support + manual: true + default: false + fast-cgi: + description: Build with fastcgi support + manual: true + default: false + cgi: + description: Build with cgi support + manual: true + default: false + dependencies: - base >= 4.7 && < 5 - tickLeiste @@ -31,8 +49,12 @@ dependencies: - containers - wai - wai-websockets -- http-types -- warp + +when: + - condition: flag(http) + dependencies: + - http-types + - warp build-tools: - cpphs diff --git a/tickLeisteServer.cabal b/tickLeisteServer.cabal index 20d2853..da8a79b 100644 --- a/tickLeisteServer.cabal +++ b/tickLeisteServer.cabal @@ -23,6 +23,26 @@ source-repository head type: git location: https://github.com/githubuser/tickLeisteServer +flag cgi + description: Build with cgi support + manual: True + default: False + +flag fast-cgi + description: Build with fastcgi support + manual: True + default: False + +flag http + description: Build with http support + manual: True + default: True + +flag https + description: Build with https support + manual: True + default: False + executable tickLeisteServer main-is: Main.hs other-modules: @@ -39,15 +59,17 @@ executable tickLeisteServer , base >=4.7 && <5 , bytestring , containers - , http-types , text , tickLeiste , tickLeiste-aeson , uuid , wai , wai-websockets - , warp , websockets + if flag(http) + build-depends: + http-types + , warp default-language: Haskell2010 test-suite tickLeisteServer-test @@ -65,7 +87,6 @@ test-suite tickLeisteServer-test , base >=4.7 && <5 , bytestring , containers - , http-types , text , tickLeiste , tickLeiste-aeson @@ -73,6 +94,9 @@ test-suite tickLeisteServer-test , uuid , wai , wai-websockets - , warp , websockets + if flag(http) + build-depends: + http-types + , warp default-language: Haskell2010