/[gentoo-x86]/dev-java/jna/jna-3.4.0.ebuild
Gentoo

Contents of /dev-java/jna/jna-3.4.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Mon Jun 11 14:05:33 2012 UTC (2 years, 1 month ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +2 -2 lines
Use matching name for download & S to make the ebuild forward-proof to vcs-snapshot API.

(Portage version: 2.2.0_alpha110_p20/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-java/jna/jna-3.4.0.ebuild,v 1.8 2012/06/07 21:18:08 ranger Exp $
4
5 EAPI="4"
6
7 JAVA_PKG_IUSE="test doc source"
8 WANT_ANT_TASKS="ant-nodeps"
9
10 inherit java-pkg-2 java-ant-2 toolchain-funcs flag-o-matic vcs-snapshot
11
12 DESCRIPTION="Java Native Access (JNA)"
13 HOMEPAGE="https://github.com/twall/jna#readme"
14 SRC_URI="https://github.com/twall/jna/tarball/3.4.0 -> ${P}.tar.gz"
15 LICENSE="LGPL-2.1"
16 SLOT="0"
17 KEYWORDS="amd64 ppc x86"
18 IUSE="+awt +nio-buffers"
19 REQUIRED_USE="test? ( awt nio-buffers )"
20
21 COMMON_DEP="
22 virtual/libffi"
23 RDEPEND="${COMMON_DEP}
24 >=virtual/jre-1.6"
25 DEPEND="${COMMON_DEP}
26 >=virtual/jdk-1.6
27 virtual/pkgconfig
28 test? (
29 dev-java/junit:0
30 dev-java/ant-junit:0
31 dev-java/ant-trax:0
32 )"
33
34 JAVA_ANT_REWRITE_CLASSPATH="true"
35 EANT_BUILD_TARGET="jar contrib-jars"
36
37 java_prepare() {
38 # delete bundled jars and copy of libffi
39 find -name "*.jar" -exec rm -v {} + || die
40 rm -r native/libffi || die
41
42 # respect CFLAGS, don't inhibit warnings, honour CC
43 # fix build.xml file
44 epatch "${FILESDIR}/${PV}-makefile-flags.patch" "${FILESDIR}/${PV}-build.xml.patch"
45
46 # Build to same directory on 64-bit archs.
47 mkdir build || die
48 ln -snf build build-d64 || die
49
50 if ! use awt ; then
51 sed -i -E "s/^(CDEFINES=.*)/\1 -DNO_JAWT/g" native/Makefile || die
52 fi
53
54 if ! use nio-buffers ; then
55 sed -i -E "s/^(CDEFINES=.*)/\1 -DNO_NIO_BUFFERS/g" native/Makefile || die
56 fi
57 }
58
59 EANT_EXTRA_ARGS="-Ddynlink.native=true"
60
61 EANT_TEST_ANT_TASKS="ant-junit ant-nodeps ant-trax"
62 src_test() {
63 local sysprops=""
64
65 # crashes vm (segfault)
66 sed -i -e 's|testRegisterMethods|no&|' test/com/sun/jna/DirectTest.java || die
67
68 # crashes vm, java 7 only (icedtea-7, oracle-jdk-bin-1.7)
69 sed -i -e 's|testGCCallbackOnFinalize|no&|' test/com/sun/jna/CallbacksTest.java || die
70
71 sysprops+=" -Djava.awt.headless=true"
72 sysprops+=" -Djava.io.tmpdir=${T}" #to ensure exec mount
73
74 mkdir -p lib || die
75 java-pkg_jar-from --into lib --build-only junit
76
77 # need to use _JAVA_OPTIONS or add them to the build.xml. ANT_OPTS won't
78 # survive the junit task.
79 _JAVA_OPTIONS="${sysprops}" java-pkg-2_src_test
80 }
81
82 src_install() {
83 java-pkg_dojar build/${PN}.jar
84 java-pkg_dojar contrib/platform/dist/platform.jar
85 java-pkg_doso build/native/libjnidispatch.so
86 use source && java-pkg_dosrc src/com
87 use doc && java-pkg_dojavadoc doc/javadoc
88 }

  ViewVC Help
Powered by ViewVC 1.1.20