# 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
#hackport: flags: -ps

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

DESCRIPTION="Embedded domain-specific language for declarative vector graphics"
HOMEPAGE="https://diagrams.github.io"
SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz"

LICENSE="BSD"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="cairo canvas gtk postscript rasterific +svg"

RDEPEND=">=dev-haskell/diagrams-contrib-1.4:=[profile?] <dev-haskell/diagrams-contrib-1.5:=[profile?]
	>=dev-haskell/diagrams-core-1.4:=[profile?] <dev-haskell/diagrams-core-1.6:=[profile?]
	>=dev-haskell/diagrams-lib-1.4:=[profile?] <dev-haskell/diagrams-lib-1.5:=[profile?]
	>=dev-lang/ghc-8.4.3:=
	cairo? ( >=dev-haskell/diagrams-cairo-1.4:=[profile?] <dev-haskell/diagrams-cairo-1.5:=[profile?] )
	canvas? ( >=dev-haskell/diagrams-canvas-1.4:=[profile?] <dev-haskell/diagrams-canvas-1.5:=[profile?] )
	gtk? ( >=dev-haskell/diagrams-gtk-1.4:=[profile?] <dev-haskell/diagrams-gtk-1.5:=[profile?] )
	postscript? ( >=dev-haskell/diagrams-postscript-1.4:=[profile?] <dev-haskell/diagrams-postscript-1.6:=[profile?] )
	rasterific? ( >=dev-haskell/diagrams-rasterific-1.4:=[profile?] <dev-haskell/diagrams-rasterific-1.5:=[profile?] )
	svg? ( >=dev-haskell/diagrams-svg-1.4:=[profile?] <dev-haskell/diagrams-svg-1.5:=[profile?] )
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-2.2.0.1
"

src_configure() {
	haskell-cabal_src_configure \
		$(cabal_flag cairo cairo) \
		$(cabal_flag canvas canvas) \
		$(cabal_flag gtk gtk) \
		$(cabal_flag postscript postscript) \
		--flag=-ps \
		$(cabal_flag rasterific rasterific) \
		$(cabal_flag svg svg)
}