Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 112537 | Differences between
and this patch

Collapse All | Expand All

(-)eclipse-sdk-3.1.2-r2.ebuild (-134 / +64 lines)
Lines 4-58 Link Here
4
4
5
inherit eutils java-utils flag-o-matic check-reqs
5
inherit eutils java-utils flag-o-matic check-reqs
6
6
7
MY_A="eclipse-sourceBuild-srcIncluded-${PV}.zip"
7
MY_PV="${PV/rc/RC}"
8
RELEASE_DATE="200601181600"
8
MY_PV="${MY_PV/_/}"
9
MY_A="eclipse-sourceBuild-srcIncluded-${MY_PV}.zip"
10
RELEASE_DATE="200604281315"
9
DESCRIPTION="Eclipse Tools Platform"
11
DESCRIPTION="Eclipse Tools Platform"
10
HOMEPAGE="http://www.eclipse.org/"
12
HOMEPAGE="http://www.eclipse.org/"
11
SRC_URI="http://download.eclipse.org/eclipse/downloads/drops/R-${PV}-${RELEASE_DATE}/${MY_A}"
13
SRC_URI="http://download.eclipse.org/eclipse/downloads/drops/S-${MY_PV}-${RELEASE_DATE}/${MY_A}"
12
IUSE="nogecko-sdk gnome jikes nosrc nodoc atk"
14
IUSE="nogecko-sdk gnome jikes nosrc nodoc atk cairo glx"
13
SLOT="3.1"
15
SLOT="3.2"
14
LICENSE="CPL-1.0"
16
LICENSE="CPL-1.0"
15
KEYWORDS="~x86 ~ppc ~amd64"
17
KEYWORDS="~x86 ~ppc ~amd64"
16
S="${WORKDIR}"
18
S="${WORKDIR}"
17
19
18
RDEPEND=">=virtual/jre-1.4.2
20
RDEPEND=">=virtual/jre-1.5
19
	>=x11-libs/gtk+-2.2.4
21
	>=x11-libs/gtk+-2.2.4
20
	!nogecko-sdk? ( net-libs/gecko-sdk )
22
	!nogecko-sdk? ( net-libs/gecko-sdk )
23
	cairo? ( >=x11-libs/cairo-1.0.2 )
21
	atk? ( >=dev-libs/atk-1.6 )
24
	atk? ( >=dev-libs/atk-1.6 )
22
	gnome? ( =gnome-base/gnome-vfs-2* =gnome-base/libgnomeui-2* )"
25
	gnome? ( =gnome-base/gnome-vfs-2* =gnome-base/libgnomeui-2* )"
23
26
24
DEPEND="${RDEPEND}
27
DEPEND="${RDEPEND}
25
	>=virtual/jdk-1.4.2
28
        >=virtual/jdk-1.5
26
	jikes? ( >=dev-java/jikes-1.21 )
29
	jikes? ( >=dev-java/jikes-1.21 )
27
	>=dev-java/ant-1.6.2
30
	>=dev-java/ant-1.6.3
28
	>=dev-java/ant-core-1.6.2-r4
31
	>=dev-java/ant-core-1.6.3
29
	>=sys-apps/findutils-4.1.7
32
	>=sys-apps/findutils-4.1.7
30
	app-arch/unzip
33
	app-arch/unzip
31
	app-arch/zip"
34
	app-arch/zip"
