# 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: -werror

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

DESCRIPTION="Connection layer between beam and postgres"
HOMEPAGE="https://haskell-beam.github.io/beam/user-guide/backends/beam-postgres"

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

RESTRICT="test" # Tries to spin up a temporary postgresql server, which fails

CABAL_CHDEPS=(
	'aeson                >=0.11 && <2.2' 'aeson >=0.11'
)

RDEPEND="
	>=dev-haskell/aeson-0.11:=[profile?]
	>=dev-haskell/attoparsec-0.13:=[profile?] <dev-haskell/attoparsec-0.15
	=dev-haskell/beam-core-0.10*:=[profile?]
	=dev-haskell/beam-migrate-0.5*:=[profile?]
	=dev-haskell/case-insensitive-1.2*:=[profile?]
	>=dev-haskell/conduit-1.2:=[profile?] <dev-haskell/conduit-1.4
	>=dev-haskell/free-4.12:=[profile?] <dev-haskell/free-5.3
	>=dev-haskell/hashable-1.1:=[profile?] <dev-haskell/hashable-1.5
	>=dev-haskell/haskell-src-exts-1.18:=[profile?] <dev-haskell/haskell-src-exts-1.24
	=dev-haskell/lifted-base-0.2*:=[profile?]
	=dev-haskell/monad-control-1.0*:=[profile?]
	=dev-haskell/network-uri-2.6*:=[profile?]
	>=dev-haskell/postgresql-libpq-0.8:=[profile?] <dev-haskell/postgresql-libpq-0.10
	>=dev-haskell/postgresql-simple-0.5:=[profile?] <dev-haskell/postgresql-simple-0.7
	=dev-haskell/scientific-0.3*:=[profile?]
	=dev-haskell/tagged-0.8*:=[profile?]
	>=dev-haskell/text-1.0:=[profile?] <dev-haskell/text-2.1
	=dev-haskell/transformers-base-0.4*:=[profile?]
	=dev-haskell/unordered-containers-0.2*:=[profile?]
	=dev-haskell/uuid-types-1.0*:=[profile?]
	>=dev-haskell/vector-0.11:=[profile?] <dev-haskell/vector-0.14
	>=dev-lang/ghc-8.8.1:=
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-3.0.0.0
	test? (
		dev-haskell/hedgehog
		dev-haskell/tasty
		dev-haskell/tasty-hunit
		dev-haskell/tmp-postgres
		dev-haskell/uuid
	)
"

src_configure() {
	haskell-cabal_src_configure \
		--flag=-werror
}