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

EAPI=8

# ebuild generated by hackport 0.8.4.0.9999
#hackport: flags: build-play-tomland:examples,build-readme:examples

CABAL_HACKAGE_REVISION=1

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

DESCRIPTION="Bidirectional TOML serialization"
HOMEPAGE="https://github.com/kowainik/tomland"

LICENSE="MPL-2.0"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="examples"

CABAL_CHBINS=(
	'readme' "${PN}-example-readme"
	'play-tomland' "${PN}-example-play"
)

CABAL_CHDEPS=(
	'hedgehog         >= 1.0.1 && < 1.3' 'hedgehog >= 1.0.1'
)

RDEPEND="
	>=dev-haskell/hashable-1.3.1.0:=[profile?] <dev-haskell/hashable-1.5:=[profile?]
	>=dev-haskell/megaparsec-7.0.5:=[profile?] <dev-haskell/megaparsec-10:=[profile?]
	>=dev-haskell/parser-combinators-1.1.0:=[profile?] <dev-haskell/parser-combinators-1.4:=[profile?]
	>=dev-haskell/text-1.2:=[profile?] <dev-haskell/text-2.1:=[profile?]
	>=dev-haskell/unordered-containers-0.2.7:=[profile?] <dev-haskell/unordered-containers-0.3:=[profile?]
	>=dev-haskell/validation-selective-0.1.0:=[profile?] <dev-haskell/validation-selective-0.3:=[profile?]
	>=dev-lang/ghc-8.10.6:=
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-3.2.1.0
	test? (
		>=dev-haskell/hedgehog-1.0.1
		>=dev-haskell/hspec-2.7.1 <dev-haskell/hspec-2.11
		>=dev-haskell/hspec-hedgehog-0.0.1 <dev-haskell/hspec-hedgehog-0.1
		>=dev-haskell/hspec-megaparsec-2.0.0 <dev-haskell/hspec-megaparsec-2.3.0
	)
	examples? (
		dev-haskell/markdown-unlit
	)
"

src_configure() {
	haskell-cabal_src_configure \
		$(cabal_flag examples build-play-tomland) \
		$(cabal_flag examples build-readme)
}