configuration/packages/decompiler-mc.nix

47 lines
1.1 KiB
Nix
Raw Normal View History

2022-06-08 16:32:55 +00:00
{ fetchFromGitHub
, lib
, makeWrapper
, stdenv
2023-02-07 02:41:49 +00:00
, unstableGitUpdater
2022-06-08 16:32:55 +00:00
# Dependencies
, jre
, python3
}:
2022-12-15 18:28:21 +00:00
stdenv.mkDerivation rec {
2022-06-08 16:32:55 +00:00
pname = "decompiler-mc";
version = "unstable-2024-04-13";
2022-06-08 16:32:55 +00:00
src = fetchFromGitHub {
owner = "hube12";
repo = "DecompilerMC";
rev = "3a8aa87d01065fbd7fdc8422f19a0fa379740635";
hash = "sha256-IdKMUX0/cAlUHIpCSaU5pjffjNwgbFxXv07hJRmGpGk=";
2022-06-08 16:32:55 +00:00
};
buildInputs = [ makeWrapper python3 ];
installPhase = ''
mkdir --parents $out
cp --recursive $src/lib $out/lib
2022-12-15 18:28:21 +00:00
install -D main.py $out/bin/${pname}
substituteInPlace $out/bin/${pname} --replace ./lib $out/lib
wrapProgram $out/bin/${pname} --prefix PATH : ${lib.makeBinPath [ jre ]}
2022-06-08 16:32:55 +00:00
'';
2023-02-07 02:41:49 +00:00
passthru.updateScript = unstableGitUpdater { };
2022-06-08 16:32:55 +00:00
meta = {
description = "Automated decompilation of Minecraft";
homepage = "https://github.com/hube12/DecompilerMC";
license = with lib.licenses; [
2022-08-10 19:46:29 +00:00
asl20 # Fernflower (vendored)
bsd3 # SpecialSource (vendored)
2022-12-15 18:28:21 +00:00
mit # DecompilerMC, CFR (vendored)
2022-06-08 16:32:55 +00:00
];
2022-12-15 18:28:21 +00:00
mainProgram = pname;
2022-06-08 16:32:55 +00:00
};
}