# 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

CABAL_HACKAGE_REVISION=1

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

DESCRIPTION="Vec: length-indexed (sized) list"
HOMEPAGE="https://github.com/phadej/vec"

LICENSE="BSD"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="+adjunctions +distributive +semigroupoids"
# Turning on 'adjunctions' without 'distributive' does nothing.
# See <https://hackage.haskell.org/package/vec-0.4.1/revision/1.cabal>
REQUIRED_USE="adjunctions? ( distributive )"

RDEPEND="
	>=dev-haskell/boring-0.2:=[profile?] <dev-haskell/boring-0.3:=[profile?]
	>=dev-haskell/fin-0.3:=[profile?] <dev-haskell/fin-0.4:=[profile?]
	>=dev-haskell/hashable-1.2.7.0:=[profile?] <dev-haskell/hashable-1.5:=[profile?]
	>=dev-haskell/indexed-traversable-0.1.1:=[profile?] <dev-haskell/indexed-traversable-0.2:=[profile?]
	>=dev-haskell/quickcheck-2.14.2:=[profile?] <dev-haskell/quickcheck-2.15:=[profile?]
	>=dev-lang/ghc-9.0.2:=
	adjunctions? (
		>=dev-haskell/adjunctions-4.4:=[profile?] <dev-haskell/adjunctions-4.5:=[profile?]
	)
	distributive? (
		>=dev-haskell/distributive-0.5.3:=[profile?] <dev-haskell/distributive-0.7:=[profile?]
	)
	semigroupoids? (
		|| (
			( >=dev-haskell/semigroupoids-5.3.5 <dev-haskell/semigroupoids-5.4 )
			( >=dev-haskell/semigroupoids-6 <dev-haskell/semigroupoids-6.1 )
		)
	)
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-3.4.1.0
	test? (
		dev-haskell/base-compat
		dev-haskell/tagged
		|| (
			( >=dev-haskell/inspection-testing-0.4.2.2 <dev-haskell/inspection-testing-0.5 )
			( >=dev-haskell/inspection-testing-0.5.0.1 <dev-haskell/inspection-testing-0.6 )
		)
	)
"

src_configure() {
	haskell-cabal_src_configure \
		$(cabal_flag adjunctions adjunctions) \
		$(cabal_flag distributive distributive) \
		$(cabal_flag semigroupoids semigroupoids)
}