# Copyright 2025 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit git-r3

DESCRIPTION="Provide compatibility with Half-Life Engine and extend it"
HOMEPAGE="https://github.com/FWGS/xash3d-fwgs https://xash.su/"
EGIT_REPO_URI="https://github.com/FWGS/xash3d-fwgs.git"
LICENSE="VALVE GPL-2+ GPL-3+ Half-Life-1-SDK"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
IUSE=""

# <media-libs/opus-1.5
DEPEND="
	virtual/opengl
	app-arch/bzip2:=
	media-libs/libogg
	media-libs/libvorbis
	media-libs/opusfile
	media-libs/libsdl2
"
RDEPEND="${DEPEND}"

src_configure() {
	./waf configure \
		--prefix=/usr \
		--enable-packaging \
		--64bits \
		--disable-werror || die
}

src_compile() {
	./waf || die
}

src_install() {
	DESTDIR="${D}" ./waf install || die
}