public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Christoph Mende (angelos)" <angelos@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in eclass: xfce4.eclass
Date: Tue, 10 Mar 2009 11:08:11 +0000	[thread overview]
Message-ID: <E1Lgzoh-00040C-R3@stork.gentoo.org> (raw)

angelos     09/03/10 11:08:11

  Modified:             xfce4.eclass
  Log:
  Updated xfce4.eclass for xfce-4.6

Revision  Changes    Path
1.25                 eclass/xfce4.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xfce4.eclass?rev=1.25&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xfce4.eclass?rev=1.25&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xfce4.eclass?r1=1.24&r2=1.25

Index: xfce4.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/xfce4.eclass,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- xfce4.eclass	30 May 2007 13:25:32 -0000	1.24
+++ xfce4.eclass	10 Mar 2009 11:08:11 -0000	1.25
@@ -1,98 +1,223 @@
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/xfce4.eclass,v 1.24 2007/05/30 13:25:32 drac Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/xfce4.eclass,v 1.25 2009/03/10 11:08:11 angelos Exp $
 
-# DEPRECATED ECLASS.
-
-if [[ ${BZIPPED} = "1" ]];then
-	COMPRESS=".tar.bz2"
-	ZIP="-bz2"
-else
-	COMPRESS=".tar.gz"
-	ZIP=""
+# @ECLASS: xfce4.eclass
+# @MAINTAINER:
+# Gentoo's Xfce Team <xfce@gentoo.org>
+# @BLURB: functions to simplify Xfce4 package installation
+# @DESCRIPTION:
+# This eclass provides functions to install Xfce4 packages with a
+# minimum of duplication in ebuilds
+
+inherit fdo-mime gnome2-utils
+[ -n ${XFCE4_PATCHES} ] && inherit eutils
+if [ ${PV} = 9999 ]; then
+	inherit autotools
+	[ "${XFCE_VCS}" = "git" ] && inherit git || inherit subversion
 fi
 
-if [[ ${GOODIES_PLUGIN} = "1" ]]; then
-	[[ -z ${MY_P} ]] && MY_P="${PN}-plugin-${PV}"
-	SRC_URI="http://download.berlios.de/xfce-goodies/${MY_P}${COMPRESS}"
-	[[ -z ${HOMEPAGE} ]] && HOMEPAGE="http://xfce-goodies.berlios.de/"
-	[[ -z ${XFCE_VERSION} ]] && XFCE_VERSION="4.2.0"
-	RDEPEND="${RDEPEND} >=xfce-base/xfce4-panel-${XFCE_VERSION}"
-fi
+LICENSE="GPL-2"
+SLOT="0"
 
-if [[ ${PLUGIN} = "1" ]]; then
-	MY_P="${PN}-plugin-${PV}"
-	[[ -z ${XFCE_VERSION} ]] && XFCE_VERSION="4.2.0"
-	RDEPEND="${RDEPEND} >=xfce-base/xfce4-panel-${XFCE_VERSION}"
-fi
+DEPEND="${RDEPEND}
+	dev-util/pkgconfig"
 
-if [[ ${GOODIES} = "1" ]]; then
-	SRC_URI="http://download.berlios.de/xfce-goodies/${MY_P:-${P}}${COMPRESS}"
-	[[ -z ${HOMEPAGE} ]] && HOMEPAGE="http://xfce-goodies.berlios.de/"
+[ ${PV} = 9999 -a -z "${XFCE_VERSION}" ] && XFCE_VERSION="4.5.99"
+[ -z ${XFCE_VERSION} ] && XFCE_VERSION=${PV}
+[ -z ${THUNAR_VERSION} ] && THUNAR_VERSION="0.9"
+
+if [ ${PV} = 9999 ]; then
+	[ -n "${WANT_GTKDOCIZE}" ] && DEPEND+=" dev-util/gtk-doc"
+	[ ${PN} != xfce4-dev-tools ] && DEPEND+="
+		>=dev-util/xfce4-dev-tools-${XFCE_VERSION}"
+	[ "${XFCE_VCS}" = "git" ] && \
+		EGIT_REPO_URI="git://git.xfce.org/${XFCE_CAT}/${MY_PN:-${PN}}"
 fi
 
-[[ -n ${SRC_URI} ]] \
-	|| SRC_URI="http://www.xfce.org/archive/xfce-${PV}/src${ZIP}/${P}${COMPRESS}"
-
-[[ ${XFCE_META} = "1" ]] \
-	&& SRC_URI=""
+[ -z ${MY_P} ] && MY_P=${MY_PN:-${PN}}-${MY_PV:-${PV}}
+S="${WORKDIR}/${MY_P}"
 
-[[ -z ${LICENSE} ]] \
-	&& LICENSE="GPL-2"
+# @ECLASS-VARIABLE: COMPRESS
+# @DESCRIPTION:
+# Define the file extensions for SRC_URI, defaults to .tar.bz2
+COMPRESS=".tar.bz2"
+
+# @FUNCTION: xfce4_gzipped
+# @DESCRIPTION:
+# Use .tar.gz instead of .tar.bz2 in SRC_URI
+xfce4_gzipped() {
+	COMPRESS=".tar.gz"
+}
 
-[[ -z ${HOMEPAGE} ]] \
-	&& HOMEPAGE="http://www.xfce.org/"
+# @FUNCTION: xfce4_plugin
+# @DESCRIPTION:
+# Append -plugin to the package name
+xfce4_plugin() {
+	MY_PN="${MY_PN:-${PN}}-plugin"
+	MY_P="${MY_PN}-${MY_PV:-${PV}}"
+	S="${WORKDIR}/${MY_P}"
+}
 
-SLOT="0"
-IUSE="debug doc"
+# @FUNCTION: xfce4_goodies
+# @DESCRIPTION:
+# Change SRC_URI (or E{SVN,GIT}_REPO_URI for live ebuilds) to the goodies path
+# and set HOMEPAGE to goodies.xfce.org
+# Note: git ebuilds usually require XFCE_CAT (for example kelnos for
+# xfce4-notifyd)
+xfce4_goodies() {
+	if [ ${PV} = 9999 ]; then
+		ESVN_REPO_URI="http://svn.xfce.org/svn/goodies/${MY_PN:-${PN}}/trunk"
+	else
+		SRC_URI="http://goodies.xfce.org/releases/${MY_PN:-${PN}}/${MY_P}${COMPRESS}"
+	fi
+	HOMEPAGE="http://goodies.xfce.org/"
+}
 
-RDEPEND=">=x11-libs/gtk+-2.2
-	dev-libs/libxml2
-	x11-libs/startup-notification
-	>=dev-libs/dbh-1.0.20
-	>=x11-themes/gtk-engines-xfce-2.2.5
-	${RDEPEND}"
-DEPEND="${RDEPEND}
-	dev-util/pkgconfig"
+# @FUNCTION: xfce4_panel_plugin
+# @DESCRIPTION:
+# Call xfce4_plugin and xfce4_goodies and RDEPEND on xfce4-panel and set
+# HOMEPAGE to the panel plugins homepage
+xfce4_panel_plugin() {
+	xfce4_plugin
+	xfce4_goodies
+	HOMEPAGE="http://goodies.xfce.org/projects/panel-plugins/${MY_PN}"
+	RDEPEND="${DEPEND} >=xfce-base/xfce4-panel-${XFCE_VERSION}"
+}
 
-[[ -z ${XFCE_S} ]] \
-	&& S="${WORKDIR}/${MY_P:-${P}}" \
-	|| S="${XFCE_S}"
+# @FUNCTION: xfce4_thunar_plugin
+# @DESCRIPTION:
+# Call xfce4_plugin and xfce4_goodies, RDEPEND on thunar and set
+# HOMEPAGE to the thunar plugins homepage
+xfce4_thunar_plugin() {
+	xfce4_plugin
+	xfce4_goodies
+	HOMEPAGE="http://thunar.xfce.org/pwiki/projects/${MY_PN}"
+	RDEPEND="${RDEPEND} >=xfce-base/thunar-${THUNAR_VERSION}"
+}
 
