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

EAPI=8

# ebuild generated by hackport 0.9.1.0.9999
#hackport: flags: -debug,-dev,-has-llvm,+opt,internal-use-unliftio:unliftio,inspection:test

CABAL_HACKAGE_REVISION=3

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

DESCRIPTION="Streaming data pipelines with declarative concurrency"
HOMEPAGE="https://streamly.composewell.com"

LICENSE="BSD"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="fusion-plugin internal-dev unliftio limit-build-mem test"
RESTRICT="!test? ( test )"
REQUIRED_USE="test? ( !internal-dev )"

RDEPEND=">=dev-haskell/atomic-primops-0.8:=[profile?] <dev-haskell/atomic-primops-0.9:=[profile?]
	>=dev-haskell/fusion-plugin-types-0.1:=[profile?] <dev-haskell/fusion-plugin-types-0.2:=[profile?]
	>=dev-haskell/hashable-1.3:=[profile?] <dev-haskell/hashable-1.6:=[profile?]
	>=dev-haskell/heaps-0.3:=[profile?] <dev-haskell/heaps-0.5:=[profile?]
	>=dev-haskell/lockfree-queue-0.2.4:=[profile?] <dev-haskell/lockfree-queue-0.3:=[profile?]
	>=dev-haskell/network-2.6:=[profile?] <dev-haskell/network-3.3:=[profile?]
	>=dev-haskell/streamly-core-0.3.0:=[profile?] <dev-haskell/streamly-core-0.3.4:=[profile?]
	>=dev-haskell/transformers-base-0.4:=[profile?] <dev-haskell/transformers-base-0.5:=[profile?]
	>=dev-haskell/unicode-data-0.1:=[profile?] <dev-haskell/unicode-data-0.10:=[profile?]
	>=dev-haskell/unordered-containers-0.2:=[profile?] <dev-haskell/unordered-containers-0.3:=[profile?]
	>=dev-lang/ghc-9.0.2:=
	test? ( >=dev-haskell/inspection-testing-0.4:=[profile?] <dev-haskell/inspection-testing-0.7:=[profile?] )
	internal-dev? ( >=dev-haskell/primitive-0.5.4:=[profile?] <dev-haskell/primitive-0.10:=[profile?] )
	unliftio? ( >=dev-haskell/unliftio-core-0.2:=[profile?] <dev-haskell/unliftio-core-0.3:=[profile?] )
	!unliftio? ( >=dev-haskell/monad-control-1.0:=[profile?] <dev-haskell/monad-control-1.1:=[profile?] )
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-3.4.1.0
	test? (
		>=dev-haskell/hspec-2.0 <dev-haskell/hspec-2.12
		>=dev-haskell/quickcheck-2.13 <dev-haskell/quickcheck-2.19
		>=dev-haskell/random-1.0.0 <dev-haskell/random-1.4
		>=dev-haskell/temporary-1.3 <dev-haskell/temporary-1.4
		fusion-plugin? (
			>=dev-haskell/fusion-plugin-0.2 <dev-haskell/fusion-plugin-0.3
		)
	)
"

src_configure() {
	haskell-cabal_src_configure \
		--flag=-debug \
		--flag=-dev \
		$(cabal_flag fusion-plugin fusion-plugin) \
		--flag=-has-llvm \
		$(cabal_flag test inspection) \
		$(cabal_flag internal-dev internal-dev) \
		$(cabal_flag unliftio internal-use-unliftio) \
		$(cabal_flag limit-build-mem limit-build-mem) \
		--flag=opt
}