diff options
author | Majiir Paktu <majiir@nabaal.net> | 2022-08-20 23:12:05 -0400 |
---|---|---|
committer | Majiir Paktu <majiir@nabaal.net> | 2022-10-29 16:10:46 -0400 |
commit | 437ae8dfd5f21294df966dfd885238cfba5c3c3e (patch) | |
tree | 3f4bcee0e6fd1b6d3ed60ab01c8191299855de4e /pkgs/tools | |
parent | 83733b5537f348d5b0d86271a08a2662d965b220 (diff) |
jd-cli: init at 1.2.1
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/security/jd-cli/default.nix | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/pkgs/tools/security/jd-cli/default.nix b/pkgs/tools/security/jd-cli/default.nix new file mode 100644 index 0000000000000..c57230bbd5a4f --- /dev/null +++ b/pkgs/tools/security/jd-cli/default.nix @@ -0,0 +1,62 @@ +{ lib, stdenv, fetchFromGitHub, jre, makeWrapper, maven }: + +let + pname = "jd-cli"; + version = "1.2.1"; + + src = fetchFromGitHub { + owner = "intoolswetrust"; + repo = pname; + rev = "${pname}-${version}"; + hash = "sha256-rRttA5H0A0c44loBzbKH7Waoted3IsOgxGCD2VM0U/Q="; + }; + + deps = stdenv.mkDerivation { + name = "${pname}-${version}-deps"; + inherit src; + + nativeBuildInputs = [ maven ]; + buildPhase = '' + mvn package -Dmaven.repo.local=$out + ''; + + # keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with lastModified timestamps inside + installPhase = '' + find $out -type f \ + -name \*.lastUpdated -or \ + -name resolver-status.properties -or \ + -name _remote.repositories \ + -delete + ''; + + dontFixup = true; + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + outputHash = "sha256-5d3ZLuzoEkPjh01uL/BuhJ6kevLdsm1P4PMLkEWaVUM="; + }; + +in stdenv.mkDerivation rec { + inherit pname version src; + + nativeBuildInputs = [ maven makeWrapper ]; + + buildPhase = '' + mvn --offline -Dmaven.repo.local=${deps} package; + ''; + + installPhase = '' + mkdir -p $out/bin $out/share/jd-cli + install -Dm644 jd-cli/target/jd-cli.jar $out/share/jd-cli + + makeWrapper ${jre}/bin/java $out/bin/jd-cli \ + --add-flags "-jar $out/share/jd-cli/jd-cli.jar" + ''; + + meta = with lib; { + description = "Simple command line wrapper around JD Core Java Decompiler project"; + homepage = "https://github.com/intoolswetrust/jd-cli"; + license = licenses.gpl3; + platforms = platforms.unix; + maintainers = with maintainers; [ majiir ]; + }; +} |