# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit desktop xdg

MY_PN="X-AIR-Edit"

DESCRIPTION="Graphical editor for the X32 mixer"
HOMEPAGE="https://www.behringer.com/"
SRC_URI="X-AIR-Edit_LINUX_${PV}.tar.gz"
S="${WORKDIR}"

LICENSE="x32edit-EULA"
SLOT="0"
KEYWORDS="-* ~amd64"
# Some required symbols are otherwise stripped out
RESTRICT="fetch strip"

RDEPEND="
	media-libs/alsa-lib
	media-libs/freetype
	net-misc/curl
"
BDEPEND="
	dev-util/patchelf
"

DOCS=(
	"X-AIR-Edit_Release_History.txt"
)
QA_PREBUILT=( "usr/bin/${PN} ")

pkg_nofetch() {
	einfo "Please visit ${HOMEPAGE} and download X32 Edit version ${PV}"
	einfo "and move it to DISTDIR."
	einfo ""
	einfo "  expected filenames: ${SRC_URI}"
	einfo ""
	einfo "The license should be shown and needs to be accepted before download."
}

src_install() {
	einstalldocs
	newbin ${MY_PN} ${PN}

	make_desktop_entry /usr/bin/${PN} "${MY_PN//-/ }" ${PN} "AudioVideo;Audio"
}