Package Details: mindustry-server 155.4-2

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

Dependencies (5)

Required by (0)

Sources (2)

Latest Comments

1 2 3 4 5 6 Next › Last »

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.

xiota commented on 2025-01-17 16:28 (UTC) (edited on 2025-01-17 16:34 (UTC) by xiota)

The per-package metadata changes, like depends, would be missing. Manually editing .SRCINFO is generally considered bad practice.

Maintainers have no "duty to prove" anything. It is user responsibility to review PKGBUILDs before building. Good job. Now, if you find an actual problem, I'll fix it. But if you just don't like how it's written, no one is forcing you to build it.

Pavlov commented on 2025-01-17 16:00 (UTC)

Can you explain how without eval an incorrect .SRCINFO would be generated, and why you can not provide you own .SRCINFO if the one automatically generated by makepkg doesn't satisfies your expectations?

Linux is a package provided in Arch official repository, therefore the Arch team guarantees that it is secure and follows the official guidelines. Your package is in AUR, where everyone can upload (almost) whatever they want without a previous authorization, therefore it is your duty to prove that your package is safe and your imaginative Bash artifacts don't help in that sense (moreover, some variables aren't even defined).

Since there are only two packages associated to this pkgbase it doesn't seem too expensive writing them both.

xiota commented on 2025-01-17 15:07 (UTC)

Without eval, incorrect .SRCINFO would be generated. Consider using a different distro if it bothers you. See "voluntary obfuscation" in extra/linux and extra/linux-lts.

Sourcing arbitrary external files makes the package "difficult to analyze or even unreadable, which can be interpreted as voluntary obfuscation."

Pavlov commented on 2025-01-17 13:06 (UTC) (edited on 2025-01-17 13:08 (UTC) by Pavlov)

for _p in "${pkgname[@]}"; do
  eval "package_$_p() {
    $(declare -f "_package_common" | tail -n +2)
    $(declare -f "_package_${_p#$_pkgtype}" | tail -n +2)
  }"
done

You should avoid to use eval since it makes the PKGBUILD difficult to analyze or even unreadable, which can be interpreted as voluntary obfuscation.

install -Dm755 /dev/stdin "$pkgdir/usr/share/applications ${pkgname#$_pkgtype}.desktop" << END
[Desktop Entry]
Type=Application
Name=$(sed -E -e "s/-/ /g;s/\b(.)/\u\1/g" <<< "${pkgname#$_pkgtype}")
Comment=$pkgdesc
Exec=${pkgname#$_pkgtype}
Icon=${pkgname#$_pkgtype}
Categories=Game;
Terminal=false
END

  install -Dm755 /dev/stdin "$pkgdir/usr/bin/${pkgname#$_pkgtype}" << END
#!/usr/bin/env sh
exec /usr/bin/java -jar /usr/share/java/$_pkgname/${pkgname#$_pkgtype}.jar "\$@"
END

You should put them in a different file sourced in source field and use sed to replace the relevant parts instead of putting everything in the PKGBUILD`.

Pavlov commented on 2024-05-23 21:57 (UTC)

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'Mindustry-146'.
> Could not resolve all files for configuration ':classpath'.
   > Could not find com.github.Anuken.Arc:packer:152e49944a.
     Searched in the following locations:
       - file:/home/loara/.m2/repository/com/github/Anuken/Arc/packer/152e49944a/packer-152e49944a.pom
       - https://repo.maven.apache.org/maven2/com/github/Anuken/Arc/packer/152e49944a/packer-152e49944a.pom
       - https://dl.google.com/dl/android/maven2/com/github/Anuken/Arc/packer/152e49944a/packer-152e49944a.pom
       - https://oss.sonatype.org/content/repositories/snapshots/com/github/Anuken/Arc/packer/152e49944a/packer-152e49944a.pom
       - https://jitpack.io/com/github/Anuken/Arc/packer/152e49944a/packer-152e49944a.pom
       - https://plugins.gradle.org/m2/com/github/Anuken/Arc/packer/152e49944a/packer-152e49944a.pom
     Required by:
         project :
   > Could not find com.github.Anuken.Arc:arc-core:152e49944a.
     Searched in the following locations:
       - file:/home/loara/.m2/repository/com/github/Anuken/Arc/arc-core/152e49944a/arc-core-152e49944a.pom
       - https://repo.maven.apache.org/maven2/com/github/Anuken/Arc/arc-core/152e49944a/arc-core-152e49944a.pom
       - https://dl.google.com/dl/android/maven2/com/github/Anuken/Arc/arc-core/152e49944a/arc-core-152e49944a.pom
       - https://oss.sonatype.org/content/repositories/snapshots/com/github/Anuken/Arc/arc-core/152e49944a/arc-core-152e49944a.pom
       - https://jitpack.io/com/github/Anuken/Arc/arc-core/152e49944a/arc-core-152e49944a.pom
       - https://plugins.gradle.org/m2/com/github/Anuken/Arc/arc-core/152e49944a/arc-core-152e49944a.pom
     Required by:
         project :

Arc should be added as dependency. Moreover, Mindustry doesn't support Java >= 18 so you should replace

archlinux-java-run --min 16 --feature jdk --java-home

with

archlinux-java-run --min 16 --max 17 --feature jdk --java-home

dmitmel commented on 2024-02-28 10:17 (UTC)

Uh, I suppose Java versions that are too new are not supported by the Gradle version Mindustry is using, try compiling with an older JDK