jd-cli: convert to mavenfod
This commit is contained in:
parent
fcb1400f3e
commit
1b5a054e0a
|
@ -1,6 +1,6 @@
|
||||||
{ lib, stdenv, fetchFromGitHub, jre, makeWrapper, maven }:
|
{ lib, javaPackages, fetchFromGitHub, jre, makeWrapper, maven }:
|
||||||
|
|
||||||
let
|
javaPackages.mavenfod rec {
|
||||||
pname = "jd-cli";
|
pname = "jd-cli";
|
||||||
version = "1.2.1";
|
version = "1.2.1";
|
||||||
|
|
||||||
|
@ -11,39 +11,10 @@ let
|
||||||
hash = "sha256-rRttA5H0A0c44loBzbKH7Waoted3IsOgxGCD2VM0U/Q=";
|
hash = "sha256-rRttA5H0A0c44loBzbKH7Waoted3IsOgxGCD2VM0U/Q=";
|
||||||
};
|
};
|
||||||
|
|
||||||
deps = stdenv.mkDerivation {
|
mvnHash = "sha256-EIam0rxmCBs/mpMck6ePFoQBQ6KYYNqJKVE32gdXPfE=";
|
||||||
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 ];
|
nativeBuildInputs = [ maven makeWrapper ];
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
mvn --offline -Dmaven.repo.local=${deps} package;
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin $out/share/jd-cli
|
mkdir -p $out/bin $out/share/jd-cli
|
||||||
install -Dm644 jd-cli/target/jd-cli.jar $out/share/jd-cli
|
install -Dm644 jd-cli/target/jd-cli.jar $out/share/jd-cli
|
||||||
|
|
Loading…
Reference in a new issue