| … | |
… | |
| 3 | # Copyright (c) 2004-2005, Thomas Matthijs <axxo@gentoo.org> |
3 | # Copyright (c) 2004-2005, Thomas Matthijs <axxo@gentoo.org> |
| 4 | # Copyright (c) 2004-2005, Gentoo Foundation |
4 | # Copyright (c) 2004-2005, Gentoo Foundation |
| 5 | # |
5 | # |
| 6 | # Licensed under the GNU General Public License, v2 |
6 | # Licensed under the GNU General Public License, v2 |
| 7 | # |
7 | # |
|
|
8 | # $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v 1.17 2007/01/25 23:02:55 betelgeuse Exp $ |
| 8 | |
9 | |
| 9 | inherit java-utils-2 |
10 | inherit java-utils-2 |
| 10 | |
11 | |
| 11 | # ----------------------------------------------------------------------------- |
12 | # ----------------------------------------------------------------------------- |
| 12 | # @eclass-begin |
13 | # @eclass-begin |
| … | |
… | |
| 15 | # This eclass should be inherited for pure Java packages, or by packages which |
16 | # This eclass should be inherited for pure Java packages, or by packages which |
| 16 | # need to use Java. |
17 | # need to use Java. |
| 17 | # ----------------------------------------------------------------------------- |
18 | # ----------------------------------------------------------------------------- |
| 18 | |
19 | |
| 19 | # ------------------------------------------------------------------------------ |
20 | # ------------------------------------------------------------------------------ |
|
|
21 | # @IUSE |
|
|
22 | # |
|
|
23 | # ebuilds using this eclass can set JAVA_PKG_IUSE and then this eclass |
|
|
24 | # will automatically add deps for them. |
|
|
25 | # |
|
|
26 | # ------------------------------------------------------------------------------ |
|
|
27 | IUSE="${JAVA_PKG_IUSE}" |
|
|
28 | |
|
|
29 | # ------------------------------------------------------------------------------ |
| 20 | # @depend |
30 | # @depend |
| 21 | # |
31 | # |
| 22 | # Java packages need java-config, and a fairly new release of Portage. |
32 | # Java packages need java-config, and a fairly new release of Portage. |
| 23 | # |
33 | # |
| 24 | # JAVA_PKG_E_DEPEND is defined in java-utils.eclass. |
34 | # JAVA_PKG_E_DEPEND is defined in java-utils.eclass. |
| 25 | # ------------------------------------------------------------------------------ |
35 | # ------------------------------------------------------------------------------ |
| 26 | DEPEND="${JAVA_PKG_E_DEPEND}" |
36 | DEPEND="${JAVA_PKG_E_DEPEND}" |
| 27 | |
37 | |
|
|
38 | hasq source ${JAVA_PKG_IUSE} && DEPEND="${DEPEND} source? ( app-arch/zip )" |
|
|
39 | |
| 28 | # ------------------------------------------------------------------------------ |
40 | # ------------------------------------------------------------------------------ |
| 29 | # @rdepend |
41 | # @rdepend |
| 30 | # |
42 | # |
| 31 | # Nothing special for RDEPEND... just the same as DEPEND. |
43 | # Nothing special for RDEPEND... just the same as DEPEND. |
| 32 | # ------------------------------------------------------------------------------ |
44 | # ------------------------------------------------------------------------------ |
| 33 | RDEPEND="${DEPEND}" |
45 | RDEPEND="${DEPEND}" |
| 34 | |
46 | |
| 35 | EXPORT_FUNCTIONS pkg_setup |
47 | EXPORT_FUNCTIONS pkg_setup src_compile |
| 36 | |
48 | |
| 37 | # ------------------------------------------------------------------------------ |
49 | # ------------------------------------------------------------------------------ |
| 38 | # @eclass-pkg_setup |
50 | # @eclass-pkg_setup |
| 39 | # |
51 | # |
| 40 | # pkg_setup initializes the Java environment |
52 | # pkg_setup initializes the Java environment |
| 41 | # ------------------------------------------------------------------------------ |
53 | # ------------------------------------------------------------------------------ |
| 42 | java-pkg-2_pkg_setup() { |
54 | java-pkg-2_pkg_setup() { |
| 43 | java-pkg_init |
55 | java-pkg_init |
|
|
56 | java-pkg_ensure-test |
|
|
57 | } |
|
|
58 | |
|
|
59 | # ------------------------------------------------------------------------------ |
|
|
60 | # @eclass-src_compile |
|
|
61 | # |
|
|
62 | # Default src_compile for java packages |
|
|
63 | # variables: |
|
|
64 | # EANT_BUILD_XML - controls the location of the build.xml (default: ./build.xml) |
|
|
65 | # EANT_FILTER_COMPILER - Calls java-pkg_filter-compiler with the value |
|
|
66 | # EANT_BUILD_TARGET - the ant target/targets to execute (default: jar) |
|
|
67 | # EANT_DOC_TARGET - the target to build extra docs under the doc use flag |
|
|
68 | # (default: the one provided by use_doc in |
|
|
69 | # java-utils-2.eclass) |
|
|
70 | # EANT_GENTOO_CLASSPATH - @see eant documention in java-utils-2.eclass |
|
|
71 | # EANT_EXTRA_ARGS - extra arguments to pass to eant |
|
|
72 | # EANT_ANT_TASKS - modifies the ANT_TASKS variable in the eant environment |
|
|
73 | # param: Parameters are passed to ant verbatim |
|
|
74 | # ------------------------------------------------------------------------------ |
|
|
75 | java-pkg-2_src_compile() { |
|
|
76 | if [[ -e "${EANT_BUILD_XML:=build.xml}" ]]; then |
|
|
77 | [[ "${EANT_FILTER_COMPILER}" ]] && \ |
|
|
78 | java-pkg_filter-compiler ${EANT_FILTER_COMPILER} |
|
|
79 | |
|
|
80 | local antflags="${EANT_BUILD_TARGET:=jar}" |
|
|
81 | hasq doc ${IUSE} && antflags="${antflags} $(use_doc ${EANT_DOC_TARGET})" |
|
|
82 | ANT_TASKS="${ANT_TASKS} ${EANT_ANT_TASKS}" \ |
|
|
83 | eant ${antflags} -f "${EANT_BUILD_XML}" ${EANT_EXTRA_ARGS} "${@}" |
|
|
84 | else |
|
|
85 | echo "${FUNCNAME}: No build.xml found so nothing to do." |
|
|
86 | fi |
| 44 | } |
87 | } |
| 45 | |
88 | |
| 46 | # ------------------------------------------------------------------------------ |
89 | # ------------------------------------------------------------------------------ |
| 47 | # @note |
90 | # @note |
| 48 | # |
91 | # |
| … | |
… | |
| 59 | pre_src_unpack() { |
102 | pre_src_unpack() { |
| 60 | java-pkg-2_pkg_setup |
103 | java-pkg-2_pkg_setup |
| 61 | } |
104 | } |
| 62 | |
105 | |
| 63 | pre_src_compile() { |
106 | pre_src_compile() { |
|
|
107 | if is-java-strict; then |
|
|
108 | echo "Searching for bundled jars:" |
|
|
109 | java-pkg_find-normal-jars || echo "None found." |
|
|
110 | fi |
| 64 | java-pkg-2_pkg_setup |
111 | java-pkg-2_pkg_setup |
| 65 | } |
112 | } |
| 66 | |
113 | |
| 67 | pre_src_install() { |
114 | pre_src_install() { |
| 68 | java-pkg-2_pkg_setup |
115 | java-pkg-2_pkg_setup |