New upstream release. Fixes #75440.
authorKarl Trygve Kalleberg <karltk@gentoo.org>
Fri, 24 Dec 2004 01:40:45 +0000 (01:40 +0000)
committerKarl Trygve Kalleberg <karltk@gentoo.org>
Fri, 24 Dec 2004 01:40:45 +0000 (01:40 +0000)
dev-util/eclipse-sdk/ChangeLog
dev-util/eclipse-sdk/Manifest
dev-util/eclipse-sdk/eclipse-sdk-3.1_pre4.ebuild [new file with mode: 0644]
dev-util/eclipse-sdk/files/digest-eclipse-sdk-3.1_pre4 [new file with mode: 0644]

index 499a5f088841ace09cbb88f6540e0ad746a4693f..a445214927335e5105bf5defc5df4ed8f62e9c07 100644 (file)
@@ -1,6 +1,12 @@
 # ChangeLog for dev-util/eclipse-sdk
 # Copyright 2003-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/eclipse-sdk/ChangeLog,v 1.75 2004/12/21 21:50:36 karltk Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/eclipse-sdk/ChangeLog,v 1.76 2004/12/24 01:40:45 karltk Exp $
+
+*eclipse-sdk-3.1_pre4 (24 Dec 2004)
+
+  24 Dec 2004; Karl Trygve Kalleberg <karltk@gentoo.org>
+  +eclipse-sdk-3.1_pre4.ebuild:
+  New upstream release. Fixes #75440.
 
   11 Dec 2004; <SeJo@gentoo.org> eclipse-sdk-3.0.0-r3.ebuild:
   stable on ppc
index 69b2f1f18e6ef49798232b62618e298632c217b8..31b72c720fb59a00de3b99e0a23a3940dbb9cd85 100644 (file)
@@ -3,10 +3,11 @@ MD5 72c647b7fb61acb5f2197480a18c3691 eclipse-sdk-3.0.1.ebuild 11876
 MD5 48da74ed77b8df76d771944145874c89 eclipse-sdk-3.0.0-r3.ebuild 12068
 MD5 cbce4b84c9e59099ac538e11f86cec11 eclipse-sdk-3.0.1-r2.ebuild 14318
 MD5 c03b4572c87bc6400aa2680678eb0ded eclipse-sdk-3.1_pre2.ebuild 16355
+MD5 4f372c4a08674e4e81f23c070e8c8bb0 eclipse-sdk-3.1_pre4.ebuild 17341
 MD5 7c7a3c52c8e446f31c2c14763321d452 eclipse-sdk-2.1.3-r5.ebuild 9900
 MD5 66df293add24d03117d0cc9e7db7df3f eclipse-sdk-3.0.1-r1.ebuild 13985
 MD5 3b77ea6dd08b71b83872d31d9d79e1ab eclipse-sdk-3.1_pre1.ebuild 12127
-MD5 5c54ba0a34a5673b98db069ffe47dbde ChangeLog 14738
+MD5 8b84b94b7ef63bb49dc3f67904a57c2c ChangeLog 14903
 MD5 8de14dda7d318d8fb514fdbcecd4058b metadata.xml 782
 MD5 ab0f6620b4767e065bd533b06245b0fc files/01-distribute_ant_target-2.1.patch 1103
 MD5 69ee2069b0260e40c6fa93315ff759cc files/eclipse-3.1.desktop 226
@@ -19,6 +20,7 @@ MD5 486d232cbe9d4b75d915bb6bf8b5f0d2 files/digest-eclipse-sdk-3.0.1 88
 MD5 eb74cc6c76bd05234e01af4fe0097b0c files/digest-eclipse-sdk-3.1_pre1 88
 MD5 5ad8ad3c4903f22b93bda11fc259940b files/digest-eclipse-sdk-3.1_pre2 88
 MD5 faec09f4506f1a9a12ceb725a09709f6 files/digest-eclipse-sdk-3.1_pre3 88
