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