Allow to build with curl (cli) instead of http-io-streams

This allows to avoid linking against OpenSSL on mac.
This commit is contained in:
2020-04-09 16:59:25 +02:00
parent 958bf698b9
commit adec7b2398
5 changed files with 374 additions and 243 deletions

View File

@@ -21,6 +21,11 @@ source-repository head
type: git
location: https://github.com/hasufell/ghcup-hs
flag Curl
description: Use curl instead of http-io-streams for download
default: False
manual: True
common HsOpenSSL
build-depends: HsOpenSSL >=0.11.4.18
@@ -238,8 +243,6 @@ library
, hpath-filepath
, hpath-io
, hpath-posix
, http-io-streams
, io-streams
, language-bash
, lzma
, monad-logger
@@ -259,7 +262,6 @@ library
, string-interpolate
, tar-bytestring
, template-haskell
, terminal-progress-bar
, text
, time
, transformers
@@ -277,6 +279,7 @@ library
exposed-modules:
GHCup
GHCup.Download
GHCup.Download.Utils
GHCup.Errors
GHCup.Platform
GHCup.Types
@@ -296,6 +299,15 @@ library
-- other-extensions:
hs-source-dirs: lib
if !flag(curl)
import:
, http-io-streams
, io-streams
, terminal-progress-bar
exposed-modules: GHCup.Download.IOStreams
else
cpp-options: -DCURL
executable ghcup
import:
config