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

EAPI=8

# ebuild generated by hackport 0.9.0.0.9999
#hackport: flags: pulse:pulseaudio

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

DESCRIPTION="A system state collecting library and application"
HOMEPAGE="https://hackage.haskell.org/package/monky"

LICENSE="LGPL-3"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="ibus +pulseaudio"

RDEPEND="dev-haskell/cereal:=[profile?]
	dev-haskell/composition:=[profile?]
	>=dev-haskell/env-locale-1.0.0.1:=[profile?]
	dev-haskell/formatting:=[profile?]
	>=dev-haskell/netlink-1.1:=[profile?]
	dev-haskell/network:=[profile?]
	dev-haskell/old-time:=[profile?]
	dev-haskell/optparse-applicative:=[profile?]
	dev-haskell/scientific:=[profile?]
	dev-haskell/statvfs:=[profile?]
	dev-haskell/text:=[profile?]
	>=dev-lang/ghc-9.0.2:=
	ibus? ( dev-haskell/dbus:=[profile?]
		dev-haskell/ibus-hs:=[profile?] )
	pulseaudio? ( >=dev-haskell/pulseaudio-0.0.2.0:=[profile?] <dev-haskell/pulseaudio-0.1.0.0:=[profile?] )
"
DEPEND="${RDEPEND}
	>=dev-haskell/cabal-3.4.1.0
"

PATCHES=(
	"${FILESDIR}"/${PN}-2.2.1.0-no-th.patch
	"${FILESDIR}"/${P}-fix-th.patch
)

src_configure() {
	haskell-cabal_src_configure \
		$(cabal_flag ibus ibus) \
		$(cabal_flag pulseaudio pulse)
}