Gentoo Archives: gentoo-commits

From: "Miroslav Šulc" <fordfrog@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/jna/
Date: Sat, 12 Jun 2021 09:59:04
Message-Id: 1623491683.0bbc0cdf5c9659cec63baf45e9ab6ee909a903f7.fordfrog@gentoo
1 commit: 0bbc0cdf5c9659cec63baf45e9ab6ee909a903f7
2 Author: Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
3 AuthorDate: Wed Jun 9 11:04:50 2021 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 12 09:54:43 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0bbc0cdf
7
8 dev-java/jna: min java restrict to 1.8
9
10 It failed to build with java 11
11
12 Package-Manager: Portage-3.0.18, Repoman-3.0.2
13 Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
14 Closes: https://github.com/gentoo/gentoo/pull/21173
15 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
16
17 dev-java/jna/jna-4.2.2-r2.ebuild | 87 ++++++++++++++++++++++++++++++++++++++++
18 1 file changed, 87 insertions(+)
19
20 diff --git a/dev-java/jna/jna-4.2.2-r2.ebuild b/dev-java/jna/jna-4.2.2-r2.ebuild
21 new file mode 100644
22 index 00000000000..ea4a7b11f2c
23 --- /dev/null
24 +++ b/dev-java/jna/jna-4.2.2-r2.ebuild
25 @@ -0,0 +1,87 @@
26 +# Copyright 1999-2021 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI=7
30 +
31 +JAVA_PKG_IUSE="doc source"
32 +MAVEN_ID="net.java.dev.jna:jna:4.2.2"
33 +
34 +inherit java-pkg-2 java-ant-2 toolchain-funcs
35 +
36 +DESCRIPTION="Java Native Access (JNA)"
37 +HOMEPAGE="https://github.com/java-native-access/jna"
38 +SRC_URI="https://github.com/java-native-access/jna/archive/${PV}.tar.gz -> ${P}.tar.gz"
39 +
40 +LICENSE="LGPL-2.1"
41 +SLOT="4"
42 +KEYWORDS="~amd64 ~x86"
43 +IUSE="+awt +nio-buffers test"
44 +
45 +REQUIRED_USE="test? ( awt nio-buffers )"
46 +
47 +# The tests stall immediately on some systems (not current stable?) when
48 +# the sandbox is active but pass successfully otherwise. Chewi has not
49 +# been able to determine why. This began in 4.2.0 as 4.1.0 worked
50 +# fine. Someone bisect it please. :)
51 +RESTRICT="test"
52 +
53 +CDEPEND="dev-libs/libffi"
54 +DEPEND="${CDEPEND}
55 + virtual/jdk:1.8
56 + x11-libs/libXt
57 + test? (
58 + dev-java/ant-junit:0
59 + dev-java/guava:20
60 + dev-java/javassist:3
61 + dev-java/reflections:0
62 + )"
63 +RDEPEND="${CDEPEND}
64 + virtual/jre:1.8"
65 +BDEPEND="virtual/pkgconfig"
66 +
67 +PATCHES=(
68 + "${FILESDIR}"/${PV}-build.xml.patch
69 + "${FILESDIR}"/${PV}-makefile-flags.patch
70 +)
71 +
72 +JAVA_ANT_REWRITE_CLASSPATH="true"
73 +EANT_BUILD_TARGET="native jar contrib-jars"
74 +EANT_EXTRA_ARGS="-Ddynlink.native=true"
75 +EANT_TEST_EXTRA_ARGS="-Dheadless=true -Djava.io.tmpdir=${T}"
76 +EANT_TEST_GENTOO_CLASSPATH="guava-20,javassist-3,reflections"
77 +
78 +src_prepare() {
79 + default
80 +
81 + # delete bundled jars and copy of libffi
82 + # except native jars because build.xml needs them all
83 + find ! -path "./lib/native/*" -name "*.jar" -delete || die
84 + rm -r native/libffi || die
85 +
86 + if ! use awt ; then
87 + sed -i -E "s/^(CDEFINES=.*)/\1 -DNO_JAWT/g" native/Makefile || die
88 + fi
89 +
90 + if ! use nio-buffers ; then
91 + sed -i -E "s/^(CDEFINES=.*)/\1 -DNO_NIO_BUFFERS/g" native/Makefile || die
92 + fi
93 +
94 + java-pkg-2_src_prepare
95 +}
96 +
97 +src_configure() {
98 + tc-export CC
99 +}
100 +
101 +src_install() {
102 + java-pkg_newjar build/${PN}-min.jar
103 + java-pkg_dojar contrib/platform/dist/${PN}-platform.jar
104 + java-pkg_doso build/native-*/libjnidispatch.so
105 +
106 + use source && java-pkg_dosrc src/*
107 + use doc && java-pkg_dojavadoc doc/javadoc
108 +}
109 +
110 +src_test() {
111 + java-pkg-2_src_test
112 +}