configuration/packages/decompiler-mc.nix
Andrew Kvalheim a59af5ca20 Format code
2022-08-10 12:46:29 -07:00

43 lines
1 KiB
Nix

{ fetchFromGitHub
, lib
, makeWrapper
, stdenv
# Dependencies
, jre
, python3
}:
stdenv.mkDerivation {
pname = "decompiler-mc";
version = "unstable-2022-05-07";
src = fetchFromGitHub {
owner = "hube12";
repo = "DecompilerMC";
rev = "ffec115d44c5ec76034b42110610ad6dbc3b75c4";
hash = "sha256-XLeupo3jzA7M6HJ8vZ1Zrt8v5m3gb516RVY0LsITeZA=";
};
buildInputs = [ makeWrapper python3 ];
installPhase = ''
mkdir --parents $out
cp --recursive $src/lib $out/lib
install -D main.py $out/bin/decompiler-mc
substituteInPlace $out/bin/decompiler-mc --replace ./lib $out/lib
wrapProgram $out/bin/decompiler-mc --prefix PATH : ${lib.makeBinPath [ jre ]}
'';
meta = {
description = "Automated decompilation of Minecraft";
homepage = "https://github.com/hube12/DecompilerMC";
license = with lib.licenses; [
asl20 # Fernflower (vendored)
bsd3 # SpecialSource (vendored)
mit # CFR (vendored), DecompilerMC
];
mainProgram = "decompiler-mc";
};
}