Merge pull request #256981 from Gerg-L/papermc
papermc: 1.20.1.83 -> 1.20.2.223
This commit is contained in:
commit
310299b585
@ -1,40 +1,50 @@
|
|||||||
{ lib, stdenv, fetchurl, bash, jre }:
|
{
|
||||||
|
lib,
|
||||||
stdenv.mkDerivation rec {
|
stdenvNoCC,
|
||||||
|
fetchurl,
|
||||||
|
jre,
|
||||||
|
makeBinaryWrapper,
|
||||||
|
}:
|
||||||
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||||
pname = "papermc";
|
pname = "papermc";
|
||||||
version = "1.20.1.83";
|
version = "1.20.2.234";
|
||||||
|
|
||||||
jar = let
|
src =
|
||||||
mcVersion = lib.versions.pad 3 version;
|
let
|
||||||
buildNum = builtins.elemAt (lib.versions.splitVersion version) 3;
|
mcVersion = lib.versions.pad 3 finalAttrs.version;
|
||||||
in fetchurl {
|
buildNum = builtins.elemAt (lib.splitVersion finalAttrs.version) 3;
|
||||||
url = "https://papermc.io/api/v2/projects/paper/versions/${mcVersion}/builds/${buildNum}/downloads/paper-${mcVersion}-${buildNum}.jar";
|
in
|
||||||
sha256 = "sha256-HQpc3MOXa1wkXqgm9ciQj04FUIyuupnYiu+2RZ/sXE4=";
|
fetchurl {
|
||||||
};
|
url = "https://papermc.io/api/v2/projects/paper/versions/${mcVersion}/builds/${buildNum}/downloads/paper-${mcVersion}-${buildNum}.jar";
|
||||||
|
hash = "sha256-fR7Dq09iFGVXodQjrS7Hg4NcrKPJbNg0hexU520JC6c=";
|
||||||
preferLocalBuild = true;
|
};
|
||||||
|
|
||||||
dontUnpack = true;
|
|
||||||
dontConfigure = true;
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
cat > minecraft-server << EOF
|
|
||||||
#!${bash}/bin/sh
|
|
||||||
exec ${jre}/bin/java \$@ -jar $out/share/papermc/papermc.jar nogui
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
install -Dm444 ${jar} $out/share/papermc/papermc.jar
|
runHook preInstall
|
||||||
install -Dm555 -t $out/bin minecraft-server
|
|
||||||
|
install -D $src $out/share/papermc/papermc.jar
|
||||||
|
|
||||||
|
makeWrapper ${lib.getExe jre} "$out/bin/minecraft-server" \
|
||||||
|
--append-flags "-jar $out/share/papermc/papermc.jar nogui"
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
makeBinaryWrapper
|
||||||
|
];
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
preferLocalBuild = true;
|
||||||
|
allowSubstitutes = false;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "High-performance Minecraft Server";
|
description = "High-performance Minecraft Server";
|
||||||
homepage = "https://papermc.io/";
|
homepage = "https://papermc.io/";
|
||||||
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
|
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
|
||||||
license = lib.licenses.gpl3Only;
|
license = lib.licenses.gpl3Only;
|
||||||
platforms = lib.platforms.unix;
|
platforms = lib.platforms.unix;
|
||||||
maintainers = with lib.maintainers; [ aaronjanse neonfuz ];
|
maintainers = with lib.maintainers; [ aaronjanse neonfuz ];
|
||||||
mainProgram = "minecraft-server";
|
mainProgram = "minecraft-server";
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user