summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-10-01 10:03:50 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-10-01 10:06:57 +0530
commitf623deffe9364abbd64049cf12c7a8278688036e (patch)
tree2ce760adb22619d9df76a40df0cdbd52a25813d8
parentpackage.mask all live ebuilds (diff)
downloadgnome-live-f623deffe9364abbd64049cf12c7a8278688036e.tar.gz
gnome-live-f623deffe9364abbd64049cf12c7a8278688036e.tar.bz2
gnome-live-f623deffe9364abbd64049cf12c7a8278688036e.zip
EAPI=2 support for gnome2-live.eclass
* Add an EAPI=2 aware gnome2.eclass * Update gnome2-live.eclass to take advantage of the new gnome2.eclass * ebuilds can now use EAPI=2 without b0rking, yay! * Whoops, forgot to EXPORT_FUNCTIONS pkg_postinst
-rw-r--r--eclass/gnome2-live.eclass25
-rw-r--r--eclass/gnome2.eclass144
2 files changed, 158 insertions, 11 deletions
diff --git a/eclass/gnome2-live.eclass b/eclass/gnome2-live.eclass
index fd861cb..d754974 100644
--- a/eclass/gnome2-live.eclass
+++ b/eclass/gnome2-live.eclass
@@ -12,10 +12,10 @@
#
-inherit autotools gnome2-utils libtool subversion
+inherit autotools gnome2 gnome2-utils libtool subversion
# DEPEND on dev-util/gtk-doc for gtkdocize
-DEPEND="${DEPEND}
+DEPEND="${DEPEND}
dev-util/gtk-doc"
# Extra options passed to elibtoolize
@@ -29,7 +29,10 @@ SRC_URI=""
gnome2-live_src_unpack() {
subversion_src_unpack
+ [[ "${EAPI}" != 2 ]] && gnome2-live_src_prepare
+}
+gnome2-live_src_prepare() {
for i in ${PATCHES}; do
epatch "${FILESDIR}/${i}"
done
@@ -38,12 +41,7 @@ gnome2-live_src_unpack() {
intltoolize --force
eautoreconf
- ## This point onwards must stay in sync with gnome2.eclass
- # Prevent scrollkeeper access violations
- gnome2_omf_fix
-
- # Run libtoolize
- elibtoolize ${ELTCONF}
+ gnome2_src_prepare
}
# So that it replaces gnome2_src_unpack in ebuilds that call it
@@ -51,6 +49,11 @@ gnome2_src_unpack() {
gnome2-live_src_unpack
}
-# So it works "out of the box" for ebuilds that rely on src_unpack exported by
-# gnome2.eclass
-EXPORT_FUNCTIONS src_unpack
+# Run manually for ebuilds that have a custom pkg_postinst
+gnome2-live_pkg_postinst() {
+ ewarn "These are live ebuilds, upstream trunks will mostly NOT be stable"
+ ewarn "Do not report bugs about the packages to the GNOME Gentoo team"
+ ewarn "Report upstream bugs (with patches if possible) instead."
+}
+
+EXPORT_FUNCTIONS src_unpack src_prepare pkg_postinst
diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
new file mode 100644
index 0000000..fcfe0e1
--- /dev/null
+++ b/eclass/gnome2.eclass
@@ -0,0 +1,144 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+#
+# gnome2.eclass
+#
+# Exports portage base functions used by ebuilds written for packages using the
+# GNOME framework. For additional functions, see gnome2-utils.eclass.
+#
+# Maintained by Gentoo's GNOME herd <gnome@gentoo.org>
+# Modified by Nirbheek Chauhan <nirbheek.chauhan@gmail.com>
+#
+
+
+inherit fdo-mime libtool gnome.org gnome2-utils
+
+
+# Extra configure opts passed to econf
+G2CONF=${G2CONF:-""}
+
+# Extra options passed to elibtoolize
+ELTCONF=${ELTCONF:-""}
+
+# Should we use EINSTALL instead of DESTDIR
+USE_EINSTALL=${USE_EINSTALL:-""}
+
+# Run scrollkeeper for this package?
+SCROLLKEEPER_UPDATE=${SCROLLKEEPER_UPDATE:-"1"}
+
+
+
+if [[ ${GCONF_DEBUG} != "no" ]]; then
+ IUSE="debug"
+fi
+
+
+
+gnome2_src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ [[ "${EAPI}" != 2 ]] && gnome2_src_prepare
+}
+
+gnome2_src_prepare() {
+ # Prevent scrollkeeper access violations
+ gnome2_omf_fix
+
+ # Run libtoolize
+ elibtoolize ${ELTCONF}
+}
+
+gnome2_src_configure() {
+ # Update the GNOME configuration options
+ if [[ ${GCONF_DEBUG} != 'no' ]] ; then
+ if use debug ; then
+ G2CONF="${G2CONF} --enable-debug=yes"
+ fi
+ fi
+
+ # Prevent a QA warning
+ if hasq doc ${IUSE} ; then
+ G2CONF="${G2CONF} $(use_enable doc gtk-doc)"
+ fi
+
+ # Avoid sandbox violations caused by misbehaving packages (bug #128289)
+ addwrite "/root/.gnome2"
+
+ # GST_REGISTRY is to work around gst-inspect trying to read/write /root
+ GST_REGISTRY="${S}/registry.xml" econf "$@" ${G2CONF} || die "configure failed"
+}
+
+gnome2_src_compile() {
+ [[ "${EAPI}" != 2 ]] && gnome2_src_configure
+ emake || die "compile failure"
+}
+
+gnome2_src_install() {
+ # if this is not present, scrollkeeper-update may segfault and
+ # create bogus directories in /var/lib/
+ local sk_tmp_dir="/var/lib/scrollkeeper"
+ dodir "${sk_tmp_dir}"
+
+ # we must delay gconf schema installation due to sandbox
+ export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1"
+
+ if [[ -z "${USE_EINSTALL}" || "${USE_EINSTALL}" = "0" ]]; then
+ debug-print "Installing with 'make install'"
+ emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${D}${sk_tmp_dir} " "$@" install || die "install failed"
+ else
+ debug-print "Installing with 'einstall'"
+ einstall "scrollkeeper_localstate_dir=${D}${sk_tmp_dir} " "$@" || die "einstall failed"
+ fi
+
+ unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
+
+ # Manual document installation
+ [[ -n "${DOCS}" ]] && dodoc ${DOCS}
+
+ # Do not keep /var/lib/scrollkeeper because:
+ # 1. The scrollkeeper database is regenerated at pkg_postinst()
+ # 2. ${D}/var/lib/scrollkeeper contains only indexes for the current pkg
+ # thus it makes no sense if pkg_postinst ISN'T run for some reason.
+ if [[ -z "$(find "${D}" -name '*.omf')" ]]; then
+ export SCROLLKEEPER_UPDATE="0"
+ fi
+ rm -rf "${D}${sk_tmp_dir}"
+
+ # Make sure this one doesn't get in the portage db
+ rm -fr "${D}/usr/share/applications/mimeinfo.cache"
+}
+
+gnome2_pkg_preinst() {
+ gnome2_gconf_savelist
+ gnome2_icon_savelist
+}
+
+gnome2_pkg_postinst() {
+ gnome2_gconf_install
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+ gnome2_icon_cache_update
+
+ if [[ "${SCROLLKEEPER_UPDATE}" = "1" ]]; then
+ gnome2_scrollkeeper_update
+ fi
+}
+
+#gnome2_pkg_prerm() {
+# gnome2_gconf_uninstall
+#}
+
+gnome2_pkg_postrm() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+ gnome2_icon_cache_update
+
+ if [[ "${SCROLLKEEPER_UPDATE}" = "1" ]]; then
+ gnome2_scrollkeeper_update
+ fi
+}
+
+# pkg_prerm
+EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_configure src_install pkg_preinst pkg_postinst pkg_postrm