linamh/sci-electronics/digital/digital-0.29.ebuild
2022-07-19 17:19:29 +02:00

69 lines
1.5 KiB
Bash

# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit java-pkg-2 xdg-utils
DESCRIPTION="Digital is an easy-to-use digital logic designer and circuit simulator designed for educational purposes."
HOMEPAGE="https://github.com/hneemann/Digital"
SRC_URI="https://github.com/hneemann/Digital/releases/download/v${PV}/Digital.zip -> ${P}.zip"
LICENSE="GPL-3"
RESTRICT=""
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
RDEPEND=">=virtual/jre-1.6
dev-util/desktop-file-utils
"
S="${WORKDIR}/Digital"
pkg_setup() { :; }
src_compile() { :; }
src_install() {
local dir="/opt/${PN}"
# buggy binary crap also requires the demo dir ??
insinto "${dir}"
doins -r examples lib
java-pkg_jarinto "${dir}"
java-pkg_dojar Digital.jar
into "${dir}"
java-pkg_dolauncher ${PN} \
--main "de.neemann.digital.gui.Main" \
--java_args "-Xss4m -Xmx512m"
# for direct run without creating an env.d file link them
dodir /opt/bin
dosym ${dir}/bin/${PN} /opt/bin/${PN}
dodoc docu/* *.txt *.me
newicon icon.svg ${PN}.svg
sed -e "s,<EXEC_LOCATION>,${dir}/bin/${PN},g" \
-e "s,<ICON_LOCATION>,${PN},g" "${S}/linux/desktop.template" > "${S}/${PN}.desktop"
domenu ${PN}.desktop
# Install mime info (from Ubuntu)
insinto /usr/share/mime/packages/
doins "linux/digital-simulator.xml"
}
pkg_postinst() {
xdg_desktop_database_update
xdg_mimeinfo_database_update
}
pkg_postrm() {
xdg_desktop_database_update
xdg_mimeinfo_database_update
}