+MD5 18dfd928ae2d0f9bc5058eb604adc895 files/digest-eclipse-sdk-3.1_pre4 88
 MD5 ed33fd609db26b85ef9b0c2a82a06b22 files/01-distribute_ant_target-3.0.patch 726
 MD5 21bde556ac55c5e22578cf4998135913 files/digest-eclipse-sdk-2.1.3-r5 176
 MD5 429b757eb766856a6b29094b06402576 files/eclipse-3.desktop 222
diff --git a/dev-util/eclipse-sdk/eclipse-sdk-3.1_pre4.ebuild b/dev-util/eclipse-sdk/eclipse-sdk-3.1_pre4.ebuild
new file mode 100644 (file)
index 0000000..94ce934
--- /dev/null
@@ -0,0 +1,536 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/eclipse-sdk/eclipse-sdk-3.1_pre4.ebuild,v 1.1 2004/12/24 01:40:45 karltk Exp $
+
+inherit eutils java-utils
+
+# karltk: Portage 2.0.51_pre13 needs this
+MY_A="eclipse-sourceBuild-srcIncluded-3.1M4.zip"
+DESCRIPTION="Eclipse Tools Platform"
+HOMEPAGE="http://www.eclipse.org/"
+SRC_URI="http://download.eclipse.org/downloads/drops/S-3.1M4-200412162000/${MY_A}"
+IUSE="gtk motif gnome kde mozilla"
+SLOT="3.1"
+LICENSE="CPL-1.0"
+KEYWORDS="~x86 ~ppc ~amd64"
+
+RDEPEND="|| ( >=virtual/jdk-1.4.2 =dev-java/blackdown-jdk-1.4.2* )
+       gtk? ( >=x11-libs/gtk+-2.2.4 )
+       !gtk? ( kde? ( kde-base/kdelibs x11-libs/openmotif )
+               !kde? ( motif? ( x11-libs/openmotif )
+                       !motif? ( >=x11-libs/gtk+-2.2.4 )
+                     )
+             )
+       mozilla? ( >=net-www/mozilla-1.5 )
+       gnome? ( =gnome-base/gnome-vfs-2* =gnome-base/libgnomeui-2* )
+       !media-fonts/unifont"
+
+DEPEND="${RDEPEND}
+       >=dev-java/ant-1.5.3
+       >=sys-apps/findutils-4.1.7
+       >=app-shells/tcsh-6.11
+       app-arch/unzip
+       app-arch/zip"
+
+pkg_setup() {
+
+       check-ram
+       check-cflags
+
+       java-utils_setup-vm
+
+       java-utils_ensure-vm-version-ge 1 4 2
+
+       ${use_gtk} && use mozilla && detect-mozilla
+
+       setup-dir-vars
+
+       use gtk && use_gtk='true' || use_gtk='false'
+       use motif && use_motif='true' || use_motif='false'
+
+       # If gtk+ enabled, disable motif
+       ${use_gtk} && use_motif='false'
+
+       # If neither enabled, default to gtk+
+       ${use_gtk} || ${use_motif} || use_gtk='true'
+
+       # If both enabled, use gtk+ only
+       ${use_gtk} && ${use_motif} && use_motif='false'
+
+       einfo "Compiling gtk+ frontend  : ${use_gtk}"
+       einfo "Compiling Motif frontend : ${use_motif}"
+
+}
+
+src_unpack() {
+       mkdir ${S}
+       cd ${S}
+       unpack ${MY_A} || die "Could not unpack ${MY_A}"
+
+       einfo "Setting up virtual machine"
+       java-utils_setup-vm
+
+       einfo "Patching build.xmls"
+       process-build-xmls
+
+       einfo "Cleaning out prebuilt code"
+       clean-prebuilt-code
+
+       einfo "Patching gtk+ frontend"
+       patch-gtk-frontend
+
+       einfo "Patching Motif frontend"
+       patch-motif-frontend
+
+       einfo "Setting build version in Help->About"
+       sed -e "s/@build@/Gentoo Linux ${PF}/" \
+               features/org.eclipse.platform/configuration.files/configuration/config.ini \
+               || die "Failed to patch config.ini"
+}
+
+src_compile() {
+
+       # karltk: this should be handled by the java-pkg eclass in setup-vm 
+       addwrite "/proc/self/maps"
+       addwrite "/proc/cpuinfo"
+       addwrite "/dev/random"
+
+       # Figure out correct boot classpath
+       # karltk: this should be handled by the java-pkg eclass in setup-vm
+       if [ ! -z "`java-config --java-version | grep IBM`" ] ; then
+               # IBM JRE
+               ant_extra_opts="-Dbootclasspath=$(java-config --jdk-home)/jre/lib/core.jar:$(java-config --jdk-home)/jre/lib/xml.jar:$(java-config --jdk-home)/jre/lib/graphics.jar"
+       else
+               # Sun derived JREs (Blackdown, Sun)
+               ant_extra_opts="-Dbootclasspath=$(java-config --jdk-home)/jre/lib/rt.jar"
+       fi
+
+       export ANT_OPTS=-Xmx768m
+
+       einfo "Building resources.core plugin"
+       cd ${S}/${core_src_dir}
+       make JDK_INCLUDE="-I`java-config -O`/include -I`java-config -O`/include/linux" || die "Failed to build resource.core plugin"
+       mkdir -p ${S}/"${core_dest_dir}"
+       mv *.so ${S}/"${core_dest_dir}"
+       cd ${S}
+
+       # Build selected native frontend code
+       ${use_gtk} && build-gtk-native
+       ${use_motif} && build-motif-native
+
+       # Compile all Java code
+       ${use_gtk} && build-gtk-java compile
+       ${use_motif} && build-motif-java compile
+
+       # Install all Java code
+       ${use_gtk} && build-gtk-java install
+       ${use_motif} && build-motif-java install
+
+
+       create-desktop-entry
+}
+
+src_install() {
+       eclipse_dir="/usr/lib/eclipse-${SLOT}"
+
+       dodir /usr/lib
+
+       einfo "Installing features and plugins"
+       if ${use_gtk} ; then
+               [ -f result/org.eclipse.sdk-I*-linux.gtk.${ARCH}.zip ] || die "gtk zip bundle was not build properly!"
+               unzip -o -q result/org.eclipse.sdk-I*-linux.gtk.${ARCH}.zip -d ${D}/usr/lib
+       fi
+       if ${use_motif} ; then
+               [ -f result/org.eclipse.sdk-I*-linux.motif.${ARCH}.zip ] || die "motif zip bundle was not build properly!"
+               unzip -o -q result/org.eclipse.sdk-I*-linux.motif.${ARCH}.zip -d ${D}/usr/lib
+       fi
+
+       mv ${D}/usr/lib/eclipse ${D}/${eclipse_dir}
+
+       insinto ${eclipse_dir}
+
+       # Install launchers and native code
+       exeinto ${eclipse_dir}
+       if ${use_gtk} ; then
+               einfo "Installing eclipse-gtk binary"
+               doexe plugins/platform-launcher/library/gtk/eclipse-gtk \
+                       || die "Failed to install eclipse-gtk"
+       fi
+       if ${use_motif} ; then
+               einfo "Installing eclipse-motif binary"
+               doexe plugins/platform-launcher/library/motif/eclipse-motif \
+                       || die "Failed to install eclipse-motif"
+       fi
+
+       doins plugins/org.eclipse.platform/{startup.jar,splash.bmp}
+
+       # Install startup script
+       exeinto /usr/bin
+       doexe ${FILESDIR}/eclipse-${SLOT}
+
+       install-desktop-entry
+
+       doman ${FILESDIR}/eclipse.1
+
+       install-link-files
+}
+
+pkg_postinst()
+{
+       check-cflags
+}
+
+# -----------------------------------------------------------------------------
+#  Helper functions
+# -----------------------------------------------------------------------------
+
+function detect-mozilla()
+{
+       mozilla_dir="--mozdir-unset---"
+
+       if [ -f ${ROOT}/usr/lib/mozilla/libgtkembedmoz.so ] ; then
+               einfo "Compiling against net-www/mozilla"
+               mozilla_dir=/usr/lib/mozilla
+       elif [ -f ${ROOT}/usr/lib/MozillaFirefox/libgtkembedmoz.so ] ; then
+               einfo "Compiling against net-www/mozilla-firefox"
+               mozilla_dir=/usr/lib/MozillaFirefox
+       else
+               eerror "You need either Mozilla, compiled against gtk+ v2.0 or newer"
+               eerror "To merge it, do USE=\"gtk2\" emerge mozilla."
+               eerror "Otherwise, remove \"mozilla\" from use flags"
+               die "Need Mozilla compiled with gtk+-2.x support"
+       fi
+}
+
+function setup-dir-vars() {
+       gtk_launcher_src_dir="plugins/platform-launcher/library/gtk"
+       motif_launch_src_dir="plugins/platform-launcher/library/motif"
+       gtk_swt_src_dir="plugins/org.eclipse.swt/Eclipse SWT PI/gtk/library"
+       motif_swt_src_dir="plugins/org.eclipse.swt/Eclipse SWT PI/motif/library"
+
+       core_src_dir="plugins/org.eclipse.core.resources.linux/src"
+
+       case ${ARCH} in
+               sparc)
+                       gtk_swt_dest_dir="plugins/org.eclipse.swt.gtk/os/solaris/sparc"
+                       motif_swt_dest_dir="plugins/org.eclipse.swt.motif/os/solaris/sparc"
+                       core_dest_dir="plugins/org.eclipse.core.resources.linux/os/solaris/sparc"
+                       ;;
+               x86)
+                       gtk_swt_dest_dir="plugins/org.eclipse.swt.gtk/os/linux/x86"
+                       motif_swt_dest_dir="plugins/org.eclipse.swt.motif/os/linux/x86"
+                       core_dest_dir="plugins/org.eclipse.core.resources.linux/os/linux/x86"
+                       ;;
+               ppc)
+                       gtk_swt_dest_dir="plugins/org.eclipse.swt.gtk/os/linux/ppc"
+                       motif_swt_dest_dir="plugins/org.eclipse.swt.motif/os/linux/ppc"
+                       core_dest_dir="plugins/org.eclipse.core.resources.linux/os/linux/ppc/"
+                       ;;
+               amd64)
+                       gtk_swt_dest_dir="plugins/org.eclipse.swt.gtk64/os/linux/amd64"
+                       motif_swt_dest_dir="plugins/org.eclipse.swt.motif/os/linux/amd64"
+                       core_dest_dir="plugins/org.eclipse.core.resources.linux/os/linux/amd64"
+                       ;;
+       esac
+}
+
+function process-build-xmls() {
+
+       # Turn off verbose mode and on errors in all build.xml files
+       find . -type f -name "build.xml" | while read x ; do
+               sed -i -r \
+                       -e 's/failonerror="[^"]+"/failonerror="true"/' \
+                       -e 's/verbose="[^"]+"/verbose="false"/' "$x"
+       done
+}
+
+function patch-gtk-frontend() {
+
+       # Move around some source code that should have been handled by the build system
+       local m="Failed to move native files for SWT gtk+"
+       cp ${S}/plugins/org.eclipse.swt/Eclipse\ SWT/common/library/* ${S}/"${gtk_swt_src_dir}" || die ${m}
+       cp ${S}/plugins/org.eclipse.swt/Eclipse\ SWT\ Mozilla/common/library/* ${S}/"${gtk_swt_src_dir}" || die ${m}
+       cp ${S}/plugins/org.eclipse.swt/Eclipse\ SWT\ Program/gnome/library/* ${S}/"${gtk_swt_src_dir}" || die ${m}
+       cp ${S}/plugins/org.eclipse.swt/Eclipse\ SWT\ AWT/gtk/library/* ${S}/"${gtk_swt_src_dir}" || die ${m}
+       cp ${S}/plugins/org.eclipse.swt/Eclipse\ SWT\ Program/kde/library/* ${S}/"${gtk_swt_src_dir}" || die ${m}
+
+       if use gnome ; then
+           gnome_lib=`pkg-config --libs gnome-vfs-module-2.0 libgnome-2.0 libgnomeui-2.0 | sed -e "s:-pthread:-lpthread:" -e "s:-Wl,--export:--export:"`
+       fi
+
+       if ${use_gtk} ; then
+               gtk_lib="`pkg-config --libs gtk+-2.0 | sed -e 's:-pthread:-lpthread:' -e 's:-Wl,::'` -L/usr/X11R6/lib -lXtst"
+               atk_lib=`pkg-config --libs atk gtk+-2.0 | sed -e "s:-Wl,--export:--export:"`
+       fi
+
+       sed -e "s:\`pkg-config --libs gtk+-2.0\`:${gtk_lib}:" \
+               -e "s:\`pkg-config --libs atk gtk+-2.0\`:${atk_lib}:" \
+               -e "s:\`pkg-config --libs gnome-vfs-module-2.0 libgnome-2.0 libgnomeui-2.0\`:${gnome_lib}:" \
+               -e "s:-I\$(JAVA_HOME)/include:-I\$(JAVA_HOME)/include -I\$(JAVA_HOME)/include/linux:" \
+               -e "s:-I\$(JAVA_HOME)\t:-I\$(JAVA_HOME)/include -I\$(JAVA_HOME)/include/linux:" \
+               -e "s:-L\$(GECKO_SDK)/embed_base/bin -lembed_base_s:-L${mozilla_dir} -lgtkembedmoz:" \
+               -e "s:\(^.*\)\(-L.*-lembedstring.*\)\(\\\\$\):\1\3:" \
+               -e "s:\(^.*\)\(-L.*/xpcom/bin.*\)\(\\\\$\):\1\3:" \
+               -e "s:\(^.*-L.*-lnspr4.*$\)::" \
+               -e "s:MOZILLACFLAGS = -O:MOZILLACFLAGS = -O -DNO_nsEmbedString_1Equals -I${mozilla_dir}/include/java:" \
+               -e "s:\(-include \)\(\$(GECKO_SDK)\)\(/mozilla-config.h\):\1${mozilla_dir}/include\3:" \
+               -e "s:\(-I\$(GECKO_SDK)\)\(/.*\)\(/include\):-I${mozilla_dir}/include\2:g" \
+               -e "s:\$(XTEST_LIB_PATH):/usr/X11R6/lib:" \
+               -e "s:\$(GECKO_SDK):${mozilla_dir}:" \
+               -i "${S}/${gtk_swt_src_dir}/make_linux.mak" || die "Failed to patch ${gtk_swt_src_dir}/make_linux.mak"
+
+       sed -e "s:KDE_LIB_PATH=.*:KDE_LIB_PATH=$(kde-config --prefix)/lib:" \
+               -e "s:KDE_INCLUDE_PATH=.*:KDE_INCLUDE_PATH=$(kde-config --prefix)/include:" \
+               -e "s:\${GECKO_SDK}/mozilla-config.h:\${GECKO_SDK}/include/mozilla-config.h:" \
+               -e "s:\${GECKO_SDK}/nspr/include:\${GECKO_SDK}/include/nspr:" \
+               -e "s:\${GECKO_SDK}/xpcom/include:\${GECKO_SDK}/include/xpcom:" \
+               -e "s:\${GECKO_SDK}/string/include:\${GECKO_SDK}/include/string:" \
+               -e "s:\${GECKO_SDK}/embed_base/include:\${GECKO_SDK}/include/embed_base:" \
+               -e "s:\${GECKO_SDK}/embedstring/include:\${GECKO_SDK}/include/embedstring:" \
+               -e "s:-lembedstring::" \
+               -e "s:-lembed_base_s::" \
+               -e "s:-lxpcomglue_s::" \
+               -e "s:GECKO_LIBS=\":GECKO_LIBS=\"-L/usr/lib/mozilla :" \
+               -i "${S}/${gtk_swt_src_dir}/build.sh" || die "Failed to patch ${gtk_swt_src_dir}/build.sh"
+
+       sed -e "s:\(JAVA_HOME *=\)\(.*$\):\1${JAVA_HOME}:" \
+               -e "s:\(GECKO_SDK *=\)\(.*$\):\1${mozilla_dir:-/usr/lib/mozilla}:" \
+               -e "s:\(AWT_LIB_PATH *=\)\(.*$\):\1\$JAVA_HOME/jre/lib/${ARCH}:" \
+               -i "${S}/${gtk_swt_src_dir}/build.sh" || die "Failed to patch ${gtk_swt_src_dir}/build.sh"
+
+}
+
+function patch-motif-frontend()
+{
+       local m="Failed to move native files for SWT Motif"
+
+       cp plugins/org.eclipse.swt/Eclipse\ SWT/common/library/* ${S}/"${motif_swt_src_dir}" || die ${m}
+       cp ${S}/plugins/org.eclipse.swt/Eclipse\ SWT\ Program/kde/library/* ${S}/"${motif_swt_src_dir}" || die ${m}
+
+       sed -e "s:/bluebird/teamswt/swt-builddir/IBMJava2-141:$JAVA_HOME:" \
+               -e "s:/bluebird/teamswt/swt-builddir/motif21:/usr/X11R6:" \
+               -e "s:/usr/lib/qt-3.1:/usr/qt/3:" \
+               -e "s:-lkdecore:-L\`kde-config --prefix\`/lib -lkdecore:" \
+               -e "s:-I/usr/include/kde:-I\`kde-config --prefix\`/include:" \
+               -e "s:-I\$(JAVA_HOME)/include:-I\$(JAVA_HOME)/include -I\$(JAVA_HOME)/include/linux:" \
+               -e "s:-I\$(JAVA_HOME)\t:-I\$(JAVA_HOME)/include -I\$(JAVA_HOME)/include/linux:" \
+               -e "s:-L\$(MOZILLA_HOME)/lib -lembed_base_s:-L\$(MOZILLA_HOME):" \
+               -e "s:-L\$(JAVA_HOME)/jre/bin:-L\$(JAVA_HOME)/jre/lib/i386:" \
+               -i "${motif_swt_src_dir}"/make_linux.mak || die "Failed to modify ${motif_swt_src_dir}/make_linux.mak"
+}
+
+
+function create-desktop-entry() {
+
+       cat ${FILESDIR}/eclipse-${SLOT}.desktop | \
+               sed -e "s/@PV@/${PV}/" \
+               > eclipse-${SLOT}.desktop || die "Failed to create desktop entry"
+}
+
+function build-gtk-java() {
+       local target=${1}
+
+       einfo "Building GTK+ frontend (${target}) -- see compilelog.txt for details"
+       LOCALCLASSPATH=jdtcore.jar:jdtCompilerAdapter.jar ant -q -q  \
+               -buildfile build.xml \
+               -DcollPlace="eclipse-${SLOT}" \
+               -DinstallOs=linux \
+               -DinstallWs=gtk \
+               -DinstallArch=$ARCH \
+               ${ant_extra_opts} ${target} \
+               || die "Failed to ${target} Java code (gtk+)"
+}
+
+function build-motif-java() {
+       local target=${1}
+
+       einfo "Building Motif frontend (${target}) -- see compilelog.txt for details"
+       LOCALCLASSPATH=jdtcore.jar:jdtCompilerAdapter.jar ant -q -q  \
+               -buildfile build.xml \
+               -DcollPlace="eclipse-${SLOT}" \
+               -DinstallOs=linux \
+               -DinstallWs=motif \
+               -DinstallArch=$ARCH \
+               ${ant_extra_opts} ${target} \
+               || die "Failed to ${target} java code (Motif)"
+}
+
+function install-desktop-entry() {
+
+       # Install GNOME .desktop file
+       if use gnome ; then
+               insinto /usr/share/gnome/apps/Development
+               doins eclipse-${SLOT}.desktop
+       fi
+
+       # Install KDE .desktop file
+       if use kde ; then
+               for x in /usr/kde/* ; do
+                       insinto ${x}/share/applnk/Applications/
+                       doins eclipse-${SLOT}.desktop
+               done
+       fi
+}
+
+function build-gtk-native() {
+
+       einfo "Building gtk+ SWT"
+
+       # kludge to allow patches to applied at unpack, but correct compilation
+       if [ ${ARCH} == "amd64" ] ; then
+               gtk_swt_src_dir="plugins/org.eclipse.swt.gtk64/src/Eclipse SWT PI/gtk/library"
+       fi
+
+       # Perpare destination directory
+       mkdir -p ${S}/"${gtk_swt_dest_dir}"
+
+       # Build the eclipse gtk binary
+       cd ${S}/plugins/platform-launcher/library/gtk
+       case ${ARCH} in
+               sparc|x86|ppc)
+                       bash ./build.sh -output eclipse-gtk -arch $ARCH || die "Failed to build eclipse-gtk"
+                       ;;
+               amd64)
+                       bash ./build.sh -output eclipse-gtk -arch $ARCH || die "Failed to build eclipse-gtk"
+                       ;;
+       esac
+
+
+       cd ${S}/"${gtk_swt_src_dir}"
+       case ${ARCH} in
+               sparc|x86|ppc)
+                       bash ./build.sh make_swt || die "Failed to build platform-independent SWT support"
+                       bash ./build.sh make_atk || die "Failed to build atk support"
+                       ;;
+               amd64)
+                       bash ./build64.sh make_swt || die "Failed to build platform-independent SWT support"
+                       bash ./build64.sh make_atk || die "Failed to build atk support"
+                       ;;
+       esac
+
+       if use gnome ; then
+               einfo "Building GNOME VFS support"
+               case ${ARCH} in
+                       sparc|x86|ppc)
+                               bash ./build.sh make_gnome || die "Failed to build GNOME VFS support"
+                               ;;
+                       amd64)
+                               bash ./build64.sh make_gnome || die "Failed to build GNOME VFS support"
+                               ;;
+               esac
+       fi
+
+       if use kde ; then
+               einfo "Building KDE support"
+               KDE_INCLUDE_PATH="$(kde-config --prefix)/include" \
+                       KDE_LIB_PATH="$(kde-config --prefix)/lib" \
+                       bash ./build.sh make_kde || die "Failed to build KDE support"
+       fi
+
+       if use mozilla ; then
+               einfo "Building Mozilla component"
+               case $ARCH in
+                       sparc|x86|ppc)
+                               bash ./build.sh make_mozilla || die "Failed to build Mozilla support"
+                               ;;
+                       amd64)
+                               bash ./build64.sh make_mozilla || die "Failed to build Mozilla support"
+                               ;;
+               esac
+       fi
+
+       # move the *.so files to the right path so eclipse can find them
+       # karltk: do this incrementally at each step above, with || die
+       mv *.so ${S}/"${gtk_swt_dest_dir}"
+       cd ${S}
+
+       einfo "Native gtk+ bindings built"
+}
+
+function build-motif-native() {
+
+       einfo "Building Motif SWT"
+
+       # Prepare destination directory
+       mkdir -p ${S}/"${motif_swt_dest_dir}"
+
+       # Build eclipse motif binary
+       cd ${S}/plugins/platform-launcher/library/motif
+       bash build.sh -output eclipse-motif -arch $ARCH || die "Failed to build eclipse-motif"
+
+       cd ${S}/"${motif_swt_src_dir}"
+
+       make -f make_linux.mak make_swt QT_HOME="${QTDIR}" || die "Failed to build Motif support"
+       if use kde ; then
+               make -f make_linux.mak make_kde QT_HOME="${QTDIR}" || die "Failed to build KDE support"
+       fi
+
+       # move the *.so files to the right path so eclipse can find them
+       # karltk: do this incrementally at each step above, with || die
+       mv *.so ${S}/"${motif_swt_dest_dir}"
+       cd ${S}
+
+       einfo "Native Motif bindings built"
+}
+
+
+
+function clean-prebuilt-code() {
+
+       # Clean up all pre-built code
+       ant -q -DinstallWs=gtk -DinstallOs=linux clean
+       ant -q -DinstallWs=motif -DinstallOs=linux clean
+       find ${S} -name '*.so' -exec rm -f {} \;
+       find ${S} -name '*.so.*' -exec rm -f {} \;
+       find ${S} -type f -name 'eclipse' -exec rm {} \;
+       rm -f eclipse
+
+}
+
+function get-memory-total() {
+       cat /proc/meminfo | grep MemTotal | sed -r "s/[^0-9]*([0-9]+).*/\1/"
+}
+
+function check-ram() {
+
+       local mem=$(get-memory-total)
+       [ $(get-memory-total) -lt 775000 ] &&
+               (
+               echo
+               ewarn "To build Eclipse, at least 768MB of RAM is recommended."
+               ewarn "Your machine has less RAM. Continuing anyway."
+               echo
+               )
+}
+
+function install-link-files() {
+       dodir /usr/lib/eclipse-${SLOT}/links
+
+       echo "path=/opt/eclipse-extensions-3" > ${D}/${eclipse_dir}/links/eclipse-binary-extensions-3.link
+       echo "path=/opt/eclipse-extensions-3.1" > ${D}/${eclipse_dir}/links/eclipse-binary-extensions-3.1.link
+
+       echo "path=/usr/lib/eclipse-extensions-3" > ${D}/${eclipse_dir}/links/eclipse-extensions-3.link
+       echo "path=/usr/lib/eclipse-extensions-3.1" > ${D}/${eclipse_dir}/links/eclipse-extensions-3.1.link
+}
+
+function check-cflags() {
+       local badflags="-fomit-frame-pointer -msse2"
+       local error=false
+
+       for x in ${badflags} ; do
+               if [ ! -z "$(echo ${CFLAGS} | grep -- $x)" ] ; then
+                       ewarn "Found offending option $x in your CFLAGS"
+                       error=true
+               fi
+       done
+       if [ ${error} == "true" ]; then
+               echo
+               ewarn "One or more potentially CFLAGS detected. When you run into trouble, please"
+               ewarn "edit /etc/make.conf and remove all offending flags, then recompile"
+               ewarn "Eclipse and all its dependencies before submitting a bug report."
+               echo
+               einfo "Tip: use equery depgraph \"=${PF}\" to list all dependencies"
+               echo
+               ebeep
+       fi
+}
diff --git a/dev-util/eclipse-sdk/files/digest-eclipse-sdk-3.1_pre4 b/dev-util/eclipse-sdk/files/digest-eclipse-sdk-3.1_pre4
new file mode 100644 (file)
index 0000000..674238a
--- /dev/null
@@ -0,0 +1 @@
+MD5 9d529492c9cac1add34e96192504ac22 eclipse-sourceBuild-srcIncluded-3.1M4.zip 61568782