From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QI5pa-0007Np-9i for garchives@archives.gentoo.org; Thu, 05 May 2011 21:11:30 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 556601C08B; Thu, 5 May 2011 21:11:22 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 112C21C08B for ; Thu, 5 May 2011 21:11:21 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5AEF81B4002 for ; Thu, 5 May 2011 21:11:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id C022980505 for ; Thu, 5 May 2011 21:11:20 +0000 (UTC) From: "Ladislav Láska" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ladislav Láska" Message-ID: <1a2a12373a548c85d50c0ea5320af9afba90b587.krakonos@gentoo> Subject: [gentoo-commits] proj/kde-sunset:master commit in: eclass/ X-VCS-Repository: proj/kde-sunset X-VCS-Files: eclass/poppler.eclass X-VCS-Directories: eclass/ X-VCS-Committer: krakonos X-VCS-Committer-Name: Ladislav Láska X-VCS-Revision: 1a2a12373a548c85d50c0ea5320af9afba90b587 Date: Thu, 5 May 2011 21:11:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 60bdc7fe440e4257d78ed72a654f5c0f commit: 1a2a12373a548c85d50c0ea5320af9afba90b587 Author: Ladislav L=C3=A1ska kam mff cuni cz> AuthorDate: Thu May 5 21:10:30 2011 +0000 Commit: Ladislav L=C3=A1ska gmail com> CommitDate: Thu May 5 21:10:30 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/kde-sunset.gi= t;a=3Dcommit;h=3D1a2a1237 Added poppler.eclass, since it was removed from main tree and some ebuilds still depend on it. --- eclass/poppler.eclass | 197 +++++++++++++++++++++++++++++++++++++++++++= ++++++ 1 files changed, 197 insertions(+), 0 deletions(-) diff --git a/eclass/poppler.eclass b/eclass/poppler.eclass new file mode 100644 index 0000000..38da37d --- /dev/null +++ b/eclass/poppler.eclass @@ -0,0 +1,197 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/poppler.eclass,v 1.6 201= 0/01/03 19:10:49 scarabeus Exp $ + +# @ECLASS: poppler.eclass +# @MAINTAINER: +# Peter Alfredsen +# @BLURB: Reduces code duplication in the modularized poppler ebuilds. +# @DESCRIPTION: +# Provides an easy template for making modularized poppler-based ebuilds= . + +inherit base multilib libtool + +has 2 ${EAPI} || DEPEND=3D"EAPI-TOO-OLD" + +EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_in= stall + +RDEPEND=3D" + !app-text/poppler + !app-text/poppler-bindings + " +DEPEND=3D" + dev-util/pkgconfig + userland_GNU? ( >=3Dsys-apps/findutils-4.4.0 ) + " + + +# @ECLASS-VARIABLE: HOMEPAGE +# @DESCRIPTION: +# Default HOMEPAGE +HOMEPAGE=3D"http://poppler.freedesktop.org/" + +# @ECLASS-VARIABLE: SRC_URI +# @DESCRIPTION: +# Default SRC_URI +SRC_URI=3D"http://poppler.freedesktop.org/poppler-${PV}.tar.gz" + +# @ECLASS-VARIABLE: S +# @DESCRIPTION: +# Default working directory +S=3D${WORKDIR}/poppler-${PV} + +# @ECLASS-VARIABLE: POPPLER_MODULE +# @DESCRIPTION: +# The name of the poppler module. Must be set by the ebuild before inher= iting +# the poppler eclass. +POPPLER_MODULE=3D${POPPLER_MODULE} + +# @ECLASS-VARIABLE: POPPLER_MODULE_S +# @DESCRIPTION: +# The working directory of the poppler module. +POPPLER_MODULE_S=3D${S}/${POPPLER_MODULE} + +# @FUNCTION: pkg_check_modules_override +# @USAGE: [package1] [package2] +# @DESCRIPTION: +# Will export the appropriate variables to override PKG_CHECK_MODULES au= toconf +# macros, with the string " " by default. If packages are specified, the= y will +# be looked up with pkg-config and the appropriate LIBS and CFLAGS subst= ituted. +# LIBS and CFLAGS can also be specified per-package with the following s= yntax: +# @CODE +# package=3DLIBS%CFLAGS +# @CODE +# =3D and % have no effect unless both are specified. +# Here is an example: +# @CODE +# pkg_check_modules_override GASH "gtk+-2.0=3D-jule%" gobject-2.0 +# @CODE +# The above example will do: +# @CODE +# export GASH_CFLAGS+=3D" -jule" +# export GASH_LIBS+=3D" " +# export GASH_CFLAGS+=3D" $(pkg-config --cflags gobject-2.0)" +# export GASH_LIBS+=3D" $(pkg-config --libs gobject-2.0)" +# @CODE +# +# NOTE: If a package is not found, the string " " will be inserted in pl= ace of +# _CFLAGS and _LIBS +pkg_check_modules_override() { + local package + local group=3D"${1}" + local packages=3D"${*:2}" + export ${group}_CFLAGS=3D" " + export ${group}_LIBS=3D" " + + if [[ ${#@} -lt 1 ]] + then + eerror "${FUNCNAME[0]} requires at least one parameter: GROUP" + eerror "PKG_CHECK_MODULES(GROUP, package1 package2 etc)" + die "${FUNCNAME[0]} requires at least one parameter: GROUP" + fi + + for package in $packages + do + if [[ ${package/=3D} !=3D ${package} && ${package/\%} !=3D ${package} = ]] + then + package_cflag_libs=3D${package##*=3D} + export ${group}_CFLAGS+=3D" ${package_cflag_libs%%\%*}" + export ${group}_LIBS+=3D" ${package_cflag_libs##*\%}" + else + if pkg-config --exists $package + then + export ${group}_CFLAGS+=3D" $(pkg-config --cflags $package)" + export ${group}_LIBS+=3D" $(pkg-config --libs $package)" + else + export ${group}_CFLAGS+=3D" " + export ${group}_LIBS+=3D" " + fi + fi + done +} +# @FUNCTION: poppler_src_unpack +# @USAGE: +# @DESCRIPTION: +# Runs unpack ${A} +poppler_src_unpack() { + unpack ${A} +} + +# @FUNCTION: poppler_src_prepare +# @USAGE: +# @DESCRIPTION: +# Runs autopatch from base.eclass. +# Uses sed to replace libpoppler.la references with -lpoppler +poppler_src_prepare() { + base_src_prepare + sed -i \ + -e 's#$(top_builddir)/poppler/libpoppler.la#-lpoppler#' \ + $(find . -type f -name 'Makefile.in') || die "Failed to sed proper lib= into Makefile.am" + elibtoolize +} + +# @FUNCTION: poppler_src_configure +# @USAGE: +# @DESCRIPTION: +# Makes sure we get a uniform Makefile environment by using pkg_check_mo= dules_override to +# fill out some blanks that configure wants filled. Probably not really = needed, but +# insures against future breakage. +# Calls econf with some defaults. +poppler_src_configure() { + pkg_check_modules_override CAIRO cairo + pkg_check_modules_override POPPLER_GLIB glib-2.0 + pkg_check_modules_override POPPLER_QT4 QtCore QtGui QtXml + pkg_check_modules_override POPPLER_QT4_TEST QtTest + pkg_check_modules_override ABIWORD libxml-2.0 + pkg_check_modules_override GTK_TEST gtk+-2.0 gdk-pixbuf-2.0 libglade-2.= 0 gthread-2.0 + pkg_check_modules_override POPPLER_GLIB glib-2.0 gobject-2.0 + + econf --disable-static \ + --enable-poppler-qt4 \ + --enable-poppler-glib \ + --enable-xpdf-headers \ + --enable-libjpeg \ + --enable-libopenjpeg \ + --enable-zlib \ + --enable-splash-output \ + ${POPPLER_CONF} +} + +# @FUNCTION: poppler_src_compile +# @USAGE: +# @DESCRIPTION: +# Removes top_srcdir Makefile to ensure that no accidental recursion hap= pens. The build +# will just die if it tries to go through top_srcdir. +# Runs emake "$@" in POPPLER_MODULE_S +poppler_src_compile() { + rm -f "${S}"/Makefile* &> /dev/null + cd "${POPPLER_MODULE_S}" || die "POPPLER_MODULE_S=3D${POPPLER_MODULE_S}= - cd failed" + einfo "Now in $POPPLER_MODULE_S" + emake "$@" || die "emake failed" +} + +# @FUNCTION: poppler_src_install +# @USAGE: +# @DESCRIPTION: +# Runs emake DESTDIR=3D"${D}" ${@:-install} in POPPLER_MODULE_S +# Removes .la files. +poppler_src_install() { + cd "${POPPLER_MODULE_S}" + emake DESTDIR=3D"${D}" ${@:-install} || die "make install failed" + for pfile in "${POPPLER_PKGCONFIG[@]}" + do + insinto /usr/$(get_libdir)/pkgconfig + if [[ ${pfile/=3D} !=3D ${pfile} ]] + then + if use ${pfile%=3D*} + then + pfile=3D${pfile#*=3D} + else + pfile=3Dfalse + fi + fi + [[ ${pfile} !=3D "false" ]] && doins "${S}/${pfile}" + done + + find "${D}" -type f -name '*.la' -exec rm -rf '{}' '+' || die "la remov= al failed" +}