# 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

CABAL_HACKAGE_REVISION=1

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

DESCRIPTION="Convert bidirectionally between Dhall and CSV files"
HOMEPAGE="https://dhall-lang.org/"

GIT_REPO="https://github.com/dhall-lang/dhall-haskell"
GIT_COMMIT="addf2bae80bc1b2d38536fd6555f8e829d8f8b2b" # tag 1.42.2
GIT_P="dhall-haskell-${GIT_COMMIT}"
SRC_URI+="
    test? (
        ${GIT_REPO}/archive/${GIT_COMMIT}.tar.gz -> ${GIT_P}.tar.gz
    )
"

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

RDEPEND="dev-haskell/ansi-terminal:=[profile?]
	>=dev-haskell/cassava-0.5.0.0:=[profile?] <dev-haskell/cassava-0.6:=[profile?]
	dev-haskell/either:=[profile?]
	dev-haskell/optparse-applicative:=[profile?]
	>=dev-haskell/prettyprinter-1.7.0:=[profile?] <dev-haskell/prettyprinter-1.8:=[profile?]
	>=dev-haskell/prettyprinter-ansi-terminal-1.1.1:=[profile?] <dev-haskell/prettyprinter-ansi-terminal-1.2:=[profile?]
	>=dev-haskell/text-0.11.1.0:=[profile?] <dev-haskell/text-2.2:=[profile?]
	<dev-haskell/unordered-containers-0.3:=[profile?]
	>=dev-haskell/vector-0.12:=[profile?] <dev-haskell/vector-0.14:=[profile?]
	>=dev-lang/dhall-1.39.0:=[profile?] <dev-lang/dhall-1.43:=[profile?]
	>=dev-lang/ghc-9.0.2:=
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-3.4.1.0
	test? ( <dev-haskell/tasty-1.5
		>=dev-haskell/tasty-hunit-0.2
		<dev-haskell/tasty-silver-3.4 )
"

src_prepare() {
    if use test; then
        cp -a "${WORKDIR}/${GIT_P}/${PN}/tasty/data" "${S}/tasty" || die
    fi
    haskell-cabal_src_prepare
}