This repository has been archived on 2024-10-13. You can view files and clone it, but cannot push or open issues or pull requests.
nix-packages/minecraft/papermc-from-source/default.nix

32 lines
847 B
Nix

{
stdenv,
callPackage,
gradle,
openjdk_headless,
git,
}: let
src = callPackage ./source.nix {};
deps = callPackage ./deps.nix {};
in
stdenv.mkDerivation {
pname = "papermc";
version = src.passthru.source.date;
inherit src;
nativeBuildInputs = [
gradle
openjdk_headless
git
];
patchPhase = ''
sed -i 's#mavenCentral..#maven("${deps}/maven")#g' build.gradle.kts
sed -i 's#gradlePluginPortal..#maven("${deps}/maven")#g' settings.gradle.kts
'';
buildPhase = ''
export GRADLE_USER_HOME=$(mktemp -d)
gradle --offline --no-daemon --debug -Dorg.gradle.java.home=${openjdk_headless} applyPatches
gradle --offline --no-daemon --info -Dorg.gradle.java.home=${openjdk_headless} createReobfBundlerJar
'';
installPhase = ''
find build/lib
'';
}