* [gentoo-commits] dev/dilfridge:master commit in: eclass/
@ 2011-03-24 13:33 Andreas K. Huettel
0 siblings, 0 replies; 8+ messages in thread
From: Andreas K. Huettel @ 2011-03-24 13:33 UTC (permalink / raw
To: gentoo-commits
commit: 917842eb31e75fd612ff31dece1413af7e88bddf
Author: Andreas K. Huettel <andreas.huettel <AT> physik <DOT> uni-r <DOT> de>
AuthorDate: Thu Mar 24 13:32:46 2011 +0000
Commit: Andreas K. Huettel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Thu Mar 24 13:33:14 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/dilfridge.git;a=commit;h=917842eb
[eclass] Remove outdated virtualx copy
---
eclass/virtualx.eclass | 205 ------------------------------------------------
1 files changed, 0 insertions(+), 205 deletions(-)
diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
deleted file mode 100644
index 782605d..0000000
--- a/eclass/virtualx.eclass
+++ /dev/null
@@ -1,205 +0,0 @@
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/virtualx.eclass,v 1.35 2010/05/15 05:40:46 dirtyepic Exp $
-
-# Original author: Martin Schlemmer <azarah@gentoo.org>
-
-# @ECLASS: virtualx.eclass
-# @MAINTAINER:
-# x11@gentoo.org
-# @BLURB: This eclass can be used for packages that needs a working X environment to build.
-
-# @ECLASS-VARIABLE: VIRTUALX_REQUIRED
-# @DESCRIPTION:
-# Is a dependency on xorg-server and xhost needed?
-# Valid values are "always", "optional", and "manual".
-# "tests" is a synonym for "optional".
-: ${VIRTUALX_REQUIRED:=optional}
-
-# @ECLASS-VARIABLE: VIRTUALX_USE
-# @DESCRIPTION:
-# If VIRTUALX_REQUIRED=optional, what USE flag should control
-# the dependency?
-: ${VIRTUALX_USE:=test}
-
-# @ECLASS-VARIABLE: VIRTUALX_DBUS_REQUIRED
-# @DESCRIPTION:
-# Is a d-bus session bus needed?
-# Valid values are "always", "optional", and "manual".
-# "tests" is a synonym for "optional".
-: ${VIRTUALX_DBUS_REQUIRED:=manual}
-
-# @ECLASS-VARIABLE: VIRTUALX_DEPEND
-# @DESCRIPTION:
-# Dep string available for use outside of eclass, in case a more
-# complicated dep is needed.
-VIRTUALX_DEPEND="!prefix? ( x11-base/xorg-server )
- x11-apps/xhost"
-
-# @ECLASS-VARIABLE: VIRTUALX_DBUS_DEPEND
-# @DESCRIPTION:
-# Dep string available for use outside of eclass, in case a more
-# complicated dep is needed.
-VIRTUALX_DBUS_DEPEND="sys-apps/dbus"
-
-case ${VIRTUALX_REQUIRED} in
- always)
- DEPEND="${VIRTUALX_DEPEND} "
- RDEPEND=""
- ;;
- optional|tests)
- DEPEND="${VIRTUALX_USE}? ( ${VIRTUALX_DEPEND} ) "
- RDEPEND=""
- IUSE="${VIRTUALX_USE}"
- ;;
- manual)
- ;;
- *)
- eerror "Invalid value (${VIRTUALX_REQUIRED}) for VIRTUALX_REQUIRED"
- eerror "Valid values are:"
- eerror " always"
- eerror " optional (default if unset)"
- eerror " manual"
- die "Invalid value (${VIRTUALX_REQUIRED}) for VIRTUALX_REQUIRED"
- ;;
-esac
-
-case ${VIRTUALX_DBUS_REQUIRED} in
- always)
- DEPEND+="${VIRTUALX_DBUS_DEPEND} "
- ;;
- optional|tests)
- DEPEND+="${VIRTUALX_USE}? ( ${VIRTUALX_DBUS_DEPEND} ) "
- ;;
- manual)
- ;;
- *)
- eerror "Invalid value (${VIRTUALX_DBUS_REQUIRED}) for VIRTUALX_DBUS_REQUIRED"
- eerror "Valid values are:"
- eerror " always"
- eerror " optional (default if unset)"
- eerror " manual"
- die "Invalid value (${VIRTUALX_DBUS_REQUIRED}) for VIRTUALX_DBUS_REQUIRED"
- ;;
-esac
-
-virtualmake() {
- local retval=0
- local OLD_SANDBOX_ON="${SANDBOX_ON}"
- local XVFB=$(type -p Xvfb)
- local XHOST=$(type -p xhost)
-
- # If $DISPLAY is not set, or xhost cannot connect to an X
- # display, then do the Xvfb hack.
- if [[ -n ${XVFB} && -n ${XHOST} ]] && \
- ( [[ -z ${DISPLAY} ]] || ! (${XHOST} &>/dev/null) ) ; then
- export XAUTHORITY=
- # The following is derived from Mandrake's hack to allow
- # compiling without the X display
-
- einfo "Scanning for an open DISPLAY to start Xvfb ..."
-
- # We really do not want SANDBOX enabled here
- export SANDBOX_ON="0"
-
- local i=0
- XDISPLAY=$(i=0; while [[ -f /tmp/.X${i}-lock ]] ; do ((i++));done; echo ${i})
-
- # If we are in a chrooted environment, and there is already a
- # X server started outside of the chroot, Xvfb will fail to start
- # on the same display (most cases this is :0 ), so make sure
- # Xvfb is started, else bump the display number
- #
- # Azarah - 5 May 2002
- #
- # Changed the mode from 800x600x32 to 800x600x24 because the mfb
- # support has been dropped in Xvfb in the xorg-x11 pre-releases.
- # For now only depths up to 24-bit are supported.
- #
- # Sven Wegener <swegener@gentoo.org> - 22 Aug 2004
- #
- # Use "-fp built-ins" because it's only part of the default font path
- # for Xorg but not the other DDXs (Xvfb, Kdrive, etc). Temporarily fixes
- # bug 278487 until xorg-server is properly patched
- #
- # Rémi Cardona <remi@gentoo.org> (10 Aug 2009)
- ${XVFB} :${XDISPLAY} -fp built-ins -screen 0 800x600x24 &>/dev/null &
- sleep 2
-
- local start=${XDISPLAY}
- while [[ ! -f /tmp/.X${XDISPLAY}-lock ]] ; do
- # Stop trying after 15 tries
- if ((XDISPLAY - start > 15)) ; then
-
- eerror ""
- eerror "Unable to start Xvfb."
- eerror ""
- eerror "'${XVFB} :${XDISPLAY} -fp built-ins -screen 0 800x600x24' returns:"
- eerror ""
- ${XVFB} :${XDISPLAY} -fp built-ins -screen 0 800x600x24
- eerror ""
- eerror "If possible, correct the above error and try your emerge again."
- eerror ""
- die
- fi
-
- ((XDISPLAY++))
- ${XVFB} :${XDISPLAY} -fp built-ins -screen 0 800x600x24 &>/dev/null &
- sleep 2
- done
-
- # Now enable SANDBOX again if needed.
- export SANDBOX_ON="${OLD_SANDBOX_ON}"
-
- einfo "Starting Xvfb on \$DISPLAY=${XDISPLAY} ..."
-
- export DISPLAY=:${XDISPLAY}
-
- if [[ ${VIRTUALX_DBUS_REQUIRED} == always ]] ||
- ( [[ ${VIRTUALX_REQUIRED} == optional ]] && use ${VIRTUALX_USE} ) ||
- ( [[ ${VIRTUALX_REQUIRED} == tests ]] && use ${VIRTUALX_USE} ); then
-
- ewarn 'Allowing access to system messagebus (experimental feature)'
- addread /var/run/dbus/system_bus_socket
- addwrite /var/run/dbus/system_bus_socket
- fi
-
- #Do not break on error, but setup $retval, as we need
- #to kill Xvfb
- ${maketype} "$@"
- retval=$?
-
- #Now kill Xvfb
- kill $(cat /tmp/.X${XDISPLAY}-lock)
- else
- #Normal make if we can connect to an X display
- ${maketype} "$@"
- retval=$?
- fi
-
- return ${retval}
-}
-
-# @FUNCTION: Xmake
-# @DESCRIPTION:
-# Same as "make", but set up the Xvfb hack if needed.
-Xmake() {
- export maketype="make"
- virtualmake "$@"
-}
-
-# @FUNCTION: Xemake
-# @DESCRIPTION:
-# Same as "emake", but set up the Xvfb hack if needed.
-Xemake() {
- export maketype="emake"
- virtualmake "$@"
-}
-
-# @FUNCTION: Xeconf
-# @DESCRIPTION:
-# Same as "econf", but set up the Xvfb hack if needed.
-Xeconf() {
- export maketype="econf"
- virtualmake "$@"
-}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] dev/dilfridge:master commit in: eclass/
@ 2011-04-06 19:35 Andreas K. Huettel
0 siblings, 0 replies; 8+ messages in thread
From: Andreas K. Huettel @ 2011-04-06 19:35 UTC (permalink / raw
To: gentoo-commits
commit: a88e40089da86119edfcb7399f1a50ace39ec95a
Author: Andreas K. Huettel <andreas.huettel <AT> physik <DOT> uni-r <DOT> de>
AuthorDate: Wed Apr 6 19:35:11 2011 +0000
Commit: Andreas K. Huettel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Wed Apr 6 19:35:46 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/dilfridge.git;a=commit;h=a88e4008
[eclass] outdated
---
eclass/kde4-functions.eclass | 575 ------------------------------------------
1 files changed, 0 insertions(+), 575 deletions(-)
diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass
deleted file mode 100644
index 34bc1aa..0000000
--- a/eclass/kde4-functions.eclass
+++ /dev/null
@@ -1,575 +0,0 @@
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.41 2010/12/29 17:56:34 tampakrap Exp $
-
-inherit versionator
-
-# @ECLASS: kde4-functions.eclass
-# @MAINTAINER:
-# kde@gentoo.org
-# @BLURB: Common ebuild functions for KDE 4 packages
-# @DESCRIPTION:
-# This eclass contains all functions shared by the different eclasses,
-# for KDE 4 ebuilds.
-
-# @ECLASS-VARIABLE: EAPI
-# @DESCRIPTION:
-# Currently kde4 eclasses support EAPI 3. Over time newer versions
-# will be supported.
-case ${EAPI:-0} in
- 4|3) : ;;
- *) die "EAPI=${EAPI} is not supported" ;;
-esac
-
-# @ECLASS-VARIABLE: KDE_OVERRIDE_MINIMAL
-# @DESCRIPTION:
-# For use only in very few well-defined cases; normally it should be unset.
-# If this variable is set, all calls to add_kdebase_dep return a dependency on
-# at least this version, independent of the version of the package itself.
-# If you know exactly that one specific NEW KDE component builds and runs fine
-# with all the rest of KDE at an OLDER version, you can set this old version here.
-# Warning- may lead to general instability and kill your pet targh.
-
-# @ECLASS-VARIABLE: KDEBASE
-# @DESCRIPTION:
-# This gets set to a non-zero value when a package is considered a kde or
-# koffice ebuild.
-if [[ ${CATEGORY} = kde-base ]]; then
- debug-print "${ECLASS}: KDEBASE ebuild recognized"
- KDEBASE=kde-base
-elif [[ ${KMNAME-${PN}} = koffice ]]; then
- debug-print "${ECLASS}: KOFFICE ebuild recognized"
- KDEBASE=koffice
-elif [[ ${KMNAME-${PN}} = kdevelop ]]; then
- debug-print "${ECLASS}: KDEVELOP ebuild recognized"
- KDEBASE=kdevelop
-fi
-
-# @ECLASS-VARIABLE: KDE_SCM
-# @DESCRIPTION:
-# If this is a live package which scm does it use
-KDE_SCM="${KDE_SCM:-svn}"
-case ${KDE_SCM} in
- svn|git) ;;
- *) die "KDE_SCM: ${KDE_SCM} is not supported" ;;
-esac
-
-# @ECLASS-VARIABLE: KDE_SLOTS
-# @DESCRIPTION:
-# The slots used by all KDE versions later than 4.0. The live KDE releases use
-# KDE_LIVE_SLOTS instead. Values should be ordered.
-KDE_SLOTS=( "4.1" "4.2" "4.3" "4.4" "4.5" "4.6" )
-
-# @ECLASS-VARIABLE: KDE_LIVE_SLOTS
-# @DESCRIPTION:
-# The slots used by KDE live versions. Values should be ordered.
-KDE_LIVE_SLOTS=( "live" )
-
-# @FUNCTION: slot_is_at_least
-# @USAGE: <want> <have>
-# @DESCRIPTION:
-# Version aware slot comparator.
-# Current implementation relies on the fact, that slots can be compared like
-# string literals (and let's keep it this way).
-slot_is_at_least() {
- [[ "${2}" > "${1}" || "${2}" = "${1}" ]]
-}
-
-# @FUNCTION: buildsycoca
-# @DESCRIPTION:
-# Function to rebuild the KDE System Configuration Cache.
-# All KDE ebuilds should run this in pkg_postinst and pkg_postrm.
-buildsycoca() {
- debug-print-function ${FUNCNAME} "$@"
-
- # We no longer need to run kbuildsycoca4, as kded does that automatically, as needed
-
- # fix permission for some directories
- for x in share/{config,kde4}; do
- [[ ${KDEDIR} == /usr ]] && DIRS=${EROOT}usr || DIRS="${EROOT}usr ${EROOT}${KDEDIR}"
- for y in ${DIRS}; do
- [[ -d "${y}/${x}" ]] || break # nothing to do if directory does not exist
- if [[ $(stat --format=%a "${y}/${x}") != 755 ]]; then
- ewarn "QA Notice:"
- ewarn "Package ${PN} is breaking ${y}/${x} permissions."
- ewarn "Please report this issue to gentoo bugzilla."
- einfo "Permissions will get adjusted automatically now."
- find "${y}/${x}" -type d -print0 | xargs -0 chmod 755
- fi
- done
- done
-}
-
-# @FUNCTION: comment_all_add_subdirectory
-# @USAGE: [list of directory names]
-# @DESCRIPTION:
-# Recursively comment all add_subdirectory instructions in listed directories,
-# except those in cmake/.
-comment_all_add_subdirectory() {
- find "$@" -name CMakeLists.txt -print0 | grep -vFzZ "./cmake" | \
- xargs -0 sed -i \
- -e '/^[[:space:]]*add_subdirectory/s/^/#DONOTCOMPILE /' \
- -e '/^[[:space:]]*ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' \
- -e '/^[[:space:]]*macro_optional_add_subdirectory/s/^/#DONOTCOMPILE /' \
- -e '/^[[:space:]]*MACRO_OPTIONAL_ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' \
- || die "${LINENO}: Initial sed died"
-}
-
-# @ECLASS-VARIABLE: KDE_LINGUAS
-# @DESCRIPTION:
-# This is a whitespace-separated list of translations this ebuild supports.
-# These translations are automatically added to IUSE. Therefore ebuilds must set
-# this variable before inheriting any eclasses. To enable only selected
-# translations, ebuilds must call enable_selected_linguas(). kde4-{base,meta}.eclass does
-# this for you.
-#
-# Example: KDE_LINGUAS="en_GB de nl"
-for _lingua in ${KDE_LINGUAS}; do
- IUSE="${IUSE} linguas_${_lingua}"
-done
-
-# @FUNCTION: enable_selected_linguas
-# @DESCRIPTION:
-# Enable translations based on LINGUAS settings and translations supported by
-# the package (see KDE_LINGUAS). By default, translations are found in "${S}"/po
-# but this default can be overridden by defining KDE_LINGUAS_DIR.
-enable_selected_linguas() {
- debug-print-function ${FUNCNAME} "$@"
-
- local x
-
- # if there is no linguas defined we enable everything
- if ! $(env | grep -q "^LINGUAS="); then
- return 0
- fi
-
- # @ECLASS-VARIABLE: KDE_LINGUAS_DIR
- # @DESCRIPTION:
- # Specified folder where application translations are located.
- # Can be defined as array of folders where translations are located.
- # Note that space separated list of dirs is not supported.
- # Default value is set to "po".
- if [[ "$(declare -p KDE_LINGUAS_DIR 2>/dev/null 2>&1)" == "declare -a"* ]]; then
- debug-print "$FUNCNAME: we have these subfolders defined: ${KDE_LINGUAS_DIR}"
- for x in "${KDE_LINGUAS_DIR[@]}"; do
- _enable_selected_linguas_dir ${x}
- done
- else
- KDE_LINGUAS_DIR=${KDE_LINGUAS_DIR:="po"}
- _enable_selected_linguas_dir ${KDE_LINGUAS_DIR}
- fi
-}
-
-# @FUNCTION: enable_selected_doc_linguas
-# @DESCRIPTION:
-# Enable only selected linguas enabled doc folders.
-enable_selected_doc_linguas() {
- debug-print-function ${FUNCNAME} "$@"
-
- # if there is no linguas defined we enable everything
- if ! $(env | grep -q "^LINGUAS="); then
- return 0
- fi
-
- # @ECLASS-VARIABLE: KDE_DOC_DIRS
- # @DESCRIPTION:
- # Variable specifying whitespace separated patterns for documentation locations.
- # Default is "doc/%lingua"
- KDE_DOC_DIRS=${KDE_DOC_DIRS:='doc/%lingua'}
- local linguas
- for pattern in ${KDE_DOC_DIRS}; do
-
- local handbookdir=`dirname ${pattern}`
- local translationdir=`basename ${pattern}`
- # Do filename pattern supplied, treat as directory
- [[ "${handbookdir}" = '.' ]] && handbookdir=${translationdir} && translationdir=
- [[ -d "${handbookdir}" ]] || die 'wrong doc dir specified'
-
- if ! use handbook; then
- # Disable whole directory
- sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
- -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
- -i CMakeLists.txt || die 'failed to comment out all handbooks'
- else
- # Disable subdirectories recursively
- comment_all_add_subdirectory "${handbookdir}"
- # Add requested translations
- local lingua
- for lingua in en ${KDE_LINGUAS}; do
- if [[ ${lingua} = 'en' ]] || use linguas_${lingua}; then
- if [[ -d "${handbookdir}/${translationdir//%lingua/${lingua}}" ]]; then
- sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \
- -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \
- -i "${handbookdir}"/CMakeLists.txt && ! has ${lingua} ${linguas} && linguas="${linguas} ${lingua}"
- fi
- fi
- done
- fi
-
- done
- [[ -n "${linguas}" ]] && einfo "Enabling handbook translations:${linguas}"
-}
-
-# @FUNCTION: get_build_type
-# @DESCRIPTION:
-# Determine whether we are using live ebuild or tbzs.
-get_build_type() {
- if [[ ${SLOT} = live || ${PV} = *9999* ]]; then
- BUILD_TYPE="live"
- else
- BUILD_TYPE="release"
- fi
- export BUILD_TYPE
-}
-
-# @FUNCTION: migrate_store_dir
-# @DESCRIPTION:
-# Universal store dir migration
-# * performs split of kdebase to kdebase-apps when needed
-# * moves playground/extragear kde4-base-style to toplevel dir
-migrate_store_dir() {
- if [[ ${KDE_SCM} != svn ]]; then
- die "migrate_store_dir() only makes sense for subversion"
- fi
-
- local cleandir="${ESVN_STORE_DIR}/KDE"
-
- if [[ -d "${cleandir}" ]]; then
- ewarn "'${cleandir}' has been found. Moving contents to new location."
- addwrite "${ESVN_STORE_DIR}"
- # Split kdebase
- local module
- if pushd "${cleandir}"/kdebase/kdebase > /dev/null; then
- for module in `find . -maxdepth 1 -type d -name [a-z0-9]\*`; do
- module="${module#./}"
- mkdir -p "${ESVN_STORE_DIR}/kdebase-${module}" && mv -f "${module}" "${ESVN_STORE_DIR}/kdebase-${module}" || \
- die "Failed to move to '${ESVN_STORE_DIR}/kdebase-${module}'."
- done
- popd > /dev/null
- rm -fr "${cleandir}/kdebase" || \
- die "Failed to remove ${cleandir}/kdebase. You need to remove it manually."
- fi
- # Move the rest
- local pkg
- for pkg in "${cleandir}"/*; do
- mv -f "${pkg}" "${ESVN_STORE_DIR}"/ || eerror "Failed to move '${pkg}'"
- done
- rmdir "${cleandir}" || die "Could not move obsolete KDE store dir. Please move '${cleandir}' contents to appropriate location (possibly ${ESVN_STORE_DIR}) and manually remove '${cleandir}' in order to continue."
- fi
-
- if ! hasq kde4-meta ${INHERITED}; then
- case ${KMNAME} in
- extragear*|playground*)
- local scmlocalpath="${ESVN_STORE_DIR}"/"${KMNAME}"/"${PN}"
- if [[ -d "${scmlocalpath}" ]]; then
- local destdir="${ESVN_STORE_DIR}"/"${ESVN_PROJECT}"/"`basename "${ESVN_REPO_URI}"`"
- ewarn "'${scmlocalpath}' has been found."
- ewarn "Moving contents to new location: ${destdir}"
- addwrite "${ESVN_STORE_DIR}"
- mkdir -p "${ESVN_STORE_DIR}"/"${ESVN_PROJECT}" && mv -f "${scmlocalpath}" "${destdir}" \
- || die "Failed to move to '${scmlocalpath}'"
- # Try cleaning empty directories
- rmdir "`dirname "${scmlocalpath}"`" 2> /dev/null
- fi
- ;;
- esac
- fi
-}
-
-# Functions handling KMLOADLIBS and KMSAVELIBS
-
-# @FUNCTION: save_library_dependencies
-# @DESCRIPTION:
-# Add exporting CMake dependencies for current package
-save_library_dependencies() {
- local depsfile="${T}/${PN}:${SLOT}"
-
- ebegin "Saving library dependencies in ${depsfile##*/}"
- echo "EXPORT_LIBRARY_DEPENDENCIES(\"${depsfile}\")" >> "${S}/CMakeLists.txt" || \
- die "Failed to save the library dependencies."
- eend $?
-}
-
-# @FUNCTION: install_library_dependencies
-# @DESCRIPTION:
-# Install generated CMake library dependencies to /var/lib/kde
-install_library_dependencies() {
- local depsfile="${T}/${PN}:${SLOT}"
-
- ebegin "Installing library dependencies as ${depsfile##*/}"
- insinto /var/lib/kde
- doins "${depsfile}" || die "Failed to install library dependencies."
- eend $?
-}
-
-# @FUNCTION: load_library_dependencies
-# @DESCRIPTION:
-# Inject specified library dependencies in current package
-load_library_dependencies() {
- local pn i depsfile
- ebegin "Injecting library dependencies from '${KMLOADLIBS}'"
-
- i=0
- for pn in ${KMLOADLIBS} ; do
- ((i++))
- depsfile="${EPREFIX}/var/lib/kde/${pn}:${SLOT}"
- [[ -r "${depsfile}" ]] || die "Depsfile '${depsfile}' not accessible. You probably need to reinstall ${pn}."
- sed -i -e "${i}iINCLUDE(\"${depsfile}\")" "${S}/CMakeLists.txt" || \
- die "Failed to include library dependencies for ${pn}"
- done
- eend $?
-}
-
-# @FUNCTION: block_other_slots
-# @DESCRIPTION:
-# Create blocks for the current package in other slots when
-# installed with USE=-kdeprefix
-block_other_slots() {
- debug-print-function ${FUNCNAME} "$@"
-
- _do_blocker ${PN} 0:${SLOT}
-}
-
-# @FUNCTION: add_blocker
-# @DESCRIPTION:
-# Create correct RDEPEND value for blocking correct package.
-# Useful for file-collision blocks.
-# Parameters are package and version(s) to block.
-# add_blocker kdelibs 4.2.4
-# If no version is specified, then all versions will be blocked
-# If any arguments (from 2 on) contain a ":", then different versions
-# are blocked in different slots. (Unlisted slots get the version without
-# a ":", if none, then all versions are blocked). The parameter is then of
-# the form VERSION:SLOT. Any VERSION of 0 means that no blocker will be
-# added for that slot (or, if no slot, then for any unlisted slot).
-# A parameter of the form :SLOT means to block all versions from that slot.
-# If VERSION begins with "<", then "!<foo" will be used instead of "!<=foo".
-# As a special case, if a parameter with slot "3.5" is passed, then that slot
-# may also be blocked.
-#
-# Versions that match "4.x.50" are equivalent to all slots up to (and including)
-# "4.x", but nothing following slot "4.x"
-#
-# As an example, if SLOT=live, then
-# add_blocker kdelibs 0 :4.3 '<4.3.96:4.4' 9999:live
-# will add the following to RDEPEND:
-# !kdeprefix? ( !kde-base/kdelibs:4.3[-kdeprefix] )
-# !kdeprefix? ( !<kde-base/kdelibs-4.3.96:4.4[-kdeprefix] )
-# !<=kde-base/kdelibs-9999:live
-add_blocker() {
- debug-print-function ${FUNCNAME} "$@"
-
- RDEPEND+=" $(_do_blocker "$@")"
-}
-
-# @FUNCTION: add_kdebase_dep
-# @DESCRIPTION:
-# Create proper dependency for kde-base/ dependencies, adding SLOT when needed
-# (and *only* when needed).
-# This takes 1 to 3 arguments. The first being the package name, the optional
-# second is additional USE flags to append, and the optional third is the
-# version to use instead of the automatic version (use sparingly).
-# The output of this should be added directly to DEPEND/RDEPEND, and may be
-# wrapped in a USE conditional (but not an || conditional without an extra set
-# of parentheses).
-add_kdebase_dep() {
- debug-print-function ${FUNCNAME} "$@"
-
- local ver
-
- if [[ -n ${3} ]]; then
- ver=${3}
- elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then
- ver=${KDE_OVERRIDE_MINIMAL}
- elif [[ ${KDEBASE} != kde-base ]]; then
- ver=${KDE_MINIMAL}
- # FIXME remove hack when kdepim-4.4.* is gone
- elif [[ ( ${KMNAME} == kdepim || ${PN} == kdepim-runtime ) && ${PV} == 4.4.[6-8] && ${1} =~ ^kde(pim)?libs$ ]]; then
- ver=4.4.5
- # FIXME remove hack when kdepim-4.6beta is gone
- elif [[ ( ${KMNAME} == kdepim || ${PN} == kdepim-runtime ) && ${PV} == 4.5.98 && ${1} =~ ^(kde(pim)?libs|oxygen-icons)$ ]]; then
- ver=4.5.90
- # if building stable-live version depend just on slot
- # to allow merging packages against more stable basic stuff
- elif [[ ${PV} == *.9999 ]]; then
- ver=${SLOT}
- else
- ver=${PV}
- fi
-
- [[ -z ${1} ]] && die "Missing parameter"
-
- local use=${2:+,${2}}
-
- if [[ ${KDEBASE} = kde-base ]]; then
- echo " !kdeprefix? ( >=kde-base/${1}-${ver}[aqua=,-kdeprefix${use}] )"
- echo " kdeprefix? ( >=kde-base/${1}-${ver}:${SLOT}[aqua=,kdeprefix${use}] )"
- elif [[ ${ver} == live ]]; then
- echo " kde-base/${1}:live[aqua=${use}]"
- else
- echo " >=kde-base/${1}-${ver}[aqua=${use}]"
- fi
-}
-
-# _greater_max_in_slot ver slot
-# slot must be 4.x or live
-# returns true if ver is >= the maximum possibile version in slot
-_greater_max_in_slot() {
- local ver=$1
- local slot=$2
- # If slot is live, then return false
- # (nothing is greater than the maximum live version)
- [[ $slot == live ]] && return 1
- # Otherwise, for slot X.Y, test against X.Y.50
- local test=${slot}.50
- version_compare $1 ${test}
- # 1 = '<', 2 = '=', 3 = '>'
- (( $? != 1 ))
-}
-
-# _less_min_in_slot ver slot
-# slot must be 4.x or live
-# returns true if ver is <= the minimum possibile version in slot
-_less_min_in_slot() {
- local ver=$1
- local slot=$2
- # If slot == live, then test with "9999_pre", so that 9999 tests false
- local test=9999_pre
- # If slot == X.Y, then test with X.(Y-1).50
- [[ $slot != live ]] && test=${slot%.*}.$((${slot#*.} - 1)).50
- version_compare $1 ${test}
- # 1 = '<', 2 = '=', 3 = '>'
- (( $? != 3 ))
-}
-
-# Internal function used for add_blocker and block_other_slots
-# This takes the same parameters as add_blocker, but echos to
-# stdout instead of updating a variable.
-_do_blocker() {
- debug-print-function ${FUNCNAME} "$@"
-
- [[ -z ${1} ]] && die "Missing parameter"
- local pkg=kde-base/$1
- shift
- local param slot def="unset" var atom
- # The following variables will hold parameters that contain ":"
- # - block_3_5
- # - block_4_1
- # - block_4_2
- # - block_4_3
- # - block_4_4
- # - block_live
- for slot in 3.5 ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
- local block_${slot//./_}="unset"
- done
-
- # This construct goes through each parameter passed, and sets
- # either def or block_* to the version passed
- for param; do
- # If the parameter does not have a ":" in it...
- if [[ ${param/:} == ${param} ]]; then
- def=${param}
- else # the parameter *does* have a ":" in it
- # so everything after the : is the slot...
- slot=${param#*:}
- # ...and everything before the : is the version
- local block_${slot//./_}=${param%:*}
- fi
- done
-
- for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
- # ${var} contains the name of the variable we care about for this slot
- # ${!var} is it's value
- var=block_${slot//./_}
- # if we didn't pass *:${slot}, then use the unsloted value
- [[ ${!var} == "unset" ]] && var=def
-
- # If no version was passed, or the version is greater than the maximum
- # possible version in this slot, block all versions in this slot
- if [[ ${!var} == "unset" ]] || [[ -z ${!var} ]] || _greater_max_in_slot ${!var#<} ${slot}; then
- atom=${pkg}
- # If the version is "0" or less than the minimum possible version in
- # this slot, do nothing
- elif [[ ${!var} == "0" ]] || _less_min_in_slot ${!var#<} ${slot}; then
- continue
- # If the version passed begins with a "<", then use "<" instead of "<="
- elif [[ ${!var:0:1} == "<" ]]; then
- # this also removes the first character of the version, which is a "<"
- atom="<${pkg}-${!var:1}"
- else
- atom="<=${pkg}-${!var}"
- fi
- # we always block our own slot, ignoring kdeprefix
- if [[ ${SLOT} == ${slot} ]]; then
- echo " !${atom}:${slot}"
- else
- # we only block other slots on -kdeprefix
- echo " !kdeprefix? ( !${atom}:${slot}[-kdeprefix] )"
- fi
- done
-
- # This is a special case block for :3.5; it does not use the
- # default version passed, and no blocker is output *unless* a version
- # is passed, or ":3.5" is passed to explicitly request a block on all
- # 3.5 versions.
- if [[ ${block_3_5} != "unset" && ${block_3_5} != "0" ]]; then
- if [[ -z ${block_3_5} ]]; then
- atom=${pkg}
- elif [[ ${block_3_5:0:1} == "<" ]]; then
- atom="<${pkg}-${block_3_5:1}"
- else
- atom="<=${pkg}-${block_3_5}"
- fi
- echo " !${atom}:3.5"
- fi
-}
-
-# local function to enable specified translations for specified directory
-# used from kde4-functions_enable_selected_linguas function
-_enable_selected_linguas_dir() {
- local lingua linguas sr_mess wp
- local dir=${1}
-
- [[ -d "${dir}" ]] || die "linguas dir \"${dir}\" does not exist"
- comment_all_add_subdirectory "${dir}"
- pushd "${dir}" > /dev/null
-
- # fix all various crazy sr@Latn variations
- # this part is only ease for ebuilds, so there wont be any die when this
- # fail at any point
- sr_mess="sr@latn sr@latin sr@Latin"
- for wp in ${sr_mess}; do
- [[ -e "${wp}.po" ]] && mv "${wp}.po" "sr@Latn.po"
- if [[ -d "${wp}" ]]; then
- # move dir and fix cmakelists
- mv "${wp}" "sr@Latn"
- sed -i \
- -e "s:${wp}:sr@Latn:g" \
- CMakeLists.txt
- fi
- done
-
- for lingua in ${KDE_LINGUAS}; do
- if [[ -e "${lingua}.po" ]]; then
- mv "${lingua}.po" "${lingua}.po.old"
- fi
- done
-
- for lingua in ${KDE_LINGUAS}; do
- if use linguas_${lingua} ; then
- if [[ -d "${lingua}" ]]; then
- linguas="${linguas} ${lingua}"
- sed -e "/add_subdirectory([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \
- -e "/ADD_SUBDIRECTORY([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \
- -i CMakeLists.txt || die "Sed to uncomment linguas_${lingua} failed."
- fi
- if [[ -e "${lingua}.po.old" ]]; then
- linguas="${linguas} ${lingua}"
- mv "${lingua}.po.old" "${lingua}.po"
- fi
- fi
- done
- [[ -n "${linguas}" ]] && echo ">>> Enabling languages: ${linguas}"
-
- popd > /dev/null
-}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] dev/dilfridge:master commit in: eclass/
@ 2011-07-17 17:31 Andreas Hüttel
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Hüttel @ 2011-07-17 17:31 UTC (permalink / raw
To: gentoo-commits
commit: a94e6887e9f14ceef84b7d9d1f2c47bd21c597b1
Author: Andreas K. Huettel (dilfridge) <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 17 17:31:43 2011 +0000
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sun Jul 17 17:31:43 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/dilfridge.git;a=commit;h=a94e6887
Copied from sci overlay
---
eclass/cmake-utils.eclass | 491 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 491 insertions(+), 0 deletions(-)
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
new file mode 100644
index 0000000..041b636
--- /dev/null
+++ b/eclass/cmake-utils.eclass
@@ -0,0 +1,491 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.69 2011/06/27 21:11:57 abcd Exp $
+
+# @ECLASS: cmake-utils.eclass
+# @MAINTAINER:
+# kde@gentoo.org
+#
+# @CODE
+# Tomáš Chvátal <scarabeus@gentoo.org>
+# Maciej Mrozowski <reavertm@gentoo.org>
+# (undisclosed contributors)
+# Original author: Zephyrus (zephyrus@mirach.it)
+# @CODE
+# @BLURB: common ebuild functions for cmake-based packages
+# @DESCRIPTION:
+# The cmake-utils eclass is base.eclass(5) wrapper that makes creating ebuilds for
+# cmake-based packages much easier.
+# It provides all inherited features (DOCS, HTML_DOCS, PATCHES) along with out-of-source
+# builds (default), in-source builds and an implementation of the well-known use_enable
+# and use_with functions for CMake.
+
+# @ECLASS-VARIABLE: WANT_CMAKE
+# @DESCRIPTION:
+# Specify if cmake-utils eclass should depend on cmake optionaly or not.
+# This is usefull when only part of aplication is using cmake build system.
+# Valid values are: always [default], optional (where the value is the useflag
+# used for optionality)
+WANT_CMAKE="${WANT_CMAKE:-always}"
+
+# @ECLASS-VARIABLE: CMAKE_MIN_VERSION
+# @DESCRIPTION:
+# Specify the minimum required CMake version. Default is 2.8.1
+CMAKE_MIN_VERSION="${CMAKE_MIN_VERSION:-2.8.1}"
+
+# @ECLASS-VARIABLE: CMAKE_REMOVE_MODULES
+# @DESCRIPTION:
+# Space-separated list of CMake modules that will be removed in $S during src_prepare,
+# in order to force packages to use the system version.
+CMAKE_REMOVE_MODULES="${CMAKE_REMOVE_MODULES:-FindBLAS}"
+
+CMAKEDEPEND=""
+case ${WANT_CMAKE} in
+ always)
+ ;;
+ *)
+ IUSE+=" ${WANT_CMAKE}"
+ CMAKEDEPEND+="${WANT_CMAKE}? ( "
+ ;;
+esac
+inherit toolchain-funcs multilib flag-o-matic base
+
+CMAKE_EXPF="src_compile src_test src_install"
+case ${EAPI:-0} in
+ 4|3|2) CMAKE_EXPF+=" src_prepare src_configure" ;;
+ 1|0) ;;
+ *) die "Unknown EAPI, Bug eclass maintainers." ;;
+esac
+EXPORT_FUNCTIONS ${CMAKE_EXPF}
+
+: ${DESCRIPTION:="Based on the ${ECLASS} eclass"}
+
+if [[ ${PN} != cmake ]]; then
+ CMAKEDEPEND+=">=dev-util/cmake-${CMAKE_MIN_VERSION}"
+fi
+
+CMAKEDEPEND+=" userland_GNU? ( >=sys-apps/findutils-4.4.0 )"
+
+[[ ${WANT_CMAKE} = always ]] || CMAKEDEPEND+=" )"
+
+DEPEND="${CMAKEDEPEND}"
+unset CMAKEDEPEND
+
+# Internal functions used by cmake-utils_use_*
+_use_me_now() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ local uper capitalised x
+ [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
+ if [[ ! -z $3 ]]; then
+ # user specified the use name so use it
+ echo "-D$1$3=$(use $2 && echo ON || echo OFF)"
+ else
+ # use all various most used combinations
+ uper=$(echo ${2} | tr '[:lower:]' '[:upper:]')
+ capitalised=$(echo ${2} | sed 's/\<\(.\)\([^ ]*\)/\u\1\L\2/g')
+ for x in $2 $uper $capitalised; do
+ echo "-D$1$x=$(use $2 && echo ON || echo OFF) "
+ done
+ fi
+}
+_use_me_now_inverted() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ local uper capitalised x
+ [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
+ if [[ ! -z $3 ]]; then
+ # user specified the use name so use it
+ echo "-D$1$3=$(use $2 && echo OFF || echo ON)"
+ else
+ # use all various most used combinations
+ uper=$(echo ${2} | tr '[:lower:]' '[:upper:]')
+ capitalised=$(echo ${2} | sed 's/\<\(.\)\([^ ]*\)/\u\1\L\2/g')
+ for x in $2 $uper $capitalised; do
+ echo "-D$1$x=$(use $2 && echo OFF || echo ON) "
+ done
+ fi
+}
+
+# @ECLASS-VARIABLE: CMAKE_BUILD_DIR
+# @DESCRIPTION:
+# Build directory where all cmake processed files should be generated.
+# For in-source build it's fixed to ${CMAKE_USE_DIR}.
+# For out-of-source build it can be overriden, by default it uses
+# ${WORKDIR}/${P}_build.
+
+# @ECLASS-VARIABLE: CMAKE_BUILD_TYPE
+# @DESCRIPTION:
+# Set to override default CMAKE_BUILD_TYPE. Only useful for packages
+# known to make use of "if (CMAKE_BUILD_TYPE MATCHES xxx)".
+# If about to be set - needs to be set before invoking cmake-utils_src_configure.
+# You usualy do *NOT* want nor need to set it as it pulls CMake default build-type
+# specific compiler flags overriding make.conf.
+: ${CMAKE_BUILD_TYPE:=Gentoo}
+
+# @ECLASS-VARIABLE: CMAKE_IN_SOURCE_BUILD
+# @DESCRIPTION:
+# Set to enable in-source build.
+
+# @ECLASS-VARIABLE: CMAKE_USE_DIR
+# @DESCRIPTION:
+# Sets the directory where we are working with cmake.
+# For example when application uses autotools and only one
+# plugin needs to be done by cmake.
+# By default it uses ${S}.
+
+# @ECLASS-VARIABLE: CMAKE_VERBOSE
+# @DESCRIPTION:
+# Set to enable verbose messages during compilation.
+
+# @ECLASS-VARIABLE: PREFIX
+# @DESCRIPTION:
+# Eclass respects PREFIX variable, though it's not recommended way to set
+# install/lib/bin prefixes.
+# Use -DCMAKE_INSTALL_PREFIX=... CMake variable instead.
+
+# @ECLASS-VARIABLE: CMAKE_BINARY
+# @DESCRIPTION:
+# Eclass can use different cmake binary than the one provided in by system.
+: ${CMAKE_BINARY:=cmake}
+
+# Determine using IN or OUT source build
+_check_build_dir() {
+ : ${CMAKE_USE_DIR:=${S}}
+ if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then
+ # we build in source dir
+ CMAKE_BUILD_DIR="${CMAKE_USE_DIR}"
+ else
+ : ${CMAKE_BUILD_DIR:=${WORKDIR}/${P}_build}
+ fi
+ echo ">>> Working in BUILD_DIR: \"$CMAKE_BUILD_DIR\""
+}
+# @FUNCTION: cmake-utils_use_with
+# @USAGE: <USE flag> [flag name]
+# @DESCRIPTION:
+# Based on use_with. See ebuild(5).
+#
+# `cmake-utils_use_with foo FOO` echoes -DWITH_FOO=ON if foo is enabled
+# and -DWITH_FOO=OFF if it is disabled.
+cmake-utils_use_with() { _use_me_now WITH_ "$@" ; }
+
+# @FUNCTION: cmake-utils_use_enable
+# @USAGE: <USE flag> [flag name]
+# @DESCRIPTION:
+# Based on use_enable. See ebuild(5).
+#
+# `cmake-utils_use_enable foo FOO` echoes -DENABLE_FOO=ON if foo is enabled
+# and -DENABLE_FOO=OFF if it is disabled.
+cmake-utils_use_enable() { _use_me_now ENABLE_ "$@" ; }
+
+# @FUNCTION: cmake-utils_use_disable
+# @USAGE: <USE flag> [flag name]
+# @DESCRIPTION:
+# Based on inversion of use_enable. See ebuild(5).
+#
+# `cmake-utils_use_enable foo FOO` echoes -DDISABLE_FOO=OFF if foo is enabled
+# and -DDISABLE_FOO=ON if it is disabled.
+cmake-utils_use_disable() { _use_me_now_inverted DISABLE_ "$@" ; }
+
+# @FUNCTION: cmake-utils_use_no
+# @USAGE: <USE flag> [flag name]
+# @DESCRIPTION:
+# Based on use_disable. See ebuild(5).
+#
+# `cmake-utils_use_no foo FOO` echoes -DNO_FOO=OFF if foo is enabled
+# and -DNO_FOO=ON if it is disabled.
+cmake-utils_use_no() { _use_me_now_inverted NO_ "$@" ; }
+
+# @FUNCTION: cmake-utils_use_want
+# @USAGE: <USE flag> [flag name]
+# @DESCRIPTION:
+# Based on use_enable. See ebuild(5).
+#
+# `cmake-utils_use_want foo FOO` echoes -DWANT_FOO=ON if foo is enabled
+# and -DWANT_FOO=OFF if it is disabled.
+cmake-utils_use_want() { _use_me_now WANT_ "$@" ; }
+
+# @FUNCTION: cmake-utils_use_build
+# @USAGE: <USE flag> [flag name]
+# @DESCRIPTION:
+# Based on use_enable. See ebuild(5).
+#
+# `cmake-utils_use_build foo FOO` echoes -DBUILD_FOO=ON if foo is enabled
+# and -DBUILD_FOO=OFF if it is disabled.
+cmake-utils_use_build() { _use_me_now BUILD_ "$@" ; }
+
+# @FUNCTION: cmake-utils_use_has
+# @USAGE: <USE flag> [flag name]
+# @DESCRIPTION:
+# Based on use_enable. See ebuild(5).
+#
+# `cmake-utils_use_has foo FOO` echoes -DHAVE_FOO=ON if foo is enabled
+# and -DHAVE_FOO=OFF if it is disabled.
+cmake-utils_use_has() { _use_me_now HAVE_ "$@" ; }
+
+# @FUNCTION: cmake-utils_use_use
+# @USAGE: <USE flag> [flag name]
+# @DESCRIPTION:
+# Based on use_enable. See ebuild(5).
+#
+# `cmake-utils_use_use foo FOO` echoes -DUSE_FOO=ON if foo is enabled
+# and -DUSE_FOO=OFF if it is disabled.
+cmake-utils_use_use() { _use_me_now USE_ "$@" ; }
+
+# @FUNCTION: cmake-utils_use
+# @USAGE: <USE flag> [flag name]
+# @DESCRIPTION:
+# Based on use_enable. See ebuild(5).
+#
+# `cmake-utils_use foo FOO` echoes -DFOO=ON if foo is enabled
+# and -DFOO=OFF if it is disabled.
+cmake-utils_use() { _use_me_now "" "$@" ; }
+
+# Internal function for modifying hardcoded definitions.
+# Removes dangerous definitions that override Gentoo settings.
+_modify-cmakelists() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ # Only edit the files once
+ grep -qs "<<< Gentoo configuration >>>" CMakeLists.txt && return 0
+
+ # Comment out all set (<some_should_be_user_defined_variable> value)
+ # TODO Add QA checker - inform when variable being checked for below is set in CMakeLists.txt
+ find "${CMAKE_USE_DIR}" -name CMakeLists.txt \
+ -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE.*)/{s/^/#IGNORE /g}' {} + \
+ -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_COLOR_MAKEFILE.*)/{s/^/#IGNORE /g}' {} + \
+ -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_INSTALL_PREFIX.*)/{s/^/#IGNORE /g}' {} + \
+ -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_VERBOSE_MAKEFILE.*)/{s/^/#IGNORE /g}' {} + \
+ || die "${LINENO}: failed to disable hardcoded settings"
+
+ # NOTE Append some useful summary here
+ cat >> "${CMAKE_USE_DIR}"/CMakeLists.txt <<- _EOF_
+
+ MESSAGE(STATUS "<<< Gentoo configuration >>>
+ Build type \${CMAKE_BUILD_TYPE}
+ Install path \${CMAKE_INSTALL_PREFIX}
+ Compiler flags:
+ C \${CMAKE_C_FLAGS}
+ C++ \${CMAKE_CXX_FLAGS}
+ Linker flags:
+ Executable \${CMAKE_EXE_LINKER_FLAGS}
+ Module \${CMAKE_MODULE_LINKER_FLAGS}
+ Shared \${CMAKE_SHARED_LINKER_FLAGS}\n")
+ _EOF_
+}
+
+enable_cmake-utils_src_prepare() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ local name
+ for name in ${CMAKE_REMOVE_MODULES} ; do
+ find "${S}" -name ${name}.cmake -exec rm -v {} +
+ done
+}
+
+enable_cmake-utils_src_configure() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ _check_build_dir
+
+ # check if CMakeLists.txt exist and if no then die
+ if [[ ! -e ${CMAKE_USE_DIR}/CMakeLists.txt ]] ; then
+ eerror "Unable to locate CMakeLists.txt under:"
+ eerror "\"${CMAKE_USE_DIR}/CMakeLists.txt\""
+ eerror "Consider not inheriting the cmake eclass."
+ die "FATAL: Unable to find CMakeLists.txt"
+ fi
+
+ # Remove dangerous things.
+ _modify-cmakelists
+
+ # Fix xdg collision with sandbox
+ export XDG_CONFIG_HOME="${T}"
+
+ # @SEE CMAKE_BUILD_TYPE
+ if [[ ${CMAKE_BUILD_TYPE} = Gentoo ]]; then
+ # Handle release builds
+ if ! has debug ${IUSE//+} || ! use debug; then
+ append-cppflags -DNDEBUG
+ fi
+ fi
+
+ # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS)
+ local build_rules=${T}/gentoo_rules.cmake
+ cat > "${build_rules}" <<- _EOF_
+ SET (CMAKE_C_COMPILER $(type -P $(tc-getCC)) CACHE FILEPATH "C compiler" FORCE)
+ SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE)
+ SET (CMAKE_CXX_COMPILER $(type -P $(tc-getCXX)) CACHE FILEPATH "C++ compiler" FORCE)
+ SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE)
+ _EOF_
+
+ if use prefix; then
+ cat >> "${build_rules}" <<- _EOF_
+ # in Prefix we need rpath and must ensure cmake gets our default linker path
+ # right ... except for Darwin hosts
+ IF (NOT APPLE)
+ SET (CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
+ SET (CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH "${EPREFIX}/usr/${CHOST}/lib/gcc;${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/$(get_libdir);${EPREFIX}/$(get_libdir)"
+ CACHE STRING "" FORCE)
+
+ ELSE ()
+
+ SET(CMAKE_PREFIX_PATH "${EPREFIX}${PREFIX:-/usr}" CACHE STRING ""FORCE)
+ SET(CMAKE_SKIP_BUILD_RPATH OFF CACHE BOOL "" FORCE)
+ SET(CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
+ SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE CACHE BOOL "" FORCE)
+ SET(CMAKE_INSTALL_RPATH "${EPREFIX}${PREFIX:-/usr}/lib;${EPREFIX}/usr/${CHOST}/lib/gcc;${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/$(get_libdir);${EPREFIX}/$(get_libdir)" CACHE STRING "" FORCE)
+ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "" FORCE)
+ SET(CMAKE_INSTALL_NAME_DIR "${EPREFIX}${PREFIX:-/usr}/lib" CACHE STRING "" FORCE)
+
+ ENDIF (NOT APPLE)
+ _EOF_
+ fi
+
+ # Common configure parameters (invariants)
+ local common_config=${T}/gentoo_common_config.cmake
+ local libdir=$(get_libdir)
+ cat > "${common_config}" <<- _EOF_
+ SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE)
+ SET (CMAKE_INSTALL_LIBDIR ${libdir} CACHE PATH "Output directory for libraries")
+ _EOF_
+ [[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}"
+
+ # Convert mycmakeargs to an array, for backwards compatibility
+ # Make the array a local variable since <=portage-2.1.6.x does not
+ # support global arrays (see bug #297255).
+ if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then
+ local mycmakeargs_local=(${mycmakeargs})
+ else
+ local mycmakeargs_local=("${mycmakeargs[@]}")
+ fi
+
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+
+ # Common configure parameters (overridable)
+ # NOTE CMAKE_BUILD_TYPE can be only overriden via CMAKE_BUILD_TYPE eclass variable
+ # No -DCMAKE_BUILD_TYPE=xxx definitions will be in effect.
+ local cmakeargs=(
+ --no-warn-unused-cli
+ -C "${common_config}"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}${PREFIX:-/usr}"
+ "${mycmakeargs_local[@]}"
+ -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}"
+ -DCMAKE_INSTALL_DO_STRIP=OFF
+ -DCMAKE_USER_MAKE_RULES_OVERRIDE="${build_rules}"
+ "${MYCMAKEARGS}"
+ )
+
+ mkdir -p "${CMAKE_BUILD_DIR}"
+ pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}"
+ echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"
+ "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed"
+ popd > /dev/null
+}
+
+enable_cmake-utils_src_compile() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ has src_prepare ${CMAKE_EXPF} || cmake-utils_src_prepare
+ has src_configure ${CMAKE_EXPF} || cmake-utils_src_configure
+ cmake-utils_src_make "$@"
+}
+
+# @FUNCTION: cmake-utils_src_make
+# @DESCRIPTION:
+# Function for building the package. Automatically detects the build type.
+# All arguments are passed to emake.
+cmake-utils_src_make() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ _check_build_dir
+ pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ # first check if Makefile exist otherwise die
+ [[ -e Makefile ]] || die "Makefile not found. Error during configure stage."
+ if [[ -n ${CMAKE_VERBOSE} ]]; then
+ emake VERBOSE=1 "$@" || die "Make failed!"
+ else
+ emake "$@" || die "Make failed!"
+ fi
+ popd > /dev/null
+}
+
+enable_cmake-utils_src_install() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ _check_build_dir
+ pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ base_src_install "$@"
+ popd > /dev/null
+
+ # Backward compatibility, for non-array variables
+ if [[ -n "${DOCS}" ]] && [[ "$(declare -p DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then
+ dodoc ${DOCS} || die "dodoc failed"
+ fi
+ if [[ -n "${HTML_DOCS}" ]] && [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then
+ dohtml -r ${HTML_DOCS} || die "dohtml failed"
+ fi
+}
+
+enable_cmake-utils_src_test() {
+ debug-print-function ${FUNCNAME} "$@"
+ local ctestargs
+
+ _check_build_dir
+ pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ [[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."; return 0 ; }
+
+ [[ -n ${TEST_VERBOSE} ]] && ctestargs="--extra-verbose --output-on-failure"
+ ctest ${ctestargs} "$@" || die "Tests failed."
+ popd > /dev/null
+}
+
+# @FUNCTION: cmake-utils_src_prepare
+# @DESCRIPTION:
+# General function for configuring with cmake. Default behaviour is to start an
+# out-of-source build.
+cmake-utils_src_prepare() {
+ _execute_optionaly "src_prepare" "$@"
+}
+
+# @FUNCTION: cmake-utils_src_configure
+# @DESCRIPTION:
+# General function for configuring with cmake. Default behaviour is to start an
+# out-of-source build.
+cmake-utils_src_configure() {
+ _execute_optionaly "src_configure" "$@"
+}
+
+# @FUNCTION: cmake-utils_src_compile
+# @DESCRIPTION:
+# General function for compiling with cmake. Default behaviour is to check for
+# EAPI and respectively to configure as well or just compile.
+# Automatically detects the build type. All arguments are passed to emake.
+cmake-utils_src_compile() {
+ _execute_optionaly "src_compile" "$@"
+}
+
+# @FUNCTION: cmake-utils_src_install
+# @DESCRIPTION:
+# Function for installing the package. Automatically detects the build type.
+cmake-utils_src_install() {
+ _execute_optionaly "src_install" "$@"
+}
+
+# @FUNCTION: cmake-utils_src_test
+# @DESCRIPTION:
+# Function for testing the package. Automatically detects the build type.
+cmake-utils_src_test() {
+ _execute_optionaly "src_test" "$@"
+}
+
+# Optionally executes phases based on WANT_CMAKE variable/USE flag.
+_execute_optionaly() {
+ local phase="$1" ; shift
+ if [[ ${WANT_CMAKE} = always ]]; then
+ enable_cmake-utils_${phase} "$@"
+ else
+ use ${WANT_CMAKE} && enable_cmake-utils_${phase} "$@"
+ fi
+}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] dev/dilfridge:master commit in: eclass/
@ 2011-07-17 17:51 Andreas Hüttel
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Hüttel @ 2011-07-17 17:51 UTC (permalink / raw
To: gentoo-commits
commit: d43b9165e6dbbb2e719de6b3939b0867a930e179
Author: Andreas K. Huettel (dilfridge) <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 17 17:51:40 2011 +0000
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sun Jul 17 17:51:40 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/dilfridge.git;a=commit;h=d43b9165
Same magic for LAPACK
---
eclass/cmake-utils.eclass | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 041b636..20bbf82 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -37,7 +37,7 @@ CMAKE_MIN_VERSION="${CMAKE_MIN_VERSION:-2.8.1}"
# @DESCRIPTION:
# Space-separated list of CMake modules that will be removed in $S during src_prepare,
# in order to force packages to use the system version.
-CMAKE_REMOVE_MODULES="${CMAKE_REMOVE_MODULES:-FindBLAS}"
+CMAKE_REMOVE_MODULES="${CMAKE_REMOVE_MODULES:-FindBLAS FindLAPACK}"
CMAKEDEPEND=""
case ${WANT_CMAKE} in
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] dev/dilfridge:master commit in: eclass/
@ 2011-07-17 18:03 Andreas Hüttel
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Hüttel @ 2011-07-17 18:03 UTC (permalink / raw
To: gentoo-commits
commit: 30e269432e9b1550f422b0bd18b328b995233548
Author: Andreas K. Huettel (dilfridge) <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 17 18:02:28 2011 +0000
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sun Jul 17 18:03:54 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/dilfridge.git;a=commit;h=30e26943
Move module removal into configure phase (otherwise it might never be called), no src_prepare again
---
eclass/cmake-utils.eclass | 17 ++---------------
1 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 20bbf82..4515db1 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -52,7 +52,7 @@ inherit toolchain-funcs multilib flag-o-matic base
CMAKE_EXPF="src_compile src_test src_install"
case ${EAPI:-0} in
- 4|3|2) CMAKE_EXPF+=" src_prepare src_configure" ;;
+ 4|3|2) CMAKE_EXPF+=" src_configure" ;;
1|0) ;;
*) die "Unknown EAPI, Bug eclass maintainers." ;;
esac
@@ -274,17 +274,13 @@ _modify-cmakelists() {
_EOF_
}
-enable_cmake-utils_src_prepare() {
+enable_cmake-utils_src_configure() {
debug-print-function ${FUNCNAME} "$@"
local name
for name in ${CMAKE_REMOVE_MODULES} ; do
find "${S}" -name ${name}.cmake -exec rm -v {} +
done
-}
-
-enable_cmake-utils_src_configure() {
- debug-print-function ${FUNCNAME} "$@"
_check_build_dir
@@ -387,7 +383,6 @@ enable_cmake-utils_src_configure() {
enable_cmake-utils_src_compile() {
debug-print-function ${FUNCNAME} "$@"
- has src_prepare ${CMAKE_EXPF} || cmake-utils_src_prepare
has src_configure ${CMAKE_EXPF} || cmake-utils_src_configure
cmake-utils_src_make "$@"
}
@@ -441,14 +436,6 @@ enable_cmake-utils_src_test() {
popd > /dev/null
}
-# @FUNCTION: cmake-utils_src_prepare
-# @DESCRIPTION:
-# General function for configuring with cmake. Default behaviour is to start an
-# out-of-source build.
-cmake-utils_src_prepare() {
- _execute_optionaly "src_prepare" "$@"
-}
-
# @FUNCTION: cmake-utils_src_configure
# @DESCRIPTION:
# General function for configuring with cmake. Default behaviour is to start an
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] dev/dilfridge:master commit in: eclass/
@ 2011-12-22 22:21 Andreas Hüttel
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Hüttel @ 2011-12-22 22:21 UTC (permalink / raw
To: gentoo-commits
commit: 723e338ca0e77329f364e324a18ec46c7c69ca18
Author: Andreas K. Huettel (dilfridge) <mail <AT> akhuettel <DOT> de>
AuthorDate: Mon Dec 19 02:11:31 2011 +0000
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Mon Dec 19 02:11:31 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/dilfridge.git;a=commit;h=723e338c
[eclass] Not needed anymore
---
eclass/cmake-utils.eclass | 478 ---------------------------------------------
1 files changed, 0 insertions(+), 478 deletions(-)
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
deleted file mode 100644
index 4515db1..0000000
--- a/eclass/cmake-utils.eclass
+++ /dev/null
@@ -1,478 +0,0 @@
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.69 2011/06/27 21:11:57 abcd Exp $
-
-# @ECLASS: cmake-utils.eclass
-# @MAINTAINER:
-# kde@gentoo.org
-#
-# @CODE
-# Tomáš Chvátal <scarabeus@gentoo.org>
-# Maciej Mrozowski <reavertm@gentoo.org>
-# (undisclosed contributors)
-# Original author: Zephyrus (zephyrus@mirach.it)
-# @CODE
-# @BLURB: common ebuild functions for cmake-based packages
-# @DESCRIPTION:
-# The cmake-utils eclass is base.eclass(5) wrapper that makes creating ebuilds for
-# cmake-based packages much easier.
-# It provides all inherited features (DOCS, HTML_DOCS, PATCHES) along with out-of-source
-# builds (default), in-source builds and an implementation of the well-known use_enable
-# and use_with functions for CMake.
-
-# @ECLASS-VARIABLE: WANT_CMAKE
-# @DESCRIPTION:
-# Specify if cmake-utils eclass should depend on cmake optionaly or not.
-# This is usefull when only part of aplication is using cmake build system.
-# Valid values are: always [default], optional (where the value is the useflag
-# used for optionality)
-WANT_CMAKE="${WANT_CMAKE:-always}"
-
-# @ECLASS-VARIABLE: CMAKE_MIN_VERSION
-# @DESCRIPTION:
-# Specify the minimum required CMake version. Default is 2.8.1
-CMAKE_MIN_VERSION="${CMAKE_MIN_VERSION:-2.8.1}"
-
-# @ECLASS-VARIABLE: CMAKE_REMOVE_MODULES
-# @DESCRIPTION:
-# Space-separated list of CMake modules that will be removed in $S during src_prepare,
-# in order to force packages to use the system version.
-CMAKE_REMOVE_MODULES="${CMAKE_REMOVE_MODULES:-FindBLAS FindLAPACK}"
-
-CMAKEDEPEND=""
-case ${WANT_CMAKE} in
- always)
- ;;
- *)
- IUSE+=" ${WANT_CMAKE}"
- CMAKEDEPEND+="${WANT_CMAKE}? ( "
- ;;
-esac
-inherit toolchain-funcs multilib flag-o-matic base
-
-CMAKE_EXPF="src_compile src_test src_install"
-case ${EAPI:-0} in
- 4|3|2) CMAKE_EXPF+=" src_configure" ;;
- 1|0) ;;
- *) die "Unknown EAPI, Bug eclass maintainers." ;;
-esac
-EXPORT_FUNCTIONS ${CMAKE_EXPF}
-
-: ${DESCRIPTION:="Based on the ${ECLASS} eclass"}
-
-if [[ ${PN} != cmake ]]; then
- CMAKEDEPEND+=">=dev-util/cmake-${CMAKE_MIN_VERSION}"
-fi
-
-CMAKEDEPEND+=" userland_GNU? ( >=sys-apps/findutils-4.4.0 )"
-
-[[ ${WANT_CMAKE} = always ]] || CMAKEDEPEND+=" )"
-
-DEPEND="${CMAKEDEPEND}"
-unset CMAKEDEPEND
-
-# Internal functions used by cmake-utils_use_*
-_use_me_now() {
- debug-print-function ${FUNCNAME} "$@"
-
- local uper capitalised x
- [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
- if [[ ! -z $3 ]]; then
- # user specified the use name so use it
- echo "-D$1$3=$(use $2 && echo ON || echo OFF)"
- else
- # use all various most used combinations
- uper=$(echo ${2} | tr '[:lower:]' '[:upper:]')
- capitalised=$(echo ${2} | sed 's/\<\(.\)\([^ ]*\)/\u\1\L\2/g')
- for x in $2 $uper $capitalised; do
- echo "-D$1$x=$(use $2 && echo ON || echo OFF) "
- done
- fi
-}
-_use_me_now_inverted() {
- debug-print-function ${FUNCNAME} "$@"
-
- local uper capitalised x
- [[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
- if [[ ! -z $3 ]]; then
- # user specified the use name so use it
- echo "-D$1$3=$(use $2 && echo OFF || echo ON)"
- else
- # use all various most used combinations
- uper=$(echo ${2} | tr '[:lower:]' '[:upper:]')
- capitalised=$(echo ${2} | sed 's/\<\(.\)\([^ ]*\)/\u\1\L\2/g')
- for x in $2 $uper $capitalised; do
- echo "-D$1$x=$(use $2 && echo OFF || echo ON) "
- done
- fi
-}
-
-# @ECLASS-VARIABLE: CMAKE_BUILD_DIR
-# @DESCRIPTION:
-# Build directory where all cmake processed files should be generated.
-# For in-source build it's fixed to ${CMAKE_USE_DIR}.
-# For out-of-source build it can be overriden, by default it uses
-# ${WORKDIR}/${P}_build.
-
-# @ECLASS-VARIABLE: CMAKE_BUILD_TYPE
-# @DESCRIPTION:
-# Set to override default CMAKE_BUILD_TYPE. Only useful for packages
-# known to make use of "if (CMAKE_BUILD_TYPE MATCHES xxx)".
-# If about to be set - needs to be set before invoking cmake-utils_src_configure.
-# You usualy do *NOT* want nor need to set it as it pulls CMake default build-type
-# specific compiler flags overriding make.conf.
-: ${CMAKE_BUILD_TYPE:=Gentoo}
-
-# @ECLASS-VARIABLE: CMAKE_IN_SOURCE_BUILD
-# @DESCRIPTION:
-# Set to enable in-source build.
-
-# @ECLASS-VARIABLE: CMAKE_USE_DIR
-# @DESCRIPTION:
-# Sets the directory where we are working with cmake.
-# For example when application uses autotools and only one
-# plugin needs to be done by cmake.
-# By default it uses ${S}.
-
-# @ECLASS-VARIABLE: CMAKE_VERBOSE
-# @DESCRIPTION:
-# Set to enable verbose messages during compilation.
-
-# @ECLASS-VARIABLE: PREFIX
-# @DESCRIPTION:
-# Eclass respects PREFIX variable, though it's not recommended way to set
-# install/lib/bin prefixes.
-# Use -DCMAKE_INSTALL_PREFIX=... CMake variable instead.
-
-# @ECLASS-VARIABLE: CMAKE_BINARY
-# @DESCRIPTION:
-# Eclass can use different cmake binary than the one provided in by system.
-: ${CMAKE_BINARY:=cmake}
-
-# Determine using IN or OUT source build
-_check_build_dir() {
- : ${CMAKE_USE_DIR:=${S}}
- if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then
- # we build in source dir
- CMAKE_BUILD_DIR="${CMAKE_USE_DIR}"
- else
- : ${CMAKE_BUILD_DIR:=${WORKDIR}/${P}_build}
- fi
- echo ">>> Working in BUILD_DIR: \"$CMAKE_BUILD_DIR\""
-}
-# @FUNCTION: cmake-utils_use_with
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_with. See ebuild(5).
-#
-# `cmake-utils_use_with foo FOO` echoes -DWITH_FOO=ON if foo is enabled
-# and -DWITH_FOO=OFF if it is disabled.
-cmake-utils_use_with() { _use_me_now WITH_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use_enable
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_enable. See ebuild(5).
-#
-# `cmake-utils_use_enable foo FOO` echoes -DENABLE_FOO=ON if foo is enabled
-# and -DENABLE_FOO=OFF if it is disabled.
-cmake-utils_use_enable() { _use_me_now ENABLE_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use_disable
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on inversion of use_enable. See ebuild(5).
-#
-# `cmake-utils_use_enable foo FOO` echoes -DDISABLE_FOO=OFF if foo is enabled
-# and -DDISABLE_FOO=ON if it is disabled.
-cmake-utils_use_disable() { _use_me_now_inverted DISABLE_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use_no
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_disable. See ebuild(5).
-#
-# `cmake-utils_use_no foo FOO` echoes -DNO_FOO=OFF if foo is enabled
-# and -DNO_FOO=ON if it is disabled.
-cmake-utils_use_no() { _use_me_now_inverted NO_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use_want
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_enable. See ebuild(5).
-#
-# `cmake-utils_use_want foo FOO` echoes -DWANT_FOO=ON if foo is enabled
-# and -DWANT_FOO=OFF if it is disabled.
-cmake-utils_use_want() { _use_me_now WANT_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use_build
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_enable. See ebuild(5).
-#
-# `cmake-utils_use_build foo FOO` echoes -DBUILD_FOO=ON if foo is enabled
-# and -DBUILD_FOO=OFF if it is disabled.
-cmake-utils_use_build() { _use_me_now BUILD_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use_has
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_enable. See ebuild(5).
-#
-# `cmake-utils_use_has foo FOO` echoes -DHAVE_FOO=ON if foo is enabled
-# and -DHAVE_FOO=OFF if it is disabled.
-cmake-utils_use_has() { _use_me_now HAVE_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use_use
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_enable. See ebuild(5).
-#
-# `cmake-utils_use_use foo FOO` echoes -DUSE_FOO=ON if foo is enabled
-# and -DUSE_FOO=OFF if it is disabled.
-cmake-utils_use_use() { _use_me_now USE_ "$@" ; }
-
-# @FUNCTION: cmake-utils_use
-# @USAGE: <USE flag> [flag name]
-# @DESCRIPTION:
-# Based on use_enable. See ebuild(5).
-#
-# `cmake-utils_use foo FOO` echoes -DFOO=ON if foo is enabled
-# and -DFOO=OFF if it is disabled.
-cmake-utils_use() { _use_me_now "" "$@" ; }
-
-# Internal function for modifying hardcoded definitions.
-# Removes dangerous definitions that override Gentoo settings.
-_modify-cmakelists() {
- debug-print-function ${FUNCNAME} "$@"
-
- # Only edit the files once
- grep -qs "<<< Gentoo configuration >>>" CMakeLists.txt && return 0
-
- # Comment out all set (<some_should_be_user_defined_variable> value)
- # TODO Add QA checker - inform when variable being checked for below is set in CMakeLists.txt
- find "${CMAKE_USE_DIR}" -name CMakeLists.txt \
- -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE.*)/{s/^/#IGNORE /g}' {} + \
- -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_COLOR_MAKEFILE.*)/{s/^/#IGNORE /g}' {} + \
- -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_INSTALL_PREFIX.*)/{s/^/#IGNORE /g}' {} + \
- -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_VERBOSE_MAKEFILE.*)/{s/^/#IGNORE /g}' {} + \
- || die "${LINENO}: failed to disable hardcoded settings"
-
- # NOTE Append some useful summary here
- cat >> "${CMAKE_USE_DIR}"/CMakeLists.txt <<- _EOF_
-
- MESSAGE(STATUS "<<< Gentoo configuration >>>
- Build type \${CMAKE_BUILD_TYPE}
- Install path \${CMAKE_INSTALL_PREFIX}
- Compiler flags:
- C \${CMAKE_C_FLAGS}
- C++ \${CMAKE_CXX_FLAGS}
- Linker flags:
- Executable \${CMAKE_EXE_LINKER_FLAGS}
- Module \${CMAKE_MODULE_LINKER_FLAGS}
- Shared \${CMAKE_SHARED_LINKER_FLAGS}\n")
- _EOF_
-}
-
-enable_cmake-utils_src_configure() {
- debug-print-function ${FUNCNAME} "$@"
-
- local name
- for name in ${CMAKE_REMOVE_MODULES} ; do
- find "${S}" -name ${name}.cmake -exec rm -v {} +
- done
-
- _check_build_dir
-
- # check if CMakeLists.txt exist and if no then die
- if [[ ! -e ${CMAKE_USE_DIR}/CMakeLists.txt ]] ; then
- eerror "Unable to locate CMakeLists.txt under:"
- eerror "\"${CMAKE_USE_DIR}/CMakeLists.txt\""
- eerror "Consider not inheriting the cmake eclass."
- die "FATAL: Unable to find CMakeLists.txt"
- fi
-
- # Remove dangerous things.
- _modify-cmakelists
-
- # Fix xdg collision with sandbox
- export XDG_CONFIG_HOME="${T}"
-
- # @SEE CMAKE_BUILD_TYPE
- if [[ ${CMAKE_BUILD_TYPE} = Gentoo ]]; then
- # Handle release builds
- if ! has debug ${IUSE//+} || ! use debug; then
- append-cppflags -DNDEBUG
- fi
- fi
-
- # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS)
- local build_rules=${T}/gentoo_rules.cmake
- cat > "${build_rules}" <<- _EOF_
- SET (CMAKE_C_COMPILER $(type -P $(tc-getCC)) CACHE FILEPATH "C compiler" FORCE)
- SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE)
- SET (CMAKE_CXX_COMPILER $(type -P $(tc-getCXX)) CACHE FILEPATH "C++ compiler" FORCE)
- SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE)
- _EOF_
-
- if use prefix; then
- cat >> "${build_rules}" <<- _EOF_
- # in Prefix we need rpath and must ensure cmake gets our default linker path
- # right ... except for Darwin hosts
- IF (NOT APPLE)
- SET (CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
- SET (CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH "${EPREFIX}/usr/${CHOST}/lib/gcc;${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/$(get_libdir);${EPREFIX}/$(get_libdir)"
- CACHE STRING "" FORCE)
-
- ELSE ()
-
- SET(CMAKE_PREFIX_PATH "${EPREFIX}${PREFIX:-/usr}" CACHE STRING ""FORCE)
- SET(CMAKE_SKIP_BUILD_RPATH OFF CACHE BOOL "" FORCE)
- SET(CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
- SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE CACHE BOOL "" FORCE)
- SET(CMAKE_INSTALL_RPATH "${EPREFIX}${PREFIX:-/usr}/lib;${EPREFIX}/usr/${CHOST}/lib/gcc;${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/$(get_libdir);${EPREFIX}/$(get_libdir)" CACHE STRING "" FORCE)
- SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "" FORCE)
- SET(CMAKE_INSTALL_NAME_DIR "${EPREFIX}${PREFIX:-/usr}/lib" CACHE STRING "" FORCE)
-
- ENDIF (NOT APPLE)
- _EOF_
- fi
-
- # Common configure parameters (invariants)
- local common_config=${T}/gentoo_common_config.cmake
- local libdir=$(get_libdir)
- cat > "${common_config}" <<- _EOF_
- SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE)
- SET (CMAKE_INSTALL_LIBDIR ${libdir} CACHE PATH "Output directory for libraries")
- _EOF_
- [[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}"
-
- # Convert mycmakeargs to an array, for backwards compatibility
- # Make the array a local variable since <=portage-2.1.6.x does not
- # support global arrays (see bug #297255).
- if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then
- local mycmakeargs_local=(${mycmakeargs})
- else
- local mycmakeargs_local=("${mycmakeargs[@]}")
- fi
-
- has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
-
- # Common configure parameters (overridable)
- # NOTE CMAKE_BUILD_TYPE can be only overriden via CMAKE_BUILD_TYPE eclass variable
- # No -DCMAKE_BUILD_TYPE=xxx definitions will be in effect.
- local cmakeargs=(
- --no-warn-unused-cli
- -C "${common_config}"
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}${PREFIX:-/usr}"
- "${mycmakeargs_local[@]}"
- -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}"
- -DCMAKE_INSTALL_DO_STRIP=OFF
- -DCMAKE_USER_MAKE_RULES_OVERRIDE="${build_rules}"
- "${MYCMAKEARGS}"
- )
-
- mkdir -p "${CMAKE_BUILD_DIR}"
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
- debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}"
- echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"
- "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed"
- popd > /dev/null
-}
-
-enable_cmake-utils_src_compile() {
- debug-print-function ${FUNCNAME} "$@"
-
- has src_configure ${CMAKE_EXPF} || cmake-utils_src_configure
- cmake-utils_src_make "$@"
-}
-
-# @FUNCTION: cmake-utils_src_make
-# @DESCRIPTION:
-# Function for building the package. Automatically detects the build type.
-# All arguments are passed to emake.
-cmake-utils_src_make() {
- debug-print-function ${FUNCNAME} "$@"
-
- _check_build_dir
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
- # first check if Makefile exist otherwise die
- [[ -e Makefile ]] || die "Makefile not found. Error during configure stage."
- if [[ -n ${CMAKE_VERBOSE} ]]; then
- emake VERBOSE=1 "$@" || die "Make failed!"
- else
- emake "$@" || die "Make failed!"
- fi
- popd > /dev/null
-}
-
-enable_cmake-utils_src_install() {
- debug-print-function ${FUNCNAME} "$@"
-
- _check_build_dir
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
- base_src_install "$@"
- popd > /dev/null
-
- # Backward compatibility, for non-array variables
- if [[ -n "${DOCS}" ]] && [[ "$(declare -p DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then
- dodoc ${DOCS} || die "dodoc failed"
- fi
- if [[ -n "${HTML_DOCS}" ]] && [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then
- dohtml -r ${HTML_DOCS} || die "dohtml failed"
- fi
-}
-
-enable_cmake-utils_src_test() {
- debug-print-function ${FUNCNAME} "$@"
- local ctestargs
-
- _check_build_dir
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
- [[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."; return 0 ; }
-
- [[ -n ${TEST_VERBOSE} ]] && ctestargs="--extra-verbose --output-on-failure"
- ctest ${ctestargs} "$@" || die "Tests failed."
- popd > /dev/null
-}
-
-# @FUNCTION: cmake-utils_src_configure
-# @DESCRIPTION:
-# General function for configuring with cmake. Default behaviour is to start an
-# out-of-source build.
-cmake-utils_src_configure() {
- _execute_optionaly "src_configure" "$@"
-}
-
-# @FUNCTION: cmake-utils_src_compile
-# @DESCRIPTION:
-# General function for compiling with cmake. Default behaviour is to check for
-# EAPI and respectively to configure as well or just compile.
-# Automatically detects the build type. All arguments are passed to emake.
-cmake-utils_src_compile() {
- _execute_optionaly "src_compile" "$@"
-}
-
-# @FUNCTION: cmake-utils_src_install
-# @DESCRIPTION:
-# Function for installing the package. Automatically detects the build type.
-cmake-utils_src_install() {
- _execute_optionaly "src_install" "$@"
-}
-
-# @FUNCTION: cmake-utils_src_test
-# @DESCRIPTION:
-# Function for testing the package. Automatically detects the build type.
-cmake-utils_src_test() {
- _execute_optionaly "src_test" "$@"
-}
-
-# Optionally executes phases based on WANT_CMAKE variable/USE flag.
-_execute_optionaly() {
- local phase="$1" ; shift
- if [[ ${WANT_CMAKE} = always ]]; then
- enable_cmake-utils_${phase} "$@"
- else
- use ${WANT_CMAKE} && enable_cmake-utils_${phase} "$@"
- fi
-}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] dev/dilfridge:master commit in: eclass/
@ 2013-06-07 19:38 Andreas Hüttel
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Hüttel @ 2013-06-07 19:38 UTC (permalink / raw
To: gentoo-commits
commit: e525e3bcc1441a9354fb0f7b64b2ab342dab0072
Author: Andreas K. Huettel <mail <AT> akhuettel <DOT> de>
AuthorDate: Fri Jun 7 19:33:37 2013 +0000
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Fri Jun 7 19:33:37 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/dilfridge.git;a=commit;h=e525e3bc
[eclass] add rpm5.eclass from n4g overlay
---
eclass/rpm5.eclass | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 113 insertions(+)
diff --git a/eclass/rpm5.eclass b/eclass/rpm5.eclass
new file mode 100644
index 0000000..8a7f884
--- /dev/null
+++ b/eclass/rpm5.eclass
@@ -0,0 +1,113 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/rpm.eclass,v 1.20 2010/07/18 21:57:20 vapier Exp $
+
+# @ECLASS: rpm.eclass
+# @MAINTAINER:
+# base-system@gentoo.org
+# @BLURB: convenience class for extracting RPMs
+
+inherit eutils
+
+DEPEND=">=app-arch/rpm5offset-9.0"
+
+# @FUNCTION: rpm_unpack
+# @USAGE: <rpms>
+# @DESCRIPTION:
+# Unpack the contents of the specified rpms like the unpack() function.
+rpm5_unpack() {
+ [[ $# -eq 0 ]] && set -- ${A}
+ local a rpmoff decompcmd
+ for a in "$@" ; do
+ echo ">>> Unpacking ${a} to ${PWD}"
+ if [[ ${a} == ./* ]] ; then
+ : nothing to do -- path is local
+ elif [[ ${a} == ${DISTDIR}/* ]] ; then
+ ewarn 'QA: do not use ${DISTDIR} with rpm_unpack -- it is added for you'
+ elif [[ ${a} == /* ]] ; then
+ ewarn 'QA: do not use full paths with rpm_unpack -- use ./ paths instead'
+ else
+ a="${DISTDIR}/${a}"
+ fi
+# rpm2tar -O "${a}" | tar xf - || die "failure unpacking ${a}"
+ rpmoff=`rpm5offset < ${a}`
+ [ -z "${rpmoff}" ] && return 1
+
+ decompcmd="lzma -dc"
+ if [ -n "`dd if=${a} skip=${rpmoff} bs=1 count=3 2>/dev/null | file - | grep bzip2`" ]; then
+ decompcmd="bzip2 -dc"
+ fi
+ if [ -n "`dd if=${a} skip=${rpmoff} bs=1 count=3 2>/dev/null | file - | grep gzip`" ]; then
+ decompcmd="gzip -dc"
+ fi
+
+ dd ibs=${rpmoff} skip=1 if=${a} 2> /dev/null \
+ | ${decompcmd} \
+ | cpio -idmu --no-preserve-owner --quiet || return 1
+ done
+}
+
+# @FUNCTION: srcrpm_unpack
+# @USAGE: <rpms>
+# @DESCRIPTION:
+# Unpack the contents of the specified rpms like the unpack() function as well
+# as any archives that it might contain. Note that the secondary archive
+# unpack isn't perfect in that it simply unpacks all archives in the working
+# directory (with the assumption that there weren't any to start with).
+srcrpm5_unpack() {
+ [[ $# -eq 0 ]] && set -- ${A}
+ rpm5_unpack "$@"
+
+ # no .src.rpm files, then nothing to do
+ [[ "$* " != *".src.rpm " ]] && return 0
+
+ eshopts_push -s nullglob
+
+ # unpack everything
+ local a
+ for a in *.tar.{gz,bz2} *.t{gz,bz2} *.zip *.ZIP ; do
+ unpack "./${a}"
+ rm -f "${a}"
+ done
+
+ eshopts_pop
+
+ return 0
+}
+
+# @FUNCTION: rpm_src_unpack
+# @DESCRIPTION:
+# Automatically unpack all archives in ${A} including rpms. If one of the
+# archives in a source rpm, then the sub archives will be unpacked as well.
+rpm5_src_unpack() {
+ local a
+ for a in ${A} ; do
+ case ${a} in
+ *.rpm) srcrpm5_unpack "${a}" ;;
+ *) unpack "${a}" ;;
+ esac
+ done
+}
+
+# @FUNCTION: rpm_spec_epatch
+# @USAGE: [spec]
+# @DESCRIPTION:
+# Read the specified spec (defaults to ${PN}.spec) and attempt to apply
+# all the patches listed in it. If the spec does funky things like moving
+# files around, well this won't handle that.
+rpm5_spec_epatch() {
+ local p spec=${1:-${PN}.spec}
+ local dir=${spec%/*}
+ grep '^%patch' "${spec}" | \
+ while read line ; do
+ set -- ${line}
+ p=$1
+ shift
+ EPATCH_OPTS="$*"
+ set -- $(grep "^P${p#%p}: " "${spec}")
+ shift
+ epatch "${dir:+${dir}/}$*"
+ done
+}
+
+EXPORT_FUNCTIONS src_unpack
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] dev/dilfridge:master commit in: eclass/
@ 2013-09-06 17:40 Andreas Hüttel
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Hüttel @ 2013-09-06 17:40 UTC (permalink / raw
To: gentoo-commits
commit: 0be759b73af689760f60ec1f6af324240905158c
Author: Andreas K. Huettel (dilfridge) <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 6 17:40:19 2013 +0000
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Fri Sep 6 17:40:19 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/dilfridge.git;a=commit;h=0be759b7
[rpm5.eclass] not needed anymore
---
eclass/rpm5.eclass | 113 -----------------------------------------------------
1 file changed, 113 deletions(-)
diff --git a/eclass/rpm5.eclass b/eclass/rpm5.eclass
deleted file mode 100644
index 8a7f884..0000000
--- a/eclass/rpm5.eclass
+++ /dev/null
@@ -1,113 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/rpm.eclass,v 1.20 2010/07/18 21:57:20 vapier Exp $
-
-# @ECLASS: rpm.eclass
-# @MAINTAINER:
-# base-system@gentoo.org
-# @BLURB: convenience class for extracting RPMs
-
-inherit eutils
-
-DEPEND=">=app-arch/rpm5offset-9.0"
-
-# @FUNCTION: rpm_unpack
-# @USAGE: <rpms>
-# @DESCRIPTION:
-# Unpack the contents of the specified rpms like the unpack() function.
-rpm5_unpack() {
- [[ $# -eq 0 ]] && set -- ${A}
- local a rpmoff decompcmd
- for a in "$@" ; do
- echo ">>> Unpacking ${a} to ${PWD}"
- if [[ ${a} == ./* ]] ; then
- : nothing to do -- path is local
- elif [[ ${a} == ${DISTDIR}/* ]] ; then
- ewarn 'QA: do not use ${DISTDIR} with rpm_unpack -- it is added for you'
- elif [[ ${a} == /* ]] ; then
- ewarn 'QA: do not use full paths with rpm_unpack -- use ./ paths instead'
- else
- a="${DISTDIR}/${a}"
- fi
-# rpm2tar -O "${a}" | tar xf - || die "failure unpacking ${a}"
- rpmoff=`rpm5offset < ${a}`
- [ -z "${rpmoff}" ] && return 1
-
- decompcmd="lzma -dc"
- if [ -n "`dd if=${a} skip=${rpmoff} bs=1 count=3 2>/dev/null | file - | grep bzip2`" ]; then
- decompcmd="bzip2 -dc"
- fi
- if [ -n "`dd if=${a} skip=${rpmoff} bs=1 count=3 2>/dev/null | file - | grep gzip`" ]; then
- decompcmd="gzip -dc"
- fi
-
- dd ibs=${rpmoff} skip=1 if=${a} 2> /dev/null \
- | ${decompcmd} \
- | cpio -idmu --no-preserve-owner --quiet || return 1
- done
-}
-
-# @FUNCTION: srcrpm_unpack
-# @USAGE: <rpms>
-# @DESCRIPTION:
-# Unpack the contents of the specified rpms like the unpack() function as well
-# as any archives that it might contain. Note that the secondary archive
-# unpack isn't perfect in that it simply unpacks all archives in the working
-# directory (with the assumption that there weren't any to start with).
-srcrpm5_unpack() {
- [[ $# -eq 0 ]] && set -- ${A}
- rpm5_unpack "$@"
-
- # no .src.rpm files, then nothing to do
- [[ "$* " != *".src.rpm " ]] && return 0
-
- eshopts_push -s nullglob
-
- # unpack everything
- local a
- for a in *.tar.{gz,bz2} *.t{gz,bz2} *.zip *.ZIP ; do
- unpack "./${a}"
- rm -f "${a}"
- done
-
- eshopts_pop
-
- return 0
-}
-
-# @FUNCTION: rpm_src_unpack
-# @DESCRIPTION:
-# Automatically unpack all archives in ${A} including rpms. If one of the
-# archives in a source rpm, then the sub archives will be unpacked as well.
-rpm5_src_unpack() {
- local a
- for a in ${A} ; do
- case ${a} in
- *.rpm) srcrpm5_unpack "${a}" ;;
- *) unpack "${a}" ;;
- esac
- done
-}
-
-# @FUNCTION: rpm_spec_epatch
-# @USAGE: [spec]
-# @DESCRIPTION:
-# Read the specified spec (defaults to ${PN}.spec) and attempt to apply
-# all the patches listed in it. If the spec does funky things like moving
-# files around, well this won't handle that.
-rpm5_spec_epatch() {
- local p spec=${1:-${PN}.spec}
- local dir=${spec%/*}
- grep '^%patch' "${spec}" | \
- while read line ; do
- set -- ${line}
- p=$1
- shift
- EPATCH_OPTS="$*"
- set -- $(grep "^P${p#%p}: " "${spec}")
- shift
- epatch "${dir:+${dir}/}$*"
- done
-}
-
-EXPORT_FUNCTIONS src_unpack
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-09-06 17:40 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-17 17:51 [gentoo-commits] dev/dilfridge:master commit in: eclass/ Andreas Hüttel
-- strict thread matches above, loose matches on Subject: below --
2013-09-06 17:40 Andreas Hüttel
2013-06-07 19:38 Andreas Hüttel
2011-12-22 22:21 Andreas Hüttel
2011-07-17 18:03 Andreas Hüttel
2011-07-17 17:31 Andreas Hüttel
2011-04-06 19:35 Andreas K. Huettel
2011-03-24 13:33 Andreas K. Huettel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox