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