Merge pull request #84075 from Gaelan/minecraft-headless

minecraft-server: build against jre_headless
This commit is contained in:
Silvan Mosberger 2020-04-03 23:53:20 +02:00 committed by GitHub
commit 7f20da7850
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,10 +1,11 @@
{ stdenv, fetchurl, jre }:
{ stdenv, fetchurl, jre_headless }:
stdenv.mkDerivation {
pname = "minecraft-server";
version = "1.15.2";
src = fetchurl {
url = "https://launcher.mojang.com/v1/objects/bb2b6b1aefcd70dfd1892149ac3a215f6c636b07/server.jar";
url =
"https://launcher.mojang.com/v1/objects/bb2b6b1aefcd70dfd1892149ac3a215f6c636b07/server.jar";
sha256 = "12kynrpxgcdg8x12wcvwkxka0fxgm5siqg8qq0nnmv0443f8dkw0";
};
@ -16,7 +17,7 @@ stdenv.mkDerivation {
cat > $out/bin/minecraft-server << EOF
#!/bin/sh
exec ${jre}/bin/java \$@ -jar $out/lib/minecraft/server.jar nogui
exec ${jre_headless}/bin/java \$@ -jar $out/lib/minecraft/server.jar nogui
EOF
chmod +x $out/bin/minecraft-server
@ -24,11 +25,11 @@ stdenv.mkDerivation {
phases = "installPhase";
meta = {
meta = with stdenv.lib; {
description = "Minecraft Server";
homepage = "https://minecraft.net";
license = stdenv.lib.licenses.unfreeRedistributable;
platforms = stdenv.lib.platforms.unix;
maintainers = with stdenv.lib.maintainers; [ thoughtpolice tomberek costrouc];
homepage = "https://minecraft.net";
license = licenses.unfreeRedistributable;
platforms = platforms.unix;
maintainers = with maintainers; [ thoughtpolice tomberek costrouc ];
};
}