Merge pull request #221396 from rhendric/rhendric/mindustry

mindustry-wayland: set SDL environment variables

authored by Francesco Gazzetta and committed by GitHub ef5c1750 d3b28b7f

+13 -5
+12 -4
pkgs/games/mindustry/default.nix
··· 15 15 , alsa-lib 16 16 , alsa-plugins 17 17 , glew 18 + , glew-egl 18 19 19 20 # for soloud 20 21 , libpulseaudio ? null ··· 30 31 , makeBuildVersion ? (v: v) 31 32 , enableClient ? true 32 33 , enableServer ? true 34 + 35 + , enableWayland ? false 33 36 }: 34 37 35 38 let 36 39 pname = "mindustry"; 37 40 version = "143.1"; 38 41 buildVersion = makeBuildVersion version; 42 + 43 + selectedGlew = if enableWayland then glew-egl else glew; 39 44 40 45 Mindustry = fetchFromGitHub { 41 46 owner = "Anuken"; ··· 139 144 140 145 buildInputs = lib.optionals enableClient [ 141 146 SDL2 142 - glew 147 + selectedGlew 143 148 alsa-lib 144 149 ]; 145 150 nativeBuildInputs = [ ··· 171 176 pushd ../Arc 172 177 gradle --offline --no-daemon jnigenBuild -Pbuildversion=${buildVersion} 173 178 gradle --offline --no-daemon jnigenJarNativesDesktop -Pbuildversion=${buildVersion} 174 - glewlib=${lib.getLib glew}/lib/libGLEW.so 179 + glewlib=${lib.getLib selectedGlew}/lib/libGLEW.so 175 180 sdllib=${lib.getLib SDL2}/lib/libSDL2.so 176 181 patchelf backends/backend-sdl/libs/linux64/libsdl-arc*.so \ 177 182 --add-needed $glewlib \ ··· 194 199 makeWrapper ${jdk}/bin/java $out/bin/mindustry \ 195 200 --add-flags "-jar $out/share/mindustry.jar" \ 196 201 --suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath [libpulseaudio alsa-lib libjack2]} \ 197 - --set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib/ 202 + --set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib/'' + optionalString enableWayland '' \ 203 + --set SDL_VIDEODRIVER wayland \ 204 + --set SDL_VIDEO_WAYLAND_WMCLASS Mindustry 205 + '' + '' 198 206 199 207 # Retain runtime depends to prevent them from being cleaned up. 200 208 # Since a jar is a compressed archive, nix can't figure out that the dependency is actually in there, ··· 202 210 # This can cause issues. 203 211 # See https://github.com/NixOS/nixpkgs/issues/109798. 204 212 echo "# Retained runtime dependencies: " >> $out/bin/mindustry 205 - for dep in ${SDL2.out} ${alsa-lib.out} ${glew.out}; do 213 + for dep in ${SDL2.out} ${alsa-lib.out} ${selectedGlew.out}; do 206 214 echo "# $dep" >> $out/bin/mindustry 207 215 done 208 216
+1 -1
pkgs/top-level/all-packages.nix
··· 36454 36454 36455 36455 mindustry = callPackage ../games/mindustry { }; 36456 36456 mindustry-wayland = callPackage ../games/mindustry { 36457 - glew = glew-egl; 36457 + enableWayland = true; 36458 36458 }; 36459 36459 36460 36460 mindustry-server = callPackage ../games/mindustry {