Package Details: mindustry 160.6-1

Git Clone URL: https://aur.archlinux.org/mindustry.git (read-only, click to copy)
Package Base: mindustry
Description: A sandbox tower defense game
Upstream URL: https://github.com/Anuken/Mindustry
Licenses: GPL-3.0-only
Submitter: dmitmel
Maintainer: xiota (chaotic-aur)
Last Packager: chaotic-aur
Votes: 39
Popularity: 1.01
First Submitted: 2019-10-10 21:43 (UTC)
Last Updated: 2026-10-07 03:08 (UTC)

Dependencies (4)

Required by (0)

Sources (2)

Latest Comments

1 2 3 4 5 6 7 Next › Last »

xiota commented on 2026-09-28 09:59 (UTC)

@joemaro Did you try clearing cache and resyncing before rebuild?

xiota commented on 2026-05-28 19:44 (UTC)

@Reycko I'll consider it if it solves a real problem, but right now I don't see any benefit. The script would still be complicated to avoid the problem people were having.

Reycko commented on 2026-05-28 06:45 (UTC)

Thank you for creating this :) I feel as if this PKGBUILD could take advantage of the archlinux-java tool to detect a java 17 runtime instead of using a hardcoded assumption of openjdk Something like

archlinux-java status | awk '/'"$_java_ver"'/ {print $1}'

should do the trick

dotdmp commented on 2026-05-10 10:45 (UTC)

As previously reported, the application fails to start with Java25, even though it is actually installed.

The issue lies in the shell startup script: /usr/bin/mindustry. The program successfully finds the installed Java25, saves its path in the JAVA_HOME shell variable, but then still launches default Java:

exec /usr/bin/java -jar /usr/share/java/mindustry/mindustry.jar "$@"

To fix update the launcher script changing the last line to: exec "$JAVA_HOME/bin/java" \ -jar /usr/share/java/mindustry/mindustry.jar "$@"


Full fixed script /usr/bin/mindustry:

#!/usr/bin/env bash

_java_ver=25
_best=""

for d in /usr/lib/jvm/java-*-openjdk; do
    if [ -d "$d" ]; then
        n=$(grep -Pom1 'java-\K[0-9]+' <<< "$d")

        if (( n >= _java_ver )); then
            _best="$d"
            break
        fi
    fi
done

if [ -z "$_best" ]; then
    echo "No compatible Java version found."
    exit 1
fi

export JAVA_HOME="$_best"

exec "$JAVA_HOME/bin/java" \
    -jar /usr/share/java/mindustry/mindustry.jar "$@"

oring commented on 2026-04-01 03:56 (UTC)

i'm having the exact issue fibonacci is

FibonacciEffect commented on 2026-02-19 10:20 (UTC)

When I am starting mindustry, I get the message that java 25 is required but java 8 is installed. I tried clean building the package build. As far as I can see in pacman the build installs java-runtime. Is it possible to record the java dependency more precisely?

xiota commented on 2025-01-18 16:41 (UTC)

@Pavlov. Please let that be your last comment on this non-issue. Edit your last comment if you need to revise your alternate PKGBUILD.

Pavlov commented on 2025-01-18 15:36 (UTC) (edited on 2025-01-18 15:39 (UTC) by Pavlov)

PKGBUILD

pkgbase="mindustry"
pkgname=("mindustry" "mindustry-server" "mindustry-icons")
pkgver="146"
pkgrel=1
pkgdesc="A sandbox tower defense game"
url="https://github.com/Anuken/Mindustry"
license=('GPL-3.0-only')
arch=('any')

depends=('hicolor-icon-theme' 'java-runtime')
makedepends=(
  'alsa-lib'
  'archlinux-java-run'
  'java-environment=17'
  'libicns'
  'gradle'
)

_pkgsrc="Mindustry-$pkgver"
_pkgsrc_arc="Arc-$pkgver"
source=(
  "${pkgbase}-${pkgver}.tar.gz"::"https://github.com/Anuken/Mindustry/archive/v${pkgver}.tar.gz"
  "${pkgbase}-arc-${pkgver}.tar.gz"::"https://github.com/Anuken/Arc/archive/refs/tags/v${pkgver}.tar.gz"
  "mindustry.sh.template"
  "mindustry.desktop.template"
)
b2sums=('9b299e478439fa9db6dc3ca46723e66393513101e236e62ed8bea8c3ec844de1eecf498fb0de2bef3f89ab3b4a2ba416f48abc677e505089c71ee2bb6e6e38a0'
        '01da117c758b861eb5d755ea3aef094905db7901c56dd5f53314d5420671b4da32c91db82d142f601340f500f86b859dc51cb067b9bdad3594108bb9458899ba'
        '86ceb4b207b9651b51f0201f76f2ee365e16e2fa29c2394570a19a36ecfaca63b566b074f7a16b4d1fcbce2b8c64f60a92b4519c7f8c6d99440a7ec91d0588fc'
        '36062279c09468b2de3d978812738113dc9ad50797b96f0ba24d61fe0eb0f7c708bc1b3cbef70a51c89a1bd9a6d80ba6fd2a5769968d02722f8eb198714f2272')

prepare() {
  ln -sf "$_pkgsrc_arc" "${srcdir}/Arc"
  cd "$_pkgsrc"
  gawk -i inplace -v MYVER="$pkgver" '{sub(/^archash=.*$/,"archash=v"MYVER); print $0}' gradle.properties
}

build() {
  mkdir -p "${srcdir}/$_pkgsrc/gradle_user_home"
  export GRADLE_USER_HOME="${srcdir}/$_pkgsrc/gradle_user_home"
  cd "$_pkgsrc"

  # skip android subproject; see settings.gradle
  unset ANDROID_HOME JITPACK

  JAVA_HOME=$(archlinux-java-run --min 17 --max 17 --feature jdk --java-home) gradle --info --no-daemon -Pbuildversion="${pkgver}" dist desktop:dist server:dist

  cd core/assets/icons
  icns2png --extract icon.icns
}

package_mindustry-icons() {
    pkgdesc="A sandbox tower defense game - icons"
    cd "$_pkgsrc"
    local icon_size
    for icon_size in 256 512 1024; do
      install -Dm644 "core/assets/icons/icon_${icon_size}x${icon_size}x32.png" "${pkgdir}/usr/share/icons/hicolor/${icon_size}x${icon_size}/apps/mindustry.png"
    done
}

package_mindustry() {
    depends+=('mindustry-icons')
    pkgdesc="A sandbox tower defense game"
    gawk '{gsub(/%JARNAME%/, "Mindustry"); print $0}' mindustry.sh.template > mindustry.sh
    gawk '{gsub(/%APPNAME%/, "Mindustry"); gsub(/%APPDESC%/, "A sandbox tower defense game"); gsub(/%APPPATH%/, "/usr/bin/mindustry.sh"); gsub(/%APPICON%/, "mindustry"); print $0}' mindustry.desktop.template > mindustry.desktop
    install -Dm755 mindustry.sh "$pkgdir/usr/bin/mindustry.sh"
    install -Dm644 mindustry.desktop "$pkgdir/usr/share/applications/mindustry.desktop"
    rm mindustry.sh
    rm mindustry.desktop
    cd "$_pkgsrc"
    install -Dm755 "desktop/build/libs/Mindustry.jar" "$pkgdir/usr/share/java/mindustry/Mindustry.jar"
}

package_mindustry-server() {
    depends+=('mindustry-icons')
    pkgdesc="A sandbox tower defense game - server"
    gawk '{gsub(/%JARNAME%/, "MindustryServer"); print $0}' mindustry.sh.template > mindustry-server.sh
    gawk '{gsub(/%APPNAME%/, "Mindustry Server"); gsub(/%APPDESC%/, "A sandbox tower defense game - server"); gsub(/%APPPATH%/, "/usr/bin/mindustry-server.sh"); gsub(/%APPICON%/, "mindustry"); print $0}' mindustry.desktop.template > mindustry-server.desktop
    install -Dm755 mindustry-server.sh "$pkgdir/usr/bin/mindustry-server.sh"
    install -Dm644 mindustry-server.desktop "$pkgdir/usr/share/applications/mindustry-server.desktop"
    rm mindustry-server.sh
    rm mindustry-server.desktop
    cd "$_pkgsrc"
    install -Dm755 "desktop/build/libs/server-release.jar" "$pkgdir/usr/share/java/mindustry/MindustryServer.jar"
}

mindustry.sh.template

#!/usr/bin/env sh
exec /usr/bin/java -jar /usr/share/java/mindustry/%JARNAME%.jar "\$@"

mindustry.desktop.template

[Desktop Entry]
Type=Application
Name=%APPNAME%
Comment=%APPDESC%
Exec=%APPPATH%
Icon=%APPICON%
Categories=Game;
Terminal=false

There are still some things to modify, but just as is is far way better than your own, and doesn't use any eval or dynamically generated bash code and generates correct .SRCINFO information. You can still improve it, for example removing java-runtime from mindustry-icons dependencies.