diff --git a/.gitignore b/.gitignore index be41408..9a636c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /mstrobel-procyon-ee404caa9a29.zip /v0.5.36.tar.gz /procyon-1.0~SNAPSHOT.tar.gz +/procyon-92ba3f44b8f2b755a21efcdc05dec347ab4df552.tar.gz +/procyon-88a95fa93c58322393174f84543edc7a0a2ca44d.tar.gz diff --git a/adaptToNewerJcommander.patch b/adaptToNewerJcommander.patch deleted file mode 100644 index bab3d59..0000000 --- a/adaptToNewerJcommander.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/Procyon.Decompiler/src/main/java/com/strobel/decompiler/CommandLineOptions.java_nw -+++ b/Procyon.Decompiler/src/main/java/com/strobel/decompiler/CommandLineOptions.java -@@ -23,7 +23,7 @@ - - public class CommandLineOptions { - @Parameter(description = "") -- private final List _inputs = new ArrayList<>(); -+ private List _inputs = new ArrayList<>(); - - @Parameter( - names = { "-?", "--help" }, - diff --git a/disableFatJar.patch b/disableFatJar.patch deleted file mode 100644 index 4abf2db..0000000 --- a/disableFatJar.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/Procyon.Decompiler/build.gradle b/Procyon.Decompiler/build.gradle -index 7377956..388de1e 100644 ---- a/Procyon.Decompiler/build.gradle -+++ b/Procyon.Decompiler/build.gradle -@@ -2,27 +2,13 @@ buildscript { - repositories { - jcenter() - } -- -- dependencies { -- classpath 'eu.appsatori:gradle-fatjar-plugin:0.3' -- } - } - - jar.enabled = false - uploadArchives.enabled = false - --apply plugin: 'eu.appsatori.fatjar' -- --fatJar { --// from rootProject.allprojects.collect({ it.sourceSets.main.allSource }) -- -- manifest { -- attributes 'Title': archivesBaseName, 'Manifest-Version': '1.0', 'Version': version, 'Main-Class' : 'com.strobel.decompiler.DecompilerDriver' -- } --} -- - dependencies { - compile 'com.beust:jcommander:1.30' - compile project(':Procyon.Core') - compile project(':Procyon.CompilerTools') --} -\ No newline at end of file -+} diff --git a/generate-tarball.sh b/generate-tarball.sh index 0ec644d..817fc26 100755 --- a/generate-tarball.sh +++ b/generate-tarball.sh @@ -1,16 +1,16 @@ #!/bin/bash -set -e +set -ex name=procyon -version="$(sed -n 's/Version:\s*//p' *.spec)" +version=`cat procyon.spec | grep "%global commit " | sed "s/.*commit //"` # RETRIEVE rm -rf procyon -git clone "https://github.com/slowcoders/procyon.git" +git clone "https://github.com/mstrobel/procyon.git" # CLEAN TARBALL pushd procyon -git checkout "f6568b3ffbb61af8166f678190f2dc0775fd47fd" +git checkout "$version" rm -rf .git .idea docs rm -rf gradle* diff --git a/lookupPatch.patch b/lookupPatch.patch deleted file mode 100644 index 9190669..0000000 --- a/lookupPatch.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- Procyon.Reflection/src/main/java/com/strobel/reflection/emit/TypeBuilder.java -+++ Procyon.Reflection/src/main/java/com/strobel/reflection/emit/TypeBuilder.java -@@ -34,6 +34,7 @@ - import java.io.IOException; - import java.io.OutputStream; - import java.lang.annotation.Annotation; -+import java.lang.invoke.MethodHandles; - import java.lang.reflect.Field; - import java.lang.reflect.Modifier; - import java.security.ProtectionDomain; -@@ -1231,14 +1232,10 @@ - - _hasBeenCreated = true; - -- _generatedClass = (Class) getUnsafeInstance().defineClass( -- fullName, -- classBytes, -- 0, -- classBytes.length, -- Thread.currentThread().getContextClassLoader(), -- _protectionDomain -- ); -+ MethodHandles.Lookup lookup = MethodHandles.lookup(); -+ MethodHandles.Lookup privateLookup = MethodHandles.privateLookupIn(Class.forName(fullName), lookup); -+ _generatedClass = (Class)privateLookup.defineClass(classBytes); -+ - - RuntimeHelpers.ensureClassInitialized(_generatedClass); - - diff --git a/newJcommander.patch b/newJcommander.patch deleted file mode 100644 index 140fc73..0000000 --- a/newJcommander.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/Procyon.Decompiler/src/main/java/com/strobel/decompiler/DecompilerDriver.java -+++ a/Procyon.Decompiler/src/main/java/com/strobel/decompiler/DecompilerDriver.java -@@ -64,7 +64,7 @@ - final boolean decompileJar = !StringUtilities.isNullOrWhitespace(jarFile); - - if (options.getPrintVersion()) { -- JCommander.getConsole().println(Procyon.version()); -+ jCommander.getConsole().println(Procyon.version()); - if (options.getPrintUsage()) { - jCommander.usage(); - } - diff --git a/procyon.spec b/procyon.spec index ebfc528..08caf50 100644 --- a/procyon.spec +++ b/procyon.spec @@ -2,35 +2,32 @@ %define debug_package %{nil} %global remove_tests 1 +%global commit 88a95fa93c58322393174f84543edc7a0a2ca44d +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global commitdate 20220221 + Name: procyon -Version: 1.0~SNAPSHOT -Release: 1%{?dist} +Version: 0.6.0 +Release: 0.11.%{commitdate}.git%{shortcommit}%{?dist} Summary: procyon java decompiler and other tools -License: ASL 2.0 +# Automatically converted from old format: ASL 2.0 - review is highly recommended. +License: Apache-2.0 URL: https://github.com/mstrobel/procyon # ./generate-tarball.sh # This script uses a fork of the original project -Source0: %{name}-%{version}.tar.gz +Source0: %{name}-%{commit}.tar.gz Source1: procyon-decompiler - -# main removal is not upstream-able, and is enforced by fedora policy -# signature is touching online world, necessary for packaging, not usptream able -Patch0: removeSigningAndIfDecompilerAndMain.patch -# fat jar do not have much sense for fedora packagin. not upstream-able -Patch1: disableFatJar.patch -# patch should be proposed to upstream. -Patch2: adaptToNewerJcommander.patch Patch3: madeToPasXlint.patch -Patch4: newJcommander.patch -Patch5: lookupPatch.patch + BuildArch: noarch +ExclusiveArch: %{java_arches} noarch BuildRequires: javapackages-tools -BuildRequires: java-devel +BuildRequires: java-25-devel BuildRequires: dos2unix BuildRequires: beust-jcommander -Requires: java-headless +Requires: java-25-headless Requires: javapackages-tools # main package is just meta package for all subprojects and their artifacts Recommends: %{name}-compilertools = %{version}-%{release} @@ -48,6 +45,7 @@ The Procyon libraries are available from Maven Central under group ID org.bitbuc %package compilertools Summary: The procyon-compilertools project BuildArch: noarch +ExclusiveArch: %{java_arches} noarch Requires: javapackages-tools %description compilertools @@ -59,6 +57,7 @@ The Compiler Toolset is still early in development and subject to change. %package core Summary: The procyon-core framework contains common support classes BuildArch: noarch +ExclusiveArch: %{java_arches} noarch Requires: javapackages-tools %description core @@ -70,6 +69,7 @@ and some runtime type helpers. %package expressions Summary: The procyon-expressions framework provides a more natural form of Linq-like code generation BuildArch: noarch +ExclusiveArch: %{java_arches} noarch Requires: javapackages-tools %description expressions @@ -84,6 +84,7 @@ minus the dynamic callsite support (and with more relaxed rules regarding type c %package decompiler Summary: procyon-decompiler is a front-end for the Java decompiler BuildArch: noarch +ExclusiveArch: %{java_arches} noarch Requires: %{name}-core Requires: %{name}-compilertools Requires: beust-jcommander @@ -97,6 +98,7 @@ https://bitbucket.org/mstrobel/procyon/wiki/Java%20Decompiler %package reflection Summary: The procyon-reflection framework provides a rich reflection and code generation API BuildArch: noarch +ExclusiveArch: %{java_arches} noarch Requires: javapackages-tools %description reflection @@ -107,7 +109,7 @@ limited and cumbersome support for generic type inspection. Its code generation MethodBuilder, and a bytecode emitter. %prep -%setup -q +%setup -q -n %{name}-%{commit} %if %{remove_tests} find | grep "\\.class$" #find | grep "\\.jar$" @@ -119,15 +121,8 @@ find | grep "\\.jar$" && exit 1 dos2unix Procyon.Decompiler/build.gradle dos2unix build.gradle dos2unix README.md -# also removing main method from enter point jar -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 dos2unix Procyon.CompilerTools/src/main/java/com/strobel/assembler/metadata/MethodBinder.java -%patch3 -p1 -%patch4 -p1 -dos2unix Procyon.Reflection/src/main/java/com/strobel/reflection/emit/TypeBuilder.java -%patch5 -p0 +%patch -P3 -p1 %build mkdir -p build/Procyon.CompilerTools/{libs,classes} @@ -136,10 +131,12 @@ mkdir -p build/Procyon.Decompiler/{libs,classes} mkdir -p build/Procyon.Expressions/{libs,classes} mkdir -p build/Procyon.Reflection/{libs,classes} -javac -d build/Procyon.Core/classes/ ` find Procyon.Core/src/main/java -type f | grep "\.java"` -javac -d build/Procyon.Reflection/classes/ -cp build/Procyon.Core/classes/ ` find Procyon.Reflection/src/main/java -type f | grep "\.java"` -javac -d build/Procyon.Expressions/classes/ -cp build/Procyon.Core/classes/:build/Procyon.Reflection/classes/ ` find Procyon.Expressions/src/main/java -type f | grep "\.java"` -javac -d build/Procyon.CompilerTools/classes/ -cp build/Procyon.Core/classes/ ` find Procyon.CompilerTools/src/main/java -type f | grep "\.java"` +sourceVersion="-source 8 -target 8 -g" + +javac $sourceVersion -d build/Procyon.Core/classes/ ` find Procyon.Core/src/main/java -type f | grep "\.java"` +javac $sourceVersion -d build/Procyon.Reflection/classes/ -cp build/Procyon.Core/classes/ ` find Procyon.Reflection/src/main/java -type f | grep "\.java"` +javac $sourceVersion -d build/Procyon.Expressions/classes/ -cp build/Procyon.Core/classes/:build/Procyon.Reflection/classes/ ` find Procyon.Expressions/src/main/java -type f | grep "\.java"` +javac $sourceVersion -d build/Procyon.CompilerTools/classes/ -cp build/Procyon.Core/classes/ ` find Procyon.CompilerTools/src/main/java -type f | grep "\.java"` # pack the jars for x in Procyon.CompilerTools Procyon.Core Procyon.Reflection Procyon.Expressions ; do @@ -217,39 +214,4 @@ popd %doc README.md %changelog -* Thu Jun 03 2021 Marian Koncek - 1.0~SNAPSHOT-1 -- Update to upstream version 1.0~SNAPSHOT - -* Wed Jan 27 2021 Fedora Release Engineering - 0.5.36-0.5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Thu Dec 10 2020 Jiri Vanek - 0.5.36-0.4 -- set source/target of 8 - -* Tue Jul 28 2020 Fedora Release Engineering - 0.5.36-0.3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Sat Jul 11 2020 Jiri Vanek - 0.5.36-0.2 -- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11 - -* Tue Feb 18 2020 Jiri Vanek - 0.5.36-0.1 -- bumped to latest tagged forest 0.5.36 -- fixed bug in usage of newer jcommander - -* Tue Feb 18 2020 Jiri Vanek - 0.5.33-0.5.pre02 -- removed fat jar, as gradle is gone -- removed javadoc and srcs artifacts. will eb building by javac -- buit by javac instead of gradle - -* Fri Jul 26 2019 Fedora Release Engineering - 0.5.33-0.3.pre02 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Sat Feb 02 2019 Fedora Release Engineering - 0.5.33-0.2.pre02 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Fri Dec 21 2018 Jiri Vanek 0.5.33-0.1.pre02 -- created special package for assembled fat jar -- adapted rest of package to include and cooperate with minimal decompiler frontend - -* Fri Dec 21 2018 Jiri Vanek 0.5.33-0.1.pre01 -- inital load +%autochangelog diff --git a/removeSigningAndIfDecompilerAndMain.patch b/removeSigningAndIfDecompilerAndMain.patch deleted file mode 100644 index 4b40d28..0000000 --- a/removeSigningAndIfDecompilerAndMain.patch +++ /dev/null @@ -1,101 +0,0 @@ -diff --git a/build.gradle b/build.gradle -index f521868..3168766 100644 ---- a/build.gradle -+++ b/build.gradle -@@ -62,9 +62,6 @@ rootProject.uploadArchives.enabled = false - - subprojects { - apply plugin: 'maven' -- apply plugin: 'signing' -- -- final boolean shouldSign = "true".equalsIgnoreCase(System.properties.getProperty("procyon.signing.enabled")) - - archivesBaseName = "procyon-${(it.name as String).split('\\.')[1].toLowerCase()}" - -@@ -131,86 +128,6 @@ subprojects { - archives javadocJar - archives sourcesJar - } -- -- if (shouldSign) { -- signing { -- sign configurations.archives -- } -- } -- -- uploadArchives { -- repositories.mavenDeployer { -- if (shouldSign) { -- beforeDeployment { MavenDeployment deployment -> -- signing.signPom(deployment) -- } -- } -- -- snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") { -- authentication(userName: project.properties.get("procyon.sonatype.username"), -- password: project.properties.get("procyon.sonatype.password")) -- } -- -- repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") { -- authentication(userName: project.properties.get("procyon.sonatype.username"), -- password: project.properties.get("procyon.sonatype.password")) -- } -- -- pom { -- groupId = project.group -- version = project.version -- artifactId = project.archivesBaseName -- -- project { -- name project.archivesBaseName -- packaging 'jar' -- description 'Procyon' -- url 'https://bitbucket.org/mstrobel/procyon' -- -- scm { -- url 'https://bitbucket.org/mstrobel/procyon' -- connection 'scm:hg:https://hg@bitbucket.org/mstrobel/procyon' -- developerConnection 'scm:hg:https://mstrobel@bitbucket.org/mstrobel/procyon' -- } -- -- issueManagement { -- system 'jira' -- url 'https://bitbucket.org/mstrobel/procyon/issues' -- } -- -- licenses { -- license { -- name 'The Apache Software License, Version 2.0' -- url 'http://www.apache.org/licenses/LICENSE-2.0.txt' -- distribution 'repo' -- } -- } -- -- developers { -- developer { -- id 'mstrobel' -- name 'Mike Strobel' -- roles { -- role 'owner' -- role 'packager' -- role 'developer' -- } -- } -- } -- -- dependencies { -- dependency { -- groupId 'junit' -- artifactId 'junit' -- version '4.11' -- scope 'test' --// optional = true -- } -- } -- } -- } -- } -- } - } - } - diff --git a/sources b/sources index d5cb14e..1dfc060 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (procyon-1.0~SNAPSHOT.tar.gz) = d19f5fc282facf0756a363844c38e98ea33d8488fd512b33a63057371e8ed31358ff47cb44b273a3687b09588342f25258a168ffba436380bd22d25b85ca3b07 +SHA512 (procyon-88a95fa93c58322393174f84543edc7a0a2ca44d.tar.gz) = 69c782cb8648f5c8f6ed1999d301df2318f64a3d3479a16ef340891deaef7a1b161d4d2808d98e70372381626dbe5488d9d0dc9b6c17feacc8e0d38f1747985e