Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 163262
Collapse All | Expand All

(-)java-ant-2.eclass (-24 / +3 lines)
Lines 126-158 Link Here
126
JAVA_PKG_BSFIX_SOURCE_TAGS=${JAVA_PKG_BSFIX_SOURCE_TAGS:-"javadoc javac xjavac javac.preset"}
126
JAVA_PKG_BSFIX_SOURCE_TAGS=${JAVA_PKG_BSFIX_SOURCE_TAGS:-"javadoc javac xjavac javac.preset"}
127
127
128
# ------------------------------------------------------------------------------
128
# ------------------------------------------------------------------------------
129
# @public java-ant_src_unpack
129
# @global JAVA_ANT_IGNORE_SYSTEM_CLASSES
130
#
130
#
131
# Unpacks the source, and attempts to fix build files.
131
# Rewrites available tasks to ignore ant classpath.
132
# variable JAVA_ANT_IGNORE_SYSTEM_CLASSES:
133
#	ignore ant classpath in available tasks
134
# ------------------------------------------------------------------------------
135
post_src_unpack() {
136
	if java-pkg_func-exists ant_src_unpack; then
137
		die "ant_src_unpack is no longer support, should use just src_unpack"
138
	fi
139
	java-ant_bsfix
140
	[[ "${JAVA_ANT_IGNORE_SYSTEM_CLASSES}" ]] \
141
		&& java-ant_ignore-system-classes "${S}/build.xml"
142
}
143
144
# ------------------------------------------------------------------------------
145
# @private ant_src_unpack
146
#
132
#
147
# Helper function which does the actual unpacking
133
# default: off
148
# ------------------------------------------------------------------------------
134
# ------------------------------------------------------------------------------
149
# TODO maybe use base.eclass for some patching love?
150
#ant_src_unpack() {
151
#	debug-print-function ${FUNCNAME} $*
152
#	if [[ -n "${A}" ]]; then
153
#		unpack ${A}
154
#	fi
155
#}
156
135
157
# ------------------------------------------------------------------------------
136
# ------------------------------------------------------------------------------
158
# @private java-ant_bsfix
137
# @private java-ant_bsfix
(-)java-pkg-2.eclass (-44 lines)
Lines 89-137 Link Here
89
}
89
}
90
90
91
# ------------------------------------------------------------------------------
91
# ------------------------------------------------------------------------------
92
# @note
93
#
94
# We need to initialize the environment in every function because Portage
95
# will source /etc/profile between phases and trample all over the env.
96
# This is accomplished by phase hooks, which is available with newer versions of
97
# portage.
98
# ------------------------------------------------------------------------------
99
100
pre_pkg_setup() {
101
	java-pkg-2_pkg_setup
102
}
103
104
pre_src_unpack() {
105
	java-pkg-2_pkg_setup
106
}
107
108
pre_src_compile() {
109
	if is-java-strict; then
110
		echo "Searching for bundled jars:"
111
		java-pkg_find-normal-jars || echo "None found."
112
		echo "Searching for bundled classes (no output if none found):"
113
		find "${WORKDIR}" -name "*.class"
114
		echo "Search done."
115
	fi
116
	java-pkg-2_pkg_setup
117
}
118
119
pre_src_install() {
120
	java-pkg-2_pkg_setup
121
}
122
123
pre_src_test() {
124
	java-pkg-2_pkg_setup
125
}
126
127
pre_pkg_preinst() {
128
	java-pkg-2_pkg_setup
129
}
130
131
pre_pkg_postinst() {
132
	java-pkg-2_pkg_setup
133
}
134
135
# ------------------------------------------------------------------------------
136
# @eclass-end
92
# @eclass-end
137
# ------------------------------------------------------------------------------
93
# ------------------------------------------------------------------------------
(-)java-utils-2.eclass (-11 / +37 lines)
Lines 59-68 Link Here
59
# -----------------------------------------------------------------------------
59
# -----------------------------------------------------------------------------
60
# @variable-internal JAVA_PKG_PORTAGE_DEP
60
# @variable-internal JAVA_PKG_PORTAGE_DEP
61
#
61
#
62
# The version of portage we need to function properly. At this moment it's
62
# The version of portage we need to function properly. Previously it was
63
# portage with phase hooks support.
63
# portage with phase hooks support but now we use a version with proper env
64
# saving.
64
# -----------------------------------------------------------------------------
65
# -----------------------------------------------------------------------------
65
JAVA_PKG_PORTAGE_DEP=">=sys-apps/portage-2.1_pre1"
66
JAVA_PKG_PORTAGE_DEP=">=sys-apps/portage-2.1.2.7"
66
67
67
# -----------------------------------------------------------------------------
68
# -----------------------------------------------------------------------------
68
# @variable-internal JAVA_PKG_E_DEPEND
69
# @variable-internal JAVA_PKG_E_DEPEND
Lines 1781-1791 Link Here
1781
# EANT_GENTOO_CLASSPATH - calls java-pkg_getjars for the value and adds to the
1820
# EANT_GENTOO_CLASSPATH - calls java-pkg_getjars for the value and adds to the
1782
#                         gentoo.classpath property. Be sure to call
1821
#                         gentoo.classpath property. Be sure to call
1783
#                         java-ant_rewrite-classpath in src_unpack.
1822
#                         java-ant_rewrite-classpath in src_unpack.
1823
# JAVA_PKG_NO_BUNDLED_SEARCH - Don't search for bundled jars or class files
1784
# *ANT_TASKS - used to determine ANT_TASKS before calling Ant.
1824
# *ANT_TASKS - used to determine ANT_TASKS before calling Ant.
1785
# ------------------------------------------------------------------------------
1825
# ------------------------------------------------------------------------------
1786
eant() {
1826
eant() {
1787
	debug-print-function ${FUNCNAME} $*
1827
	debug-print-function ${FUNCNAME} $*
1788
1828
1829
	if [[ ${EBUILD_PHASE} = compile ]]; then
1830
		# Used to be done in hooks in java-ant-2.eclass but moved here so that we can
1831
		# finally get rid of the hooks without breaking stuff
1832
1833
		[[ "${JAVA_ANT_IGNORE_SYSTEM_CLASSES}" && "${JAVA_PKG_BSFIX}" ]] \
1834
			&& java-ant_ignore-system-classes "${S}/build.xml"
1835
1836
		if hasq java-ant-2 ${INHERITED}; then
1837
			java-ant_bsfix
1838
		fi
1839
1840
		# eant can be called multiple times
1841
		JAVA_PKG_BSFIX="off"
1842
1843
		if [[ -z ${JAVA_PKG_NO_BUNDLED_SEARCH} ]] && is-java-strict; then
1844
			echo "Searching for bundled jars:"
1845
			java-pkg_find-normal-jars || echo "None found."
1846
			echo "Searching for bundled classes (no output if none found):"
1847
			find "${WORKDIR}" -name "*.class"
1848
			echo "Search done."
1849
			JAVA_PKG_NO_BUNDLED_SEARCH=true # eant can be called many times
1850
		fi
1851
	fi
1852
1789
	if ! hasq java-ant-2 ${INHERITED}; then
1853
	if ! hasq java-ant-2 ${INHERITED}; then
1790
		local msg="You should inherit java-ant-2 when using eant"
1854
		local msg="You should inherit java-ant-2 when using eant"
1791
		java-pkg_announce-qa-violation "${msg}"
1855
		java-pkg_announce-qa-violation "${msg}"
Lines 1797-1803 Link Here
1797
	local compiler="${GENTOO_COMPILER}"
1861
	local compiler="${GENTOO_COMPILER}"
1798
1862
1799
	local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}"
1863
	local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}"
