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

EAPI=8

GLYPH_PV="0.5.0"

GITHUB_REPOSITORY="isene/glass"
GITHUB_COMMIT="b5d856a6e97d5eb8cdf85a8ff9fd3e740379986f"

inherit github-archive

DESCRIPTION="Terminal emulator in x86_64 Linux assembly, speaks X11 wire protocol directly"
#HOMEPAGE="https://github.com/isene/glass"
#	https://github.com/isene/glass/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz
SRC_URI+=" https://github.com/isene/glyph/archive/refs/tags/v${GLYPH_PV}.tar.gz -> glyph-${GLYPH_PV}.gh.tar.gz"
#S="${WORKDIR}/glass-${PV}"

LICENSE="Unlicense"
SLOT="0"
KEYWORDS="-* amd64"

BDEPEND="dev-lang/nasm"
RDEPEND="media-fonts/font-misc-misc"

#src_prepare() {
#	eapply "${FILESDIR}/${PN}-0.3.43-selection-extract-oob.patch"
#	eapply "${FILESDIR}/${PN}-0.3.43-gc-bg-alpha-argb.patch"
#	eapply_user
#}

src_unpack() {
	default
	# glass.asm does: %include "../glyph/glyph.asm"
	mv "${WORKDIR}/glyph-${GLYPH_PV}" "${WORKDIR}/glyph" || die
}

src_compile() {
	emake glass
}

src_install() {
	dobin glass
}