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

EAPI=7

# ebuild generated by hackport 0.6.7.9999
#hackport: flags: -has-llvm
CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite"
inherit haskell-cabal

DESCRIPTION="Beautiful Streaming, Concurrent and Reactive Composition"
HOMEPAGE="https://github.com/composewell/streamly"
SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz"

LICENSE="BSD"
SLOT="0/${PV}"
KEYWORDS="~amd64 ~x86"
IUSE="debug dev examples examples-sdl fusion-plugin no-fusion streamk"

RDEPEND=">=dev-haskell/atomic-primops-0.8:=[profile?] <dev-haskell/atomic-primops-0.9:=[profile?]
	>=dev-haskell/exceptions-0.8:=[profile?] <dev-haskell/exceptions-0.11:=[profile?]
	>=dev-haskell/fusion-plugin-types-0.1:=[profile?] <dev-haskell/fusion-plugin-types-0.2:=[profile?]
	>=dev-haskell/heaps-0.3:=[profile?] <dev-haskell/heaps-0.4:=[profile?]
	>=dev-haskell/lockfree-queue-0.2.3:=[profile?] <dev-haskell/lockfree-queue-0.3:=[profile?]
	>=dev-haskell/monad-control-1.0:=[profile?] <dev-haskell/monad-control-2:=[profile?]
	>=dev-haskell/mtl-2.2:=[profile?] <dev-haskell/mtl-3:=[profile?]
	>=dev-haskell/network-2.6:=[profile?] <dev-haskell/network-4:=[profile?]
	>=dev-haskell/primitive-0.5.4:=[profile?] <dev-haskell/primitive-0.8:=[profile?]
	>=dev-haskell/semigroups-0.18:=[profile?] <dev-haskell/semigroups-0.19:=[profile?]
	>=dev-haskell/transformers-base-0.4:=[profile?] <dev-haskell/transformers-base-0.5:=[profile?]
	>=dev-lang/ghc-7.10.1:=
	examples? ( >=dev-haskell/hashable-1.2:=[profile?] <dev-haskell/hashable-1.4:=[profile?]
			>=dev-haskell/http-conduit-2.2.2:=[profile?] <dev-haskell/http-conduit-2.4:=[profile?]
			>=dev-haskell/random-1.0.0:=[profile?] <dev-haskell/random-2:=[profile?]
			>=dev-haskell/unordered-containers-0.2:=[profile?] <dev-haskell/unordered-containers-0.3:=[profile?]
			>=dev-haskell/vector-0.12:=[profile?] <dev-haskell/vector-0.13:=[profile?] )
	examples-sdl? ( >=dev-haskell/hashable-1.2:=[profile?] <dev-haskell/hashable-1.4:=[profile?]
			>=dev-haskell/http-conduit-2.2.2:=[profile?] <dev-haskell/http-conduit-2.4:=[profile?]
			>=dev-haskell/random-1.0.0:=[profile?] <dev-haskell/random-2:=[profile?]
			>=dev-haskell/sdl-0.6.5:=[profile?] <dev-haskell/sdl-0.7:=[profile?]
			>=dev-haskell/unordered-containers-0.2:=[profile?] <dev-haskell/unordered-containers-0.3:=[profile?]
			>=dev-haskell/vector-0.12:=[profile?] <dev-haskell/vector-0.13:=[profile?] )
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-2.2
	test? ( >=dev-haskell/hspec-2.0 <dev-haskell/hspec-3
		>=dev-haskell/quickcheck-2.10 <dev-haskell/quickcheck-2.15
		dev-lang/ghc
		dev? ( >=dev-haskell/clock-0.7.1 <dev-haskell/clock-0.9 )
		!examples? ( !examples-sdl? ( >=dev-haskell/random-1.0.0 <dev-haskell/random-2 ) ) )
"

PATCHES="${FILESDIR}/${PN}-0.7.2-upstream-duplicate-instance-fix.patch"

src_configure() {
	haskell-cabal_src_configure \
		$(cabal_flag debug debug) \
		$(cabal_flag dev dev) \
		$(cabal_flag examples examples) \
		$(cabal_flag examples-sdl examples-sdl) \
		$(cabal_flag fusion-plugin fusion-plugin) \
		--flags=-has-llvm \
		$(cabal_flag no-fusion no-fusion) \
		$(cabal_flag streamk streamk)
}