-xfce4_src_compile() {
-	if [[ "${DEBUG_OFF}" = "1" ]] && use debug; then
-		XFCE_CONFIG="${XFCE_CONFIG}"
-	elif use debug; then
-		XFCE_CONFIG="${XFCE_CONFIG} --enable-debug=yes"
+# @FUNCTION: xfce4_core
+# @DESCRIPTION:
+# Change SRC_URI (or ESVN_REPO_URI for live ebuilds) to the main Xfce path and
+# set the HOMEPAGE to www.xfce.org
+xfce4_core() {
+	if [ ${PV} = 9999 ]; then
+		ESVN_REPO_URI="http://svn.xfce.org/svn/xfce/${MY_PN:-${PN}}/trunk"
+	else
+		SRC_URI="mirror://xfce/xfce-${XFCE_VERSION}/src/${MY_P}${COMPRESS}"
 	fi
+	HOMEPAGE="http://www.xfce.org/"
+}
 
-	if [[ ${XFCE_META} = "1" ]]; then
-		einfo "Meta Build, Nothing to compile."
-	else
-		econf ${XFCE_CONFIG} || die
+# @FUNCTION: xfce4_single_male
+# @DESCRIPTION:
+# Build with one job for broken parallel builds
+xfce4_single_make() {
+	JOBS="-j1"
+}
 
-		if [[ "${SINGLE_MAKE}" = "1" ]]; then
-			emake -j1 || die
+# @FUNCTION: xfce4_src_unpack
+# @DESCRIPTION:
+# Only used for live ebuilds. Patch autogen.sh to inject the correct revision
+# into configure.ac
+xfce4_src_unpack() {
+	if [ ${PV} = 9999 ]; then
+		local revision
+		XFCE_CONFIG+=" --enable-maintainer-mode"
+		if [ "${XFCE_VCS}" = "git" ]; then
+			git_src_unpack
+			revision=$(git show --pretty=format:%ci | head -n 1 | \
+			awk '{ gsub("-", "", $1); print $1"-"; }')
+			revision+=$(git rev-parse HEAD | cut -c1-8)
 		else
-			emake || die
+			subversion_src_unpack
+			subversion_wc_info
+			revision=${ESVN_WC_REVISION}
+		fi
+		local linguas
+		[ -d po ] && linguas="$(sed -e '/^#/d' po/LINGUAS)"
+		[ -n "${XFCE4_PATCHES}" ] && epatch ${XFCE4_PATCHES}
+		if [ -f configure.??.in ]; then
+			[ -f configure.ac.in ] && configure=configure.ac.in
+			[ -f configure.in.in ] && configure=configure.in.in
+			[ -n "${linguas}" ] && sed -i -e "s/@LINGUAS@/${linguas}/g" ${configure}
+			sed -i -e "s/@REVISION@/${revision}/g" ${configure}
+			cp ${configure} ${configure/.in}
+		fi
+		if [ -f configure.?? ]; then
+			[ -f configure.ac ] && configure=configure.ac
+			[ -f configure.in ] && configure=configure.in
+			[ ${PN} != xfce4-dev-tools ] && AT_M4DIR="/usr/share/xfce4/dev-tools/m4macros"
+			[ -n "${WANT_GTKDOCIZE}" ] && gtkdocize --copy
+			if [ -d po ]; then
+			grep -Eqs "^(AC|IT)_PROG_INTLTOOL" ${configure} \
+				&& intltoolize --automake --copy --force \
+				|| glib-gettextize --copy --force >/dev/null
+			fi
+			eautoreconf
 		fi
+	else
+		unpack ${A}
 	fi
 }
 
+# @FUNCTION: xfce4_src_configure
+# @DESCRIPTION:
+# Package configuration
+# XFCE_CONFIG is used for additional econf/autogen.sh arguments
+# startup-notification and debug are automatically added when they are found in
+# IUSE
+xfce4_src_configure() {
+	has startup-notification ${IUSE} && \
+		XFCE_CONFIG+=" $(use_enable startup-notification)"
+
+	has debug ${IUSE} && XFCE_CONFIG+=" $(use_enable debug)"
+
+	econf ${XFCE_CONFIG}
+}
+
+# @FUNCTION: xfce4_src_compile
+# @DESCRIPTION:
+# Package compilation
+# Calls xfce4_src_configure for EAPI <= 1 and runs emake with ${JOBS}
+xfce4_src_compile() {
+	[ "${EAPI}" -le 1 ] && xfce4_src_configure
+	emake ${JOBS} || die "emake failed"
+}
+
+# @FUNCTION: xfce4_src_install
+# @DESCRIPTION:
+# Package installation
+# The content of $DOCS is installed via dodoc
 xfce4_src_install() {
-	if [[ ${XFCE_META} = "1" ]]; then
-		einfo "Meta Build, Nothing to install."
-	else
-		if [[ "${WANT_EINSTALL}" = "1" ]]; then
-			einstall || die
-		else
-				make DESTDIR=${D} install || die
-		fi
+	[ -n "${DOCS}" ] && dodoc ${DOCS}
 
-		if use doc; then
-			dodoc ${XFCE_DOCS} AUTHORS INSTALL README COPYING ChangeLog HACKING NEWS THANKS TODO
-		fi
-	fi
+	emake DESTDIR="${D}" install || die "emake install failed"
+}
+
+# @FUNCTION: xfce4_pkg_preinst
+# @DESCRIPTION:
+# Run gnome2_icon_savelist for the following gnome2_icon_cache_update
+xfce4_pkg_preinst() {
+	gnome2_icon_savelist
+}
+
+# @FUNCTION: xfce4_pkg_postinst
+# @DESCRIPTION:
+# Run fdo-mime_{desktop,mime}_database_update and gnome2_icon_cache_update
+xfce4_pkg_postinst() {
+	fdo-mime_desktop_database_update
+	fdo-mime_mime_database_update
+	gnome2_icon_cache_update
+}
+
+# @FUNCTION: xfce4_pkg_postrm
+# @DESCRIPTION:
+# Run fdo-mime_{desktop,mime}_database_update and gnome2_icon_cache_update
+xfce4_pkg_postrm() {
+	fdo-mime_desktop_database_update
+	fdo-mime_mime_database_update
+	gnome2_icon_cache_update
 }
 
-EXPORT_FUNCTIONS src_compile src_install
+EXPORT_FUNCTIONS src_unpack src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm






             reply	other threads:[~2009-03-10 11:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-10 11:08 Christoph Mende (angelos) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-03-10 11:25 [gentoo-commits] gentoo-x86 commit in eclass: xfce4.eclass Christoph Mende (angelos)
2009-03-13 11:22 Christoph Mende (angelos)
2009-03-16 14:43 Christoph Mende (angelos)
2009-05-01  4:13 Jeremy Olexa (darkside)
2009-07-08 15:23 Jeremy Olexa (darkside)
2009-09-07 18:20 Christoph Mende (angelos)
2011-01-30 18:58 Samuli Suominen (ssuominen)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1Lgzoh-00040C-R3@stork.gentoo.org \
    --to=angelos@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox