diff options
author | Yuan Liao <liaoyuan@gmail.com> | 2022-01-06 10:03:27 -0800 |
---|---|---|
committer | Miroslav Šulc <fordfrog@gentoo.org> | 2022-01-08 09:56:56 +0100 |
commit | 9eb362c301c9ca8a1968867436506860ac11a759 (patch) | |
tree | 71c61f9a6883c4cf7f8d1acd044349a348a0e366 /dev-java/jna | |
parent | x11-misc/xwallpaper: sync live ebuild (diff) | |
download | gentoo-9eb362c301c9ca8a1968867436506860ac11a759.tar.gz gentoo-9eb362c301c9ca8a1968867436506860ac11a759.tar.bz2 gentoo-9eb362c301c9ca8a1968867436506860ac11a759.zip |
dev-java/jna: Add 5.10.0
Signed-off-by: Yuan Liao <liaoyuan@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/23679
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java/jna')
-rw-r--r-- | dev-java/jna/Manifest | 1 | ||||
-rw-r--r-- | dev-java/jna/files/5.10.0-build.xml.patch | 55 | ||||
-rw-r--r-- | dev-java/jna/files/5.10.0-tests-exclude.patch | 27 | ||||
-rw-r--r-- | dev-java/jna/jna-5.10.0.ebuild | 99 |
4 files changed, 182 insertions, 0 deletions
diff --git a/dev-java/jna/Manifest b/dev-java/jna/Manifest index 20ee000d50be..ac70c75ad8e2 100644 --- a/dev-java/jna/Manifest +++ b/dev-java/jna/Manifest @@ -1 +1,2 @@ DIST jna-4.2.2.tar.gz 58638853 BLAKE2B 3941202ad7839f748c65f1abf53a335f6de7959def06de27a30520457147af3f70f6de54d640718b8314f6e61ab61ee9b26c39812d5cb1f918b8ff714d6b902e SHA512 11ab524f87f6dc7fe3ac8eb0620f9ba392445147770304be7b7fa5cd49de8efed983ad30c16077bfa6419eaf1ff50311a3ded811a78fdcd09bc686ef93ad7f9f +DIST jna-5.10.0.tar.gz 106258319 BLAKE2B f5605fd91bacc1e900e835494c27b0fdb4ba91b0c04bad1757133bed5938603264ce9fba89c5ce7e4644456b752b934f6e205d0131659e77bf0c58c2b44c61cd SHA512 93e1ab659a60d711557eb93620bcbd05f3dbe9c739b256cfb647d8ac2a4038d0bc638c614b58339b2875017ac18b219a4ddeb0d92e5ca25fef2e326bc14ae256 diff --git a/dev-java/jna/files/5.10.0-build.xml.patch b/dev-java/jna/files/5.10.0-build.xml.patch new file mode 100644 index 000000000000..242845bfd356 --- /dev/null +++ b/dev-java/jna/files/5.10.0-build.xml.patch @@ -0,0 +1,55 @@ +diff --git a/build.xml b/build.xml +index ed104c2..cd8895c 100644 +--- a/build.xml ++++ b/build.xml +@@ -182,9 +182,9 @@ + + <target name="-prepare-anttools"> + <subant antfile="build-ant-tools.xml" buildpath="${basedir}"></subant> +- <taskdef name="BuildArmSoftFloatDetector" classname="com.sun.jna.BuildArmSoftFloatDetector" classpath="${build}/ant-tools:$lib/asm-8.0.1.jar" /> +- <taskdef name="CalcAndroidVersion" classname="com.sun.jna.ant.CalcAndroidVersion" classpath="${build}/ant-tools:lib/asm-8.0.1.jar" /> +- <taskdef name="ModuleGenerator" classname="com.sun.jna.ant.ModuleGenerator" classpath="${build}/ant-tools:lib/asm-8.0.1.jar" /> ++ <taskdef name="BuildArmSoftFloatDetector" classname="com.sun.jna.BuildArmSoftFloatDetector" classpath="${build}/ant-tools:${gentoo.classpath}" /> ++ <taskdef name="CalcAndroidVersion" classname="com.sun.jna.ant.CalcAndroidVersion" classpath="${build}/ant-tools:${gentoo.classpath}" /> ++ <taskdef name="ModuleGenerator" classname="com.sun.jna.ant.ModuleGenerator" classpath="${build}/ant-tools:${gentoo.classpath}" /> + </target> + + <target name="-dynamic-properties" depends="-prepare-anttools"> +@@ -385,7 +385,9 @@ + <pathelement path="${build}/${jar}"/> + <pathelement path="${test.classes}"/> + <pathelement path="${build}/${testjar}"/> ++ <!-- + <pathelement path="lib/clover.jar"/> ++ --> + <path refid="test.libs"/> + </path> + </target> +@@ -1265,8 +1267,10 @@ cd .. + <mkdir dir="${build}/jws"/> + <copy todir="${build}/jws" file="${build}/${jar}"/> + <copy todir="${build}/jws" file="${build}/${testjar}"/> ++ <!-- + <copy todir="${build}/jws" file="lib/junit.jar"/> + <copy todir="${build}/jws" file="lib/clover.jar"/> ++ --> + <jar jarfile="${build}/jws/jnidispatch.jar" createUnicodeExtraFields="never" encoding="UTF-8"> + <fileset dir="${build.native}" includes="*jnidispatch.*"/> + </jar> +diff --git a/contrib/platform/build.xml b/contrib/platform/build.xml +index 47fa8ed..a623ce6 100644 +--- a/contrib/platform/build.xml ++++ b/contrib/platform/build.xml +@@ -115,9 +115,9 @@ + + <target name="-prepare-anttools"> + <subant antfile="build-ant-tools.xml" buildpath="${basedir}/../../"></subant> +- <taskdef name="BuildArmSoftFloatDetector" classname="com.sun.jna.BuildArmSoftFloatDetector" classpath="${basedir}/../../build/ant-tools:${basedir}/../../lib/asm-8.0.1.jar" /> +- <taskdef name="CalcAndroidVersion" classname="com.sun.jna.ant.CalcAndroidVersion" classpath="${basedir}/../../build/ant-tools:${basedir}/../../lib/asm-8.0.1.jar" /> +- <taskdef name="ModuleGenerator" classname="com.sun.jna.ant.ModuleGenerator" classpath="${basedir}/../../build/ant-tools:${basedir}/../../lib/asm-8.0.1.jar" /> ++ <taskdef name="BuildArmSoftFloatDetector" classname="com.sun.jna.BuildArmSoftFloatDetector" classpath="${basedir}/../../build/ant-tools:${gentoo.classpath}" /> ++ <taskdef name="CalcAndroidVersion" classname="com.sun.jna.ant.CalcAndroidVersion" classpath="${basedir}/../../build/ant-tools:${gentoo.classpath}" /> ++ <taskdef name="ModuleGenerator" classname="com.sun.jna.ant.ModuleGenerator" classpath="${basedir}/../../build/ant-tools:${gentoo.classpath}" /> + </target> + + <macrodef name="build-manifest"> diff --git a/dev-java/jna/files/5.10.0-tests-exclude.patch b/dev-java/jna/files/5.10.0-tests-exclude.patch new file mode 100644 index 000000000000..e608e2087f44 --- /dev/null +++ b/dev-java/jna/files/5.10.0-tests-exclude.patch @@ -0,0 +1,27 @@ +From 2b50e2296c9c9961fd168abe285f773aecd6437a Mon Sep 17 00:00:00 2001 +From: Yuan Liao <liaoyuan@gmail.com> +Date: Thu, 6 Jan 2022 12:21:22 -0800 +Subject: [PATCH] Skip execution of test classes without any tests + +Signed-off-by: Yuan Liao <liaoyuan@gmail.com> +--- + build.xml | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/build.xml b/build.xml +index ed104c2..9fb15ae 100644 +--- a/build.xml ++++ b/build.xml +@@ -1388,6 +1388,9 @@ cd .. + <fileset dir="${test.src}" excludes="${tests.exclude-patterns}"> + <patternset includes="${tests.include}"/> + <include name="${tests.platform}"/> ++ <exclude name="com/sun/jna/DefaultMethodInvocationTest.java"/> ++ <exclude name="com/sun/jna/ELFAnalyserTest.java"/> ++ <exclude name="com/sun/jna/PrematureGCTest.java"/> + <exclude name="${tests.exclude}"/> + </fileset> + </batchtest> +-- +2.34.1 + diff --git a/dev-java/jna/jna-5.10.0.ebuild b/dev-java/jna/jna-5.10.0.ebuild new file mode 100644 index 000000000000..b7730f9d8e7a --- /dev/null +++ b/dev-java/jna/jna-5.10.0.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" +MAVEN_ID="net.java.dev.jna:jna:5.10.0" + +inherit java-pkg-2 java-ant-2 toolchain-funcs + +DESCRIPTION="Java Native Access" +HOMEPAGE="https://github.com/java-native-access/jna" +SRC_URI="https://github.com/java-native-access/jna/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="|| ( Apache-2.0 LGPL-2.1+ )" +SLOT="4" +KEYWORDS="~amd64 ~ppc64 ~x86" + +BDEPEND=" + virtual/pkgconfig +" + +CDEPEND=" + >=dev-libs/libffi-3.4:= +" + +DEPEND=" + >=virtual/jdk-1.8:* + dev-java/animal-sniffer-annotations:0 + dev-java/ant-core:0 + dev-java/asm:9 + test? ( + dev-java/ant-junit:0 + dev-java/junit:4 + dev-java/reflections:0 + ) + ${CDEPEND} +" + +RDEPEND=" + >=virtual/jre-1.8:* + ${CDEPEND} +" + +DOCS=( README.md CHANGES.md OTHERS TODO ) +PATCHES=( + "${FILESDIR}/${PV}-build.xml.patch" + "${FILESDIR}/${PV}-tests-exclude.patch" + "${FILESDIR}/4.2.2-makefile-flags.patch" +) + +JAVA_ANT_REWRITE_CLASSPATH="true" +JAVA_PKG_BSFIX_NAME="build.xml build-ant-tools.xml" +EANT_BUILD_TARGET="jar contrib-jars" +EANT_EXTRA_ARGS="-Dbuild-native=true -Dcompatibility=1.8 -Ddynlink.native=true" +EANT_TEST_EXTRA_ARGS="-Djava.io.tmpdir=${T}" +EANT_TEST_GENTOO_CLASSPATH="animal-sniffer-annotations,reflections" + +pkg_setup() { + java-pkg-2_pkg_setup + + EANT_GENTOO_CLASSPATH_EXTRA="$(java-pkg_getjars --build-only \ + animal-sniffer-annotations,ant-core,asm-9)" + + # Any spaces in paths returned by toolchain-funcs and options like MAKEOPTS + # could cause trouble in EANT_EXTRA_ARGS when Java eclasses process the + # variable's value, so define them in ANT_OPTS instead + ANT_OPTS="-DCC='$(tc-getCC)'" + # Parallel build does not respect dependency relationships between objects + ANT_OPTS+=" -DEXTRA_MAKE_OPTS='${MAKEOPTS} -j1'" +} + +src_prepare() { + default + + # Eliminate build.xml's dependency on bundled native JARs + sed -i -e '/zipfileset src="${lib.native}/,+2d' build.xml || + die "Failed to delete lines referencing bundled JARs in build.xml" + + # Clean up bundled JARs and libffi + java-pkg_clean + rm -r native/libffi || die "Failed to remove bundled libffi" + + java-pkg-2_src_prepare +} + +src_test() { + java-pkg-2_src_test +} + +src_install() { + java-pkg_newjar "build/${PN}-min.jar" + java-pkg_dojar "contrib/platform/dist/${PN}-platform.jar" + java-pkg_doso build/native-*/libjnidispatch.so + einstalldocs + + use source && java-pkg_dosrc src/* + use doc && java-pkg_dojavadoc doc/javadoc +} |