From 796b1bce0305969c283cbd7a9bdf132521017191 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Thu, 17 Jan 2019 14:41:31 +0100 Subject: [PATCH] Update to upstream version 5.4.0 --- .gitignore | 2 + 0001-Adapt-build.patch | 6 +-- 0002-Load-system-library.patch | 61 +++++++++---------------- 0003-Tests-headless.patch | 8 ++-- 0004-Fix-javadoc-build.patch | 6 +-- 0005-Fix-duplicate-manifest-entry.patch | 11 ++--- 0006-Remove-Werror.patch | 13 +++--- jna.spec | 16 +++++-- sources | 2 +- 9 files changed, 59 insertions(+), 66 deletions(-) diff --git a/.gitignore b/.gitignore index 32e836f..4286e61 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ jna-3.2.7.tar.bz2 /jna-4.4.0-clean.tar.xz /jna-4.5.0-clean.tar.xz /jna-4.5.1-clean.tar.xz +/jna-5.2.0-clean.tar.xz +/jna-5.4.0-clean.tar.xz diff --git a/0001-Adapt-build.patch b/0001-Adapt-build.patch index 003d5db..36ad5d1 100644 --- a/0001-Adapt-build.patch +++ b/0001-Adapt-build.patch @@ -8,7 +8,7 @@ Subject: [PATCH 1/6] Adapt build 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/native/Makefile b/native/Makefile -index 6f9ad25..3712a9e 100644 +index 1bea2dc..cb3afed 100644 --- a/native/Makefile +++ b/native/Makefile @@ -97,7 +97,7 @@ CDEFINES=-D_REENTRANT @@ -20,7 +20,7 @@ index 6f9ad25..3712a9e 100644 ifeq ($(DYNAMIC_LIBFFI),true) CFLAGS += $(shell pkg-config --cflags libffi 2>/dev/null || echo) LIBS += $(shell pkg-config --libs libffi 2>/dev/null || echo -lffi) -@@ -455,7 +455,6 @@ $(BUILD)/$(JNA_JNI_VERSION).stamp: +@@ -457,7 +457,6 @@ $(BUILD)/$(JNA_JNI_VERSION).stamp: $(LIBRARY): $(JNIDISPATCH_OBJS) $(FFI_LIB) $(LD) $(LDFLAGS) $(JNIDISPATCH_OBJS) $(FFI_LIB) $(LIBS) @@ -29,5 +29,5 @@ index 6f9ad25..3712a9e 100644 $(TESTLIB): $(BUILD)/testlib.o $(LD) $(LDFLAGS) $< $(LIBS) -- -2.14.3 +2.20.1 diff --git a/0002-Load-system-library.patch b/0002-Load-system-library.patch index 717300c..b8785b0 100644 --- a/0002-Load-system-library.patch +++ b/0002-Load-system-library.patch @@ -4,21 +4,19 @@ Date: Mon, 16 Jan 2017 11:31:32 +0100 Subject: [PATCH 2/6] Load system library --- - src/com/sun/jna/Native.java | 97 ++------------------------------------------- - 1 file changed, 4 insertions(+), 93 deletions(-) + src/com/sun/jna/Native.java | 80 ++----------------------------------- + 1 file changed, 4 insertions(+), 76 deletions(-) diff --git a/src/com/sun/jna/Native.java b/src/com/sun/jna/Native.java -index 91b195f..9ac3815 100644 +index eae060f..11bcc5b 100644 --- a/src/com/sun/jna/Native.java +++ b/src/com/sun/jna/Native.java -@@ -829,101 +829,12 @@ public final class Native implements Version { - - /** +@@ -912,84 +912,12 @@ public final class Native implements Version { * Loads the JNA stub library. -- * First tries jna.boot.library.path, then the system path, then from the -- * jar file. -+ * MODIFIED FROM UPSTREAM - we rip out all sorts of gunk here that is -+ * unnecessary when JNA is properly installed with the OS. + * First tries jna.boot.library.path, then the system path, then from the + * jar file. ++ * MODIFIED FROM UPSTREAM - we rip out all sorts of gunk here that is ++ * unnecessary when JNA is properly installed with the OS. */ private static void loadNativeDispatchLibrary() { - if (!Boolean.getBoolean("jna.nounpack")) { @@ -26,7 +24,7 @@ index 91b195f..9ac3815 100644 - removeTemporaryFiles(); - } - catch(IOException e) { -- System.err.println("JNA Warning: IOException removing temporary files: " + e.getMessage()); +- LOG.log(Level.WARNING, "JNA Warning: IOException removing temporary files", e); - } - } - @@ -39,20 +37,14 @@ index 91b195f..9ac3815 100644 - String dir = dirs.nextToken(); - File file = new File(new File(dir), System.mapLibraryName(libName).replace(".dylib", ".jnilib")); - String path = file.getAbsolutePath(); -- if (DEBUG_JNA_LOAD) { -- System.out.println("Looking in " + path); -- } +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Looking in {0}", path); - if (file.exists()) { - try { -- if (DEBUG_JNA_LOAD) { -- System.out.println("Trying " + path); -- } +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Trying {0}", path); - System.setProperty("jnidispatch.path", path); - System.load(path); - jnidispatchPath = path; -- if (DEBUG_JNA_LOAD) { -- System.out.println("Found jnidispatch at " + path); -- } +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Found jnidispatch at {0}", path); - return; - } catch (UnsatisfiedLinkError ex) { - // Not a problem if already loaded in anoteher class loader @@ -70,37 +62,28 @@ index 91b195f..9ac3815 100644 - ext = "dylib"; - } - path = path.substring(0, path.lastIndexOf(orig)) + ext; -- if (DEBUG_JNA_LOAD) { -- System.out.println("Looking in " + path); -- } +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Looking in {0}", path); - if (new File(path).exists()) { - try { -- if (DEBUG_JNA_LOAD) { -- System.out.println("Trying " + path); -- } +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Trying {0}", path); - System.setProperty("jnidispatch.path", path); - System.load(path); - jnidispatchPath = path; -- if (DEBUG_JNA_LOAD) { -- System.out.println("Found jnidispatch at " + path); -- } +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Found jnidispatch at {0}", path); - return; - } catch (UnsatisfiedLinkError ex) { -- System.err.println("File found at " + path + " but not loadable: " + ex.getMessage()); +- LOG.log(Level.WARNING, "File found at " + path + " but not loadable: " + ex.getMessage(), ex); - } - } - } - } - } -- if (!Boolean.getBoolean("jna.nosys")) { +- String jnaNosys = System.getProperty("jna.nosys", "true"); +- if ((!Boolean.parseBoolean(jnaNosys)) || Platform.isAndroid()) { - try { -- if (DEBUG_JNA_LOAD) { -- System.out.println("Trying (via loadLibrary) " + libName); -- } +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Trying (via loadLibrary) {0}", libName); - System.loadLibrary(libName); -- if (DEBUG_JNA_LOAD) { -- System.out.println("Found jnidispatch on system path"); -- } +- LOG.log(DEBUG_JNA_LOAD_LEVEL, "Found jnidispatch on system path"); - return; - } - catch(UnsatisfiedLinkError e) { @@ -113,10 +96,10 @@ index 91b195f..9ac3815 100644 - throw new UnsatisfiedLinkError("Unable to locate JNA native support library"); - } + jnidispatchPath = "@LIBDIR@/" + System.mapLibraryName("jnidispatch"); -+ System.load(jnidispatchPath); ++ System.load(jnidispatchPath); } static final String JNA_TMPLIB_PREFIX = "jna"; -- -2.14.3 +2.20.1 diff --git a/0003-Tests-headless.patch b/0003-Tests-headless.patch index f879f9d..9a4645d 100644 --- a/0003-Tests-headless.patch +++ b/0003-Tests-headless.patch @@ -8,17 +8,17 @@ Subject: [PATCH 3/6] Tests headless 1 file changed, 1 insertion(+) diff --git a/build.xml b/build.xml -index 63a9cc7..ab9cf52 100644 +index d5c2bbc..835c02b 100644 --- a/build.xml +++ b/build.xml -@@ -1128,6 +1128,7 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc +@@ -1202,6 +1202,7 @@ cd .. + - + -- -2.14.3 +2.20.1 diff --git a/0004-Fix-javadoc-build.patch b/0004-Fix-javadoc-build.patch index f68b0be..a51113d 100644 --- a/0004-Fix-javadoc-build.patch +++ b/0004-Fix-javadoc-build.patch @@ -8,10 +8,10 @@ Subject: [PATCH 4/6] Fix javadoc build 1 file changed, 1 insertion(+) diff --git a/build.xml b/build.xml -index ab9cf52..d1fe4aa 100644 +index 835c02b..cecafd0 100644 --- a/build.xml +++ b/build.xml -@@ -1233,6 +1233,7 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc +@@ -1307,6 +1307,7 @@ cd .. @@ -20,5 +20,5 @@ index ab9cf52..d1fe4aa 100644 -- -2.14.3 +2.20.1 diff --git a/0005-Fix-duplicate-manifest-entry.patch b/0005-Fix-duplicate-manifest-entry.patch index fce0d78..01ea16c 100644 --- a/0005-Fix-duplicate-manifest-entry.patch +++ b/0005-Fix-duplicate-manifest-entry.patch @@ -3,18 +3,17 @@ From: Mikolaj Izdebski Date: Mon, 10 Jul 2017 11:48:43 +0200 Subject: [PATCH 5/6] Fix duplicate manifest entry -Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1469022 --- build.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.xml b/build.xml -index d1fe4aa..c0a0b78 100644 +index cecafd0..ad5794e 100644 --- a/build.xml +++ b/build.xml -@@ -571,9 +571,9 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc - includes="*jnidispatch*" - prefix="com/sun/jna/w32ce-arm"/> +@@ -586,9 +586,9 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc + includes="LICENSE,LGPL2.1,AL2.0" + prefix="META-INF"/> - + @@ -25,5 +24,5 @@ index d1fe4aa..c0a0b78 100644 -- -2.14.3 +2.20.1 diff --git a/0006-Remove-Werror.patch b/0006-Remove-Werror.patch index 60f7f02..951e600 100644 --- a/0006-Remove-Werror.patch +++ b/0006-Remove-Werror.patch @@ -8,15 +8,16 @@ Subject: [PATCH 6/6] Remove -Werror 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/native/Makefile b/native/Makefile -index 3712a9e..73a906f 100644 +index cb3afed..028c201 100644 --- a/native/Makefile +++ b/native/Makefile -@@ -336,10 +336,10 @@ endif - ifeq ($(CC),gcc) +@@ -337,11 +337,11 @@ ifeq ($(CC),gcc) GCC_MAJOR_VERSION = $(shell gcc -dumpversion | cut -f 1 -d '.') ifneq ($(GCC_MAJOR_VERSION),4) -- LOC_CC_OPTS=-Wno-unknown-warning-option -Werror -Wno-clobbered -Wno-unused-variable -+ LOC_CC_OPTS=-Wno-unknown-warning-option -Wno-clobbered -Wno-unused-variable + ifneq ($(GCC_MAJOR_VERSION),3) +- LOC_CC_OPTS=-Wno-unknown-warning-option -Werror -Wno-clobbered -Wno-unused-variable ++ LOC_CC_OPTS=-Wno-unknown-warning-option -Wno-clobbered -Wno-unused-variable + endif endif else - LOC_CC_OPTS=-Wno-unknown-warning-option -Werror -Wno-clobbered -Wno-unused-variable @@ -25,5 +26,5 @@ index 3712a9e..73a906f 100644 # Enable 64-bit builds if the arch demands it -- -2.14.3 +2.20.1 diff --git a/jna.spec b/jna.spec index 95ac17f..b3d0058 100644 --- a/jna.spec +++ b/jna.spec @@ -2,18 +2,20 @@ %bcond_without reflections Name: jna -Version: 4.5.1 -Release: 10%{?dist} +Version: 5.4.0 +Release: 1%{?dist} Summary: Pure Java access to native libraries # Most of code is dual-licensed under either LGPL 2.1+ only or Apache # License 2.0. WeakIdentityHashMap.java was taken from Apache CXF, # which is pure Apache License 2.0. License: (LGPLv2+ or ASL 2.0) and ASL 2.0 + URL: https://github.com/java-native-access/jna/ # ./generate-tarball.sh Source0: %{name}-%{version}-clean.tar.xz Source1: package-list Source2: generate-tarball.sh + Patch0: 0001-Adapt-build.patch # This patch is Fedora-specific for now until we get the huge # JNI library location mess sorted upstream @@ -78,7 +80,7 @@ This package contains the contributed examples for %{name}. %prep -%setup -q -n %{name}-%{version} +%setup -q cp %{SOURCE1} . %patch0 -p1 -b .build %patch1 -p1 -b .loadlib @@ -119,11 +121,14 @@ export JAVA_HOME=%{_jvmdir}/java # We pass -Ddynlink.native which comes from our patch because # upstream doesn't want to default to dynamic linking. +# -Drelease removes the .SNAPSHOT suffix from maven artifact names #ant -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true native compile javadoc jar contrib-jars -ant -Dcompatibility=1.6 -Dplatform.compatibility=1.6 -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true native dist +ant -Drelease -Dcompatibility=1.6 -Dplatform.compatibility=1.6\ + -Dcflags_extra.native="%{optflags}" -Ddynlink.native=true native dist # remove compiled contribs find contrib -name build -exec rm -rf {} \; || : + %install # NOTE: JNA has highly custom code to look for native jars in this # directory. Since this roughly matches the jpackage guidelines, @@ -154,6 +159,9 @@ install -m 755 build/native*/libjnidispatch*.so %{buildroot}%{_libdir}/%{name}/ %changelog +* Thu Aug 01 2019 Marian Koncek - 5.4.0-1 +- Update to upstream version 5.4.0 + * Thu Jul 25 2019 Fedora Release Engineering - 4.5.1-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild diff --git a/sources b/sources index 6c60b2c..2c55cf8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (jna-4.5.1-clean.tar.xz) = e27a5635ebcb746dd7c1de9d408ef803039fe46b865aca4d7352ffda6439f1b4d3e19b2543d7de2790505c3e5d1f4d4749b5cc3e5d2bccfba878d6c6bcb2fcdd +SHA512 (jna-5.4.0-clean.tar.xz) = bcf01008965e83eb954a212bc58862c923e9c72b1486eebccbe000b6eeda356b4b5ee22a1190ec59bdd4d47249fdd0e1b6b2f9fe7cc1eb82a0fc50062f5b6b12