Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/jnr-ffi/, dev-java/jnr-ffi/files/
Date: Sun, 28 Nov 2021 19:02:19
Message-Id: 1638126124.10579138b9895a51dfaad4d6b6bccb5908045ee0.sam@gentoo
1 commit: 10579138b9895a51dfaad4d6b6bccb5908045ee0
2 Author: Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
3 AuthorDate: Sun Nov 28 09:45:00 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 28 19:02:04 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10579138
7
8 dev-java/jnr-ffi: undo 2.0.2 removal
9
10 Bug: https://bugs.gentoo.org/827215
11 Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 dev-java/jnr-ffi/Manifest | 1 +
15 dev-java/jnr-ffi/files/jnr-ffi-2.0.2-junit48.patch | 11 +
16 dev-java/jnr-ffi/files/jnr-ffi_maven-build.xml | 250 +++++++++++++++++++++
17 dev-java/jnr-ffi/jnr-ffi-2.0.2.ebuild | 60 +++++
18 4 files changed, 322 insertions(+)
19
20 diff --git a/dev-java/jnr-ffi/Manifest b/dev-java/jnr-ffi/Manifest
21 index a1833f95b1e1..a62c50306aae 100644
22 --- a/dev-java/jnr-ffi/Manifest
23 +++ b/dev-java/jnr-ffi/Manifest
24 @@ -1 +1,2 @@
25 +DIST jnr-ffi-2.0.2.tar.gz 170707 BLAKE2B fc4f1dcea51939b6098b980b4962380e58ba590ea9d4cdba7823c1372bd645d985ae25d8ebf1f0b575a0e4b5c192e5595094076d3cd44e4bb3c077dd838c170f SHA512 80a932408f5ceaf19fd7a399b786aa0d7b9251ea144bc2755bcf3cdc3aea85615a1faa001bbcd3072bc0eead2aaa30d0bbead5f96c82c4b9e455c1ed1379b4c0
26 DIST jnr-ffi-2.2.8-sources.tar.gz 261959 BLAKE2B 16f7b89c88a61fa07da65d4e5287258f96550b93898bb7313ddd62d1f002276da86aca2c79874eccb466eaebcad5181ff33539996a6558b6d79ce9280cf9c0a9 SHA512 15187d90f15ad82cb6cac0617806ab7d0322bfcb4f44523f2272f93f19ec115625806c9d450bffaa57db32c70906328c8edc905046465b0ec3eb6ff52e500b42
27
28 diff --git a/dev-java/jnr-ffi/files/jnr-ffi-2.0.2-junit48.patch b/dev-java/jnr-ffi/files/jnr-ffi-2.0.2-junit48.patch
29 new file mode 100644
30 index 000000000000..92b4cb2bcfc3
31 --- /dev/null
32 +++ b/dev-java/jnr-ffi/files/jnr-ffi-2.0.2-junit48.patch
33 @@ -0,0 +1,11 @@
34 +--- a/src/test/java/jnr/ffi/ObjectReferenceManagerTest.java
35 ++++ b/src/test/java/jnr/ffi/ObjectReferenceManagerTest.java
36 +@@ -35,7 +35,7 @@
37 + Pointer ptr = referenceManager.add(bar);
38 + Pointer ptr2 = referenceManager.add(bar2);
39 + assertNotSame(ptr, ptr2);
40 +- assertNotEquals(ptr, ptr2);
41 ++ assertTrue(!ptr.equals(ptr2));
42 + assertSame(bar, referenceManager.get(ptr));
43 + assertSame(bar2, referenceManager.get(ptr2));
44 + }
45
46 diff --git a/dev-java/jnr-ffi/files/jnr-ffi_maven-build.xml b/dev-java/jnr-ffi/files/jnr-ffi_maven-build.xml
47 new file mode 100644
48 index 000000000000..0337f347bec0
49 --- /dev/null
50 +++ b/dev-java/jnr-ffi/files/jnr-ffi_maven-build.xml
51 @@ -0,0 +1,250 @@
52 +<?xml version="1.0" encoding="UTF-8"?>
53 +
54 +<!-- ====================================================================== -->
55 +<!-- Ant build file (http://ant.apache.org/) for Ant 1.6.2 or above. -->
56 +<!-- ====================================================================== -->
57 +
58 +<!-- ====================================================================== -->
59 +<!-- ===================== - DO NOT EDIT THIS FILE! - ===================== -->
60 +<!-- ====================================================================== -->
61 +<!-- -->
62 +<!-- Any modifications will be overwritten. -->
63 +<!-- -->
64 +<!-- Generated by Maven Ant Plugin on 1/9/12 11:18 AM -->
65 +<!-- See: http://maven.apache.org/plugins/maven-ant-plugin/ -->
66 +<!-- -->
67 +<!-- ====================================================================== -->
68 +
69 +<project name="jnr-ffi-from-maven" default="package" basedir=".">
70 +
71 + <!-- ====================================================================== -->
72 + <!-- Build environment properties -->
73 + <!-- ====================================================================== -->
74 +
75 + <property file="${user.home}/.m2/maven.properties"/>
76 + <property file="maven-build.properties"/>
77 +
78 + <property name="maven.build.finalName" value="jnr-ffi-0.6.0"/>
79 + <property name="maven.build.dir" value="target"/>
80 + <property name="maven.build.outputDir" value="${maven.build.dir}/classes"/>
81 + <property name="maven.build.srcDir.0" value="src/main/java"/>
82 + <property name="maven.build.resourceDir.0" value="src/main/resources"/>
83 + <property name="maven.build.testOutputDir" value="${maven.build.dir}/test-classes"/>
84 + <property name="maven.build.testDir.0" value="src/test/java"/>
85 + <property name="maven.build.testResourceDir.0" value="src/test/resources"/>
86 + <property name="maven.test.reports" value="${maven.build.dir}/test-reports"/>
87 + <property name="maven.reporting.outputDirectory" value="${maven.build.dir}/site"/>
88 +
89 + <property name="maven.repo.local" value="${user.home}/.m2/repository"/>
90 + <property name="maven.settings.offline" value="false"/>
91 + <property name="maven.settings.interactiveMode" value="true"/>
92 +
93 + <!-- ====================================================================== -->
94 + <!-- Defining classpaths -->
95 + <!-- ====================================================================== -->
96 +
97 + <path id="build.classpath">
98 + <pathelement location="${maven.repo.local}/com/github/jnr/jffi/1.0.11/jffi-1.0.11.jar"/>
99 + <pathelement location="${maven.repo.local}/asm/asm/3.2/asm-3.2.jar"/>
100 + <pathelement location="${maven.repo.local}/asm/asm-commons/3.2/asm-commons-3.2.jar"/>
101 + <pathelement location="${maven.repo.local}/asm/asm-analysis/3.2/asm-analysis-3.2.jar"/>
102 + <pathelement location="${maven.repo.local}/asm/asm-tree/3.2/asm-tree-3.2.jar"/>
103 + <pathelement location="${maven.repo.local}/asm/asm-util/3.2/asm-util-3.2.jar"/>
104 + <pathelement location="${maven.repo.local}/com/github/jnr/jnr-x86asm/1.0.1/jnr-x86asm-1.0.1.jar"/>
105 + </path>
106 + <path id="build.test.classpath">
107 + <pathelement location="${maven.repo.local}/junit/junit/4.8.2/junit-4.8.2.jar"/>
108 + <pathelement location="${maven.repo.local}/com/github/jnr/jffi/1.0.11/jffi-1.0.11.jar"/>
109 + <pathelement location="${maven.repo.local}/com/github/jnr/jffi/1.0.11/jffi-1.0.11-native.jar"/>
110 + <pathelement location="${maven.repo.local}/asm/asm/3.2/asm-3.2.jar"/>
111 + <pathelement location="${maven.repo.local}/asm/asm-commons/3.2/asm-commons-3.2.jar"/>
112 + <pathelement location="${maven.repo.local}/asm/asm-analysis/3.2/asm-analysis-3.2.jar"/>
113 + <pathelement location="${maven.repo.local}/asm/asm-tree/3.2/asm-tree-3.2.jar"/>
114 + <pathelement location="${maven.repo.local}/asm/asm-util/3.2/asm-util-3.2.jar"/>
115 + <pathelement location="${maven.repo.local}/com/github/jnr/jnr-x86asm/1.0.1/jnr-x86asm-1.0.1.jar"/>
116 + </path>
117 +
118 + <!-- ====================================================================== -->
119 + <!-- Cleaning up target -->
120 + <!-- ====================================================================== -->
121 +
122 + <target name="clean" description="Clean the output directory">
123 + <delete dir="${maven.build.dir}"/>
124 + </target>
125 +
126 + <!-- ====================================================================== -->
127 + <!-- Compilation target -->
128 + <!-- ====================================================================== -->
129 +
130 + <target name="compile" depends="get-deps" description="Compile the code">
131 + <mkdir dir="${maven.build.outputDir}"/>
132 + <javac destdir="${maven.build.outputDir}"
133 + nowarn="false"
134 + debug="true"
135 + optimize="false"
136 + deprecation="true"
137 + target="1.1"
138 + verbose="false"
139 + fork="false"
140 + source="1.3">
141 + <src>
142 + <pathelement location="${maven.build.srcDir.0}"/>
143 + </src>
144 + <classpath refid="build.classpath"/>
145 + </javac>
146 + </target>
147 +
148 + <!-- ====================================================================== -->
149 + <!-- Test-compilation target -->
150 + <!-- ====================================================================== -->
151 +
152 + <target name="compile-tests"
153 + depends="compile"
154 + description="Compile the test code"
155 + unless="maven.test.skip">
156 + <mkdir dir="${maven.build.testOutputDir}"/>
157 + <javac destdir="${maven.build.testOutputDir}"
158 + nowarn="false"
159 + debug="true"
160 + optimize="false"
161 + deprecation="true"
162 + target="1.1"
163 + verbose="false"
164 + fork="false"
165 + source="1.3">
166 + <src>
167 + <pathelement location="${maven.build.testDir.0}"/>
168 + </src>
169 + <classpath>
170 + <path refid="build.test.classpath"/>
171 + <pathelement location="${maven.build.outputDir}"/>
172 + </classpath>
173 + </javac>
174 + </target>
175 +
176 + <!-- ====================================================================== -->
177 + <!-- Run all tests -->
178 + <!-- ====================================================================== -->
179 +
180 + <target name="test"
181 + depends="compile-tests, junit-missing"
182 + unless="junit.skipped"
183 + description="Run the test cases">
184 + <mkdir dir="${maven.test.reports}"/>
185 + <junit printSummary="yes" haltonerror="true" haltonfailure="true" fork="true" dir=".">
186 + <sysproperty key="basedir" value="."/>
187 + <formatter type="xml"/>
188 + <formatter type="plain" usefile="false"/>
189 + <classpath>
190 + <path refid="build.test.classpath"/>
191 + <pathelement location="${maven.build.outputDir}"/>
192 + <pathelement location="${maven.build.testOutputDir}"/>
193 + </classpath>
194 + <batchtest todir="${maven.test.reports}" unless="test">
195 + <fileset dir="${maven.build.testDir.0}">
196 + <include name="**/Test*.java"/>
197 + <include name="**/*Test.java"/>
198 + <include name="**/*TestCase.java"/>
199 + <exclude name="**/*Abstract*Test.java"/>
200 + </fileset>
201 + </batchtest>
202 + <batchtest todir="${maven.test.reports}" if="test">
203 + <fileset dir="${maven.build.testDir.0}">
204 + <include name="**/${test}.java"/>
205 + <exclude name="**/*Abstract*Test.java"/>
206 + </fileset>
207 + </batchtest>
208 + </junit>
209 + </target>
210 +
211 + <target name="test-junit-present">
212 + <available classname="junit.framework.Test" property="junit.present"/>
213 + </target>
214 +
215 + <target name="test-junit-status"
216 + depends="test-junit-present">
217 + <condition property="junit.missing">
218 + <and>
219 + <isfalse value="${junit.present}"/>
220 + <isfalse value="${maven.test.skip}"/>
221 + </and>
222 + </condition>
223 + <condition property="junit.skipped">
224 + <or>
225 + <isfalse value="${junit.present}"/>
226 + <istrue value="${maven.test.skip}"/>
227 + </or>
228 + </condition>
229 + </target>
230 +
231 + <target name="junit-missing"
232 + depends="test-junit-status"
233 + if="junit.missing">
234 + <echo>=================================== WARNING ===================================</echo>
235 + <echo> JUnit is not present in your $ANT_HOME/lib directory. Tests not executed.</echo>
236 + <echo>===============================================================================</echo>
237 + </target>
238 +
239 + <!-- ====================================================================== -->
240 + <!-- Javadoc target -->
241 + <!-- ====================================================================== -->
242 +
243 + <target name="javadoc" description="Generates the Javadoc of the application">
244 + <javadoc sourcepath="${maven.build.srcDir.0}"
245 + packagenames="*"
246 + destdir="${maven.reporting.outputDirectory}/apidocs"
247 + access="protected"
248 + old="false"
249 + verbose="false"
250 + version="true"
251 + use="true"
252 + author="true"
253 + splitindex="false"
254 + nodeprecated="false"
255 + nodeprecatedlist="false"
256 + notree="false"
257 + noindex="false"
258 + nohelp="false"
259 + nonavbar="false"
260 + serialwarn="false"
261 + charset="ISO-8859-1"
262 + linksource="false"
263 + breakiterator="false"/>
264 + </target>
265 +
266 + <!-- ====================================================================== -->
267 + <!-- Package target -->
268 + <!-- ====================================================================== -->
269 +
270 + <target name="package" depends="compile,test" description="Package the application">
271 + <jar jarfile="${maven.build.dir}/${maven.build.finalName}.jar"
272 + compress="true"
273 + index="false"
274 + basedir="${maven.build.outputDir}"
275 + excludes="**/package.html"/>
276 + </target>
277 +
278 + <!-- ====================================================================== -->
279 + <!-- A dummy target for the package named after the type it creates -->
280 + <!-- ====================================================================== -->
281 +
282 + <target name="jar" depends="package" description="Builds the jar for the application"/>
283 +
284 + <!-- ====================================================================== -->
285 + <!-- Download dependencies target -->
286 + <!-- ====================================================================== -->
287 +
288 + <target name="test-offline">
289 + <condition property="maven.mode.offline">
290 + <equals arg1="${maven.settings.offline}" arg2="true"/>
291 + </condition>
292 + </target>
293 +
294 + <target name="get-deps"
295 + depends="test-offline"
296 + description="Download all dependencies"
297 + unless="maven.mode.offline">
298 + <!-- removed -->
299 + </target>
300 +
301 +</project>
302
303 diff --git a/dev-java/jnr-ffi/jnr-ffi-2.0.2.ebuild b/dev-java/jnr-ffi/jnr-ffi-2.0.2.ebuild
304 new file mode 100644
305 index 000000000000..5fd24c27ec3c
306 --- /dev/null
307 +++ b/dev-java/jnr-ffi/jnr-ffi-2.0.2.ebuild
308 @@ -0,0 +1,60 @@
309 +# Copyright 1999-2021 Gentoo Authors
310 +# Distributed under the terms of the GNU General Public License v2
311 +
312 +EAPI="5"
313 +
314 +JAVA_PKG_IUSE="doc source test"
315 +
316 +inherit java-pkg-2 java-ant-2
317 +
318 +DESCRIPTION="An abstracted interface to invoking native functions from java"
319 +HOMEPAGE="https://github.com/jnr/jnr-ffi"
320 +SRC_URI="https://github.com/jnr/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
321 +
322 +LICENSE="|| ( Apache-2.0 LGPL-3 )"
323 +SLOT="2"
324 +KEYWORDS="amd64 ~arm64 ~ppc64 x86"
325 +
326 +COMMON_DEP="
327 + dev-java/jffi:1.2
328 + dev-java/jnr-x86asm:1.0
329 + dev-java/asm:4"
330 +
331 +RDEPEND="${COMMON_DEP}
332 + >=virtual/jre-1.5"
333 +
334 +DEPEND="${COMMON_DEP}
335 + >=virtual/jdk-1.5
336 + test? (
337 + dev-java/ant-junit:0
338 + >=dev-java/junit-4.8:4
339 + )"
340 +
341 +java_prepare() {
342 + cp "${FILESDIR}"/${PN}_maven-build.xml build.xml || die
343 + epatch "${FILESDIR}"/${P}-junit48.patch
344 +}
345 +
346 +JAVA_ANT_REWRITE_CLASSPATH="yes"
347 +JAVA_ANT_CLASSPATH_TAGS="${JAVA_ANT_CLASSPATH_TAGS} javadoc"
348 +JAVA_ANT_ENCODING="UTF-8"
349 +
350 +EANT_GENTOO_CLASSPATH="asm-4,jffi-1.2,jnr-x86asm-1.0"
351 +EANT_EXTRA_ARGS="-Dmaven.build.finalName=${PN}"
352 +
353 +EANT_TEST_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH},junit-4"
354 +
355 +src_test() {
356 + # build native test library
357 + emake BUILD_DIR=build -f libtest/GNUmakefile
358 +
359 + _JAVA_OPTIONS="-Djnr.ffi.library.path=build" \
360 + java-pkg-2_src_test
361 +}
362 +
363 +src_install() {
364 + java-pkg_dojar target/${PN}.jar
365 +
366 + use doc && java-pkg_dojavadoc target/site/apidocs
367 + use source && java-pkg_dosrc src/main/java/*
368 +}