Skip to content

Commit

Permalink
Allow to build with curl (cli) instead of http-io-streams
Browse files Browse the repository at this point in the history
This allows to avoid linking against OpenSSL on mac.
  • Loading branch information
hasufell committed Apr 9, 2020
1 parent 958bf69 commit adec7b2
Show file tree
Hide file tree
Showing 5 changed files with 374 additions and 243 deletions.
18 changes: 15 additions & 3 deletions ghcup.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -238,8 +243,6 @@ library
, hpath-filepath
, hpath-io
, hpath-posix
, http-io-streams
, io-streams
, language-bash
, lzma
, monad-logger
Expand All @@ -259,7 +262,6 @@ library
, string-interpolate
, tar-bytestring
, template-haskell
, terminal-progress-bar
, text
, time
, transformers
Expand All @@ -277,6 +279,7 @@ library
exposed-modules:
GHCup
GHCup.Download
GHCup.Download.Utils
GHCup.Errors
GHCup.Platform
GHCup.Types
Expand All @@ -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
Expand Down
Loading

0 comments on commit adec7b2

Please sign in to comment.