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

EAPI=8

# ebuild generated by hackport 0.8.4.0
#hackport: flags: -doctests

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

DESCRIPTION="Clash: a functional hardware description language - As a library"
HOMEPAGE="https://clash-lang.org/"

LICENSE="BSD-2"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="debug +unittests workaround-ghc-mmap-crash"

RDEPEND=">=dev-haskell/aeson-0.6.2.0:=[profile?] <dev-haskell/aeson-2.3:=[profile?]
	>=dev-haskell/aeson-pretty-0.8:=[profile?] <dev-haskell/aeson-pretty-0.9:=[profile?]
	>=dev-haskell/ansi-terminal-0.8.0.0:=[profile?] <dev-haskell/ansi-terminal-1.1:=[profile?]
	>=dev-haskell/async-2.2.0:=[profile?] <dev-haskell/async-2.3:=[profile?]
	>=dev-haskell/attoparsec-0.10.4.0:=[profile?] <dev-haskell/attoparsec-0.15:=[profile?]
	>=dev-haskell/attoparsec-aeson-2.1:=[profile?] <dev-haskell/attoparsec-aeson-2.3:=[profile?]
	>=dev-haskell/base16-bytestring-0.1.1:=[profile?] <dev-haskell/base16-bytestring-1.1:=[profile?]
	~dev-haskell/clash-prelude-1.8.1:=[profile?]
	>=dev-haskell/concurrent-supply-0.1.7:=[profile?] <dev-haskell/concurrent-supply-0.2:=[profile?]
	>=dev-haskell/cryptohash-sha256-0.11:=[profile?] <dev-haskell/cryptohash-sha256-0.12:=[profile?]
	>=dev-haskell/data-binary-ieee754-0.4.4:=[profile?] <dev-haskell/data-binary-ieee754-0.6:=[profile?]
	>=dev-haskell/data-default-0.7:=[profile?] <dev-haskell/data-default-0.8:=[profile?]
	>=dev-haskell/dlist-0.8:=[profile?] <dev-haskell/dlist-1.1:=[profile?]
	>=dev-haskell/docopt-0.7:=[profile?] <dev-haskell/docopt-0.8:=[profile?]
	>=dev-haskell/extra-1.6.17:=[profile?] <dev-haskell/extra-1.8:=[profile?]
	dev-haskell/glob:=[profile?]
	>=dev-haskell/hashable-1.2.1.0:=[profile?] <dev-haskell/hashable-1.5:=[profile?]
	>=dev-haskell/haskell-src-meta-0.8:=[profile?] <dev-haskell/haskell-src-meta-0.9:=[profile?]
	>=dev-haskell/hint-0.7:=[profile?] <dev-haskell/hint-0.10:=[profile?]
	>=dev-haskell/infinite-list-0.1:=[profile?] <dev-haskell/infinite-list-0.2:=[profile?]
	>=dev-haskell/lens-4.10:=[profile?] <dev-haskell/lens-5.3:=[profile?]
	>=dev-haskell/ordered-containers-0.2:=[profile?] <dev-haskell/ordered-containers-0.3:=[profile?]
	>=dev-haskell/pretty-show-1.9:=[profile?] <dev-haskell/pretty-show-2.0:=[profile?]
	>=dev-haskell/prettyprinter-1.2.0.1:=[profile?] <dev-haskell/prettyprinter-1.8:=[profile?]
	>=dev-haskell/prettyprinter-interp-0.2:=[profile?] <dev-haskell/prettyprinter-interp-0.3:=[profile?]
	>=dev-haskell/primitive-0.5.0.1:=[profile?] <dev-haskell/primitive-1.0:=[profile?]
	>=dev-haskell/string-interpolate-0.3:=[profile?] <dev-haskell/string-interpolate-0.4:=[profile?]
	dev-haskell/stringsearch:=[profile?]
	>=dev-haskell/temporary-1.2.1:=[profile?] <dev-haskell/temporary-1.4:=[profile?]
	>=dev-haskell/terminal-size-0.3:=[profile?] <dev-haskell/terminal-size-0.4:=[profile?]
	>=dev-haskell/text-1.2.2:=[profile?] <dev-haskell/text-2.2:=[profile?]
	>=dev-haskell/trifecta-1.7.1.1:=[profile?] <dev-haskell/trifecta-2.2:=[profile?]
	>=dev-haskell/unordered-containers-0.2.3.3:=[profile?] <dev-haskell/unordered-containers-0.3:=[profile?]
	>=dev-haskell/vector-0.11:=[profile?] <dev-haskell/vector-1.0:=[profile?]
	>=dev-haskell/vector-binary-instances-0.2.3.5:=[profile?] <dev-haskell/vector-binary-instances-0.3:=[profile?]
	>=dev-haskell/yaml-0.11:=[profile?] <dev-haskell/yaml-0.12:=[profile?]
	>=dev-lang/ghc-8.6.0:=[profile?] <dev-lang/ghc-9.9:=[profile?]
	>=dev-lang/ghc-8.10.1:=
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-3.2.0.0
	test? ( unittests? ( dev-haskell/clash-prelude
				dev-haskell/ghc-typelits-knownnat
				dev-haskell/haskell-src-exts
				dev-haskell/quickcheck-text
				>=dev-haskell/tasty-1.2 <dev-haskell/tasty-1.6
				dev-haskell/tasty-hunit
				dev-haskell/tasty-quickcheck
				dev-haskell/tasty-th ) )
"

src_configure() {
	haskell-cabal_src_configure \
		$(cabal_flag debug debug) \
		--flag=-doctests \
		$(cabal_flag unittests unittests) \
		$(cabal_flag workaround-ghc-mmap-crash workaround-ghc-mmap-crash)
}