summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmytro Meleshko2024-01-03 20:04:24 +0100
committerDmytro Meleshko2024-01-03 20:04:24 +0100
commit202b601c2fb4f99ec017abfcb76ad183e825e23f (patch)
tree22195e1f56891b7e872e6f7f98e502cdda6416f0
parent71e5e3ec52fe2be57ef5d0950f0a7ee9d135b39e (diff)
downloadaur-202b601c2fb4f99ec017abfcb76ad183e825e23f.tar.gz
use archlinux-java-run to select a suitable JDK for compilation
-rw-r--r--.SRCINFO3
-rw-r--r--PKGBUILD39
2 files changed, 6 insertions, 36 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d6f7ae884fb6..8d4189c90694 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = mindustry
pkgver = 7.0_146
- pkgrel = 1
+ pkgrel = 2
epoch = 1
url = https://github.com/Anuken/Mindustry
arch = any
@@ -8,6 +8,7 @@ pkgbase = mindustry
makedepends = java-environment>=16
makedepends = libicns
makedepends = alsa-lib
+ makedepends = archlinux-java-run
depends = java-runtime>=8
depends = sh
depends = hicolor-icon-theme
diff --git a/PKGBUILD b/PKGBUILD
index ef1bec103a18..29f34efb8c07 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,14 +3,14 @@ pkgbase=mindustry
pkgname=("${pkgbase}" "${pkgbase}-server")
_build=146
pkgver="7.0_${_build}"
-pkgrel=1
+pkgrel=2
epoch=1
arch=('any')
_repo_name="Mindustry"
url="https://github.com/Anuken/${_repo_name}"
license=('GPL3')
depends=("java-runtime>=8" "sh" "hicolor-icon-theme")
-makedepends=("java-environment>=16" "libicns" "alsa-lib")
+makedepends=("java-environment>=16" "libicns" "alsa-lib" "archlinux-java-run")
source=("${pkgbase}-${_build}.tar.gz::https://github.com/Anuken/${_repo_name}/archive/v${_build}.tar.gz"
"${pkgbase}.desktop"
"${pkgbase}.sh"
@@ -25,44 +25,13 @@ sha256sums=('aa1684d87d9f3e1d1a2da415b5e055ea6493fe31398748447927bd903019adbd'
build() {
cd "${_repo_name}-${_build}"
- # NOTE: JDK discovery code is not needed for now because the upstream switched
- # to Gradle 6.x. Keeping it just in case.
-
- # # find JDK older than 13 because Gradle 5.x doesn't support it
- # for java_dir in /usr/lib/jvm/*; do
- # if ! [ -x "${java_dir}/bin/java" ]; then break; fi
-
- # if [ -f "${java_dir}/release" ]; then
- # version="$(sed -n 's/^JAVA_VERSION="\(.*\)"$/\1/p' "${java_dir}/release")"
- # elif [ -f "${java_dir}/jre/lib/rt.jar" ]; then
- # version="$(unzip -p "${java_dir}/jre/lib/rt.jar" META-INF/MANIFEST.MF | sed -n 's/Implementation-Version: 1\.\(.*\)$/\1/p')"
- # else
- # break
- # fi
-
- # if [ -z "${version}" ]; then break; fi
-
- # if [ "$(vercmp "${version}" 8)" -ge 0 ] && [ "$(vercmp "${version}" 13)" -lt 0 ]; then
- # msg2 "Using JDK v%s from %s" "${version}" "${java_dir}"
- # msg2 "Edit the PKGBUILD if you wish to change the JDK used to compile %s" "${pkgbase}"
- # found_correct_jdk=1
- # break
- # fi
- # done; unset version
-
- # if [ -n "$found_correct_jdk" ]; then
- # export JAVA_HOME="${java_dir}"
- # else
- # error "Couldn't find a JDK with version >=8 and <13"
- # return 1
- # fi
-
# Skip configuring of the android subproject because we aren't compiling the
# Android app here.
# <https://github.com/Anuken/Mindustry/blob/00e3a59463f41bdce5b12cf5b4715a253f7af306/settings.gradle#L14>
unset ANDROID_HOME
- ./gradlew --no-daemon dist -Pbuildversion="${_build}" desktop:dist server:dist
+ JAVA_HOME=$(archlinux-java-run --min 16 --feature jdk --java-home) \
+ ./gradlew --no-daemon dist -Pbuildversion="${_build}" desktop:dist server:dist
cd core/assets/icons
icns2png --extract icon.icns