1800
1801
	local build_compiler="$(source ${compiler_env} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER})"
1864
	local build_compiler="$(source ${compiler_env} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER})"
1802
	if [[ "${compiler}" != "javac" && -z "${build_compiler}" ]]; then
1865
	if [[ "${compiler}" != "javac" && -z "${build_compiler}" ]]; then
1803
		die "ANT_BUILD_COMPILER undefined in ${compiler_env}"
1866
		die "ANT_BUILD_COMPILER undefined in ${compiler_env}"
Lines 2018-2023 Link Here
2018
		I_WANT_GLOBAL_JAVA_OPTIONS="true"
2081
		I_WANT_GLOBAL_JAVA_OPTIONS="true"
2019
	fi
2082
	fi
2020
2083
2084
	if java-pkg_func-exists ant_src_unpack; then
2085
		java-pkg_announce-qa-violation "Using old ant_src_unpack. Should be src_unpack"
2086
	fi
2087
2021
	java-pkg_init_paths_
2088
	java-pkg_init_paths_
2022
	java-pkg_switch-vm
2089
	java-pkg_switch-vm
2023
	PATH=${JAVA_HOME}/bin:${PATH}
2090
	PATH=${JAVA_HOME}/bin:${PATH}
Lines 2464-2477 Link Here
2464
		java-pkg_append_ LD_LIBRARY_PATH "$(java-config -g LDPATH)"
