# Copyright 2026 Aubrey
# Distributed under the terms of the BSD-2-Clause License

EAPI=8

inherit unpacker xdg

DESCRIPTION="Next-generation open source Minecraft launcher (prebuilt)"
HOMEPAGE="https://github.com/Polyfrost/OneLauncher"
SRC_URI="https://github.com/Polyfrost/OneLauncher/releases/download/oneclient-${PV}/OneClient_${PV}_linux_x86_64.deb"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE="wayland"

RDEPEND="
	media-libs/fontconfig
	media-libs/freetype
	media-libs/libglvnd
	x11-libs/libXcursor
	x11-libs/libXrandr
	x11-libs/libXi
	sys-apps/dbus
	x11-libs/gtk+:3
	wayland? (
		x11-libs/libxkbcommon
		dev-libs/wayland
	)
"
DEPEND="${RDEPEND}"
BDEPEND=""

S="${WORKDIR}"

src_install() {
	cp -r "${S}"/usr "${ED}" || die
	dosym oneclient_app /usr/bin/oneclient
}

pkg_postinst() {
	xdg_icon_cache_update
}

pkg_postrm() {
	xdg_icon_cache_update
}