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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Jun 11 14:05:33 2012 UTC (2 years, 6 months ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +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-r1.ebuild,v 1.1 2012/05/13 09:41:50 sera Exp $
4
5 EAPI="4"
6
7 JAVA_PKG_IUSE="doc source test"
8
9 inherit eutils java-pkg-2 java-ant-2 toolchain-funcs vcs-snapshot
10
11 DESCRIPTION="Java Native Access (JNA)"
12 HOMEPAGE="https://github.com/twall/jna#readme"
13 SRC_URI="https://github.com/twall/jna/tarball/3.4.0 -> ${P}.tar.gz"
14
15 LICENSE="LGPL-2.1"
16 SLOT="0"
17 KEYWORDS="~amd64 ~ppc ~x86"
18
19 IUSE="+awt +nio-buffers"
20 REQUIRED_USE="test? ( awt nio-buffers )"
21
22 COMMON_DEP="
23 virtual/libffi"
24 RDEPEND="${COMMON_DEP}
25 >=virtual/jre-1.6"
26 DEPEND="${COMMON_DEP}
27 >=virtual/jdk-1.6
28 dev-java/ant-nodeps:0
29 virtual/pkgconfig
30 test? (
31 dev-java/ant-junit:0
32 dev-java/ant-trax:0
33 )"
34
35 java_prepare() {
36 # delete bundled jars and copy of libffi
37 find -name "*.jar" -exec rm -v {} + || die
38 rm -r native/libffi || die
39
40 epatch "${FILESDIR}/${PV}-build.xml.patch"
41 # respect CFLAGS, don't inhibit warnings, honour CC
42 epatch "${FILESDIR}/${P}-makefile-flags.patch"
43 tc-export CC
44
45 # Build to same directory on 64-bit archs.
46 mkdir build || die
47 ln -snf build build-d64 || die
48
49 if ! use awt ; then
50 sed -i -E "s/^(CDEFINES=.*)/\1 -DNO_JAWT/g" native/Makefile || die
51 fi
52
53 if ! use nio-buffers ; then
54 sed -i -E "s/^(CDEFINES=.*)/\1 -DNO_NIO_BUFFERS/g" native/Makefile || die
55 fi
56 }
57
58 EANT_BUILD_TARGET="jar contrib-jars"
59 EANT_ANT_TASKS="ant-nodeps"
60 EANT_EXTRA_ARGS="-Ddynlink.native=true"
61
62 EANT_TEST_ANT_TASKS="ant-junit ant-nodeps ant-trax"
63 src_test() {
64 local sysprops=""
65
66 # crashes vm (segfault)
67 sed -i -e 's|testRegisterMethods|no&|' test/com/sun/jna/DirectTest.java || die
68
69 # crashes vm, java 7 only (icedtea-7, oracle-jdk-bin-1.7)
70 sed -i -e 's|testGCCallbackOnFinalize|no&|' test/com/sun/jna/CallbacksTest.java || die
71
72 sysprops+=" -Djava.awt.headless=true"
73 sysprops+=" -Djava.io.tmpdir=${T}" #to ensure exec mount
74
75 mkdir -p lib || die
76 java-pkg_jar-from --into lib --build-only junit
77
78 # need to use _JAVA_OPTIONS or add them to the build.xml. ANT_OPTS won't
79 # survive the junit task.
80 _JAVA_OPTIONS="${sysprops}" java-pkg-2_src_test
81 }
82
83 src_install() {
84 java-pkg_dojar build/${PN}.jar
85 java-pkg_dojar contrib/platform/dist/platform.jar
86 java-pkg_doso build/native/libjnidispatch.so
87
88 java-pkg_register-optional-dependency emul-linux-x86-jna #313209
89
90 use source && java-pkg_dosrc src/com
91 use doc && java-pkg_dojavadoc doc/javadoc
92 }

  ViewVC Help
Powered by ViewVC 1.1.20