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

EAPI=8

# ebuild generated by hackport 0.5.6

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

DESCRIPTION="Efficient high-level bit operations not found in Data.Bits"
HOMEPAGE="https://hackage.haskell.org/package/bits-extras"
SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz"

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

RESTRICT=test # fails trailingZeros test

RDEPEND=">=dev-lang/ghc-7.4.1:=
	test? ( dev-haskell/hunit:=[profile?]
		dev-haskell/quickcheck:=[profile?]
		dev-haskell/test-framework:=[profile?]
		dev-haskell/test-framework-hunit:=[profile?]
		dev-haskell/test-framework-quickcheck2:=[profile?] )
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-1.6
"

PATCHES=(
	"${FILESDIR}"/${P}-gcc-9.patch
)

src_prepare() {
	default

	rm Setup.hs || die
	cabal_chdeps \
		'Executable test' 'Executable bits-extras-test'
}

src_configure() {
	haskell-cabal_src_configure \
		$(cabal_flag test test)
}