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

EAPI=8

# ebuild generated by hackport 0.9.0.0.9999
#hackport: flags: -debug,-dev,-has-llvm,use-c-malloc:c-malloc,use-unliftio:unliftio,streamly-core:minimal,+opt,inspection:test

CABAL_HACKAGE_REVISION=6

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

DESCRIPTION="Streaming, dataflow programming and declarative concurrency"
HOMEPAGE="https://streamly.composewell.com"

LICENSE="BSD"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="c-malloc fusion-plugin limit-build-mem minimal no-fusion streamk test unliftio"
RESTRICT+=" !test? ( test )"

CABAL_CHDEPS=(
	'inspection-testing >= 0.4   && < 0.6' 'inspection-testing >= 0.4'
	)

RDEPEND=">=dev-haskell/atomic-primops-0.8:=[profile?] <dev-haskell/atomic-primops-0.9:=[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.2.2:=[profile?] <dev-haskell/streamly-core-0.2.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.7:=[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?] )
	!minimal? (
		>=dev-haskell/atomic-primops-0.8:=[profile?] <dev-haskell/atomic-primops-0.9:=[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/unicode-data-0.1:=[profile?] <dev-haskell/unicode-data-0.7:=[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/network-3.1 <dev-haskell/network-3.3
		>=dev-haskell/quickcheck-2.13 <dev-haskell/quickcheck-2.15
		>=dev-haskell/random-1.0.0 <dev-haskell/random-1.3
		>=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 limit-build-mem limit-build-mem) \
		$(cabal_flag no-fusion no-fusion) \
		--flag=opt \
		$(cabal_flag streamk streamk) \
		$(cabal_flag minimal streamly-core) \
		$(cabal_flag c-malloc use-c-malloc) \
		$(cabal_flag unliftio use-unliftio)
}