2531
		java-pkg_append_ LD_LIBRARY_PATH "$(java-config -g LDPATH)"
2465
2532
2466
		local tann="${T}/announced-vm"
2533
		local tann="${T}/announced-vm"
2534
		# With the hooks we should only get here once from pkg_setup but better safe than sorry
2535
		# if people have for example modified eclasses some where
2467
		if [[ -n "${JAVA_PKG_DEBUG}" ]] || [[ ! -f "${tann}" ]] ; then
2536
		if [[ -n "${JAVA_PKG_DEBUG}" ]] || [[ ! -f "${tann}" ]] ; then
2468
			# Add a check for setup/preinst phase... to avoid duplicate outputs
2537
			einfo "Using: $(java-config -f)"
2469
			# for when FEATURES=buildpkg
2538
			[[ ! -f "${tann}" ]] && touch "${tann}"
2470
			if [[ ${EBUILD_PHASE} != "setup" && ${EBUILD_PHASE} != "preinst" && ${EBUILD_PHASE} != "postinst" ]];
2471
			then
2472
				einfo "Using: $(java-config -f)"
2473
				[[ ! -f "${tann}" ]] && touch "${tann}"
2474
			fi
2475
		fi
2539
		fi
2476
2540
2477
	else
2541
	else
(-)java-pkg-opt-2.eclass (-38 / +5 lines)
Lines 5-10 Link Here
5
#
5
#
6
# Licensed under the GNU General Public License, v2
6
# Licensed under the GNU General Public License, v2
7
#
7
#
8
# Major changes:
9
#    20070401: 
10
#       Removed phase hooks because Portage does proper env saving now.
11
#       <betelgeuse@gentoo.org>
12
#
8
# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-opt-2.eclass,v 1.5 2006/12/03 13:05:06 betelgeuse Exp $
13
# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-opt-2.eclass,v 1.5 2006/12/03 13:05:06 betelgeuse Exp $
9
14
10
inherit java-utils-2
15
inherit java-utils-2
Lines 37-77 Link Here
37
java-pkg-opt-2_pkg_setup() {
42
java-pkg-opt-2_pkg_setup() {
38
	use ${JAVA_PKG_OPT_USE} && java-pkg_init
43
	use ${JAVA_PKG_OPT_USE} && java-pkg_init
39
}
44
}
40
41
# ------------------------------------------------------------------------------
42
# @note
43
#
44
# We need to initialize the environment in every function because Portage
45
# will source /etc/profile between phases and trample all over the env.
46
# This is accomplished by phase hooks, which is available with newer versions of
47
# portage.
48
# ------------------------------------------------------------------------------
49
50
pre_pkg_setup() {
51
	java-pkg-opt-2_pkg_setup
52
}
53
54
pre_src_unpack() {
55
	java-pkg-opt-2_pkg_setup
56
	use "${JAVA_PKG_OPT_USE}" || JAVA_PKG_BSFIX="off"
57
}
58
59
pre_src_compile() {
60
	java-pkg-opt-2_pkg_setup
61
}
62
63
pre_src_install() {
64
	java-pkg-opt-2_pkg_setup
65
}
66
67
pre_src_test() {
68
	java-pkg-opt-2_pkg_setup
69
}
70
71
pre_pkg_preinst() {
72
	java-pkg-opt-2_pkg_setup
73
}
74
75
pre_pkg_postinst() {
76
	java-pkg-opt-2_pkg_setup
77
}

Return to bug 163262