# Copyright 1999-2026 Gentoo Authors, illogician <illogician@tutamail.com>
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit flag-o-matic git-r3

DESCRIPTION="X11 window manager featuring tabs and an iconbar"
HOMEPAGE="http://www.fluxbox.org"
EGIT_REPO_URI="https://github.com/fluxbox/fluxbox.git"

LICENSE="MIT"
SLOT="0"
IUSE="nls xinerama bidi +truetype +imlib +slit +systray +ewmh +toolbar vim-syntax"
REQUIRED_USE="systray? ( toolbar )"

RDEPEND="bidi? ( dev-libs/fribidi )
	imlib? ( media-libs/imlib )
	truetype? ( media-libs/freetype )
	vim-syntax? ( app-vim/fluxbox-syntax )
	x11-libs/libXext
	x11-libs/libXft
	x11-libs/libXpm
	x11-libs/libXrandr
	x11-libs/libXrender
	xinerama? ( x11-libs/libXinerama )
	|| ( x11-misc/gxmessage x11-apps/xmessage )"

BDEPEND="bidi? ( virtual/pkgconfig )
	nls? ( sys-devel/gettext )
	virtual/pkgconfig"

DEPEND="${RDEPEND}
	x11-base/xorg-proto"

src_unpack() {
	git-r3_src_unpack
	default
}

src_prepare() {
	default
	./autogen.sh
}

src_configure() {

	econf \
		$(use_enable bidi fribidi ) \
		$(use_enable ewmh) \
		$(use_enable imlib imlib2) \
		$(use_enable nls) \
		$(use_enable slit) \
		$(use_enable systray) \
		$(use_enable toolbar) \
		$(use_enable truetype xft) \
		$(use_enable xinerama) \
		$(use_enable vim-syntax)
}

src_compile() {
	emake
}

src_install() {
	emake DESTDIR="${D}" install
	dodoc README* AUTHORS TODO* ChangeLog NEWS
}