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

EAPI=8

DESCRIPTION="LinApple II - Apple ][ Emulator for Linux"
HOMEPAGE="https://github.com/linappleii/linapple"

inherit git-r3

EGIT_REPO_URI="https://github.com/linappleii/linapple.git"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"

# Maintainer information
MAINTAINER="Ognjan Kirilov Iordanov <iordanov@gmx.de>"

# Abhängigkeiten für das Build
DEPEND="
    dev-libs/libzip
    media-libs/sdl-image
    x11-libs/libX11
"

#src_unpack() {
#    git clone "${EGIT_REPO_URI}" "${S}"
#}

src_prepare() {
    default
}

src_compile() {
    emake
}

src_install() {
	emake DESTDIR="${D}/usr/bin" install "${S}/build/bin/linapple"
	emake DESTDIR="${D}/etc/linapple" install "${S}/build/etc/linapple/linapple.conf"
	emake DESTDIR="${D}/usr/share/linapple" install "${S}/build/share/linapple/Master.dsk"
}

pkg_postinst() {
    elog "To run LinApple II, type 'linapple' in the terminal."
    elog "You may want to consult the LinApple II documentation for configuration options."
}