mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-16 01:16:59 +02:00
eclass: Drop unused eclasses
This commit is contained in:
parent
10ea5a6e01
commit
d6edbe5c5d
@ -1,160 +0,0 @@
|
||||
# Copyright 1999-2019 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# @ECLASS: cron.eclass
|
||||
# @MAINTAINER:
|
||||
# maintainer-needed@gentoo.org
|
||||
# @AUTHOR:
|
||||
# Original Author: Aaron Walker <ka0ttic@gentoo.org>
|
||||
# @BLURB: Some functions for cron
|
||||
# @DESCRIPTION:
|
||||
# Purpose: The main motivation for this eclass was to simplify
|
||||
# the jungle known as src_install() in cron ebuilds. Using these
|
||||
# functions also ensures that permissions are *always* reset,
|
||||
# preventing the accidental installation of files with wrong perms.
|
||||
#
|
||||
# NOTE on defaults: the default settings in the below functions were
|
||||
# chosen based on the most common setting among cron ebuilds.
|
||||
#
|
||||
# Please assign any bugs regarding this eclass to cron-bugs@gentoo.org.
|
||||
|
||||
inherit eutils flag-o-matic
|
||||
|
||||
EXPORT_FUNCTIONS pkg_postinst
|
||||
|
||||
SLOT="0"
|
||||
|
||||
DEPEND=">=sys-apps/sed-4.0.5"
|
||||
|
||||
RDEPEND=">=sys-process/cronbase-0.3.2"
|
||||
for pn in vixie-cron bcron cronie dcron fcron; do
|
||||
[[ ${pn} == "${PN}" ]] || RDEPEND="${RDEPEND} !sys-process/${pn}"
|
||||
done
|
||||
|
||||
# @FUNCTION: docrondir
|
||||
# @USAGE: [ dir ] [ perms ]
|
||||
# @DESCRIPTION:
|
||||
# Creates crontab directory
|
||||
#
|
||||
# Both arguments are optional. Everything after 'dir' is considered
|
||||
# the permissions (same format as insopts).
|
||||
#
|
||||
# ex: docrondir /some/dir -m 0770 -o root -g cron
|
||||
# docrondir /some/dir (uses default perms)
|
||||
# docrondir -m0700 (uses default dir)
|
||||
|
||||
docrondir() {
|
||||
# defaults
|
||||
local perms="-m0750 -o root -g cron" dir="/var/spool/cron/crontabs"
|
||||
|
||||
if [[ -n $1 ]] ; then
|
||||
case "$1" in
|
||||
*/*)
|
||||
dir=$1
|
||||
shift
|
||||
[[ -n $1 ]] && perms="$@"
|
||||
;;
|
||||
*)
|
||||
perms="$@"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
diropts ${perms}
|
||||
keepdir ${dir}
|
||||
|
||||
# reset perms to default
|
||||
diropts -m0755
|
||||
}
|
||||
|
||||
# @FUNCTION: docron
|
||||
# @USAGE: [ exe ] [ perms ]
|
||||
# @DESCRIPTION:
|
||||
# Install cron executable
|
||||
#
|
||||
# Both arguments are optional.
|
||||
#
|
||||
# ex: docron -m 0700 -o root -g root ('exe' defaults to "cron")
|
||||
# docron crond -m 0110
|
||||
|
||||
docron() {
|
||||
local cron="cron" perms="-m 0750 -o root -g wheel"
|
||||
|
||||
if [[ -n $1 ]] ; then
|
||||
case "$1" in
|
||||
-*)
|
||||
perms="$@"
|
||||
;;
|
||||
*)
|
||||
cron=$1
|
||||
shift
|
||||
[[ -n $1 ]] && perms="$@"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
exeopts ${perms}
|
||||
exeinto /usr/sbin
|
||||
doexe ${cron} || die "failed to install ${cron}"
|
||||
|
||||
# reset perms to default
|
||||
exeopts -m0755
|
||||
}
|
||||
|
||||
# @FUNCTION: docrontab
|
||||
# @USAGE: [ exe ] [ perms ]
|
||||
# @DESCRIPTION:
|
||||
# Install crontab executable
|
||||
#
|
||||
# Uses same semantics as docron.
|
||||
|
||||
docrontab() {
|
||||
local crontab="crontab" perms="-m 4750 -o root -g cron"
|
||||
|
||||
if [[ -n $1 ]] ; then
|
||||
case "$1" in
|
||||
-*)
|
||||
perms="$@"
|
||||
;;
|
||||
*)
|
||||
crontab=$1
|
||||
shift
|
||||
[[ -n $1 ]] && perms="$@"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
exeopts ${perms}
|
||||
exeinto /usr/bin
|
||||
doexe ${crontab} || die "failed to install ${crontab}"
|
||||
|
||||
# reset perms to default
|
||||
exeopts -m0755
|
||||
|
||||
# users expect /usr/bin/crontab to exist...
|
||||
if [[ "${crontab##*/}" != "crontab" ]] ; then
|
||||
dosym ${crontab##*/} /usr/bin/crontab || \
|
||||
die "failed to create /usr/bin/crontab symlink"
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: cron_pkg_postinst
|
||||
# @DESCRIPTION:
|
||||
# Outputs a message about system crontabs
|
||||
# daemons that have a true system crontab set CRON_SYSTEM_CRONTAB="yes"
|
||||
cron_pkg_postinst() {
|
||||
echo
|
||||
# daemons that have a true system crontab set CRON_SYSTEM_CRONTAB="yes"
|
||||
if [ "${CRON_SYSTEM_CRONTAB:-no}" != "yes" ] ; then
|
||||
einfo "To activate /etc/cron.{hourly|daily|weekly|monthly} please run:"
|
||||
einfo " crontab /etc/crontab"
|
||||
einfo
|
||||
einfo "!!! That will replace root's current crontab !!!"
|
||||
einfo
|
||||
fi
|
||||
|
||||
einfo "You may wish to read the Gentoo Linux Cron Guide, which can be"
|
||||
einfo "found online at:"
|
||||
einfo " https://wiki.gentoo.org/wiki/Cron"
|
||||
echo
|
||||
}
|
@ -1,164 +0,0 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# @ECLASS: emboss-r2.eclass
|
||||
# @MAINTAINER:
|
||||
# sci-biology@gentoo.org
|
||||
# jlec@gentoo.org
|
||||
# ted.tanberry@gmail.com
|
||||
# @AUTHOR:
|
||||
# Original author: Author Olivier Fisette <ofisette@gmail.com>
|
||||
# Next gen author: Justin Lecher <jlec@gentoo.org>
|
||||
# Next gen author: Ted Tanberry <ted.tanberry@gmail.com>
|
||||
# @SUPPORTED_EAPIS: 6
|
||||
# @BLURB: Use this to easy install EMBOSS and EMBASSY programs (EMBOSS add-ons).
|
||||
# @DESCRIPTION:
|
||||
# The inheriting ebuild must set at least EAPI=6 and provide EBO_DESCRIPTION before the inherit line.
|
||||
# KEYWORDS should be set. Additionally "(R|P)DEPEND"encies and other standard
|
||||
# ebuild variables can be extended (FOO+=" bar").
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# EAPI=6
|
||||
#
|
||||
# EBO_DESCRIPTION="applications from the CBS group"
|
||||
#
|
||||
# inherit emboss-r2
|
||||
|
||||
# @ECLASS-VARIABLE: EBO_DESCRIPTION
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# Should be set. Completes the generic description of the embassy module as follows:
|
||||
#
|
||||
# EMBOSS integrated version of ${EBO_DESCRIPTION}, e.g.
|
||||
#
|
||||
# "EMBOSS integrated version of applications from the CBS group"
|
||||
#
|
||||
# Defaults to the upstream name of the module.
|
||||
|
||||
if [[ ! ${_EMBOSS_R2} ]]; then
|
||||
|
||||
case ${EAPI:-0} in
|
||||
6) ;;
|
||||
*) die "EAPI=${EAPI} is not supported" ;;
|
||||
esac
|
||||
|
||||
inherit autotools flag-o-matic
|
||||
|
||||
EXPORT_FUNCTIONS src_prepare src_configure src_install
|
||||
|
||||
HOMEPAGE="http://emboss.sourceforge.net/"
|
||||
LICENSE="LGPL-2 GPL-2"
|
||||
|
||||
SLOT="0"
|
||||
IUSE="mysql pdf png postgres static-libs X"
|
||||
|
||||
RDEPEND="
|
||||
dev-libs/expat
|
||||
dev-libs/libpcre:3
|
||||
sci-libs/plplot:=
|
||||
sys-libs/zlib
|
||||
mysql? ( dev-db/mysql-connector-c:0= )
|
||||
pdf? ( media-libs/libharu:= )
|
||||
png? ( media-libs/gd:2=[png] )
|
||||
postgres? ( dev-db/postgresql:= )
|
||||
X? ( x11-libs/libXt )"
|
||||
|
||||
if [[ ${PN} == embassy-* ]]; then
|
||||
EMBASSY_PACKAGE=yes
|
||||
# The EMBASSY package name, retrieved from the inheriting ebuild's name
|
||||
EN=${PN:8}
|
||||
# The full name and version of the EMBASSY package (excluding the Gentoo
|
||||
# revision number)
|
||||
EF="${EN^^}-${PV}"
|
||||
|
||||
[[ ${EBO_DESCRIPTION} ]] || die "EBO_DESCRIPTION was not set before inheriting emboss-r2.eclass"
|
||||
|
||||
DESCRIPTION="EMBOSS integrated version of ${EBO_DESCRIPTION}"
|
||||
SRC_URI="ftp://emboss.open-bio.org/pub/EMBOSS/${EF}.tar.gz -> embassy-${EN}-${PV}.tar.gz"
|
||||
RDEPEND+=" >=sci-biology/emboss-6.6.0-r1[mysql=,pdf=,png=,postgres=,static-libs=,X=]"
|
||||
|
||||
S="${WORKDIR}/${EF}"
|
||||
fi
|
||||
|
||||
DEPEND="${RDEPEND}"
|
||||
|
||||
# @ECLASS-VARIABLE: EBO_EAUTORECONF
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# If set, run eautoreconf from autotools.eclass after applying patches
|
||||
# in emboss-r2_src_prepare.
|
||||
|
||||
# @FUNCTION: emboss-r2_src_prepare
|
||||
# @DESCRIPTION:
|
||||
# Does the following things
|
||||
#
|
||||
# 1. Renames configure.in to configure.ac, if possible
|
||||
# 2. Calls default_src_prepare (i.e.
|
||||
# applies Gentoo and user patches in EAPI>=6)
|
||||
# 3. If EBO_EAUTORECONF is set, run eautoreconf
|
||||
#
|
||||
|
||||
emboss-r2_src_prepare() {
|
||||
if [[ -e configure.in ]]; then
|
||||
mv configure.{in,ac} || die
|
||||
fi
|
||||
|
||||
default
|
||||
[[ ${EBO_EAUTORECONF} ]] && eautoreconf
|
||||
}
|
||||
|
||||
# @FUNCTION: emboss-r2_src_configure
|
||||
# @DESCRIPTION:
|
||||
# runs econf with following options.
|
||||
#
|
||||
# --enable-shared
|
||||
# $(use_enable static-libs static)
|
||||
# $(use_with X x)
|
||||
# $(use_with png pngdriver)
|
||||
# $(use_with pdf hpdf)
|
||||
# $(use_with mysql mysql)
|
||||
# $(use_with postgres postgresql)
|
||||
# --enable-large
|
||||
# --without-java
|
||||
# --enable-systemlibs
|
||||
#
|
||||
# can be appended to like econf, e.g.
|
||||
# emboss-r2_src_configure --disable-shared
|
||||
|
||||
emboss-r2_src_configure() {
|
||||
local myconf=(
|
||||
--enable-shared
|
||||
$(use_enable static-libs static)
|
||||
$(use_with X x)
|
||||
$(use_with png pngdriver "${EPREFIX}/usr")
|
||||
$(use_with pdf hpdf "${EPREFIX}/usr")
|
||||
$(use_with mysql mysql "${EPREFIX}/usr/bin/mysql_config")
|
||||
$(use_with postgres postgresql "${EPREFIX}/usr/bin/pg_config")
|
||||
--enable-large
|
||||
--without-java
|
||||
--enable-systemlibs
|
||||
)
|
||||
|
||||
[[ ${EMBASSY_PACKAGE} == yes ]] && \
|
||||
append-cppflags "-I${EPREFIX}/usr/include/emboss"
|
||||
|
||||
econf "${myconf[@]}" "$@"
|
||||
}
|
||||
|
||||
# @FUNCTION: emboss-r2_src_install
|
||||
# @DESCRIPTION:
|
||||
# Installs the package into the staging area and removes
|
||||
# extraneous .la files, if USE="-static-libs"
|
||||
|
||||
emboss-r2_src_install() {
|
||||
default
|
||||
|
||||
# delete .la files
|
||||
if ! use static-libs; then
|
||||
find "${D}" -name '*.la' -delete || die
|
||||
fi
|
||||
}
|
||||
|
||||
_EMBOSS_R2=1
|
||||
fi
|
@ -1,369 +0,0 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# @ECLASS: gnome2.eclass
|
||||
# @MAINTAINER:
|
||||
# gnome@gentoo.org
|
||||
# @SUPPORTED_EAPIS: 4 5 6
|
||||
# @BLURB: Provides phases for Gnome/Gtk+ based packages.
|
||||
# @DESCRIPTION:
|
||||
# Exports portage base functions used by ebuilds written for packages using the
|
||||
# GNOME framework. For additional functions, see gnome2-utils.eclass.
|
||||
|
||||
# @ECLASS-VARIABLE: GNOME2_EAUTORECONF
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# Run eautoreconf instead of only elibtoolize
|
||||
GNOME2_EAUTORECONF=${GNOME2_EAUTORECONF:-""}
|
||||
|
||||
[[ ${GNOME2_EAUTORECONF} == 'yes' ]] && inherit autotools
|
||||
inherit eutils libtool gnome.org gnome2-utils xdg
|
||||
|
||||
case "${EAPI:-0}" in
|
||||
4|5)
|
||||
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
|
||||
;;
|
||||
6)
|
||||
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
|
||||
;;
|
||||
*) die "EAPI=${EAPI} is not supported" ;;
|
||||
esac
|
||||
|
||||
# @ECLASS-VARIABLE: DOCS
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# String containing documents passed to dodoc command for eapi4.
|
||||
# In eapi5 we rely on einstalldocs (from eutils.eclass) and for newer EAPIs we
|
||||
# follow PMS spec.
|
||||
|
||||
# @ECLASS-VARIABLE: ELTCONF
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# Extra options passed to elibtoolize
|
||||
ELTCONF=${ELTCONF:-""}
|
||||
|
||||
# @ECLASS-VARIABLE: G2CONF
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# Extra configure opts passed to econf.
|
||||
# Deprecated, pass extra arguments to gnome2_src_configure.
|
||||
# Banned in eapi6 and newer.
|
||||
if has ${EAPI:-0} 4 5; then
|
||||
G2CONF=${G2CONF:-""}
|
||||
fi
|
||||
|
||||
# @ECLASS-VARIABLE: GCONF_DEBUG
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# Whether to handle debug or not.
|
||||
# Some gnome applications support various levels of debugging (yes, no, minimum,
|
||||
# etc), but using --disable-debug also removes g_assert which makes debugging
|
||||
# harder. This variable should be set to yes for such packages for the eclass
|
||||
# to handle it properly. It will enable minimal debug with USE=-debug.
|
||||
# Note that this is most commonly found in configure.ac as GNOME_DEBUG_CHECK.
|
||||
#
|
||||
# Banned since eapi6 as upstream is moving away from this obsolete macro in favor
|
||||
# of autoconf-archive macros, that do not expose this issue (bug #270919)
|
||||
if has ${EAPI:-0} 4 5; then
|
||||
if [[ ${GCONF_DEBUG} != "no" ]]; then
|
||||
IUSE="debug"
|
||||
fi
|
||||
fi
|
||||
|
||||
# @ECLASS-VARIABLE: GNOME2_ECLASS_GIO_MODULES
|
||||
# @INTERNAL
|
||||
# @DESCRIPTION:
|
||||
# Array containing glib GIO modules
|
||||
|
||||
# @ECLASS-VARIABLE: GNOME2_LA_PUNT
|
||||
# @DESCRIPTION:
|
||||
# For eapi4 it sets if we should delete ALL or none of the .la files
|
||||
# For eapi5 and newer it relies on prune_libtool_files (from eutils.eclass)
|
||||
# for this. Available values for GNOME2_LA_PUNT:
|
||||
# - "no": will not clean any .la files
|
||||
# - "yes": will run prune_libtool_files --modules
|
||||
# - If it is not set, it will run prune_libtool_files
|
||||
if has ${EAPI:-0} 4; then
|
||||
GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-"no"}
|
||||
else
|
||||
GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
|
||||
fi
|
||||
|
||||
# @FUNCTION: gnome2_src_unpack
|
||||
# @DESCRIPTION:
|
||||
# Stub function for old EAPI.
|
||||
gnome2_src_unpack() {
|
||||
if has ${EAPI:-0} 4 5; then
|
||||
unpack ${A}
|
||||
cd "${S}"
|
||||
else
|
||||
die "gnome2_src_unpack is banned from eapi6"
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: gnome2_src_prepare
|
||||
# @DESCRIPTION:
|
||||
# Prepare environment for build, fix build of scrollkeeper documentation,
|
||||
# run elibtoolize.
|
||||
gnome2_src_prepare() {
|
||||
xdg_src_prepare
|
||||
|
||||
# Prevent assorted access violations and test failures
|
||||
gnome2_environment_reset
|
||||
|
||||
# Prevent scrollkeeper access violations
|
||||
# We stop to run it from eapi6 as scrollkeeper helpers from
|
||||
# rarian are not running anything and, then, access violations
|
||||
# shouldn't occur.
|
||||
has ${EAPI:-0} 4 5 && gnome2_omf_fix
|
||||
|
||||
# Disable all deprecation warnings
|
||||
gnome2_disable_deprecation_warning
|
||||
|
||||
# Run libtoolize or eautoreconf, bug #591584
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=655517
|
||||
if [[ ${GNOME2_EAUTORECONF} == 'yes' ]]; then
|
||||
eautoreconf
|
||||
else
|
||||
elibtoolize ${ELTCONF}
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: gnome2_src_configure
|
||||
# @DESCRIPTION:
|
||||
# Gnome specific configure handling
|
||||
gnome2_src_configure() {
|
||||
# Deprecated for a long time now and banned since eapi6, see Gnome team policies
|
||||
if [[ -n ${G2CONF} ]] ; then
|
||||
if has ${EAPI:-0} 4 5; then
|
||||
eqawarn "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
|
||||
else
|
||||
die "G2CONF set, please review documentation at https://wiki.gentoo.org/wiki/Project:GNOME/Gnome_Team_Ebuild_Policies#G2CONF_and_src_configure"
|
||||
fi
|
||||
fi
|
||||
|
||||
local g2conf=()
|
||||
|
||||
if has ${EAPI:-0} 4 5; then
|
||||
if [[ ${GCONF_DEBUG} != 'no' ]] ; then
|
||||
if use debug ; then
|
||||
g2conf+=( --enable-debug=yes )
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if [[ -n ${GCONF_DEBUG} ]] ; then
|
||||
die "GCONF_DEBUG is banned since eapi6 in favor of each ebuild taking care of the proper handling of debug configure option"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Starting with EAPI=5, we consider packages installing gtk-doc to be
|
||||
# handled by adding DEPEND="dev-util/gtk-doc-am" which provides tools to
|
||||
# relink URLs in documentation to already installed documentation.
|
||||
# This decision also greatly helps with constantly broken doc generation.
|
||||
# Remember to drop 'doc' USE flag from your package if it was only used to
|
||||
# rebuild docs.
|
||||
# Preserve old behavior for older EAPI.
|
||||
if grep -q "enable-gtk-doc" "${ECONF_SOURCE:-.}"/configure ; then
|
||||
if has ${EAPI:-0} 4 && in_iuse doc ; then
|
||||
g2conf+=( $(use_enable doc gtk-doc) )
|
||||
else
|
||||
g2conf+=( --disable-gtk-doc )
|
||||
fi
|
||||
fi
|
||||
|
||||
# Pass --disable-maintainer-mode when needed
|
||||
if grep -q "^[[:space:]]*AM_MAINTAINER_MODE(\[enable\])" \
|
||||
"${ECONF_SOURCE:-.}"/configure.*; then
|
||||
g2conf+=( --disable-maintainer-mode )
|
||||
fi
|
||||
|
||||
# Pass --disable-scrollkeeper when possible
|
||||
if grep -q "disable-scrollkeeper" "${ECONF_SOURCE:-.}"/configure; then
|
||||
g2conf+=( --disable-scrollkeeper )
|
||||
fi
|
||||
|
||||
# Pass --disable-silent-rules when possible (not needed since eapi5), bug #429308
|
||||
if has ${EAPI:-0} 4; then
|
||||
if grep -q "disable-silent-rules" "${ECONF_SOURCE:-.}"/configure; then
|
||||
g2conf+=( --disable-silent-rules )
|
||||
fi
|
||||
fi
|
||||
|
||||
# Pass --disable-schemas-install when possible
|
||||
if grep -q "disable-schemas-install" "${ECONF_SOURCE:-.}"/configure; then
|
||||
g2conf+=( --disable-schemas-install )
|
||||
fi
|
||||
|
||||
# Pass --disable-schemas-compile when possible
|
||||
if grep -q "disable-schemas-compile" "${ECONF_SOURCE:-.}"/configure; then
|
||||
g2conf+=( --disable-schemas-compile )
|
||||
fi
|
||||
|
||||
# Pass --disable-update-mimedb when possible
|
||||
if grep -q "disable-update-mimedb" "${ECONF_SOURCE:-.}"/configure; then
|
||||
g2conf+=( --disable-update-mimedb )
|
||||
fi
|
||||
|
||||
# Pass --enable-compile-warnings=minimum as we don't want -Werror* flags, bug #471336
|
||||
if grep -q "enable-compile-warnings" "${ECONF_SOURCE:-.}"/configure; then
|
||||
g2conf+=( --enable-compile-warnings=minimum )
|
||||
fi
|
||||
|
||||
# Pass --docdir with proper directory, bug #482646 (not needed since eapi6)
|
||||
if has ${EAPI:-0} 4 5; then
|
||||
if grep -q "^ *--docdir=" "${ECONF_SOURCE:-.}"/configure; then
|
||||
g2conf+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )
|
||||
fi
|
||||
fi
|
||||
|
||||
# Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659)
|
||||
if has ${EAPI:-0} 4 5; then
|
||||
addwrite "$(unset HOME; echo ~)/.gnome2"
|
||||
else
|
||||
addpredict "$(unset HOME; echo ~)/.gnome2"
|
||||
fi
|
||||
|
||||
if has ${EAPI:-0} 4 5; then
|
||||
econf ${g2conf[@]} ${G2CONF} "$@"
|
||||
else
|
||||
econf ${g2conf[@]} "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: gnome2_src_compile
|
||||
# @DESCRIPTION:
|
||||
# Only default src_compile for now
|
||||
gnome2_src_compile() {
|
||||
if has ${EAPI:-0} 4 5; then
|
||||
emake
|
||||
else
|
||||
default
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: gnome2_src_install
|
||||
# @DESCRIPTION:
|
||||
# Gnome specific install. Handles typical GConf and scrollkeeper setup
|
||||
# in packages and removal of .la files if requested
|
||||
gnome2_src_install() {
|
||||
# we must delay gconf schema installation due to sandbox
|
||||
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1"
|
||||
|
||||
local sk_tmp_dir="/var/lib/scrollkeeper"
|
||||
# scrollkeeper-update from rarian doesn't do anything. Then, since eapi6
|
||||
# we stop taking care of it
|
||||
#
|
||||
# if this is not present, scrollkeeper-update may segfault and
|
||||
# create bogus directories in /var/lib/
|
||||
if has ${EAPI:-0} 4 5; then
|
||||
dodir "${sk_tmp_dir}" || die "dodir failed"
|
||||
emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install || die "install failed"
|
||||
else
|
||||
default
|
||||
fi
|
||||
|
||||
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
|
||||
|
||||
# Handle documentation as 'default' for eapi5, bug #373131
|
||||
# Since eapi6 this is handled by default on its own plus MAINTAINERS and HACKING
|
||||
# files that are really common in gnome packages (bug #573390)
|
||||
if has ${EAPI:-0} 4; then
|
||||
# Manual document installation
|
||||
if [[ -n "${DOCS}" ]]; then
|
||||
dodoc ${DOCS} || die "dodoc failed"
|
||||
fi
|
||||
elif has ${EAPI:-0} 5; then
|
||||
einstalldocs
|
||||
else
|
||||
local d
|
||||
for d in HACKING MAINTAINERS; do
|
||||
[[ -s "${d}" ]] && dodoc "${d}"
|
||||
done
|
||||
fi
|
||||
|
||||
# Do not keep /var/lib/scrollkeeper because:
|
||||
# 1. The scrollkeeper database is regenerated at pkg_postinst()
|
||||
# 2. ${ED}/var/lib/scrollkeeper contains only indexes for the current pkg
|
||||
# thus it makes no sense if pkg_postinst ISN'T run for some reason.
|
||||
rm -rf "${ED}${sk_tmp_dir}"
|
||||
rmdir "${ED}/var/lib" 2>/dev/null
|
||||
rmdir "${ED}/var" 2>/dev/null
|
||||
|
||||
# Make sure this one doesn't get in the portage db
|
||||
rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
|
||||
|
||||
# Delete all .la files
|
||||
if has ${EAPI:-0} 4; then
|
||||
if [[ "${GNOME2_LA_PUNT}" != "no" ]]; then
|
||||
ebegin "Removing .la files"
|
||||
if ! use_if_iuse static-libs ; then
|
||||
find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed"
|
||||
fi
|
||||
eend
|
||||
fi
|
||||
else
|
||||
case "${GNOME2_LA_PUNT}" in
|
||||
yes) prune_libtool_files --modules;;
|
||||
no) ;;
|
||||
*) prune_libtool_files;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: gnome2_pkg_preinst
|
||||
# @DESCRIPTION:
|
||||
# Finds Icons, GConf and GSettings schemas for later handling in pkg_postinst
|
||||
gnome2_pkg_preinst() {
|
||||
xdg_pkg_preinst
|
||||
gnome2_gconf_savelist
|
||||
gnome2_schemas_savelist
|
||||
gnome2_scrollkeeper_savelist
|
||||
gnome2_gdk_pixbuf_savelist
|
||||
|
||||
local f
|
||||
|
||||
GNOME2_ECLASS_GIO_MODULES=()
|
||||
while IFS= read -r -d '' f; do
|
||||
GNOME2_ECLASS_GIO_MODULES+=( ${f} )
|
||||
done < <(cd "${D}" && find usr/$(get_libdir)/gio/modules -type f -print0 2>/dev/null)
|
||||
|
||||
export GNOME2_ECLASS_GIO_MODULES
|
||||
}
|
||||
|
||||
# @FUNCTION: gnome2_pkg_postinst
|
||||
# @DESCRIPTION:
|
||||
# Handle scrollkeeper, GConf, GSettings, Icons, desktop and mime
|
||||
# database updates.
|
||||
gnome2_pkg_postinst() {
|
||||
xdg_pkg_postinst
|
||||
gnome2_gconf_install
|
||||
if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
|
||||
gnome2_schemas_update
|
||||
fi
|
||||
gnome2_scrollkeeper_update
|
||||
gnome2_gdk_pixbuf_update
|
||||
|
||||
if [[ ${#GNOME2_ECLASS_GIO_MODULES[@]} -gt 0 ]]; then
|
||||
gnome2_giomodule_cache_update
|
||||
fi
|
||||
}
|
||||
|
||||
# # FIXME Handle GConf schemas removal
|
||||
#gnome2_pkg_prerm() {
|
||||
# gnome2_gconf_uninstall
|
||||
#}
|
||||
|
||||
# @FUNCTION: gnome2_pkg_postrm
|
||||
# @DESCRIPTION:
|
||||
# Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
|
||||
gnome2_pkg_postrm() {
|
||||
xdg_pkg_postrm
|
||||
if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
|
||||
gnome2_schemas_update
|
||||
fi
|
||||
gnome2_scrollkeeper_update
|
||||
|
||||
if [[ ${#GNOME2_ECLASS_GIO_MODULES[@]} -gt 0 ]]; then
|
||||
gnome2_giomodule_cache_update
|
||||
fi
|
||||
}
|
@ -1,240 +0,0 @@
|
||||
# Copyright 1999-2019 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# @ECLASS: office-ext-r1.eclass
|
||||
# @MAINTAINER:
|
||||
# The office team <office@gentoo.org>
|
||||
# @AUTHOR:
|
||||
# Tomáš Chvátal <scarabeus@gentoo.org>
|
||||
# @SUPPORTED_EAPIS: 5 6 7
|
||||
# @BLURB: Eclass for installing libreoffice/openoffice extensions
|
||||
# @DESCRIPTION:
|
||||
# Eclass for easing maintenance of libreoffice/openoffice extensions.
|
||||
|
||||
case "${EAPI:-0}" in
|
||||
5|6) inherit eutils multilib ;;
|
||||
7) ;;
|
||||
*) die "EAPI=${EAPI} is not supported" ;;
|
||||
esac
|
||||
|
||||
OEXT_EXPORTED_FUNCTIONS="src_unpack src_install pkg_postinst pkg_prerm"
|
||||
|
||||
# @ECLASS-VARIABLE: OFFICE_REQ_USE
|
||||
# @DESCRIPTION:
|
||||
# Useflags required on office implementation for the extension.
|
||||
#
|
||||
# Example:
|
||||
# @CODE
|
||||
# OFFICE_REQ_USE="java,jemalloc(-)?"
|
||||
# @CODE
|
||||
if [[ ${OFFICE_REQ_USE} ]]; then
|
||||
# Append the brackets for the depend bellow
|
||||
OFFICE_REQ_USE="[${OFFICE_REQ_USE}]"
|
||||
fi
|
||||
|
||||
# @ECLASS-VARIABLE: OFFICE_IMPLEMENTATIONS
|
||||
# @DESCRIPTION:
|
||||
# List of implementations supported by the extension.
|
||||
# Some work only for libreoffice and vice versa.
|
||||
# Default value is all implementations.
|
||||
#
|
||||
# Example:
|
||||
# @CODE
|
||||
# OFFICE_IMPLEMENTATIONS=( "libreoffice" "openoffice" )
|
||||
# @CODE
|
||||
[[ -z ${OFFICE_IMPLEMENTATIONS} ]] && OFFICE_IMPLEMENTATIONS=( "libreoffice" "openoffice" )
|
||||
|
||||
# @ECLASS-VARIABLE: OFFICE_EXTENSIONS
|
||||
# @REQUIRED
|
||||
# @DESCRIPTION:
|
||||
# Array containing list of extensions to install.
|
||||
#
|
||||
# Example:
|
||||
# @CODE
|
||||
# OFFICE_EXTENSIONS=( ${PN}_${PV}.oxt )
|
||||
# @CODE
|
||||
[[ -z ${OFFICE_EXTENSIONS} ]] && die "OFFICE_EXTENSIONS variable is unset."
|
||||
if [[ "$(declare -p OFFICE_EXTENSIONS 2>/dev/null 2>&1)" != "declare -a"* ]]; then
|
||||
die "OFFICE_EXTENSIONS variable is not an array."
|
||||
fi
|
||||
|
||||
# @ECLASS-VARIABLE: OFFICE_EXTENSIONS_LOCATION
|
||||
# @DESCRIPTION:
|
||||
# Path to the extensions location. Defaults to ${DISTDIR}.
|
||||
#
|
||||
# Example:
|
||||
# @CODE
|
||||
# OFFICE_EXTENSIONS_LOCATION="${S}/unpacked/"
|
||||
# @CODE
|
||||
: ${OFFICE_EXTENSIONS_LOCATION:=${DISTDIR}}
|
||||
|
||||
IUSE=""
|
||||
RDEPEND=""
|
||||
|
||||
for i in ${OFFICE_IMPLEMENTATIONS[@]}; do
|
||||
IUSE+=" office_implementation_${i}"
|
||||
if [[ ${i} == "openoffice" ]]; then
|
||||
# special only binary
|
||||
RDEPEND+="
|
||||
office_implementation_openoffice? (
|
||||
app-office/openoffice-bin${OFFICE_REQ_USE}
|
||||
)
|
||||
"
|
||||
else
|
||||
RDEPEND+="
|
||||
office_implementation_${i}? (
|
||||
|| (
|
||||
app-office/${i}${OFFICE_REQ_USE}
|
||||
app-office/${i}-bin${OFFICE_REQ_USE}
|
||||
)
|
||||
)
|
||||
"
|
||||
fi
|
||||
done
|
||||
|
||||
REQUIRED_USE="|| ( "
|
||||
for i in ${OFFICE_IMPLEMENTATIONS[@]}; do
|
||||
REQUIRED_USE+=" office_implementation_${i} "
|
||||
done
|
||||
REQUIRED_USE+=" )"
|
||||
|
||||
DEPEND="${RDEPEND}
|
||||
app-arch/unzip
|
||||
"
|
||||
|
||||
# Most projects actually do not provide any relevant sourcedir as they are oxt.
|
||||
S="${WORKDIR}"
|
||||
|
||||
# @FUNCTION: office-ext-r1_src_unpack
|
||||
# @DESCRIPTION:
|
||||
# Flush the cache after removal of an extension.
|
||||
office-ext-r1_src_unpack() {
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
local i
|
||||
|
||||
default
|
||||
|
||||
for i in ${OFFICE_EXTENSIONS[@]}; do
|
||||
# Unpack the extensions where required and add case for oxt
|
||||
# which should be most common case for the extensions.
|
||||
if [[ -f "${OFFICE_EXTENSIONS_LOCATION}/${i}" ]] ; then
|
||||
case ${i} in
|
||||
*.oxt)
|
||||
mkdir -p "${WORKDIR}/${i}/"
|
||||
pushd "${WORKDIR}/${i}/" > /dev/null
|
||||
echo ">>> Unpacking "${OFFICE_EXTENSIONS_LOCATION}/${i}" to ${PWD}"
|
||||
unzip -qo ${OFFICE_EXTENSIONS_LOCATION}/${i}
|
||||
assert "failed unpacking ${OFFICE_EXTENSIONS_LOCATION}/${i}"
|
||||
popd > /dev/null
|
||||
;;
|
||||
*) unpack ${i} ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# @FUNCTION: office-ext-r1_src_install
|
||||
# @DESCRIPTION:
|
||||
# Install the extension source to the proper location.
|
||||
office-ext-r1_src_install() {
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
debug-print "Extensions: ${OFFICE_EXTENSIONS[@]}"
|
||||
|
||||
local i j
|
||||
|
||||
for i in ${OFFICE_IMPLEMENTATIONS[@]}; do
|
||||
if use office_implementation_${i}; then
|
||||
if [[ ${i} == openoffice ]]; then
|
||||
# OOO needs to use uno because direct deployment segfaults.
|
||||
# This is bug by their side, but i don't want to waste time
|
||||
# fixing it myself.
|
||||
insinto /usr/$(get_libdir)/${i}/share/extension/install
|
||||
for j in ${OFFICE_EXTENSIONS[@]}; do
|
||||
doins ${OFFICE_EXTENSIONS_LOCATION}/${j}
|
||||
done
|
||||
else
|
||||
for j in ${OFFICE_EXTENSIONS[@]}; do
|
||||
pushd "${WORKDIR}/${j}/" > /dev/null
|
||||
insinto /usr/$(get_libdir)/${i}/share/extensions/${j/.oxt/}
|
||||
doins -r *
|
||||
popd > /dev/null
|
||||
done
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
#### OPENOFFICE COMPAT CODE
|
||||
|
||||
UNOPKG_BINARY="/usr/lib64/openoffice/program/unopkg"
|
||||
|
||||
# @FUNCTION: office-ext-r1_add_extension
|
||||
# @DESCRIPTION:
|
||||
# Install the extension into the libreoffice/openoffice.
|
||||
office-ext-r1_add_extension() {
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
local ext=$1
|
||||
local tmpdir=$(emktemp -d)
|
||||
|
||||
debug-print "${FUNCNAME}: ${UNOPKG_BINARY} add --shared \"${ext}\""
|
||||
ebegin "Adding office extension: \"${ext}\""
|
||||
${UNOPKG_BINARY} add --suppress-license \
|
||||
--shared "${ext}" \
|
||||
"-env:UserInstallation=file:///${tmpdir}" \
|
||||
"-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
|
||||
eend $?
|
||||
${UNOPKG_BINARY} list --shared > /dev/null
|
||||
rm -r "${tmpdir}" || dir "failed to clean up"
|
||||
}
|
||||
|
||||
# @FUNCTION: office-ext-r1_remove_extension
|
||||
# @DESCRIPTION:
|
||||
# Remove the extension from the libreoffice/openoffice.
|
||||
office-ext-r1_remove_extension() {
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
local ext=$1
|
||||
local tmpdir=$(mktemp -d --tmpdir="${T}")
|
||||
|
||||
debug-print "${FUNCNAME}: ${UNOPKG_BINARY} remove --shared \"${ext}\""
|
||||
ebegin "Removing office extension: \"${ext}\""
|
||||
${UNOPKG_BINARY} remove --suppress-license \
|
||||
--shared "${ext}" \
|
||||
"-env:UserInstallation=file:///${tmpdir}" \
|
||||
"-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
|
||||
eend $?
|
||||
${UNOPKG_BINARY} list --shared > /dev/null
|
||||
rm -r "${tmpdir}" || dir "failed to clean up"
|
||||
}
|
||||
|
||||
# @FUNCTION: office-ext-r1_pkg_postinst
|
||||
# @DESCRIPTION:
|
||||
# Add the extensions to the openoffice.
|
||||
office-ext-r1_pkg_postinst() {
|
||||
if in_iuse office_implementation_openoffice && use office_implementation_openoffice; then
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
debug-print "Extensions: ${OFFICE_EXTENSIONS[@]}"
|
||||
local i
|
||||
|
||||
for i in ${OFFICE_EXTENSIONS[@]}; do
|
||||
office-ext-r1_add_extension "/usr/lib64/openoffice/share/extension/install/${i}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: office-ext-r1_pkg_prerm
|
||||
# @DESCRIPTION:
|
||||
# Remove the extensions from the openoffice.
|
||||
office-ext-r1_pkg_prerm() {
|
||||
if in_iuse office_implementation_openoffice && use office_implementation_openoffice; then
|
||||
debug-print-function ${FUNCNAME} "$@"
|
||||
debug-print "Extensions: ${OFFICE_EXTENSIONS[@]}"
|
||||
local i
|
||||
|
||||
for i in ${OFFICE_EXTENSIONS[@]}; do
|
||||
office-ext-r1_remove_extension "${i}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
EXPORT_FUNCTIONS ${OEXT_EXPORTED_FUNCTIONS}
|
||||
unset OEXT_EXPORTED_FUNCTIONS
|
@ -1,452 +0,0 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# @ECLASS: php-ext-source-r3.eclass
|
||||
# @MAINTAINER:
|
||||
# Gentoo PHP team <php-bugs@gentoo.org>
|
||||
# @SUPPORTED_EAPIS: 6 7
|
||||
# @BLURB: Compile and install standalone PHP extensions.
|
||||
# @DESCRIPTION:
|
||||
# A unified interface for compiling and installing standalone PHP
|
||||
# extensions.
|
||||
|
||||
inherit autotools
|
||||
|
||||
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
|
||||
|
||||
case ${EAPI:-0} in
|
||||
6|7) ;;
|
||||
*)
|
||||
die "${ECLASS} is not compatible with EAPI=${EAPI}"
|
||||
esac
|
||||
|
||||
# @ECLASS-VARIABLE: PHP_EXT_NAME
|
||||
# @REQUIRED
|
||||
# @DESCRIPTION:
|
||||
# The extension name. This must be set, otherwise the eclass dies.
|
||||
# Only automagically set by php-ext-pecl-r3.eclass, so unless your ebuild
|
||||
# inherits that eclass, you must set this manually before inherit.
|
||||
[[ -z "${PHP_EXT_NAME}" ]] && \
|
||||
die "no extension name specified for the php-ext-source-r3 eclass"
|
||||
|
||||
# @ECLASS-VARIABLE: PHP_EXT_INI
|
||||
# @DESCRIPTION:
|
||||
# Controls whether or not to add a line to php.ini for the extension.
|
||||
# Defaults to "yes" and should not be changed in most cases.
|
||||
[[ -z "${PHP_EXT_INI}" ]] && PHP_EXT_INI="yes"
|
||||
|
||||
# @ECLASS-VARIABLE: PHP_EXT_ZENDEXT
|
||||
# @DESCRIPTION:
|
||||
# Controls whether the extension is a ZendEngine extension or not.
|
||||
# Defaults to "no". If you don't know what this is, you don't need it.
|
||||
[[ -z "${PHP_EXT_ZENDEXT}" ]] && PHP_EXT_ZENDEXT="no"
|
||||
|
||||
# @ECLASS-VARIABLE: USE_PHP
|
||||
# @REQUIRED
|
||||
# @DESCRIPTION:
|
||||
# Lists the PHP slots compatible the extension is compatible with.
|
||||
# Example:
|
||||
# @CODE
|
||||
# USE_PHP="php5-6 php7-0"
|
||||
# @CODE
|
||||
[[ -z "${USE_PHP}" ]] && \
|
||||
die "USE_PHP is not set for the php-ext-source-r3 eclass"
|
||||
|
||||
# @ECLASS-VARIABLE: PHP_EXT_OPTIONAL_USE
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# If set, all of the dependencies added by this eclass will be
|
||||
# conditional on USE=${PHP_EXT_OPTIONAL_USE}. This is needed when
|
||||
# ebuilds have to inherit this eclass unconditionally, but only
|
||||
# actually use it when (for example) the user has USE=php.
|
||||
|
||||
# @ECLASS-VARIABLE: PHP_EXT_S
|
||||
# @DESCRIPTION:
|
||||
# The relative location of the temporary build directory for the PHP
|
||||
# extension within the source package. This is useful for packages that
|
||||
# bundle the PHP extension. Defaults to ${S}.
|
||||
[[ -z "${PHP_EXT_S}" ]] && PHP_EXT_S="${S}"
|
||||
|
||||
# @ECLASS-VARIABLE: PHP_EXT_SAPIS
|
||||
# @DESCRIPTION:
|
||||
# A list of SAPIs for which we will install this extension. Formerly
|
||||
# called PHPSAPILIST. The default includes every SAPI currently used in
|
||||
# the tree.
|
||||
[[ -z "${PHP_EXT_SAPIS}" ]] && PHP_EXT_SAPIS="apache2 cli cgi fpm embed phpdbg"
|
||||
|
||||
# @ECLASS-VARIABLE: PHP_INI_NAME
|
||||
# @DESCRIPTION:
|
||||
# An optional file name of the saved ini file minis the ini extension
|
||||
# This allows ordering of extensions such that one is loaded before
|
||||
# or after another. Defaults to the PHP_EXT_NAME.
|
||||
# Example (produces 40-foo.ini file):
|
||||
# @CODE@
|
||||
# PHP_INI_NAME="40-foo"
|
||||
# @CODE@
|
||||
: ${PHP_INI_NAME:=${PHP_EXT_NAME}}
|
||||
|
||||
# @ECLASS-VARIABLE: PHP_EXT_NEEDED_USE
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# A list of USE flags to append to each PHP target selected
|
||||
# as a valid USE-dependency string. The value should be valid
|
||||
# for all targets so USE defaults may be necessary.
|
||||
# Example:
|
||||
# @CODE
|
||||
# PHP_EXT_NEEDED_USE="mysql?,pdo,pcre(+)"
|
||||
# @CODE
|
||||
#
|
||||
# The PHP dependencies will result in:
|
||||
# @CODE
|
||||
# php_targets_php7-0? ( dev-lang/php:7.0[mysql?,pdo,pcre(+)] )
|
||||
# @CODE
|
||||
|
||||
|
||||
# Make sure at least one target is installed. First, start a USE
|
||||
# conditional like "php?", but only when PHP_EXT_OPTIONAL_USE is
|
||||
# non-null. The option group "|| (..." is always started here.
|
||||
REQUIRED_USE="${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( }|| ( "
|
||||
PHPDEPEND="${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( } "
|
||||
for _php_target in ${USE_PHP}; do
|
||||
# Now loop through each USE_PHP target and add the corresponding
|
||||
# dev-lang/php slot to PHPDEPEND.
|
||||
IUSE+=" php_targets_${_php_target}"
|
||||
REQUIRED_USE+="php_targets_${_php_target} "
|
||||
_php_slot=${_php_target/php}
|
||||
_php_slot=${_php_slot/-/.}
|
||||
if [[ ${PHP_EXT_NEEDED_USE} ]] ; then
|
||||
_php_slot+=[${PHP_EXT_NEEDED_USE}]
|
||||
fi
|
||||
PHPDEPEND+=" php_targets_${_php_target}? ( dev-lang/php:${_php_slot} )"
|
||||
done
|
||||
|
||||
# Don't pollute the environment with our loop variables.
|
||||
unset _php_slot _php_target
|
||||
|
||||
# Finally, end the optional group that we started before the loop. Close
|
||||
# the USE-conditional if PHP_EXT_OPTIONAL_USE is non-null.
|
||||
REQUIRED_USE+=") ${PHP_EXT_OPTIONAL_USE:+ )}"
|
||||
PHPDEPEND+=" ${PHP_EXT_OPTIONAL_USE:+ )}"
|
||||
TOOLDEPS="sys-devel/m4 sys-devel/libtool"
|
||||
|
||||
RDEPEND="${PHPDEPEND}"
|
||||
|
||||
case ${EAPI:-0} in
|
||||
6) DEPEND="${TOOLDEPS} ${PHPDEPEND}" ;;
|
||||
7) DEPEND="${PHPDEPEND}" ; BDEPEND="${TOOLDEPS} ${PHPDEPEND}" ;;
|
||||
esac
|
||||
|
||||
unset PHPDEPEND TOOLDEPS
|
||||
|
||||
# @ECLASS-VARIABLE: PHP_EXT_SKIP_PHPIZE
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# By default, we run "phpize" in php-ext-source-r3_src_prepare(). Set
|
||||
# PHP_EXT_SKIP_PHPIZE="yes" in your ebuild if you do not want to run
|
||||
# phpize (and the autoreconf that becomes necessary afterwards).
|
||||
|
||||
# @ECLASS-VARIABLE: PHP_EXT_SKIP_PATCHES
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# By default, we run default_src_prepare to PHP_EXT_S.
|
||||
# Set PHP_EXT_SKIP_PATCHES="yes" in your ebuild if you
|
||||
# want to apply patches yourself.
|
||||
|
||||
# @FUNCTION: php-ext-source-r3_src_prepare
|
||||
# @DESCRIPTION:
|
||||
# Runs the default src_prepare() for PATCHES/eapply_user() support (optional),
|
||||
# and for each PHP slot, makes a copy of sources, initializes the environment,
|
||||
# and calls php-ext-source-r3_phpize().
|
||||
php-ext-source-r3_src_prepare() {
|
||||
local slot orig_s="${PHP_EXT_S}"
|
||||
if [[ "${PHP_EXT_SKIP_PATCHES}" != 'yes' ]] ; then
|
||||
pushd "${orig_s}" > /dev/null || die
|
||||
default
|
||||
popd > /dev/null || die
|
||||
fi
|
||||
for slot in $(php_get_slots); do
|
||||
cp --recursive --preserve "${orig_s}" "${WORKDIR}/${slot}" || \
|
||||
die "failed to copy sources from ${orig_s} to ${WORKDIR}/${slot}"
|
||||
php_init_slot_env "${slot}"
|
||||
php-ext-source-r3_phpize
|
||||
done
|
||||
}
|
||||
|
||||
# @FUNCTION: php-ext-source-r3_phpize
|
||||
# @DESCRIPTION:
|
||||
# Subject to PHP_EXT_SKIP_PHPIZE, this function runs phpize and
|
||||
# autoreconf in a manner that avoids warnings.
|
||||
php-ext-source-r3_phpize() {
|
||||
if [[ "${PHP_EXT_SKIP_PHPIZE}" != 'yes' ]] ; then
|
||||
# Create configure out of config.m4. We use autotools_run_tool
|
||||
# to avoid some warnings about WANT_AUTOCONF and
|
||||
# WANT_AUTOMAKE (see bugs #329071 and #549268).
|
||||
autotools_run_tool "${PHPIZE}"
|
||||
|
||||
# Force libtoolize to run and regenerate autotools files (bug
|
||||
# #220519).
|
||||
rm aclocal.m4 || die "failed to remove aclocal.m4"
|
||||
eautoreconf
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# @ECLASS-VARIABLE: PHP_EXT_ECONF_ARGS
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# Set this in the ebuild to pass additional configure options to
|
||||
# econf. Formerly called my_conf. Either a string or an array of
|
||||
# --flag=value parameters is supported.
|
||||
|
||||
# @FUNCTION: php-ext-source-r3_src_configure
|
||||
# @DESCRIPTION:
|
||||
# Takes care of standard configure for PHP extensions (modules).
|
||||
php-ext-source-r3_src_configure() {
|
||||
# net-snmp creates these, bug #385403.
|
||||
addpredict /usr/share/snmp/mibs/.index
|
||||
addpredict /var/lib/net-snmp/mib_indexes
|
||||
|
||||
# Support either a string or an array for PHP_EXT_ECONF_ARGS.
|
||||
local econf_args
|
||||
if [[ -n "${PHP_EXT_ECONF_ARGS}" && $(declare -p PHP_EXT_ECONF_ARGS) == "declare -a"* ]]; then
|
||||
econf_args=( "${PHP_EXT_ECONF_ARGS[@]}" )
|
||||
else
|
||||
econf_args=( ${PHP_EXT_ECONF_ARGS} )
|
||||
fi
|
||||
|
||||
local slot
|
||||
for slot in $(php_get_slots); do
|
||||
php_init_slot_env "${slot}"
|
||||
econf --with-php-config="${PHPCONFIG}" "${econf_args[@]}"
|
||||
done
|
||||
}
|
||||
|
||||
# @FUNCTION: php-ext-source-r3_src_compile
|
||||
# @DESCRIPTION:
|
||||
# Compile a standard standalone PHP extension.
|
||||
php-ext-source-r3_src_compile() {
|
||||
# net-snmp creates these, bug #324739.
|
||||
addpredict /usr/share/snmp/mibs/.index
|
||||
addpredict /var/lib/net-snmp/mib_indexes
|
||||
|
||||
# shm extension creates a semaphore file, bug #173574.
|
||||
addpredict /session_mm_cli0.sem
|
||||
local slot
|
||||
for slot in $(php_get_slots); do
|
||||
php_init_slot_env "${slot}"
|
||||
emake
|
||||
done
|
||||
}
|
||||
|
||||
# @FUNCTION: php-ext-source-r3_src_install
|
||||
# @DESCRIPTION:
|
||||
# Install a standard standalone PHP extension. Uses einstalldocs()
|
||||
# to support the DOCS variable/array.
|
||||
php-ext-source-r3_src_install() {
|
||||
local slot
|
||||
for slot in $(php_get_slots); do
|
||||
php_init_slot_env "${slot}"
|
||||
|
||||
# Strip $EPREFIX from $EXT_DIR before calling doexe (which
|
||||
# handles EPREFIX itself). Shared libs are +x by convention,
|
||||
# although nothing seems to depend on that.
|
||||
exeinto "${EXT_DIR#$EPREFIX}"
|
||||
doexe "modules/${PHP_EXT_NAME}.so"
|
||||
|
||||
INSTALL_ROOT="${D}" emake install-headers
|
||||
done
|
||||
einstalldocs
|
||||
php-ext-source-r3_createinifiles
|
||||
}
|
||||
|
||||
# @FUNCTION: php-ext-source-r3_src_test
|
||||
# @DESCRIPTION:
|
||||
# Run tests delivered with the standalone PHP extension. Phpize will have generated
|
||||
# a run-tests.php file to be executed by `make test`. We only need to
|
||||
# force the test suite to run in non-interactive mode.
|
||||
php-ext-source-r3_src_test() {
|
||||
local slot
|
||||
for slot in $(php_get_slots); do
|
||||
php_init_slot_env "${slot}"
|
||||
NO_INTERACTION="yes" emake test
|
||||
done
|
||||
}
|
||||
|
||||
# @FUNCTION: php_get_slots
|
||||
# @DESCRIPTION:
|
||||
# Get a list of PHP slots contained in both the ebuild's USE_PHP and the
|
||||
# user's PHP_TARGETS.
|
||||
php_get_slots() {
|
||||
local s=""
|
||||
local slot
|
||||
for slot in ${USE_PHP}; do
|
||||
use php_targets_${slot} && s+=" ${slot/-/.}"
|
||||
done
|
||||
echo $s
|
||||
}
|
||||
|
||||
# @FUNCTION: php_init_slot_env
|
||||
# @USAGE: <slot>
|
||||
# @DESCRIPTION:
|
||||
# Takes a slot name, and initializes some global variables to values
|
||||
# corresponding to that slot. For example, it sets the path to the "php"
|
||||
# and "phpize" binaries, which will differ for each slot. This function
|
||||
# is intended to be called while looping through a list of slots
|
||||
# obtained from php_get_slots().
|
||||
#
|
||||
# Calling this function will change the working directory to the
|
||||
# temporary build directory for the given slot.
|
||||
php_init_slot_env() {
|
||||
local libdir=$(get_libdir)
|
||||
local slot="${1}"
|
||||
|
||||
PHPPREFIX="${EPREFIX}/usr/${libdir}/${slot}"
|
||||
PHPIZE="${PHPPREFIX}/bin/phpize"
|
||||
PHPCONFIG="${PHPPREFIX}/bin/php-config"
|
||||
PHPCLI="${PHPPREFIX}/bin/php"
|
||||
PHPCGI="${PHPPREFIX}/bin/php-cgi"
|
||||
PHP_PKG="$(best_version =dev-lang/php-${1:3}*)"
|
||||
|
||||
EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)"
|
||||
PHP_CURRENTSLOT=${1:3}
|
||||
|
||||
PHP_EXT_S="${WORKDIR}/${slot}"
|
||||
cd "${PHP_EXT_S}" || die "failed to change directory to ${PHP_EXT_S}"
|
||||
}
|
||||
|
||||
# @FUNCTION: php_slot_ini_files
|
||||
# @USAGE: <slot>
|
||||
# @INTERNAL
|
||||
# @DESCRIPTION:
|
||||
# Output a list of relative paths to INI files for the given
|
||||
# slot. Usually there will be one INI file per SAPI.
|
||||
php_slot_ini_files() {
|
||||
local slot_ini_files=""
|
||||
local x
|
||||
for x in ${PHP_EXT_SAPIS} ; do
|
||||
if [[ -f "${EPREFIX}/etc/php/${x}-${1}/php.ini" ]] ; then
|
||||
slot_ini_files+=" etc/php/${x}-${1}/ext/${PHP_INI_NAME}.ini"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "${slot_ini_files}"
|
||||
}
|
||||
|
||||
# @FUNCTION: php-ext-source-r3_createinifiles
|
||||
# @DESCRIPTION:
|
||||
# Builds INI files for every enabled slot and SAPI.
|
||||
php-ext-source-r3_createinifiles() {
|
||||
local slot
|
||||
for slot in $(php_get_slots); do
|
||||
php_init_slot_env "${slot}"
|
||||
|
||||
local file
|
||||
for file in $(php_slot_ini_files "${slot}") ; do
|
||||
if [[ "${PHP_EXT_INI}" = "yes" ]] ; then
|
||||
# Add the needed lines to the <ext>.ini files
|
||||
php-ext-source-r3_addextension "${PHP_EXT_NAME}.so" "${file}"
|
||||
fi
|
||||
|
||||
if [[ -n "${PHP_EXT_INIFILE}" ]] ; then
|
||||
cat "${FILESDIR}/${PHP_EXT_INIFILE}" >> "${ED}/${file}" \
|
||||
|| die "failed to append to ${ED}/${file}"
|
||||
|
||||
einfo "Added contents of ${FILESDIR}/${PHP_EXT_INIFILE}" \
|
||||
"to ${file}"
|
||||
fi
|
||||
inidir="${file/${PHP_INI_NAME}.ini/}"
|
||||
inidir="${inidir/ext/ext-active}"
|
||||
dodir "/${inidir}"
|
||||
dosym "/${file}" "/${file/ext/ext-active}"
|
||||
done
|
||||
done
|
||||
|
||||
# A location where PHP code for this extension can be stored,
|
||||
# independent of the PHP or extension versions. This will be part of
|
||||
# PHP's include_path, configured in php.ini. For example, pecl-apcu
|
||||
# installs an "apc.php" file which you are supposed to load with
|
||||
#
|
||||
# require('apcu/apc.php');
|
||||
#
|
||||
PHP_EXT_SHARED_DIR="${EPREFIX}/usr/share/php/${PHP_EXT_NAME}"
|
||||
}
|
||||
|
||||
# @FUNCTION: php-ext-source-r3_addextension
|
||||
# @USAGE: <extension-path> <ini-file>
|
||||
# @INTERNAL
|
||||
# @DESCRIPTION:
|
||||
# Add a line to an INI file that will enable the given extension. The
|
||||
# first parameter is the path to the extension (.so) file, and the
|
||||
# second parameter is the name of the INI file in which it should be
|
||||
# loaded. This function determines the setting name (either
|
||||
# "extension=..." or "zend_extension=...") and then calls
|
||||
# php-ext-source-r3_addtoinifile to do the actual work.
|
||||
php-ext-source-r3_addextension() {
|
||||
local ext_type="extension"
|
||||
local ext_file="${1}"
|
||||
|
||||
if [[ "${PHP_EXT_ZENDEXT}" = "yes" ]] ; then
|
||||
ext_type="zend_extension"
|
||||
ext_file="${EXT_DIR}/${1}" # Zend extensions need the path...
|
||||
fi
|
||||
|
||||
php-ext-source-r3_addtoinifile "${2}" "${ext_type}" "${ext_file}"
|
||||
}
|
||||
|
||||
# @FUNCTION: php-ext-source-r3_addtoinifile
|
||||
# @USAGE: <relative-ini-path> <setting-or-section-name> [setting-value]
|
||||
# @INTERNAL
|
||||
# @DESCRIPTION:
|
||||
# Add a setting=value to one INI file. The first argument is the
|
||||
# relative path to the INI file. The second argument is the setting
|
||||
# name, and the third argument is its value.
|
||||
#
|
||||
# You can also pass "[Section]" as the second parameter, to create a new
|
||||
# section in the INI file. In that case, the third parameter (which
|
||||
# would otherwise be the value of the setting) is ignored.
|
||||
php-ext-source-r3_addtoinifile() {
|
||||
local inifile="${WORKDIR}/${1}"
|
||||
local inidir="${inifile%/*}"
|
||||
|
||||
mkdir -p "${inidir}" || die "failed to create INI directory ${inidir}"
|
||||
|
||||
# Are we adding the name of a section? Assume not by default.
|
||||
local my_added="${2}=${3}"
|
||||
if [[ ${2:0:1} == "[" ]] ; then
|
||||
# Ok, it's a section name.
|
||||
my_added="${2}"
|
||||
fi
|
||||
echo "${my_added}" >> "${inifile}" || die "failed to append to ${inifile}"
|
||||
einfo "Added '${my_added}' to /${1}"
|
||||
|
||||
insinto "/${1%/*}"
|
||||
doins "${inifile}"
|
||||
}
|
||||
|
||||
# @FUNCTION: php-ext-source-r3_addtoinifiles
|
||||
# @USAGE: <setting-or-section-name> [setting-value] [message]
|
||||
# @DESCRIPTION:
|
||||
# Add settings to every php.ini file installed by this extension.
|
||||
# You can also add new [Section]s -- see the example below.
|
||||
#
|
||||
# @CODE
|
||||
# Add some settings for the extension:
|
||||
#
|
||||
# php-ext-source-r3_addtoinifiles "zend_optimizer.optimization_level" "15"
|
||||
# php-ext-source-r3_addtoinifiles "zend_optimizer.enable_loader" "0"
|
||||
# php-ext-source-r3_addtoinifiles "zend_optimizer.disable_licensing" "0"
|
||||
#
|
||||
# Adding values to a section in php.ini file installed by the extension:
|
||||
#
|
||||
# php-ext-source-r3_addtoinifiles "[Debugger]"
|
||||
# php-ext-source-r3_addtoinifiles "debugger.enabled" "on"
|
||||
# php-ext-source-r3_addtoinifiles "debugger.profiler_enabled" "on"
|
||||
# @CODE
|
||||
php-ext-source-r3_addtoinifiles() {
|
||||
local slot
|
||||
for slot in $(php_get_slots); do
|
||||
for file in $(php_slot_ini_files "${slot}") ; do
|
||||
php-ext-source-r3_addtoinifile "${file}" "${1}" "${2}"
|
||||
done
|
||||
done
|
||||
}
|
Loading…
Reference in New Issue
Block a user