summaryrefslogtreecommitdiff
path: root/dev-lang/dzaima-bqn/dzaima-bqn-0.2.1.ebuild
blob: de1b210a761b873a88635e606b246fccc11185c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit edo java-pkg-2

DESCRIPTION="A BQN language implementation written in Java, also know as dbqn"
HOMEPAGE="https://github.com/dzaima/BQN/"

if [[ ${PV} == *9999* ]] ; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/dzaima/BQN.git"
else
	SRC_URI="https://github.com/dzaima/BQN/archive/v${PV}.tar.gz
		-> ${P}.tar.gz"
	S="${WORKDIR}/BQN-${PV}"
	KEYWORDS="amd64 ~x86"
fi

LICENSE="MIT"
SLOT="0"

RDEPEND=">=virtual/jre-1.8"
DEPEND=">=virtual/jdk-1.8"

BUILD_DIR="${WORKDIR}/${P}_BuildDir"
BUILD_JAR="${BUILD_DIR}/dbqn.jar"

DOCS=( readme.md )

src_prepare() {
	default
	java-pkg-2_src_prepare

	mkdir -p "${BUILD_DIR}" || die
}

src_compile() {
	# This is the "build8" (or "build") script rewritten for our purposes.

	ejavac -d "${BUILD_DIR}" $(find ./src -name "*.java")

	cd "${BUILD_DIR}" || die
	edob jar cvfe "${BUILD_JAR}" BQN.Main BQN
}

src_test() {
	edob java -jar "${BUILD_JAR}" -f "${S}"/test/test
}

src_install() {
	java-pkg_dojar "${BUILD_JAR}"
	java-pkg_dolauncher dbqn --jar dbqn.jar

	einstalldocs
}

pkg_postinst() {
	einfo "The ${CATEGORY}/${PN} installs the main executable under the name \"dbqn\"."
}