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

EAPI=8

# ebuild generated by hackport 0.5.4
#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"
SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz"

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/mtl:=[profile?]
	>=dev-haskell/netlink-1.1:=[profile?]
	dev-haskell/network:=[profile?]
	dev-haskell/old-locale:=[profile?]
	dev-haskell/old-time:=[profile?]
	dev-haskell/optparse-applicative:=[profile?]
	dev-haskell/statvfs:=[profile?]
	dev-haskell/stm:=[profile?]
	dev-haskell/text:=[profile?]
	dev-haskell/transformers-compat:=[profile?]
	>=dev-lang/ghc-7.8.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-1.18.1.3
"

PATCHES=(
	"${FILESDIR}"/${P}-formatting-6.patch
	"${FILESDIR}"/${P}-network-3.patch
	"${FILESDIR}"/${P}-no-th.patch
)

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