32
35
33
ECLIPSE_DIR="/usr/lib/eclipse-${SLOT}"
36
ECLIPSE_DIR="/usr/lib/eclipse-${SLOT}"
34
ECLIPSE_LINKS_DIR="${ECLIPSE_DIR}/links"
37
ECLIPSE_LINKS_DIR="${ECLIPSE_DIR}/links"
38
JAVA_HEAP_MEM="768"
39
JAVA_EXTRA_MEM="128"
35
40
36
# TODO:
41
# TODO:
37
# - use CFLAGS from make.conf when building native libraries
38
#   - must patch eclipse build files
39
#   - also submit patch to bugs.eclipse.org
40
# - ppc support not tested, but not explicitly broken either
41
# - make a extension location in /var/lib that's writable by 'eclipse' group
42
# - make a extension location in /var/lib that's writable by 'eclipse' group
42
# - use make_desktop_entry from eutils instead of our own stuff
43
# - use make_desktop_entry from eutils instead of our own stuff
43
# - 
44
# - somehow use jdk 1.4 and jdk 1.5 at the same time, otherwise it might not 
45
#   be possible to develop for embedded platforms using this jdk
44
46
45
pkg_setup() {
47
pkg_setup() {
48
	let "CHECKREQS_MEMORY=${JAVA_HEAP_MEM} + ${JAVA_EXTRA_MEM}"
46
	debug-print "Checking for sufficient physical RAM"
49
	debug-print "Checking for sufficient physical RAM"
47
	CHECKREQS_MEMORY="768"
48
	check_reqs
50
	check_reqs
49
51
50
	debug-print "Checking for bad CFLAGS"
51
	check-cflags
52
53
	# Make sure our vm is sane
52
	# Make sure our vm is sane
54
	java-utils_setup-vm
53
	java-utils_setup-vm
55
	java-utils_ensure-vm-version-ge 1 4 2
54
	java-utils_ensure-vm-version-ge 1 5
56
55
57
	# All other gentoo archs match in eclipse build system except amd64
56
	# All other gentoo archs match in eclipse build system except amd64
58
	if use amd64 ; then
57
	if use amd64 ; then
Lines 61-73 Link Here
61
		eclipsearch=${ARCH}
60
		eclipsearch=${ARCH}
62
	fi
61
	fi
63
62
64
	# All other gentoo archs match in sun jdk library patch except x86
65
	if use x86 ; then
66
		jvmarch=i386
67
	else
68
		jvmarch=${ARCH}
69
	fi
70
71
	# eventually, we'll have a plugin directory that's user writable, as group
63
	# eventually, we'll have a plugin directory that's user writable, as group
72
	# 'eclipse' -nichoj
64
	# 'eclipse' -nichoj
73
65
Lines 78-85 Link Here
78
src_unpack() {
70
src_unpack() {
79
	unpack ${A}
71
	unpack ${A}
80
72
81
	# TODO figure out what this does -nichoj
73
	#   1: fix classpath (eclipse bug #128921)
82
	epatch ${FILESDIR}/06-path-fixups.patch
74
	#   2: fix building of native code filesystem library
75
	#      - hard coded JAVA_HOME, use ebuild CFLAGS
76
	#   3: fix building of native update code library
77
	#      - remove hard coded x86 path
78
	#      - some gcc versions refuse if both -static and -fPIC are used
79
	epatch ${FILESDIR}/07-eclipse-3.2.patch
83
80
84
	einfo "Setting up virtual machine"
81
	einfo "Setting up virtual machine"
85
	java-utils_setup-vm
82
	java-utils_setup-vm
Lines 89-105 Link Here
89
86
90
	einfo "Patching makefiles"
87
	einfo "Patching makefiles"
91
	fix_makefiles
88
	fix_makefiles
92
	fix_amd64_ibm_jvm
93
}
89
}
94
90
95
src_compile() {
91
src_compile() {
96
	# karltk: this should be handled by the java-pkg eclass in setup-vm 
97
	addwrite "/proc/self/maps"
98
	addwrite "/proc/cpuinfo"
99
	addwrite "/dev/random"
100
101
	# Figure out VM, set up ant classpath and native library paths
102
	setup-jvm-opts
103
92
104
	if use !nogecko-sdk ; then
93
	if use !nogecko-sdk ; then
105
		einfo "Will compile embedded Mozilla support against net-libs/gecko-sdk"
94
		einfo "Will compile embedded Mozilla support against net-libs/gecko-sdk"
Lines 110-131 Link Here
110
99
111
	use jikes && bootstrap_ant_opts="-Dbuild.compiler=jikes"
100
	use jikes && bootstrap_ant_opts="-Dbuild.compiler=jikes"
112
101
102
	ANT_OPTS="-Xmx${JAVA_HEAP_MEM}M -Djava5.home=$JAVA_HOME"
103
113
	debug-print "Bootstrapping bootstrap ecj"
104
	debug-print "Bootstrapping bootstrap ecj"
114
	ant ${bootstrap_ant_opts} -q -f jdtcoresrc/compilejdtcorewithjavac.xml || die "Failed to bootstrap ecj"
105
	ant --noconfig -nouserlib ${bootstrap_ant_opts} -quiet -buildfile jdtcoresrc/compilejdtcorewithjavac.xml || die "Failed to bootstrap ecj"
115
106
116
	debug-print "Bootstrapping ecj"
107
	debug-print "Bootstrapping ecj"
117
	ant -lib jdtcoresrc/ecj.jar -q -f jdtcoresrc/compilejdtcore.xml || die "Failed to bootstrap ecj"
108
	ant --noconfig -nouserlib -lib jdtcoresrc/ecj.jar -quiet -buildfile jdtcoresrc/compilejdtcore.xml || die "Failed to bootstrap ecj"
109
110
	# eclipse build scripts misdetect the CPU model because it prefers
111
	# "uname -p" to "uname -m". Override the selection here
112
	MODEL="`uname -m`"
113
	export MODEL
114
115
	einfo "Building native code"
116
	build-native
118
117
119
	debug-print "Compiling Eclipse -- see ${S}/compilelog.txt for details"
118
	debug-print "Compiling Eclipse -- see ${S}/compilelog.txt for details"
120
	ANT_OPTS="-Xmx1024M" \
119
	ant --noconfig -nouserlib -lib jdtcoresrc/ecj.jar -verbose -buildfile build.xml \
121
		ant -lib jdtcoresrc/ecj.jar -q -f build.xml \
122
		-DinstallOs=linux \
120
		-DinstallOs=linux \
123
		-DinstallWs=gtk \
121
		-DinstallWs=gtk \
124
		-DinstallArch=${eclipsearch} \
122
		-DinstallArch=${eclipsearch} \
125
		-Dbootclasspath=${bootclasspath} \
123
		-Dbootclasspath=${bootclasspath} \
126
		-Dlibsconfig=true \
124
		-Dlibsconfig=true \
127
		-DjavacTarget=1.4 \
125
		-DjavacTarget=1.5 \
128
		-DjavacSource=1.4 \
126
		-DjavacSource=1.5 \
129
		-DjavacVerbose=false \
127
		-DjavacVerbose=false \
130
		-DjavacFailOnError=true \
128
		-DjavacFailOnError=true \
131
		-DjavacDebugInfo=true \
129
		-DjavacDebugInfo=true \
Lines 188-198 Link Here
188
# -----------------------------------------------------------------------------
186
# -----------------------------------------------------------------------------
189
187
190
fix_makefiles() {
188
fix_makefiles() {
191
	# Comment out hard-coded JAVA_HOME
192
	sed -i 's/^JAVA_HOME/#JAVA_HOME/' plugins/org.eclipse.core.resources.linux/src/Makefile || die "Failed to patch Makefile"
193
189
194
	# Select the set of native libraries to compile
190
	# Select the set of native libraries to compile
195
	local libs="make_swt make_awt make_atk"
191
	local libs="make_swt make_awt make_atk make_glx"
196
192
197
	if use gnome ; then
193
	if use gnome ; then
198
		einfo "Building GNOME VFS support"
194
		einfo "Building GNOME VFS support"
Lines 200-206 Link Here
200
	fi
196
	fi
201
197
202
	if use !nogecko-sdk ; then
198
	if use !nogecko-sdk ; then
203
		einfo "Building Mozilla embed support"
199
		einfo "Building embedded browser support"
204
		libs="${libs} make_mozilla"
200
		libs="${libs} make_mozilla"
205
	fi
201
	fi
206
202
Lines 209-315 Link Here
209
		libs="${libs} make_atk"
205
		libs="${libs} make_atk"
210
	fi
206
	fi
211
207
212
	sed -i "s/^all:.*/all: ${libs}/" "plugins/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak" || die "Failed to patch make_linux.mak"
208
	if use cairo ; then
213
}
209
		einfo "Building Cairo support"
210
		libs="${libs} make_cairo"
211
	fi
214
212
215
fix_amd64_ibm_jvm() {
216
	# the ibm jdk ebuild should have fixed headers, but until then
213
	# the ibm jdk ebuild should have fixed headers, but until then
217
	# we just fix the compiling here (see bug #97421)
214
	# we just fix the compiling here (see bug #97421)
218
	if use amd64 ; then
215
	if use amd64 ; then
219
	    if [ ! -z "`java-config --java-version | grep IBM`" ] ; then
216
	    if [ ! -z "`java-config --java-version | grep IBM`" ] ; then
220
			einfo "Fixing IBM jdk header problem"
217
			einfo "Fixing IBM jdk header problem"
221
			find plugins -name "make_linux.mak" -print0 | xargs -0 sed -i -e 's/^CFLAGS =/CFLAGS = -D_JNI_IMPORT_OR_EXPORT_= /'
218
			CFLAGS="${CFLAGS} -D_JNI_IMPORT_OR_EXPORT_= "
222
	    fi
219
	    fi
223
	fi
220
	fi
224
}
225
221
222
	sed -i "s/make -f \$MAKEFILE all .*/make -f \$MAKEFILE ${libs}/" "plugins/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh" || die "Failed to patch build.sh"
226
223
227
clean-prebuilt-code() {
224
	# patch gentoo CFLAGS into place
228
	find ${S} -type f \( -name '*.class' -o -name '*.so' -o -name '*.so.*' -o -name 'eclipse' \) | xargs rm -f
225
	sed -i -e "s/^CFLAGS =\(.*\)\\\\/CFLAGS =\1 $CFLAGS \\\\/" -e "s/^MOZILLACFLAGS =\(.*\)\\\\/MOZILLACFLAGS =\1 $CFLAGS \\\\/" "plugins/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak" || die "Failed to patch make_linux.mak"
229
}
226
}
230
227
231
check-cflags() {
232
	local badflags="-fomit-frame-pointer -msse2"
233
	local error=false
234
	local flag
235
236
	for flag in ${badflags} ; do
237
		if is-flag ${flag}; then
238
			ewarn "Found offending option ${flag} in your CFLAGS"
239
			error=true
240
		fi
241
	done
242
	if [ ${error} == "true" ]; then
243
		echo
244
		ewarn "One or more potentially gruesome CFLAGS detected. When you run into trouble,"
245
		ewarn "please edit /etc/make.conf and remove all offending flags, then recompile"
246
		ewarn "Eclipse and all its dependencies before submitting a bug report."
247
		echo
248
		ewarn "In particular, gtk+ is extremely sensitive to which which flags it was"
249
		ewarn "compiled with."
250
		echo
251
		einfo "Tip: use equery depgraph \"=${PF}\" to list all dependencies."
252
		echo
253
		ebeep
254
	fi
255
}
256
257
setup-jvm-opts() {
258
	# Figure out correct boot classpath
259
	# karltk: this should be handled by the java-pkg eclass in setup-vm
260
	if [ ! -z "`java-config --java-version | grep IBM`" ] ; then
261
		# IBM JDK
262
		local bp="$(java-config --jdk-home)/jre/lib"
263
		bootclasspath="${bp}/core.jar:${bp}/xml.jar:${bp}/graphics.jar:${bp}/security.jar:${bp}/server.jar"
264
		JAVA_LIB_DIR="$(java-config --jdk-home)/jre/bin"
265
	else
266
		# Sun derived JDKs (Blackdown, Sun)
267
		local bp="$(java-config --jdk-home)/jre/lib"
268
		bootclasspath="${bp}/rt.jar:${bp}/jsse.jar"
269
		JAVA_LIB_DIR="$(java-config --jdk-home)/jre/lib/${jvmarch}"
270
	fi
271
272
	einfo "Using bootclasspath ${bootclasspath}"
273
	einfo "Using JVM library path ${JAVA_LIB_DIR}"
274
275
	if [ ! -f ${JAVA_LIB_DIR}/libawt.so ] ; then
276
	    die "Could not find libawt.so native library"
277
	fi
278
228
279
	export AWT_LIB_PATH=${JAVA_LIB_DIR}
229
clean-prebuilt-code() {
230
	find ${S} -type f \( -name '*.class' -o -name '*.so' -o -name '*.dll' -o -name '*.so.*' -o -name 'eclipse' \) -print0 | xargs -0 rm -f
280
}
231
}
281
232
282
setup-mozilla-opts() {
233
setup-mozilla-opts() {
283
	mozilla_dir="--mozdir-unset---"
234
	# - override eclipse default mozilla detection logic from:
284
235
	#   plugins/org.eclipse.swt/Eclipse\ SWT\ PI/gtk/library/build.sh
285
	if [ -f ${ROOT}/usr/lib/gecko-sdk/lib/libgtkembedmoz.so ] ; then
236
	# - add embed_base (bugs.gentoo.org:#130273)
286
		mozilla_dir=/usr/lib/gecko-sdk
237
	GECKO_INCLUDES="`pkg-config --cflags gecko-sdk-gtkmozembed | sed 's|\(-I[^ ]*/include\) |\1 \1/embed_base |'`"
287
	else
238
	GECKO_LIBS="`pkg-config --libs gecko-sdk-gtkmozembed`"
288
		# TODO need to update this appropriately for gecko-sdk
239
	MAKE_MOZILLA=make_mozilla
289
		eerror "You have enabled the embedded mozilla component, but no suitable"
240
	export GECKO_INCLUDES GECKO_LIBS MAKE_MOZILLA
290
		eerror "provider was found. You need gecko-sdk compiled against"
291
		eerror "gtk+ v2.0 or newer."
292
		eerror "To merge it, execute 'USE=\"gtk2\" emerge mozilla' as root."
293
		eerror "To disable embedded mozilla, remove \"mozilla\" from your USE flags."
294
		die "Need Mozilla compiled with gtk+-2.x support"
295
	fi
296
297
	export GECKO_SDK="${mozilla_dir}"
298
	# TODO should this be using pkg-config?
299
	export GECKO_INCLUDES="-include ${GECKO_SDK}/include/mozilla-config.h \
300
		-I${GECKO_SDK}/include/nspr \
301
		-I${GECKO_SDK}/include/nspr \
302
		-I${GECKO_SDK}/include/xpcom \
303
		-I${GECKO_SDK}/include/string \
304
		-I${GECKO_SDK}/include/embed_base \
305
		-I${JAVA_HOME}/include/linux"
306
	export GECKO_LIBS="-L${GECKO_SDK}/lib -lgtkembedmoz"
307
}
241
}
308
242
309
build-native() {
243
build-native() {
310
	sh features/org.eclipse.platform.launchers/library/gtk/build.sh \
244
	make -C plugins/org.eclipse.core.filesystem/natives/unix/linux
311
		-os linux -ws gtk \
245
	cp -v plugins/org.eclipse.core.filesystem/natives/unix/linux/*.so plugins/org.eclipse.core.filesystem.linux.${eclipsearch}/os/linux/${eclipsearch}
312
		-arch ${eclipsearch} || die "Failed to build launcher"
313
}
246
}
314
create-desktop-entry() {
247
create-desktop-entry() {
315
	sed -e "s/@PV@/${PV}/" ${FILESDIR}/eclipse-${SLOT}.desktop \
248
	sed -e "s/@PV@/${PV}/" ${FILESDIR}/eclipse-${SLOT}.desktop \
Lines 333-346 Link Here
333
	einfo "Installing link files"
266
	einfo "Installing link files"
334
267
335
	dodir ${ECLIPSE_LINKS_DIR}
268
	dodir ${ECLIPSE_LINKS_DIR}
336
	install_link_file /opt/eclipse-extensions-3 eclipse-binary-extensions-3.link
269
	install_link_file /opt/eclipse-extensions-3.2 eclipse-binary-extensions-3.2.link
337
	install_link_file /opt/eclipse-extensions-3.1 eclipse-binary-extensions-3.1.link
338
270
339
	install_link_file /usr/lib/eclipse-extensions-3 eclipse-extensions-3.link
271
	install_link_file /usr/lib/eclipse-extensions-3.2 eclipse-extensions-3.2.link
340
	install_link_file /usr/lib/eclipse-extensions-3.1 eclipse-extensions-3.1.link
341
272
342
#	install_link_file /var/lib/eclipse-3 eclipse-var-3.link
273
#	install_link_file /var/lib/eclipse-3.2 eclipse-var-3.2.link
343
#	install_link_file /var/lib/eclipse-3.1 eclipse-var-3.1.link
344
}
274
}
345
275
346
strip-src() {
276
strip-src() {

Return to bug 112537