From: MIvanchev <MIvanchev@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [WIP] New package: mindustry-7.0_b146
Date: Thu, 24 Oct 2024 09:16:02 +0200 [thread overview]
Message-ID: <20241024071602.B63012FB10@inbox.vuxu.org> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-52749@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 710 bytes --]
There is an updated pull request by MIvanchev against master on the void-packages repository
https://github.com/MIvanchev/void-packages ci-mindustry
https://github.com/void-linux/void-packages/pull/52749
[WIP] New package: mindustry-7.0_b146
#### Testing the changes
- I tested the changes in this PR: **YES**
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**
#### Local build testing
- I built this PR locally for my native architecture, (X86_64-GLIBC)
Solves #38019, #45582.
A patch file from https://github.com/void-linux/void-packages/pull/52749.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci-mindustry-52749.patch --]
[-- Type: text/x-diff, Size: 8765 bytes --]
From e1654674ec9ebddbd388736d8c45dc0480e90c48 Mon Sep 17 00:00:00 2001
From: Mihail Ivanchev <contact@ivanchev.net>
Date: Wed, 3 Apr 2024 17:05:39 +0200
Subject: [PATCH] New package: mindustry-7.0_b146
---
srcpkgs/mindustry-server | 1 +
srcpkgs/mindustry/files/mindustry | 2 +
srcpkgs/mindustry/files/mindustry-server | 2 +
srcpkgs/mindustry/patches/local-arc.patch | 114 ++++++++++++++++++++++
srcpkgs/mindustry/template | 67 +++++++++++++
5 files changed, 186 insertions(+)
create mode 120000 srcpkgs/mindustry-server
create mode 100644 srcpkgs/mindustry/files/mindustry
create mode 100644 srcpkgs/mindustry/files/mindustry-server
create mode 100644 srcpkgs/mindustry/patches/local-arc.patch
create mode 100644 srcpkgs/mindustry/template
diff --git a/srcpkgs/mindustry-server b/srcpkgs/mindustry-server
new file mode 120000
index 00000000000000..9eaea683d630ea
--- /dev/null
+++ b/srcpkgs/mindustry-server
@@ -0,0 +1 @@
+mindustry
\ No newline at end of file
diff --git a/srcpkgs/mindustry/files/mindustry b/srcpkgs/mindustry/files/mindustry
new file mode 100644
index 00000000000000..392ab236e52782
--- /dev/null
+++ b/srcpkgs/mindustry/files/mindustry
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/bin/java -jar /usr/share/mindustry/Mindustry.jar "$@"
diff --git a/srcpkgs/mindustry/files/mindustry-server b/srcpkgs/mindustry/files/mindustry-server
new file mode 100644
index 00000000000000..abbde29b1db716
--- /dev/null
+++ b/srcpkgs/mindustry/files/mindustry-server
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/bin/java -jar /usr/share/mindustry/server-release.jar "$@"
diff --git a/srcpkgs/mindustry/patches/local-arc.patch b/srcpkgs/mindustry/patches/local-arc.patch
new file mode 100644
index 00000000000000..fe0f3569d48d53
--- /dev/null
+++ b/srcpkgs/mindustry/patches/local-arc.patch
@@ -0,0 +1,114 @@
+diff '--color=auto' -Naur a/build.gradle b/build.gradle
+--- a/build.gradle 2024-10-22 17:02:02.872062571 +0200
++++ b/build.gradle 2024-10-21 16:04:59.582642809 +0200
+@@ -1,10 +1,14 @@
+ buildscript{
+ ext{
+- getArcHash = {
+- return new Properties().with{ p -> p.load(file('gradle.properties').newReader()); return p }["archash"]
+- }
++ arcHash = property("archash")
++
++ localArc = !project.hasProperty("release") && new File(rootDir.parent, 'Arc').exists() && !project.hasProperty("noLocalArc")
+
+- arcHash = getArcHash()
++ arcModule = { String name ->
++ //skip to last submodule
++ name = name.substring(name.lastIndexOf(':') + 1)
++ return "com.github.Anuken${localArc ? "" : ".Arc"}:$name:$arcHash"
++ }
+ }
+
+ repositories{
+@@ -16,8 +20,8 @@
+ }
+
+ dependencies{
+- classpath "com.github.Anuken.Arc:packer:$arcHash"
+- classpath "com.github.Anuken.Arc:arc-core:$arcHash"
++ classpath arcModule(":extensions:packer")
++ classpath arcModule(":arc-core")
+ }
+ }
+
+@@ -48,20 +52,6 @@
+ return new File(projectDir.parent, '../Mindustry-Debug').exists() && !project.hasProperty("release") && project.hasProperty("args")
+ }
+
+- localArc = {
+- return !project.hasProperty("release") && !project.hasProperty("noLocalArc") && new File(projectDir.parent, '../Arc').exists()
+- }
+-
+- arcModule = { String name ->
+- if(localArc()){
+- return project(":Arc:$name")
+- }else{
+- //skip to last submodule
+- if(name.contains(':')) name = name.split(':').last()
+- return "com.github.Anuken.Arc:$name:${getArcHash()}"
+- }
+- }
+-
+ generateDeployName = { String platform ->
+ if(platform == "windows"){
+ platform += "64"
+@@ -331,8 +321,8 @@
+ api arcModule("extensions:fx")
+ api arcModule("extensions:arcnet")
+ api "com.github.Anuken:rhino:$rhinoVersion"
+- if(localArc() && debugged()) api arcModule("extensions:recorder")
+- if(localArc()) api arcModule(":extensions:packer")
++ if(localArc && debugged()) api arcModule("extensions:recorder")
++ if(localArc) api arcModule(":extensions:packer")
+
+ annotationProcessor 'com.github.Anuken:jabel:0.9.0'
+ compileOnly project(":annotations")
+@@ -423,7 +413,7 @@
+
+ dependencies{
+ implementation 'com.squareup:javapoet:1.12.1'
+- implementation "com.github.Anuken.Arc:arc-core:$arcHash"
++ implementation arcModule("arc-core")
+ }
+ }
+
+diff '--color=auto' -Naur a/settings.gradle b/settings.gradle
+--- a/settings.gradle 2024-10-22 17:02:31.778129695 +0200
++++ b/settings.gradle 2024-10-22 17:04:44.499440184 +0200
+@@ -34,33 +34,9 @@
+ }
+
+ if(!hasProperty("release")){
+- if(new File(settingsDir, '../Arc').exists()){
+- use(
+- ':Arc',
+- ':Arc:arc-core',
+- ':Arc:extensions',
+- ':Arc:extensions:freetype',
+- ':Arc:extensions:recorder',
+- ':Arc:extensions:arcnet',
+- ':Arc:extensions:packer',
+- ':Arc:extensions:g3d',
+- ':Arc:extensions:fx',
+- ':Arc:extensions:flabel',
+- ':Arc:extensions:discord',
+- ':Arc:extensions:profiling',
+- ':Arc:natives',
+- ':Arc:natives:natives-desktop',
+- ':Arc:natives:natives-android',
+- ':Arc:natives:natives-ios',
+- ':Arc:natives:natives-freetype-desktop',
+- ':Arc:natives:natives-freetype-android',
+- ':Arc:natives:natives-freetype-ios',
+- ':Arc:backends',
+- ':Arc:backends:backend-sdl',
+- ':Arc:backends:backend-android',
+- ':Arc:backends:backend-robovm',
+- ':Arc:backends:backend-headless'
+- )
++ if(new File(rootDir.parent, 'Arc').exists()){
++ println("Compiling with localArc")
++ includeBuild("../Arc")
+ }
+
+ if(new File(settingsDir, '../Mindustry-Debug').exists()){
diff --git a/srcpkgs/mindustry/template b/srcpkgs/mindustry/template
new file mode 100644
index 00000000000000..57afbcc81e6792
--- /dev/null
+++ b/srcpkgs/mindustry/template
@@ -0,0 +1,67 @@
+# Template file for 'mindustry'
+pkgname=mindustry
+version=7.0.b146
+revision=1
+_build=${version##*.b}
+hostmakedepends="openjdk17"
+makedepends="cross-i686-w64-mingw32 cross-x86_64-w64-mingw32 alsa-lib-devel libdrm-devel SDL2-devel libgbm-devel"
+depends="virtual?java-runtime desktop-file-utils hicolor-icon-theme"
+short_desc="Automation tower defense RTS"
+maintainer="Mihail Ivanchev <contact@ivanchev.net>"
+license="GPL-3.0-or-later"
+homepage="https://mindustrygame.github.io/"
+distfiles="https://github.com/Anuken/Arc/archive/refs/tags/v${_build}.tar.gz>Arc.tar.gz
+ https://github.com/Anuken/Mindustry/archive/refs/tags/v${_build}.tar.gz>Mindustry.tar.gz"
+checksum="30cc1b00968aaec8dbb76a2dad6439c7d7418970fafe24c350b2be4e68c3e5d6
+ aa1684d87d9f3e1d1a2da415b5e055ea6493fe31398748447927bd903019adbd"
+skip_extraction="Arc.tar.gz Mindustry.tar.gz"
+build_wrksrc=Mindustry-${_build}
+patch_args="-Np1 --directory=${build_wrksrc}"
+
+# TODO: Make sure this template doesn't download anything. Currently not possible
+# because Void's Gradle version is incompatible.
+
+# TODO: Mindustry will not run on JRE<17, but we have no way to check this because
+# virtual?java-runtime>=17 doesn't seem to work.
+
+case "$XBPS_TARGET_MACHINE" in
+ i686*) broken="Couldn't load shared library 'libarc.so' for target: Linux, 32-bit" ;;
+ *-musl) broken="Couldn't load shared library 'libarc64.so' for target: Linux, 64-bit" ;;
+esac
+
+# JAVA_HOME needs to be set because otherwise gradle fails to find Java.
+
+export JAVA_HOME=/usr/lib/jvm/openjdk17
+
+post_extract() {
+ vsrcextract -C Arc Arc.tar.gz
+ vsrcextract -C ${build_wrksrc} Mindustry.tar.gz
+}
+
+do_build() {
+ pushd ../Arc
+ ./gradlew arc-core:jnigenBuild
+ ./gradlew extensions:freetype:jnigenBuild
+ cp arc-core/libs/*/* natives/natives-desktop/libs/
+ cp extensions/freetype/libs/*/* natives/natives-freetype-desktop/libs/
+ popd
+
+ ./gradlew --no-daemon dist -Pbuildversion="${_build}" desktop:dist server:dist
+}
+
+do_install() {
+ vmkdir usr/share/mindustry
+ vinstall desktop/build/libs/Mindustry.jar 644 usr/share/mindustry
+ vbin ${FILESDIR}/mindustry
+ vinstall core/assets/icons/icon_64.png 644 usr/share/icons/hicolor/64x64/apps mindustry.png
+}
+
+mindustry-server_package() {
+ short_desc+=" (server)"
+ pkg_install() {
+ vmkdir usr/share/mindustry
+ vinstall server/build/libs/server-release.jar 644 usr/share/mindustry
+ vbin ${FILESDIR}/mindustry-server
+ vinstall core/assets/icons/icon_64.png 644 usr/share/icons/hicolor/64x64/apps mindustry-server.png
+ }
+}
next prev parent reply other threads:[~2024-10-24 7:16 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-23 11:46 [PR PATCH] " MIvanchev
2024-10-23 12:17 ` MIvanchev
2024-10-23 12:17 ` MIvanchev
2024-10-23 12:18 ` [PR PATCH] [Updated] " MIvanchev
2024-10-23 12:19 ` MIvanchev
2024-10-23 12:23 ` MIvanchev
2024-10-23 12:28 ` MIvanchev
2024-10-23 14:56 ` Johnnynator
2024-10-23 15:03 ` Johnnynator
2024-10-23 15:03 ` Johnnynator
2024-10-23 15:14 ` MIvanchev
2024-10-23 15:15 ` MIvanchev
2024-10-23 15:21 ` Johnnynator
2024-10-23 15:46 ` Johnnynator
2024-10-23 15:55 ` MIvanchev
2024-10-23 17:38 ` [PR PATCH] [Updated] " MIvanchev
2024-10-23 17:42 ` MIvanchev
2024-10-24 6:51 ` [PR PATCH] [Updated] [WIP] " MIvanchev
2024-10-24 7:12 ` MIvanchev
2024-10-24 7:13 ` MIvanchev
2024-10-24 7:16 ` MIvanchev [this message]
2024-10-24 7:19 ` MIvanchev
2024-10-24 7:29 ` MIvanchev
2024-10-24 7:31 ` MIvanchev
2024-10-24 7:35 ` [PR PATCH] [Updated] " MIvanchev
2025-01-23 1:57 ` github-actions
2025-01-23 8:03 ` MIvanchev
2025-04-24 2:08 ` github-actions
2025-04-24 7:45 ` MIvanchev
-- strict thread matches above, loose matches on Subject: below --
2024-04-03 15:09 [PR PATCH] [WIP] " MIvanchev
2024-04-03 15:19 ` [PR PATCH] [Updated] " MIvanchev
2024-04-03 15:27 ` MIvanchev
2024-04-03 15:37 ` MIvanchev
2024-04-03 15:47 ` MIvanchev
2024-04-03 17:42 ` MIvanchev
2024-04-03 17:49 ` MIvanchev
2024-04-03 17:53 ` MIvanchev
2024-04-03 17:57 ` MIvanchev
2024-04-03 17:57 ` MIvanchev
2024-04-03 18:00 ` MIvanchev
2024-04-03 18:03 ` MIvanchev
2024-04-03 18:09 ` MIvanchev
2024-04-03 18:34 ` MIvanchev
2024-04-03 18:42 ` MIvanchev
2024-04-04 6:49 ` MIvanchev
2024-04-05 7:40 ` MIvanchev
2024-04-15 13:56 ` MIvanchev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241024071602.B63012FB10@inbox.vuxu.org \
--to=mivanchev@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).