# 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: +split-these,hlint:test

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

DESCRIPTION="Data structures for describing changes to other data structures"
HOMEPAGE="https://obsidian.systems"

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

# The <hlint-3.5 restriction on ghc-9.0 shouldn't be necessary with ghc-lib
CABAL_CHDEPS=(
	'hlint (< 2.1 || >= 2.2.2) && < 3.5' 'hlint >= 2.2.2'
	'hlint >= 3.5 && < 3.6' 'hlint >= 3.5'
	'lens >= 4.7 && < 5.3' 'lens >= 4.7'
)

RDEPEND="
	>=dev-haskell/commutative-semigroups-0.0:=[profile?] <dev-haskell/commutative-semigroups-0.2:=[profile?]
	>=dev-haskell/constraints-extras-0.3:=[profile?] <dev-haskell/constraints-extras-0.5:=[profile?]
	>=dev-haskell/dependent-map-0.3:=[profile?] <dev-haskell/dependent-map-0.5:=[profile?]
	>=dev-haskell/dependent-sum-0.6:=[profile?] <dev-haskell/dependent-sum-0.8:=[profile?]
	>=dev-haskell/indexed-traversable-0.1:=[profile?] <dev-haskell/indexed-traversable-0.2:=[profile?]
	>=dev-haskell/lens-4.7:=[profile?]
	>=dev-haskell/monoidal-containers-0.6:=[profile?] <dev-haskell/monoidal-containers-0.7:=[profile?]
	>=dev-haskell/semialign-1:=[profile?] <dev-haskell/semialign-1.4:=[profile?]
	>=dev-haskell/semigroupoids-4.0:=[profile?] <dev-haskell/semigroupoids-7:=[profile?]
	>=dev-haskell/these-1:=[profile?] <dev-haskell/these-1.3:=[profile?]
	>=dev-haskell/witherable-0.3:=[profile?] <dev-haskell/witherable-0.5:=[profile?]
	>=dev-lang/ghc-9.0.2:=
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-3.4.1.0
	test? (
		dev-haskell/filemanip
		dev-haskell/hedgehog
		>=dev-haskell/hlint-3.5[ghc-lib]
		dev-haskell/hunit
	)
"

src_configure() {
	haskell-cabal_src_configure \
		$(cabal_flag test hlint) \
		--flag=split-these
}