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

EAPI=8

# ebuild generated by hackport 0.8.4.0.9999

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

DESCRIPTION="A library for declaring, parsing, and invoking text-input based commands"
HOMEPAGE="https://github.com/simmsb/calamity"

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

CABAL_CHDEPS=(
	'text >=1.2 && <2.1' 'text >=2.0 && <2.2'
)

RDEPEND=">=dev-haskell/megaparsec-8:=[profile?] <dev-haskell/megaparsec-10:=[profile?]
	>=dev-haskell/optics-0.4.1:=[profile?] <dev-haskell/optics-0.5:=[profile?]
	>=dev-haskell/polysemy-1.5:=[profile?] <dev-haskell/polysemy-2:=[profile?]
	>=dev-haskell/polysemy-plugin-0.3:=[profile?] <dev-haskell/polysemy-plugin-0.5:=[profile?]
	>=dev-haskell/text-2.0:=[profile?] <dev-haskell/text-2.2:=[profile?]
	>=dev-haskell/text-show-3.8:=[profile?] <dev-haskell/text-show-4:=[profile?]
	>=dev-haskell/unordered-containers-0.2:=[profile?] <dev-haskell/unordered-containers-0.3:=[profile?]
	>=dev-lang/ghc-8.10.6:=
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-3.2.1.0
"

src_install() {
	# no idea, dirty hack...
	sed -i 's/-fplugin=Polysemy.Plugin//g' "${S}/calamity-commands.cabal" || die
	haskell-cabal_src_install || die
}