Merge pull request #75546 from averelld/jdgui-update

jd-gui: 1.4.0 -> 1.6.5
This commit is contained in:
Jörg Thalheim 2019-12-14 07:41:01 +00:00 committed by GitHub
commit fbfd77b158
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,22 +1,27 @@
{ stdenv, fetchurl, gradle_2_5, perl, makeWrapper, jre, makeDesktopItem, writeText, runtimeShell }:
{ stdenv, fetchFromGitHub, jre, jdk, makeDesktopItem, perl, writeText, runtimeShell }:
let
version = "1.4.0";
name = "jd-gui-${version}";
pname = "jd-gui";
version = "1.6.5";
src = fetchurl {
url = "https://github.com/java-decompiler/jd-gui/archive/v${version}.tar.gz";
sha256 = "0anz7szlr5kgmsmkyv34jdynsnk8v6kvibcyz98jsd96fh725lax";
src = fetchFromGitHub {
owner = "java-decompiler";
repo = pname;
rev = "v${version}";
sha256 = "0yn2xcwznig941pw2f3wi8ixz1wprxcn9wl0g2ggdzx51rfwgzzi";
};
deps = stdenv.mkDerivation {
name = "${name}-deps";
name = "${pname}-deps";
inherit src;
nativeBuildInputs = [ gradle_2_5 perl ];
nativeBuildInputs = [ jdk perl ];
patchPhase = "patchShebangs gradlew";
buildPhase = ''
export GRADLE_USER_HOME=$(mktemp -d);
gradle --no-daemon build
./gradlew --no-daemon jar
'';
# Mavenize dependency paths
@ -25,11 +30,12 @@ let
find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
| perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
| sh
cp -r $GRADLE_USER_HOME/wrapper $out
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "1apmqiphnav79m4rdii58h7f4qslpfig4qybyyl2fr7zk92gv3l9";
outputHash = "1s4p91iiyikrsgvpzkhw3jm5lsm0jpzp7iw7afdhhl9jm18igs70";
};
# Point to our local deps repo
@ -59,18 +65,24 @@ let
comment = "Java Decompiler JD-GUI";
desktopName = "JD-GUI";
genericName = "Java Decompiler";
mimeType = "application/x-java-archive;application/x-java";
mimeType = "application/java;application/java-vm;application/java-archive";
categories = "Development;Debugger;";
extraEntries="StartupWMClass=org-jd-gui-App";
};
in stdenv.mkDerivation {
inherit name version src;
in stdenv.mkDerivation rec {
inherit pname version src;
name = "${pname}-${version}";
nativeBuildInputs = [ gradle_2_5 perl makeWrapper ];
nativeBuildInputs = [ jdk ];
patchPhase = "patchShebangs gradlew";
buildPhase = ''
export GRADLE_USER_HOME=$(mktemp -d)
gradle --offline --no-daemon --info --init-script ${gradleInit} jar
cp -r ${deps}/wrapper $GRADLE_USER_HOME
chmod u+w $GRADLE_USER_HOME/wrapper/dists/gradle*/*/*.lck
./gradlew --offline --no-daemon --info --init-script ${gradleInit} jar
'';
installPhase = let
@ -83,18 +95,16 @@ in stdenv.mkDerivation {
cat > $out/bin/jd-gui <<EOF
#!${runtimeShell}
export JAVA_HOME=${jre}
${jre}/bin/java -jar ${jar} $@
exec ${jre}/bin/java -jar ${jar} "\$@"
EOF
chmod +x $out/bin/jd-gui
${(desktopItem "$out/bin/jd-gui").buildCommand}
'';
dontStrip = true;
meta = with stdenv.lib; {
description = "Fast Java Decompiler with powerful GUI";
homepage = "http://jd.benow.ca/";
homepage = "https://java-decompiler.github.io/";
license = licenses.gpl3;
platforms = platforms.unix;
maintainers = [ maintainers.thoughtpolice ];