Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mindustry: 126.2 → 140.4 #200743

Merged
merged 2 commits into from
Nov 18, 2022
Merged

mindustry: 126.2 → 140.4 #200743

merged 2 commits into from
Nov 18, 2022

Conversation

chkno
Copy link
Member

@chkno chkno commented Nov 11, 2022

Description of changes

This is the big update, releasing the last 1.5 years of development out of beta, with the new planet Erekir: https://store.steampowered.com/news/app/1127400/view/3415444546227810671

Also, get back to using the latest Java and gradle versions (as enabled and required by Anuken/Mindustry#5114 )

Also, eliminate more (maybe the last of?) uses of binaries-not-built-here.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

This is follow-up from #198323

FYI:
Mindustry maintainer @fgaz
Other folks that have done mindustry version bumps @maxhbr @Mindavi

Copy link
Member

@fgaz fgaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thank you! What about adding yourself to meta.maintainers?

Copy link
Member

@pyrox0 pyrox0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Mindavi
Copy link
Contributor

Mindavi commented Nov 13, 2022

Great that you managed to get this all building! Didn't test (yet), but the diff looks good on a first look.

@twitchyliquid64
Copy link

I was able to build this and test it successfully on an online server! Unfortunately the audio didnt work.

Debugging with:

diff --git a/pkgs/games/mindustry/default.nix b/pkgs/games/mindustry/default.nix
index 51d8577caa7..5bad0196007 100644
--- a/pkgs/games/mindustry/default.nix
+++ b/pkgs/games/mindustry/default.nix
@@ -159,6 +161,7 @@ stdenv.mkDerivation rec {
     sed -ie "/curl.*glew/{;s#curl -o #cp ${glewSource} #;s# -L http.*\.zip##;}" Arc/backends/backend-sdl/build.gradle
     sed -ie "/curl.*sdlmingw/{;s#curl -o #cp ${SDLmingwSource} #;s# -L http.*\.tar.gz##;}" Arc/backends/backend-sdl/build.gradle

+    sed -ie "s#-DWITH_MINIAUDIO#-DWITH_MINIAUDIO -DMA_DEBUG_OUTPUT#g" Arc/arc-core/build.gradle

     pushd Mindustry
   '' + optionalString enableClient ''

[xxx@xxx:~/projects/nixpkgs]$

We get the following output:

[I] [Core] Initialized SDL v2.24.0
DEBUG: Failed to initialize WASAPI backend.
DEBUG: Failed to initialize DirectSound backend.
DEBUG: Failed to initialize WinMM backend.
DEBUG: Failed to initialize Core Audio backend.
DEBUG: Failed to initialize sndio backend.
DEBUG: Failed to initialize audio(4) backend.
DEBUG: Failed to initialize OSS backend.
DEBUG: Attempting to initialize PulseAudio backend...
DEBUG: Loading library: libpulse.so
INFO: Failed to load library: libpulse.so
DEBUG: Loading library: libpulse.so.0
INFO: Failed to load library: libpulse.so.0
DEBUG: Failed to initialize PulseAudio backend.
DEBUG: Attempting to initialize ALSA backend...
DEBUG: Loading library: libasound.so.2
INFO: Failed to load library: libasound.so.2
DEBUG: Loading library: libasound.so
INFO: Failed to load library: libasound.so
DEBUG: [ALSA] Failed to open shared object.
DEBUG: Failed to initialize ALSA backend.
DEBUG: Attempting to initialize JACK backend...
DEBUG: Loading library: libjack.so
INFO: Failed to load library: libjack.so
DEBUG: Loading library: libjack.so.0
INFO: Failed to load library: libjack.so.0
DEBUG: Failed to initialize JACK backend.
DEBUG: Failed to initialize AAudio backend.
DEBUG: Failed to initialize OpenSL|ES backend.
DEBUG: Failed to initialize Web Audio backend.
DEBUG: Failed to initialize Custom backend.
DEBUG: Failed to initialize Null backend.
[E] Failed to initialize audio, disabling sound: arc.util.ArcRuntimeException: Other error
	at arc.audio.Soloud.init(Native Method)
	at arc.audio.Audio.initialize(Audio.java:41)
	at arc.audio.Audio.<init>(Audio.java:30)
	at arc.backend.sdl.SdlApplication.<init>(SdlApplication.java:42)
	at mindustry.desktop.DesktopLauncher.main(DesktopLauncher.java:39)

Which suggests it cannot find the right libraries.

@fgaz
Copy link
Member

fgaz commented Nov 15, 2022

It worked for me, but I use pipewire with pulse, jack, and alsa enabled. What audio server do you use @twitchyliquid64? Pulseaudio I suppose?

@fgaz
Copy link
Member

fgaz commented Nov 15, 2022

@twitchyliquid64 what happens if add something like this to installPhase?

@twitchyliquid64
Copy link

Im just about to get on a train and won't be back till next week so unfortimately cant test - but yes, I use pulse and bringing in libpulse like that at runtime should work!

@Mindavi
Copy link
Contributor

Mindavi commented Nov 15, 2022

I am seeing the exact same issue:

[I] [Core] Initialized SDL v2.24.2
[E] Failed to initialize audio, disabling sound: arc.util.ArcRuntimeException: Other error
        at arc.audio.Soloud.init(Native Method)
        at arc.audio.Audio.initialize(Audio.java:41)
        at arc.audio.Audio.<init>(Audio.java:30)
        at arc.backend.sdl.SdlApplication.<init>(SdlApplication.java:42)
        at mindustry.desktop.DesktopLauncher.main(DesktopLauncher.java:39)

[I] [GL] Version: OpenGL 4.6.0 / Intel / Mesa Intel(R) HD Graphics 530 (SKL GT2)
[I] [GL] Max texture size: 16384
[I] [GL] Using OpenGL 2 context.
[I] [JAVA] Version: 17.0.4
[I] [RAM] Available: 7.8 GB
[I] [Mindustry] Version: 140.3
[I] Total time to load: 3373ms
[I] Fetching community servers at https://raw.githubusercontent.com/Anuken/Mindustry/master/servers_v7.json
[I] Fetched 26 community servers.

I'll see if adding pulseaudio works for me. I am using pulseaudio at least.

Edit: after applying the following patch, it still didn't work for me. The cmdline output of mindustry changed though.

diff --git a/pkgs/games/mindustry/default.nix b/pkgs/games/mindustry/default.nix
index 51d8577caa7..c347aaa4cb2 100644
--- a/pkgs/games/mindustry/default.nix
+++ b/pkgs/games/mindustry/default.nix
@@ -16,6 +16,8 @@
 , alsa-plugins
 , glew
 
+, libpulseaudio
+
 # Make the build version easily overridable.
 # Server and client build versions must match, and an empty build version means
 # any build is allowed, so this parameter acts as a simple whitelist.
@@ -188,7 +190,8 @@ stdenv.mkDerivation rec {
     mkdir -p $out/bin
     makeWrapper ${jdk}/bin/java $out/bin/mindustry \
       --add-flags "-jar $out/share/mindustry.jar" \
-      --set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib/
+      --set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib/ \
+      --prefix LD_LIBRARY_PATH : ${libpulseaudio}/lib
 
     # Retain runtime depends to prevent them from being cleaned up.
     # Since a jar is a compressed archive, nix can't figure out that the dependency is actually in there,

New output:

[I] [Core] Initialized SDL v2.24.0
[I] [Audio] Initialized SoLoud 202111 using MiniAudio at 44100hz / 900 samples / 2 channels
[I] [GL] Version: OpenGL 4.6.0 / Intel / Mesa Intel(R) HD Graphics 530 (SKL GT2)
[I] [GL] Max texture size: 16384
[I] [GL] Using OpenGL 2 context.
[I] [JAVA] Version: 17.0.4
[I] [RAM] Available: 7.8 GB
[I] [Mindustry] Version: 140.3
[I] Total time to load: 13814ms
[I] Fetching community servers at https://raw.githubusercontent.com/Anuken/Mindustry/master/servers_v7.json
[I] Fetched 26 community servers.

@chkno
Copy link
Member Author

chkno commented Nov 18, 2022

Thank you for the feedback, @fgaz, @theHedgehog0, @Mindavi, and @twitchyliquid64! I've updated this PR:

  • Sound is fixed
  • 140.4 was released, so go for that instead of 140.3
  • Added myself to maintainers

@ofborg ofborg bot requested a review from fgaz November 18, 2022 02:56
@ofborg ofborg bot added the 11.by: package-maintainer This PR was created by the maintainer of the package it changes label Nov 18, 2022
@fgaz
Copy link
Member

fgaz commented Nov 18, 2022

@GrahamcOfBorg build mindustry-server

Copy link
Member

@fgaz fgaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's merge. Just in time for the branch-off too!

@fgaz fgaz changed the title mindustry 126.2 → 140.3 mindustry: 126.2 → 140.3 Nov 18, 2022
@fgaz fgaz changed the title mindustry: 126.2 → 140.3 mindustry: 126.2 → 140.4 Nov 18, 2022
@fgaz fgaz merged commit d9b6681 into NixOS:master Nov 18, 2022
@twitchyliquid64
Copy link

I can confirm sounds works for me with this PR!

@chkno chkno deleted the mindustry-140.3 branch November 22, 2022 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants