1{
2 lib,
3 stdenv,
4 fetchurl,
5 makeWrapper,
6 jre,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "revanced-cli";
11 version = "5.0.1";
12
13 src = fetchurl {
14 url = "https://github.com/revanced/revanced-cli/releases/download/v${version}/revanced-cli-${version}-all.jar";
15 hash = "sha256-tq+DSWAPVupR2W1Jqk0vKI4ox5zWSTSbpwyLcs4EXa8=";
16 };
17
18 nativeBuildInputs = [ makeWrapper ];
19 buildInputs = [ jre ];
20
21 dontUnpack = true;
22
23 installPhase = ''
24 runHook preInstall
25
26 mkdir -p "$prefix/bin"
27
28 makeWrapper ${jre}/bin/java $out/bin/revanced-cli \
29 --add-flags "-jar $src" \
30 --prefix PATH : "$PATH"
31
32 runHook postInstall
33 '';
34
35 meta = with lib; {
36 description = "Command line application as an alternative to the ReVanced Manager";
37 homepage = "https://github.com/revanced/revanced-cli";
38 license = licenses.gpl3Only;
39 sourceProvenance = with sourceTypes; [ binaryBytecode ];
40 maintainers = with maintainers; [ jopejoe1 ];
41 mainProgram = "revanced-cli";
42 };
43}