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

EAPI=8

# ebuild generated by hackport 0.9.1.0.9999

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

DESCRIPTION="Low-level bindings to Libsass"
HOMEPAGE="https://github.com/jakubfijalkowski/hlibsass"

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

RDEPEND=">=dev-lang/ghc-9.0.2:=
	externallibsass? ( dev-libs/libsass:= )
	!externallibsass? ( ( || ( llvm-core/clang
							sys-devel/gcc[cxx] ) ) )
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-3.4.1.0 <dev-haskell/cabal-4
	test? ( dev-haskell/hspec )
"

REQUIRED_USE="
	externallibsass? ( !sharedlibsass )
"

src_configure() {
	# uses 'make' directly
	tc-export AR CC CXX

	haskell-cabal_src_configure \
		$(cabal_flag externallibsass externallibsass) \
		$(cabal_flag sharedlibsass sharedlibsass)
}