# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

# ebuild generated by hackport 0.8.5.1.9999
#hackport: flags: +network-uri

CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite"
inherit haskell-cabal

DESCRIPTION="An HTTP client using io-streams"
HOMEPAGE="https://github.com/aesiniath/http-streams/"

LICENSE="BSD"
SLOT="0/${PV}"
KEYWORDS="~amd64"

RDEPEND="
	<dev-haskell/aeson-2.3:=[profile?]
	dev-haskell/attoparsec:=[profile?]
	<dev-haskell/attoparsec-aeson-2.3:=[profile?]
	dev-haskell/base64-bytestring:=[profile?]
	>=dev-haskell/blaze-builder-0.4:=[profile?]
	dev-haskell/case-insensitive:=[profile?]
	>=dev-haskell/hsopenssl-0.11.2:=[profile?]
	>=dev-haskell/http-common-0.8.3.4:=[profile?]
	>=dev-haskell/io-streams-1.3:=[profile?] <dev-haskell/io-streams-1.6:=[profile?]
	>=dev-haskell/network-2.6:=[profile?]
	>=dev-haskell/network-uri-2.6:=[profile?]
	>=dev-haskell/openssl-streams-1.1:=[profile?] <dev-haskell/openssl-streams-1.4:=[profile?]
	dev-haskell/text:=[profile?]
	dev-haskell/unordered-containers:=[profile?]
	>=dev-lang/ghc-9.0.2:=
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-3.4.1.0
	test? (
		dev-haskell/aeson-pretty
		dev-haskell/hspec
		dev-haskell/hspec-expectations
		dev-haskell/hunit
		dev-haskell/lifted-base
		dev-haskell/random
		>=dev-haskell/snap-core-1.0 <dev-haskell/snap-core-1.2
		>=dev-haskell/snap-server-1.1 <dev-haskell/snap-server-1.2
	)
"

pkg_pretend() {
	if use test; then
		ewarn "The \"test\" USE flag for this package creates cycles within the"
		ewarn "dependency graph. This may give you problems during 'haskell-updater' runs."
		ewarn "It is recommended to leave it disabled unless explicitly testing the package."
	fi
}

src_configure() {
	haskell-cabal_src_configure \
		--flag=network-uri
}