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

EAPI=8

# ebuild generated by hackport 0.9.1.0

CABAL_HACKAGE_REVISION=1

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

SRC_URI="https://github.com/jaspervdj/patat/archive/refs/tags/v${PV}.tar.gz  -> ${P}.gh.tar.gz"
DESCRIPTION="Terminal-based presentations using Pandoc"
HOMEPAGE="https://github.com/jaspervdj/patat"

LICENSE="GPL-2"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="patat-make-man"

	#>=dev-haskell/pandoc-3.1:=[profile?] <dev-haskell/pandoc-3.8:=[profile?]
RDEPEND=">=dev-haskell/aeson-2.0:=[profile?] <dev-haskell/aeson-2.3:=[profile?]
	>=dev-haskell/ansi-terminal-1.1:=[profile?] <dev-haskell/ansi-terminal-1.2:=[profile?]
	>=dev-haskell/ansi-wl-pprint-0.6:=[profile?] <dev-haskell/ansi-wl-pprint-1.1:=[profile?]
	>=dev-haskell/async-2.2:=[profile?] <dev-haskell/async-2.3:=[profile?]
	>=dev-haskell/base64-bytestring-1.0:=[profile?] <dev-haskell/base64-bytestring-1.3:=[profile?]
	>=dev-haskell/case-insensitive-1.2:=[profile?] <dev-haskell/case-insensitive-1.3:=[profile?]
	>=dev-haskell/colour-2.3:=[profile?] <dev-haskell/colour-2.4:=[profile?]
	>=dev-haskell/hashable-1.4:=[profile?] <dev-haskell/hashable-1.6:=[profile?]
	>=dev-haskell/juicypixels-3.3.3:=[profile?] <dev-haskell/juicypixels-3.4:=[profile?]
	>=dev-haskell/network-2.6:=[profile?]
	>=dev-haskell/network-uri-2.6:=[profile?]
	>=dev-haskell/optparse-applicative-0.16:=[profile?] <dev-haskell/optparse-applicative-0.19:=[profile?]
	>=dev-haskell/pandoc-3.1:=[profile?] <dev-haskell/pandoc-3.10:=[profile?]
	>=dev-haskell/pandoc-types-1.23:=[profile?] <dev-haskell/pandoc-types-1.24:=[profile?]
	>=dev-haskell/random-1.2:=[profile?] <dev-haskell/random-1.4:=[profile?]
	>=dev-haskell/skylighting-0.10:=[profile?] <dev-haskell/skylighting-0.15:=[profile?]
	>=dev-haskell/terminal-size-0.3:=[profile?] <dev-haskell/terminal-size-0.4:=[profile?]
	>=dev-haskell/text-1.2:=[profile?] <dev-haskell/text-2.2:=[profile?]
	>=dev-haskell/unordered-containers-0.2:=[profile?] <dev-haskell/unordered-containers-0.3:=[profile?]
	>=dev-haskell/vector-0.13:=[profile?] <dev-haskell/vector-0.14:=[profile?]
	>=dev-haskell/wcwidth-0.0:=[profile?] <dev-haskell/wcwidth-0.1:=[profile?]
	>=dev-haskell/yaml-0.8:=[profile?] <dev-haskell/yaml-0.12:=[profile?]
	>=dev-lang/ghc-9.0.2:=
	patat-make-man? ( >=dev-haskell/doctemplates-0.8:=[profile?] <dev-haskell/doctemplates-0.12:=[profile?] )
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-3.4.1.0
	test? ( >=dev-haskell/goldplate-0.2.2.1 <dev-haskell/goldplate-0.3
		>=dev-haskell/quickcheck-2.8 <dev-haskell/quickcheck-2.17
		>=dev-haskell/tasty-1.2 <dev-haskell/tasty-1.6
		>=dev-haskell/tasty-hunit-0.10 <dev-haskell/tasty-hunit-0.11
		>=dev-haskell/tasty-quickcheck-0.10 <dev-haskell/tasty-quickcheck-0.12 )
"

src_prepare() {
	# A temporary patch in order to support more recent pandoc
	# Should disappear with the next tag/release
	# it is the diff between v0.15.2.0 and ce81a76dda38af99fa4af06097bc0f5aded3c426
	# (diff of markdown file is not included, only haskell and conf)
	eapply "${FILESDIR}"/${PN}-v${PV}_to_ce81a76dda38af99fa4af06097bc0f5aded3c426.patch
	eapply_user
}

src_configure() {
	haskell-cabal_src_configure \
		$(cabal_flag patat-make-man patat-make-man)
}