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

EAPI=8

# ebuild generated by hackport 0.7.1.1.9999

CABAL_FEATURES="lib profile haddock hoogle hscolour" # test-suite
CABAL_HACKAGE_REVISION="4"
inherit haskell-cabal
RESTRICT="test" # fails a few tests, unstable ordering?

DESCRIPTION="An Haskell template system supporting both HTML5 and XML"
HOMEPAGE="https://snapframework.com/"

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

RDEPEND=">=dev-haskell/aeson-0.6:=[profile?]
	>=dev-haskell/attoparsec-0.10:=[profile?]
	>=dev-haskell/blaze-builder-0.2:=[profile?] <dev-haskell/blaze-builder-0.5:=[profile?]
	>=dev-haskell/blaze-html-0.4:=[profile?] <dev-haskell/blaze-html-0.10:=[profile?]
	>=dev-haskell/directory-tree-0.10:=[profile?] <dev-haskell/directory-tree-0.13:=[profile?]
	>=dev-haskell/dlist-0.5:=[profile?]
	>=dev-haskell/hashable-1.1:=[profile?]
	dev-haskell/indexed-traversable:=[profile?]
	>=dev-haskell/lifted-base-0.2:=[profile?] <dev-haskell/lifted-base-0.3:=[profile?]
	>=dev-haskell/map-syntax-0.3:=[profile?] <dev-haskell/map-syntax-0.4:=[profile?]
	>=dev-haskell/monad-control-0.3:=[profile?] <dev-haskell/monad-control-1.1:=[profile?]
	>=dev-haskell/random-1.0.1.0:=[profile?]
	>=dev-haskell/transformers-base-0.4:=[profile?] <dev-haskell/transformers-base-0.5:=[profile?]
	>=dev-haskell/unordered-containers-0.1.4:=[profile?] <dev-haskell/unordered-containers-0.3:=[profile?]
	>=dev-haskell/vector-0.9:=[profile?] <dev-haskell/vector-0.13:=[profile?]
	>=dev-haskell/xmlhtml-0.2.3.5:=[profile?] <dev-haskell/xmlhtml-0.3:=[profile?]
	>=dev-lang/ghc-8.4.3:=
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-2.2.0.1"
#	test? ( >=dev-haskell/bifunctors-5.3 <dev-haskell/bifunctors-5.6
#		>=dev-haskell/hunit-1.2 <dev-haskell/hunit-2
#		>=dev-haskell/lens-4.3
#		>=dev-haskell/quickcheck-2
#		>=dev-haskell/test-framework-0.4 <dev-haskell/test-framework-0.9
#		>=dev-haskell/test-framework-hunit-0.2.7 <dev-haskell/test-framework-hunit-0.4
#		>=dev-haskell/test-framework-quickcheck2-0.2.12.1 <dev-haskell/test-framework-quickcheck2-0.4 )
BDEPEND="app-text/dos2unix"

PATCHES=( "${FILESDIR}"/${PN}-1.1.0.1-aeson-2-p01.patch
		  "${FILESDIR}"/${PN}-1.1.0.1-aeson-2-p02.patch
		  "${FILESDIR}"/${PN}-1.1.0.1-aeson-2-p03.patch
		  "${FILESDIR}"/${PN}-1.1.0.1-aeson-2-p04.patch )

src_prepare() {
	cabal_chdeps \
		'aeson                      >= 0.6     && < 1.5' 'aeson                      >= 0.6     && < 1.6'
	default
	cabal_chdeps \
		'base                       >= 4.5     && < 4.13' 'base                       >= 4.5' \
		'attoparsec                 >= 0.10    && < 0.14' 'attoparsec                 >= 0.10' \
		'hashable                   >= 1.1     && < 1.3' 'hashable                   >= 1.1' \
		'dlist                      >= 0.5     && < 0.9' 'dlist                      >= 0.5' \
		'lens                       >= 4.3      && < 4.18' 'lens                       >= 4.3' \
		'random                     >= 1.0.1.0 && < 1.2' 'random                     >= 1.0.1.0' \
		'QuickCheck                 >= 2        && < 2.13' 'QuickCheck                 >= 2'
}