bump(profiles): sync with upstream

Packages updated:
  eclass
  licenses
  profiles
  scripts
This commit is contained in:
David Michael 2018-06-21 14:32:48 +00:00
parent 1ea3d80164
commit cdcc9e1545
810 changed files with 10689 additions and 18832 deletions

View File

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# @ECLASS: ant-tasks.eclass
@ -16,20 +16,21 @@
JAVA_ANT_DISABLE_ANT_CORE_DEP=true
# rewriting build.xml for are the testcases has no reason atm
JAVA_PKG_BSFIX_ALL=no
inherit versionator java-pkg-2 java-ant-2
inherit java-pkg-2 java-ant-2
[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver
EXPORT_FUNCTIONS src_unpack src_compile src_install
# @ECLASS-VARIABLE: ANT_TASK_JDKVER
# @DESCRIPTION:
# Affects the >=virtual/jdk version set in DEPEND string. Defaults to 1.5, can
# be overriden from ebuild BEFORE inheriting this eclass.
# be overridden from ebuild BEFORE inheriting this eclass.
ANT_TASK_JDKVER=${ANT_TASK_JDKVER-1.5}
# @ECLASS-VARIABLE: ANT_TASK_JREVER
# @DESCRIPTION:
# Affects the >=virtual/jre version set in DEPEND string. Defaults to 1.5, can
# be overriden from ebuild BEFORE inheriting this eclass.
# be overridden from ebuild BEFORE inheriting this eclass.
ANT_TASK_JREVER=${ANT_TASK_JREVER-1.5}
# @ECLASS-VARIABLE: ANT_TASK_NAME
@ -60,24 +61,22 @@ if [[ ${PV} == *beta2* ]]; then
MY_PV=${PV/_beta2/beta}
UPSTREAM_PREFIX="http://people.apache.org/dist/ant/v1.7.1beta2/src"
GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles"
ANT_TASK_PV=$(get_version_component_range 1-3)
ANT_TASK_PV=$(ver_cut 1-3)
elif [[ ${PV} == *_rc* ]]; then
MY_PV=${PV/_rc/RC}
UPSTREAM_PREFIX="https://dev.gentoo.org/~caster/distfiles"
GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles"
ANT_TASK_PV=$(get_version_component_range 1-3)
ANT_TASK_PV=$(ver_cut 1-3)
else
# default for final releases
MY_PV=${PV}
UPSTREAM_PREFIX="mirror://apache/ant/source"
case ${PV} in
1.9.*)
UPSTREAM_PREFIX="https://archive.apache.org/dist/ant/source"
GENTOO_PREFIX="https://dev.gentoo.org/~tomwij/files/dist"
;;
1.8.4)
GENTOO_PREFIX="https://dev.gentoo.org/~sera/distfiles"
;;
*)
UPSTREAM_PREFIX="mirror://apache/ant/source"
GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles"
;;
esac
@ -86,7 +85,7 @@ fi
# source/workdir name
MY_P="apache-ant-${MY_PV}"
# Default values for standard ebuild variables, can be overriden from ebuild.
# Default values for standard ebuild variables, can be overridden from ebuild.
DESCRIPTION="Apache Ant's optional tasks depending on ${ANT_TASK_DEPNAME}"
HOMEPAGE="http://ant.apache.org/"
SRC_URI="${UPSTREAM_PREFIX}/${MY_P}-src.tar.bz2
@ -103,7 +102,7 @@ if [[ -z "${ANT_TASK_DISABLE_VM_DEPS}" ]]; then
fi
# we need direct blockers with old ant-tasks for file collisions - bug #252324
if version_is_at_least 1.7.1 ; then
if ver_test -ge 1.7.1; then
DEPEND+=" !dev-java/ant-tasks"
fi
@ -169,7 +168,7 @@ ant-tasks_src_install() {
java-pkg_register-ant-task --version "${ANT_TASK_PV}"
# create the compatibility symlink
if version_is_at_least 1.7.1_beta2; then
if ver_test -ge 1.7.1_beta2; then
dodir /usr/share/ant/lib
dosym /usr/share/${PN}/lib/${PN}.jar /usr/share/ant/lib/${PN}.jar
fi

View File

@ -24,12 +24,12 @@ esac
case $(get_version_component_range 1-2) in
2.4)
DEFAULT_MPM_THREADED="event" #509922
RDEPEND=">=dev-libs/apr-1.5.1
CDEPEND=">=dev-libs/apr-1.5.1:=
!www-apache/mod_macro" #492578 #477702
;;
2.2)
DEFAULT_MPM_THREADED="worker"
RDEPEND=">=dev-libs/apr-1.4.5" #368651
CDEPEND=">=dev-libs/apr-1.4.5:=" #368651
;;
*)
die "Unknown MAJOR.MINOR apache version."
@ -47,14 +47,14 @@ esac
# If you want to override this in an ebuild, use:
# ORIG_PR="(revision of Gentoo stuff you want)"
# GENTOO_PATCHNAME="gentoo-${PN}-${PV}${ORIG_PR:+-${ORIG_PR}}"
[[ -n "$GENTOO_PATCHNAME" ]] || GENTOO_PATCHNAME="gentoo-${PF}"
[[ -n "${GENTOO_PATCHNAME}" ]] || GENTOO_PATCHNAME="gentoo-${PF}"
# @ECLASS-VARIABLE: GENTOO_PATCHDIR
# @DESCRIPTION:
# This internal variable contains the working directory where patches and config
# files are located.
# Defaults to the patchset name appended to the working directory.
[[ -n "$GENTOO_PATCHDIR" ]] || GENTOO_PATCHDIR="${WORKDIR}/${GENTOO_PATCHNAME}"
[[ -n "${GENTOO_PATCHDIR}" ]] || GENTOO_PATCHDIR="${WORKDIR}/${GENTOO_PATCHNAME}"
# @VARIABLE: GENTOO_DEVELOPER
# @DESCRIPTION:
@ -70,7 +70,7 @@ esac
# @DESCRIPTION:
# This variable should contain the entire filename of patch tarball.
# Defaults to the name of the patchset, with a datestamp.
[[ -n "$GENTOO_PATCH_A" ]] || GENTOO_PATCH_A="${GENTOO_PATCHNAME}-${GENTOO_PATCHSTAMP}.tar.bz2"
[[ -n "${GENTOO_PATCH_A}" ]] || GENTOO_PATCH_A="${GENTOO_PATCHNAME}-${GENTOO_PATCHSTAMP}.tar.bz2"
SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2
https://dev.gentoo.org/~${GENTOO_DEVELOPER}/dist/apache/${GENTOO_PATCH_A}"
@ -91,26 +91,52 @@ SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2
# built-in modules
IUSE_MPMS="${IUSE_MPMS_FORK} ${IUSE_MPMS_THREAD}"
IUSE="${IUSE} debug doc ldap libressl selinux ssl static suexec threads"
IUSE="${IUSE} debug doc gdbm ldap libressl selinux ssl static suexec threads"
for module in ${IUSE_MODULES} ; do
IUSE="${IUSE} apache2_modules_${module}"
done
_apache2_set_mpms() {
local mpm
local ompm
for mpm in ${IUSE_MPMS} ; do
IUSE="${IUSE} apache2_mpms_${mpm}"
REQUIRED_USE+=" apache2_mpms_${mpm}? ("
for ompm in ${IUSE_MPMS} ; do
if [[ "${mpm}" != "${ompm}" ]] ; then
REQUIRED_USE+=" !apache2_mpms_${ompm}"
fi
done
DEPEND="dev-lang/perl
=dev-libs/apr-1*
=dev-libs/apr-util-1*[ldap?]
if has ${mpm} ${IUSE_MPMS_FORK} ; then
REQUIRED_USE+=" !threads"
else
REQUIRED_USE+=" threads"
fi
REQUIRED_USE+=" )"
done
if [[ "${PV}" != 2.2* ]] ; then
REQUIRED_USE+=" apache2_mpms_prefork? ( !apache2_modules_http2 )"
fi
}
_apache2_set_mpms
unset -f _apache2_set_mpms
DEPEND="${CDEPEND}
dev-lang/perl
=dev-libs/apr-util-1*:=[gdbm=,ldap?]
dev-libs/libpcre
apache2_modules_deflate? ( sys-libs/zlib )
apache2_modules_mime? ( app-misc/mime-types )
gdbm? ( sys-libs/gdbm:= )
ldap? ( =net-nds/openldap-2* )
ssl? (
!libressl? ( >=dev-libs/openssl-1.0.2:0= )
libressl? ( dev-libs/libressl:= )
libressl? ( dev-libs/libressl:0= )
)
!=www-servers/apache-1*"
RDEPEND+=" ${DEPEND}
@ -119,6 +145,23 @@ PDEPEND="~app-admin/apache-tools-${PV}"
S="${WORKDIR}/httpd-${PV}"
# @VARIABLE: MODULE_DEPENDS
# @DESCRIPTION:
# This variable needs to be set in the ebuild and contains a space-separated
# list of dependency tokens each with a module and the module it depends on
# separated by a colon
# now extend REQUIRED_USE to reflect the module dependencies to portage
_apache2_set_module_depends() {
local dep
for dep in ${MODULE_DEPENDS} ; do
REQUIRED_USE+=" apache2_modules_${dep%:*}? ( apache2_modules_${dep#*:} )"
done
}
_apache2_set_module_depends
unset -f _apache2_set_module_depends
# ==============================================================================
# INTERNAL FUNCTIONS
# ==============================================================================
@ -135,16 +178,12 @@ setup_mpm() {
MY_MPM=""
for x in ${IUSE_MPMS} ; do
if use apache2_mpms_${x} ; then
if [[ -z "${MY_MPM}" ]] ; then
# there can at most be one MPM selected because of REQUIRED_USE constraints
MY_MPM=${x}
elog
elog "Selected MPM: ${MY_MPM}"
elog
else
eerror "You have selected more then one mpm USE-flag."
eerror "Only one MPM is supported."
die "more then one mpm was specified"
fi
break
fi
done
@ -161,20 +200,6 @@ setup_mpm() {
elog
fi
fi
if has ${MY_MPM} ${IUSE_MPMS_THREAD} && ! use threads ; then
eerror "You have selected a threaded MPM but USE=threads is disabled"
die "invalid use flag combination"
fi
if has ${MY_MPM} ${IUSE_MPMS_FORK} && use threads ; then
eerror "You have selected a non-threaded MPM but USE=threads is enabled"
die "invalid use flag combination"
fi
if [[ "${PV}" != 2.2* ]] && [[ "${MY_MPM}" = *prefork* ]] && use apache2_modules_http2 ; then
die "http2 does not work with prefork MPM."
fi
}
# @VARIABLE: MODULE_CRITICAL
@ -207,35 +232,6 @@ check_module_critical() {
fi
}
# @VARIABLE: MODULE_DEPENDS
# @DESCRIPTION:
# This variable needs to be set in the ebuild and contains a space-separated
# list of dependency tokens each with a module and the module it depends on
# separated by a colon
# @FUNCTION: check_module_depends
# @DESCRIPTION:
# This internal function makes sure that all inter-module dependencies are
# satisfied with the current module selection
check_module_depends() {
local err=0
for m in ${MY_MODS[@]} ; do
for dep in ${MODULE_DEPENDS} ; do
if [[ "${m}" == "${dep%:*}" ]] ; then
if ! use apache2_modules_${dep#*:} ; then
eerror "Module '${m}' depends on '${dep#*:}'"
err=1
fi
fi
done
done
if [[ ${err} -ne 0 ]] ; then
die "invalid use flag combination"
fi
}
# @ECLASS-VARIABLE: MY_CONF
# @DESCRIPTION:
# This internal variable contains the econf options for the current module
@ -316,7 +312,6 @@ setup_modules() {
# sort and uniquify MY_MODS
MY_MODS=( $(echo ${MY_MODS[@]} | tr ' ' '\n' | sort -u) )
check_module_depends
check_module_critical
}
@ -332,7 +327,7 @@ setup_modules() {
# This internal function generates the LoadModule lines for httpd.conf based on
# the current module selection and MODULE_DEFINES
generate_load_module() {
local endit=0 mod_lines= mod_dir="${ED}/usr/$(get_libdir)/apache2/modules"
local endit=0 mod_lines= mod_dir="${ED%/}/usr/$(get_libdir)/apache2/modules"
if use static; then
sed -i -e "/%%LOAD_MODULE%%/d" \
@ -534,24 +529,25 @@ apache-2_src_configure() {
# econf overwrites the stuff from config.layout, so we have to put them into
# our myconf line too
MY_CONF+=(
--includedir="${EPREFIX}"/usr/include/apache2
--libexecdir="${EPREFIX}"/usr/$(get_libdir)/apache2/modules
--datadir="${EPREFIX}"/var/www/localhost
--sysconfdir="${EPREFIX}"/etc/apache2
--localstatedir="${EPREFIX}"/var
--with-mpm=${MY_MPM}
--with-apr="${SYSROOT}${EPREFIX}"/usr
--with-apr-util="${SYSROOT}${EPREFIX}"/usr
--with-pcre="${T}"/pcre-config
--with-z="${EPREFIX}"/usr
--with-port=80
--with-program-name=apache2
--enable-layout=Gentoo
)
ac_cv_path_PKGCONFIG=${PKG_CONFIG} \
econf \
--includedir="${EPREFIX}"/usr/include/apache2 \
--libexecdir="${EPREFIX}"/usr/$(get_libdir)/apache2/modules \
--datadir="${EPREFIX}"/var/www/localhost \
--sysconfdir="${EPREFIX}"/etc/apache2 \
--localstatedir="${EPREFIX}"/var \
--with-mpm=${MY_MPM} \
--with-apr="${SYSROOT}${EPREFIX}"/usr \
--with-apr-util="${SYSROOT}${EPREFIX}"/usr \
--with-pcre="${T}"/pcre-config \
--with-z="${EPREFIX}"/usr \
--with-port=80 \
--with-program-name=apache2 \
--enable-layout=Gentoo \
"${MY_CONF[@]}"
econf "${MY_CONF[@]}"
sed -i -e 's:apache2\.conf:httpd.conf:' include/ap_config_auto.h
sed -i -e 's:apache2\.conf:httpd.conf:' include/ap_config_auto.h || die
}
# @FUNCTION: apache-2_src_install
@ -575,15 +571,15 @@ apache-2_src_install() {
# generate a sane default APACHE2_OPTS
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO"
use doc && APACHE2_OPTS="${APACHE2_OPTS} -D MANUAL"
use ssl && APACHE2_OPTS="${APACHE2_OPTS} -D SSL -D SSL_DEFAULT_VHOST"
use suexec && APACHE2_OPTS="${APACHE2_OPTS} -D SUEXEC"
use doc && APACHE2_OPTS+=" -D MANUAL"
use ssl && APACHE2_OPTS+=" -D SSL -D SSL_DEFAULT_VHOST"
use suexec && APACHE2_OPTS+=" -D SUEXEC"
if has negotiation ${APACHE2_MODULES} && use apache2_modules_negotiation; then
APACHE2_OPTS="${APACHE2_OPTS} -D LANGUAGE"
APACHE2_OPTS+=" -D LANGUAGE"
fi
sed -i -e "s:APACHE2_OPTS=\".*\":APACHE2_OPTS=\"${APACHE2_OPTS}\":" \
"${GENTOO_PATCHDIR}"/init/apache2.confd || die "sed failed"
"${GENTOO_PATCHDIR}"/init/apache2.confd || die
newconfd "${GENTOO_PATCHDIR}"/init/apache2.confd apache2
newinitd "${GENTOO_PATCHDIR}"/init/apache2.initd apache2
@ -605,19 +601,19 @@ apache-2_src_install() {
# drop in a convenient link to the manual
if use doc ; then
sed -i -e "s:VERSION:${PVR}:" "${ED}/etc/apache2/modules.d/00_apache_manual.conf"
sed -i -e "s:VERSION:${PVR}:" "${ED%/}/etc/apache2/modules.d/00_apache_manual.conf"
docompress -x /usr/share/doc/${PF}/manual # 503640
else
rm -f "${ED}/etc/apache2/modules.d/00_apache_manual.conf"
rm -Rf "${ED}/usr/share/doc/${PF}/manual"
rm -f "${ED%/}/etc/apache2/modules.d/00_apache_manual.conf"
rm -Rf "${ED%/}/usr/share/doc/${PF}/manual"
fi
# the default icons and error pages get stored in
# /usr/share/apache2/{error,icons}
dodir /usr/share/apache2
mv -f "${ED}/var/www/localhost/error" "${ED}/usr/share/apache2/error"
mv -f "${ED}/var/www/localhost/icons" "${ED}/usr/share/apache2/icons"
rm -rf "${ED}/var/www/localhost/"
mv -f "${ED%/}/var/www/localhost/error" "${ED%/}/usr/share/apache2/error"
mv -f "${ED%/}/var/www/localhost/icons" "${ED%/}/usr/share/apache2/icons"
rm -rf "${ED%/}/var/www/localhost/"
eend $?
# set some sane permissions for suexec

View File

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: autotools.eclass
@ -46,16 +46,20 @@ inherit libtool
# @INTERNAL
# @DESCRIPTION:
# CONSTANT!
# The latest major version/slot of automake available on each arch. #312315
# We should list both the latest stable, and the latest unstable. #465732
# This way the stable builds will still work, but the unstable are allowed
# to build & test things for us ahead of time (if they have it installed).
# The latest major unstable and stable version/slot of automake available
# on each arch.
# List latest unstable version first to boost testing adoption rate because
# most package manager dependency resolver will pick the first suitable
# version.
# If a newer slot is stable on any arch, and is NOT reflected in this list,
# then circular dependencies may arise during emerge @system bootstraps.
#
# See bug 312315 and 465732 for further information and context.
#
# Do NOT change this variable in your ebuilds!
# If you want to force a newer minor version, you can specify the correct
# WANT value by using a colon: <PV>:<WANT_AUTOMAKE>
_LATEST_AUTOMAKE=( 1.15:1.15 )
_LATEST_AUTOMAKE=( 1.16.1:1.16 1.15.1:1.15 )
_automake_atom="sys-devel/automake"
_autoconf_atom="sys-devel/autoconf"
@ -438,9 +442,17 @@ autotools_env_setup() {
if [[ ${WANT_AUTOMAKE} == "latest" ]]; then
local pv
for pv in ${_LATEST_AUTOMAKE[@]/#*:} ; do
# has_version respects ROOT, but in this case, we don't want it to,
# thus "ROOT=/" prefix:
ROOT=/ has_version "=sys-devel/automake-${pv}*" && export WANT_AUTOMAKE="${pv}"
# Break on first hit to respect _LATEST_AUTOMAKE order.
local hv_args=""
case ${EAPI:-0} in
5|6)
hv_args="--host-root"
;;
7)
hv_args="-b"
;;
esac
ROOT=/ has_version ${hv_args} "=sys-devel/automake-${pv}*" && export WANT_AUTOMAKE="${pv}" && break
done
[[ ${WANT_AUTOMAKE} == "latest" ]] && \
die "Cannot find the latest automake! Tried ${_LATEST_AUTOMAKE[*]}"

View File

@ -1,4 +1,4 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# DEPRECATED
@ -41,18 +41,21 @@ esac
EXPORT_FUNCTIONS ${BASE_EXPF}
# @ECLASS-VARIABLE: DOCS
# @DEFAULT_UNSET
# @DESCRIPTION:
# Array containing documents passed to dodoc command.
#
# DOCS=( "${S}/doc/document.txt" "${S}/doc/doc_folder/" )
# @ECLASS-VARIABLE: HTML_DOCS
# @DEFAULT_UNSET
# @DESCRIPTION:
# Array containing documents passed to dohtml command.
#
# HTML_DOCS=( "${S}/doc/document.html" "${S}/doc/html_folder/" )
# @ECLASS-VARIABLE: PATCHES
# @DEFAULT_UNSET
# @DESCRIPTION:
# PATCHES array variable containing all various patches to be applied.
# This variable is expected to be defined in global scope of ebuild.

View File

@ -1,4 +1,4 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: bash-completion-r1.eclass
@ -25,7 +25,7 @@
inherit toolchain-funcs
case ${EAPI:-0} in
0|1|2|3|4|5|6) ;;
0|1|2|3|4|5|6|7) ;;
*) die "EAPI ${EAPI} unsupported (yet)."
esac
@ -98,6 +98,7 @@ dobashcomp() {
debug-print-function ${FUNCNAME} "${@}"
(
insopts -m 0644
insinto "$(_bash-completion-r1_get_bashcompdir)"
doins "${@}"
)
@ -112,6 +113,7 @@ newbashcomp() {
debug-print-function ${FUNCNAME} "${@}"
(
insopts -m 0644
insinto "$(_bash-completion-r1_get_bashcompdir)"
newins "${@}"
)

View File

@ -1,410 +0,0 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# @ECLASS: bitcoincore.eclass
# @MAINTAINER:
# Luke Dashjr <luke_gentoo_bitcoin@dashjr.org>
# @BLURB: common code for Bitcoin Core ebuilds
# @DESCRIPTION:
# This eclass is used in Bitcoin Core ebuilds (bitcoin-qt, bitcoind,
# libbitcoinconsensus) to provide a single common place for the common ebuild
# stuff.
#
# The eclass provides all common dependencies as well as common use flags.
has "${EAPI:-0}" 5 || die "EAPI=${EAPI} not supported"
if [[ ! ${_BITCOINCORE_ECLASS} ]]; then
in_bcc_iuse() {
local liuse=( ${BITCOINCORE_IUSE} )
has "${1}" "${liuse[@]#[+-]}"
}
in_bcc_policy() {
local liuse=( ${BITCOINCORE_POLICY_PATCHES} )
has "${1}" "${liuse[@]#[+-]}"
}
DB_VER="4.8"
inherit autotools db-use eutils
if [ -z "$BITCOINCORE_COMMITHASH" ]; then
inherit git-2
fi
fi
EXPORT_FUNCTIONS src_prepare src_test src_install
if in_bcc_iuse ljr || in_bcc_iuse knots || in_bcc_iuse 1stclassmsg || in_bcc_iuse zeromq || [ -n "$BITCOINCORE_POLICY_PATCHES" ]; then
EXPORT_FUNCTIONS pkg_pretend
fi
if [[ ! ${_BITCOINCORE_ECLASS} ]]; then
# @ECLASS-VARIABLE: BITCOINCORE_COMMITHASH
# @DESCRIPTION:
# Set this variable before the inherit line, to the upstream commit hash.
# @ECLASS-VARIABLE: BITCOINCORE_IUSE
# @DESCRIPTION:
# Set this variable before the inherit line, to the USE flags supported.
# @ECLASS-VARIABLE: BITCOINCORE_LJR_DATE
# @DESCRIPTION:
# Set this variable before the inherit line, to the datestamp of the Knots
# patchset.
# @ECLASS-VARIABLE: BITCOINCORE_POLICY_PATCHES
# @DESCRIPTION:
# Set this variable before the inherit line, to a space-delimited list of
# supported policies.
MyPV="${PV/_/}"
MyPN="bitcoin"
MyP="${MyPN}-${MyPV}"
# These are expected to change in future versions
DOCS="${DOCS} doc/README.md doc/release-notes.md"
OPENSSL_DEPEND="dev-libs/openssl:0[-bindist]"
WALLET_DEPEND="sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]"
LIBEVENT_DEPEND=""
UNIVALUE_DEPEND=""
BITCOINCORE_LJR_NAME=ljr
BITCOINCORE_KNOTS_USE=knots
[ -n "${BITCOINCORE_LJR_PV}" ] || BITCOINCORE_LJR_PV="${PV}"
case "${PV}" in
0.13*)
BITCOINCORE_MINOR=$(get_version_component_range 2)
IUSE="${IUSE} libressl"
OPENSSL_DEPEND="!libressl? ( dev-libs/openssl:0[-bindist] ) libressl? ( dev-libs/libressl )"
if in_bcc_iuse libevent; then
LIBEVENT_DEPEND="libevent? ( dev-libs/libevent )"
else
LIBEVENT_DEPEND="dev-libs/libevent"
fi
LIBSECP256K1_DEPEND="=dev-libs/libsecp256k1-0.0.0_pre20151118[recovery]"
UNIVALUE_DEPEND="dev-libs/univalue"
BITCOINCORE_LJR_NAME=knots
if in_bcc_iuse ljr; then
BITCOINCORE_KNOTS_USE=ljr
fi
if in_bcc_policy spamfilter; then
REQUIRED_USE="${REQUIRED_USE} bitcoin_policy_spamfilter? ( ${BITCOINCORE_KNOTS_USE} )"
fi
;;
9999*)
BITCOINCORE_MINOR=9999
BITCOINCORE_SERIES="9999"
LIBEVENT_DEPEND="dev-libs/libevent"
LIBSECP256K1_DEPEND=">dev-libs/libsecp256k1-0.0.0_pre20150422"
UNIVALUE_DEPEND="dev-libs/univalue"
;;
*)
die "Unrecognised version"
;;
esac
[ -n "${BITCOINCORE_SERIES}" ] || BITCOINCORE_SERIES="0.${BITCOINCORE_MINOR}.x"
LJR_PV() {
local testsfx=
if [ -n "${BITCOINCORE_LJR_PREV}" ]; then
if [ "$1" = "dir" ]; then
testsfx="/test/${BITCOINCORE_LJR_PREV}"
else
testsfx=".${BITCOINCORE_LJR_PREV}"
fi
fi
echo "${BITCOINCORE_LJR_PV}.${BITCOINCORE_LJR_NAME}${BITCOINCORE_LJR_DATE}${testsfx}"
}
LJR_PATCHDIR="${MyPN}-$(LJR_PV ljr).patches"
LJR_PATCH() { echo "${WORKDIR}/${LJR_PATCHDIR}/${MyPN}-$(LJR_PV ljr).$@.patch"; }
LJR_PATCH_DESC="http://luke.dashjr.org/programs/${MyPN}/files/${MyPN}d/luke-jr/${BITCOINCORE_SERIES}/$(LJR_PV ljr)/${MyPN}-$(LJR_PV ljr).desc.txt"
if [ "$BITCOINCORE_MINOR" -ge 12 ]; then
LJR_PATCH_DESC="http://bitcoinknots.org/files/${BITCOINCORE_SERIES}/$(LJR_PV dir)/${MyPN}-$(LJR_PV).desc.html"
fi
HOMEPAGE="http://bitcoincore.org/"
if [ -z "$BITCOINCORE_COMMITHASH" ]; then
EGIT_PROJECT='bitcoin'
EGIT_REPO_URI="https://github.com/bitcoin/bitcoin.git"
else
SRC_URI="https://github.com/${MyPN}/${MyPN}/archive/${BITCOINCORE_COMMITHASH}.tar.gz -> ${MyPN}-v${PV}${BITCOINCORE_SRC_SUFFIX}.tgz"
if [ -z "${BITCOINCORE_NO_SYSLIBS}" ]; then
SRC_URI="${SRC_URI} http://bitcoinknots.org/files/${BITCOINCORE_SERIES}/$(LJR_PV dir)/${LJR_PATCHDIR}.txz -> ${LJR_PATCHDIR}.tar.xz"
fi
if in_bcc_iuse addrindex; then
SRC_URI="${SRC_URI} addrindex? ( https://github.com/btcdrak/bitcoin/compare/${BITCOINCORE_ADDRINDEX_DIFF}.diff -> ${BITCOINCORE_ADDRINDEX_PATCHFILE} )"
fi
if in_bcc_iuse xt; then
BITCOINXT_PATCHFILE="${MyPN}xt-v${PV}.patch"
SRC_URI="${SRC_URI} xt? ( https://github.com/bitcoinxt/bitcoinxt/compare/${BITCOINCORE_XT_DIFF}.diff -> ${BITCOINXT_PATCHFILE} )"
fi
if in_bcc_policy rbf && [ -n "${BITCOINCORE_RBF_DIFF}" ]; then
SRC_URI="${SRC_URI} bitcoin_policy_rbf? ( https://github.com/petertodd/bitcoin/compare/${BITCOINCORE_RBF_DIFF}.diff -> ${BITCOINCORE_RBF_PATCHFILE} )"
fi
S="${WORKDIR}/${MyPN}-${BITCOINCORE_COMMITHASH}"
fi
bitcoincore_policy_iuse() {
local mypolicy iuse_def new_BITCOINCORE_IUSE=
for mypolicy in ${BITCOINCORE_POLICY_PATCHES}; do
if [[ "${mypolicy:0:1}" =~ ^[+-] ]]; then
iuse_def=${mypolicy:0:1}
mypolicy="${mypolicy:1}"
else
iuse_def=
fi
new_BITCOINCORE_IUSE="$new_BITCOINCORE_IUSE ${iuse_def}bitcoin_policy_${mypolicy}"
done
echo $new_BITCOINCORE_IUSE
}
IUSE="$IUSE $BITCOINCORE_IUSE $(bitcoincore_policy_iuse)"
if in_bcc_policy rbf && in_bcc_iuse xt; then
REQUIRED_USE="${REQUIRED_USE} bitcoin_policy_rbf? ( !xt )"
fi
BITCOINCORE_COMMON_DEPEND="
${OPENSSL_DEPEND}
"
if ! has libevent ${BITCOINCORE_NO_DEPEND}; then
BITCOINCORE_COMMON_DEPEND="${BITCOINCORE_COMMON_DEPEND} ${LIBEVENT_DEPEND}"
fi
if [ "${BITCOINCORE_NEED_LIBSECP256K1}" = "1" ]; then
BITCOINCORE_COMMON_DEPEND="${BITCOINCORE_COMMON_DEPEND} $LIBSECP256K1_DEPEND"
fi
if [ "${PN}" = "libbitcoinconsensus" ]; then
DEPEND="$DEPEND ${BITCOINCORE_COMMON_DEPEND}
test? (
${UNIVALUE_DEPEND}
>=dev-libs/boost-1.52.0[threads(+)]
)
"
else
BITCOINCORE_COMMON_DEPEND="${BITCOINCORE_COMMON_DEPEND}
${UNIVALUE_DEPEND}
>=dev-libs/boost-1.52.0[threads(+)]
"
fi
bitcoincore_common_depend_use() {
in_bcc_iuse "$1" || return
BITCOINCORE_COMMON_DEPEND="${BITCOINCORE_COMMON_DEPEND} $1? ( $2 )"
}
bitcoincore_common_depend_use upnp net-libs/miniupnpc
bitcoincore_common_depend_use wallet "${WALLET_DEPEND}"
bitcoincore_common_depend_use zeromq net-libs/zeromq
RDEPEND="${RDEPEND} ${BITCOINCORE_COMMON_DEPEND}"
DEPEND="${DEPEND} ${BITCOINCORE_COMMON_DEPEND}
>=app-shells/bash-4.1
sys-apps/sed
"
if [ "${BITCOINCORE_NEED_LEVELDB}" = "1" ]; then
RDEPEND="${RDEPEND} virtual/bitcoin-leveldb"
fi
if in_bcc_iuse ${BITCOINCORE_KNOTS_USE}; then
if [ "${BITCOINCORE_LJR_NAME}" = "knots" ]; then
DEPEND="${DEPEND} ${BITCOINCORE_KNOTS_USE}? ( dev-lang/perl )"
fi
fi
bitcoincore_policymsg() {
local USEFlag="bitcoin_policy_$1"
in_iuse "${USEFlag}" || return
if use "${USEFlag}"; then
[ -n "$2" ] && einfo "$2"
else
[ -n "$3" ] && einfo "$3"
fi
bitcoincore_policymsg_flag=true
}
bitcoincore_pkg_pretend() {
bitcoincore_policymsg_flag=false
if use_if_iuse ${BITCOINCORE_KNOTS_USE} || use_if_iuse 1stclassmsg || use_if_iuse addrindex || use_if_iuse xt || { use_if_iuse zeromq && [ "${BITCOINCORE_MINOR}" -lt 12 ]; }; then
einfo "Extra functionality improvements to Bitcoin Core are enabled."
bitcoincore_policymsg_flag=true
if use_if_iuse addrindex addrindex; then
einfo "Please be aware that the addrindex functionality is known to be unreliable."
fi
fi
bitcoincore_policymsg cltv \
"CLTV policy is enabled: Your node will recognise and assist OP_CHECKLOCKTIMEVERIFY (BIP65) transactions." \
"CLTV policy is disabled: Your node will not recognise OP_CHECKLOCKTIMEVERIFY (BIP65) transactions."
bitcoincore_policymsg cpfp \
"CPFP policy is enabled: If you mine, you will give consideration to child transaction fees to pay for their parents." \
"CPFP policy is disabled: If you mine, you will ignore transactions unless they have sufficient fee themselves, even if child transactions offer a fee to cover their cost."
bitcoincore_policymsg dcmp \
"Data Carrier Multi-Push policy is enabled: Your node will assist transactions with at most a single multiple-'push' data carrier output." \
"Data Carrier Multi-Push policy is disabled: Your node will assist transactions with at most a single data carrier output with only a single 'push'."
bitcoincore_policymsg rbf \
"Replace By Fee policy is enabled: Your node will preferentially mine and relay transactions paying the highest fee, regardless of receive order." \
"Replace By Fee policy is disabled: Your node will only accept the first transaction seen consuming a conflicting input, regardless of fee offered by later ones."
bitcoincore_policymsg spamfilter \
"Enhanced spam filter policy is enabled: Your node will identify notorious spam scripts and avoid assisting them. This may impact your ability to use some services (see link for a list)." \
"Enhanced spam filter policy is disabled: Your node will not be checking for notorious spam scripts, and may assist them."
$bitcoincore_policymsg_flag && einfo "For more information on any of the above, see ${LJR_PATCH_DESC}"
}
bitcoincore_predelete_patch() {
local patchfile="$1"
mkdir -p "${WORKDIR}/pdp"
local tmpfile="${WORKDIR}/pdp/${patchfile##*/}"
perl -ne '
newline:
if (m[(^diff .* b/(.*)$)]) {
$a = "$1\n";
$f = $2;
$_ = <>;
if (m[^deleted file]) {
unlink($f) || die;
while (!m[^diff ]) {
$_ = <>
}
goto newline
} else {
print($a)
}
}
print
' <"${patchfile}" >"${tmpfile}" || die
epatch "${tmpfile}"
}
bitcoincore_prepare() {
local mypolicy
if [ -n "${BITCOINCORE_NO_SYSLIBS}" ]; then
true
elif [ "${PV}" = "9999" ]; then
epatch "${FILESDIR}/${PV}-syslibs.patch"
else
epatch "$(LJR_PATCH syslibs)"
fi
if use_if_iuse ${BITCOINCORE_KNOTS_USE}; then
if [ "${BITCOINCORE_LJR_NAME}" = "knots" ]; then
bitcoincore_predelete_patch "$(LJR_PATCH f)"
bitcoincore_predelete_patch "$(LJR_PATCH branding)"
epatch "$(LJR_PATCH ts)"
else
epatch "$(LJR_PATCH ljrF)"
fi
fi
if use_if_iuse 1stclassmsg; then
epatch "$(LJR_PATCH 1stclassmsg)"
fi
if use_if_iuse addrindex; then
epatch "${DISTDIR}/${BITCOINCORE_ADDRINDEX_PATCHFILE}"
fi
if use_if_iuse xt; then
epatch "${DISTDIR}/${BITCOINXT_PATCHFILE}"
fi
{ use_if_iuse zeromq && [ "${BITCOINCORE_MINOR}" -lt 12 ]; } && epatch "$(LJR_PATCH zeromq)"
for mypolicy in ${BITCOINCORE_POLICY_PATCHES}; do
mypolicy="${mypolicy#[-+]}"
if [ "${BITCOINCORE_MINOR}" -ge 12 ]; then
case "${mypolicy}" in
rbf)
use bitcoin_policy_rbf || sed -i 's/\(DEFAULT_ENABLE_REPLACEMENT = \)true/\1false/' src/main.h
;;
spamfilter)
use bitcoin_policy_spamfilter || sed -i 's/\(DEFAULT_SPAMFILTER = \)true/\1false/' src/main.h
;;
*)
die "Unknown policy ${mypolicy}"
esac
continue
fi
use bitcoin_policy_${mypolicy} || continue
case "${mypolicy}" in
rbf)
if [ -n "${BITCOINCORE_RBF_PATCHFILE}" ]; then
epatch "${DISTDIR}/${BITCOINCORE_RBF_PATCHFILE}"
else
epatch "$(LJR_PATCH ${mypolicy})"
fi
;;
*)
epatch "$(LJR_PATCH ${mypolicy})"
;;
esac
done
echo '#!/bin/true' >share/genbuild.sh
mkdir -p src/obj
echo "#define BUILD_SUFFIX gentoo${PVR#${PV}}" >src/obj/build.h
}
bitcoincore_autoreconf() {
eautoreconf
rm -r src/leveldb || die
rm -r src/secp256k1 || die
}
bitcoincore_src_prepare() {
bitcoincore_prepare
bitcoincore_autoreconf
}
bitcoincore_conf() {
local my_econf=
if use_if_iuse upnp; then
my_econf="${my_econf} --with-miniupnpc --enable-upnp-default"
else
my_econf="${my_econf} --without-miniupnpc --disable-upnp-default"
fi
if use_if_iuse test; then
my_econf="${my_econf} --enable-tests"
else
my_econf="${my_econf} --disable-tests"
fi
if use_if_iuse wallet; then
my_econf="${my_econf} --enable-wallet"
else
my_econf="${my_econf} --disable-wallet"
fi
if ! use_if_iuse zeromq; then
# NOTE: Older (pre-0.12) patches would disable ZMQ if --enable-zmq was passed
my_econf="${my_econf} --disable-zmq"
fi
if [ -z "${BITCOINCORE_NO_SYSLIBS}" ]; then
my_econf="${my_econf} --disable-util-cli --disable-util-tx"
else
my_econf="${my_econf} --without-utils"
fi
# Knots 0.12.0 errors if --with-libevent used for bitcoin{d,-cli}, so only disable it when not wanted
if has libevent ${BITCOINCORE_NO_DEPEND} || { in_bcc_iuse libevent && ! use libevent; }; then
my_econf="${my_econf} --without-libevent"
fi
if [ "${BITCOINCORE_NEED_LEVELDB}" = "1" ]; then
# Passing --with-system-leveldb fails if leveldb is not installed, so only use it for targets that use LevelDB
my_econf="${my_econf} --with-system-leveldb"
fi
econf \
--disable-bench \
--disable-ccache \
--disable-static \
--with-system-libsecp256k1 \
--with-system-univalue \
--without-libs \
--without-daemon \
--without-gui \
${my_econf} \
"$@"
}
bitcoincore_src_test() {
emake check
}
bitcoincore_src_install() {
default
[ "${PN}" = "libbitcoinconsensus" ] || rm "${D}/usr/bin/test_bitcoin"
}
_BITCOINCORE_ECLASS=1
fi

View File

@ -1,9 +1,9 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# @ECLASS: bzr.eclass
# @MAINTAINER:
# No maintainer <maintainer-needed@gentoo.org>
# Ulrich Müller <ulm@gentoo.org>
# @AUTHOR:
# Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>
# Mark Lee <bzr-gentoo-overlay@lazymalevolence.com>
@ -11,28 +11,28 @@
# Christian Faulhammer <fauli@gentoo.org>
# @BLURB: generic fetching functions for the Bazaar VCS
# @DESCRIPTION:
# The bzr.eclass provides functions to fetch, unpack, patch, and
# bootstrap sources from repositories of the Bazaar distributed version
# control system. The eclass was originally derived from git.eclass.
# The bzr.eclass provides functions to fetch and unpack sources from
# repositories of the Bazaar distributed version control system.
# The eclass was originally derived from git.eclass.
#
# Note: Just set EBZR_REPO_URI to the URI of the branch and src_unpack()
# of this eclass will export the branch to ${WORKDIR}/${P}.
inherit eutils
EBZR="bzr.eclass"
case "${EAPI:-0}" in
0|1) EXPORT_FUNCTIONS src_unpack ;;
*) EXPORT_FUNCTIONS src_unpack src_prepare ;;
if [[ ${EBZR_REPO_URI%%:*} = sftp ]]; then
DEPEND=">=dev-vcs/bzr-2.6.0[sftp]"
else
DEPEND=">=dev-vcs/bzr-2.6.0"
fi
case ${EAPI:-0} in
2|3|4|5|6) ;;
7) BDEPEND="${DEPEND}"; DEPEND="" ;;
*) die "${EBZR}: EAPI ${EAPI:-0} is not supported" ;;
esac
DEPEND=">=dev-vcs/bzr-2.0.1"
case "${EAPI:-0}" in
0|1) ;;
*) [[ ${EBZR_REPO_URI%%:*} = sftp ]] \
&& DEPEND=">=dev-vcs/bzr-2.0.1[sftp]" ;;
esac
EXPORT_FUNCTIONS src_unpack
# @ECLASS-VARIABLE: EBZR_STORE_DIR
# @DESCRIPTION:
@ -57,7 +57,7 @@ esac
# @ECLASS-VARIABLE: EBZR_UPDATE_CMD
# @DESCRIPTION:
# The Bazaar command to update the sources.
: ${EBZR_UPDATE_CMD:="bzr pull"}
: ${EBZR_UPDATE_CMD:="bzr pull --overwrite-tags"}
# @ECLASS-VARIABLE: EBZR_EXPORT_CMD
# @DESCRIPTION:
@ -85,9 +85,8 @@ esac
# @DESCRIPTION:
# The repository URI for the source package.
#
# Note: If the ebuild uses an sftp:// URI, then in EAPI 0 or 1 it must
# make sure that dev-vcs/bzr was built with USE="sftp". In EAPI 2 or
# later, the eclass will depend on dev-vcs/bzr[sftp].
# Note: If the ebuild uses an sftp:// URI, then the eclass will depend
# on dev-vcs/bzr[sftp].
# @ECLASS-VARIABLE: EBZR_INITIAL_URI
# @DEFAULT_UNSET
@ -100,21 +99,6 @@ esac
#
# Normally, this variable needs not be set.
# @ECLASS-VARIABLE: EBZR_BOOTSTRAP
# @DEFAULT_UNSET
# @DESCRIPTION:
# Bootstrap script or command like autogen.sh or etc.
# @ECLASS-VARIABLE: EBZR_PATCHES
# @DEFAULT_UNSET
# @DESCRIPTION:
# bzr.eclass can apply patches in bzr_bootstrap(). You can use regular
# expressions in this variable like *.diff or *.patch and the like.
# Note: These patches will be applied before EBZR_BOOTSTRAP is processed.
#
# Patches are searched both in ${PWD} and ${FILESDIR}. If not found in
# either location, the installation dies.
# @ECLASS-VARIABLE: EBZR_PROJECT
# @DESCRIPTION:
# The project name of your ebuild. Normally, the branch will be stored
@ -276,65 +260,9 @@ bzr_fetch() {
popd > /dev/null
}
# @FUNCTION: bzr_bootstrap
# @DESCRIPTION:
# Apply patches in ${EBZR_PATCHES} and run ${EBZR_BOOTSTRAP} if specified.
bzr_bootstrap() {
local patch lpatch
pushd "${S}" > /dev/null || die "${EBZR}: can't chdir to ${S}"
if [[ -n ${EBZR_PATCHES} ]] ; then
einfo "apply patches -->"
for patch in ${EBZR_PATCHES} ; do
if [[ -f ${patch} ]] ; then
epatch "${patch}"
else
# This loop takes care of wildcarded patches given via
# EBZR_PATCHES in an ebuild
for lpatch in "${FILESDIR}"/${patch} ; do
if [[ -f ${lpatch} ]] ; then
epatch "${lpatch}"
else
die "${EBZR}: ${patch} is not found"
fi
done
fi
done
fi
if [[ -n ${EBZR_BOOTSTRAP} ]] ; then
einfo "begin bootstrap -->"
if [[ -f ${EBZR_BOOTSTRAP} ]] && [[ -x ${EBZR_BOOTSTRAP} ]] ; then
einfo " bootstrap with a file: ${EBZR_BOOTSTRAP}"
"./${EBZR_BOOTSTRAP}" \
|| die "${EBZR}: can't execute EBZR_BOOTSTRAP"
else
einfo " bootstrap with commands: ${EBZR_BOOTSTRAP}"
"${EBZR_BOOTSTRAP}" \
|| die "${EBZR}: can't eval EBZR_BOOTSTRAP"
fi
fi
popd > /dev/null
}
# @FUNCTION: bzr_src_unpack
# @DESCRIPTION:
# Default src_unpack(), calls bzr_fetch. For EAPIs 0 and 1, also calls
# bzr_src_prepare.
# Default src_unpack(), calls bzr_fetch.
bzr_src_unpack() {
bzr_fetch
case "${EAPI:-0}" in
0|1) bzr_src_prepare ;;
esac
}
# @FUNCTION: bzr_src_prepare
# @DESCRIPTION:
# Default src_prepare(), calls bzr_bootstrap.
bzr_src_prepare() {
bzr_bootstrap
}

View File

@ -16,6 +16,8 @@ case ${EAPI} in
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
inherit multiprocessing
EXPORT_FUNCTIONS src_unpack src_compile src_install
IUSE="${IUSE} debug"
@ -117,7 +119,7 @@ cargo_src_compile() {
export CARGO_HOME="${ECARGO_HOME}"
cargo build -v $(usex debug "" --release) \
cargo build -v -j $(makeopts_jobs) $(usex debug "" --release) \
|| die "cargo build failed"
}
@ -127,7 +129,7 @@ cargo_src_compile() {
cargo_src_install() {
debug-print-function ${FUNCNAME} "$@"
cargo install --root="${D}/usr" $(usex debug --debug "") \
cargo install -j $(makeopts_jobs) --root="${D}/usr" $(usex debug --debug "") \
|| die "cargo install failed"
rm -f "${D}/usr/.crates.toml"

View File

@ -71,7 +71,12 @@ fi
# eclass, see that function's description.
cdrom_get_cds() {
unset CDROM_SET
export CDROM_CURRENT_CD=0 CDROM_CHECKS=( "${@}" )
export CDROM_CURRENT_CD=0
export CDROM_NUM_CDS="${#}"
local i
for i in $(seq ${#}); do
export CDROM_CHECK_${i}="${!i}"
done
# If the user has set CD_ROOT or CD_ROOT_1, don't bother informing
# them about which discs are needed as they presumably already know.
@ -190,7 +195,8 @@ cdrom_load_next_cd() {
local i cdset
: CD_ROOT_${CDROM_CURRENT_CD}
export CDROM_ROOT=${CD_ROOT:-${!_}}
IFS=: read -r -a cdset -d "" <<< "${CDROM_CHECKS[$((${CDROM_CURRENT_CD} - 1))]}"
local var="CDROM_CHECK_${CDROM_CURRENT_CD}"
IFS=: read -r -a cdset -d "" <<< "${!var}"
for i in $(seq ${CDROM_SET:-0} ${CDROM_SET:-$((${#cdset[@]} - 1))}); do
local f=${cdset[${i}]} point= node= fs= opts=
@ -222,7 +228,7 @@ cdrom_load_next_cd() {
fi
if [[ ${showedmsg} -eq 0 ]] ; then
if [[ ${#CDROM_CHECKS[@]} -eq 1 ]] ; then
if [[ ${CDROM_NUM_CDS} -eq 1 ]] ; then
einfo "Please insert+mount the ${CDROM_NAME:-CD for ${PN}} now !"
else
local var="CDROM_NAME_${CDROM_CURRENT_CD}"

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: check-reqs.eclass
@ -39,8 +39,6 @@
if [[ ! ${_CHECK_REQS_ECLASS_} ]]; then
inherit eutils
# @ECLASS-VARIABLE: CHECKREQS_MEMORY
# @DEFAULT_UNSET
# @DESCRIPTION:
@ -68,22 +66,11 @@ case "${EAPI:-0}" in
*) die "EAPI=${EAPI} is not supported" ;;
esac
# @FUNCTION: check_reqs
# @DESCRIPTION:
# Obsolete function executing all the checks and printing out results
check_reqs() {
debug-print-function ${FUNCNAME} "$@"
[[ ${EAPI:-0} == [012345] ]] || die "${FUNCNAME} is banned in EAPI > 5"
echo
eqawarn "Package calling old ${FUNCNAME} function."
eqawarn "Please file a bug against the package."
eqawarn "It should call check-reqs_pkg_pretend and check-reqs_pkg_setup"
eqawarn "and possibly use EAPI=4 or later."
echo
check-reqs_pkg_setup "$@"
eerror "Package calling old ${FUNCNAME} function."
eerror "It should call check-reqs_pkg_pretend and check-reqs_pkg_setup."
die "${FUNCNAME} is banned"
}
# @FUNCTION: check-reqs_pkg_setup
@ -176,10 +163,9 @@ check-reqs_get_kibibytes() {
local size=${1%[GMT]}
case ${unit} in
G) echo $((1024 * 1024 * size)) ;;
M) echo $((1024 * size)) ;;
G) echo $((1024 * 1024 * size)) ;;
T) echo $((1024 * 1024 * 1024 * size)) ;;
[0-9]) echo $((1024 * size)) ;;
*)
die "${FUNCNAME}: Unknown unit: ${unit}"
;;
@ -196,17 +182,8 @@ check-reqs_get_number() {
[[ -z ${1} ]] && die "Usage: ${FUNCNAME} [size]"
local unit=${1:(-1)}
local size=${1%[GMT]}
local msg=eerror
[[ ${EAPI:-0} == [012345] ]] && msg=eqawarn
# Check for unset units and warn about them.
# Backcompat.
if [[ ${size} == ${1} ]]; then
${msg} "Package does not specify unit for the size check"
${msg} "File bug against the package. It should specify the unit."
fi
[[ ${size} == ${1} ]] && die "${FUNCNAME}: Missing unit: ${1}"
echo ${size}
}
@ -224,8 +201,8 @@ check-reqs_get_unit() {
local unit=${1:(-1)}
case ${unit} in
M) echo "MiB" ;;
G) echo "GiB" ;;
[M0-9]) echo "MiB" ;;
T) echo "TiB" ;;
*)
die "${FUNCNAME}: Unknown unit: ${unit}"

View File

@ -71,15 +71,13 @@ chromium_remove_language_paks() {
# Look for missing pak files.
for lang in ${CHROMIUM_LANGS}; do
if [[ ! -e ${lang}.pak ]]; then
# https://bugs.gentoo.org/583762
if [[ ${lang} != sr-ME || ! -e me.pak ]]; then
eqawarn "L10N warning: no .pak file for ${lang} (${lang}.pak not found)"
fi
fi
done
# Bug 588198
rm -f fake-bidi.pak || die
rm -f fake-bidi.pak.info || die
# Look for extra pak files.
# Remove pak files that the user does not want.
@ -90,22 +88,14 @@ chromium_remove_language_paks() {
continue
fi
# https://bugs.gentoo.org/583762
if [[ ${lang} == me ]]; then
if ! has sr-ME ${CHROMIUM_LANGS}; then
eqawarn "L10N warning: no sr-ME in LANGS"
elif ! use l10n_sr-ME; then
rm "${pak}" || die
fi
continue
fi
if ! has ${lang} ${CHROMIUM_LANGS}; then
eqawarn "L10N warning: no ${lang} in LANGS"
continue
fi
if ! use l10n_${lang}; then
rm "${pak}" || die
rm -f "${pak}.info" || die
fi
done
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: cmake-utils.eclass
@ -9,6 +9,7 @@
# Maciej Mrozowski <reavertm@gentoo.org>
# (undisclosed contributors)
# Original author: Zephyrus (zephyrus@mirach.it)
# @SUPPORTED_EAPIS: 5 6
# @BLURB: common ebuild functions for cmake-based packages
# @DESCRIPTION:
# The cmake-utils eclass makes creating ebuilds for cmake-based packages much easier.
@ -44,6 +45,7 @@ _CMAKE_UTILS_ECLASS=1
: ${CMAKE_BUILD_TYPE:=Gentoo}
# @ECLASS-VARIABLE: CMAKE_IN_SOURCE_BUILD
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set to enable in-source build.
@ -56,7 +58,7 @@ _CMAKE_UTILS_ECLASS=1
# @ECLASS-VARIABLE: CMAKE_MIN_VERSION
# @DESCRIPTION:
# Specify the minimum required CMake version.
: ${CMAKE_MIN_VERSION:=3.7.2}
: ${CMAKE_MIN_VERSION:=3.9.6}
# @ECLASS-VARIABLE: CMAKE_REMOVE_MODULES
# @DESCRIPTION:
@ -88,12 +90,14 @@ _CMAKE_UTILS_ECLASS=1
# "no" to disable (default) or anything else to enable.
# @ECLASS-VARIABLE: CMAKE_EXTRA_CACHE_FILE
# @DEFAULT_UNSET
# @DESCRIPTION:
# Specifies an extra cache file to pass to cmake. This is the analog of EXTRA_ECONF
# for econf and is needed to pass TRY_RUN results when cross-compiling.
# Should be set by user in a per-package basis in /etc/portage/package.env.
# @ECLASS-VARIABLE: CMAKE_UTILS_QA_SRC_DIR_READONLY
# @DEFAULT_UNSET
# @DESCRIPTION:
# After running cmake-utils_src_prepare, sets ${S} to read-only. This is
# a user flag and should under _no circumstances_ be set in the ebuild.
@ -105,8 +109,12 @@ case ${EAPI} in
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
inherit toolchain-funcs multilib ninja-utils flag-o-matic eutils \
multiprocessing versionator
inherit toolchain-funcs ninja-utils flag-o-matic multiprocessing xdg-utils
case ${EAPI} in
7) ;;
*) inherit eapi7-ver eutils multilib ;;
esac
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
@ -487,7 +495,7 @@ cmake-utils_src_configure() {
_cmake_check_build_dir
# Fix xdg collision with sandbox
local -x XDG_CONFIG_HOME="${T}"
xdg_environment_reset
# @SEE CMAKE_BUILD_TYPE
if [[ ${CMAKE_BUILD_TYPE} = Gentoo ]]; then
@ -504,7 +512,7 @@ cmake-utils_src_configure() {
# we need to add "<INCLUDES>"
local includes=
if [[ ${PN} == cmake ]] ; then
if $(version_is_at_least 3.4.0 $(get_version_component_range 1-3 ${PV})) ; then
if $(ver_test $(ver_cut 1-3 ${PV}) -ge 3.4.0) ; then
includes="<INCLUDES>"
fi
elif ROOT=/ has_version \>=dev-util/cmake-3.4.0_rc1 ; then
@ -512,6 +520,8 @@ cmake-utils_src_configure() {
fi
cat > "${build_rules}" <<- _EOF_ || die
SET (CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE)
SET (CMAKE_ASM-ATT_COMPILE_OBJECT "<CMAKE_ASM-ATT_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c -x assembler <SOURCE>" CACHE STRING "ASM-ATT compile command" FORCE)
SET (CMAKE_ASM-ATT_LINK_FLAGS "-nostdlib" CACHE STRING "ASM-ATT link flags" FORCE)
SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE)
SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE)
SET (CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> <DEFINES> ${includes} ${FCFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "Fortran compile command" FORCE)
@ -527,6 +537,7 @@ cmake-utils_src_configure() {
local toolchain_file=${BUILD_DIR}/gentoo_toolchain.cmake
cat > ${toolchain_file} <<- _EOF_ || die
SET (CMAKE_ASM_COMPILER "${myCC/ /;}")
SET (CMAKE_ASM-ATT_COMPILER "${myCC/ /;}")
SET (CMAKE_C_COMPILER "${myCC/ /;}")
SET (CMAKE_CXX_COMPILER "${myCXX/ /;}")
SET (CMAKE_Fortran_COMPILER "${myFC/ /;}")
@ -562,10 +573,10 @@ cmake-utils_src_configure() {
# When cross-compiling with a sysroot (e.g. with crossdev's emerge wrappers)
# we need to tell cmake to use libs/headers from the sysroot but programs from / only.
cat >> "${toolchain_file}" <<- _EOF_ || die
set(CMAKE_FIND_ROOT_PATH "${SYSROOT}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET (CMAKE_FIND_ROOT_PATH "${SYSROOT}")
SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
_EOF_
fi
fi
@ -582,12 +593,10 @@ cmake-utils_src_configure() {
ELSE ()
SET (CMAKE_PREFIX_PATH "${EPREFIX}/usr" CACHE STRING "" FORCE)
SET (CMAKE_MACOSX_RPATH ON CACHE BOOL "" 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 "")
SET(CMAKE_INSTALL_RPATH "${EPREFIX}/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}/usr/lib" CACHE STRING "" FORCE)
ENDIF (NOT APPLE)
_EOF_
@ -600,13 +609,22 @@ cmake-utils_src_configure() {
SET (CMAKE_GENTOO_BUILD ON CACHE BOOL "Indicate Gentoo package build")
SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE)
SET (CMAKE_INSTALL_LIBDIR ${libdir} CACHE PATH "Output directory for libraries")
SET (CMAKE_INSTALL_INFODIR "${EPREFIX}/usr/share/info" CACHE PATH "")
SET (CMAKE_INSTALL_MANDIR "${EPREFIX}/usr/share/man" CACHE PATH "")
_EOF_
[[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}"
if [[ ${EAPI} != [56] ]]; then
cat >> "${common_config}" <<- _EOF_ || die
SET (CMAKE_INSTALL_DOCDIR "${EPREFIX}/usr/share/doc/${PF}" CACHE PATH "")
_EOF_
fi
# Wipe the default optimization flags out of CMake
if [[ ${CMAKE_BUILD_TYPE} != Gentoo && ${EAPI} != 5 ]]; then
cat >> ${common_config} <<- _EOF_ || die
SET (CMAKE_ASM_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_ASM-ATT_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
SET (CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
@ -641,7 +659,7 @@ cmake-utils_src_configure() {
fi
# Common configure parameters (overridable)
# NOTE CMAKE_BUILD_TYPE can be only overriden via CMAKE_BUILD_TYPE eclass variable
# NOTE CMAKE_BUILD_TYPE can be only overridden via CMAKE_BUILD_TYPE eclass variable
# No -DCMAKE_BUILD_TYPE=xxx definitions will be in effect.
local cmakeargs=(
${warn_unused_cli}

View File

@ -14,7 +14,7 @@ inherit eutils
# @ECLASS-VARIABLE: CLIMPLEMENTATIONS
# @DESCRIPTION:
# Common Lisp implementations
CLIMPLEMENTATIONS="sbcl clisp clozurecl cmucl ecls gcl"
CLIMPLEMENTATIONS="sbcl clisp clozurecl cmucl ecls gcl abcl"
# @ECLASS-VARIABLE: CLSOURCEROOT
# @DESCRIPTION:
@ -194,6 +194,11 @@ common-lisp-export-impl-args() {
fi
CL_BINARY="${1}"
case "${CL_BINARY}" in
sbcl)
CL_NORC="--sysinit /dev/null --userinit /dev/null"
CL_LOAD="--load"
CL_EVAL="--eval"
;;
clisp)
CL_NORC="-norc"
CL_LOAD="-i"
@ -216,8 +221,8 @@ common-lisp-export-impl-args() {
CL_LOAD="-load"
CL_EVAL="-eval"
;;
sbcl)
CL_NORC="--sysinit /dev/null --userinit /dev/null"
abcl)
CL_NORC="--noinit"
CL_LOAD="--load"
CL_EVAL="--eval"
;;

View File

@ -1,211 +0,0 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: common-lisp-common.eclass
# @MAINTAINER:
# Common Lisp project <common-lisp@gentoo.org>
# @AUTHOR: Matthew Kennedy <mkennedy@gentoo.org>
# @BLURB: eclass for installing Common Lisp packages.
# @DESCRIPTION:
# Sundry code common to many Common Lisp related ebuilds.
inherit eutils multilib
# Some handy constants
CLFASLROOT=/usr/$(get_libdir)/common-lisp/
CLSOURCEROOT=/usr/share/common-lisp/source/
CLSYSTEMROOT=/usr/share/common-lisp/systems/
# Many of our Common Lisp ebuilds are either inspired by, or actually
# use packages and files from the Debian project's archives.
do-debian-credits() {
docinto debian
for i in copyright README.Debian changelog; do
# be silent, since all files are not always present
dodoc "${S}"/debian/${i} &>/dev/null || true
done
docinto .
}
# Most of the code below is from Debian's Common Lisp Controller
# package
register-common-lisp-implementation() {
PROGNAME=$(basename $0)
# first check if there is at least a compiler-name:
if [ -z "$1" ] ; then
cat <<EOF
usage: $PROGNAME compiler-name
registers a Common Lisp compiler to the
Common-Lisp-Controller system.
EOF
exit 1
fi
IMPL=$1
FILE="/usr/$(get_libdir)/common-lisp/bin/$IMPL.sh"
if [ ! -f "$FILE" ] ; then
cat <<EOF
$PROGNAME: I cannot find the script $FILE for the implementation $IMPL
EOF
exit 2
fi
if [ ! -r "$FILE" ] ; then
cat <<EOF
$PROGNAME: I cannot read the script $FILE for the implementation $IMPL
EOF
exit 2
fi
# install CLC into the lisp
sh "$FILE" install-clc || (echo "Installation of CLC failed" >&2 ; exit 3)
mkdir /usr/$(get_libdir)/common-lisp/$IMPL &>/dev/null || true
chown cl-builder:cl-builder /usr/$(get_libdir)/common-lisp/$IMPL
# now recompile the stuff
for i in /usr/share/common-lisp/systems/*.asd ; do
if [ -f $i -a -r $i ] ; then
i=${i%.asd}
package=${i##*/}
clc-autobuild-check $IMPL $package
if [ $? = 0 ]; then
echo recompiling package $package for implementation $IMPL
/usr/bin/clc-send-command --quiet recompile $package $IMPL
fi
fi
done
for i in /usr/share/common-lisp/systems/*.system ; do
if [ -f $i -a -r $i ] ; then
i=${i%.system}
package=${i##*/}
clc-autobuild-check $IMPL $package
if [ $? = 0 ]; then
echo recompiling package $package for implementation $IMPL
/usr/bin/clc-send-command --quiet recompile $package $IMPL
fi
fi
done
echo "$PROGNAME: Compiler $IMPL installed"
}
unregister-common-lisp-implementation() {
PROGNAME=$(basename $0)
if [ `id -u` != 0 ] ; then
echo $PROGNAME: you need to be root to run this program
exit 1
fi
if [ -z "$1" ] ; then
cat <<EOF
usage: $PROGNAME compiler-name
un-registers a Common Lisp compiler to the
Common-Lisp-Controller system.
EOF
exit 1
fi
IMPL=$1
IMPL_BIN="/usr/$(get_libdir)/common-lisp/bin/$IMPL.sh"
if [ ! -f "$IMPL_BIN" ] ; then
cat <<EOF
$PROGNAME: No implementation of the name $IMPL is registered
Cannot find the file $IMPL_BIN
Maybe you already removed it?
EOF
exit 0
fi
if [ ! -r "$IMPL_BIN" ] ; then
cat <<EOF
$PROGNAME: No implementation of the name $IMPL is registered
Cannot read the file $IMPL_BIN
Maybe you already removed it?
EOF
exit 0
fi
# Uninstall the CLC
sh $IMPL_BIN remove-clc || echo "De-installation of CLC failed" >&2
clc-autobuild-impl $IMPL inherit
# Just remove the damn subtree
(cd / ; rm -rf "/usr/$(get_libdir)/common-lisp/$IMPL/" ; true )
echo "$PROGNAME: Common Lisp implementation $IMPL uninstalled"
}
reregister-all-common-lisp-implementations() {
# Rebuilds all common lisp implementations
# Written by Kevin Rosenberg <kmr@debian.org>
# GPL-2 license
local clc_bin_dir=/usr/$(get_libdir)/common-lisp/bin
local opt=$(shopt nullglob); shopt -s nullglob
cd $clc_bin_dir
for impl_bin in *.sh; do
impl=$(echo $impl_bin | sed 's/\(.*\).sh/\1/')
unregister-common-lisp-implementation $impl
register-common-lisp-implementation $impl
done
cd - >/dev/null
[[ $opt = *off ]] && shopt -u nullglob
}
# BIG FAT HACK: Since the Portage emerge step kills file timestamp
# information, we need to compensate by ensuring all FASL files are
# more recent than their source files.
# The following `impl-*-timestamp-hack' functions SHOULD NOT be used
# outside of this eclass.
impl-save-timestamp-hack() {
local impl=$1
dodir /usr/share/${impl}
tar cpjf "${D}"/usr/share/${impl}/portage-timestamp-compensate -C "${D}"/usr/$(get_libdir)/${impl} .
}
impl-restore-timestamp-hack() {
local impl=$1
tar xjpfo /usr/share/${impl}/portage-timestamp-compensate -C /usr/$(get_libdir)/${impl}
}
impl-remove-timestamp-hack() {
local impl=$1
rm -rf /usr/$(get_libdir)/${impl} &>/dev/null || true
}
test-in() {
local symbol=$1
shift
for i in $@; do
if [ $i == ${symbol} ]; then
return 0 # true
fi
done
false
}
standard-impl-postinst() {
local impl=$1
rm -rf /usr/$(get_libdir)/common-lisp/${impl}/* &>/dev/null || true
chown cl-builder:cl-builder /usr/$(get_libdir)/common-lisp/${impl}
if test-in ${impl} cmucl sbcl; then
impl-restore-timestamp-hack ${impl}
fi
chown -R root:0 /usr/$(get_libdir)/${impl}
/usr/bin/clc-autobuild-impl ${impl} yes
register-common-lisp-implementation ${impl}
}
standard-impl-postrm() {
local impl=$1 impl_binary=$2
# Since we keep our own time stamps we must manually remove them
# here.
if [ ! -x ${impl_binary} ]; then
if test-in ${impl} cmucl sbcl; then
impl-remove-timestamp-hack ${impl}
fi
rm -rf /usr/$(get_libdir)/common-lisp/${impl}/*
fi
}
# Local Variables: ***
# mode: shell-script ***
# tab-width: 4 ***
# End: ***

View File

@ -1,81 +0,0 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: common-lisp.eclass
# @MAINTAINER:
# Common Lisp project <common-lisp@gentoo.org>
# @AUTHOR: Matthew Kennedy <mkennedy@gentoo.org>
# @BLURB: eclass for installing Common Lisp packages.
# @DESCRIPTION:
# This eclass supports the common-lisp-controller installation of many
# Common Lisp libraries
inherit common-lisp-common
CLPACKAGE=
DEPEND="dev-lisp/common-lisp-controller"
EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm
common-lisp_pkg_postinst() {
if [ -z "${CLPACKAGE}" ]; then
die "CLPACKAGE was empty or undefined upon call to pkg_prerm"
else
for package in ${CLPACKAGE}; do
einfo "Registering Common Lisp source for ${package}"
register-common-lisp-source ${package}
done
fi
}
common-lisp_pkg_postrm() {
if [ -z "${CLPACKAGE}" ]; then
die "CLPACKAGE was empty or undefined upon call to pkg_prerm"
else
for package in ${CLPACKAGE}; do
if [ ! -d ${CLSOURCEROOT}/${package} ]; then
einfo "Unregistering Common Lisp source for ${package}"
# rm -rf ${CLFASLROOT}/*/${package}
unregister-common-lisp-source ${package}
fi
done
fi
}
#
# In pkg_preinst, we remove the FASL files for the previous version of
# the source.
#
common-lisp_pkg_preinst() {
if [ -z "${CLPACKAGE}" ]; then
die "CLPACKAGE was empty or undefined upon call to pkg_preinst"
else
for package in ${CLPACKAGE}; do
einfo "Removing FASL files for previous version of Common Lisp package ${package}"
rm -rf ${CLFASLROOT}/*/${package} || true
done
fi
}
common-lisp-install() {
insinto ${CLSOURCEROOT}/${CLPACKAGE}
doins $@
}
common-lisp-system-symlink() {
dodir ${CLSYSTEMROOT}/`dirname ${CLPACKAGE}`
if [ $# -eq 0 ]; then
dosym ${CLSOURCEROOT}/${CLPACKAGE}/${CLPACKAGE}.asd \
${CLSYSTEMROOT}/${CLPACKAGE}.asd
else
for package in "$@" ; do
dosym ${CLSOURCEROOT}/$CLPACKAGE/${package}.asd \
${CLSYSTEMROOT}/${package}.asd
done
fi
}
# Local Variables: ***
# mode: shell-script ***
# tab-width: 4 ***
# End: ***

View File

@ -1,4 +1,4 @@
# Copyright 1999-2011 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: cron.eclass
@ -155,6 +155,6 @@ cron_pkg_postinst() {
einfo "You may wish to read the Gentoo Linux Cron Guide, which can be"
einfo "found online at:"
einfo " https://www.gentoo.org/doc/en/cron-guide.xml"
einfo " https://wiki.gentoo.org/wiki/Cron"
echo
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: db.eclass
@ -17,7 +17,8 @@ DEPEND="test? ( >=dev-lang/tcl-8.4 )"
RDEPEND=""
db_fix_so() {
LIB="${ROOT}/usr/$(get_libdir)"
has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
LIB="${EROOT}/usr/$(get_libdir)"
cd "${LIB}"
@ -50,7 +51,7 @@ db_fix_so() {
# do the same for headers now
# but since there are only two of them, just overwrite them
cd "${ROOT}"/usr/include
cd "${EROOT}"/usr/include
target=`find . -maxdepth 1 -type d -name 'db[0-9]*' | sort -n |cut -d/ -f2- | tail -n1`
if [ -n "${target}" ] && [ -e "${target}/db.h" ] && ( ! [[ -e db.h ]] || [[ -h db.h ]] ); then
einfo "Creating db.h symlinks to ${target}"
@ -67,19 +68,21 @@ db_fix_so() {
}
db_src_install_doc() {
has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
# not everybody wants this wad of documentation as it is primarily API docs
if use doc; then
dodir /usr/share/doc/${PF}/html
mv "${D}"/usr/docs/* "${D}"/usr/share/doc/${PF}/html/
rm -rf "${D}"/usr/docs
mv "${ED}"/usr/docs/* "${ED}"/usr/share/doc/${PF}/html/
rm -rf "${ED}"/usr/docs
else
rm -rf "${D}"/usr/docs
rm -rf "${ED}"/usr/docs
fi
db_src_install_examples
}
db_src_install_examples() {
has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
if use examples ; then
local langs="c cxx stl"
[[ "${IUSE/java}" != "${IUSE}" ]] \
@ -90,15 +93,16 @@ db_src_install_examples() {
src="${S}/../examples_${i}/"
if [ -f "${src}" ]; then
dodir "${destdir}"
cp -ra "${src}" "${D}${destdir}/"
cp -ra "${src}" "${ED}${destdir}/"
fi
done
fi
}
db_src_install_usrbinslot() {
has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
# slot all program names to avoid overwriting
for fname in "${D}"/usr/bin/db*
for fname in "${ED}"/usr/bin/db*
do
dn="$(dirname "${fname}")"
bn="$(basename "${fname}")"
@ -109,18 +113,20 @@ db_src_install_usrbinslot() {
}
db_src_install_headerslot() {
has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
# install all headers in a slotted location
dodir /usr/include/db${SLOT}
mv "${D}"/usr/include/*.h "${D}"/usr/include/db${SLOT}/
mv "${ED}"/usr/include/*.h "${ED}"/usr/include/db${SLOT}/
}
db_src_install_usrlibcleanup() {
LIB="${D}/usr/$(get_libdir)"
has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
LIB="${ED}/usr/$(get_libdir)"
# Clean out the symlinks so that they will not be recorded in the
# contents (bug #60732)
if [ "${D}" = "" ]; then
die "Calling clean_links while \$D not defined"
if [ "${ED}" = "" ]; then
die "Calling clean_links while \$ED not defined"
fi
if [ -e "${LIB}"/libdb.a ] && [ ! -e "${LIB}"/libdb-${SLOT}.a ]; then
@ -139,7 +145,7 @@ db_src_install_usrlibcleanup() {
find "${LIB}" -maxdepth 1 -type l -name 'libdb[1._-]*a' -exec rm \{} \;
rm -f \
"${D}"/usr/include/{db,db_185}.h \
"${ED}"/usr/include/{db,db_185}.h \
"${LIB}"/libdb{,_{cxx,sql,stl,java,tcl}}.a
}

View File

@ -0,0 +1,400 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: desktop.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @BLURB: support for desktop files, menus, and icons
if [[ -z ${_DESKTOP_ECLASS} ]]; then
_DESKTOP_ECLASS=1
# @FUNCTION: make_desktop_entry
# @USAGE: make_desktop_entry(<command>, [name], [icon], [type], [fields])
# @DESCRIPTION:
# Make a .desktop file.
#
# @CODE
# binary: what command does the app run with ?
# name: the name that will show up in the menu
# icon: the icon to use in the menu entry
# this can be relative (to /usr/share/pixmaps) or
# a full path to an icon
# type: what kind of application is this?
# for categories:
# https://specifications.freedesktop.org/menu-spec/latest/apa.html
# if unset, function tries to guess from package's category
# fields: extra fields to append to the desktop file; a printf string
# @CODE
make_desktop_entry() {
[[ -z $1 ]] && die "make_desktop_entry: You must specify the executable"
local exec=${1}
local name=${2:-${PN}}
local icon=${3:-${PN}}
local type=${4}
local fields=${5}
if [[ -z ${type} ]] ; then
local catmaj=${CATEGORY%%-*}
local catmin=${CATEGORY##*-}
case ${catmaj} in
app)
case ${catmin} in
accessibility) type="Utility;Accessibility";;
admin) type=System;;
antivirus) type=System;;
arch) type="Utility;Archiving";;
backup) type="Utility;Archiving";;
cdr) type="AudioVideo;DiscBurning";;
dicts) type="Office;Dictionary";;
doc) type=Documentation;;
editors) type="Utility;TextEditor";;
emacs) type="Development;TextEditor";;
emulation) type="System;Emulator";;
laptop) type="Settings;HardwareSettings";;
office) type=Office;;
pda) type="Office;PDA";;
vim) type="Development;TextEditor";;
xemacs) type="Development;TextEditor";;
esac
;;
dev)
type="Development"
;;
games)
case ${catmin} in
action|fps) type=ActionGame;;
arcade) type=ArcadeGame;;
board) type=BoardGame;;
emulation) type=Emulator;;
kids) type=KidsGame;;
puzzle) type=LogicGame;;
roguelike) type=RolePlaying;;
rpg) type=RolePlaying;;
simulation) type=Simulation;;
sports) type=SportsGame;;
strategy) type=StrategyGame;;
esac
type="Game;${type}"
;;
gnome)
type="Gnome;GTK"
;;
kde)
type="KDE;Qt"
;;
mail)
type="Network;Email"
;;
media)
case ${catmin} in
gfx)
type=Graphics
;;
*)
case ${catmin} in
radio) type=Tuner;;
sound) type=Audio;;
tv) type=TV;;
video) type=Video;;
esac
type="AudioVideo;${type}"
;;
esac
;;
net)
case ${catmin} in
dialup) type=Dialup;;
ftp) type=FileTransfer;;
im) type=InstantMessaging;;
irc) type=IRCClient;;
mail) type=Email;;
news) type=News;;
nntp) type=News;;
p2p) type=FileTransfer;;
voip) type=Telephony;;
esac
type="Network;${type}"
;;
sci)
case ${catmin} in
astro*) type=Astronomy;;
bio*) type=Biology;;
calc*) type=Calculator;;
chem*) type=Chemistry;;
elec*) type=Electronics;;
geo*) type=Geology;;
math*) type=Math;;
physics) type=Physics;;
visual*) type=DataVisualization;;
esac
type="Education;Science;${type}"
;;
sys)
type="System"
;;
www)
case ${catmin} in
client) type=WebBrowser;;
esac
type="Network;${type}"
;;
*)
type=
;;
esac
fi
local slot=${SLOT%/*}
if [[ ${slot} == "0" ]] ; then
local desktop_name="${PN}"
else
local desktop_name="${PN}-${slot}"
fi
local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop"
#local desktop=${T}/${exec%% *:-${desktop_name}}.desktop
# Don't append another ";" when a valid category value is provided.
type=${type%;}${type:+;}
if [[ -n ${icon} && ${icon} != /* ]] && [[ ${icon} == *.xpm || ${icon} == *.png || ${icon} == *.svg ]]; then
ewarn "As described in the Icon Theme Specification, icon file extensions are not"
ewarn "allowed in .desktop files if the value is not an absolute path."
icon=${icon%.*}
fi
cat <<-EOF > "${desktop}"
[Desktop Entry]
Name=${name}
Type=Application
Comment=${DESCRIPTION}
Exec=${exec}
TryExec=${exec%% *}
Icon=${icon}
Categories=${type}
EOF
if [[ ${fields:-=} != *=* ]] ; then
# 5th arg used to be value to Path=
ewarn "make_desktop_entry: update your 5th arg to read Path=${fields}"
fields="Path=${fields}"
fi
[[ -n ${fields} ]] && printf '%b\n' "${fields}" >> "${desktop}"
(
# wrap the env here so that the 'insinto' call
# doesn't corrupt the env of the caller
insopts -m 0644
insinto /usr/share/applications
doins "${desktop}"
) || die "installing desktop file failed"
}
# @FUNCTION: make_session_desktop
# @USAGE: <title> <command> [command args...]
# @DESCRIPTION:
# Make a GDM/KDM Session file. The title is the file to execute to start the
# Window Manager. The command is the name of the Window Manager.
#
# You can set the name of the file via the ${wm} variable.
make_session_desktop() {
[[ -z $1 ]] && eerror "$0: You must specify the title" && return 1
[[ -z $2 ]] && eerror "$0: You must specify the command" && return 1
local title=$1
local command=$2
local desktop=${T}/${wm:-${PN}}.desktop
shift 2
cat <<-EOF > "${desktop}"
[Desktop Entry]
Name=${title}
Comment=This session logs you into ${title}
Exec=${command} $*
TryExec=${command}
Type=XSession
EOF
(
# wrap the env here so that the 'insinto' call
# doesn't corrupt the env of the caller
insopts -m 0644
insinto /usr/share/xsessions
doins "${desktop}"
)
}
# @FUNCTION: domenu
# @USAGE: <menus>
# @DESCRIPTION:
# Install the list of .desktop menu files into the appropriate directory
# (/usr/share/applications).
domenu() {
(
# wrap the env here so that the 'insinto' call
# doesn't corrupt the env of the caller
local i j ret=0
insopts -m 0644
insinto /usr/share/applications
for i in "$@" ; do
if [[ -f ${i} ]] ; then
doins "${i}"
((ret+=$?))
elif [[ -d ${i} ]] ; then
for j in "${i}"/*.desktop ; do
doins "${j}"
((ret+=$?))
done
else
((++ret))
fi
done
exit ${ret}
)
}
# @FUNCTION: newmenu
# @USAGE: <menu> <newname>
# @DESCRIPTION:
# Like all other new* functions, install the specified menu as newname.
newmenu() {
(
# wrap the env here so that the 'insinto' call
# doesn't corrupt the env of the caller
insopts -m 0644
insinto /usr/share/applications
newins "$@"
)
}
# @FUNCTION: _iconins
# @INTERNAL
# @DESCRIPTION:
# function for use in doicon and newicon
_iconins() {
(
# wrap the env here so that the 'insinto' call
# doesn't corrupt the env of the caller
insopts -m 0644
local funcname=$1; shift
local size dir
local context=apps
local theme=hicolor
while [[ $# -gt 0 ]] ; do
case $1 in
-s|--size)
if [[ ${2%%x*}x${2%%x*} == "$2" ]] ; then
size=${2%%x*}
else
size=${2}
fi
case ${size} in
16|22|24|32|36|48|64|72|96|128|192|256|512)
size=${size}x${size};;
scalable)
;;
*)
eerror "${size} is an unsupported icon size!"
exit 1;;
esac
shift 2;;
-t|--theme)
theme=${2}
shift 2;;
-c|--context)
context=${2}
shift 2;;
*)
if [[ -z ${size} ]] ; then
insinto /usr/share/pixmaps
else
insinto /usr/share/icons/${theme}/${size}/${context}
fi
if [[ ${funcname} == doicon ]] ; then
if [[ -f $1 ]] ; then
doins "${1}"
elif [[ -d $1 ]] ; then
shopt -s nullglob
doins "${1}"/*.{png,svg}
shopt -u nullglob
else
eerror "${1} is not a valid file/directory!"
exit 1
fi
else
break
fi
shift 1;;
esac
done
if [[ ${funcname} == newicon ]] ; then
newins "$@"
fi
) || die
}
# @FUNCTION: doicon
# @USAGE: [options] <icons>
# @DESCRIPTION:
# Install icon into the icon directory /usr/share/icons or into
# /usr/share/pixmaps if "--size" is not set.
# This is useful in conjunction with creating desktop/menu files.
#
# @CODE
# options:
# -s, --size
# !!! must specify to install into /usr/share/icons/... !!!
# size of the icon, like 48 or 48x48
# supported icon sizes are:
# 16 22 24 32 36 48 64 72 96 128 192 256 512 scalable
# -c, --context
# defaults to "apps"
# -t, --theme
# defaults to "hicolor"
#
# icons: list of icons
#
# example 1: doicon foobar.png fuqbar.svg suckbar.png
# results in: insinto /usr/share/pixmaps
# doins foobar.png fuqbar.svg suckbar.png
#
# example 2: doicon -s 48 foobar.png fuqbar.png blobbar.png
# results in: insinto /usr/share/icons/hicolor/48x48/apps
# doins foobar.png fuqbar.png blobbar.png
# @CODE
doicon() {
_iconins ${FUNCNAME} "$@"
}
# @FUNCTION: newicon
# @USAGE: [options] <icon> <newname>
# @DESCRIPTION:
# Like doicon, install the specified icon as newname.
#
# @CODE
# example 1: newicon foobar.png NEWNAME.png
# results in: insinto /usr/share/pixmaps
# newins foobar.png NEWNAME.png
#
# example 2: newicon -s 48 foobar.png NEWNAME.png
# results in: insinto /usr/share/icons/hicolor/48x48/apps
# newins foobar.png NEWNAME.png
# @CODE
newicon() {
_iconins ${FUNCNAME} "$@"
}
fi

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: distutils-r1.eclass
@ -46,7 +46,7 @@ case "${EAPI:-0}" in
0|1|2|3|4)
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
5|6)
5|6|7)
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
@ -79,7 +79,8 @@ esac
if [[ ! ${_DISTUTILS_R1} ]]; then
[[ ${EAPI} == [45] ]] && inherit eutils
inherit toolchain-funcs xdg-utils
[[ ${EAPI} == [56] ]] && inherit xdg-utils
inherit toolchain-funcs
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
inherit multiprocessing python-r1
@ -97,7 +98,11 @@ if [[ ! ${_DISTUTILS_R1} ]]; then
if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
RDEPEND=${PYTHON_DEPS}
if [[ ${EAPI} != [56] ]]; then
BDEPEND=${PYTHON_DEPS}
else
DEPEND=${PYTHON_DEPS}
fi
REQUIRED_USE=${PYTHON_REQUIRED_USE}
fi
@ -230,13 +235,13 @@ fi
# @USAGE: [<args>...]
# @DESCRIPTION:
# Run setup.py using currently selected Python interpreter
# (if ${PYTHON} is set; fallback 'python' otherwise).
# (if ${EPYTHON} is set; fallback 'python' otherwise).
#
# setup.py will be passed the following, in order:
# 1. ${mydistutilsargs[@]}
# 2. additional arguments passed to the esetup.py function.
#
# Please note that setup.py will respect defaults (unless overriden
# Please note that setup.py will respect defaults (unless overridden
# via command-line options) from setup.cfg that is created
# in distutils-r1_python_compile and in distutils-r1_python_install.
#
@ -249,7 +254,7 @@ esetup.py() {
[[ ${BUILD_DIR} ]] && _distutils-r1_create_setup_cfg
set -- "${PYTHON:-python}" setup.py "${mydistutilsargs[@]}" "${@}"
set -- "${EPYTHON:-python}" setup.py "${mydistutilsargs[@]}" "${@}"
echo "${@}" >&2
"${@}" || die "${die_args[@]}"
@ -390,7 +395,7 @@ _distutils-r1_create_setup_cfg() {
#
# note: due to some packages (wxpython) relying on separate
# platlib & purelib dirs, we do not set --build-lib (which
# can not be overriden with --build-*lib)
# can not be overridden with --build-*lib)
build-platlib = %(build-base)s/lib
build-purelib = %(build-base)s/lib
@ -412,7 +417,7 @@ _distutils-r1_create_setup_cfg() {
[install]
compile = True
optimize = 2
root = ${D}
root = ${D%/}
_EOF_
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
@ -582,7 +587,7 @@ distutils-r1_python_install() {
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
_distutils-r1_wrap_scripts "${root}" "${scriptdir}"
multibuild_merge_root "${root}" "${D}"
multibuild_merge_root "${root}" "${D%/}"
fi
}
@ -739,7 +744,7 @@ distutils-r1_src_prepare() {
distutils-r1_src_configure() {
python_export_utf8_locale
xdg_environment_reset # Bug 577704
[[ ${EAPI} == [56] ]] && xdg_environment_reset # Bug 577704
if declare -f python_configure >/dev/null; then
_distutils-r1_run_foreach_impl python_configure
@ -797,7 +802,7 @@ _distutils-r1_check_namespace_pth() {
while IFS= read -r -d '' f; do
pth+=( "${f}" )
done < <(find "${ED}" -name '*-nspkg.pth' -print0)
done < <(find "${ED%/}" -name '*-nspkg.pth' -print0)
if [[ ${pth[@]} ]]; then
ewarn "The following *-nspkg.pth files were found installed:"

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: eapi7-ver.eclass
@ -58,12 +58,9 @@
# the version string, it is truncated silently.
case ${EAPI:-0} in
0|1|2|3|4|5)
die "${ECLASS}: EAPI=${EAPI:-0} not supported";;
6)
;;
*)
die "${ECLASS}: EAPI=${EAPI} unknown";;
0|1|2|3|4|5|6) ;;
7) die "${ECLASS}: EAPI=${EAPI} includes all functions from this eclass" ;;
*) die "${ECLASS}: EAPI=${EAPI} unknown" ;;
esac
# @FUNCTION: _ver_parse_range
@ -135,11 +132,12 @@ ver_cut() {
local max=$((${#comp[@]}/2))
_ver_parse_range "${range}" "${max}"
local IFS=
if [[ ${start} -gt 0 ]]; then
start=$(( start*2 - 1 ))
fi
echo "${comp[*]:start:end*2-start}"
# Work around a bug in bash-3.2, where "${comp[*]:start:end*2-start}"
# inserts stray 0x7f characters for empty array elements
printf "%s" "${comp[@]:start:end*2-start}" $'\n'
}
# @FUNCTION: ver_rs

View File

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: elisp.eclass
@ -65,24 +65,24 @@
# files by dodoc in src_install().
inherit elisp-common
case ${EAPI:-0} in
0|1)
inherit eutils
EXPORT_FUNCTIONS src_{unpack,compile,install} \
pkg_{setup,postinst,postrm} ;;
2|3|4|5)
inherit eutils
EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \
pkg_{setup,postinst,postrm} ;;
6)
EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \
pkg_{setup,postinst,postrm} ;;
0|1|2|3|4|5) inherit epatch ;;
6|7) ;;
*) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
esac
DEPEND=">=virtual/emacs-${NEED_EMACS:-23}"
RDEPEND="${DEPEND}"
case ${EAPI:-0} in
0|1) EXPORT_FUNCTIONS src_{unpack,compile,install} \
pkg_{setup,postinst,postrm} ;;
*) EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \
pkg_{setup,postinst,postrm} ;;
esac
RDEPEND=">=virtual/emacs-${NEED_EMACS:-23}"
case ${EAPI:-0} in
0|1|2|3|4|5|6) DEPEND="${RDEPEND}" ;;
*) BDEPEND="${RDEPEND}" ;;
esac
# @FUNCTION: elisp_pkg_setup
# @DESCRIPTION:
@ -137,14 +137,14 @@ elisp_src_prepare() {
fi
case ${EAPI:-0} in
0|1|2|3|4|5) epatch "${file}" ;;
6) eapply "${file}" ;;
*) eapply "${file}" ;;
esac
done
# apply any user patches
case ${EAPI:-0} in
0|1|2|3|4|5) epatch_user ;;
6) eapply_user ;;
*) eapply_user ;;
esac
if [[ -n ${ELISP_REMOVE} ]]; then

View File

@ -1,9 +1,9 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: enlightenment.eclass
# @MAINTAINER:
# enlightenment@gentoo.org
# maintainer-needed@gentoo.org
# @BLURB: simplify enlightenment package management
if [[ -z ${_ENLIGHTENMENT_ECLASS} ]]; then
@ -37,7 +37,7 @@ E_ECONF=()
#
# live $PV has a 9999 marker
# KEYWORDS ""
# SRC_URI svn/etc... up
# SRC_URI git/etc... up
# S $WORKDIR/$E_S_APPEND
#
# Overrides:
@ -45,8 +45,7 @@ E_ECONF=()
# SRC_URI EURI_STATE
# S EURI_STATE
E_LIVE_SERVER_DEFAULT_SVN="http://svn.enlightenment.org/svn/e/trunk"
E_LIVE_SERVER_DEFAULT_GIT="git://git.enlightenment.org"
E_LIVE_SERVER_DEFAULT_GIT="https://git.enlightenment.org"
E_STATE="release"
if [[ ${PV} == *9999* ]] ; then
@ -58,15 +57,6 @@ if [[ ${PV} == *9999* ]] ; then
E_S_APPEND=${EGIT_URI_APPEND}
E_LIVE_SOURCE="git"
inherit git-2
else
E_LIVE_SERVER=${E_LIVE_SERVER:-${E_LIVE_SERVER_DEFAULT_SVN}}
ESVN_URI_APPEND=${ESVN_URI_APPEND:-${PN}}
ESVN_PROJECT="enlightenment/${ESVN_SUB_PROJECT}"
ESVN_REPO_URI=${ESVN_SERVER:-${E_LIVE_SERVER_DEFAULT_SVN}}/${ESVN_SUB_PROJECT}/${ESVN_URI_APPEND}
E_S_APPEND=${ESVN_URI_APPEND}
E_LIVE_SOURCE="svn"
inherit subversion
fi
E_STATE="live"
WANT_AUTOTOOLS="yes"
@ -98,8 +88,8 @@ case "${EAPI:-0}" in
esac
EXPORT_FUNCTIONS ${ENLIGHTENMENT_EXPF}
DESCRIPTION="A DR17 production"
HOMEPAGE="http://www.enlightenment.org/"
DESCRIPTION="An Enlightenment Foundation production"
HOMEPAGE="https://www.enlightenment.org"
if [[ -z ${SRC_URI} ]] ; then
case ${EURI_STATE:-${E_STATE}} in
release) SRC_URI="mirror://sourceforge/enlightenment/${P}.tar.gz";;
@ -126,7 +116,6 @@ esac
enlightenment_src_unpack() {
if [[ ${E_STATE} == "live" ]] ; then
case ${E_LIVE_SOURCE} in
svn) subversion_src_unpack;;
git) git-2_src_unpack;;
*) die "eek!";;
esac
@ -147,7 +136,6 @@ enlightenment_src_prepare() {
# autotools require README, when README.in is around, but README
# is created later in configure step
[[ -f README.in ]] && touch README
export SVN_REPO_PATH=${ESVN_WC_PATH}
eautoreconf
fi
epunt_cxx
@ -178,7 +166,7 @@ enlightenment_src_compile() {
enlightenment_src_install() {
V=1 emake install DESTDIR="${D}" || die
find "${D}" '(' -name CVS -o -name .svn -o -name .git ')' -type d -exec rm -rf '{}' \; 2>/dev/null
find "${D}" '(' -name CVS -o -name -o -name .git ')' -type d -exec rm -rf '{}' \; 2>/dev/null
for d in AUTHORS ChangeLog NEWS README TODO ${EDOCS}; do
[[ -f ${d} ]] && dodoc ${d}
done

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: epatch.eclass
@ -11,6 +11,13 @@
if [[ -z ${_EPATCH_ECLASS} ]]; then
case ${EAPI:-0} in
0|1|2|3|4|5|6)
;;
*)
die "${ECLASS}: banned in EAPI=${EAPI}; use eapply* instead";;
esac
inherit estack
# @VARIABLE: EPATCH_SOURCE

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: eutils.eclass
@ -20,7 +20,8 @@ _EUTILS_ECLASS=1
# implicitly inherited (now split) eclasses
case ${EAPI:-0} in
0|1|2|3|4|5|6)
inherit epatch estack ltprune multilib toolchain-funcs
inherit desktop epatch estack ltprune multilib preserve-libs \
toolchain-funcs vcs-clean
;;
esac
@ -37,37 +38,6 @@ if ! declare -F eqawarn >/dev/null ; then
}
fi
# @FUNCTION: ecvs_clean
# @USAGE: [list of dirs]
# @DESCRIPTION:
# Remove CVS directories recursiveley. Useful when a source tarball contains
# internal CVS directories. Defaults to $PWD.
ecvs_clean() {
[[ $# -eq 0 ]] && set -- .
find "$@" -type d -name 'CVS' -prune -print0 | xargs -0 rm -rf
find "$@" -type f -name '.cvs*' -print0 | xargs -0 rm -rf
}
# @FUNCTION: esvn_clean
# @USAGE: [list of dirs]
# @DESCRIPTION:
# Remove .svn directories recursiveley. Useful when a source tarball contains
# internal Subversion directories. Defaults to $PWD.
esvn_clean() {
[[ $# -eq 0 ]] && set -- .
find "$@" -type d -name '.svn' -prune -print0 | xargs -0 rm -rf
}
# @FUNCTION: egit_clean
# @USAGE: [list of dirs]
# @DESCRIPTION:
# Remove .git* directories/files recursiveley. Useful when a source tarball
# contains internal Git directories. Defaults to $PWD.
egit_clean() {
[[ $# -eq 0 ]] && set -- .
find "$@" -type d -name '.git*' -prune -print0 | xargs -0 rm -rf
}
# @FUNCTION: emktemp
# @USAGE: [temp dir]
# @DESCRIPTION:
@ -115,427 +85,6 @@ edos2unix() {
sed -i 's/\r$//' -- "$@" || die
}
# @FUNCTION: make_desktop_entry
# @USAGE: make_desktop_entry(<command>, [name], [icon], [type], [fields])
# @DESCRIPTION:
# Make a .desktop file.
#
# @CODE
# binary: what command does the app run with ?
# name: the name that will show up in the menu
# icon: the icon to use in the menu entry
# this can be relative (to /usr/share/pixmaps) or
# a full path to an icon
# type: what kind of application is this?
# for categories:
# https://specifications.freedesktop.org/menu-spec/latest/apa.html
# if unset, function tries to guess from package's category
# fields: extra fields to append to the desktop file; a printf string
# @CODE
make_desktop_entry() {
[[ -z $1 ]] && die "make_desktop_entry: You must specify the executable"
local exec=${1}
local name=${2:-${PN}}
local icon=${3:-${PN}}
local type=${4}
local fields=${5}
if [[ -z ${type} ]] ; then
local catmaj=${CATEGORY%%-*}
local catmin=${CATEGORY##*-}
case ${catmaj} in
app)
case ${catmin} in
accessibility) type="Utility;Accessibility";;
admin) type=System;;
antivirus) type=System;;
arch) type="Utility;Archiving";;
backup) type="Utility;Archiving";;
cdr) type="AudioVideo;DiscBurning";;
dicts) type="Office;Dictionary";;
doc) type=Documentation;;
editors) type="Utility;TextEditor";;
emacs) type="Development;TextEditor";;
emulation) type="System;Emulator";;
laptop) type="Settings;HardwareSettings";;
office) type=Office;;
pda) type="Office;PDA";;
vim) type="Development;TextEditor";;
xemacs) type="Development;TextEditor";;
esac
;;
dev)
type="Development"
;;
games)
case ${catmin} in
action|fps) type=ActionGame;;
arcade) type=ArcadeGame;;
board) type=BoardGame;;
emulation) type=Emulator;;
kids) type=KidsGame;;
puzzle) type=LogicGame;;
roguelike) type=RolePlaying;;
rpg) type=RolePlaying;;
simulation) type=Simulation;;
sports) type=SportsGame;;
strategy) type=StrategyGame;;
esac
type="Game;${type}"
;;
gnome)
type="Gnome;GTK"
;;
kde)
type="KDE;Qt"
;;
mail)
type="Network;Email"
;;
media)
case ${catmin} in
gfx)
type=Graphics
;;
*)
case ${catmin} in
radio) type=Tuner;;
sound) type=Audio;;
tv) type=TV;;
video) type=Video;;
esac
type="AudioVideo;${type}"
;;
esac
;;
net)
case ${catmin} in
dialup) type=Dialup;;
ftp) type=FileTransfer;;
im) type=InstantMessaging;;
irc) type=IRCClient;;
mail) type=Email;;
news) type=News;;
nntp) type=News;;
p2p) type=FileTransfer;;
voip) type=Telephony;;
esac
type="Network;${type}"
;;
sci)
case ${catmin} in
astro*) type=Astronomy;;
bio*) type=Biology;;
calc*) type=Calculator;;
chem*) type=Chemistry;;
elec*) type=Electronics;;
geo*) type=Geology;;
math*) type=Math;;
physics) type=Physics;;
visual*) type=DataVisualization;;
esac
type="Education;Science;${type}"
;;
sys)
type="System"
;;
www)
case ${catmin} in
client) type=WebBrowser;;
esac
type="Network;${type}"
;;
*)
type=
;;
esac
fi
local slot=${SLOT%/*}
if [[ ${slot} == "0" ]] ; then
local desktop_name="${PN}"
else
local desktop_name="${PN}-${slot}"
fi
local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop"
#local desktop=${T}/${exec%% *:-${desktop_name}}.desktop
# Don't append another ";" when a valid category value is provided.
type=${type%;}${type:+;}
if [[ -n ${icon} && ${icon} != /* ]] && [[ ${icon} == *.xpm || ${icon} == *.png || ${icon} == *.svg ]]; then
ewarn "As described in the Icon Theme Specification, icon file extensions are not"
ewarn "allowed in .desktop files if the value is not an absolute path."
icon=${icon%.*}
fi
cat <<-EOF > "${desktop}"
[Desktop Entry]
Name=${name}
Type=Application
Comment=${DESCRIPTION}
Exec=${exec}
TryExec=${exec%% *}
Icon=${icon}
Categories=${type}
EOF
if [[ ${fields:-=} != *=* ]] ; then
# 5th arg used to be value to Path=
ewarn "make_desktop_entry: update your 5th arg to read Path=${fields}"
fields="Path=${fields}"
fi
[[ -n ${fields} ]] && printf '%b\n' "${fields}" >> "${desktop}"
(
# wrap the env here so that the 'insinto' call
# doesn't corrupt the env of the caller
insinto /usr/share/applications
doins "${desktop}"
) || die "installing desktop file failed"
}
# @FUNCTION: _eutils_eprefix_init
# @INTERNAL
# @DESCRIPTION:
# Initialized prefix variables for EAPI<3.
_eutils_eprefix_init() {
has "${EAPI:-0}" 0 1 2 && : ${ED:=${D}} ${EPREFIX:=} ${EROOT:=${ROOT}}
}
# @FUNCTION: validate_desktop_entries
# @USAGE: [directories]
# @DESCRIPTION:
# Validate desktop entries using desktop-file-utils
validate_desktop_entries() {
eqawarn "validate_desktop_entries is deprecated and should be not be used."
eqawarn ".desktop file validation is done implicitly by Portage now."
_eutils_eprefix_init
if [[ -x "${EPREFIX}"/usr/bin/desktop-file-validate ]] ; then
einfo "Checking desktop entry validity"
local directories=""
for d in /usr/share/applications $@ ; do
[[ -d ${ED}${d} ]] && directories="${directories} ${ED}${d}"
done
if [[ -n ${directories} ]] ; then
for FILE in $(find ${directories} -name "*\.desktop" \
-not -path '*.hidden*' | sort -u 2>/dev/null)
do
local temp=$(desktop-file-validate ${FILE} | grep -v "warning:" | \
sed -e "s|error: ||" -e "s|${FILE}:|--|g" )
[[ -n $temp ]] && elog ${temp/--/${FILE/${ED}/}:}
done
fi
echo ""
else
einfo "Passing desktop entry validity check. Install dev-util/desktop-file-utils, if you want to help to improve Gentoo."
fi
}
# @FUNCTION: make_session_desktop
# @USAGE: <title> <command> [command args...]
# @DESCRIPTION:
# Make a GDM/KDM Session file. The title is the file to execute to start the
# Window Manager. The command is the name of the Window Manager.
#
# You can set the name of the file via the ${wm} variable.
make_session_desktop() {
[[ -z $1 ]] && eerror "$0: You must specify the title" && return 1
[[ -z $2 ]] && eerror "$0: You must specify the command" && return 1
local title=$1
local command=$2
local desktop=${T}/${wm:-${PN}}.desktop
shift 2
cat <<-EOF > "${desktop}"
[Desktop Entry]
Name=${title}
Comment=This session logs you into ${title}
Exec=${command} $*
TryExec=${command}
Type=XSession
EOF
(
# wrap the env here so that the 'insinto' call
# doesn't corrupt the env of the caller
insinto /usr/share/xsessions
doins "${desktop}"
)
}
# @FUNCTION: domenu
# @USAGE: <menus>
# @DESCRIPTION:
# Install the list of .desktop menu files into the appropriate directory
# (/usr/share/applications).
domenu() {
(
# wrap the env here so that the 'insinto' call
# doesn't corrupt the env of the caller
local i j ret=0
insinto /usr/share/applications
for i in "$@" ; do
if [[ -f ${i} ]] ; then
doins "${i}"
((ret+=$?))
elif [[ -d ${i} ]] ; then
for j in "${i}"/*.desktop ; do
doins "${j}"
((ret+=$?))
done
else
((++ret))
fi
done
exit ${ret}
)
}
# @FUNCTION: newmenu
# @USAGE: <menu> <newname>
# @DESCRIPTION:
# Like all other new* functions, install the specified menu as newname.
newmenu() {
(
# wrap the env here so that the 'insinto' call
# doesn't corrupt the env of the caller
insinto /usr/share/applications
newins "$@"
)
}
# @FUNCTION: _iconins
# @INTERNAL
# @DESCRIPTION:
# function for use in doicon and newicon
_iconins() {
(
# wrap the env here so that the 'insinto' call
# doesn't corrupt the env of the caller
local funcname=$1; shift
local size dir
local context=apps
local theme=hicolor
while [[ $# -gt 0 ]] ; do
case $1 in
-s|--size)
if [[ ${2%%x*}x${2%%x*} == "$2" ]] ; then
size=${2%%x*}
else
size=${2}
fi
case ${size} in
16|22|24|32|36|48|64|72|96|128|192|256|512)
size=${size}x${size};;
scalable)
;;
*)
eerror "${size} is an unsupported icon size!"
exit 1;;
esac
shift 2;;
-t|--theme)
theme=${2}
shift 2;;
-c|--context)
context=${2}
shift 2;;
*)
if [[ -z ${size} ]] ; then
insinto /usr/share/pixmaps
else
insinto /usr/share/icons/${theme}/${size}/${context}
fi
if [[ ${funcname} == doicon ]] ; then
if [[ -f $1 ]] ; then
doins "${1}"
elif [[ -d $1 ]] ; then
shopt -s nullglob
doins "${1}"/*.{png,svg}
shopt -u nullglob
else
eerror "${1} is not a valid file/directory!"
exit 1
fi
else
break
fi
shift 1;;
esac
done
if [[ ${funcname} == newicon ]] ; then
newins "$@"
fi
) || die
}
# @FUNCTION: doicon
# @USAGE: [options] <icons>
# @DESCRIPTION:
# Install icon into the icon directory /usr/share/icons or into
# /usr/share/pixmaps if "--size" is not set.
# This is useful in conjunction with creating desktop/menu files.
#
# @CODE
# options:
# -s, --size
# !!! must specify to install into /usr/share/icons/... !!!
# size of the icon, like 48 or 48x48
# supported icon sizes are:
# 16 22 24 32 36 48 64 72 96 128 192 256 512 scalable
# -c, --context
# defaults to "apps"
# -t, --theme
# defaults to "hicolor"
#
# icons: list of icons
#
# example 1: doicon foobar.png fuqbar.svg suckbar.png
# results in: insinto /usr/share/pixmaps
# doins foobar.png fuqbar.svg suckbar.png
#
# example 2: doicon -s 48 foobar.png fuqbar.png blobbar.png
# results in: insinto /usr/share/icons/hicolor/48x48/apps
# doins foobar.png fuqbar.png blobbar.png
# @CODE
doicon() {
_iconins ${FUNCNAME} "$@"
}
# @FUNCTION: newicon
# @USAGE: [options] <icon> <newname>
# @DESCRIPTION:
# Like doicon, install the specified icon as newname.
#
# @CODE
# example 1: newicon foobar.png NEWNAME.png
# results in: insinto /usr/share/pixmaps
# newins foobar.png NEWNAME.png
#
# example 2: newicon -s 48 foobar.png NEWNAME.png
# results in: insinto /usr/share/icons/hicolor/48x48/apps
# newins foobar.png NEWNAME.png
# @CODE
newicon() {
_iconins ${FUNCNAME} "$@"
}
# @FUNCTION: strip-linguas
# @USAGE: [<allow LINGUAS>|<-i|-u> <directories of .po files>]
# @DESCRIPTION:
@ -585,159 +134,6 @@ strip-linguas() {
export LINGUAS=${newls:1}
}
# @FUNCTION: preserve_old_lib
# @USAGE: <libs to preserve> [more libs]
# @DESCRIPTION:
# These functions are useful when a lib in your package changes ABI SONAME.
# An example might be from libogg.so.0 to libogg.so.1. Removing libogg.so.0
# would break packages that link against it. Most people get around this
# by using the portage SLOT mechanism, but that is not always a relevant
# solution, so instead you can call this from pkg_preinst. See also the
# preserve_old_lib_notify function.
preserve_old_lib() {
_eutils_eprefix_init
if [[ ${EBUILD_PHASE} != "preinst" ]] ; then
eerror "preserve_old_lib() must be called from pkg_preinst() only"
die "Invalid preserve_old_lib() usage"
fi
[[ -z $1 ]] && die "Usage: preserve_old_lib <library to preserve> [more libraries to preserve]"
# let portage worry about it
has preserve-libs ${FEATURES} && return 0
local lib dir
for lib in "$@" ; do
[[ -e ${EROOT}/${lib} ]] || continue
dir=${lib%/*}
dodir ${dir} || die "dodir ${dir} failed"
cp "${EROOT}"/${lib} "${ED}"/${lib} || die "cp ${lib} failed"
touch "${ED}"/${lib}
done
}
# @FUNCTION: preserve_old_lib_notify
# @USAGE: <libs to notify> [more libs]
# @DESCRIPTION:
# Spit helpful messages about the libraries preserved by preserve_old_lib.
preserve_old_lib_notify() {
if [[ ${EBUILD_PHASE} != "postinst" ]] ; then
eerror "preserve_old_lib_notify() must be called from pkg_postinst() only"
die "Invalid preserve_old_lib_notify() usage"
fi
# let portage worry about it
has preserve-libs ${FEATURES} && return 0
_eutils_eprefix_init
local lib notice=0
for lib in "$@" ; do
[[ -e ${EROOT}/${lib} ]] || continue
if [[ ${notice} -eq 0 ]] ; then
notice=1
ewarn "Old versions of installed libraries were detected on your system."
ewarn "In order to avoid breaking packages that depend on these old libs,"
ewarn "the libraries are not being removed. You need to run revdep-rebuild"
ewarn "in order to remove these old dependencies. If you do not have this"
ewarn "helper program, simply emerge the 'gentoolkit' package."
ewarn
fi
ewarn " # revdep-rebuild --library '${lib}' && rm '${lib}'"
done
}
# @FUNCTION: built_with_use
# @USAGE: [--hidden] [--missing <action>] [-a|-o] <DEPEND ATOM> <List of USE flags>
# @DESCRIPTION:
#
# Deprecated: Use EAPI 2 use deps in DEPEND|RDEPEND and with has_version calls.
#
# A temporary hack until portage properly supports DEPENDing on USE
# flags being enabled in packages. This will check to see if the specified
# DEPEND atom was built with the specified list of USE flags. The
# --missing option controls the behavior if called on a package that does
# not actually support the defined USE flags (aka listed in IUSE).
# The default is to abort (call die). The -a and -o flags control
# the requirements of the USE flags. They correspond to "and" and "or"
# logic. So the -a flag means all listed USE flags must be enabled
# while the -o flag means at least one of the listed IUSE flags must be
# enabled. The --hidden option is really for internal use only as it
# means the USE flag we're checking is hidden expanded, so it won't be found
# in IUSE like normal USE flags.
#
# Remember that this function isn't terribly intelligent so order of optional
# flags matter.
built_with_use() {
_eutils_eprefix_init
local hidden="no"
if [[ $1 == "--hidden" ]] ; then
hidden="yes"
shift
fi
local missing_action="die"
if [[ $1 == "--missing" ]] ; then
missing_action=$2
shift ; shift
case ${missing_action} in
true|false|die) ;;
*) die "unknown action '${missing_action}'";;
esac
fi
local opt=$1
[[ ${opt:0:1} = "-" ]] && shift || opt="-a"
local PKG=$(best_version $1)
[[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package"
shift
local USEFILE=${EROOT}/var/db/pkg/${PKG}/USE
local IUSEFILE=${EROOT}/var/db/pkg/${PKG}/IUSE
# if the IUSE file doesn't exist, the read will error out, we need to handle
# this gracefully
if [[ ! -e ${USEFILE} ]] || [[ ! -e ${IUSEFILE} && ${hidden} == "no" ]] ; then
case ${missing_action} in
true) return 0;;
false) return 1;;
die) die "Unable to determine what USE flags $PKG was built with";;
esac
fi
if [[ ${hidden} == "no" ]] ; then
local IUSE_BUILT=( $(<"${IUSEFILE}") )
# Don't check USE_EXPAND #147237
local expand
for expand in $(echo ${USE_EXPAND} | tr '[:upper:]' '[:lower:]') ; do
if [[ $1 == ${expand}_* ]] ; then
expand=""
break
fi
done
if [[ -n ${expand} ]] ; then
if ! has $1 ${IUSE_BUILT[@]#[-+]} ; then
case ${missing_action} in
true) return 0;;
false) return 1;;
die) die "$PKG does not actually support the $1 USE flag!";;
esac
fi
fi
fi
local USE_BUILT=$(<${USEFILE})
while [[ $# -gt 0 ]] ; do
if [[ ${opt} = "-o" ]] ; then
has $1 ${USE_BUILT} && return 0
else
has $1 ${USE_BUILT} || return 1
fi
shift
done
[[ ${opt} = "-a" ]]
}
# @FUNCTION: make_wrapper
# @USAGE: <wrapper> <target> [chdir] [libpaths] [installpath]
# @DESCRIPTION:
@ -746,9 +142,9 @@ built_with_use() {
# first optionally setting LD_LIBRARY_PATH to the colon-delimited
# libpaths followed by optionally changing directory to chdir.
make_wrapper() {
_eutils_eprefix_init
local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5
local tmpwrapper=$(emktemp)
has "${EAPI:-0}" 0 1 2 && local EPREFIX=""
(
echo '#!/bin/sh'
@ -776,6 +172,7 @@ make_wrapper() {
if [[ -n ${path} ]] ; then
(
exeopts -m 0755
exeinto "${path}"
newexe "${tmpwrapper}" "${wrapper}"
) || die
@ -869,10 +266,6 @@ optfeature() {
fi
}
check_license() {
die "you no longer need this as portage supports ACCEPT_LICENSE itself"
}
case ${EAPI:-0} in
0|1|2)
@ -940,12 +333,14 @@ case ${EAPI:-0} in
# @FUNCTION: einstalldocs
# @DESCRIPTION:
# Install documentation using DOCS and HTML_DOCS.
# Install documentation using DOCS and HTML_DOCS, in EAPIs that do not
# provide this function. When available (i.e., in EAPI 6 or later),
# the package manager implementation should be used instead.
#
# If DOCS is declared and non-empty, all files listed in it are
# installed. The files must exist, otherwise the function will fail.
# In EAPI 4 and subsequent EAPIs DOCS may specify directories as well,
# in other EAPIs using directories is unsupported.
# In EAPI 4 and 5, DOCS may specify directories as well; in earlier
# EAPIs using directories is unsupported.
#
# If DOCS is not declared, the files matching patterns given
# in the default EAPI implementation of src_install will be installed.
@ -1002,10 +397,11 @@ einstalldocs() {
# @FUNCTION: in_iuse
# @USAGE: <flag>
# @DESCRIPTION:
# Determines whether the given flag is in IUSE. Strips IUSE default prefixes
# as necessary.
# Determines whether the given flag is in IUSE. Strips IUSE default
# prefixes as necessary. In EAPIs where it is available (i.e., EAPI 6
# or later), the package manager implementation should be used instead.
#
# Note that this function should not be used in the global scope.
# Note that this function must not be used in the global scope.
in_iuse() {
debug-print-function ${FUNCNAME} "${@}"
[[ ${#} -eq 1 ]] || die "Invalid args to ${FUNCNAME}()"

View File

@ -11,7 +11,7 @@
# often via packages like libcap.
#
# Due to probable capability-loss on moving or copying, this happens in
# pkg_postinst-phase (at least for now).
# pkg_postinst phase (at least for now).
#
# @EXAMPLE:
# You can manually set the caps on ping and ping6 by doing:
@ -110,11 +110,12 @@ fcaps() {
root=${EROOT:-${ROOT}}
;;
esac
root=${root%/}
# Process every file!
local file
for file ; do
[[ ${file} != /* ]] && file="${root}${file}"
[[ ${file} != /* ]] && file="${root}/${file}"
if use filecaps ; then
# Try to set capabilities. Ignore errors when the

View File

@ -16,7 +16,7 @@ inherit eutils toolchain-funcs multilib
# Return all the flag variables that our high level funcs operate on.
all-flag-vars() {
echo {C,CPP,CXX,CCAS,F,FC,LD}FLAGS
echo {ADA,C,CPP,CXX,CCAS,F,FC,LD}FLAGS
}
# {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags
@ -27,7 +27,7 @@ setup-allowed-flags() {
'-fstack-protector*' '-fsanitize*' '-fstack-check*' -fno-stack-check
-fbounds-check -fbounds-checking -fno-strict-overflow
-fno-PIE -fno-pie -nopie -no-pie -fno-unit-at-a-time
-g '-g[0-9]' -ggdb '-ggdb[0-9]' '-gdwarf-*' gstabs -gstabs+
-g '-g[0-9]' -ggdb '-ggdb[0-9]' '-gdwarf-*' gstabs -gstabs+ -gz
-fno-ident -fpermissive -frecord-gcc-switches
'-fdiagnostics*' '-fplugin*'
'-W*' -w
@ -421,9 +421,9 @@ strip-flags() {
test-flag-PROG() {
local comp=$1
local lang=$2
local flag=$3
shift 2
[[ -z ${comp} || -z ${flag} ]] && return 1
[[ -z ${comp} || -z $1 ]] && return 1
local cmdline=(
$(tc-get${comp})
@ -434,11 +434,11 @@ test-flag-PROG() {
-c -o /dev/null
)
if "${cmdline[@]}" -x${lang} - </dev/null &>/dev/null ; then
cmdline+=( "${flag}" -x${lang} - )
cmdline+=( "$@" -x${lang} - )
else
# XXX: what's the purpose of this? does it even work with
# any compiler?
cmdline+=( "${flag}" -c -o /dev/null /dev/null )
cmdline+=( "$@" -c -o /dev/null /dev/null )
fi
if ! "${cmdline[@]}" </dev/null &>/dev/null; then
@ -455,25 +455,25 @@ test-flag-PROG() {
# @USAGE: <flag>
# @DESCRIPTION:
# Returns shell true if <flag> is supported by the C compiler, else returns shell false.
test-flag-CC() { test-flag-PROG "CC" c "$1"; }
test-flag-CC() { test-flag-PROG "CC" c "$@"; }
# @FUNCTION: test-flag-CXX
# @USAGE: <flag>
# @DESCRIPTION:
# Returns shell true if <flag> is supported by the C++ compiler, else returns shell false.
test-flag-CXX() { test-flag-PROG "CXX" c++ "$1"; }
test-flag-CXX() { test-flag-PROG "CXX" c++ "$@"; }
# @FUNCTION: test-flag-F77
# @USAGE: <flag>
# @DESCRIPTION:
# Returns shell true if <flag> is supported by the Fortran 77 compiler, else returns shell false.
test-flag-F77() { test-flag-PROG "F77" f77 "$1"; }
test-flag-F77() { test-flag-PROG "F77" f77 "$@"; }
# @FUNCTION: test-flag-FC
# @USAGE: <flag>
# @DESCRIPTION:
# Returns shell true if <flag> is supported by the Fortran 90 compiler, else returns shell false.
test-flag-FC() { test-flag-PROG "FC" f95 "$1"; }
test-flag-FC() { test-flag-PROG "FC" f95 "$@"; }
test-flags-PROG() {
local comp=$1
@ -484,8 +484,21 @@ test-flags-PROG() {
[[ -z ${comp} ]] && return 1
for x ; do
test-flag-${comp} "${x}" && flags+=( "${x}" )
while (( $# )); do
case "$1" in
--param)
if test-flag-${comp} "$1" "$2"; then
flags+=( "$1" "$2" )
fi
shift 2
;;
*)
if test-flag-${comp} "$1"; then
flags+=( "$1" )
fi
shift 1
;;
esac
done
echo "${flags[*]}"

View File

@ -1,4 +1,4 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: freedict.eclass
@ -21,21 +21,23 @@
# @DESCRIPTION:
# Please see above for a description.
inherit eutils multilib
IUSE=""
case ${EAPI:-0} in
6) ;;
*) die "${ECLASS}.eclass is banned in EAPI=${EAPI}" ;;
esac
MY_P=${PN/freedict-/}
S="${WORKDIR}"
DESCRIPTION="Freedict for language translation from ${FORLANG} to ${TOLANG}"
HOMEPAGE="http://www.freedict.de"
HOMEPAGE="http://freedict.sourceforge.net/"
SRC_URI="http://freedict.sourceforge.net/download/linux/${MY_P}.tar.gz"
LICENSE="GPL-2+"
SLOT="0"
LICENSE="GPL-2"
DEPEND="app-text/dictd"
RDEPEND="app-text/dictd"
S="${WORKDIR}"
# @FUNCTION: freedict_src_install
# @DESCRIPTION:

View File

@ -16,14 +16,14 @@ inherit multiprocessing versionator
# @DESCRIPTION:
# returns the name of the ghc executable
ghc-getghc() {
type -P ghc
type -P ${HC:-ghc}
}
# @FUNCTION: ghc-getghcpkg
# @DESCRIPTION:
# Internal function determines returns the name of the ghc-pkg executable
ghc-getghcpkg() {
type -P ghc-pkg
type -P ${HC_PKG:-ghc-pkg}
}
# @FUNCTION: ghc-getghcpkgbin

View File

@ -6,7 +6,7 @@
# maintainer-needed@gentoo.org
# @BLURB: Eclass for fetching and unpacking git repositories.
# @DESCRIPTION:
# Eclass for easing maitenance of live ebuilds using git as remote repository.
# Eclass for easing maintenance of live ebuilds using git as remote repository.
# Eclass support working with git submodules and branching.
#
# This eclass is DEPRECATED. Please use git-r3 instead.
@ -15,7 +15,7 @@ if [[ ${EAPI} == 6 ]]; then
die "${ECLASS}.eclass is banned in EAPI ${EAPI}"
fi
# This eclass support all EAPIs
# This eclass support all EAPIs.
EXPORT_FUNCTIONS src_unpack
DEPEND="dev-vcs/git"
@ -47,7 +47,7 @@ DEPEND="dev-vcs/git"
# @ECLASS-VARIABLE: EGIT_MASTER
# @DESCRIPTION:
# Variable for specifying master branch.
# Usefull when upstream don't have master branch or name it differently.
# Useful when upstream don't have master branch or name it differently.
#
# EGIT_MASTER="master"
@ -62,7 +62,7 @@ DEPEND="dev-vcs/git"
# @ECLASS-VARIABLE: EGIT_DIR
# @DESCRIPTION:
# Directory where we want to store the git data.
# This variable should not be overriden.
# This variable should not be overridden.
#
# EGIT_DIR="${EGIT_STORE_DIR}/${EGIT_PROJECT}"
@ -73,7 +73,7 @@ DEPEND="dev-vcs/git"
# URI for the repository
# e.g. http://foo, git://bar
#
# It can be overriden via env using packagename_LIVE_REPO
# It can be overridden via env using packagename_LIVE_REPO
# variable.
#
# Support multiple values:
@ -88,7 +88,7 @@ DEPEND="dev-vcs/git"
# @ECLASS-VARIABLE: EGIT_BRANCH
# @DESCRIPTION:
# Variable containing branch name we want to check out.
# It can be overriden via env using packagename_LIVE_BRANCH
# It can be overridden via env using packagename_LIVE_BRANCH
# variable.
#
# EGIT_BRANCH="${EGIT_MASTER}"
@ -96,7 +96,7 @@ DEPEND="dev-vcs/git"
# @ECLASS-VARIABLE: EGIT_COMMIT
# @DESCRIPTION:
# Variable containing commit hash/tag we want to check out.
# It can be overriden via env using packagename_LIVE_COMMIT
# It can be overridden via env using packagename_LIVE_COMMIT
# variable.
#
# EGIT_COMMIT="${EGIT_BRANCH}"
@ -125,7 +125,7 @@ DEPEND="dev-vcs/git"
# @DEFAULT_UNSET
# @DESCRIPTION:
# If non-empty this variable bans unpacking of ${A} content into the srcdir.
# Default behaviour is to unpack ${A} content.
# Default behavior is to unpack ${A} content.
# @FUNCTION: git-2_init_variables
# @INTERNAL

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: git-r3.eclass
@ -10,7 +10,10 @@
# git as remote repository.
case "${EAPI:-0}" in
0|1|2|3|4|5|6)
0|1|2|3)
die "Unsupported EAPI=${EAPI} (obsolete) for ${ECLASS}"
;;
4|5|6|7)
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
@ -22,7 +25,11 @@ EXPORT_FUNCTIONS src_unpack
if [[ ! ${_GIT_R3} ]]; then
if [[ ! ${_INHERITED_BY_GIT_2} ]]; then
DEPEND=">=dev-vcs/git-1.8.2.1"
if [[ ${EAPI:-0} != [0123456] ]]; then
BDEPEND=">=dev-vcs/git-1.8.2.1[curl]"
else
DEPEND=">=dev-vcs/git-1.8.2.1[curl]"
fi
fi
# @ECLASS-VARIABLE: EGIT_CLONE_TYPE
@ -145,7 +152,7 @@ fi
# The branch name to check out. If unset, the upstream default (HEAD)
# will be used.
#
# It can be overriden via env using ${PN}_LIVE_BRANCH variable.
# It can be overridden via env using ${PN}_LIVE_BRANCH variable.
# @ECLASS-VARIABLE: EGIT_COMMIT
# @DEFAULT_UNSET
@ -155,7 +162,7 @@ fi
# not on HEAD branch, EGIT_BRANCH needs to be set to a branch on which
# the commit is available.
#
# It can be overriden via env using ${PN}_LIVE_COMMIT variable.
# It can be overridden via env using ${PN}_LIVE_COMMIT variable.
# @ECLASS-VARIABLE: EGIT_COMMIT_DATE
# @DEFAULT_UNSET
@ -171,7 +178,7 @@ fi
# will be considered alike a single commit with date corresponding
# to the merge commit date.
#
# It can be overriden via env using ${PN}_LIVE_COMMIT_DATE variable.
# It can be overridden via env using ${PN}_LIVE_COMMIT_DATE variable.
# @ECLASS-VARIABLE: EGIT_CHECKOUT_DIR
# @DESCRIPTION:
@ -553,6 +560,7 @@ _git-r3_is_local_repo() {
git-r3_fetch() {
debug-print-function ${FUNCNAME} "$@"
# process repos first since we create repo_name from it
local repos
if [[ ${1} ]]; then
repos=( ${1} )
@ -562,12 +570,6 @@ git-r3_fetch() {
repos=( ${EGIT_REPO_URI} )
fi
local branch=${EGIT_BRANCH:+refs/heads/${EGIT_BRANCH}}
local remote_ref=${2:-${EGIT_COMMIT:-${branch:-HEAD}}}
local local_id=${3:-${CATEGORY}/${PN}/${SLOT%/*}}
local local_ref=refs/git-r3/${local_id}/__main__
local commit_date=${4:-${EGIT_COMMIT_DATE}}
[[ ${repos[@]} ]] || die "No URI provided and EGIT_REPO_URI unset"
local r
@ -591,6 +593,54 @@ git-r3_fetch() {
)
fi
# get the default values for the common variables and override them
local branch_name=${EGIT_BRANCH}
local commit_id=${2:-${EGIT_COMMIT}}
local commit_date=${4:-${EGIT_COMMIT_DATE}}
# support new override API for EAPI 6+
if ! has "${EAPI:-0}" 0 1 2 3 4 5; then
# get the name and do some more processing:
# 1) kill .git suffix,
# 2) underscore (remaining) non-variable characters,
# 3) add preceding underscore if it starts with a digit,
# 4) uppercase.
local override_name=${GIT_DIR##*/}
override_name=${override_name%.git}
override_name=${override_name//[^a-zA-Z0-9_]/_}
override_name=${override_name^^}
local varmap=(
REPO:repos
BRANCH:branch_name
COMMIT:commit_id
COMMIT_DATE:commit_date
)
local localvar livevar live_warn=
for localvar in "${varmap[@]}"; do
livevar=EGIT_OVERRIDE_${localvar%:*}_${override_name}
localvar=${localvar#*:}
if [[ -n ${!livevar} ]]; then
[[ ${localvar} == repos ]] && repos=()
live_warn=1
ewarn "Using ${livevar}=${!livevar}"
declare "${localvar}=${!livevar}"
fi
done
if [[ ${live_warn} ]]; then
ewarn "No support will be provided."
fi
fi
# set final variables after applying overrides
local branch=${branch_name:+refs/heads/${branch_name}}
local remote_ref=${commit_id:-${branch:-HEAD}}
local local_id=${3:-${CATEGORY}/${PN}/${SLOT%/*}}
local local_ref=refs/git-r3/${local_id}/__main__
# try to fetch from the remote
local success saved_umask
if [[ ${EVCS_UMASK} ]]; then
@ -604,20 +654,6 @@ git-r3_fetch() {
local fetch_command=( git fetch "${r}" )
local clone_type=${EGIT_CLONE_TYPE}
if [[ ${r} == http://* || ${r} == https://* ]] &&
[[ ! ${EGIT_CURL_WARNED} ]] &&
! ROOT=/ has_version 'dev-vcs/git[curl]'
then
ewarn "git-r3: fetching from HTTP(S) requested. In order to support HTTP(S),"
ewarn "dev-vcs/git needs to be built with USE=curl. Example solution:"
ewarn
ewarn " echo dev-vcs/git curl >> /etc/portage/package.use"
ewarn " emerge -1v dev-vcs/git"
ewarn
ewarn "HTTP(S) URIs will be skipped."
EGIT_CURL_WARNED=1
fi
if [[ ${clone_type} == mirror ]]; then
fetch_command+=(
--prune
@ -803,7 +839,7 @@ git-r3_fetch() {
}
# @FUNCTION: git-r3_checkout
# @USAGE: [<repo-uri> [<checkout-path> [<local-id>]]]
# @USAGE: [<repo-uri> [<checkout-path> [<local-id> [<checkout-paths>...]]]]
# @DESCRIPTION:
# Check the previously fetched tree to the working copy.
#
@ -819,6 +855,12 @@ git-r3_fetch() {
# <local-id> needs to specify the local identifier that was used
# for respective git-r3_fetch.
#
# If <checkout-paths> are specified, then the specified paths are passed
# to 'git checkout' to effect a partial checkout. Please note that such
# checkout will not cause the repository to switch branches,
# and submodules will be skipped at the moment. The submodules matching
# those paths might be checked out in a future version of the eclass.
#
# The checkout operation will write to the working copy, and export
# the repository state into the environment. If the repository contains
# submodules, they will be checked out recursively.
@ -836,6 +878,7 @@ git-r3_checkout() {
local out_dir=${2:-${EGIT_CHECKOUT_DIR:-${WORKDIR}/${P}}}
local local_id=${3:-${CATEGORY}/${PN}/${SLOT%/*}}
local checkout_paths=( "${@:4}" )
local -x GIT_DIR
_git-r3_set_gitdir "${repos[0]}"
@ -883,6 +926,9 @@ git-r3_checkout() {
else
set -- "${@}" "${new_commit_id}"
fi
if [[ ${checkout_paths[@]} ]]; then
set -- "${@}" -- "${checkout_paths[@]}"
fi
echo "${@}" >&2
"${@}" || die "git checkout ${remote_ref:-${new_commit_id}} failed"
}
@ -905,8 +951,12 @@ git-r3_checkout() {
echo " updating from commit: ${old_commit_id}"
echo " to commit: ${new_commit_id}"
git --no-pager diff --stat \
set -- git --no-pager diff --stat \
${old_commit_id}..${new_commit_id}
if [[ ${checkout_paths[@]} ]]; then
set -- "${@}" -- "${checkout_paths[@]}"
fi
"${@}"
else
echo " at the commit: ${new_commit_id}"
fi
@ -914,7 +964,7 @@ git-r3_checkout() {
git update-ref --no-deref refs/git-r3/"${local_id}"/{__old__,__main__} || die
# recursively checkout submodules
if [[ -f ${out_dir}/.gitmodules ]]; then
if [[ -f ${out_dir}/.gitmodules && ! ${checkout_paths} ]]; then
local submodules
_git-r3_set_submodules \
"$(<"${out_dir}"/.gitmodules)"

View File

@ -1,82 +1,99 @@
# Copyright 1999-2012 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# Original Author: Jim Ramsay <lack@gentoo.org>
#
# Purpose:
# Provides common methods used by (almost) all gkrellm plugins:
# @ECLASS: gkrellm-plugin.eclass
# @MAINTAINER:
# maintainer-needed@gentoo.org
# @AUTHOR:
# Original author: Jim Ramsay
# EAPI 6 author: David Seifert
# @BLURB: Provides src_install used by (almost) all gkrellm plugins
# @DESCRIPTION:
# - Sets up default dependencies
# - Adds pkg_setup check to ensure gkrellm was built with USE="X" (bug
# 167227)
# - Provides utility routines in lieu of hard-coding the plugin directories.
# - Provides the most common src_install method to avoid code duplication.
#
# Utility Routines:
# gkrellm-plugin_dir - Returns the gkrellm-2 plugin directory
# gkrellm-plugin_server_dir - Returns the gkrellm-2 server plugin directory
#
# Environment:
# For src_install:
# PLUGIN_SO - The name of the plugin's .so file which will be installed in
# the plugin dir. Defaults to "${PN}.so".
# PLUGIN_DOCS - An optional list of docs to be installed. Defaults to
# unset.
# PLUGIN_SERVER_SO - The name of the plugin's server plugin .so portion.
# Defaults to unset.
# Important: This will also cause the pkg_setup check to be skipped, so
# you need to check 'build_with_use app-admin/gkrellm X' in your
# src_compile and only compile the GUI portion if that returns true. (see
# x11-plugins/gkrelltop as an example)
# - Provides a common src_install method to avoid code duplication
#
# Changelog:
# 03 January 2018: David Seifert <soap@gentoo.org>
# - Port to EAPI 6, remove built_with_use, simplify a lot
# 12 March 2007: Jim Ramsay <lack@gentoo.org>
# - Added server plugin support
# 09 March 2007: Jim Ramsay <lack@gentoo.org>
# - Initial commit
#
inherit multilib eutils
# @ECLASS-VARIABLE: PLUGIN_SO
# @DESCRIPTION:
# The name of the plugin's .so file which will be installed in
# the plugin dir. Defaults to "${PN}$(get_modname)". Has to be a bash array.
RDEPEND="=app-admin/gkrellm-2*"
DEPEND="${RDEPEND}
virtual/pkgconfig"
# @ECLASS-VARIABLE: PLUGIN_SERVER_SO
# @DESCRIPTION:
# The name of the plugin's server plugin $(get_modname) portion.
# Unset by default. Has to be a bash array.
gkrellm-plugin_dir() {
echo /usr/$(get_libdir)/gkrellm2/plugins
}
# @ECLASS-VARIABLE: PLUGIN_DOCS
# @DESCRIPTION:
# An optional list of docs to be installed, in addition to the default
# DOCS variable which is respected too. Has to be a bash array.
gkrellm-plugin_server_dir() {
echo /usr/$(get_libdir)/gkrellm2/plugins-gkrellmd
}
case ${EAPI:-0} in
[0-5])
die "${ECLASS} is banned in EAPI ${EAPI:-0}"
;;
6)
;;
*)
die "Unknown EAPI ${EAPI:-0}"
;;
esac
gkrellm-plugin_pkg_setup() {
if [[ -z "${PLUGIN_SERVER_SO}" ]] &&
! built_with_use app-admin/gkrellm X; then
eerror "This plugin requires the X frontend of gkrellm."
eerror "Please re-emerge app-admin/gkrellm with USE=\"X\""
die "Please re-emerge app-admin/gkrellm with USE=\"X\""
fi
}
inherit multilib
EXPORT_FUNCTIONS src_install
if [[ ! ${_GKRELLM_PLUGIN_R1} ]]; then
DEPEND="virtual/pkgconfig"
# @FUNCTION: gkrellm-plugin_src_install
# @DESCRIPTION:
# Install the plugins and call einstalldocs
gkrellm-plugin_src_install() {
if built_with_use app-admin/gkrellm X; then
insinto $(gkrellm-plugin_dir)
doins ${PLUGIN_SO:-${PN}.so} || die "Plugin shared library was not installed"
exeinto /usr/$(get_libdir)/gkrellm2/plugins
if ! declare -p PLUGIN_SO >/dev/null 2>&1 ; then
doexe ${PN}$(get_modname)
elif declare -p PLUGIN_SO | grep -q "^declare -a " ; then
doexe "${PLUGIN_SO[@]}"
else
die "PLUGIN_SO has to be a bash array!"
fi
if [[ -n "${PLUGIN_SERVER_SO}" ]]; then
insinto $(gkrellm-plugin_server_dir)
doins ${PLUGIN_SERVER_SO} || die "Server plugin shared library was not installed"
if [[ -n ${PLUGIN_SERVER_SO} ]]; then
exeinto /usr/$(get_libdir)/gkrellm2/plugins-gkrellmd
if declare -p PLUGIN_SERVER_SO | grep -q "^declare -a " ; then
doexe "${PLUGIN_SERVER_SO[@]}"
else
die "PLUGIN_SERVER_SO has to be a bash array!"
fi
fi
DDOCS="README* Change* AUTHORS FAQ TODO INSTALL"
for doc in ${DDOCS}; do
[ -s "$doc" ] && dodoc $doc
einstalldocs
local d
for d in Changelog* ChangeLog*; do
[[ -s "${d}" ]] && dodoc "${d}"
done
[ -n "${PLUGIN_DOCS}" ] && dodoc ${PLUGIN_DOCS}
if [[ -n ${PLUGIN_DOCS} ]]; then
if declare -p PLUGIN_DOCS | grep -q "^declare -a " ; then
dodoc "${PLUGIN_DOCS[@]}"
else
die "PLUGIN_DOCS has to be a bash array!"
fi
fi
}
EXPORT_FUNCTIONS pkg_setup src_install
_GKRELLM_PLUGIN_R1=1
fi

File diff suppressed because it is too large Load Diff

View File

@ -1,847 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# Author: George Shapovalov <george@gentoo.org>
# Author: Steve Arnold <nerdboy@gentoo.org>
# No maintainer <maintainer-needed@gentoo.org>
#
# Notes:
# HOMEPAGE and LICENSE are set in appropriate ebuild, as
# gnat is developed by FSF and AdaCore "in parallel"
#
# The following vars can be set in ebuild before inheriting this eclass. They
# will be respected:
# SLOT
# BOOT_SLOT - where old bootstrap is used as it works fine
#WANT_AUTOMAKE="1.8"
#WANT_AUTOCONF="2.1"
inherit eutils fixheadtails flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs versionator
FEATURES=${FEATURES/multilib-strict/}
EXPORT_FUNCTIONS="pkg_setup pkg_postinst pkg_postrm src_unpack src_configure src_compile src_install"
IUSE="nls"
# multilib is supported via profiles now, multilib usevar is deprecated
RDEPEND="app-eselect/eselect-gnat
virtual/libiconv
nls? ( virtual/libintl )"
DEPEND="${RDEPEND}
>=app-eselect/eselect-gnat-1.3-r1
>=sys-libs/glibc-2.12
>=sys-devel/binutils-2.23
sys-devel/bc
>=sys-devel/bison-1.875
>=sys-devel/flex-2.5.4
nls? ( sys-devel/gettext )"
# Note!
# It may not be safe to source this at top level. Only source inside local
# functions!
GnatCommon="/usr/share/gnat/lib/gnat-common.bash"
#---->> globals and SLOT <<----
# just a check, this location seems to vary too much, easier to track it in
# ebuild
#[ -z "${GNATSOURCE}" ] && die "please set GNATSOURCE in ebuild! (before inherit)"
# versioning
# because of gnatpro/gnatgpl we need to track both gcc and gnat versions
# these simply default to $PV
GNATMAJOR=$(get_version_component_range 1)
GNATMINOR=$(get_version_component_range 2)
GNATBRANCH=$(get_version_component_range 1-2)
GNATRELEASE=$(get_version_component_range 1-3)
# this one is for the gnat-gpl which is versioned by gcc backend and ACT version
# number added on top
ACT_Ver=$(get_version_component_range 4)
# GCCVER and SLOT logic
#
# I better define vars for package names, as there was discussion on proper
# naming and it may change
PN_GnatGCC="gnat-gcc"
PN_GnatGpl="gnat-gpl"
# ATTN! GCCVER stands for the provided backend gcc, not the one on the system
# so tc-* functions are of no use here. The present versioning scheme makes
# GCCVER basically a part of PV, but *this may change*!!
#
# GCCVER can be set in the ebuild.
[[ -z ${GCCVER} ]] && GCCVER="${GNATRELEASE}"
# finally extract GCC version strings
GCCMAJOR=$(get_version_component_range 1 "${GCCVER}")
GCCMINOR=$(get_version_component_range 2 "${GCCVER}")
GCCBRANCH=$(get_version_component_range 1-2 "${GCCVER}")
GCCRELEASE=$(get_version_component_range 1-3 "${GCCVER}")
# SLOT logic, make it represent gcc backend, as this is what matters most
# There are some special cases, so we allow it to be defined in the ebuild
# ATTN!! If you set SLOT in the ebuild, don't forget to make sure that
# BOOT_SLOT is also set properly!
[[ -z ${SLOT} ]] && SLOT="${GCCBRANCH}"
# possible future crosscompilation support
export CTARGET=${CTARGET:-${CHOST}}
is_crosscompile() {
[[ ${CHOST} != ${CTARGET} ]]
}
# Bootstrap CTARGET and SLOT logic. For now BOOT_TARGET=CHOST is "guaranteed" by
# profiles, so mostly watch out for the right SLOT used in the bootstrap.
# As above, with SLOT, it may need to be defined in the ebuild
BOOT_TARGET=${CTARGET}
[[ -z ${BOOT_SLOT} ]] && BOOT_SLOT=${SLOT}
# set our install locations
PREFIX=${GNATBUILD_PREFIX:-/usr} # not sure we need this hook, but may be..
LIBPATH=${PREFIX}/$(get_libdir)/${PN}/${CTARGET}/${SLOT}
LIBEXECPATH=${PREFIX}/libexec/${PN}/${CTARGET}/${SLOT}
INCLUDEPATH=${LIBPATH}/include
BINPATH=${PREFIX}/${CTARGET}/${PN}-bin/${SLOT}
DATAPATH=${PREFIX}/share/${PN}-data/${CTARGET}/${SLOT}
# ATTN! the one below should match the path defined in eselect-gnat module
CONFIG_PATH="/usr/share/gnat/eselect"
gnat_profile="${CTARGET}-${PN}-${SLOT}"
gnat_config_file="${CONFIG_PATH}/${gnat_profile}"
# ebuild globals
if [[ ${PN} == "${PN_GnatPro}" ]] && [[ ${GNATMAJOR} == "3" ]]; then
DEPEND="x86? ( >=app-shells/tcsh-6.0 )"
fi
S="${WORKDIR}/gcc-${GCCVER}"
# bootstrap globals, common to src_unpack and src_compile
GNATBOOT="${WORKDIR}/usr"
GNATBUILD="${WORKDIR}/build"
# necessary for detecting lib locations and creating env.d entry
#XGCC="${GNATBUILD}/gcc/xgcc -B${GNATBUILD}/gcc"
#----<< globals and SLOT >>----
# set SRC_URI's in ebuilds for now
#----<< support checks >>----
# skipping this section - do not care about hardened/multilib for now
#---->> specs + env.d logic <<----
# TODO!!!
# set MANPATH, etc..
#----<< specs + env.d logic >>----
#---->> some helper functions <<----
is_multilib() {
[[ ${GCCMAJOR} < 3 ]] && return 1
case ${CTARGET} in
mips64*|powerpc64*|s390x*|sparc64*|x86_64*)
has_multilib_profile ;;
*) false ;;
esac
}
# adapted from toolchain,
# left only basic multilib functionality and cut off mips stuff
create_specs_file() {
einfo "Creating a vanilla gcc specs file"
"${WORKDIR}"/build/gcc/xgcc -dumpspecs > "${WORKDIR}"/build/vanilla.specs
}
# eselect stuff taken straight from toolchain.eclass and greatly simplified
add_profile_eselect_conf() {
local gnat_config_file=$1
local abi=$2
local var
echo >> "${D}/${gnat_config_file}"
if ! is_multilib ; then
echo " ctarget=${CTARGET}" >> "${D}/${gnat_config_file}"
else
echo "[${abi}]" >> "${D}/${gnat_config_file}"
var="CTARGET_${abi}"
if [[ -n ${!var} ]] ; then
echo " ctarget=${!var}" >> "${D}/${gnat_config_file}"
else
var="CHOST_${abi}"
if [[ -n ${!var} ]] ; then
echo " ctarget=${!var}" >> "${D}/${gnat_config_file}"
else
echo " ctarget=${CTARGET}" >> "${D}/${gnat_config_file}"
fi
fi
fi
var="CFLAGS_${abi}"
if [[ -n ${!var} ]] ; then
echo " cflags=${!var}" >> "${D}/${gnat_config_file}"
fi
}
create_eselect_conf() {
local abi
dodir ${CONFIG_PATH}
echo "[global]" > "${D}/${gnat_config_file}"
echo " version=${CTARGET}-${SLOT}" >> "${D}/${gnat_config_file}"
echo " binpath=${BINPATH}" >> "${D}/${gnat_config_file}"
echo " libexecpath=${LIBEXECPATH}" >> "${D}/${gnat_config_file}"
echo " ldpath=${LIBPATH}" >> "${D}/${gnat_config_file}"
echo " manpath=${DATAPATH}/man" >> "${D}/${gnat_config_file}"
echo " infopath=${DATAPATH}/info" >> "${D}/${gnat_config_file}"
echo " bin_prefix=${CTARGET}" >> "${D}/${gnat_config_file}"
for abi in $(get_all_abis) ; do
add_profile_eselect_conf "${gnat_config_file}" "${abi}"
done
}
should_we_eselect_gnat() {
# we only want to switch compilers if installing to / or /tmp/stage1root
[[ ${ROOT} == "/" ]] || return 1
# if the current config is invalid, we definitely want a new one
# Note: due to bash quirkiness, the following must not be 1 line
local curr_config
curr_config=$(eselect --colour=no gnat show | grep ${CTARGET} | awk '{ print $1 }') || return 0
[[ -z ${curr_config} ]] && return 0
# The logic is basically "try to keep the same profile if possible"
if [[ ${curr_config} == ${CTARGET}-${PN}-${SLOT} ]] ; then
return 0
else
elog "The current gcc config appears valid, so it will not be"
elog "automatically switched for you. If you would like to"
elog "switch to the newly installed gcc version, do the"
elog "following:"
echo
elog "eselect gnat set <profile>"
echo
ebeep
return 1
fi
}
# active compiler selection, called from pkg_postinst
do_gnat_config() {
eselect gnat set ${CTARGET}-${PN}-${SLOT} &> /dev/null
elog "The following gnat profile has been activated:"
elog "${CTARGET}-${PN}-${SLOT}"
elog ""
elog "The compiler has been installed as gnatgcc, and the coverage testing"
elog "tool as gnatgcov."
elog ""
elog "Ada handling in Gentoo allows you to have multiple gnat variants"
elog "installed in parallel and automatically manage Ada libs."
elog "Please take a look at the Ada project page for some documentation:"
elog "http://www.gentoo.org/proj/en/prog_lang/ada/index.xml"
}
# Taken straight from the toolchain.eclass. Only removed the "obsolete hunk"
#
# The purpose of this DISGUSTING gcc multilib hack is to allow 64bit libs
# to live in lib instead of lib64 where they belong, with 32bit libraries
# in lib32. This hack has been around since the beginning of the amd64 port,
# and we're only now starting to fix everything that's broken. Eventually
# this should go away.
#
# Travis Tilley <lv@gentoo.org> (03 Sep 2004)
#
disgusting_gcc_multilib_HACK() {
local config
local libdirs
if has_multilib_profile ; then
case $(tc-arch) in
amd64)
config="i386/t-linux64"
libdirs="../$(get_abi_LIBDIR amd64) ../$(get_abi_LIBDIR x86)" \
;;
ppc64)
config="rs6000/t-linux64"
libdirs="../$(get_abi_LIBDIR ppc64) ../$(get_abi_LIBDIR ppc)" \
;;
esac
else
die "Your profile is no longer supported by portage."
fi
einfo "updating multilib directories to be: ${libdirs}"
sed -i -e "s:^MULTILIB_OSDIRNAMES.*:MULTILIB_OSDIRNAMES = ${libdirs}:" "${S}"/gcc/config/${config}
}
#---->> pkg_* <<----
gnatbuild_pkg_setup() {
debug-print-function ${FUNCNAME} $@
# Setup variables which would normally be in the profile
if is_crosscompile ; then
multilib_env ${CTARGET}
fi
# we dont want to use the installed compiler's specs to build gnat!
unset GCC_SPECS
}
gnatbuild_pkg_postinst() {
if should_we_eselect_gnat; then
do_gnat_config
else
eselect gnat update
fi
# if primary compiler list is empty, add this profile to the list, so
# that users are not left without active compilers (making sure that
# libs are getting built for at least one)
elog
. ${GnatCommon} || die "failed to source common code"
if [[ ! -f ${PRIMELIST} ]] || [[ ! -s ${PRIMELIST} ]]; then
echo "${gnat_profile}" > ${PRIMELIST}
elog "The list of primary compilers was empty and got assigned ${gnat_profile}."
fi
elog "Please edit ${PRIMELIST} and list there gnat profiles intended"
elog "for common use."
}
gnatbuild_pkg_postrm() {
# "eselect gnat update" now removes the env.d file if the corresponding
# gnat profile was unmerged
eselect gnat update
elog "If you just unmerged the last gnat in this SLOT, your active gnat"
elog "profile got unset. Please check what eselect gnat show tells you"
elog "and set the desired profile"
}
#---->> pkg_* <<----
#---->> src_* <<----
# common unpack stuff
gnatbuild_src_unpack() {
debug-print-function ${FUNCNAME} $@
if [[ -z "$1" ]]; then
gnatbuild_src_unpack all
return $?
fi
while [ "$1" ]; do
case $1 in
base_unpack)
unpack ${A}
pax-mark E $(find ${GNATBOOT} -name gnat1)
cd "${S}"
# patching gcc sources, following the toolchain
# first, the common patches
if [[ -d "${FILESDIR}"/patches ]] && [[ ! -z $(ls "${FILESDIR}"/patches/*.patch 2>/dev/null) ]] ; then
EPATCH_MULTI_MSG="Applying common Gentoo patches ..." \
epatch "${FILESDIR}"/patches/*.patch
fi
#
# then per SLOT
if [[ -d "${FILESDIR}"/patches/${SLOT} ]] && [[ ! -z $(ls "${FILESDIR}"/patches/${SLOT}/*.patch 2>/dev/null) ]] ; then
EPATCH_MULTI_MSG="Applying SLOT-specific Gentoo patches ..." \
epatch "${FILESDIR}"/patches/${SLOT}/*.patch
fi
# Replacing obsolete head/tail with POSIX compliant ones
ht_fix_file */configure
# if ! is_crosscompile && is_multilib && \
# [[ ( $(tc-arch) == "amd64" || $(tc-arch) == "ppc64" ) && -z ${SKIP_MULTILIB_HACK} ]] ; then
# disgusting_gcc_multilib_HACK || die "multilib hack failed"
# fi
# Fixup libtool to correctly generate .la files with portage
cd "${S}"
elibtoolize --portage --shallow --no-uclibc
gnuconfig_update
# update configure files
einfo "Fixing misc issues in configure files"
for f in $(grep -l 'autoconf version 2.13' $(find "${S}" -name configure)) ; do
ebegin " Updating ${f}"
patch "${f}" "${FILESDIR}"/gcc-configure-LANG.patch >& "${T}"/configure-patch.log \
|| eerror "Please file a bug about this"
eend $?
done
# this is only needed for gnat-gpl-4.1 and breaks for gnat-gcc, so
# this block was moved to corresponding ebuild
# pushd "${S}"/gnattools &> /dev/null
# eautoconf
# popd &> /dev/null
;;
common_prep)
# Prepare the gcc source directory
cd "${S}/gcc"
touch cstamp-h.in
touch ada/[es]info.h
touch ada/nmake.ad[bs]
# set the compiler name to gnatgcc
for i in `find ada/ -name '*.ad[sb]'`; do \
sed -i -e "s/\"gcc\"/\"gnatgcc\"/g" ${i}; \
done
# add -fPIC flag to shared libs for 3.4* backend
if [ "3.4" == "${GCCBRANCH}" ] ; then
cd ada
epatch "${FILESDIR}"/gnat-Make-lang.in.patch
fi
# gcc 4.3 sources seem to have a common omission of $(DESTDIR),
# that leads to make install trying to rm -f file on live system.
# As we do not need this rm, we simply remove the whole line
if [ "4.3" == "${GCCBRANCH}" ] ; then
sed -i -e "/\$(RM) \$(bindir)/d" "${S}"/gcc/ada/Make-lang.in
fi
mkdir -p "${GNATBUILD}"
;;
all)
gnatbuild_src_unpack base_unpack common_prep
;;
esac
shift
done
}
# for now just dont run default configure
gnatbuild_src_configure() {
# do nothing
:
}
# it would be nice to split configure and make steps
# but both need to operate inside specially tuned evironment
# so just do sections for now (as in eclass section of handbook)
# sections are: configure, make-tools, bootstrap,
# gnatlib_and_tools, gnatlib-shared
gnatbuild_src_compile() {
debug-print-function ${FUNCNAME} $@
if [[ -z "$1" ]]; then
gnatbuild_src_compile all
return $?
fi
if [[ "all" == "$1" ]]
then # specialcasing "all" to avoid scanning sources unnecessarily
gnatbuild_src_compile configure make-tools \
bootstrap gnatlib_and_tools gnatlib-shared
else
# Set some paths to our bootstrap compiler.
export PATH="${GNATBOOT}/bin:${PATH}"
# !ATTN! the bootstrap compilers have a very simplystic structure,
# so many paths are not identical to the installed ones.
# Plus it was simplified even more in new releases.
if [[ ${BOOT_SLOT} > 4.1 ]] ; then
case $(tc-arch) in
arm)
GNATLIB="${GNATBOOT}/lib/gcc/${BOOT_TARGET}/${BOOT_SLOT}"
;;
*)
GNATLIB="${GNATBOOT}/lib"
;;
esac
else
GNATLIB="${GNATBOOT}/lib/gnatgcc/${BOOT_TARGET}/${BOOT_SLOT}"
fi
export CC="${GNATBOOT}/bin/gnatgcc"
# CPATH is supposed to be applied for any language, thus
# superceding either of C/CPLUS/OBJC_INCLUDE_PATHs
export CPATH="${GNATLIB}/include"
#export INCLUDE_DIR="${GNATLIB}/include"
#export C_INCLUDE_PATH="${GNATLIB}/include"
#export CPLUS_INCLUDE_PATH="${GNATLIB}/include"
export LIB_DIR="${GNATLIB}"
export LDFLAGS="-L${GNATLIB}"
# additional vars from gnuada and elsewhere
#export LD_RUN_PATH="${LIBPATH}"
export LIBRARY_PATH="${GNATLIB}"
#export LD_LIBRARY_PATH="${GNATLIB}"
# export COMPILER_PATH="${GNATBOOT}/bin/"
export ADA_OBJECTS_PATH="${GNATLIB}/adalib"
export ADA_INCLUDE_PATH="${GNATLIB}/adainclude"
einfo "CC=${CC},
ADA_INCLUDE_PATH=${ADA_INCLUDE_PATH},
LDFLAGS=${LDFLAGS},
PATH=${PATH}"
while [ "$1" ]; do
case $1 in
configure)
debug-print-section configure
# Configure gcc
local confgcc
# some cross-compile logic from toolchain
confgcc="${confgcc} --host=${CHOST}"
if is_crosscompile || tc-is-cross-compiler ; then
confgcc="${confgcc} --target=${CTARGET}"
fi
[[ -n ${CBUILD} ]] && confgcc="${confgcc} --build=${CBUILD}"
# Native Language Support
if use nls ; then
confgcc="${confgcc} --enable-nls --without-included-gettext"
else
confgcc="${confgcc} --disable-nls"
fi
if version_is_at_least 4.6 ; then
confgcc="${confgcc} --enable-lto"
elif tc_version_is_at_least 4.5 ; then
confgcc="${confgcc} --disable-lto --disable-plugin"
fi
# reasonably sane globals (from toolchain)
# also disable mudflap and ssp
confgcc="${confgcc} \
--with-system-zlib \
--disable-checking \
--disable-werror \
--disable-libmudflap \
--disable-libssp \
--disable-altivec \
--disable-fixed-point \
--disable-libgcj \
--disable-libcilkrts \
--disable-libsanitizer \
--disable-libunwind-exceptions"
if in_iuse openmp ; then
# Make sure target has pthreads support. #326757 #335883
# There shouldn't be a chicken&egg problem here as openmp won't
# build without a C library, and you can't build that w/out
# already having a compiler ...
if ! is_crosscompile || \
$(tc-getCPP ${CTARGET}) -E - <<<"#include <pthread.h>" >& /dev/null
then
case $(tc-arch) in
arm)
confgcc="${confgcc} --disable-libgomp"
;;
*)
confgcc="${confgcc} $(use_enable openmp libgomp)"
;;
esac
else
# Force disable as the configure script can be dumb #359855
confgcc="${confgcc} --disable-libgomp"
fi
else
# For gcc variants where we don't want openmp (e.g. kgcc)
confgcc="${confgcc} --disable-libgomp"
fi
# ACT's gnat-gpl does not like libada for whatever reason..
if version_is_at_least 4.2 ; then
confgcc="${confgcc} --enable-libada"
# else
# einfo "ACT's gnat-gpl does not like libada, disabling"
# confgcc="${confgcc} --disable-libada"
fi
# set some specifics available in later versions
if version_is_at_least 4.7 ; then
einfo "setting gnat thread model"
confgcc="${confgcc} --enable-threads=posix"
confgcc="${confgcc} --enable-shared=boehm-gc,ada,libada"
elif version_is_at_least 4.3 ; then
confgcc="${confgcc} --enable-threads=gnat"
confgcc="${confgcc} --enable-shared=boehm-gc,ada,libada"
else
confgcc="${confgcc} --enable-threads=posix"
confgcc="${confgcc} --enable-shared"
fi
# multilib support
if is_multilib ; then
confgcc="${confgcc} --enable-multilib"
else
confgcc="${confgcc} --disable-multilib"
fi
# __cxa_atexit is "essential for fully standards-compliant handling of
# destructors", but apparently requires glibc.
if [[ ${CTARGET} == *-gnu* ]] ; then
confgcc="${confgcc} --enable-__cxa_atexit"
confgcc="${confgcc} --enable-clocale=gnu"
fi
einfo "confgcc=${confgcc}"
export gcc_cv_lto_plugin=1 # okay to build, default to opt-in
export gcc_cv_prog_makeinfo_modern=no
export ac_cv_have_x='have_x=yes ac_x_includes= ac_x_libraries='
export gcc_cv_libc_provides_ssp=yes
# need to strip graphite/lto flags or we'll get the
# dreaded C compiler cannot create executables...
# error.
strip-flags
replace-flags -O? -O2
filter-flags '-mabi*' -m31 -m32 -m64
filter-flags -frecord-gcc-switches
filter-flags -mno-rtm -mno-htm
#filter-flags -floop-interchange -floop-strip-mine -floop-block
#filter-flags -fuse-linker-plugin -flto*
cd "${GNATBUILD}"
CC="${CC}" CFLAGS="${CFLAGS}" CXXFLAGS="${CFLAGS}" "${S}"/configure \
--prefix="${PREFIX}" \
--bindir="${BINPATH}" \
--includedir="${INCLUDEPATH}" \
--libdir="${LIBPATH}" \
--libexecdir="${LIBEXECPATH}" \
--datadir="${DATAPATH}" \
--mandir="${DATAPATH}"/man \
--infodir="${DATAPATH}"/info \
--enable-languages=c,ada \
--with-gcc \
${confgcc} || die "configure failed"
;;
make-tools)
debug-print-section make-tools
# Compile helper tools
cd "${GNATBOOT}"
cp "${S}"/gcc/ada/xtreeprs.adb .
cp "${S}"/gcc/ada/xsinfo.adb .
cp "${S}"/gcc/ada/xeinfo.adb .
cp "${S}"/gcc/ada/xnmake.adb .
cp "${S}"/gcc/ada/xutil.ad{s,b} .
if (( ${GNATMINOR} > 5 )) ; then
cp "${S}"/gcc/ada/einfo.ad{s,b} .
cp "${S}"/gcc/ada/csinfo.adb .
cp "${S}"/gcc/ada/ceinfo.adb .
fi
gnatmake xtreeprs && \
gnatmake xsinfo && \
gnatmake xeinfo && \
gnatmake xnmake || die "building helper tools"
mv xeinfo xnmake xsinfo xtreeprs bin/
;;
bootstrap)
debug-print-section bootstrap
# and, finally, the build itself
cd "${GNATBUILD}"
emake \
LDFLAGS="${LDFLAGS}" \
LIBPATH="${LIBPATH}" \
CC="${CC}" \
bootstrap-lean || die "bootstrap failed"
;;
gnatlib_and_tools)
debug-print-section gnatlib_and_tools
einfo "building gnatlib_and_tools"
cd "${GNATBUILD}"
emake -j1 -C gcc gnatlib_and_tools || \
die "gnatlib_and_tools failed"
;;
gnatlib-shared)
debug-print-section gnatlib-shared
einfo "building shared lib"
cd "${GNATBUILD}"
rm -f gcc/ada/rts/*.{o,ali} || die
#otherwise make tries to reuse already compiled (without -fPIC) objs..
emake -j1 -C gcc gnatlib-shared LIBRARY_VERSION="${GCCBRANCH}" || \
die "gnatlib-shared failed"
;;
esac
shift
done # while
fi # "all" == "$1"
}
# -- end gnatbuild_src_compile
gnatbuild_src_install() {
debug-print-function ${FUNCNAME} $@
if [[ -z "$1" ]] ; then
gnatbuild_src_install all
return $?
fi
while [ "$1" ]; do
case $1 in
install) # runs provided make install
debug-print-section install
# Looks like we need an access to the bootstrap compiler here too
# as gnat apparently wants to compile something during the installation
# The spotted obuser was xgnatugn, used to process gnat_ugn_urw.texi,
# during preparison of the docs.
export PATH="${GNATBOOT}/bin:${PATH}"
if [[ ${BOOT_SLOT} > 4.1 ]] ; then
GNATLIB="${GNATBOOT}/lib"
else
GNATLIB="${GNATBOOT}/lib/gnatgcc/${BOOT_TARGET}/${BOOT_SLOT}"
fi
export CC="${GNATBOOT}/bin/gnatgcc"
export INCLUDE_DIR="${GNATLIB}/include"
export C_INCLUDE_PATH="${GNATLIB}/include"
export CPLUS_INCLUDE_PATH="${GNATLIB}/include"
export LIB_DIR="${GNATLIB}"
export LDFLAGS="-L${GNATLIB}"
export ADA_OBJECTS_PATH="${GNATLIB}/adalib"
export ADA_INCLUDE_PATH="${GNATLIB}/adainclude"
# Do not allow symlinks in /usr/lib/gcc/${CHOST}/${MY_PV}/include as
# this can break the build.
for x in "${GNATBUILD}"/gcc/include/* ; do
if [ -L ${x} ] ; then
rm -f ${x}
fi
done
# Remove generated headers, as they can cause things to break
# (ncurses, openssl, etc). (from toolchain.eclass)
for x in $(find "${WORKDIR}"/build/gcc/include/ -name '*.h') ; do
grep -q 'It has been auto-edited by fixincludes from' "${x}" \
&& rm -f "${x}"
done
cd "${GNATBUILD}"
make DESTDIR="${D}" install || die
# Disable RANDMMAP so PCH works. #301299
pax-mark r "${D}"${LIBEXECPATH}/{gnat1,cc1,cc1plus}
# Quiet QA warnings, wait for adacore exec stack patch in gcc 7
export QA_EXECSTACK="${BINPATH:1}/gnatls ${BINPATH:1}/gnatname
${BINPATH:1}/gnatmake ${BINPATH:1}/gnatclean ${BINPATH:1}/gnat"
if use doc ; then
if (( $(bc <<< "${GNATBRANCH} > 4.3") )) ; then
#make a convenience info link
ewarn "Yay! Math works."
dosym gnat_ugn.info ${DATAPATH}/info/gnat.info
fi
fi
;;
move_libs)
debug-print-section move_libs
# first we need to remove some stuff to make moving easier
rm -rf "${D}${LIBPATH}"/{32,include,libiberty.a}
# gcc insists on installing libs in its own place
mv "${D}${LIBPATH}/gcc/${CTARGET}/${GCCRELEASE}"/* "${D}${LIBPATH}"
mv "${D}${LIBEXECPATH}/gcc/${CTARGET}/${GCCRELEASE}"/* "${D}${LIBEXECPATH}"
# libgcc_s and, with gcc>=4.0, other libs get installed in multilib specific locations by gcc
# we pull everything together to simplify working environment
if has_multilib_profile ; then
case $(tc-arch) in
amd64)
mv "${D}${LIBPATH}"/../$(get_abi_LIBDIR amd64)/* "${D}${LIBPATH}"
mv "${D}${LIBPATH}"/../$(get_abi_LIBDIR x86)/* "${D}${LIBPATH}"/32
;;
ppc64)
# not supported yet, will have to be adjusted when we
# actually build gnat for that arch
;;
esac
fi
# force gnatgcc to use its own specs - versions prior to 3.4.6 read specs
# from system gcc location. Do the simple wrapper trick for now
# !ATTN! change this if eselect-gnat starts to follow eselect-compiler
cd "${D}${BINPATH}"
if [[ ${GCCVER} < 3.4.6 ]] ; then
# gcc 4.1 uses builtin specs. What about 4.0?
mv gnatgcc gnatgcc_2wrap
cat > gnatgcc << EOF
#! /bin/bash
# wrapper to cause gnatgcc read appropriate specs and search for the right .h
# files (in case no matching gcc is installed)
BINDIR=\$(dirname \$0)
# The paths in the next line have to be absolute, as gnatgcc may be called from
# any location
\${BINDIR}/gnatgcc_2wrap -specs="${LIBPATH}/specs" -I"${LIBPATH}/include" \$@
EOF
chmod a+x gnatgcc
else
local i
for i in cpp gcc gcov ; do
ln -s ${i} gnat${i}
done
fi
# earlier gnat's generate some Makefile's at generic location, need to
# move to avoid collisions
[ -f "${D}${PREFIX}"/share/gnat/Makefile.generic ] &&
mv "${D}${PREFIX}"/share/gnat/Makefile.* "${D}${DATAPATH}"
# use gid of 0 because some stupid ports don't have
# the group 'root' set to gid 0 (toolchain.eclass)
# chown -R root:0 "${D}${LIBPATH}"
;;
cleanup)
debug-print-section cleanup
rm -rf "${D}${LIBPATH}"/{gcc,install-tools,../lib{32,64}}
rm -rf "${D}${LIBEXECPATH}"/{gcc,install-tools}
# this one is installed by gcc and is a duplicate even here anyway
rm -f "${D}${BINPATH}/${CTARGET}-gcc-${GCCRELEASE}"
# remove duplicate docs
rm -f "${D}${DATAPATH}"/info/{dir,gcc,cpp}*
rm -rf "${D}${DATAPATH}"/man/man7/
# fix .la path for lto plugin
if use lto ; then
sed -i -e \
"/libdir=/c\libdir='${LIBEXECPATH}'" \
"${D}${LIBEXECPATH}"/liblto_plugin.la \
|| die "sed update of .la file failed!"
fi
;;
prep_env)
# instead of putting junk under /etc/env.d/gnat we recreate env files as
# needed with eselect
create_eselect_conf
;;
all)
gnatbuild_src_install install move_libs cleanup prep_env
;;
esac
shift
done # while
}
# -- end gnatbuild_src_install

View File

@ -1,115 +0,0 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: gnome-games.eclass
# @MAINTAINER:
# Gnome team <gnome@gentoo.org>
# @AUTHOR:
# Author: Pacho Ramos <pacho@gentoo.org>
# @BLURB: An eclass to build gnome-games.
# @DESCRIPTION:
# An eclass to build gnome-games using proper phases from gnome2 and
# games eclasses.
case "${EAPI:-0}" in
0|1)
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
2|3|4|5)
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
;;
esac
inherit autotools games gnome2
EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
if [[ ! ${_GNOME_GAMES} ]]; then
DEPEND=">=dev-util/intltool-0.50.2-r1"
RDEPEND="!gnome-extra/gnome-games"
# @FUNCTION: gnome-games_pkg_setup
# @DESCRIPTION:
# Set proper phase defaults
gnome-games_pkg_setup() {
debug-print-function ${FUNCNAME} "${@}"
games_pkg_setup
}
# @FUNCTION: gnome-games_src_prepare
# @DESCRIPTION:
# Set proper phase defaults
gnome-games_src_prepare() {
debug-print-function ${FUNCNAME} "${@}"
# Fix intltoolize broken file:
# https://bugs.launchpad.net/intltool/+bug/398571
intltoolize --force --copy --automake || die "intltoolize failed"
eautoreconf
gnome2_src_prepare
}
# @FUNCTION: gnome-games_src_configure
# @DESCRIPTION:
# Set proper phase defaults, relying on gnome2_src_configure
# and passing extra arguments from egamesconf (games.eclass)
gnome-games_src_configure() {
debug-print-function ${FUNCNAME} "${@}"
gnome2_src_configure \
--prefix="${GAMES_PREFIX}" \
--libdir="$(games_get_libdir)" \
--sysconfdir="${GAMES_SYSCONFDIR}" \
--localstatedir=/var \
--localedir=/usr/share/locale \
"$@"
}
# @FUNCTION: gnome-games_src_compile
# @DESCRIPTION:
# Set proper phase defaults
gnome-games_src_compile() {
debug-print-function ${FUNCNAME} "${@}"
gnome2_src_compile
}
# @FUNCTION: gnome-games_src_install
# @DESCRIPTION:
# Set proper phase defaults
gnome-games_src_install() {
debug-print-function ${FUNCNAME} "${@}"
gnome2_src_install
prepgamesdirs
}
# @FUNCTION: gnome-games_pkg_preinst
# @DESCRIPTION:
# Set proper phase defaults
gnome-games_pkg_preinst() {
debug-print-function ${FUNCNAME} "${@}"
gnome2_pkg_preinst
games_pkg_preinst
}
# @FUNCTION: gnome-games_pkg_postinst
# @DESCRIPTION:
# Set proper phase defaults
gnome-games_pkg_postinst() {
debug-print-function ${FUNCNAME} "${@}"
gnome2_pkg_postinst
games_pkg_postinst
}
# @FUNCTION: gnome-games_pkg_postrm
# @DESCRIPTION:
# Set proper phase defaults
gnome-games_pkg_postrm() {
debug-print-function ${FUNCNAME} "${@}"
gnome2_pkg_postrm
}
_GNOME_GAMES=1
fi

View File

@ -207,7 +207,9 @@ gnome2_gconf_uninstall() {
# @FUNCTION: gnome2_icon_savelist
# @DESCRIPTION:
# Find the icons that are about to be installed and save their location
# in the GNOME2_ECLASS_ICONS environment variable.
# in the GNOME2_ECLASS_ICONS environment variable. This is only
# necessary for eclass implementations that call
# gnome2_icon_cache_update conditionally.
# This function should be called from pkg_preinst.
gnome2_icon_savelist() {
has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
@ -218,8 +220,7 @@ gnome2_icon_savelist() {
# @FUNCTION: gnome2_icon_cache_update
# @DESCRIPTION:
# Updates Gtk+ icon cache files under /usr/share/icons if the current ebuild
# have installed anything under that location.
# Updates Gtk+ icon cache files under /usr/share/icons.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_icon_cache_update() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
@ -358,7 +359,8 @@ gnome2_scrollkeeper_update() {
# @FUNCTION: gnome2_schemas_savelist
# @DESCRIPTION:
# Find if there is any GSettings schema to install and save the list in
# GNOME2_ECLASS_GLIB_SCHEMAS variable.
# GNOME2_ECLASS_GLIB_SCHEMAS variable. This is only necessary for eclass
# implementations that call gnome2_schemas_update conditionally.
# This function should be called from pkg_preinst.
gnome2_schemas_savelist() {
has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
@ -370,7 +372,7 @@ gnome2_schemas_savelist() {
# @FUNCTION: gnome2_schemas_update
# @USAGE: gnome2_schemas_update
# @DESCRIPTION:
# Updates GSettings schemas if GNOME2_ECLASS_GLIB_SCHEMAS has some.
# Updates GSettings schemas.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_schemas_update() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"

View File

@ -1,6 +1,13 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @DEAD
# Michał Górny <mgorny@gentoo.org> (17 Jun 2018)
# This eclass was used for old versions of Mono applications, and all
# versions using it have been removed already. It's not maintained,
# uses obsolete (even removed) eclasses, outdated URIs, it has
# documentation problems. Removal in 30 days.
# @ECLASS: go-mono.eclass
# @MAINTAINER:
# dotnet@gentoo.org

View File

@ -1,7 +1,7 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: golang-build.eclass
# @ECLASS: golang-base.eclass
# @MAINTAINER:
# William Hubbs <williamh@gentoo.org>
# @BLURB: Eclass that provides base functions for Go packages.
@ -22,7 +22,7 @@ if [[ -z ${_GOLANG_BASE} ]]; then
_GOLANG_BASE=1
DEPEND=">=dev-lang/go-1.8"
DEPEND=">=dev-lang/go-1.9"
# Do not complain about CFLAGS etc since go projects do not use them.
QA_FLAGS_IGNORED='.*'

View File

@ -115,13 +115,6 @@ else
DEPEND="${DEPEND} nls? ( >=sys-devel/gettext-0.17 )"
fi
if [[ ${SLOT} == "0.10" ]]; then
RDEPEND="${RDEPEND}
abi_x86_32? (
!app-emulation/emul-linux-x86-gstplugins[-abi_x86_32(-)]
)"
fi
DEPEND="${DEPEND} ${RDEPEND}"
# @FUNCTION: gstreamer_environment_reset

View File

@ -1,6 +1,13 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @DEAD
# Michał Górny <mgorny@gentoo.org> (17 Jun 2018)
# This eclass was used for old versions of split gtk-sharp modules,
# and all packages/versions using it have been removed already.
# It's not maintained, uses obsolete eclasses, outdated URIs,
# it has documentation problems. Removal in 30 days.
# @ECLASS: gtk-sharp-module.eclass
# @MAINTAINER:
# dotnet@gentoo.org

View File

@ -1,502 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: intel-sdp.eclass
# @MAINTAINER:
# Justin Lecher <jlec@gentoo.org>
# Sci Team <sci@gentoo.org>
# @BLURB: Handling of Intel's Software Development Products package management
if [[ ! ${_INTEL_SDP_ECLASS_} ]]; then
case "${EAPI:-0}" in
4|5) ;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
# @ECLASS-VARIABLE: INTEL_DID
# @DEFAULT_UNSET
# @DESCRIPTION:
# The package download ID from Intel.
# To find out its value, see the links to download in
# https://registrationcenter.intel.com/RegCenter/MyProducts.aspx
#
# e.g. 2504
#
# Must be defined before inheriting the eclass
# @ECLASS-VARIABLE: INTEL_DPN
# @DEFAULT_UNSET
# @DESCRIPTION:
# The package name to download from Intel.
# To find out its value, see the links to download in
# https://registrationcenter.intel.com/RegCenter/MyProducts.aspx
#
# e.g. parallel_studio_xe
#
# Must be defined before inheriting the eclass
# @ECLASS-VARIABLE: INTEL_DPV
# @DEFAULT_UNSET
# @DESCRIPTION:
# The package download version from Intel.
# To find out its value, see the links to download in
# https://registrationcenter.intel.com/RegCenter/MyProducts.aspx
#
# e.g. 2011_sp1_update2
#
# Must be defined before inheriting the eclass
# @ECLASS-VARIABLE: INTEL_TARX
# @DESCRIPTION:
# The package extention.
# To find out its value, see the links to download in
# https://registrationcenter.intel.com/RegCenter/MyProducts.aspx
#
# e.g. tar.gz
#
# Must be defined before inheriting the eclass
: ${INTEL_TARX:=tgz}
# @ECLASS-VARIABLE: INTEL_SUBDIR
# @DEFAULT_UNSET
# @DESCRIPTION:
# The package sub-directory where it will end-up in /opt/intel
# To find out its value, you have to do a raw install from the Intel tar ball
# @ECLASS-VARIABLE: INTEL_SKIP_LICENSE
# @DEFAULT_UNSET
# @DESCRIPTION:
# Possibility to skip the mandatory check for licenses. Only set this if there
# is really no fix.
# @ECLASS-VARIABLE: INTEL_RPMS_DIR
# @DESCRIPTION:
# Main subdirectory which contains the rpms to extract.
: ${INTEL_RPMS_DIR:=rpm}
# @ECLASS-VARIABLE: INTEL_X86
# @DESCRIPTION:
# 32bit arch in rpm names
#
# e.g. i484
: ${INTEL_X86:=i486}
# @ECLASS-VARIABLE: INTEL_BIN_RPMS
# @DESCRIPTION:
# Functional name of rpm without any version/arch tag
#
# e.g. compilerprof
#
# if the rpm is located in a directory different to INTEL_RPMS_DIR you can
# specify the full path
#
# e.g. CLI_install/rpm/intel-vtune-amplifier-xe-cli
: ${INTEL_BIN_RPMS:=""}
# @ECLASS-VARIABLE: INTEL_DAT_RPMS
# @DESCRIPTION:
# Functional name of rpm of common data which are arch free
# without any version tag
#
# e.g. openmp
#
# if the rpm is located in a directory different to INTEL_RPMS_DIR you can
# specify the full path
#
# e.g. CLI_install/rpm/intel-vtune-amplifier-xe-cli-common
: ${INTEL_DAT_RPMS:=""}
# @ECLASS-VARIABLE: INTEL_SINGLE_ARCH
# @DESCRIPTION:
# Unset, if only the multilib package will be provided by intel
: ${INTEL_SINGLE_ARCH:=true}
# @ECLASS-VARIABLE: INTEL_SDP_DB
# @DESCRIPTION:
# Full path to intel registry db
INTEL_SDP_DB="${EROOT%/}"/opt/intel/intel-sdp-products.db
inherit check-reqs eutils multilib versionator
_INTEL_PV1=$(get_version_component_range 1)
_INTEL_PV2=$(get_version_component_range 2)
_INTEL_PV3=$(get_version_component_range 3)
_INTEL_PV4=$(get_version_component_range 4)
_INTEL_URI="http://registrationcenter-download.intel.com/irc_nas/${INTEL_DID}/${INTEL_DPN}"
if [ ${INTEL_SINGLE_ARCH} == true ]; then
SRC_URI="
amd64? ( multilib? ( ${_INTEL_URI}_${INTEL_DPV}.${INTEL_TARX} ) )
amd64? ( !multilib? ( ${_INTEL_URI}_${INTEL_DPV}_intel64.${INTEL_TARX} ) )
x86? ( ${_INTEL_URI}_${INTEL_DPV}_ia32.${INTEL_TARX} )"
else
SRC_URI="${_INTEL_URI}_${INTEL_DPV}.${INTEL_TARX}"
fi
LICENSE="Intel-SDP"
# Future work, #394411
#SLOT="${_INTEL_PV1}.${_INTEL_PV2}"
SLOT="0"
IUSE="examples multilib"
RESTRICT="mirror"
RDEPEND=""
DEPEND="app-arch/rpm2targz"
_INTEL_SDP_YEAR=${INTEL_DPV%_update*}
_INTEL_SDP_YEAR=${INTEL_DPV%_sp*}
# @ECLASS-VARIABLE: INTEL_SDP_DIR
# @DESCRIPTION:
# Full rootless path to installation dir
INTEL_SDP_DIR="opt/intel/${INTEL_SUBDIR}-${_INTEL_SDP_YEAR:-${_INTEL_PV1}}.${_INTEL_PV3}.${_INTEL_PV4}"
# @ECLASS-VARIABLE: INTEL_SDP_EDIR
# @DESCRIPTION:
# Full rooted path to installation dir
INTEL_SDP_EDIR="${EROOT%/}/${INTEL_SDP_DIR}"
S="${WORKDIR}"
QA_PREBUILT="${INTEL_SDP_DIR}/*"
# @ECLASS-VARIABLE: INTEL_ARCH
# @DEFAULT_UNSET
# @DESCRIPTION:
# Intels internal names of the arches; will be set at runtime accordingly
#
# e.g. amd64-multilib -> INTEL_ARCH="intel64 ia32"
# @FUNCTION: _isdp_big-warning
# @USAGE: [pre-check | test-failed]
# @INTERNAL
# @DESCRIPTION:
# warn user that we really require a license
_isdp_big-warning() {
debug-print-function ${FUNCNAME} "${@}"
case ${1} in
pre-check )
echo ""
ewarn "License file not found!"
;;
test-failed )
echo
ewarn "Function test failed. Most probably due to an invalid license."
ewarn "This means you already tried to bypass the license check once."
;;
esac
echo ""
ewarn "Make sure you have received an Intel license."
ewarn "To receive a non-commercial license, you need to register at:"
ewarn "https://software.intel.com/en-us/qualify-for-free-software"
ewarn "Install the license file into ${INTEL_SDP_EDIR}/licenses/"
case ${1} in
pre-check )
ewarn "before proceeding with installation of ${P}"
echo ""
;;
* )
echo ""
;;
esac
}
# @FUNCTION: _isdp_version_test
# @INTERNAL
# @DESCRIPTION:
# Testing for valid license by asking for version information of the compiler
_isdp_version_test() {
debug-print-function ${FUNCNAME} "${@}"
local comp comp_full arch warn
case ${PN} in
ifc )
debug-print "Testing ifort"
comp=ifort
;;
icc )
debug-print "Testing icc"
comp=icc
;;
*)
die "${PN} is not supported for testing"
;;
esac
for arch in ${INTEL_ARCH}; do
case ${EBUILD_PHASE} in
install )
comp_full="${ED}/${INTEL_SDP_DIR}/bin/${arch}/${comp}"
;;
postinst )
comp_full="${INTEL_SDP_EDIR}/bin/${arch}/${comp}"
;;
* )
ewarn "Compile test not supported in ${EBUILD_PHASE}"
continue
;;
esac
debug-print "LD_LIBRARY_PATH=\"${INTEL_SDP_EDIR}/bin/${arch}/\" \"${comp_full}\" -V"
LD_LIBRARY_PATH="${INTEL_SDP_EDIR}/bin/${arch}/" "${comp_full}" -V &>/dev/null
[[ $? -ne 0 ]] && warn=yes
done
[[ "${warn}" == "yes" ]] && _isdp_big-warning test-failed
}
# @FUNCTION: _isdp_run-test
# @INTERNAL
# @DESCRIPTION:
# Test if installed compiler is working
_isdp_run-test() {
debug-print-function ${FUNCNAME} "${@}"
if [[ -z ${INTEL_SKIP_LICENSE} ]]; then
case ${PN} in
ifc | icc )
_isdp_version_test ;;
* )
debug-print "No test available for ${PN}"
;;
esac
fi
}
# @FUNCTION: intel-sdp_pkg_pretend
# @DESCRIPTION:
#
# * Check that the user has a (valid) license file before going on.
#
# * Check for space requirements being fullfilled
intel-sdp_pkg_pretend() {
debug-print-function ${FUNCNAME} "${@}"
local warn=1 dir dirs ret arch a p
: ${CHECKREQS_DISK_BUILD:=256M}
check-reqs_pkg_pretend
if [[ -z ${INTEL_SKIP_LICENSE} ]]; then
if echo ${INTEL_LICENSE_FILE} | grep -q @; then
einfo "Looks like you are using following license server:"
einfo " ${INTEL_LICENSE_FILE}"
return 0
fi
dirs=(
"${INTEL_SDP_EDIR}/licenses"
"${INTEL_SDP_EDIR}/Licenses"
"${EPREFIX}/opt/intel/licenses"
)
for dir in "${dirs[@]}" ; do
ebegin "Checking for a license in: ${dir}"
#maybe use nullglob or [[ $(echo ${dir/*lic) != "${dir}/*lic" ]]
[[ $( ls "${dir}"/*lic 2>/dev/null ) ]]; ret=$?
eend ${ret}
if [[ ${ret} == "0" ]]; then
warn=${ret}
break
fi
done
if [[ ${warn} == "1" ]]; then
_isdp_big-warning pre-check
die "Could not find license file"
fi
else
eqawarn "The ebuild doesn't check for presents of a proper intel license!"
eqawarn "This shouldn't be done unless there is a serious reason."
fi
}
# @FUNCTION: intel-sdp_pkg_setup
# @DESCRIPTION:
# Setting up and sorting some internal variables
intel-sdp_pkg_setup() {
debug-print-function ${FUNCNAME} "${@}"
local arch a p
if use x86; then
arch=${INTEL_X86}
INTEL_ARCH="ia32"
elif use amd64; then
arch=x86_64
INTEL_ARCH="intel64"
if has_multilib_profile; then
arch="x86_64 ${INTEL_X86}"
INTEL_ARCH="intel64 ia32"
fi
fi
INTEL_RPMS=()
INTEL_RPMS_FULL=()
if [[ $(declare -p INTEL_BIN_RPMS) = "declare -a "* ]] ; then
_INTEL_BIN_RPMS=( ${INTEL_BIN_RPMS[@]} )
else
read -r -d '' -a _INTEL_BIN_RPMS <<<"${INTEL_BIN_RPMS}"
fi
for p in "${_INTEL_BIN_RPMS[@]}"; do
for a in ${arch}; do
if [ ${p} == $(basename ${p}) ]; then
INTEL_RPMS+=( intel-${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.${a}.rpm )
else
INTEL_RPMS_FULL+=( ${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.${a}.rpm )
fi
done
done
if [[ $(declare -p INTEL_DAT_RPMS) = "declare -a "* ]] ; then
_INTEL_DAT_RPMS=( ${INTEL_DAT_RPMS[@]} )
else
read -r -d '' -a _INTEL_DAT_RPMS <<<"${INTEL_DAT_RPMS}"
fi
for p in "${_INTEL_DAT_RPMS[@]}"; do
if [ ${p} == $(basename ${p}) ]; then
INTEL_RPMS+=( intel-${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.noarch.rpm )
else
INTEL_RPMS_FULL+=( ${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.noarch.rpm )
fi
done
}
# @FUNCTION: intel-sdp_src_unpack
# @DESCRIPTION:
# Unpacking necessary rpms from tarball, extract them and rearrange the output.
intel-sdp_src_unpack() {
local l r subdir rb t list=() debug_list
for t in ${A}; do
for r in "${INTEL_RPMS[@]}"; do
rpmdir=${t%%.*}/${INTEL_RPMS_DIR}
list+=( ${rpmdir}/${r} )
done
for r in "${INTEL_RPMS_FULL[@]}"; do
list+=( ${t%%.*}/${r} )
done
debug_list="$(IFS=$'\n'; echo ${list[@]} )"
debug-print "Adding to decompression list:"
debug-print ${debug_list}
tar xvf "${DISTDIR}"/${t} ${list[@]} &> "${T}"/rpm-extraction.log
for r in ${list[@]}; do
rb=$(basename ${r})
l=.${rb}_$(date +'%d%m%y_%H%M%S').log
einfo "Unpacking ${rb}"
rpm2tar -O ${r} | tar xvf - | sed -e \
"s:^\.:${EROOT#/}:g" > ${l}; assert "unpacking ${r} failed"
mv ${l} opt/intel/ || die "failed moving extract log file"
done
done
mv opt/intel/* ${INTEL_SDP_DIR} || die "mv to INTEL_SDP_DIR failed"
}
# @FUNCTION: intel-sdp_src_install
# @DESCRIPTION:
# Install everything
intel-sdp_src_install() {
debug-print-function ${FUNCNAME} "${@}"
if path_exists "${INTEL_SDP_DIR}"/uninstall*; then
ebegin "Cleaning out uninstall information"
find "${INTEL_SDP_DIR}"/uninstall* -delete || die
eend
fi
if path_exists "${INTEL_SDP_DIR}"/Documentation; then
dodoc -r "${INTEL_SDP_DIR}"/Documentation/*
ebegin "Cleaning out documentation"
find "${INTEL_SDP_DIR}"/Documentation -delete || die
eend
fi
if path_exists "${INTEL_SDP_DIR}"/Samples; then
if use examples ; then
insinto /usr/share/${P}/examples/
doins -r "${INTEL_SDP_DIR}"/Samples/*
fi
ebegin "Cleaning out examples"
find "${INTEL_SDP_DIR}"/Samples -delete || die
eend
fi
if path_exists "${INTEL_SDP_DIR}"/man; then
path_exists "${INTEL_SDP_DIR}"/man/en_US/man1/* && \
doman "${INTEL_SDP_DIR}"/man/en_US/man1/*
path_exists "${INTEL_SDP_DIR}"/man/man1/* && \
doman "${INTEL_SDP_DIR}"/man/man1/*
has linguas_ja ${IUSE} && use linguas_ja && \
doman -i18n=ja_JP "${INTEL_SDP_DIR}"/man/ja_JP/man1/*
find "${INTEL_SDP_DIR}"/man -delete || die
fi
ebegin "Tagging ${PN}"
find opt -name \*sh -type f -exec sed -i \
-e "s:<.*DIR>:${INTEL_SDP_EDIR}:g" \
'{}' + || die
eend
[[ -d "${ED}" ]] || dodir /
mv opt "${ED}"/ || die "moving files failed"
dodir "${INTEL_SDP_DIR}"/licenses /opt/intel/ism/rm
keepdir "${INTEL_SDP_DIR}"/licenses /opt/intel/ism/rm
}
# @FUNCTION: intel-sdp_pkg_postinst
# @DESCRIPTION:
# Add things to intel database
intel-sdp_pkg_postinst() {
debug-print-function ${FUNCNAME} "${@}"
# add product registry to intel "database"
local l r
for r in ${INTEL_RPMS}; do
l="$(ls -1 ${EROOT%/}/opt/intel/.${r}_*.log | head -n 1)"
echo >> ${INTEL_SDP_DB} \
"<:${r%-${_INTEL_PV4}*}-${_INTEL_PV4}:${r}:${INTEL_SDP_EDIR}:${l}:>"
done
_isdp_run-test
if [[ ${PN} = icc ]] && has_version ">=dev-util/ccache-3.1.9-r2" ; then
#add ccache links as icc might get installed after ccache
"${EROOT}"/usr/bin/ccache-config --install-links
fi
}
# @FUNCTION: intel-sdp_pkg_postrm
# @DESCRIPTION:
# Sanitize intel database
intel-sdp_pkg_postrm() {
debug-print-function ${FUNCNAME} "${@}"
# remove from intel "database"
if [[ -e ${INTEL_SDP_DB} ]]; then
local r
for r in ${INTEL_RPMS}; do
sed -i \
-e "/${r}/d" \
${INTEL_SDP_DB}
done
fi
if [[ ${PN} = icc ]] && has_version ">=dev-util/ccache-3.1.9-r2" && [[ -z ${REPLACED_BY_VERSION} ]]; then
# --remove-links would remove all links, --install-links updates them
"${EROOT}"/usr/bin/ccache-config --install-links
fi
}
EXPORT_FUNCTIONS pkg_setup src_unpack src_install pkg_postinst pkg_postrm pkg_pretend
_INTEL_SDP_ECLASS_=1
fi

View File

@ -1,4 +1,4 @@
# Copyright 2004-2017 Gentoo Foundation
# Copyright 2004-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: java-ant-2.eclass
@ -359,40 +359,6 @@ java-ant_rewrite-classpath() {
fi
}
# @FUNCTION: java-ant_remove-taskdefs
# @USAGE: [--name NAME] [path/to/build.xml]
# @DESCRIPTION:
# Removes (named) taskdef elements from the build.xml file.
# When --name NAME is specified, only remove taskdef with name NAME. Otherwise,
# all taskdefs are removed.
# The file to rewrite defaults to build.xml when not specified.
java-ant_remove-taskdefs() {
debug-print-function ${FUNCNAME} $*
die "${FUNCNAME} has been banned, see bug #479838."
local task_name
if [[ "${1}" == --name ]]; then
task_name="${2}"
shift 2
fi
local file="${1:-build.xml}"
echo "Removing taskdefs from ${file}"
python <<EOF
import sys
from xml.dom.minidom import parse
dom = parse("${file}")
for elem in dom.getElementsByTagName('taskdef'):
if (len("${task_name}") == 0 or elem.getAttribute("name") == "${task_name}"):
elem.parentNode.removeChild(elem)
elem.unlink()
f = open("${file}", "w")
dom.writexml(f)
f.close()
EOF
[[ $? != 0 ]] && die "Removing taskdefs failed"
}
# @FUNCTION: java-ant_ignore-system-classes
# @USAGE: [path/to/build.xml]
# @DESCRIPTION:

View File

@ -2907,7 +2907,7 @@ java-pkg_gen-cp() {
local atom
for atom in ${CP_DEPEND}; do
if [[ ${atom} =~ /(([[:alnum:]+_-]+)-[0-9]+(\.[0-9]+)*[a-z]?(_[[:alnum:]]+)?(-r[0-9]*)?|[[:alnum:]+_-]+):([[:alnum:]+_.-]+) ]]; then
if [[ ${atom} =~ /(([[:alnum:]+_-]+)-[0-9]+(\.[0-9]+)*[a-z]?(_[[:alnum:]]+)*(-r[0-9]*)?|[[:alnum:]+_-]+):([[:alnum:]+_.-]+) ]]; then
atom=${BASH_REMATCH[2]:-${BASH_REMATCH[1]}}
[[ ${BASH_REMATCH[6]} != 0 ]] && atom+=-${BASH_REMATCH[6]}
local regex="(^|\s|,)${atom}($|\s|,)"

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: java-vm-2.eclass
@ -14,13 +14,13 @@ case ${EAPI:-0} in
*) die "EAPI=${EAPI} is not supported" ;;
esac
inherit fdo-mime multilib pax-utils prefix
inherit multilib pax-utils prefix xdg-utils
EXPORT_FUNCTIONS pkg_setup pkg_postinst pkg_prerm pkg_postrm
RDEPEND="
>=dev-java/java-config-2.2.0-r3
>=app-eselect/eselect-java-0.2.0"
>=app-eselect/eselect-java-0.4.0"
DEPEND="${RDEPEND}"
export WANT_JAVA_CONFIG=2
@ -86,7 +86,7 @@ java-vm-2_pkg_postinst() {
fi
fi
fdo-mime_desktop_database_update
xdg_desktop_database_update
}
@ -112,7 +112,7 @@ java-vm-2_pkg_prerm() {
# Update mime database.
java-vm-2_pkg_postrm() {
fdo-mime_desktop_database_update
xdg_desktop_database_update
}

View File

@ -1,961 +0,0 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: kde4-base.eclass
# @MAINTAINER:
# kde@gentoo.org
# @BLURB: This eclass provides functions for kde 4.X ebuilds
# @DESCRIPTION:
# The kde4-base.eclass provides support for building KDE4 based ebuilds
# and KDE4 applications.
#
# NOTE: KDE 4 ebuilds currently support EAPI 5. This will be
# reviewed over time as new EAPI versions are approved.
if [[ -z ${_KDE4_BASE_ECLASS} ]]; then
_KDE4_BASE_ECLASS=1
# @ECLASS-VARIABLE: KDE_SELINUX_MODULE
# @DESCRIPTION:
# If set to "none", do nothing.
# For any other value, add selinux to IUSE, and depending on that useflag
# add a dependency on sec-policy/selinux-${KDE_SELINUX_MODULE} to (R)DEPEND
: ${KDE_SELINUX_MODULE:=none}
# @ECLASS-VARIABLE: VIRTUALDBUS_TEST
# @DESCRIPTION:
# If defined, launch and use a private dbus session during src_test.
# @ECLASS-VARIABLE: VIRTUALX_REQUIRED
# @DESCRIPTION:
# For proper description see virtualx.eclass manpage.
# Here we redefine default value to be manual, if your package needs virtualx
# for tests you should proceed with setting VIRTUALX_REQUIRED=test.
: ${VIRTUALX_REQUIRED:=manual}
inherit kde4-functions toolchain-funcs fdo-mime flag-o-matic gnome2-utils virtualx versionator eutils multilib
if [[ ${KDE_BUILD_TYPE} = live ]]; then
case ${KDE_SCM} in
svn) inherit subversion ;;
git) inherit git-r3 ;;
esac
fi
# @ECLASS-VARIABLE: CMAKE_REQUIRED
# @DESCRIPTION:
# Specify if cmake buildsystem is being used. Possible values are 'always' and 'never'.
# Please note that if it's set to 'never' you need to explicitly override following phases:
# src_configure, src_compile, src_test and src_install.
# Defaults to 'always'.
: ${CMAKE_REQUIRED:=always}
if [[ ${CMAKE_REQUIRED} = always ]]; then
buildsystem_eclass="cmake-utils"
export_fns="src_configure src_compile src_test src_install"
fi
# @ECLASS-VARIABLE: KDE_MINIMAL
# @DESCRIPTION:
# This variable is used when KDE_REQUIRED is set, to specify required KDE minimal
# version for apps to work. Currently defaults to 4.4
# One may override this variable to raise version requirements.
# Note that it is fixed to ${PV} for kde-base packages.
KDE_MINIMAL="${KDE_MINIMAL:-4.4}"
# Set slot for KDEBASE known packages
case ${KDEBASE} in
kde-base)
SLOT=4/$(get_version_component_range 1-2)
KDE_MINIMAL="${PV}"
;;
kdevelop)
if [[ ${KDE_BUILD_TYPE} = live ]]; then
# @ECLASS-VARIABLE: KDEVELOP_VERSION
# @DESCRIPTION:
# Specifies KDevelop version. Default is 4.0.0 for tagged packages and 9999 for live packages.
# Applies to KDEBASE=kdevelop only.
KDEVELOP_VERSION="${KDEVELOP_VERSION:-4.9999}"
# @ECLASS-VARIABLE: KDEVPLATFORM_VERSION
# @DESCRIPTION:
# Specifies KDevplatform version. Default is 1.0.0 for tagged packages and 9999 for live packages.
# Applies to KDEBASE=kdevelop only.
KDEVPLATFORM_VERSION="${KDEVPLATFORM_VERSION:-4.9999}"
else
case ${PN} in
kdevelop)
KDEVELOP_VERSION=${PV}
KDEVPLATFORM_VERSION="$(($(get_major_version)-3)).$(get_after_major_version)"
;;
kdevplatform|kdevelop-php*|kdevelop-python)
KDEVELOP_VERSION="$(($(get_major_version)+3)).$(get_after_major_version)"
KDEVPLATFORM_VERSION=${PV}
;;
*)
KDEVELOP_VERSION="${KDEVELOP_VERSION:-4.0.0}"
KDEVPLATFORM_VERSION="${KDEVPLATFORM_VERSION:-1.0.0}"
esac
fi
SLOT="4"
;;
esac
inherit ${buildsystem_eclass}
EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_preinst pkg_postinst pkg_postrm
unset buildsystem_eclass
unset export_fns
# @ECLASS-VARIABLE: DECLARATIVE_REQUIRED
# @DESCRIPTION:
# Is qtdeclarative required? Possible values are 'always', 'optional' and 'never'.
# This variable must be set before inheriting any eclasses. Defaults to 'never'.
DECLARATIVE_REQUIRED="${DECLARATIVE_REQUIRED:-never}"
# @ECLASS-VARIABLE: QT3SUPPORT_REQUIRED
# @DESCRIPTION:
# Is qt3support required? Possible values are 'true' or 'false'.
# This variable must be set before inheriting any eclasses. Defaults to 'false'.
QT3SUPPORT_REQUIRED="${QT3SUPPORT_REQUIRED:-false}"
# @ECLASS-VARIABLE: QTHELP_REQUIRED
# @DESCRIPTION:
# Is qthelp required? Possible values are 'always', 'optional' and 'never'.
# This variable must be set before inheriting any eclasses. Defaults to 'never'.
QTHELP_REQUIRED="${QTHELP_REQUIRED:-never}"
# @ECLASS-VARIABLE: OPENGL_REQUIRED
# @DESCRIPTION:
# Is qtopengl required? Possible values are 'always', 'optional' and 'never'.
# This variable must be set before inheriting any eclasses. Defaults to 'never'.
OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}"
# @ECLASS-VARIABLE: MULTIMEDIA_REQUIRED
# @DESCRIPTION:
# Is qtmultimedia required? Possible values are 'always', 'optional' and 'never'.
# This variable must be set before inheriting any eclasses. Defaults to 'never'.
MULTIMEDIA_REQUIRED="${MULTIMEDIA_REQUIRED:-never}"
# @ECLASS-VARIABLE: SQL_REQUIRED
# @DESCRIPTION:
# Is qtsql required? Possible values are 'always', 'optional' and 'never'.
# This variable must be set before inheriting any eclasses. Defaults to 'never'.
SQL_REQUIRED="${SQL_REQUIRED:-never}"
# @ECLASS-VARIABLE: WEBKIT_REQUIRED
# @DESCRIPTION:
# Is qtwebkit required? Possible values are 'always', 'optional' and 'never'.
# This variable must be set before inheriting any eclasses. Defaults to 'never'.
WEBKIT_REQUIRED="${WEBKIT_REQUIRED:-never}"
# @ECLASS-VARIABLE: CPPUNIT_REQUIRED
# @DESCRIPTION:
# Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'.
# This variable must be set before inheriting any eclasses. Defaults to 'never'.
CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}"
# @ECLASS-VARIABLE: KDE_REQUIRED
# @DESCRIPTION:
# Is kde required? Possible values are 'always', 'optional' and 'never'.
# This variable must be set before inheriting any eclasses. Defaults to 'always'
# If set to 'always' or 'optional', KDE_MINIMAL may be overriden as well.
# Note that for kde-base packages this variable is fixed to 'always'.
KDE_REQUIRED="${KDE_REQUIRED:-always}"
# @ECLASS-VARIABLE: KDE_HANDBOOK
# @DESCRIPTION:
# Set to enable handbook in application. Possible values are 'always', 'optional'
# (handbook USE flag) and 'never'.
# This variable must be set before inheriting any eclasses. Defaults to 'never'.
# It adds default handbook dirs for kde-base packages to KMEXTRA and in any case it
# ensures buildtime and runtime dependencies.
KDE_HANDBOOK="${KDE_HANDBOOK:-never}"
# @ECLASS-VARIABLE: KDE_LINGUAS_LIVE_OVERRIDE
# @DESCRIPTION:
# Set this varible if you want your live package to manage its
# translations. (Mostly all kde ebuilds does not ship documentation
# and translations in live ebuilds)
if [[ ${KDE_BUILD_TYPE} == live && -z ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
# Kdebase actually provides the handbooks even for live stuff
[[ ${KDEBASE} == kde-base ]] || KDE_HANDBOOK=never
KDE_LINGUAS=""
fi
# Setup packages inheriting this eclass
case ${KDEBASE} in
kde-base)
HOMEPAGE="https://www.kde.org/"
LICENSE="GPL-2"
if [[ ${KDE_BUILD_TYPE} = live && -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
# Disable tests for live ebuilds by default
RESTRICT+=" test"
fi
# This code is to prevent portage from searching GENTOO_MIRRORS for
# packages that will never be mirrored. (As they only will ever be in
# the overlay).
case ${PV} in
*9999* | 4.?.[6-9]? | 4.??.[6-9]? | ??.?.[6-9]? | ??.??.[6-9]?)
RESTRICT+=" mirror"
;;
esac
;;
kdevelop)
HOMEPAGE="https://www.kdevelop.org/"
LICENSE="GPL-2"
;;
esac
# @ECLASS-VARIABLE: QT_MINIMAL
# @DESCRIPTION:
# Determine version of qt we enforce as minimal for the package.
QT_MINIMAL="${QT_MINIMAL:-4.8.5}"
# Declarative dependencies
qtdeclarativedepend="
>=dev-qt/qtdeclarative-${QT_MINIMAL}:4
"
case ${DECLARATIVE_REQUIRED} in
always)
COMMONDEPEND+=" ${qtdeclarativedepend}"
;;
optional)
IUSE+=" declarative"
COMMONDEPEND+=" declarative? ( ${qtdeclarativedepend} )"
;;
*) ;;
esac
unset qtdeclarativedepend
# Qt3Support dependencies
qt3supportdepend="
>=dev-qt/qt3support-${QT_MINIMAL}:4[accessibility]
"
case ${QT3SUPPORT_REQUIRED} in
true)
COMMONDEPEND+=" ${qt3supportdepend}"
[[ -n ${qtcoreuse} ]] && qtcoreuse+=",qt3support" || qtcoreuse="qt3support"
[[ -n ${qtsqluse} ]] && qtsqluse+=",qt3support" || qtsqluse="qt3support"
[[ -n ${kdelibsuse} ]] && kdelibsuse+=",qt3support(+)" || kdelibsuse="qt3support(+)"
;;
*) ;;
esac
unset qt3supportdepend
# QtHelp dependencies
qthelpdepend="
>=dev-qt/qthelp-${QT_MINIMAL}:4
"
case ${QTHELP_REQUIRED} in
always)
COMMONDEPEND+=" ${qthelpdepend}"
;;
optional)
IUSE+=" qthelp"
COMMONDEPEND+=" qthelp? ( ${qthelpdepend} )"
;;
esac
unset qthelpdepend
# OpenGL dependencies
qtopengldepend="
>=dev-qt/qtopengl-${QT_MINIMAL}:4
"
case ${OPENGL_REQUIRED} in
always)
COMMONDEPEND+=" ${qtopengldepend}"
;;
optional)
IUSE+=" opengl"
COMMONDEPEND+=" opengl? ( ${qtopengldepend} )"
;;
*) ;;
esac
unset qtopengldepend
# MultiMedia dependencies
qtmultimediadepend="
>=dev-qt/qtmultimedia-${QT_MINIMAL}:4
"
case ${MULTIMEDIA_REQUIRED} in
always)
COMMONDEPEND+=" ${qtmultimediadepend}"
;;
optional)
IUSE+=" multimedia"
COMMONDEPEND+=" multimedia? ( ${qtmultimediadepend} )"
;;
*) ;;
esac
unset qtmultimediadepend
# Sql dependencies
[[ -n ${qtsqluse} ]] && qtsqluse="[${qtsqluse}]"
qtsqldepend="
>=dev-qt/qtsql-${QT_MINIMAL}:4${qtsqluse}
"
case ${SQL_REQUIRED} in
always)
COMMONDEPEND+=" ${qtsqldepend}"
;;
optional)
IUSE+=" sql"
COMMONDEPEND+=" sql? ( ${qtsqldepend} )"
;;
*) ;;
esac
unset qtsqluse
unset qtsqldepend
# WebKit dependencies
qtwebkitdepend="
>=dev-qt/qtwebkit-${QT_MINIMAL}:4
"
case ${WEBKIT_REQUIRED} in
always)
COMMONDEPEND+=" ${qtwebkitdepend}"
[[ -n ${kdelibsuse} ]] && kdelibsuse+=",webkit(+)" || kdelibsuse="webkit(+)"
;;
optional)
IUSE+=" +webkit"
COMMONDEPEND+=" webkit? ( ${qtwebkitdepend} )"
[[ -n ${kdelibsuse} ]] && kdelibsuse+=",webkit?" || kdelibsuse="webkit?"
;;
*) ;;
esac
unset qtwebkitdepend
# CppUnit dependencies
cppuintdepend="
dev-util/cppunit
"
case ${CPPUNIT_REQUIRED} in
always)
DEPEND+=" ${cppuintdepend}"
;;
optional)
IUSE+=" test"
DEPEND+=" test? ( ${cppuintdepend} )"
;;
*) ;;
esac
unset cppuintdepend
# KDE dependencies
# Qt accessibility classes are needed in various places, bug 325461
[[ -n ${qtcoreuse} ]] && qtcoreuse+=",ssl" || qtcoreuse="ssl"
[[ -n ${qtcoreuse} ]] && qtcoreuse="[${qtcoreuse}]"
kdecommondepend="
dev-lang/perl
>=dev-qt/designer-${QT_MINIMAL}:4
>=dev-qt/qtcore-${QT_MINIMAL}:4${qtcoreuse}
>=dev-qt/qtdbus-${QT_MINIMAL}:4
>=dev-qt/qtgui-${QT_MINIMAL}:4[accessibility,dbus(+)]
>=dev-qt/qtscript-${QT_MINIMAL}:4
>=dev-qt/qtsvg-${QT_MINIMAL}:4
>=dev-qt/qttest-${QT_MINIMAL}:4
"
unset qtcoreuse
if [[ ${PN} != kdelibs ]]; then
[[ -n ${kdelibsuse} ]] && kdelibsuse="[${kdelibsuse}]"
kdecommondepend+=" kde-frameworks/kdelibs:4${kdelibsuse}"
if [[ ${KDEBASE} = kdevelop ]]; then
if [[ ${PN} != kdevplatform ]]; then
# @ECLASS-VARIABLE: KDEVPLATFORM_REQUIRED
# @DESCRIPTION:
# Specifies whether kdevplatform is required. Possible values are 'always' (default) and 'never'.
# Applies to KDEBASE=kdevelop only.
KDEVPLATFORM_REQUIRED="${KDEVPLATFORM_REQUIRED:-always}"
case ${KDEVPLATFORM_REQUIRED} in
always)
kdecommondepend+="
>=dev-util/kdevplatform-${KDEVPLATFORM_VERSION}:4
"
;;
*) ;;
esac
fi
fi
fi
unset kdelibsuse
kdedepend="
dev-util/automoc
virtual/pkgconfig
>=x11-libs/libXtst-1.1.0
x11-proto/xf86vidmodeproto
"
kderdepend=""
# all packages needs oxygen icons for basic iconset
if [[ ${PN} != oxygen-icons ]]; then
kderdepend+=" kde-frameworks/oxygen-icons"
fi
# add a dependency over kde4-l10n
if [[ ${KDEBASE} != "kde-base" && -n ${KDE_LINGUAS} ]]; then
for _lingua in $(kde4_lingua_to_l10n ${KDE_LINGUAS}); do
# if our package has linguas, pull in kde4-l10n with selected lingua enabled,
# but only for selected ones.
# this can't be done on one line because if user doesn't use any localisation
# then he is probably not interested in kde4-l10n at all.
kderdepend+="
l10n_${_lingua}? ( $(add_kdeapps_dep kde4-l10n "l10n_${_lingua}(+)") )
"
done
unset _lingua
fi
kdehandbookdepend="
app-text/docbook-xml-dtd:4.2
app-text/docbook-xsl-stylesheets
"
kdehandbookrdepend="
kde-frameworks/kdelibs:4[handbook]
"
case ${KDE_HANDBOOK} in
always)
kdedepend+=" ${kdehandbookdepend}"
[[ ${PN} != kdelibs ]] && kderdepend+=" ${kdehandbookrdepend}"
;;
optional)
IUSE+=" +handbook"
kdedepend+=" handbook? ( ${kdehandbookdepend} )"
[[ ${PN} != kdelibs ]] && kderdepend+=" handbook? ( ${kdehandbookrdepend} )"
;;
*) ;;
esac
unset kdehandbookdepend kdehandbookrdepend
case ${KDE_SELINUX_MODULE} in
none) ;;
*)
IUSE+=" selinux"
kderdepend+=" selinux? ( sec-policy/selinux-${KDE_SELINUX_MODULE} )"
;;
esac
case ${KDE_REQUIRED} in
always)
[[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" ${kdecommondepend}"
[[ -n ${kdedepend} ]] && DEPEND+=" ${kdedepend}"
[[ -n ${kderdepend} ]] && RDEPEND+=" ${kderdepend}"
;;
optional)
IUSE+=" kde"
[[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" kde? ( ${kdecommondepend} )"
[[ -n ${kdedepend} ]] && DEPEND+=" kde? ( ${kdedepend} )"
[[ -n ${kderdepend} ]] && RDEPEND+=" kde? ( ${kderdepend} )"
;;
*) ;;
esac
unset kdecommondepend kdedepend kderdepend
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: COMMONDEPEND is ${COMMONDEPEND}"
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND (only) is ${DEPEND}"
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND (only) is ${RDEPEND}"
# Accumulate dependencies set by this eclass
DEPEND+=" ${COMMONDEPEND}"
RDEPEND+=" ${COMMONDEPEND}"
unset COMMONDEPEND
# Fetch section - If the ebuild's category is not 'kde-base' and if it is not a
# kdevelop ebuild, the URI should be set in the ebuild itself
_calculate_src_uri() {
debug-print-function ${FUNCNAME} "$@"
local _kmname _kmname_pv
# we calculate URI only for known KDEBASE modules
[[ -n ${KDEBASE} ]] || return
# calculate tarball module name
if [[ -n ${KMNAME} ]]; then
_kmname="${KMNAME}"
else
_kmname=${PN}
fi
_kmname_pv="${_kmname}-${PV}"
case ${KDEBASE} in
kde-base)
case ${PV} in
4.4.20*)
# KDEPIM 4.4 no-akonadi branch, special case
# TODO: Remove this part when KDEPIM 4.4 gets out of the tree
SRC_URI="https://dev.gentoo.org/~dilfridge/distfiles/${_kmname_pv}.tar.xz" ;;
4.?.[6-9]? | 4.??.[6-9]?)
# Unstable KDE SC releases
SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.xz" ;;
4.11.22)
# Part of 15.08.0 actually, sigh. Not stable for next release!
SRC_URI="mirror://kde/Attic/applications/15.08.0/src/${_kmname_pv}.tar.xz" ;;
4.14.3)
# Last SC release
SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.xz" ;;
4.14.10)
# Part of 15.04.3 actually, sigh. Used by last version of KDE PIM 4.
SRC_URI="mirror://kde/Attic/applications/15.04.3/src/${_kmname_pv}.tar.xz" ;;
4.14.11*)
# KDEPIM 4.14 snapshot with Gentoo patches
SRC_URI="https://dev.gentoo.org/~asturm/distfiles/${_kmname_pv}.tar.xz" ;;
16.12.3)
SRC_URI="mirror://kde/Attic/applications/16.12.3/src/${_kmname_pv}.tar.xz" ;;
??.?.[6-9]? | ??.??.[4-9]?)
# Unstable KDE Applications releases
SRC_URI="mirror://kde/unstable/applications/${PV}/src/${_kmname}-${PV}.tar.xz" ;;
*)
# Stable KDE Applications releases
SRC_URI="mirror://kde/stable/applications/${PV}/src/${_kmname}-${PV}.tar.xz"
;;
esac
;;
kdevelop|kdevelop-php*|kdevplatform)
case ${KDEVELOP_VERSION} in
4.[123].[6-9]*) SRC_URI="mirror://kde/unstable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.xz" ;;
4.7.3) SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2" ;;
4.7.4) SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/${P}.tar.xz" ;;
*) SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.xz" ;;
esac
;;
esac
}
_calculate_live_repo() {
debug-print-function ${FUNCNAME} "$@"
SRC_URI=""
case ${KDE_SCM} in
svn)
# Determine branch URL based on live type
local branch_prefix
case ${PV} in
9999*)
# trunk
branch_prefix="trunk/KDE"
;;
*)
# branch
branch_prefix="branches/KDE/$(get_kde_version)"
if [[ ${PV} == ??.??.49.9999 && ${CATEGORY} = kde-apps ]]; then
branch_prefix="branches/Applications/$(get_kde_version)"
fi
# @ECLASS-VARIABLE: ESVN_PROJECT_SUFFIX
# @DESCRIPTION
# Suffix appended to ESVN_PROJECT depending on fetched branch.
# Defaults is empty (for -9999 = trunk), and "-${PV}" otherwise.
ESVN_PROJECT_SUFFIX="-${PV}"
;;
esac
# @ECLASS-VARIABLE: ESVN_MIRROR
# @DESCRIPTION:
# This variable allows easy overriding of default kde mirror service
# (anonsvn) with anything else you might want to use.
ESVN_MIRROR=${ESVN_MIRROR:=svn://anonsvn.kde.org/home/kde}
# Split ebuild, or extragear stuff
if [[ -n ${KMNAME} ]]; then
ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then
KMMODULE="${PN}"
fi
# Split kde-base/ ebuilds: (they reside in trunk/KDE)
case ${KMNAME} in
kdebase-*)
ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/kdebase/${KMNAME#kdebase-}"
;;
kdelibs-*)
ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/kdelibs/${KMNAME#kdelibs-}"
;;
kdereview*)
ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
;;
kdesupport)
ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}"
;;
kde*)
ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/${KMNAME}"
;;
extragear*|playground*)
# Unpack them in toplevel dir, so that they won't conflict with kde4-meta
# build packages from same svn location.
ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}"
;;
*)
ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
;;
esac
else
# kdelibs, kdepimlibs
ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/${PN}"
ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}"
fi
# @ECLASS-VARIABLE: ESVN_UP_FREQ
# @DESCRIPTION:
# This variable is used for specifying the timeout between svn synces
# for kde-base modules. Does not affect misc apps.
# Default value is 1 hour.
[[ ${KDEBASE} = kde-base ]] && ESVN_UP_FREQ=${ESVN_UP_FREQ:-1}
;;
git)
local _kmname
# @ECLASS-VARIABLE: EGIT_MIRROR
# @DESCRIPTION:
# This variable allows easy overriding of default kde mirror service
# (anongit) with anything else you might want to use.
EGIT_MIRROR=${EGIT_MIRROR:=https://anongit.kde.org}
# @ECLASS-VARIABLE: EGIT_REPONAME
# @DESCRIPTION:
# This variable allows overriding of default repository
# name. Specify only if this differ from PN and KMNAME.
if [[ -n ${EGIT_REPONAME} ]]; then
# the repository and kmname different
_kmname=${EGIT_REPONAME}
elif [[ -n ${KMNAME} ]]; then
_kmname=${KMNAME}
else
_kmname=${PN}
fi
# default branching
[[ ${PV} != 4.9999* && ${PV} != 9999 && ${KDEBASE} == kde-base ]] && \
EGIT_BRANCH="KDE/$(get_kde_version)"
# Applications branching
[[ ${PV} == ??.??.49.9999 && ${KDEBASE} == kde-base ]] && \
EGIT_BRANCH="Applications/$(get_kde_version)"
# default repo uri
EGIT_REPO_URI+=( "${EGIT_MIRROR}/${_kmname}" )
debug-print "${FUNCNAME}: Repository: ${EGIT_REPO_URI}"
debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}"
;;
esac
}
case ${KDE_BUILD_TYPE} in
live) _calculate_live_repo ;;
*) _calculate_src_uri ;;
esac
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
# @ECLASS-VARIABLE: PREFIX
# @DESCRIPTION:
# Set the installation PREFIX for non kde-base applications. It defaults to /usr.
# kde-base packages go into KDE4 installation directory (/usr).
# No matter the PREFIX, package will be built against KDE installed in /usr.
# @FUNCTION: kde4-base_pkg_setup
# @DESCRIPTION:
# Do some basic settings
kde4-base_pkg_setup() {
debug-print-function ${FUNCNAME} "$@"
if has handbook ${IUSE} || has "+handbook" ${IUSE} && [[ "${KDE_HANDBOOK}" != optional ]] ; then
eqawarn "Handbook support is enabled via KDE_HANDBOOK=optional in the ebuild."
eqawarn "Please do not just set IUSE=handbook, as this leads to dependency errors."
fi
# Don't set KDEHOME during compilation, it will cause access violations
unset KDEHOME
KDEDIR=/usr
: ${PREFIX:=/usr}
EKDEDIR=${EPREFIX}/usr
# Point to correct QT plugins path
QT_PLUGIN_PATH="${EPREFIX}/usr/$(get_libdir)/kde4/plugins/"
# Fix XDG collision with sandbox
export XDG_CONFIG_HOME="${T}"
}
# @FUNCTION: kde4-base_src_unpack
# @DESCRIPTION:
# This function unpacks the source tarballs for KDE4 applications.
kde4-base_src_unpack() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${KDE_BUILD_TYPE} = live ]]; then
case ${KDE_SCM} in
svn)
subversion_src_unpack
;;
git)
git-r3_src_unpack
;;
esac
else
unpack ${A}
fi
}
# @FUNCTION: kde4-base_src_prepare
# @DESCRIPTION:
# General pre-configure and pre-compile function for KDE4 applications.
# It also handles translations if KDE_LINGUAS is defined. See KDE_LINGUAS and
# enable_selected_linguas() and enable_selected_doc_linguas()
# in kde4-functions.eclass(5) for further details.
kde4-base_src_prepare() {
debug-print-function ${FUNCNAME} "$@"
# enable handbook and linguas only when not using live ebuild
# Only enable selected languages, used for KDE extragear apps.
if [[ -n ${KDE_LINGUAS} ]]; then
enable_selected_linguas
fi
# Enable/disable handbooks for kde4-base packages
# kde4-l10n inherits kde4-base but is metapackage, so no check for doc
# kdelibs inherits kde4-base but handle installing the handbook itself
if ! has kde4-meta ${INHERITED} && in_iuse handbook; then
if [[ ${KDEBASE} == kde-base ]]; then
if [[ ${PN} != kde4-l10n && ${PN} != kdepim-l10n && ${PN} != kdelibs ]] && use !handbook; then
# documentation in kde4-functions
: ${KDE_DOC_DIRS:=doc}
local dir
for dir in ${KDE_DOC_DIRS}; do
sed -e "\!^[[:space:]]*add_subdirectory[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \
-e "\!^[[:space:]]*ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \
-e "\!^[[:space:]]*macro_optional_add_subdirectory[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \
-e "\!^[[:space:]]*MACRO_OPTIONAL_ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \
-i CMakeLists.txt || die "failed to comment out handbook"
done
fi
else
enable_selected_doc_linguas
fi
fi
# SCM bootstrap
if [[ ${KDE_BUILD_TYPE} = live ]]; then
case ${KDE_SCM} in
svn) subversion_src_prepare ;;
esac
fi
# Apply patches, cmake-utils does the job already
cmake-utils_src_prepare
# Save library dependencies
if [[ -n ${KMSAVELIBS} ]] ; then
save_library_dependencies
fi
# Inject library dependencies
if [[ -n ${KMLOADLIBS} ]] ; then
load_library_dependencies
fi
# Hack for manuals relying on outdated DTD, only outside kde-base/...
if [[ -z ${KDEBASE} ]]; then
find "${S}" -name "*.docbook" \
-exec sed -i -r \
-e 's:-//KDE//DTD DocBook XML V4\.1(\..)?-Based Variant V1\.[01]//EN:-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN:g' {} + \
|| die 'failed to fix DocBook variant version'
fi
}
# @FUNCTION: kde4-base_src_configure
# @DESCRIPTION:
# Function for configuring the build of KDE4 applications.
kde4-base_src_configure() {
debug-print-function ${FUNCNAME} "$@"
# Build tests in src_test only, where we override this value
local cmakeargs=(-DKDE4_BUILD_TESTS=OFF)
if use_if_iuse debug; then
# Set "real" debug mode
CMAKE_KDE_BUILD_TYPE="Debugfull"
else
# Handle common release builds
append-cppflags -DQT_NO_DEBUG
fi
# Set distribution name
[[ ${PN} = kdelibs ]] && cmakeargs+=(-DKDE_DISTRIBUTION_TEXT=Gentoo)
# Here we set the install prefix
tc-is-cross-compiler || cmakeargs+=(-DCMAKE_INSTALL_PREFIX="${EPREFIX}${PREFIX}")
# Use colors
QTEST_COLORED=1
# Shadow existing installations
unset KDEDIRS
#qmake -query QT_INSTALL_LIBS unavailable when cross-compiling
tc-is-cross-compiler && cmakeargs+=(-DQT_LIBRARY_DIR=${ROOT}/usr/$(get_libdir)/qt4)
#kde-config -path data unavailable when cross-compiling
tc-is-cross-compiler && cmakeargs+=(-DKDE4_DATA_DIR=${ROOT}/usr/share/apps/)
# sysconf needs to be /etc, not /usr/etc
cmakeargs+=(-DSYSCONF_INSTALL_DIR="${EPREFIX}"/etc)
if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then
if [[ ${mycmakeargs} ]]; then
eqawarn "mycmakeargs should always be declared as an array, not a string"
fi
mycmakeargs=(${mycmakeargs})
fi
mycmakeargs=("${cmakeargs[@]}" "${mycmakeargs[@]}")
cmake-utils_src_configure
}
# @FUNCTION: kde4-base_src_compile
# @DESCRIPTION:
# General function for compiling KDE4 applications.
kde4-base_src_compile() {
debug-print-function ${FUNCNAME} "$@"
cmake-utils_src_compile "$@"
}
# @FUNCTION: kde4-base_src_test
# @DESCRIPTION:
# Function for testing KDE4 applications.
kde4-base_src_test() {
debug-print-function ${FUNCNAME} "$@"
local kded4_pid
_test_runner() {
if [[ -n "${VIRTUALDBUS_TEST}" ]]; then
export $(dbus-launch)
kded4 2>&1 > /dev/null &
kded4_pid=$!
fi
cmake-utils_src_test
}
# When run as normal user during ebuild development with the ebuild command, the
# kde tests tend to access the session DBUS. This however is not possible in a real
# emerge or on the tinderbox.
# > make sure it does not happen, so bad tests can be recognized and disabled
unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID
# Override this value, set in kde4-base_src_configure()
mycmakeargs+=(-DKDE4_BUILD_TESTS=ON)
cmake-utils_src_configure
kde4-base_src_compile
if [[ ${VIRTUALX_REQUIRED} == always || ${VIRTUALX_REQUIRED} == test ]]; then
# check for sanity if anyone already redefined VIRTUALX_COMMAND from the default
if [[ ${VIRTUALX_COMMAND} != emake ]]; then
# surprise- we are already INSIDE virtualmake!!!
debug-print "QA Notice: This version of kde4-base.eclass includes the virtualx functionality."
debug-print " You may NOT set VIRTUALX_COMMAND or call virtualmake from the ebuild."
debug-print " Setting VIRTUALX_REQUIRED is completely sufficient. See the"
debug-print " kde4-base.eclass docs for details... Applying workaround."
_test_runner
else
virtx _test_runner
fi
else
_test_runner
fi
if [ -n "${kded4_pid}" ] ; then
kill ${kded4_pid}
fi
if [ -n "${DBUS_SESSION_BUS_PID}" ] ; then
kill ${DBUS_SESSION_BUS_PID}
fi
}
# @FUNCTION: kde4-base_src_install
# @DESCRIPTION:
# Function for installing KDE4 applications.
kde4-base_src_install() {
debug-print-function ${FUNCNAME} "$@"
if [[ -n ${KMSAVELIBS} ]] ; then
install_library_dependencies
fi
# Install common documentation of KDE4 applications
local doc
if ! has kde4-meta ${INHERITED}; then
for doc in "${S}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
[[ -f ${doc} && -s ${doc} ]] && dodoc "${doc}"
done
for doc in "${S}"/*/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
[[ -f ${doc} && -s ${doc} ]] && newdoc "${doc}" "$(basename $(dirname ${doc})).$(basename ${doc})"
done
fi
cmake-utils_src_install
# We don't want ${PREFIX}/share/doc/HTML to be compressed,
# because then khelpcenter can't find the docs
[[ -d ${ED}/${PREFIX}/share/doc/HTML ]] &&
docompress -x ${PREFIX}/share/doc/HTML
}
# @FUNCTION: kde4-base_pkg_preinst
# @DESCRIPTION:
# Function storing icon caches
kde4-base_pkg_preinst() {
debug-print-function ${FUNCNAME} "$@"
gnome2_icon_savelist
if [[ ${KDE_BUILD_TYPE} == live && ${KDE_SCM} == svn ]]; then
subversion_pkg_preinst
fi
}
# @FUNCTION: kde4-base_pkg_postinst
# @DESCRIPTION:
# Function to rebuild the KDE System Configuration Cache after an application has been installed.
kde4-base_pkg_postinst() {
debug-print-function ${FUNCNAME} "$@"
if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
gnome2_icon_cache_update
fi
fdo-mime_desktop_database_update
fdo-mime_mime_database_update
buildsycoca
if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
if [[ ${KDE_BUILD_TYPE} = live ]]; then
echo
einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}"
einfo "Use it at your own risk."
einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!"
echo
fi
fi
}
# @FUNCTION: kde4-base_pkg_postrm
# @DESCRIPTION:
# Function to rebuild the KDE System Configuration Cache after an application has been removed.
kde4-base_pkg_postrm() {
debug-print-function ${FUNCNAME} "$@"
if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
gnome2_icon_cache_update
fi
fdo-mime_desktop_database_update
fdo-mime_mime_database_update
buildsycoca
}
fi

View File

@ -1,429 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @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.
if [[ -z ${_KDE4_FUNCTIONS_ECLASS} ]]; then
_KDE4_FUNCTIONS_ECLASS=1
inherit versionator
# @ECLASS-VARIABLE: EAPI
# @DESCRIPTION:
# Currently kde4 eclasses support EAPI 5 and 6.
case ${EAPI} in
5|6) : ;;
*) die "EAPI=${EAPI:-0} 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
# kdevelop ebuild.
if [[ ${CATEGORY} = kde-base || ${CATEGORY} == kde-plasma || ${CATEGORY} = kde-apps || ${CATEGORY} = kde-frameworks ]]; then
debug-print "${ECLASS}: KDEBASE ebuild recognized"
KDEBASE=kde-base
elif [[ ${KMNAME-${PN}} = kdevelop ]]; then
KDEBASE=kdevelop
fi
debug-print "${ECLASS}: ${KDEBASE} ebuild recognized"
# determine the build type
if [[ ${PV} = *9999* ]]; then
KDE_BUILD_TYPE="live"
else
KDE_BUILD_TYPE="release"
fi
export KDE_BUILD_TYPE
# Set reponame and SCM for modules that have fully migrated to git
# (hack - it's here because it needs to be before SCM inherits from kde4-base)
if [[ ${KDE_BUILD_TYPE} == live ]]; then
case "${KMNAME}" in
kdebase-workspace)
EGIT_REPONAME=${EGIT_REPONAME:=kde-workspace}
;;
kdebase-runtime)
EGIT_REPONAME=${EGIT_REPONAME:=kde-runtime}
;;
esac
fi
# @ECLASS-VARIABLE: KDE_SCM
# @DESCRIPTION:
# If this is a live package which scm does it use
# Everything else uses git by default
KDE_SCM="${KDE_SCM:-git}"
case ${KDE_SCM} in
svn|git) ;;
*) die "KDE_SCM: ${KDE_SCM} is not supported" ;;
esac
# @FUNCTION: kde4_lingua_to_l10n
# @USAGE: <lingua>...
# @INTERNAL
# @DESCRIPTION:
# Output l10n flag name(s) (without prefix(es)) appropriate for given KDE
# locale(s).
kde4_lingua_to_l10n() {
local l
for l; do
case ${l} in
ca@valencia) echo ca-valencia;;
sr@ijekavian) echo sr-ijekavsk;;
sr@ijekavianlatin) echo sr-Latn-ijekavsk;;
sr@latin|sr@Latn) echo sr-Latn;;
uz@cyrillic) echo uz-Cyrl;;
*@*) die "${FUNCNAME}: Unhandled KDE_LINGUAS: ${l}";;
*) echo "${l/_/-}";;
esac
done
}
# @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="de en_GB nl"
if [[ ${KDE_BUILD_TYPE} != live || -n ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
for _lingua in $(kde4_lingua_to_l10n ${KDE_LINGUAS}); do
IUSE="${IUSE} l10n_${_lingua}"
done
fi
# @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 usr/share/{config,kde4}; do
DIRS=${EROOT}usr
[[ -d "${EROOT}${x}" ]] || break # nothing to do if directory does not exist
# fixes Bug 318237
if use userland_BSD ; then
[[ $(stat -f %p "${EROOT}${x}") != 40755 ]]
local stat_rtn="$?"
else
[[ $(stat --format=%a "${EROOT}${x}") != 755 ]]
local stat_rtn=$?
fi
if [[ $stat_rtn != 1 ]] ; then
ewarn "QA Notice:"
ewarn "Package ${PN} is breaking ${EROOT}${x} permissions."
ewarn "Please report this issue to gentoo bugzilla."
einfo "Permissions will get adjusted automatically now."
find "${EROOT}${x}" -type d -print0 | xargs -0 chmod 755
fi
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"
}
# @FUNCTION: enable_selected_linguas
# @DESCRIPTION:
# Enable translations based on L10N 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
# @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 L10N enabled doc folders.
enable_selected_doc_linguas() {
debug-print-function ${FUNCNAME} "$@"
# @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}"
# In certain packages, the default handbook is en_US instead of the usual en. Since there is no en_US 'translation',
# it makes no sense to add to KDE_LINGUAS which causes this type of handbook to not be installed.
if [[ -d "${handbookdir}/en_US" && ! -d "${handbookdir}/en" ]]; then
mv "${handbookdir}/en_US" "${handbookdir}/en" || die
sed -e "s/en_US/en/" -i "${handbookdir}/CMakeLists.txt"
fi
# Add requested translations
local lingua
for lingua in en ${KDE_LINGUAS}; do
if [[ ${lingua} = en ]] || use "l10n_$(kde4_lingua_to_l10n "${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}"
}
# Functions handling KMLOADLIBS and KMSAVELIBS
# @FUNCTION: save_library_dependencies
# @DESCRIPTION:
# Add exporting CMake dependencies for current package
save_library_dependencies() {
local depsfile="${T}/${PN}"
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}"
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}"
[[ -r ${depsfile} ]] || depsfile="${EPREFIX}/var/lib/kde/${pn}:$(get_kde_version)"
[[ -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: add_kdeapps_dep
# @DESCRIPTION:
# Create proper dependency for kde-apps/ dependencies.
# 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_kdeapps_dep() {
debug-print-function ${FUNCNAME} "$@"
local ver
if [[ -n ${2} ]] ; then
local use="[${2}]"
fi
if [[ -n ${3} ]]; then
ver=${3}
elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then
ver=${KDE_OVERRIDE_MINIMAL}
elif [[ ${KDEBASE} != kde-base ]]; then
ver=${KDE_MINIMAL}
# if building kde-apps, live master or stable-live branch,
# use the final SC version since there are no further general releases.
# except when it is kdepim split packages, which rely on same-version deps
elif [[ ${CATEGORY} == kde-apps || ${PV} == *9999 ]] && [[ ${KMNAME} != "kdepim" ]]; then
ver=4.14.3
else
ver=${PV}
fi
[[ -z ${1} ]] && die "Missing parameter"
echo " >=kde-apps/${1}-${ver}:4${use}"
}
# @FUNCTION: add_kdebase_dep
# @DESCRIPTION:
# Create proper dependency for kde-base/ dependencies.
# 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 ${2} ]] ; then
local use="[${2}]"
fi
if [[ -n ${3} ]]; then
ver=${3}
elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then
ver=${KDE_OVERRIDE_MINIMAL}
elif [[ ${KDEBASE} != kde-base ]]; then
ver=${KDE_MINIMAL}
# if building live master or kde-apps, use the final SC version
# since there are no further general releases.
elif [[ ${CATEGORY} == kde-apps || ${PV} == 9999 ]]; then
ver=4.14.3
# if building a live version branch (eg. 4.11.49.9999) use the major version
elif [[ ${PV} == *.9999 ]]; then
ver=$(get_kde_version)
else
ver=${PV}
fi
[[ -z ${1} ]] && die "Missing parameter"
echo " >=kde-base/${1}-${ver}:4${use}"
}
# 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 || die
# 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 "l10n_$(kde4_lingua_to_l10n ${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 || die
}
# @FUNCTION: get_kde_version
# @DESCRIPTION:
# Translates an ebuild version into a major.minor KDE SC
# release version. If no version is specified, ${PV} is used.
get_kde_version() {
local ver=${1:-${PV}}
local major=$(get_major_version ${ver})
local minor=$(get_version_component_range 2 ${ver})
local micro=$(get_version_component_range 3 ${ver})
if [[ ${ver} == 9999 ]]; then
echo live
else
(( micro < 50 )) && echo ${major}.${minor} || echo ${major}.$((minor + 1))
fi
}
fi

View File

@ -1,629 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# @ECLASS: kde4-meta.eclass
# @MAINTAINER:
# kde@gentoo.org
# @BLURB: Eclass for writing "split" KDE packages.
# @DESCRIPTION:
# This eclass provides all necessary functions for writing split KDE ebuilds.
#
# You must define KMNAME to use this eclass, and do so before inheriting it. All other variables are optional.
# Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY.
if [[ -z ${_KDE4_META_ECLASS} ]]; then
_KDE4_META_ECLASS=1
[[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
inherit kde4-base
KDEMETA_EXPF="pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm"
EXPORT_FUNCTIONS ${KDEMETA_EXPF}
# Add dependencies that all packages in a certain module share.
case ${KMNAME} in
kdepim|kdepim-runtime)
case ${PN} in
akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
IUSE+=" +kontact"
RDEPEND+=" kontact? ( $(add_kdeapps_dep kontact '' ${PV}) )"
;;
esac
;;
esac
DEPEND+=" ${COMMONDEPEND}"
RDEPEND+=" ${COMMONDEPEND}"
unset COMMONDEPEND
debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
# Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc)
case ${KDE_BUILD_TYPE} in
live)
if [[ ${KDE_SCM} == svn ]]; then
case ${KMNAME} in
extragear*|playground*)
ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
;;
esac
fi
;;
esac
# @ECLASS-VARIABLE: KMNAME
# @DESCRIPTION:
# Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it
# _before_ inheriting this eclass, (unlike the other parameters), since it's
# used to set $SRC_URI.
# @ECLASS-VARIABLE: KMMODULE
# @DESCRIPTION:
# Specify exactly one subdirectory of $KMNAME here. Defaults to $PN.
# The subdirectory listed here is treated exactly like items in $KMEXTRA.
#
# Example: The ebuild name of "kdebase/l10n" is kde-base/kdebase-l10n, because
# just 'l10n' would be too confusing. Hence it sets KMMODULE="l10n".
# @ECLASS-VARIABLE: KMNOMODULE
# @DESCRIPTION:
# If set to "true", $KMMODULE doesn't have to be defined.
#
# Example usage: If you're installing subdirectories of a package, like plugins,
# you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and
# set KMNOMODULE="true".
if [[ -z ${KMMODULE} ]] && [[ ${KMNOMODULE} != true ]]; then
KMMODULE=${PN}
fi
# @ECLASS-VARIABLE: KMEXTRA
# @DESCRIPTION:
# All subdirectories listed here will be extracted, compiled & installed.
# $KMMODULE is always added to $KMEXTRA.
# If KDE_HANDBOOK is 'always' or 'optional' and handbook USE-flag is set, and if this
# directory exists, then "doc/$KMMODULE" is added to $KMEXTRA. If there's additional
# documentation in different subdirectories, it should be added to KMEXTRA manually..
# @ECLASS-VARIABLE: KMCOMPILEONLY
# @DESCRIPTION:
# All subdirectories listed here will be extracted & compiled, but not installed.
# TODO: better formulation may be needed
# @ECLASS-VARIABLE: KMEXTRACTONLY
# @DESCRIPTION:
# All subdirectories listed here will be extracted, but neither compiled nor installed.
# This can be used to avoid compilation in a subdirectory of a directory in $KMMODULE or $KMEXTRA
# @ECLASS-VARIABLE: KMTARPARAMS
# @DESCRIPTION:
# Specify extra parameters to pass to tar, in kde4-meta_src_extract.
# '-xpf -j' are passed to tar by default.
# @FUNCTION: kde4-meta_pkg_setup
# @DESCRIPTION:
# Currently calls its equivalent in kde4-base.eclass(5) and checks the gcc version.
# Use this one in split ebuilds.
kde4-meta_pkg_setup() {
debug-print-function ${FUNCNAME} "$@"
kde4-base_pkg_setup
}
# @FUNCTION: kde4-meta_src_unpack
# @DESCRIPTION:
# This function unpacks the source for split ebuilds.
# Further more is processed in kde4-meta_src_extract
kde4-meta_src_unpack() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${KDE_BUILD_TYPE} = live ]]; then
case "${KDE_SCM}" in
svn)
S="${WORKDIR}/${P}"
mkdir -p "${S}"
ESVN_RESTRICT="export" subversion_src_unpack
subversion_wc_info
subversion_bootstrap
;;
git)
git-r3_src_unpack
;;
esac
fi
kde4-meta_src_extract
}
# @FUNCTION: kde4-meta_src_extract
# @DESCRIPTION:
# A function to extract the source for a split KDE ebuild.
# Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and
# KMTARPARAMS.
kde4-meta_src_extract() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${KDE_BUILD_TYPE} = live ]]; then
# Export working copy to ${S}
einfo "Exporting parts of working copy to ${S}"
kde4-meta_create_extractlists
case ${KDE_SCM} in
svn)
local rsync_options subdir targetdir wc_path escm
rsync_options="--group --links --owner --perms --quiet --exclude=.svn/ --exclude=.git/"
wc_path="${ESVN_WC_PATH}"
escm="{ESVN}"
# Copy ${KMNAME} non-recursively (toplevel files)
rsync ${rsync_options} "${wc_path}"/* "${S}" \
|| die "${escm}: can't export toplevel files to '${S}'."
# Copy cmake directory
if [[ -d "${wc_path}/cmake" ]]; then
rsync --recursive ${rsync_options} "${wc_path}/cmake" "${S}" \
|| die "${escm}: can't export cmake files to '${S}'."
fi
# Copy all subdirectories
for subdir in $(_list_needed_subdirectories); do
targetdir=""
if [[ $subdir = doc/* && ! -e "$wc_path/$subdir" ]]; then
continue
fi
[[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
rsync --recursive ${rsync_options} "${wc_path}/${subdir%/}" "${S}/${targetdir}" \
|| die "${escm}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
done
;;
esac
else
local abort tarball tarfile f extractlist postfix
if [[ ${PV} =~ 4.4.11 ]]; then
postfix="bz2"
KMTARPARAMS+=" --bzip2"
else
postfix="xz"
KMTARPARAMS+=" --xz"
fi
tarball="${KMNAME}-${PV}.tar.${postfix}"
# Full path to source tarball
tarfile="${DISTDIR}/${tarball}"
# Detect real toplevel dir from tarball name - it will be used upon extraction
# and in _list_needed_subdirectories
topdir="${tarball%.tar.*}/"
ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
kde4-meta_create_extractlists
for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake
do
extractlist+=" ${topdir}${f}"
done
extractlist+=" $(_list_needed_subdirectories)"
pushd "${WORKDIR}" > /dev/null || die
# @ECLASS-VARIABLE: KDE4_STRICTER
# @DESCRIPTION:
# Print out all issues found executing tar / kmextract files
# Set on if you want to find issues in kde-base ebuild unpack sequences
[[ -n ${KDE4_STRICTER} ]] && echo 'tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist}'
tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null || echo "tar extract command failed at least partially - continuing anyway"
# Default $S is based on $P; rename the extracted directory to match $S if necessary
if [[ ${KMNAME} != ${PN} ]]; then
mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
fi
popd > /dev/null || die
eend $?
if [[ -n ${KDE4_STRICTER} ]]; then
for f in $(_list_needed_subdirectories fatal); do
if [[ ! -e ${S}/${f#*/} ]]; then
eerror "'${f#*/}' is missing"
abort=true
fi
done
[[ -n ${abort} ]] && die "There were missing files."
fi
# We don't need it anymore
unset topdir
fi
}
# @FUNCTION: kde4-meta_create_extractlists
# @DESCRIPTION:
# Create lists of files and subdirectories to extract.
# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
# KMEXTRACTONLY and KMTARPARAMS.
kde4-meta_create_extractlists() {
debug-print-function ${FUNCNAME} "$@"
# Add default handbook locations
# FIXME - legacy code - remove when 4.4.5 is gone or preferrably port 4.4.5.
if [[ $(get_kde_version) < 4.5 ]] && use_if_iuse handbook && [[ -z ${KMNOMODULE} ]]; then
# We use the basename of $KMMODULE because $KMMODULE can contain
# the path to the module subdirectory.
KMEXTRA_NONFATAL+="
doc/${KMMODULE##*/}"
fi
# Add default handbook locations
if [[ -z ${KMNOMODULE} ]] && ( [[ ${KDE_HANDBOOK} == always ]] || ( [[ ${KDE_HANDBOOK} == optional ]] && use handbook ) ); then
KMEXTRA_NONFATAL+=" doc/${KMMODULE##*/}"
fi
# Add some CMake-files to KMEXTRACTONLY.
# Note that this actually doesn't include KMEXTRA handling.
# In those cases you should care to add the relevant files to KMEXTRACTONLY
case ${KMNAME} in
kde-baseapps)
KMEXTRACTONLY+="
CTestConfig.cmake
config-apps.h.cmake
ConfigureChecks.cmake"
;;
kde-runtime)
KMEXTRACTONLY+="
cmake/modules/
CTestConfig.cmake
config-runtime.h.cmake"
;;
kde-workspace)
KMEXTRACTONLY+="
cmake/modules/
config-unix.h.cmake
ConfigureChecks.cmake
config-workspace.h.cmake
config-X11.h.cmake
startkde.cmake
KDE4WorkspaceConfig.cmake.in"
;;
kdepim)
if [[ ${PN} != libkdepim ]]; then
KMEXTRACTONLY+="
libkdepim/"
fi
KMEXTRACTONLY+="
config-enterprise.h.cmake
kleopatra/ConfigureChecks.cmake
CTestCustom.cmake
kdepim-version.h.cmake
kdepim-version.h"
if use_if_iuse kontact; then
KMEXTRA+="
kontact/plugins/${PLUGINNAME:-${PN}}/"
fi
;;
esac
debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
}
_list_needed_subdirectories() {
local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist
# We expand KMEXTRA by adding CMakeLists.txt files
kmextra="${KMEXTRA}"
[[ ${1} != fatal ]] && kmextra+=" ${KMEXTRA_NONFATAL}"
for i in ${kmextra}; do
kmextra_expanded+=" ${i}"
j=$(dirname ${i})
while [[ ${j} != "." ]]; do
kmextra_expanded+=" ${j}/CMakeLists.txt";
j=$(dirname ${j})
done
done
# Expand KMMODULE
if [[ -n ${KMMODULE} ]]; then
kmmodule_expanded="${KMMODULE}"
j=$(dirname ${KMMODULE})
while [[ ${j} != "." ]]; do
kmmodule_expanded+=" ${j}/CMakeLists.txt";
j=$(dirname ${j})
done
fi
# Expand KMCOMPILEONLY
for i in ${KMCOMPILEONLY}; do
kmcompileonly_expanded+=" ${i}"
j=$(dirname ${i})
while [[ ${j} != "." ]]; do
kmcompileonly_expanded+=" ${j}/CMakeLists.txt";
j=$(dirname ${j})
done
done
debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}"
debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}"
debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
# Create final list of stuff to extract
# We append topdir only when specified (usually for tarballs)
for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
${KMEXTRACTONLY}
do
extractlist+=" ${topdir}${i}"
done
echo ${extractlist}
}
# @FUNCTION: kde4-meta_src_prepare
# @DESCRIPTION:
# Meta-package build system configuration handling - commenting out targets, etc..
kde4-meta_src_prepare() {
debug-print-function ${FUNCNAME} "$@"
kde4-meta_change_cmakelists
kde4-base_src_prepare
}
# @FUNCTION: _change_cmakelists_parent_dirs
# @DESCRIPTION:
# Adjust CMakeLists.txt to shadow subdirectories
# that are not required for the build.
_change_cmakelists_parent_dirs() {
debug-print-function ${FUNCNAME} "$@"
local _olddir _dir
_dir="${S}"/${1}
until [[ ${_dir} == ${S} ]]; do
_olddir=$(basename "${_dir}")
_dir=$(dirname "${_dir}")
debug-print "${LINENO}: processing ${_dir} CMakeLists.txt searching for ${_olddir}"
if [[ -f ${_dir}/CMakeLists.txt ]]; then
sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
-e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
-i ${_dir}/CMakeLists.txt || die "${LINENO}: died in ${FUNCNAME} while processing ${_dir}"
fi
done
}
# @FUNCTION: kde4-meta_change_cmakelists
# @DESCRIPTION:
# Adjust CMakeLists.txt to comply to our splitting.
kde4-meta_change_cmakelists() {
debug-print-function ${FUNCNAME} "$@"
pushd "${S}" > /dev/null || die
comment_all_add_subdirectory ./
# Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt
if [[ -f CMakeLists.txt ]]; then
sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
-e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
-i CMakeLists.txt || die "${LINENO}: cmake sed died"
fi
# Restore "add_subdirectory( ${ ..." (this is done in kdesdk)
if [[ -f CMakeLists.txt ]]; then
sed -e '/add_subdirectory[[:space:]]*([[:space:]]*\${/s/^#DONOTCOMPILE //' \
-e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*\${/s/^#DONOTCOMPILE //' \
-i CMakeLists.txt || die "${LINENO}: cmake sed died"
fi
if [[ -z ${KMNOMODULE} ]]; then
# Restore "add_subdirectory" in $KMMODULE subdirectories
find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | \
xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
die "${LINENO}: died in KMMODULE section"
_change_cmakelists_parent_dirs ${KMMODULE}
fi
local i
# KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
for i in ${KMEXTRACTONLY}; do
if [[ -d ${i} && -f ${i}/../CMakeLists.txt ]]; then
sed -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" \
-i ${i}/../CMakeLists.txt || \
die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
fi
done
# KMCOMPILEONLY
for i in ${KMCOMPILEONLY}; do
debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}"
# Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions.
find "${S}"/${i} -name CMakeLists.txt -print0 | \
xargs -0 sed -i \
-e 's/^#DONOTCOMPILE //g' \
-e '/install(.*)/I{s/^/#DONOTINSTALL /;}' \
-e '/^install(/,/)/I{s/^/#DONOTINSTALL /;}' \
-e '/kde4_install_icons(.*)/I{s/^/#DONOTINSTALL /;}' || \
die "${LINENO}: sed died in the KMCOMPILEONLY section while processing ${i}"
_change_cmakelists_parent_dirs ${i}
done
# KMEXTRA section
for i in ${KMEXTRA}; do
debug-print "${LINENO}: KMEXTRA section, processing ${i}"
find "${S}"/${i} -name CMakeLists.txt -print0 | \
xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
_change_cmakelists_parent_dirs ${i}
done
# KMEXTRA_NONFATAL section
for i in ${KMEXTRA_NONFATAL}; do
if [[ -d "${S}"/${i} ]]; then
find "${S}"/${i} -name CMakeLists.txt -print0 | \
xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
_change_cmakelists_parent_dirs ${i}
fi
done
case ${KMNAME} in
kde-workspace)
# COLLISION PROTECT section
# Install the startkde script just once, as a part of kde-plasma/kdebase-startkde,
# not as a part of every package.
if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
# The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.
sed -e '/startkde/s/^/#DONOTINSTALL /' \
-i CMakeLists.txt || die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
fi
# Remove workspace target prefix in order to get direct linking to workspace libs
sed -e '/set(KDE4WORKSPACE_TARGET_PREFIX/s/^/#OVERRIDE /' \
-i CMakeLists.txt || die "${LINENO}: sed died in KDE4WORKSPACE_TARGET_PREFIX removal section"
# Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
if [[ ${PN} != libkworkspace ]]; then
sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
-i CMakeLists.txt || die "${LINENO}: sed died in kde-workspace strip config install and fix EXPORT section"
fi
# <KDE/4.11
if [[ ${PN} != plasma-workspace ]]; then
sed -e '/KActivities/s/REQUIRED//' \
-i CMakeLists.txt || die "${LINENO}: sed died in kde-workspace dep reduction section"
fi
sed -e '/QImageBlitz/s/REQUIRED//' \
-i CMakeLists.txt || die "${LINENO}: sed died in kde-workspace dep reduction section 2"
# >=KDE/4.11
sed -e 's/TYPE REQUIRED/TYPE OPTIONAL/' -e 's/XCB REQUIRED/XCB/' -e 's/X11 REQUIRED/X11/' \
-e 's/message(FATAL_ERROR/message(/' -i CMakeLists.txt \
|| die "${LINENO}: sed died in kde-workspace dep reduction section"
if [[ "${PN}" != "kwin" ]]; then
sed -i -e "/^ macro_log_feature(OPENGL_OR_ES_FOUND/s/TRUE/FALSE/" \
"${S}"/CMakeLists.txt || die "${LINENO}: sed died removing kde-workspace opengl dependency"
fi
;;
kde-runtime)
sed -e 's/TYPE REQUIRED/TYPE OPTIONAL/' -e '/LibGcrypt/s/REQUIRED//' -i CMakeLists.txt \
|| die "${LINENO}: sed died in kde-runtime dep reduction section"
# COLLISION PROTECT section
# Only install the kde4 script as part of kde-base/kdebase-data
if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then
sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
-i CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
fi
;;
kdenetwork)
# Disable hardcoded kdepimlibs check
sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
-i CMakeLists.txt || die "failed to disable hardcoded checks"
;;
kdepim)
# Disable hardcoded checks
sed -r -e 's/TYPE REQUIRED/TYPE OPTIONAL/' -e '/find_package\(KdepimLibs/s/REQUIRED//' \
-e '/find_package\((KdepimLibs|Boost|QGpgme|Akonadi|ZLIB|Strigi|SharedDesktopOntologies|Soprano|Nepomuk)/{/macro_optional_/!s/find/macro_optional_&/}' \
-e '/macro_log_feature\((Boost|QGPGME|Akonadi|ZLIB|STRIGI|SHAREDDESKTOPONTOLOGIES|Soprano|Nepomuk)_FOUND/s/ TRUE / FALSE /' \
-e 's/if[[:space:]]*([[:space:]]*BUILD_.*)[[:space:]]*/if(1) # &/' \
-e 's/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)[[:space:]]*$/if(1) # &/' \
-i CMakeLists.txt || die "failed to disable hardcoded checks"
# Disable broken or redundant build logic
if use_if_iuse kontact || [[ ${PN} = kontact ]]; then
sed -e 's/if[[:space:]]*([[:space:]]*BUILD_.*)[[:space:]]*$/if(1) # &/' \
-e 's/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)[[:space:]]*$/if(1) # &/' \
-i kontact/plugins/CMakeLists.txt || die 'failed to override build logic'
fi
case ${PV} in
4.4*)
case ${PN} in
kalarm|kmailcvt|kontact|korganizer|korn)
sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
-e '/add_custom_target(kmail_xml /,/)/p' \
-i kmail/CMakeLists.txt || die "uncommenting xml failed"
_change_cmakelists_parent_dirs kmail
;;
esac
;;
esac
;;
esac
popd > /dev/null || die
}
# @FUNCTION: kde4-meta_src_configure
# @DESCRIPTION:
# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
# ebuilds.
kde4-meta_src_configure() {
debug-print-function ${FUNCNAME} "$@"
kde4-base_src_configure
}
# @FUNCTION: kde4-meta_src_compile
# @DESCRIPTION:
# General function for compiling split KDE4 applications.
# Overrides kde4-base_src_compile.
kde4-meta_src_compile() {
debug-print-function ${FUNCNAME} "$@"
kde4-base_src_compile "$@"
}
# @FUNCTION: kde4-meta_src_test
# @DESCRIPTION:
# Currently just calls its equivalent in kde4-base.eclass(5) if
# I_KNOW_WHAT_I_AM_DOING is set. Use this in split ebuilds.
kde4-meta_src_test() {
debug-print-function ${FUNCNAME} "$@"
if [[ $I_KNOW_WHAT_I_AM_DOING ]]; then
kde4-base_src_test
else
einfo "Tests disabled"
fi
}
# @FUNCTION: kde4-meta_src_install
# @DESCRIPTION:
# Function for installing KDE4 split applications.
kde4-meta_src_install() {
debug-print-function ${FUNCNAME} "$@"
# Search ${S}/${KMMODULE} and install common documentation files found
local doc
for doc in "${S}/${KMMODULE}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
[[ -f "${doc}" ]] && [[ -s "${doc}" ]] && dodoc "${doc}"
done
kde4-base_src_install
}
# @FUNCTION: kde4-meta_pkg_preinst
# @DESCRIPTION:
# Invoke its equivalent in kde4-base.eclass.
kde4-meta_pkg_preinst() {
debug-print-function ${FUNCNAME} "$@"
kde4-base_pkg_preinst
}
# @FUNCTION: kde4-meta_pkg_postinst
# @DESCRIPTION:
# Invoke kbuildsycoca4.
kde4-meta_pkg_postinst() {
debug-print-function ${FUNCNAME} "$@"
kde4-base_pkg_postinst
}
# @FUNCTION: kde4-meta_pkg_postrm
# @DESCRIPTION:
# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
# ebuilds.
kde4-meta_pkg_postrm() {
debug-print-function ${FUNCNAME} "$@"
kde4-base_pkg_postrm
}
fi

View File

@ -1,32 +1,34 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: kde5-functions.eclass
# @MAINTAINER:
# kde@gentoo.org
# @BLURB: Common ebuild functions for KDE 5 packages
# @SUPPORTED_EAPIS: 6
# @BLURB: Common ebuild functions for packages based on KDE Frameworks 5.
# @DESCRIPTION:
# This eclass contains all functions shared by the different eclasses,
# for KDE 5 ebuilds.
# This eclass contains functions shared by the other KDE eclasses and forms
# part of their public API.
#
# This eclass should (almost) never be inherited directly by an ebuild.
if [[ -z ${_KDE5_FUNCTIONS_ECLASS} ]]; then
_KDE5_FUNCTIONS_ECLASS=1
inherit toolchain-funcs versionator
inherit toolchain-funcs
# @ECLASS-VARIABLE: EAPI
# @DESCRIPTION:
# Currently EAPI 6 is supported.
case ${EAPI} in
6) ;;
6) inherit eapi7-ver ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
# determine the build type
# @ECLASS-VARIABLE: KDE_BUILD_TYPE
# @DESCRIPTION:
# If PV matches "*9999*", this is automatically set to "live".
# Otherwise, this is automatically set to "release".
KDE_BUILD_TYPE="release"
if [[ ${PV} = *9999* ]]; then
KDE_BUILD_TYPE="live"
else
KDE_BUILD_TYPE="release"
fi
export KDE_BUILD_TYPE
@ -35,39 +37,52 @@ case ${CATEGORY} in
[[ ${KDE_BUILD_TYPE} = live ]] && : ${FRAMEWORKS_MINIMAL:=9999}
;;
kde-plasma)
[[ ${PV} = 5.11* ]] && : ${FRAMEWORKS_MINIMAL:=5.38.0}
if [[ ${KDE_BUILD_TYPE} = live ]]; then
: ${FRAMEWORKS_MINIMAL:=9999}
if [[ ${PV} = 5.12.5* ]]; then
: ${FRAMEWORKS_MINIMAL:=5.43.0}
: ${QT_MINIMAL:=5.9.1}
fi
if [[ ${KDE_BUILD_TYPE} = live && ${PV} != 5.12* ]]; then
: ${FRAMEWORKS_MINIMAL:=9999}
: ${QT_MINIMAL:=5.10.1}
fi
;;
kde-apps)
if [[ ${PV} = 17.12.3* ]]; then
: ${FRAMEWORKS_MINIMAL:=5.43.0}
: ${QT_MINIMAL:=5.9.1}
fi
[[ ${PV} = 18.04.2* ]] && : ${FRAMEWORKS_MINIMAL:=5.44.0}
;;
esac
# @ECLASS-VARIABLE: QT_MINIMAL
# @DESCRIPTION:
# Minimal Qt version to require for the package.
: ${QT_MINIMAL:=5.7.1}
# Minimum version of Qt to require. This affects add_qt_dep.
: ${QT_MINIMAL:=5.9.4}
# @ECLASS-VARIABLE: FRAMEWORKS_MINIMAL
# @DESCRIPTION:
# Minimal Frameworks version to require for the package.
: ${FRAMEWORKS_MINIMAL:=5.37.0}
# Minimum version of Frameworks to require. This affects add_frameworks_dep.
: ${FRAMEWORKS_MINIMAL:=5.46.0}
# @ECLASS-VARIABLE: PLASMA_MINIMAL
# @DESCRIPTION:
# Minimal Plasma version to require for the package.
: ${PLASMA_MINIMAL:=5.10.5}
# Minimum version of Plasma to require. This affects add_plasma_dep.
: ${PLASMA_MINIMAL:=5.12.5}
# @ECLASS-VARIABLE: KDE_APPS_MINIMAL
# @DESCRIPTION:
# Minimal KDE Applications version to require for the package.
: ${KDE_APPS_MINIMAL:=14.12.0}
# Minimum version of KDE Applications to require. This affects add_kdeapps_dep.
: ${KDE_APPS_MINIMAL:=17.12.3}
# @ECLASS-VARIABLE: KDE_GCC_MINIMAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# Minimal GCC version to require for the package.
# Minimum version of active GCC to require. This is checked in kde5.eclass in
# kde5_pkg_pretend and kde5_pkg_setup.
# @ECLASS-VARIABLE: KDEBASE
# @DEFAULT_UNSET
# @DESCRIPTION:
# This gets set to a non-zero value when a package is considered a
# kdevelop ebuild.
@ -79,7 +94,8 @@ debug-print "${ECLASS}: ${KDEBASE} ebuild recognized"
# @ECLASS-VARIABLE: KDE_SCM
# @DESCRIPTION:
# SCM to use if this is a live ebuild.
# SCM to use if KDE_BUILD_TYPE is determined to be "live".
# Currently, only git is supported.
: ${KDE_SCM:=git}
case ${KDE_SCM} in
@ -135,7 +151,7 @@ _add_category_dep() {
if [[ -n ${version} ]] ; then
local operator=">="
local version="-$(get_version_component_range 1-3 ${version})"
local version="-${version}"
fi
if [[ -n ${slot} ]] ; then
@ -148,7 +164,7 @@ _add_category_dep() {
}
# @FUNCTION: add_frameworks_dep
# @USAGE: <package> [USE flags] [minimum version]
# @USAGE: <package name> [USE flags] [minimum version] [slot + operator]
# @DESCRIPTION:
# Create proper dependency for kde-frameworks/ dependencies.
# This takes 1 to 4 arguments. The first being the package name, the optional
@ -171,8 +187,8 @@ add_frameworks_dep() {
if [[ -n ${3} ]]; then
version=${3}
elif [[ ${CATEGORY} = kde-frameworks ]]; then
version=$(get_version_component_range 1-2)
elif [[ -z "${version}" ]] ; then
version=$(ver_cut 1-2)
elif [[ -z ${3} ]] ; then
version=${FRAMEWORKS_MINIMAL}
fi
@ -180,7 +196,7 @@ add_frameworks_dep() {
}
# @FUNCTION: add_plasma_dep
# @USAGE: <package> [USE flags] [minimum version]
# @USAGE: <package name> [USE flags] [minimum version] [slot + operator]
# @DESCRIPTION:
# Create proper dependency for kde-plasma/ dependencies.
# This takes 1 to 4 arguments. The first being the package name, the optional
@ -203,8 +219,8 @@ add_plasma_dep() {
if [[ -n ${3} ]]; then
version=${3}
elif [[ ${CATEGORY} = kde-plasma ]]; then
version=${PV}
elif [[ -z "${version}" ]] ; then
version=$(ver_cut 1-3)
elif [[ -z ${3} ]] ; then
version=${PLASMA_MINIMAL}
fi
@ -212,7 +228,7 @@ add_plasma_dep() {
}
# @FUNCTION: add_kdeapps_dep
# @USAGE: <package> [USE flags] [minimum version]
# @USAGE: <package name> [USE flags] [minimum version] [slot + operator]
# @DESCRIPTION:
# Create proper dependency for kde-apps/ dependencies.
# This takes 1 to 4 arguments. The first being the package name, the optional
@ -235,8 +251,8 @@ add_kdeapps_dep() {
if [[ -n ${3} ]]; then
version=${3}
elif [[ ${CATEGORY} = kde-apps ]]; then
version=${PV}
elif [[ -z "${version}" ]] ; then
version=$(ver_cut 1-3)
elif [[ -z ${3} ]] ; then
version=${KDE_APPS_MINIMAL}
fi
@ -244,7 +260,7 @@ add_kdeapps_dep() {
}
# @FUNCTION: add_qt_dep
# @USAGE: <package> [USE flags] [minimum version]
# @USAGE: <package name> [USE flags] [minimum version] [slot + operator]
# @DESCRIPTION:
# Create proper dependency for dev-qt/ dependencies.
# This takes 1 to 4 arguments. The first being the package name, the optional
@ -262,15 +278,16 @@ add_qt_dep() {
die "${FUNCNAME} was called with too many arguments"
fi
local version
local version=${3}
local slot=${4}
if [[ -n ${3} ]]; then
version=${3}
elif [[ -z "${version}" ]]; then
if [[ -z ${version} ]]; then
if [[ ${1} = qtwebkit && $(ver_cut 2 ${QT_MINIMAL}) -ge 9 ]]; then
version=5.9.1 # no more upstream release, need bug #624404
else
version=${QT_MINIMAL}
fi
fi
if [[ -z ${slot} ]]; then
slot="5"
fi
@ -278,15 +295,18 @@ add_qt_dep() {
_add_category_dep dev-qt "${1}" "${2}" "${version}" "${slot}"
}
# @FUNCTION: get_kde_version
# @FUNCTION: get_kde_version [version]
# @DESCRIPTION:
# Translates an ebuild version into a major.minor KDE SC
# release version. If no version is specified, ${PV} is used.
# Translates an ebuild version into a major.minor KDE release version, taking
# into account KDE's prerelease versioning scheme.
# For example, get_kde_version 17.07.80 will return "17.08".
# If the version equals 9999, "live" is returned.
# If no version is specified, ${PV} is used.
get_kde_version() {
local ver=${1:-${PV}}
local major=$(get_major_version ${ver})
local minor=$(get_version_component_range 2 ${ver})
local micro=$(get_version_component_range 3 ${ver})
local major=$(ver_cut 1 ${ver})
local minor=$(ver_cut 2 ${ver})
local micro=$(ver_cut 3 ${ver})
if [[ ${ver} == 9999 ]]; then
echo live
else

View File

@ -4,9 +4,10 @@
# @ECLASS: kde5-meta-pkg.eclass
# @MAINTAINER:
# kde@gentoo.org
# @BLURB: This eclass contains boilerplate for KDE 5 meta packages
# @BLURB: This eclass contains boilerplate for KDE meta packages.
# @DESCRIPTION:
# This eclass should only be used for defining meta packages for KDE 5.
# This eclass should only be used for defining meta packages bundling
# software produced by the KDE community.
if [[ -z ${_KDE5_META_PKG_ECLASS} ]]; then
_KDE5_META_PKG_ECLASS=1

View File

@ -1,12 +1,25 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: kde5.eclass
# @MAINTAINER:
# kde@gentoo.org
# @BLURB: Support eclass for KDE 5-related packages.
# @BLURB: Support eclass for packages that follow KDE packaging conventions.
# @DESCRIPTION:
# The kde5.eclass provides support for building KDE 5-related packages.
# This eclass is intended to streamline the creation of ebuilds for packages
# that follow KDE upstream packaging conventions. It's primarily intended for
# the three upstream release groups (Frameworks, Plasma, Applications) but
# is also for any package that follows similar conventions.
#
# This eclass unconditionally inherits kde5-functions.eclass and all its public
# functions and variables may be considered as part of this eclass's API.
#
# This eclass unconditionally inherits cmake-utils.eclass and all its public
# variables and helper functions (not phase functions) may be considered as part
# of this eclass's API.
#
# This eclass's phase functions are not intended to be mixed and matched, so if
# any phase functions are overridden the version here should also be called.
if [[ -z ${_KDE5_ECLASS} ]]; then
_KDE5_ECLASS=1
@ -18,7 +31,11 @@ _KDE5_ECLASS=1
# for tests you should proceed with setting VIRTUALX_REQUIRED=test.
: ${VIRTUALX_REQUIRED:=manual}
inherit cmake-utils eutils flag-o-matic gnome2-utils kde5-functions versionator virtualx xdg
inherit cmake-utils flag-o-matic gnome2-utils kde5-functions virtualx xdg
case ${EAPI} in
6) inherit eapi7-ver eutils ;;
esac
if [[ ${KDE_BUILD_TYPE} = live ]]; then
case ${KDE_SCM} in
@ -35,19 +52,22 @@ EXPORT_FUNCTIONS pkg_setup pkg_nofetch src_unpack src_prepare src_configure src_
# @ECLASS-VARIABLE: KDE_AUTODEPS
# @DESCRIPTION:
# If set to "false", do nothing.
# For any other value, add a dependency on dev-qt/qtcore:5 and kde-frameworks/extra-cmake-modules:5.
# For any other value, add dependencies on dev-qt/qtcore:5, kde-frameworks/kf-env
# and kde-frameworks/extra-cmake-modules:5. Additionally, required blockers may
# be set depending on the value of CATEGORY.
: ${KDE_AUTODEPS:=true}
# @ECLASS-VARIABLE: KDE_BLOCK_SLOT4
# @DESCRIPTION:
# This variable is used when KDE_AUTODEPS is set.
# If set to "true", add RDEPEND block on kde-apps/${PN}:4
# This variable only has any effect when when CATEGORY = "kde-apps" and
# KDE_AUTODEPS is also set. If set to "true", add RDEPEND block on kde-apps/${PN}:4
: ${KDE_BLOCK_SLOT4:=true}
# @ECLASS-VARIABLE: KDE_DEBUG
# @DESCRIPTION:
# If set to "false", unconditionally build with -DNDEBUG.
# Otherwise, add debug to IUSE to control building with that flag.
# If set to "false", add -DNDEBUG (via cmake-utils_src_configure) and -DQT_NO_DEBUG
# to CPPFLAGS.
# Otherwise, add debug to IUSE.
: ${KDE_DEBUG:=true}
# @ECLASS-VARIABLE: KDE_DESIGNERPLUGIN
@ -76,19 +96,23 @@ EXPORT_FUNCTIONS pkg_setup pkg_nofetch src_unpack src_prepare src_configure src_
# @ECLASS-VARIABLE: KDE_DOC_DIR
# @DESCRIPTION:
# Defaults to "doc". Otherwise, use alternative KDE handbook path.
# Specifies the location of the KDE handbook if not the default.
: ${KDE_DOC_DIR:=doc}
# @ECLASS-VARIABLE: KDE_PO_DIRS
# @DESCRIPTION:
# Specifies the possible locations of KDE l10n files if not the default.
: ${KDE_PO_DIRS:="po poqm"}
# @ECLASS-VARIABLE: KDE_QTHELP
# @DESCRIPTION:
# If set to "false", do nothing.
# Otherwise, add "doc" to IUSE, add the appropriate dependency, generate
# and install Qt compressed help files with -DBUILD_QCH=ON when USE=doc.
if [[ ${CATEGORY} = kde-frameworks && ( $(get_version_component_range 2) -ge 36 || ${KDE_BUILD_TYPE} = live ) ]]; then
if [[ ${CATEGORY} = kde-frameworks ]]; then
: ${KDE_QTHELP:=true}
else
: ${KDE_QTHELP:=false}
fi
: ${KDE_QTHELP:=false}
# @ECLASS-VARIABLE: KDE_TESTPATTERN
# @DESCRIPTION:
@ -111,9 +135,8 @@ fi
# fix and creates ${T}/${P}-tests-optional.patch to refine and submit upstream.
if [[ ${CATEGORY} = kde-frameworks ]]; then
: ${KDE_TEST:=true}
else
: ${KDE_TEST:=false}
fi
: ${KDE_TEST:=false}
# @ECLASS-VARIABLE: KDE_SELINUX_MODULE
# @DESCRIPTION:
@ -161,7 +184,7 @@ case ${KDE_SUBSLOT} in
kde-frameworks | \
kde-plasma | \
kde-apps)
SLOT+="/$(get_version_component_range 1-2)"
SLOT+="/$(ver_cut 1-2)"
;;
*)
SLOT+="/${PV}"
@ -180,21 +203,19 @@ case ${KDE_AUTODEPS} in
RDEPEND+=" >=kde-frameworks/kf-env-4"
COMMONDEPEND+=" $(add_qt_dep qtcore)"
case ${CATEGORY} in
kde-frameworks | \
kde-plasma)
RDEPEND+=" !<kde-apps/kde4-l10n-15.12.3-r1"
;;
kde-apps)
# all packages need breeze/oxygen icons for basic iconset, bug #564838
if [[ ${PN} != breeze-icons && ${PN} != oxygen-icons ]]; then
RDEPEND+=" || ( $(add_frameworks_dep breeze-icons) kde-frameworks/oxygen-icons:* )"
fi
if [[ ${CATEGORY} = kde-apps ]]; then
[[ ${KDE_BLOCK_SLOT4} = true ]] && RDEPEND+=" !kde-apps/${PN}:4"
[[ $(get_version_component_range 1) -ge 17 ]] && \
RDEPEND+="
!kde-apps/kde-l10n
!<kde-apps/kde4-l10n-16.12.0:4
!kde-apps/kdepim-l10n:5
"
;;
esac
fi
;;
esac
@ -209,11 +230,7 @@ case ${KDE_DESIGNERPLUGIN} in
false) ;;
*)
IUSE+=" designer"
DEPEND+=" designer? (
$(add_frameworks_dep kdesignerplugin)
$(add_qt_dep designer)
)"
;;
DEPEND+=" designer? ( $(add_frameworks_dep kdesignerplugin) )"
esac
case ${KDE_EXAMPLES} in
@ -314,8 +331,6 @@ _calculate_src_uri() {
case ${CATEGORY} in
kde-apps)
case ${PV} in
16.12.3)
SRC_URI="mirror://kde/Attic/applications/16.12.3/src/${_kmname}-${PV}.tar.xz" ;;
??.?.[6-9]? | ??.??.[6-9]? )
SRC_URI="mirror://kde/unstable/applications/${PV}/src/${_kmname}-${PV}.tar.xz"
RESTRICT+=" mirror"
@ -327,10 +342,10 @@ _calculate_src_uri() {
kde-frameworks)
SRC_URI="mirror://kde/stable/frameworks/${PV%.*}/${_kmname}-${PV}.tar.xz" ;;
kde-plasma)
local plasmapv=$(get_version_component_range 1-3)
local plasmapv=$(ver_cut 1-3)
case ${PV} in
5.?.[6-9]? )
5.?.[6-9]? | 5.??.[6-9]? )
# Plasma 5 beta releases
SRC_URI="mirror://kde/unstable/plasma/${plasmapv}/${_kmname}-${PV}.tar.xz"
RESTRICT+=" mirror"
@ -396,11 +411,11 @@ _calculate_live_repo() {
fi
if [[ ${PV} == ??.??.49.9999 && ${CATEGORY} = kde-apps ]]; then
EGIT_BRANCH="Applications/$(get_version_component_range 1-2)"
EGIT_BRANCH="Applications/$(ver_cut 1-2)"
fi
if [[ ${PV} != 9999 && ${CATEGORY} = kde-plasma ]]; then
EGIT_BRANCH="Plasma/$(get_version_component_range 1-2)"
EGIT_BRANCH="Plasma/$(ver_cut 1-2)"
fi
EGIT_REPO_URI="${EGIT_MIRROR}/${_kmname}"
@ -417,7 +432,8 @@ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
# @FUNCTION: kde5_pkg_pretend
# @DESCRIPTION:
# Do some basic settings
# Checks if the active compiler meets the minimum version requirements.
# phase function is only exported if KDE_GCC_MINIMAL is defined.
kde5_pkg_pretend() {
debug-print-function ${FUNCNAME} "$@"
_check_gcc_version
@ -425,7 +441,7 @@ kde5_pkg_pretend() {
# @FUNCTION: kde5_pkg_setup
# @DESCRIPTION:
# Do some basic settings
# Checks if the active compiler meets the minimum version requirements.
kde5_pkg_setup() {
debug-print-function ${FUNCNAME} "$@"
_check_gcc_version
@ -433,7 +449,9 @@ kde5_pkg_setup() {
# @FUNCTION: kde5_pkg_nofetch
# @DESCRIPTION:
# Display package publication status
# Intended for use in the KDE overlay. If this package matches something in
# KDE_UNRELEASED, display a giant warning that the package has not yet been
# released upstream and should not be used.
kde5_pkg_nofetch() {
if ! _kde_is_unreleased ; then
return
@ -463,7 +481,7 @@ kde5_pkg_nofetch() {
# @FUNCTION: kde5_src_unpack
# @DESCRIPTION:
# Function for unpacking KDE 5.
# Unpack the sources, automatically handling both release and live ebuilds.
kde5_src_unpack() {
debug-print-function ${FUNCNAME} "$@"
@ -480,7 +498,8 @@ kde5_src_unpack() {
# @FUNCTION: kde5_src_prepare
# @DESCRIPTION:
# Function for preparing the KDE 5 sources.
# Wrapper for cmake-utils_src_prepare with lots of extra logic for magic
# handling of linguas, tests, handbook etc.
kde5_src_prepare() {
debug-print-function ${FUNCNAME} "$@"
@ -503,18 +522,18 @@ kde5_src_prepare() {
# drop translations when nls is not wanted
if in_iuse nls && ! use nls ; then
if [[ -d po ]] ; then
rm -r po || die
fi
if [[ -d poqm ]] ; then
rm -r poqm || die
local po
for po in ${KDE_PO_DIRS}; do
if [[ -d ${po} ]] ; then
rm -r ${po} || die
fi
done
fi
# enable only the requested translations when required
if [[ -v LINGUAS ]] ; then
local po
for po in po poqm; do
for po in ${KDE_PO_DIRS}; do
if [[ -d ${po} ]] ; then
pushd ${po} > /dev/null || die
local lang
@ -590,7 +609,8 @@ kde5_src_prepare() {
# @FUNCTION: kde5_src_configure
# @DESCRIPTION:
# Function for configuring the build of KDE 5.
# Wrapper for cmake-utils_src_configure with extra logic for magic handling of
# handbook, tests etc.
kde5_src_configure() {
debug-print-function ${FUNCNAME} "$@"
@ -601,7 +621,7 @@ kde5_src_configure() {
local cmakeargs
if ! use_if_iuse test ; then
if in_iuse test && ! use test ; then
cmakeargs+=( -DBUILD_TESTING=OFF )
if [[ ${KDE_TEST} = optional ]] ; then
@ -614,7 +634,7 @@ kde5_src_configure() {
fi
if ! use_if_iuse designer && [[ ${KDE_DESIGNERPLUGIN} != false ]] ; then
cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Designer=ON )
cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_KF5DesignerPlugin=ON )
fi
if [[ ${KDE_QTHELP} != false ]]; then
@ -632,7 +652,8 @@ kde5_src_configure() {
# @FUNCTION: kde5_src_compile
# @DESCRIPTION:
# Function for compiling KDE 5.
# Wrapper for cmake-utils_src_compile. Currently doesn't do anything extra, but
# is included as part of the API just in case it's needed in the future.
kde5_src_compile() {
debug-print-function ${FUNCNAME} "$@"
@ -641,7 +662,8 @@ kde5_src_compile() {
# @FUNCTION: kde5_src_test
# @DESCRIPTION:
# Function for testing KDE 5.
# Wrapper for cmake-utils_src_test with extra logic for magic handling of dbus
# and virtualx.
kde5_src_test() {
debug-print-function ${FUNCNAME} "$@"
@ -672,7 +694,9 @@ kde5_src_test() {
# @FUNCTION: kde5_src_install
# @DESCRIPTION:
# Function for installing KDE 5.
# Wrapper for cmake-utils_src_install with extra logic to avoid compressing
# certain types of files. For example, khelpcenter is not able to read
# compressed handbooks.
kde5_src_install() {
debug-print-function ${FUNCNAME} "$@"
@ -695,7 +719,7 @@ kde5_src_install() {
# @FUNCTION: kde5_pkg_preinst
# @DESCRIPTION:
# Function storing icon caches
# Sets up environment variables required in kde5_pkg_postinst.
kde5_pkg_preinst() {
debug-print-function ${FUNCNAME} "$@"
@ -705,7 +729,7 @@ kde5_pkg_preinst() {
# @FUNCTION: kde5_pkg_postinst
# @DESCRIPTION:
# Function to rebuild the KDE System Configuration Cache after an application has been installed.
# Updates the various XDG caches (icon, desktop, mime) if necessary.
kde5_pkg_postinst() {
debug-print-function ${FUNCNAME} "$@"
@ -726,7 +750,7 @@ kde5_pkg_postinst() {
# @FUNCTION: kde5_pkg_postrm
# @DESCRIPTION:
# Function to rebuild the KDE System Configuration Cache after an application has been removed.
# Updates the various XDG caches (icon, desktop, mime) if necessary.
kde5_pkg_postrm() {
debug-print-function ${FUNCNAME} "$@"

View File

@ -1,4 +1,4 @@
# Copyright 1999-2016 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: kernel-2.eclass
@ -146,7 +146,7 @@
# @DESCRIPTION:
# This kernel was already deblobbed elsewhere.
# If false, either optional deblobbing will be available
# or the license will note the inclusion of freedist code.
# or the license will note the inclusion of linux-firmware code.
# @ECLASS-VARIABLE: K_LONGTERM
# @DEFAULT_UNSET
@ -606,6 +606,7 @@ if [[ ${ETYPE} == sources ]]; then
sys-devel/make
dev-lang/perl
sys-devel/bc
virtual/libelf
)"
SLOT="${PVR}"
@ -624,7 +625,7 @@ if [[ ${ETYPE} == sources ]]; then
# Reflect that kernels contain firmware blobs unless otherwise
# stripped
LICENSE="${LICENSE} !deblob? ( freedist )"
LICENSE="${LICENSE} !deblob? ( linux-firmware )"
DEPEND+=" deblob? ( ${PYTHON_DEPS} )"
@ -642,7 +643,7 @@ if [[ ${ETYPE} == sources ]]; then
K_DEBLOB_TAG=${K_DEBLOB_TAG:--gnu}
DEBLOB_A="deblob-${DEBLOB_PV}"
DEBLOB_CHECK_A="deblob-check-${DEBLOB_PV}"
DEBLOB_HOMEPAGE="http://www.fsfla.org/svn/fsfla/software/linux-libre/releases/tags"
DEBLOB_HOMEPAGE="https://www.fsfla.org/svn/fsfla/software/linux-libre/releases/tags/"
DEBLOB_URI_PATH="${DEBLOB_PV}${K_DEBLOB_TAG}"
if ! has "${EAPI:-0}" 0 1 ; then
DEBLOB_CHECK_URI="${DEBLOB_HOMEPAGE}/${DEBLOB_URI_PATH}/deblob-check -> ${DEBLOB_CHECK_A}"
@ -661,13 +662,13 @@ if [[ ${ETYPE} == sources ]]; then
else
# We have no way to deblob older kernels, so just mark them as
# tainted with non-libre materials.
LICENSE="${LICENSE} freedist"
LICENSE="${LICENSE} linux-firmware"
fi
fi
elif [[ ${ETYPE} == headers ]]; then
DESCRIPTION="Linux system headers"
IUSE="crosscompile_opts_headers-only"
IUSE="headers-only"
# Since we should NOT honour KBUILD_OUTPUT in headers
# lets unset it here.
@ -693,7 +694,7 @@ kernel_header_destdir() {
# @DESCRIPTION:
# set use if necessary for cross compile support
cross_pre_c_headers() {
use crosscompile_opts_headers-only && [[ ${CHOST} != ${CTARGET} ]]
use headers-only && [[ ${CHOST} != ${CTARGET} ]]
}
# @FUNCTION: env_setup_xmakeopts
@ -748,7 +749,6 @@ unpack_2_6() {
touch .config
eerror "make defconfig failed."
eerror "assuming you dont have any headers installed yet and continuing"
epause 5
fi
make -s include/linux/version.h ${xmakeopts} 2>/dev/null \
@ -1257,7 +1257,8 @@ unipatch() {
# bug #272676
if [[ "$(tc-arch)" = "sparc" || "$(tc-arch)" = "sparc64" ]]; then
if [[ ${KV_MAJOR} -ge 3 || ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} > 2.6.28 ]]; then
UNIPATCH_DROP="${UNIPATCH_DROP} *_fbcondecor-0.9.6.patch"
if [[ ! -z ${K_WANT_GENPATCHES} ]] ; then
UNIPATCH_DROP="${UNIPATCH_DROP} *_fbcondecor*.patch"
echo
ewarn "fbcondecor currently prevents sparc/sparc64 from booting"
ewarn "for kernel versions >= 2.6.29. Removing fbcondecor patch."
@ -1265,6 +1266,7 @@ unipatch() {
echo
fi
fi
fi
#so now lets get rid of the patchno's we want to exclude
UNIPATCH_DROP="${UNIPATCH_EXCLUDE} ${UNIPATCH_DROP}"
@ -1606,7 +1608,6 @@ kernel-2_pkg_setup() {
ewarn "Also be aware that bugreports about gcc-4 not working"
ewarn "with linux-2.4 based ebuilds will be closed as INVALID!"
echo
epause 10
fi
fi

View File

@ -1,4 +1,4 @@
# Copyright 1999-2016 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: l10n.eclass
@ -12,15 +12,13 @@
# conveniently handle localizations (translations) offered by packages.
# These are meant to prevent code duplication for such boring tasks as
# determining the cross-section between the user's set LINGUAS and what
# is offered by the package; and generating the right list of linguas_*
# USE flags.
# is offered by the package.
# @ECLASS-VARIABLE: PLOCALES
# @DEFAULT_UNSET
# @DESCRIPTION:
# Variable listing the locales for which localizations are offered by
# the package. Check profiles/desc/linguas.desc to see if the locales
# are listed there. Add any missing ones there.
# the package.
#
# Example: PLOCALES="cy de el_GR en_US pt_BR vi zh_CN"
@ -33,11 +31,6 @@
#
# Example: PLOCALE_BACKUP="en_US"
# Add linguas useflags
for u in ${PLOCALES}; do
IUSE+=" linguas_${u}"
done
# @FUNCTION: l10n_for_each_locale_do
# @USAGE: <function>
# @DESCRIPTION:
@ -103,23 +96,27 @@ l10n_find_plocales_changes() {
# @FUNCTION: l10n_get_locales
# @USAGE: [disabled]
# @DESCRIPTION:
# Determine which LINGUAS USE flags the user has enabled that are offered
# by the package, as listed in PLOCALES, and return them. In case no locales
# are selected, fall back on PLOCALE_BACKUP. When the disabled argument is
# given, return the disabled useflags instead of the enabled ones.
# Determine which LINGUAS the user has enabled that are offered by the
# package, as listed in PLOCALES, and return them. In case no locales
# are selected, fall back on PLOCALE_BACKUP. When the disabled argument
# is given, return the disabled locales instead of the enabled ones.
l10n_get_locales() {
local disabled_locales enabled_locales loc locs
for loc in ${PLOCALES}; do
if use linguas_${loc}; then
enabled_locales+="${loc} "
local loc locs
if [[ -z ${LINGUAS+set} ]]; then
# enable all if unset
locs=${PLOCALES}
else
disabled_locales+="${loc} "
fi
for loc in ${LINGUAS}; do
has ${loc} ${PLOCALES} && locs+="${loc} "
done
fi
[[ -z ${locs} ]] && locs=${PLOCALE_BACKUP}
if [[ ${1} == disabled ]]; then
locs=${disabled_locales}
else
locs=${enabled_locales:-$PLOCALE_BACKUP}
local disabled_locs
for loc in ${PLOCALES}; do
has ${loc} ${locs} || disabled_locs+="${loc} "
done
locs=${disabled_locs}
fi
printf "%s" "${locs}"
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2016 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: latex-package.eclass
@ -54,13 +54,16 @@
case ${EAPI:-0} in
0|1|2|3|4|5) inherit base eutils ;;
6) ;;
*) die "Unknown EAPI ${EAPI} for ${ECLASS}" ;;
esac
RDEPEND="virtual/latex-base"
DEPEND="${RDEPEND}
>=sys-apps/texinfo-4.2-r5"
case ${EAPI:-0} in
0|1|2|3|4|5|6) ;;
7) BDEPEND="${DEPEND}"; DEPEND="" ;;
*) die "${ECLASS}: Unknown EAPI ${EAPI}" ;;
esac
HOMEPAGE="http://www.tug.org/"
TEXMF="/usr/share/texmf-site"

View File

@ -18,7 +18,7 @@
#
# Thanks for original eclass to Andrian Nord <NightNord@niifaq.ru>.
#
# Only EAPI >4 supported
# Only EAPI >=6 is supported
case ${EAPI:-0} in
6) ;;

View File

@ -1,4 +1,4 @@
# Copyright 1999-2016 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: linux-info.eclass
@ -914,7 +914,6 @@ linux-info_pkg_setup() {
ewarn "Also be aware that bugreports about gcc-4 not working"
ewarn "with linux-2.4 based ebuilds will be closed as INVALID!"
echo
epause 10
fi
fi

View File

@ -22,6 +22,12 @@
# A string containing the USE flag to use for making this eclass optional
# The recommended non-empty value is 'modules'
# @ECLASS-VARIABLE: MODULES_OPTIONAL_USE_IUSE_DEFAULT
# @DESCRIPTION:
# A boolean to control the IUSE default state for the MODULES_OPTIONAL_USE USE
# flag. Default value is unset (false). True represented by 1 or 'on', other
# values including unset treated as false.
# @ECLASS-VARIABLE: KERNEL_DIR
# @DESCRIPTION:
# A string containing the directory of the target kernel sources. The default value is
@ -129,7 +135,16 @@
inherit eutils linux-info multilib
EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst src_install src_compile pkg_postrm
IUSE="kernel_linux ${MODULES_OPTIONAL_USE}"
case ${MODULES_OPTIONAL_USE_IUSE_DEFAULT:-n} in
[nNfF]*|[oO][fF]*|0|-) _modules_optional_use_iuse_default='' ;;
*) _modules_optional_use_iuse_default='+' ;;
esac
[[ -n "${_modules_optional_use_iuse_default}" ]] && case ${EAPI:-0} in
0) die "EAPI=${EAPI} is not supported with MODULES_OPTIONAL_USE_IUSE_DEFAULT due to lack of IUSE defaults" ;;
esac
IUSE="kernel_linux ${MODULES_OPTIONAL_USE:+${_modules_optional_use_iuse_default}}${MODULES_OPTIONAL_USE}"
SLOT="0"
RDEPEND="${MODULES_OPTIONAL_USE}${MODULES_OPTIONAL_USE:+? (} kernel_linux? ( virtual/modutils ) ${MODULES_OPTIONAL_USE:+)}"
DEPEND="${RDEPEND}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: llvm.eclass
@ -78,7 +78,7 @@ if [[ ! ${_LLVM_ECLASS} ]]; then
# @INTERNAL
# @DESCRIPTION:
# Correct values of LLVM slots, newest first.
declare -g -r _LLVM_KNOWN_SLOTS=( 6 5 4 )
declare -g -r _LLVM_KNOWN_SLOTS=( 7 6 5 4 )
# @FUNCTION: get_llvm_prefix
# @USAGE: [<max_slot>]

View File

@ -15,6 +15,13 @@
if [[ -z ${_LTPRUNE_ECLASS} ]]; then
case ${EAPI:-0} in
0|1|2|3|4|5|6)
;;
*)
die "${ECLASS}: banned in EAPI=${EAPI}; use 'find' instead";;
esac
inherit toolchain-funcs
# @FUNCTION: prune_libtool_files

View File

@ -1,36 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: makeedit.eclass
# @AUTHOR:
# Spider
# @BLURB: An eclass to replace some flags in makefiles
# @DESCRIPTION:
#
# @CODE
# To use this eclass, do 2 things:
# 1. append-flags "$MAKEEDIT_FLAGS". If you filter-flags, make sure to do
# the append-flags afterward, otherwise you'll lose them.
# 2. after running configure or econf, call edit_makefiles to remove
# extraneous CFLAGS from your Makefiles.
# @CODE
#
# This combination should reduce the RAM requirements of your build, and maybe
# even speed it up a bit.
MAKEEDIT_FLAGS="-Wno-return-type -w"
# @FUNCTION: edit_makefiles
# @DESCRIPTION:
# Removes some flags in makefiles
edit_makefiles() {
# We already add "-Wno-return-type -w" to compiler flags, so
# no need to replace "-Wall" and "-Wreturn-type" with them.
einfo "Parsing Makefiles ..."
find . \( -iname makefile -o -name \*.mk -o -name GNUmakefile \) -print0 | \
xargs -0 sed -i \
-e 's:-Wall::g' \
-e 's:-Wreturn-type::g' \
-e 's:-pedantic::g'
}

View File

@ -57,15 +57,19 @@ DEPEND="dev-vcs/mercurial"
: ${EHG_QUIET:="OFF"}
[[ "${EHG_QUIET}" == "ON" ]] && EHG_QUIET_CMD_OPT="--quiet"
# @ECLASS-VARIABLE: EHG_CONFIG
# @DESCRIPTION:
# Extra config option to hand to hg clone/pull
# @ECLASS-VARIABLE: EHG_CLONE_CMD
# @DESCRIPTION:
# Command used to perform initial repository clone.
[[ -z "${EHG_CLONE_CMD}" ]] && EHG_CLONE_CMD="hg clone ${EHG_QUIET_CMD_OPT} --pull --noupdate"
[[ -z "${EHG_CLONE_CMD}" ]] && EHG_CLONE_CMD="hg clone ${EHG_CONFIG:+--config ${EHG_CONFIG}} ${EHG_QUIET_CMD_OPT} --pull --noupdate"
# @ECLASS-VARIABLE: EHG_PULL_CMD
# @DESCRIPTION:
# Command used to update repository.
[[ -z "${EHG_PULL_CMD}" ]] && EHG_PULL_CMD="hg pull ${EHG_QUIET_CMD_OPT}"
[[ -z "${EHG_PULL_CMD}" ]] && EHG_PULL_CMD="hg pull ${EHG_CONFIG:+--config ${EHG_CONFIG}} ${EHG_QUIET_CMD_OPT}"
# @ECLASS-VARIABLE: EHG_OFFLINE
# @DESCRIPTION:
@ -134,6 +138,7 @@ mercurial_fetch() {
hg clone \
${EHG_QUIET_CMD_OPT} \
--updaterev="${EHG_REVISION}" \
${EHG_CONFIG:+--config ${EHG_CONFIG}} \
"${EHG_STORE_DIR}/${EHG_PROJECT}/${module}" \
"${sourcedir}" || die "hg clone failed"
# An exact revision helps a lot for testing purposes, so have some output...

View File

@ -92,6 +92,42 @@ __MESON_AUTO_DEPEND=${MESON_AUTO_DEPEND} # See top of eclass
# Optional meson arguments as Bash array; this should be defined before
# calling meson_src_configure.
read -d '' __MESON_ARRAY_PARSER <<"EOF"
import shlex
import sys
# See http://mesonbuild.com/Syntax.html#strings
def quote(str):
escaped = str.replace("\\\\", "\\\\\\\\").replace("'", "\\\\'")
return "'{}'".format(escaped)
print("[{}]".format(
", ".join([quote(x) for x in shlex.split(" ".join(sys.argv[1:]))])))
EOF
# @FUNCTION: _meson_env_array
# @INTERNAL
# @DESCRIPTION:
# Parses the command line flags and converts them into an array suitable for
# use in a cross file.
#
# Input: --single-quote=\' --double-quote=\" --dollar=\$ --backtick=\`
# --backslash=\\ --full-word-double="Hello World"
# --full-word-single='Hello World'
# --full-word-backslash=Hello\ World
# --simple --unicode-8=© --unicode-16=𐐷 --unicode-32=𐤅
#
# Output: ['--single-quote=\'', '--double-quote="', '--dollar=$',
# '--backtick=`', '--backslash=\\', '--full-word-double=Hello World',
# '--full-word-single=Hello World',
# '--full-word-backslash=Hello World', '--simple', '--unicode-8=©',
# '--unicode-16=𐐷', '--unicode-32=𐤅']
#
_meson_env_array() {
python -c "${__MESON_ARRAY_PARSER}" "$@"
}
# @FUNCTION: _meson_create_cross_file
# @INTERNAL
# @DESCRIPTION:
@ -108,6 +144,7 @@ _meson_create_cross_file() {
*-darwin*) system=darwin ;;
*-freebsd*) system=freebsd ;;
*-linux*) system=linux ;;
mingw*|*-mingw*) system=windows ;;
*-solaris*) system=sunos ;;
esac
@ -120,13 +157,29 @@ _meson_create_cross_file() {
# This may require adjustment based on CFLAGS
local cpu=${CHOST%%-*}
cat > "${T}/meson.${CHOST}" <<-EOF
cat > "${T}/meson.${CHOST}.${ABI}" <<-EOF
[binaries]
ar = '${AR}'
c = '${CC}'
cpp = '${CXX}'
pkgconfig = '${PKG_CONFIG}'
strip = '${STRIP}'
ar = $(_meson_env_array "$(tc-getAR)")
c = $(_meson_env_array "$(tc-getCC)")
cpp = $(_meson_env_array "$(tc-getCXX)")
fortran = $(_meson_env_array "$(tc-getFC)")
llvm-config = '$(tc-getPROG LLVM_CONFIG llvm-config)'
objc = $(_meson_env_array "$(tc-getPROG OBJC cc)")
objcpp = $(_meson_env_array "$(tc-getPROG OBJCXX c++)")
pkgconfig = '$(tc-getPKG_CONFIG)'
strip = $(_meson_env_array "$(tc-getSTRIP)")
[properties]
c_args = $(_meson_env_array "${CFLAGS} ${CPPFLAGS}")
c_link_args = $(_meson_env_array "${CFLAGS} ${LDFLAGS}")
cpp_args = $(_meson_env_array "${CXXFLAGS} ${CPPFLAGS}")
cpp_link_args = $(_meson_env_array "${CXXFLAGS} ${LDFLAGS}")
fortran_args = $(_meson_env_array "${FCFLAGS}")
fortran_link_args = $(_meson_env_array "${FCFLAGS} ${LDFLAGS}")
objc_args = $(_meson_env_array "${OBJCFLAGS} ${CPPFLAGS}")
objc_link_args = $(_meson_env_array "${OBJCFLAGS} ${LDFLAGS}")
objcpp_args = $(_meson_env_array "${OBJCXXFLAGS} ${CPPFLAGS}")
objcpp_link_args = $(_meson_env_array "${OBJCXXFLAGS} ${LDFLAGS}")
[host_machine]
system = '${system}'
@ -136,6 +189,19 @@ _meson_create_cross_file() {
EOF
}
# @FUNCTION: meson_use
# @USAGE: <USE flag> [option name]
# @DESCRIPTION:
# Given a USE flag and meson project option, outputs a string like:
#
# -Doption=true
# -Doption=false
#
# If the project option is unspecified, it defaults to the USE flag.
meson_use() {
usex "$1" "-D${2-$1}=true" "-D${2-$1}=false"
}
# @FUNCTION: meson_src_configure
# @DESCRIPTION:
# This is the meson_src_configure function.
@ -152,24 +218,9 @@ meson_src_configure() {
--wrap-mode nodownload
)
# Both meson(1) and _meson_create_cross_file need these
local -x AR=$(tc-getAR)
local -x CC=$(tc-getCC)
local -x CXX=$(tc-getCXX)
local -x PKG_CONFIG=$(tc-getPKG_CONFIG)
local -x STRIP=$(tc-getSTRIP)
if tc-is-cross-compiler; then
if tc-is-cross-compiler || [[ ${ABI} != ${DEFAULT_ABI-${ABI}} ]]; then
_meson_create_cross_file || die "unable to write meson cross file"
mesonargs+=(
--cross-file "${T}/meson.${CHOST}"
)
# In cross mode, meson uses these as the native/build programs
AR=$(tc-getBUILD_AR)
CC=$(tc-getBUILD_CC)
CXX=$(tc-getBUILD_CXX)
PKG_CONFIG=$(tc-getBUILD_PKG_CONFIG)
STRIP=$(tc-getBUILD_STRIP)
mesonargs+=( --cross-file "${T}/meson.${CHOST}.${ABI}" )
fi
# https://bugs.gentoo.org/625396
@ -182,7 +233,7 @@ meson_src_configure() {
set -- meson "${mesonargs[@]}" "$@" \
"${EMESON_SOURCE:-${S}}" "${BUILD_DIR}"
echo "$@"
"$@" || die
tc-env_build "$@" || die
}
# @FUNCTION: meson_src_compile

View File

@ -29,6 +29,7 @@ esac
inherit flag-o-matic toolchain-funcs mozcoreconf-v4
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="wifi". Currently this would include
@ -39,6 +40,7 @@ inherit flag-o-matic toolchain-funcs mozcoreconf-v4
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="jit". Currently this would include
@ -49,6 +51,7 @@ inherit flag-o-matic toolchain-funcs mozcoreconf-v4
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK3
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional gtk3 support via IUSE="gtk3". Currently this would include
@ -59,6 +62,7 @@ inherit flag-o-matic toolchain-funcs mozcoreconf-v4
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_QT5
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional qt5 support via IUSE="qt5". Currently this would include

View File

@ -1,408 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# @ECLASS: mozconfig-v6.49.eclass
# @MAINTAINER:
# mozilla team <mozilla@gentoo.org>
# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v6
# @DESCRIPTION:
# This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
# to provide a single common place for the common mozilla engine compoments.
#
# The eclass provides all common dependencies as well as common use flags.
#
# Some use flags which may be optional in particular mozilla packages can be
# supported through setting eclass variables.
#
# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
# and so ebuilds inheriting this eclass do not need to inherit that.
case ${EAPI} in
0|1|2|3|4)
die "EAPI=${EAPI} not supported"
;;
5)
inherit multilib
;;
esac
inherit flag-o-matic toolchain-funcs mozcoreconf-v4
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="wifi". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if necko-wifi support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="jit". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if optional jit support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK3
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional gtk3 support via IUSE="gtk3". Currently this would include
# ebuilds for firefox, but thunderbird and seamonkey could follow in the future.
#
# Leave the variable UNSET if gtk3 support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK2ONLY
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional gtk2-only support via IUSE="gtk2".
#
# Note that this option conflicts directly with MOZCONFIG_OPTIONAL_GTK3, both
# variables cannot be set at the same time and this variable will be ignored if
# MOZCONFIG_OPTIONAL_GTK3 is set.
#
# Leave the variable UNSET if gtk2-only support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_QT5
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional qt5 support via IUSE="qt5". Currently this would include
# ebuilds for firefox, but thunderbird and seamonkey could follow in the future.
#
# Leave the variable UNSET if qt5 support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# use-flags common among all mozilla ebuilds
IUSE="${IUSE} dbus debug +jemalloc neon pulseaudio selinux +skia startup-notification system-cairo
system-harfbuzz system-icu system-jpeg system-libevent system-sqlite system-libvpx"
# some notes on deps:
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
RDEPEND=">=app-text/hunspell-1.2:=
dev-libs/atk
dev-libs/expat
>=x11-libs/cairo-1.10[X]
>=x11-libs/gtk+-2.18:2
x11-libs/gdk-pixbuf
>=x11-libs/pango-1.22.0
>=media-libs/libpng-1.6.21:0=[apng]
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
kernel_linux? ( media-libs/alsa-lib )
pulseaudio? ( media-sound/pulseaudio )
virtual/freedesktop-icon-theme
dbus? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72 )
startup-notification? ( >=x11-libs/startup-notification-0.8 )
>=dev-libs/glib-2.26:2
>=sys-libs/zlib-1.2.3
>=virtual/libffi-3.0.10
virtual/ffmpeg
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrender
x11-libs/libXt
system-cairo? ( >=x11-libs/cairo-1.12[X,xcb] >=x11-libs/pixman-0.19.2 )
system-icu? ( >=dev-libs/icu-56.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-libevent? ( >=dev-libs/libevent-2.0:0= )
system-sqlite? ( >=dev-db/sqlite-3.13.0:3[secure-delete,debug=] )
system-libvpx? ( >=media-libs/libvpx-1.5.0:0=[postproc] )
system-harfbuzz? ( >=media-libs/harfbuzz-1.2.6:0=[graphite,icu] >=media-gfx/graphite2-1.3.8 )
"
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
MOZCONFIG_OPTIONAL_GTK2ONLY=
if [[ ${MOZCONFIG_OPTIONAL_GTK3} = "enabled" ]]; then
IUSE+=" +gtk3"
else
IUSE+=" gtk3"
fi
RDEPEND+="
gtk3? ( >=x11-libs/gtk+-3.4.0:3 )"
elif [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_GTK2ONLY} = "enabled" ]]; then
IUSE+=" +gtk2"
else
IUSE+=" gtk2"
fi
RDEPEND+="
!gtk2? ( >=x11-libs/gtk+-3.4.0:3 )"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then
inherit qmake-utils
if [[ ${MOZCONFIG_OPTIONAL_QT5} = "enabled" ]]; then
IUSE+=" +qt5"
else
IUSE+=" qt5"
fi
RDEPEND+="
qt5? (
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtnetwork:5
dev-qt/qtprintsupport:5
dev-qt/qtwidgets:5
dev-qt/qtxml:5
dev-qt/qtdeclarative:5
)"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
IUSE+=" +wifi"
else
IUSE+=" wifi"
fi
RDEPEND+="
wifi? (
kernel_linux? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72
net-misc/networkmanager )
)"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_JIT} = "enabled" ]]; then
IUSE+=" +jit"
else
IUSE+=" jit"
fi
fi
DEPEND="app-arch/zip
app-arch/unzip
>=sys-devel/binutils-2.16.1
sys-apps/findutils
${RDEPEND}"
RDEPEND+="
selinux? ( sec-policy/selinux-mozilla )"
# force system-icu if system-harfbuzz is selected, to avoid potential ABI issues
REQUIRED_USE="
system-harfbuzz? ( system-icu )"
# only one of gtk3 or qt5 should be permitted to be selected, since only one will be used.
[[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]] && [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]] && \
REQUIRED_USE+=" ?? ( gtk3 qt5 )"
# only one of gtk2 or qt5 should be permitted to be selected, since only one will be used.
[[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]] && [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]] && \
REQUIRED_USE+=" ?? ( gtk2 qt5 )"
# @FUNCTION: mozconfig_config
# @DESCRIPTION:
# Set common configure options for mozilla packages.
# Call this within src_configure() phase, after mozconfig_init
#
# Example:
#
# inherit mozconfig-v6.46
#
# src_configure() {
# mozconfig_init
# mozconfig_config
# # ... misc ebuild-unique settings via calls to
# # ... mozconfig_{annotate,use_with,use_enable}
# mozconfig_final
# }
mozconfig_config() {
# Migrated from mozcoreconf-2
mozconfig_annotate 'system_libs' \
--with-system-zlib \
--with-system-bz2
if has bindist ${IUSE}; then
mozconfig_use_enable !bindist official-branding
if [[ ${PN} == firefox ]] && use bindist ; then
mozconfig_annotate '' --with-branding=browser/branding/aurora
fi
fi
mozconfig_use_enable debug
mozconfig_use_enable debug tests
if ! use debug ; then
mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
else
mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
fi
mozconfig_use_enable startup-notification
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
# wifi pulls in dbus so manage both here
mozconfig_use_enable wifi necko-wifi
if use kernel_linux && use wifi && ! use dbus; then
echo "Enabling dbus support due to wifi request"
mozconfig_annotate 'dbus required by necko-wifi on linux' --enable-dbus
else
mozconfig_use_enable dbus
fi
else
mozconfig_use_enable dbus
mozconfig_annotate 'disabled' --disable-necko-wifi
fi
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
mozconfig_use_enable jit ion
fi
# These are enabled by default in all mozilla applications
mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr
mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr
mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include --x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir)
if use system-libevent; then
mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr
fi
mozconfig_annotate '' --prefix="${EPREFIX}"/usr
mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate 'Gentoo default' --enable-system-hunspell
mozconfig_annotate '' --disable-gnomeui
mozconfig_annotate '' --enable-gio
mozconfig_annotate '' --disable-crashreporter
mozconfig_annotate 'Gentoo default' --with-system-png
mozconfig_annotate '' --enable-system-ffi
mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
mozconfig_use_enable skia
mozconfig_annotate '' --disable-gconf
mozconfig_annotate '' --with-intl-api
# default toolkit is cairo-gtk2, optional use flags can change this
local toolkit="cairo-gtk2"
local toolkit_comment=""
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
if use gtk3; then
toolkit="cairo-gtk3"
toolkit_comment="gtk3 use flag"
fi
fi
if [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
if ! use gtk2 ; then
toolkit="cairo-gtk3"
else
toolkit_comment="gtk2 use flag"
fi
fi
if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then
if use qt5; then
toolkit="cairo-qt"
toolkit_comment="qt5 use flag"
# need to specify these vars because the qt5 versions are not found otherwise,
# and setting --with-qtdir overrides the pkg-config include dirs
local i
for i in qmake moc rcc; do
echo "export HOST_${i^^}=\"$(qt5_get_bindir)/${i}\"" \
>> "${S}"/.mozconfig || die
done
echo 'unset QTDIR' >> "${S}"/.mozconfig || die
mozconfig_annotate '+qt5' --disable-gio
fi
fi
mozconfig_annotate "${toolkit_comment}" --enable-default-toolkit=${toolkit}
# Use jemalloc unless libc is not glibc >= 2.4
# at this time the minimum glibc in the tree is 2.9 so we should be safe.
if use elibc_glibc && use jemalloc; then
# We must force-enable jemalloc 4 via .mozconfig
echo "export MOZ_JEMALLOC4=1" >> "${S}"/.mozconfig || die
mozconfig_annotate '' --enable-replace-malloc
fi
# Instead of the standard --build= and --host=, mozilla uses --host instead
# of --build, and --target intstead of --host.
# Note, mozilla also has --build but it does not do what you think it does.
# Set both --target and --host as mozilla uses python to guess values otherwise
mozconfig_annotate '' --target="${CHOST}"
mozconfig_annotate '' --host="${CBUILD:-${CHOST}}"
mozconfig_use_enable pulseaudio
mozconfig_use_enable system-cairo
mozconfig_use_enable system-sqlite
mozconfig_use_with system-jpeg
mozconfig_use_with system-icu
mozconfig_use_with system-libvpx
mozconfig_use_with system-harfbuzz
mozconfig_use_with system-harfbuzz system-graphite2
# Modifications to better support ARM, bug 553364
if use neon ; then
mozconfig_annotate '' --with-fpu=neon
mozconfig_annotate '' --with-thumb=yes
mozconfig_annotate '' --with-thumb-interwork=no
fi
if [[ ${CHOST} == armv* ]] ; then
mozconfig_annotate '' --with-float-abi=hard
mozconfig_annotate '' --enable-skia
if ! use system-libvpx ; then
sed -i -e "s|softfp|hard|" \
"${S}"/media/libvpx/moz.build
fi
fi
}
# @FUNCTION: mozconfig_install_prefs
# @DESCRIPTION:
# Set preferences into the prefs.js file specified as a parameter to
# the function. This sets both some common prefs to all mozilla
# packages, and any prefs that may relate to the use flags administered
# by mozconfig_config().
#
# Call this within src_install() phase, after copying the template
# prefs file (if any) from ${FILESDIR}
#
# Example:
#
# inherit mozconfig-v6.46
#
# src_install() {
# cp "${FILESDIR}"/gentoo-default-prefs.js \
# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
# || die
#
# mozconfig_install_prefs \
# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"
#
# ...
# }
mozconfig_install_prefs() {
local prefs_file="${1}"
einfo "Adding prefs from mozconfig to ${prefs_file}"
# set dictionary path, to use system hunspell
echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \
>>"${prefs_file}" || die
# force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it
if use system-harfbuzz ; then
echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \
>>"${prefs_file}" || die
fi
# force cairo as the canvas renderer if USE=skia is disabled
if ! use skia ; then
echo "lockPref(\"gfx.canvas.azure.backends\",\"cairo\");" \
>>"${prefs_file}" || die
echo "lockPref(\"gfx.content.azure.backends\",\"cairo\");" \
>>"${prefs_file}" || die
fi
}

View File

@ -1,414 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# @ECLASS: mozconfig-v6.51.eclass
# @MAINTAINER:
# mozilla team <mozilla@gentoo.org>
# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v6
# @DESCRIPTION:
# This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
# to provide a single common place for the common mozilla engine compoments.
#
# The eclass provides all common dependencies as well as common use flags.
#
# Some use flags which may be optional in particular mozilla packages can be
# supported through setting eclass variables.
#
# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
# and so ebuilds inheriting this eclass do not need to inherit that.
case ${EAPI} in
0|1|2|3|4)
die "EAPI=${EAPI} not supported"
;;
5)
inherit multilib
;;
esac
inherit flag-o-matic toolchain-funcs mozcoreconf-v4
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="wifi". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if necko-wifi support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# deterministic jit support via IUSE="jit". The upstream default will be used
# otherwise, which is generally to enable jit unless support for the platform
# is missing.
#
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK3
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional gtk3 support via IUSE="gtk3". Currently this would include
# ebuilds for firefox, but thunderbird and seamonkey could follow in the future.
#
# Leave the variable UNSET if gtk3 support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK2ONLY
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional gtk2-only support via IUSE="gtk2".
#
# Note that this option conflicts directly with MOZCONFIG_OPTIONAL_GTK3, both
# variables cannot be set at the same time and this variable will be ignored if
# MOZCONFIG_OPTIONAL_GTK3 is set.
#
# Leave the variable UNSET if gtk2-only support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_QT5
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional qt5 support via IUSE="qt5". Currently this would include
# ebuilds for firefox, but thunderbird and seamonkey could follow in the future.
#
# Leave the variable UNSET if qt5 support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# use-flags common among all mozilla ebuilds
IUSE="${IUSE} dbus debug +jemalloc neon pulseaudio selinux +skia startup-notification system-cairo
system-harfbuzz system-icu system-jpeg system-libevent system-sqlite system-libvpx"
# some notes on deps:
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
RDEPEND=">=app-text/hunspell-1.2:=
dev-libs/atk
dev-libs/expat
>=x11-libs/cairo-1.10[X]
x11-libs/gdk-pixbuf
>=x11-libs/pango-1.22.0
>=media-libs/libpng-1.6.25:0=[apng]
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
kernel_linux? ( media-libs/alsa-lib )
pulseaudio? ( media-sound/pulseaudio )
virtual/freedesktop-icon-theme
dbus? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72 )
startup-notification? ( >=x11-libs/startup-notification-0.8 )
>=dev-libs/glib-2.26:2
>=sys-libs/zlib-1.2.3
>=virtual/libffi-3.0.10
virtual/ffmpeg
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrender
x11-libs/libXt
system-cairo? ( >=x11-libs/cairo-1.12[X,xcb] >=x11-libs/pixman-0.19.2 )
system-icu? ( >=dev-libs/icu-56.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-libevent? ( >=dev-libs/libevent-2.0:0= )
system-sqlite? ( >=dev-db/sqlite-3.14.1:3[secure-delete,debug=] )
system-libvpx? ( >=media-libs/libvpx-1.5.0:0=[postproc] )
system-harfbuzz? ( >=media-libs/harfbuzz-1.2.6:0=[graphite,icu] >=media-gfx/graphite2-1.3.8 )
"
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
MOZCONFIG_OPTIONAL_GTK2ONLY=
if [[ ${MOZCONFIG_OPTIONAL_GTK3} = "enabled" ]]; then
IUSE+=" +gtk3"
else
IUSE+=" gtk3"
fi
RDEPEND+="
gtk3? ( >=x11-libs/gtk+-3.4.0:3 )
!gtk3? ( >=x11-libs/gtk+-2.18:2 )"
elif [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_GTK2ONLY} = "enabled" ]]; then
IUSE+=" +gtk2"
else
IUSE+=" gtk2"
fi
RDEPEND+="
gtk2? ( >=x11-libs/gtk+-2.18:2 )
!gtk2? ( >=x11-libs/gtk+-3.4.0:3 )"
else
RDEPEND+="
>=x11-libs/gtk+-2.18:2"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then
inherit qmake-utils
if [[ ${MOZCONFIG_OPTIONAL_QT5} = "enabled" ]]; then
IUSE+=" +qt5"
else
IUSE+=" qt5"
fi
RDEPEND+="
qt5? (
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtnetwork:5
dev-qt/qtprintsupport:5
dev-qt/qtwidgets:5
dev-qt/qtxml:5
dev-qt/qtdeclarative:5
)"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
IUSE+=" +wifi"
else
IUSE+=" wifi"
fi
RDEPEND+="
wifi? (
kernel_linux? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72
net-misc/networkmanager )
)"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_JIT} = "enabled" ]]; then
IUSE+=" +jit"
else
IUSE+=" jit"
fi
fi
DEPEND="app-arch/zip
app-arch/unzip
>=sys-devel/binutils-2.16.1
sys-apps/findutils
${RDEPEND}"
RDEPEND+="
selinux? ( sec-policy/selinux-mozilla )"
# force system-icu if system-harfbuzz is selected, to avoid potential ABI issues
REQUIRED_USE="
system-harfbuzz? ( system-icu )"
# only one of gtk3 or qt5 should be permitted to be selected, since only one will be used.
[[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]] && [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]] && \
REQUIRED_USE+=" ?? ( gtk3 qt5 )"
# only one of gtk2 or qt5 should be permitted to be selected, since only one will be used.
[[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]] && [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]] && \
REQUIRED_USE+=" ?? ( gtk2 qt5 )"
# @FUNCTION: mozconfig_config
# @DESCRIPTION:
# Set common configure options for mozilla packages.
# Call this within src_configure() phase, after mozconfig_init
#
# Example:
#
# inherit mozconfig-v6.46
#
# src_configure() {
# mozconfig_init
# mozconfig_config
# # ... misc ebuild-unique settings via calls to
# # ... mozconfig_{annotate,use_with,use_enable}
# mozconfig_final
# }
mozconfig_config() {
# Migrated from mozcoreconf-2
mozconfig_annotate 'system_libs' \
--with-system-zlib \
--with-system-bz2
if has bindist ${IUSE}; then
mozconfig_use_enable !bindist official-branding
if [[ ${PN} == firefox ]] && use bindist ; then
mozconfig_annotate '' --with-branding=browser/branding/aurora
fi
fi
# Enable position independent executables
mozconfig_annotate 'enabled by Gentoo' --enable-pie
mozconfig_use_enable debug
mozconfig_use_enable debug tests
if ! use debug ; then
mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
else
mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
fi
mozconfig_use_enable startup-notification
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
# wifi pulls in dbus so manage both here
mozconfig_use_enable wifi necko-wifi
if use kernel_linux && use wifi && ! use dbus; then
echo "Enabling dbus support due to wifi request"
mozconfig_annotate 'dbus required by necko-wifi on linux' --enable-dbus
else
mozconfig_use_enable dbus
fi
else
mozconfig_use_enable dbus
mozconfig_annotate 'disabled' --disable-necko-wifi
fi
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
mozconfig_use_enable jit ion
fi
# These are enabled by default in all mozilla applications
mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr
mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr
mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include --x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir)
if use system-libevent; then
mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr
fi
mozconfig_annotate '' --prefix="${EPREFIX}"/usr
mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate 'Gentoo default' --enable-system-hunspell
mozconfig_annotate '' --disable-gnomeui
mozconfig_annotate '' --enable-gio
mozconfig_annotate '' --disable-crashreporter
mozconfig_annotate 'Gentoo default' --with-system-png
mozconfig_annotate '' --enable-system-ffi
mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
mozconfig_use_enable skia
mozconfig_annotate '' --disable-gconf
mozconfig_annotate '' --with-intl-api
# default toolkit is cairo-gtk2, optional use flags can change this
local toolkit="cairo-gtk2"
local toolkit_comment=""
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
if use gtk3; then
toolkit="cairo-gtk3"
toolkit_comment="gtk3 use flag"
fi
fi
if [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
if ! use gtk2 ; then
toolkit="cairo-gtk3"
else
toolkit_comment="gtk2 use flag"
fi
fi
if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then
if use qt5; then
toolkit="cairo-qt"
toolkit_comment="qt5 use flag"
# need to specify these vars because the qt5 versions are not found otherwise,
# and setting --with-qtdir overrides the pkg-config include dirs
local i
for i in qmake moc rcc; do
echo "export HOST_${i^^}=\"$(qt5_get_bindir)/${i}\"" \
>> "${S}"/.mozconfig || die
done
echo 'unset QTDIR' >> "${S}"/.mozconfig || die
mozconfig_annotate '+qt5' --disable-gio
fi
fi
mozconfig_annotate "${toolkit_comment}" --enable-default-toolkit=${toolkit}
# Use jemalloc unless libc is not glibc >= 2.4
# at this time the minimum glibc in the tree is 2.9 so we should be safe.
if use elibc_glibc && use jemalloc; then
# We must force-enable jemalloc 4 via .mozconfig
echo "export MOZ_JEMALLOC4=1" >> "${S}"/.mozconfig || die
mozconfig_annotate '' --enable-replace-malloc
fi
# Instead of the standard --build= and --host=, mozilla uses --host instead
# of --build, and --target intstead of --host.
# Note, mozilla also has --build but it does not do what you think it does.
# Set both --target and --host as mozilla uses python to guess values otherwise
mozconfig_annotate '' --target="${CHOST}"
mozconfig_annotate '' --host="${CBUILD:-${CHOST}}"
mozconfig_use_enable pulseaudio
mozconfig_use_enable system-cairo
mozconfig_use_enable system-sqlite
mozconfig_use_with system-jpeg
mozconfig_use_with system-icu
mozconfig_use_with system-libvpx
mozconfig_use_with system-harfbuzz
mozconfig_use_with system-harfbuzz system-graphite2
# Modifications to better support ARM, bug 553364
if use neon ; then
mozconfig_annotate '' --with-fpu=neon
mozconfig_annotate '' --with-thumb=yes
mozconfig_annotate '' --with-thumb-interwork=no
fi
if [[ ${CHOST} == armv* ]] ; then
mozconfig_annotate '' --with-float-abi=hard
mozconfig_annotate '' --enable-skia
if ! use system-libvpx ; then
sed -i -e "s|softfp|hard|" \
"${S}"/media/libvpx/moz.build
fi
fi
}
# @FUNCTION: mozconfig_install_prefs
# @DESCRIPTION:
# Set preferences into the prefs.js file specified as a parameter to
# the function. This sets both some common prefs to all mozilla
# packages, and any prefs that may relate to the use flags administered
# by mozconfig_config().
#
# Call this within src_install() phase, after copying the template
# prefs file (if any) from ${FILESDIR}
#
# Example:
#
# inherit mozconfig-v6.46
#
# src_install() {
# cp "${FILESDIR}"/gentoo-default-prefs.js \
# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
# || die
#
# mozconfig_install_prefs \
# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"
#
# ...
# }
mozconfig_install_prefs() {
local prefs_file="${1}"
einfo "Adding prefs from mozconfig to ${prefs_file}"
# set dictionary path, to use system hunspell
echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \
>>"${prefs_file}" || die
# force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it
if use system-harfbuzz ; then
echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \
>>"${prefs_file}" || die
fi
# force cairo as the canvas renderer if USE=skia is disabled
if ! use skia ; then
echo "lockPref(\"gfx.canvas.azure.backends\",\"cairo\");" \
>>"${prefs_file}" || die
echo "lockPref(\"gfx.content.azure.backends\",\"cairo\");" \
>>"${prefs_file}" || die
fi
}

View File

@ -29,6 +29,7 @@ esac
inherit flag-o-matic toolchain-funcs mozcoreconf-v5
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="wifi". Currently this would include
@ -39,6 +40,7 @@ inherit flag-o-matic toolchain-funcs mozcoreconf-v5
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# deterministic jit support via IUSE="jit". The upstream default will be used
@ -49,6 +51,7 @@ inherit flag-o-matic toolchain-funcs mozcoreconf-v5
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK3
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional gtk3 support via IUSE="force-gtk3". Currently this would include
@ -61,6 +64,7 @@ inherit flag-o-matic toolchain-funcs mozcoreconf-v5
# MOZCONFIG_OPTIONAL_GTK2ONLY.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK2ONLY
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional gtk2-only support via IUSE="gtk2".
@ -74,6 +78,7 @@ inherit flag-o-matic toolchain-funcs mozcoreconf-v5
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_QT5
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional qt5 support via IUSE="qt5". Currently this would include

View File

@ -1,388 +0,0 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# @ECLASS: mozconfig-v6.53.eclass
# @MAINTAINER:
# mozilla team <mozilla@gentoo.org>
# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v6
# @DESCRIPTION:
# This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
# to provide a single common place for the common mozilla engine compoments.
#
# The eclass provides all common dependencies as well as common use flags.
#
# Some use flags which may be optional in particular mozilla packages can be
# supported through setting eclass variables.
#
# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
# and so ebuilds inheriting this eclass do not need to inherit that.
case ${EAPI} in
0|1|2|3|4)
die "EAPI=${EAPI} not supported"
;;
5)
inherit multilib
;;
esac
inherit flag-o-matic toolchain-funcs mozcoreconf-v5
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# optional necko-wifi support via IUSE="wifi". Currently this would include
# ebuilds for firefox, and potentially seamonkey.
#
# Leave the variable UNSET if necko-wifi support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild needs to provide
# deterministic jit support via IUSE="jit". The upstream default will be used
# otherwise, which is generally to enable jit unless support for the platform
# is missing.
#
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK3
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional gtk3 support via IUSE="force-gtk3". Currently this would include
# thunderbird and seamonkey in the future, once support is ready for testing.
#
# Leave the variable UNSET if gtk3 support should not be optionally available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# If gtk+:3 is to be the standard toolkit, do not use this and instead use
# MOZCONFIG_OPTIONAL_GTK2ONLY.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK2ONLY
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional gtk2-only support via IUSE="gtk2".
#
# Note that this option conflicts directly with MOZCONFIG_OPTIONAL_GTK3, both
# variables cannot be set at the same time and this variable will be ignored if
# MOZCONFIG_OPTIONAL_GTK3 is set.
#
# Leave the variable UNSET if gtk2-only support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_QT5
# @DESCRIPTION:
# Set this variable before the inherit line, when an ebuild can provide
# optional qt5 support via IUSE="qt5". Currently this would include
# ebuilds for firefox, but thunderbird and seamonkey could follow in the future.
#
# Leave the variable UNSET if qt5 support should not be available.
# Set the variable to "enabled" if the use flag should be enabled by default.
# Set the variable to any value if the use flag should exist but not be default-enabled.
# use-flags common among all mozilla ebuilds
IUSE="${IUSE} dbus debug +jemalloc neon pulseaudio selinux startup-notification system-cairo
system-harfbuzz system-icu system-jpeg system-libevent system-sqlite system-libvpx"
# some notes on deps:
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
RDEPEND=">=app-text/hunspell-1.5.4:=
dev-libs/atk
dev-libs/expat
>=x11-libs/cairo-1.10[X]
>=x11-libs/gtk+-2.18:2
x11-libs/gdk-pixbuf
>=x11-libs/pango-1.22.0
>=media-libs/libpng-1.6.28:0=[apng]
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
kernel_linux? ( !pulseaudio? ( media-libs/alsa-lib ) )
pulseaudio? ( || ( media-sound/pulseaudio
>=media-sound/apulse-0.1.9 ) )
virtual/freedesktop-icon-theme
dbus? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72 )
startup-notification? ( >=x11-libs/startup-notification-0.8 )
>=dev-libs/glib-2.26:2
>=sys-libs/zlib-1.2.3
>=virtual/libffi-3.0.10
virtual/ffmpeg
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrender
x11-libs/libXt
system-cairo? ( >=x11-libs/cairo-1.12[X,xcb] >=x11-libs/pixman-0.19.2 )
system-icu? ( >=dev-libs/icu-58.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-libevent? ( >=dev-libs/libevent-2.0:0= )
system-sqlite? ( >=dev-db/sqlite-3.17.0:3[secure-delete,debug=] )
system-libvpx? ( >=media-libs/libvpx-1.5.0:0=[postproc] )
system-harfbuzz? ( >=media-libs/harfbuzz-1.3.3:0= >=media-gfx/graphite2-1.3.9-r1 )
"
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
MOZCONFIG_OPTIONAL_GTK2ONLY=
if [[ ${MOZCONFIG_OPTIONAL_GTK3} = "enabled" ]]; then
IUSE+=" +force-gtk3"
else
IUSE+=" force-gtk3"
fi
RDEPEND+=" force-gtk3? ( >=x11-libs/gtk+-3.4.0:3 )"
elif [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_GTK2ONLY} = "enabled" ]]; then
IUSE+=" +gtk2"
else
IUSE+=" gtk2"
fi
RDEPEND+=" !gtk2? ( >=x11-libs/gtk+-3.4.0:3 )"
else
# no gtk3 related dep set by optional use flags, force it
RDEPEND+=" >=x11-libs/gtk+-3.4.0:3"
fi
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
IUSE+=" +wifi"
else
IUSE+=" wifi"
fi
RDEPEND+="
wifi? (
kernel_linux? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72
net-misc/networkmanager )
)"
fi
DEPEND="app-arch/zip
app-arch/unzip
>=sys-devel/binutils-2.16.1
sys-apps/findutils
pulseaudio? ( media-sound/pulseaudio )
${RDEPEND}"
RDEPEND+="
pulseaudio? ( || ( media-sound/pulseaudio
>=media-sound/apulse-0.1.9 ) )
selinux? ( sec-policy/selinux-mozilla )"
# @FUNCTION: mozconfig_config
# @DESCRIPTION:
# Set common configure options for mozilla packages.
# Call this within src_configure() phase, after mozconfig_init
#
# Example:
#
# inherit mozconfig-v6.46
#
# src_configure() {
# mozconfig_init
# mozconfig_config
# # ... misc ebuild-unique settings via calls to
# # ... mozconfig_{annotate,use_with,use_enable}
# mozconfig_final
# }
mozconfig_config() {
# Migrated from mozcoreconf-2
mozconfig_annotate 'system_libs' \
--with-system-zlib \
--with-system-bz2
if has bindist ${IUSE}; then
mozconfig_use_enable !bindist official-branding
if [[ ${PN} == firefox ]] && use bindist ; then
mozconfig_annotate '' --with-branding=browser/branding/aurora
fi
fi
# Enable position independent executables
mozconfig_annotate 'enabled by Gentoo' --enable-pie
mozconfig_use_enable debug
mozconfig_use_enable debug tests
if ! use debug ; then
mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
else
mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
fi
mozconfig_use_enable startup-notification
if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
# wifi pulls in dbus so manage both here
mozconfig_use_enable wifi necko-wifi
if use kernel_linux && use wifi && ! use dbus; then
echo "Enabling dbus support due to wifi request"
mozconfig_annotate 'dbus required by necko-wifi on linux' --enable-dbus
else
mozconfig_use_enable dbus
fi
else
mozconfig_use_enable dbus
mozconfig_annotate 'disabled' --disable-necko-wifi
fi
if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
mozconfig_use_enable jit ion
fi
# These are enabled by default in all mozilla applications
mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr
mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr
mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include --x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir)
if use system-libevent; then
mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr
fi
mozconfig_annotate '' --prefix="${EPREFIX}"/usr
mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate 'Gentoo default' --enable-system-hunspell
mozconfig_annotate '' --disable-gnomeui
mozconfig_annotate '' --enable-gio
mozconfig_annotate '' --disable-crashreporter
mozconfig_annotate 'Gentoo default' --with-system-png
mozconfig_annotate '' --enable-system-ffi
mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
mozconfig_annotate '' --disable-gconf
mozconfig_annotate '' --with-intl-api
# skia has no support for big-endian platforms
if [[ $(tc-endian) == "big" ]]; then
mozconfig_annotate 'big endian target' --disable-skia
else
mozconfig_annotate '' --enable-skia
fi
# default toolkit is cairo-gtk3, optional use flags can change this
local toolkit="cairo-gtk3"
local toolkit_comment=""
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
if ! use force-gtk3; then
toolkit="cairo-gtk2"
toolkit_comment="force-gtk3 use flag"
fi
fi
if [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then
if use gtk2 ; then
toolkit="cairo-gtk2"
else
toolkit_comment="gtk2 use flag"
fi
fi
if [[ -n ${MOZCONFIG_OPTIONAL_QT5} ]]; then
if use qt5; then
toolkit="cairo-qt"
toolkit_comment="qt5 use flag"
# need to specify these vars because the qt5 versions are not found otherwise,
# and setting --with-qtdir overrides the pkg-config include dirs
local i
for i in qmake moc rcc; do
echo "export HOST_${i^^}=\"$(qt5_get_bindir)/${i}\"" \
>> "${S}"/.mozconfig || die
done
echo 'unset QTDIR' >> "${S}"/.mozconfig || die
mozconfig_annotate '+qt5' --disable-gio
fi
fi
mozconfig_annotate "${toolkit_comment}" --enable-default-toolkit=${toolkit}
# Use jemalloc unless libc is not glibc >= 2.4
# at this time the minimum glibc in the tree is 2.9 so we should be safe.
if use elibc_glibc && use jemalloc; then
# We must force-enable jemalloc 4 via .mozconfig
echo "export MOZ_JEMALLOC4=1" >> "${S}"/.mozconfig || die
mozconfig_annotate '' --enable-replace-malloc
fi
# Instead of the standard --build= and --host=, mozilla uses --host instead
# of --build, and --target intstead of --host.
# Note, mozilla also has --build but it does not do what you think it does.
# Set both --target and --host as mozilla uses python to guess values otherwise
mozconfig_annotate '' --target="${CHOST}"
mozconfig_annotate '' --host="${CBUILD:-${CHOST}}"
mozconfig_use_enable pulseaudio
# force the deprecated alsa sound code if pulseaudio is disabled
if use kernel_linux && ! use pulseaudio ; then
mozconfig_annotate '-pulseaudio' --enable-alsa
fi
mozconfig_use_enable system-cairo
mozconfig_use_enable system-sqlite
mozconfig_use_with system-jpeg
mozconfig_use_with system-icu
mozconfig_use_with system-libvpx
mozconfig_use_with system-harfbuzz
mozconfig_use_with system-harfbuzz system-graphite2
# Modifications to better support ARM, bug 553364
if use neon ; then
mozconfig_annotate '' --with-fpu=neon
mozconfig_annotate '' --with-thumb=yes
mozconfig_annotate '' --with-thumb-interwork=no
fi
if [[ ${CHOST} == armv* ]] ; then
mozconfig_annotate '' --with-float-abi=hard
if ! use system-libvpx ; then
sed -i -e "s|softfp|hard|" \
"${S}"/media/libvpx/moz.build
fi
fi
}
# @FUNCTION: mozconfig_install_prefs
# @DESCRIPTION:
# Set preferences into the prefs.js file specified as a parameter to
# the function. This sets both some common prefs to all mozilla
# packages, and any prefs that may relate to the use flags administered
# by mozconfig_config().
#
# Call this within src_install() phase, after copying the template
# prefs file (if any) from ${FILESDIR}
#
# Example:
#
# inherit mozconfig-v6.46
#
# src_install() {
# cp "${FILESDIR}"/gentoo-default-prefs.js \
# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
# || die
#
# mozconfig_install_prefs \
# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"
#
# ...
# }
mozconfig_install_prefs() {
local prefs_file="${1}"
einfo "Adding prefs from mozconfig to ${prefs_file}"
# set dictionary path, to use system hunspell
echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \
>>"${prefs_file}" || die
# force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it
if use system-harfbuzz ; then
echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \
>>"${prefs_file}" || die
fi
# force cairo as the canvas renderer on platforms without skia support
if [[ $(tc-endian) == "big" ]] ; then
echo "sticky_pref(\"gfx.canvas.azure.backends\",\"cairo\");" \
>>"${prefs_file}" || die
echo "sticky_pref(\"gfx.content.azure.backends\",\"cairo\");" \
>>"${prefs_file}" || die
fi
}

View File

@ -1,7 +1,7 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# @ECLASS: mozconfig-v6.56.eclass
# @ECLASS: mozconfig-v6.58.eclass
# @MAINTAINER:
# mozilla team <mozilla@gentoo.org>
# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v6
@ -98,13 +98,11 @@ RDEPEND=">=app-text/hunspell-1.5.4:=
>=x11-libs/gtk+-2.18:2
x11-libs/gdk-pixbuf
>=x11-libs/pango-1.22.0
>=media-libs/libpng-1.6.31:0=[apng]
>=media-libs/libpng-1.6.34:0=[apng]
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
kernel_linux? ( !pulseaudio? ( media-libs/alsa-lib ) )
pulseaudio? ( || ( media-sound/pulseaudio
>=media-sound/apulse-0.1.9 ) )
virtual/freedesktop-icon-theme
dbus? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72 )
@ -124,9 +122,9 @@ RDEPEND=">=app-text/hunspell-1.5.4:=
system-icu? ( >=dev-libs/icu-59.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-libevent? ( >=dev-libs/libevent-2.0:0= )
system-sqlite? ( >=dev-db/sqlite-3.19.3:3[secure-delete,debug=] )
system-sqlite? ( >=dev-db/sqlite-3.20.1:3[secure-delete,debug=] )
system-libvpx? ( >=media-libs/libvpx-1.5.0:0=[postproc] )
system-harfbuzz? ( >=media-libs/harfbuzz-1.3.3:0= >=media-gfx/graphite2-1.3.9-r1 )
system-harfbuzz? ( >=media-libs/harfbuzz-1.4.2:0= >=media-gfx/graphite2-1.3.9-r1 )
"
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
@ -167,6 +165,11 @@ DEPEND="app-arch/zip
>=sys-devel/binutils-2.16.1
sys-apps/findutils
pulseaudio? ( media-sound/pulseaudio )
|| (
( >=dev-lang/rust-1.21.0 >=dev-util/cargo-0.22.0 )
>=dev-lang/rust-1.21.0[extended]
( >=dev-lang/rust-bin-1.21.0 >=dev-util/cargo-0.22.0 )
)
${RDEPEND}"
RDEPEND+="
@ -197,10 +200,10 @@ mozconfig_config() {
--with-system-zlib \
--with-system-bz2
# Disable for testing purposes only
mozconfig_annotate 'Upstream bug 1341234' --disable-stylo
# Stylo is only broken on x86 builds
use x86 && mozconfig_annotate 'Upstream bug 1341234' --disable-stylo
# Must pass release in order to properly select linker via gold useflag
# Must pass release in order to properly select linker
mozconfig_annotate 'Enable by Gentoo' --enable-release
# Must pass --enable-gold if using ld.gold

View File

@ -1,7 +1,7 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# @ECLASS: mozconfig-v6.55.eclass
# @ECLASS: mozconfig-v6.58.eclass
# @MAINTAINER:
# mozilla team <mozilla@gentoo.org>
# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v6
@ -26,7 +26,7 @@ case ${EAPI} in
;;
esac
inherit flag-o-matic toolchain-funcs mozcoreconf-v5
inherit flag-o-matic toolchain-funcs mozcoreconf-v6
# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
# @DESCRIPTION:
@ -84,8 +84,8 @@ inherit flag-o-matic toolchain-funcs mozcoreconf-v5
# Set the variable to any value if the use flag should exist but not be default-enabled.
# use-flags common among all mozilla ebuilds
IUSE="${IUSE} dbus debug neon pulseaudio selinux startup-notification system-cairo
system-harfbuzz system-icu system-jpeg system-libevent system-sqlite system-libvpx"
IUSE="${IUSE} dbus debug neon pulseaudio selinux startup-notification system-harfbuzz
system-icu system-jpeg system-libevent system-sqlite system-libvpx"
# some notes on deps:
# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
@ -98,17 +98,16 @@ RDEPEND=">=app-text/hunspell-1.5.4:=
>=x11-libs/gtk+-2.18:2
x11-libs/gdk-pixbuf
>=x11-libs/pango-1.22.0
>=media-libs/libpng-1.6.29:0=[apng]
>=media-libs/libpng-1.6.34:0=[apng]
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
kernel_linux? ( !pulseaudio? ( media-libs/alsa-lib ) )
pulseaudio? ( || ( media-sound/pulseaudio
>=media-sound/apulse-0.1.9 ) )
virtual/freedesktop-icon-theme
dbus? ( >=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72 )
startup-notification? ( >=x11-libs/startup-notification-0.8 )
>=x11-libs/pixman-0.19.2
>=dev-libs/glib-2.26:2
>=sys-libs/zlib-1.2.3
>=virtual/libffi-3.0.10
@ -120,13 +119,12 @@ RDEPEND=">=app-text/hunspell-1.5.4:=
x11-libs/libXfixes
x11-libs/libXrender
x11-libs/libXt
system-cairo? ( >=x11-libs/cairo-1.12[X,xcb] >=x11-libs/pixman-0.19.2 )
system-icu? ( >=dev-libs/icu-58.1:= )
system-icu? ( >=dev-libs/icu-59.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-libevent? ( >=dev-libs/libevent-2.0:0= )
system-sqlite? ( >=dev-db/sqlite-3.19.3:3[secure-delete,debug=] )
system-sqlite? ( >=dev-db/sqlite-3.20.1:3[secure-delete,debug=] )
system-libvpx? ( >=media-libs/libvpx-1.5.0:0=[postproc] )
system-harfbuzz? ( >=media-libs/harfbuzz-1.3.3:0= >=media-gfx/graphite2-1.3.9-r1 )
system-harfbuzz? ( >=media-libs/harfbuzz-1.4.2:0= >=media-gfx/graphite2-1.3.9-r1 )
"
if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
@ -167,6 +165,14 @@ DEPEND="app-arch/zip
>=sys-devel/binutils-2.16.1
sys-apps/findutils
pulseaudio? ( media-sound/pulseaudio )
elibc_glibc? ( || (
( >=dev-lang/rust-1.24.0[-extended(-)] >=dev-util/cargo-0.25.0 )
>=dev-lang/rust-1.24.0[extended]
( >=dev-lang/rust-bin-1.24.0 >=dev-util/cargo-0.25.0 )
) )
elibc_musl? ( || ( >=dev-lang/rust-1.24.0
>=dev-util/cargo-0.25.0
) )
${RDEPEND}"
RDEPEND+="
@ -197,6 +203,19 @@ mozconfig_config() {
--with-system-zlib \
--with-system-bz2
# Stylo is only broken on x86 builds
use x86 && mozconfig_annotate 'Upstream bug 1341234' --disable-stylo
# Must pass release in order to properly select linker
mozconfig_annotate 'Enable by Gentoo' --enable-release
# Must pass --enable-gold if using ld.gold
if tc-ld-is-gold ; then
mozconfig_annotate 'tc-ld-is-gold=true' --enable-gold
else
mozconfig_annotate 'tc-ld-is-gold=false' --disable-gold
fi
if has bindist ${IUSE}; then
mozconfig_use_enable !bindist official-branding
if [[ ${PN} == firefox ]] && use bindist ; then
@ -248,9 +267,9 @@ mozconfig_config() {
mozconfig_annotate '' --disable-crashreporter
mozconfig_annotate 'Gentoo default' --with-system-png
mozconfig_annotate '' --enable-system-ffi
mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
mozconfig_annotate '' --disable-gconf
mozconfig_annotate '' --with-intl-api
mozconfig_annotate '' --enable-system-pixman
# skia has no support for big-endian platforms
if [[ $(tc-endian) == "big" ]]; then
@ -308,7 +327,6 @@ mozconfig_config() {
# For testing purpose only
mozconfig_annotate 'Sandbox' --enable-content-sandbox
mozconfig_use_enable system-cairo
mozconfig_use_enable system-sqlite
mozconfig_use_with system-jpeg
mozconfig_use_with system-icu

View File

@ -212,9 +212,6 @@ mozconfig_init() {
append-cxxflags -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2
fi
# Go a little faster; use less RAM
append-flags "$MAKEEDIT_FLAGS"
# Use the MOZILLA_FIVE_HOME for the rpath
append-ldflags -Wl,-rpath="${MOZILLA_FIVE_HOME}",--enable-new-dtags
# Set MOZILLA_FIVE_HOME in mozconfig

View File

@ -218,9 +218,6 @@ mozconfig_init() {
append-cxxflags -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2
fi
# Go a little faster; use less RAM
append-flags "$MAKEEDIT_FLAGS"
# Use the MOZILLA_FIVE_HOME for the rpath
append-ldflags -Wl,-rpath="${MOZILLA_FIVE_HOME}",--enable-new-dtags
# Set MOZILLA_FIVE_HOME in mozconfig

View File

@ -0,0 +1,277 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# @ECLASS: mozcoreconf-v5.eclass
# @MAINTAINER:
# Mozilla team <mozilla@gentoo.org>
# @BLURB: core options and configuration functions for mozilla
# @DESCRIPTION:
#
# inherit mozconfig-v6.* or above for mozilla configuration support
# @ECLASS-VARIABLE: MOZILLA_FIVE_HOME
# @DESCRIPTION:
# This is an eclass-generated variable that defines the rpath that the mozilla
# product will be installed in. Read-only
if [[ ! ${_MOZCORECONF} ]]; then
PYTHON_COMPAT=( python2_7 )
PYTHON_REQ_USE='ncurses,sqlite,ssl,threads'
inherit multilib toolchain-funcs flag-o-matic python-any-r1 versionator
IUSE="${IUSE} custom-cflags custom-optimization"
DEPEND="virtual/pkgconfig
${PYTHON_DEPS}"
# @FUNCTION: mozconfig_annotate
# @DESCRIPTION:
# add an annotated line to .mozconfig
#
# Example:
# mozconfig_annotate "building on ultrasparc" --enable-js-ultrasparc
# => ac_add_options --enable-js-ultrasparc # building on ultrasparc
mozconfig_annotate() {
declare reason=$1 x ; shift
[[ $# -gt 0 ]] || die "mozconfig_annotate missing flags for ${reason}\!"
for x in ${*}; do
echo "ac_add_options ${x} # ${reason}" >>.mozconfig
done
}
# @FUNCTION: mozconfig_use_enable
# @DESCRIPTION:
# add a line to .mozconfig based on a USE-flag
#
# Example:
# mozconfig_use_enable truetype freetype2
# => ac_add_options --enable-freetype2 # +truetype
mozconfig_use_enable() {
declare flag=$(use_enable "$@")
mozconfig_annotate "$(use $1 && echo +$1 || echo -$1)" "${flag}"
}
# @FUNCTION mozconfig_use_with
# @DESCRIPTION
# add a line to .mozconfig based on a USE-flag
#
# Example:
# mozconfig_use_with kerberos gss-api /usr/$(get_libdir)
# => ac_add_options --with-gss-api=/usr/lib # +kerberos
mozconfig_use_with() {
declare flag=$(use_with "$@")
mozconfig_annotate "$(use $1 && echo +$1 || echo -$1)" "${flag}"
}
# @FUNCTION mozconfig_use_extension
# @DESCRIPTION
# enable or disable an extension based on a USE-flag
#
# Example:
# mozconfig_use_extension gnome gnomevfs
# => ac_add_options --enable-extensions=gnomevfs
mozconfig_use_extension() {
declare minus=$(use $1 || echo -)
mozconfig_annotate "${minus:-+}$1" --enable-extensions=${minus}${2}
}
moz_pkgsetup() {
# Ensure we use C locale when building
export LANG="C"
export LC_ALL="C"
export LC_MESSAGES="C"
export LC_CTYPE="C"
# Ensure we use correct toolchain
export HOST_CC="$(tc-getBUILD_CC)"
export HOST_CXX="$(tc-getBUILD_CXX)"
tc-export CC CXX LD PKG_CONFIG AR RANLIB
# Ensure that we have a sane build enviroment
export MOZILLA_CLIENT=1
export BUILD_OPT=1
export NO_STATIC_LIB=1
export USE_PTHREADS=1
export ALDFLAGS=${LDFLAGS}
# ensure MOZCONFIG is not defined
unset MOZCONFIG
# set MOZILLA_FIVE_HOME
export MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
# nested configure scripts in mozilla products generate unrecognized options
# false positives when toplevel configure passes downwards.
export QA_CONFIGURE_OPTIONS=".*"
if [[ $(gcc-major-version) -eq 3 ]]; then
ewarn "Unsupported compiler detected, DO NOT file bugs for"
ewarn "outdated compilers. Bugs opened with gcc-3 will be closed"
ewarn "invalid."
fi
python-any-r1_pkg_setup
}
# @FUNCTION: mozconfig_init
# @DESCRIPTION:
# Initialize mozilla configuration and populate with core settings.
# This should be called in src_configure before any other mozconfig_* functions.
mozconfig_init() {
declare enable_optimize pango_version myext x
declare XUL=$([[ ${PN} == xulrunner ]] && echo true || echo false)
declare FF=$([[ ${PN} == firefox ]] && echo true || echo false)
declare SM=$([[ ${PN} == seamonkey ]] && echo true || echo false)
declare TB=$([[ ${PN} == thunderbird ]] && echo true || echo false)
####################################
#
# Setup the initial .mozconfig
# See http://www.mozilla.org/build/configure-build.html
#
####################################
case ${PN} in
*xulrunner)
cp xulrunner/config/mozconfig .mozconfig \
|| die "cp xulrunner/config/mozconfig failed" ;;
*firefox)
cp browser/config/mozconfig .mozconfig \
|| die "cp browser/config/mozconfig failed" ;;
seamonkey)
# Must create the initial mozconfig to enable application
: >.mozconfig || die "initial mozconfig creation failed"
mozconfig_annotate "" --enable-application=suite ;;
*thunderbird)
# Must create the initial mozconfig to enable application
: >.mozconfig || die "initial mozconfig creation failed"
mozconfig_annotate "" --enable-application=mail ;;
esac
####################################
#
# CFLAGS setup and ARCH support
#
####################################
# Set optimization level
if [[ $(gcc-major-version) -ge 7 ]]; then
mozconfig_annotate "Workaround known breakage" --enable-optimize=-O2
elif [[ ${ARCH} == hppa ]]; then
mozconfig_annotate "more than -O0 causes a segfault on hppa" --enable-optimize=-O0
elif [[ ${ARCH} == x86 ]]; then
mozconfig_annotate "less than -O2 causes a segfault on x86" --enable-optimize=-O2
elif [[ ${ARCH} == arm ]] && [[ $(gcc-major-version) -ge 6 ]]; then
mozconfig_annotate "less than -O2 causes a breakage on arm with gcc-6" --enable-optimize=-O2
elif use custom-optimization || [[ ${ARCH} =~ (alpha|ia64) ]]; then
# Set optimization level based on CFLAGS
if is-flag -O0; then
mozconfig_annotate "from CFLAGS" --enable-optimize=-O0
elif [[ ${ARCH} == ppc ]] && has_version '>=sys-libs/glibc-2.8'; then
mozconfig_annotate "more than -O1 segfaults on ppc with glibc-2.8" --enable-optimize=-O1
elif is-flag -O4; then
mozconfig_annotate "from CFLAGS" --enable-optimize=-O4
elif is-flag -O3; then
mozconfig_annotate "from CFLAGS" --enable-optimize=-O3
elif is-flag -O1; then
mozconfig_annotate "from CFLAGS" --enable-optimize=-O1
elif is-flag -Os; then
mozconfig_annotate "from CFLAGS" --enable-optimize=-Os
else
mozconfig_annotate "Gentoo's default optimization" --enable-optimize=-O2
fi
else
# Enable Mozilla's default
mozconfig_annotate "mozilla default" --enable-optimize
fi
# Strip optimization so it does not end up in compile string
filter-flags '-O*'
# Strip over-aggressive CFLAGS
use custom-cflags || strip-flags
# Additional ARCH support
case "${ARCH}" in
arm)
# Reduce the memory requirements for linking
append-ldflags -Wl,--no-keep-memory -Wl,--reduce-memory-overheads
;;
alpha)
# Historically we have needed to add -fPIC manually for 64-bit.
# Additionally, alpha should *always* build with -mieee for correct math
# operation
append-flags -fPIC -mieee
;;
ia64)
# Historically we have needed to add this manually for 64-bit
append-flags -fPIC
;;
ppc64)
append-flags -fPIC -mminimal-toc
# Reduce the memory requirements for linking
append-ldflags -Wl,--no-keep-memory -Wl,--reduce-memory-overheads
;;
esac
# We need to append flags for gcc-6 support
if [[ $(gcc-major-version) -ge 6 ]]; then
append-cxxflags -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns -fno-schedule-insns2
fi
# Use the MOZILLA_FIVE_HOME for the rpath
append-ldflags -Wl,-rpath="${MOZILLA_FIVE_HOME}",--enable-new-dtags
####################################
#
# mozconfig setup
#
####################################
mozconfig_annotate disable_update_strip \
--disable-updater \
--disable-strip \
--disable-install-strip
# jemalloc won't build with older glibc
! has_version ">=sys-libs/glibc-2.4" && mozconfig_annotate "we have old glibc" --disable-jemalloc
}
# @FUNCTION: mozconfig_final
# @DESCRIPTION:
# Apply EXTRA_ECONF values to .mozconfig
# Display a table describing all configuration options paired
# with reasons, then clean up extensions list.
# This should be called in src_configure at the end of all other mozconfig_* functions.
mozconfig_final() {
declare ac opt hash reason
# Apply EXTRA_ECONF entries to .mozconfig
if [[ -n ${EXTRA_ECONF} ]]; then
IFS=\! read -a ac <<<${EXTRA_ECONF// --/\!}
for opt in "${ac[@]}"; do
mozconfig_annotate "EXTRA_ECONF" --${opt#--}
done
fi
echo
echo "=========================================================="
echo "Building ${PF} with the following configuration"
grep ^ac_add_options .mozconfig | while read ac opt hash reason; do
[[ -z ${hash} || ${hash} == \# ]] \
|| die "error reading mozconfig: ${ac} ${opt} ${hash} ${reason}"
printf " %-30s %s\n" "${opt}" "${reason:-mozilla.org default}"
done
echo "=========================================================="
echo
# Resolve multiple --enable-extensions down to one
declare exts=$(sed -n 's/^ac_add_options --enable-extensions=\([^ ]*\).*/\1/p' \
.mozconfig | xargs)
sed -i '/^ac_add_options --enable-extensions/d' .mozconfig
echo "ac_add_options --enable-extensions=${exts// /,}" >> .mozconfig
}
_MOZCORECONF=1
fi

View File

@ -22,7 +22,7 @@ DEPEND="app-arch/unzip"
mozversion_extension_location() {
case ${PN} in
firefox|firefox-bin)
firefox|firefox-bin|palemoon)
if [[ $(get_version_component_range 1) -ge 21 ]] ; then
return 0
fi
@ -69,10 +69,18 @@ xpi_install() {
[[ ${#} -ne 1 ]] && die "$FUNCNAME takes exactly one argument, please specify an xpi to unpack"
x="${1}"
cd ${x}
#cd ${x}
# determine id for extension
if [[ -f "${x}"/install.rdf ]]; then
emid="$(sed -n -e '/install-manifest/,$ { /em:id/!d; s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' "${x}"/install.rdf)" \
|| die "failed to determine extension id"
|| die "failed to determine extension id from install.rdf"
elif [[ -f "${x}"/manifest.json ]]; then
emid="$( sed -n 's/.*"id": "\(.*\)",/\1/p' "${x}"/manifest.json )" \
|| die "failed to determine extension id from manifest.json"
else
die "failed to determine extension id"
fi
if [[ -n ${MOZEXTENSION_TARGET} ]]; then
insinto "${MOZILLA_FIVE_HOME}"/${MOZEXTENSION_TARGET%/}/${emid}
elif $(mozversion_extension_location) ; then

View File

@ -1,4 +1,4 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: multibuild.eclass
@ -16,7 +16,7 @@ case "${EAPI:-0}" in
0|1|2|3)
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
4|5|6)
4|5|6|7)
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"

View File

@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: multilib-build.eclass
@ -20,7 +20,7 @@ if [[ ! ${_MULTILIB_BUILD} ]]; then
# EAPI=4 is required for meaningful MULTILIB_USEDEP.
case ${EAPI:-0} in
4|5|6) ;;
4|5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
@ -269,8 +269,8 @@ multilib_check_headers() {
_multilib_header_cksum() {
set -o pipefail
if [[ -d ${ED}usr/include ]]; then
find "${ED}"usr/include -type f \
if [[ -d ${ED%/}/usr/include ]]; then
find "${ED%/}"/usr/include -type f \
-exec cksum {} + | sort -k2
fi
}
@ -390,7 +390,7 @@ multilib_prepare_wrappers() {
[[ ${#} -le 1 ]] || die "${FUNCNAME}: too many arguments"
local root=${1:-${ED}}
local root=${1:-${ED%/}}
local f
if [[ ${COMPLETE_MULTILIB} == yes ]]; then
@ -458,9 +458,9 @@ multilib_prepare_wrappers() {
# Some ABIs may have install less files than others.
if [[ -f ${root}/usr/include${f} ]]; then
local wrapper=${ED}/tmp/multilib-include${f}
local wrapper=${ED%/}/tmp/multilib-include${f}
if [[ ! -f ${ED}/tmp/multilib-include${f} ]]; then
if [[ ! -f ${ED%/}/tmp/multilib-include${f} ]]; then
dodir "/tmp/multilib-include${dir}"
# a generic template
cat > "${wrapper}" <<_EOF_ || die
@ -497,8 +497,8 @@ multilib_prepare_wrappers() {
# else
# error "abi_s390_32 not supported by the package."
# endif
#elif defined(__powerpc__)
# if defined(__powerpc64__)
#elif defined(__powerpc__) || defined(__ppc__)
# if defined(__powerpc64__) || defined(__ppc64__)
# error "abi_ppc_64 not supported by the package."
# else
# error "abi_ppc_32 not supported by the package."
@ -518,7 +518,7 @@ _EOF_
# $CHOST shall be set by multilib_toolchain_setup
dodir "/tmp/multilib-include/${CHOST}${dir}"
mv "${root}/usr/include${f}" "${ED}/tmp/multilib-include/${CHOST}${dir}/" || die
mv "${root}/usr/include${f}" "${ED%/}/tmp/multilib-include/${CHOST}${dir}/" || die
# Note: match a space afterwards to avoid collision potential.
sed -e "/${MULTILIB_ABI_FLAG} /s&error.*&include <${CHOST}${f}>&" \
@ -558,11 +558,11 @@ multilib_install_wrappers() {
local root=${1:-${ED}}
if [[ -d "${ED}"/tmp/multilib-include ]]; then
if [[ -d ${ED%/}/tmp/multilib-include ]]; then
multibuild_merge_root \
"${ED}"/tmp/multilib-include "${root}"/usr/include
"${ED%/}"/tmp/multilib-include "${root}"/usr/include
# it can fail if something else uses /tmp
rmdir "${ED}"/tmp &>/dev/null
rmdir "${ED%/}"/tmp &>/dev/null
fi
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: multilib-minimal.eclass
@ -24,7 +24,7 @@
# EAPI=4 is required for meaningful MULTILIB_USEDEP.
case ${EAPI:-0} in
4|5|6) ;;
4|5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
esac

View File

@ -1,4 +1,4 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: multiprocessing.eclass
@ -7,51 +7,25 @@
# @AUTHOR:
# Brian Harring <ferringb@gentoo.org>
# Mike Frysinger <vapier@gentoo.org>
# @BLURB: parallelization with bash (wtf?)
# @BLURB: multiprocessing helper functions
# @DESCRIPTION:
# The multiprocessing eclass contains a suite of functions that allow ebuilds
# to quickly run things in parallel using shell code.
# The multiprocessing eclass contains a suite of utility functions
# that could be helpful to controlling parallel multiple job execution.
# The most common use is processing MAKEOPTS in order to obtain job
# count.
#
# It has two modes: pre-fork and post-fork. If you don't want to dive into any
# more nuts & bolts, just use the pre-fork mode. For main threads that mostly
# spawn children and then wait for them to finish, use the pre-fork mode. For
# main threads that do a bit of processing themselves, use the post-fork mode.
# You may mix & match them for longer computation loops.
# @EXAMPLE:
#
# @CODE
# # First initialize things:
# multijob_init
#
# # Then hash a bunch of files in parallel:
# for n in {0..20} ; do
# multijob_child_init md5sum data.${n} > data.${n}
# done
#
# # Then wait for all the children to finish:
# multijob_finish
# src_compile() {
# # custom build system that does not support most of MAKEOPTS
# ./mybs -j$(makeopts_jobs)
# }
# @CODE
if [[ -z ${_MULTIPROCESSING_ECLASS} ]]; then
_MULTIPROCESSING_ECLASS=1
# @FUNCTION: bashpid
# @DESCRIPTION:
# Return the process id of the current sub shell. This is to support bash
# versions older than 4.0 that lack $BASHPID support natively. Simply do:
# echo ${BASHPID:-$(bashpid)}
#
# Note: Using this func in any other way than the one above is not supported.
bashpid() {
# Running bashpid plainly will return incorrect results. This func must
# be run in a subshell of the current subshell to get the right pid.
# i.e. This will show the wrong value:
# bashpid
# But this will show the right value:
# (bashpid)
sh -c 'echo ${PPID}'
}
# @FUNCTION: get_nproc
# @USAGE: [${fallback:-1}]
# @DESCRIPTION:
@ -126,188 +100,4 @@ makeopts_loadavg() {
echo ${lavg:-${2:-999}}
}
# @FUNCTION: multijob_init
# @USAGE: [${MAKEOPTS}]
# @DESCRIPTION:
# Setup the environment for executing code in parallel.
# You must call this before any other multijob function.
multijob_init() {
# When something goes wrong, try to wait for all the children so we
# don't leave any zombies around.
has wait ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS+=" wait "
# Setup a pipe for children to write their pids to when they finish.
# We have to allocate two fd's because POSIX has undefined behavior
# when using one single fd for both read and write. #487056
# However, opening an fd for read or write only will block until the
# opposite end is opened as well. Thus we open the first fd for both
# read and write to not block ourselve, but use it for reading only.
# The second fd really is opened for write only, as Cygwin supports
# just one single read fd per FIFO. #583962
local pipe="${T}/multijob.pipe"
mkfifo -m 600 "${pipe}"
redirect_alloc_fd mj_read_fd "${pipe}"
redirect_alloc_fd mj_write_fd "${pipe}" '>'
rm -f "${pipe}"
# See how many children we can fork based on the user's settings.
mj_max_jobs=$(makeopts_jobs "$@")
mj_num_jobs=0
}
# @FUNCTION: multijob_child_init
# @USAGE: [--pre|--post] [command to run in background]
# @DESCRIPTION:
# This function has two forms. You can use it to execute a simple command
# in the background (and it takes care of everything else), or you must
# call this first thing in your forked child process.
#
# The --pre/--post options allow you to select the child generation mode.
#
# @CODE
# # 1st form: pass the command line as arguments:
# multijob_child_init ls /dev
# # Or if you want to use pre/post fork modes:
# multijob_child_init --pre ls /dev
# multijob_child_init --post ls /dev
#
# # 2nd form: execute multiple stuff in the background (post fork):
# (
# multijob_child_init
# out=`ls`
# if echo "${out}" | grep foo ; then
# echo "YEAH"
# fi
# ) &
# multijob_post_fork
#
# # 2nd form: execute multiple stuff in the background (pre fork):
# multijob_pre_fork
# (
# multijob_child_init
# out=`ls`
# if echo "${out}" | grep foo ; then
# echo "YEAH"
# fi
# ) &
# @CODE
multijob_child_init() {
local mode="pre"
case $1 in
--pre) mode="pre" ; shift ;;
--post) mode="post"; shift ;;
esac
if [[ $# -eq 0 ]] ; then
trap 'echo ${BASHPID:-$(bashpid)} $? >&'${mj_write_fd} EXIT
trap 'exit 1' INT TERM
else
local ret
[[ ${mode} == "pre" ]] && { multijob_pre_fork; ret=$?; }
( multijob_child_init ; "$@" ) &
[[ ${mode} == "post" ]] && { multijob_post_fork; ret=$?; }
return ${ret}
fi
}
# @FUNCTION: _multijob_fork
# @INTERNAL
# @DESCRIPTION:
# Do the actual book keeping.
_multijob_fork() {
[[ $# -eq 1 ]] || die "incorrect number of arguments"
local ret=0
[[ $1 == "post" ]] && : $(( ++mj_num_jobs ))
if [[ ${mj_num_jobs} -ge ${mj_max_jobs} ]] ; then
multijob_finish_one
ret=$?
fi
[[ $1 == "pre" ]] && : $(( ++mj_num_jobs ))
return ${ret}
}
# @FUNCTION: multijob_pre_fork
# @DESCRIPTION:
# You must call this in the parent process before forking a child process.
# If the parallel limit has been hit, it will wait for one child to finish
# and return its exit status.
multijob_pre_fork() { _multijob_fork pre "$@" ; }
# @FUNCTION: multijob_post_fork
# @DESCRIPTION:
# You must call this in the parent process after forking a child process.
# If the parallel limit has been hit, it will wait for one child to finish
# and return its exit status.
multijob_post_fork() { _multijob_fork post "$@" ; }
# @FUNCTION: multijob_finish_one
# @DESCRIPTION:
# Wait for a single process to exit and return its exit code.
multijob_finish_one() {
[[ $# -eq 0 ]] || die "${FUNCNAME} takes no arguments"
local pid ret
read -r -u ${mj_read_fd} pid ret || die
: $(( --mj_num_jobs ))
return ${ret}
}
# @FUNCTION: multijob_finish
# @DESCRIPTION:
# Wait for all pending processes to exit and return the bitwise or
# of all their exit codes.
multijob_finish() {
local ret=0
while [[ ${mj_num_jobs} -gt 0 ]] ; do
multijob_finish_one
: $(( ret |= $? ))
done
# Let bash clean up its internal child tracking state.
wait
# Do this after reaping all the children.
[[ $# -eq 0 ]] || die "${FUNCNAME} takes no arguments"
# No need to hook anymore.
EBUILD_DEATH_HOOKS=${EBUILD_DEATH_HOOKS/ wait / }
return ${ret}
}
# @FUNCTION: redirect_alloc_fd
# @USAGE: <var> <file> [redirection]
# @DESCRIPTION:
# Find a free fd and redirect the specified file via it. Store the new
# fd in the specified variable. Useful for the cases where we don't care
# about the exact fd #.
redirect_alloc_fd() {
local var=$1 file=$2 redir=${3:-"<>"}
# Make sure /dev/fd is sane on Linux hosts. #479656
if [[ ! -L /dev/fd && ${CBUILD} == *linux* ]] ; then
eerror "You're missing a /dev/fd symlink to /proc/self/fd."
eerror "Please fix the symlink and check your boot scripts (udev/etc...)."
die "/dev/fd is broken"
fi
if [[ $(( (BASH_VERSINFO[0] << 8) + BASH_VERSINFO[1] )) -ge $(( (4 << 8) + 1 )) ]] ; then
# Newer bash provides this functionality.
eval "exec {${var}}${redir}'${file}'"
else
# Need to provide the functionality ourselves.
local fd=10
while :; do
# Make sure the fd isn't open. It could be a char device,
# or a symlink (possibly broken) to something else.
if [[ ! -e /dev/fd/${fd} ]] && [[ ! -L /dev/fd/${fd} ]] ; then
eval "exec ${fd}${redir}'${file}'" && break
fi
[[ ${fd} -gt 1024 ]] && die 'could not locate a free temp fd !?'
: $(( ++fd ))
done
: $(( ${var} = fd ))
fi
}
fi

View File

@ -1,7 +1,7 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: aspell-dict.eclass
# @ECLASS: myspell-r2.eclass
# @MAINTAINER:
# maintainer-needed@gentoo.org
# @AUTHOR:

View File

@ -15,7 +15,7 @@
# the src_prepare, src_configure, src_compile, and src_install
# phase hooks.
inherit cmake-utils flag-o-matic multilib prefix eutils toolchain-funcs
inherit cmake-utils flag-o-matic multilib prefix eutils toolchain-funcs versionator
#
# HELPER FUNCTIONS:

View File

@ -20,20 +20,24 @@
MYSQL_EXTRAS=""
# @ECLASS-VARIABLE: MYSQL_EXTRAS_VER
# @DEFAULT_UNSET
# @DESCRIPTION:
# The version of the MYSQL_EXTRAS repo to use to build mysql
# Use "none" to disable it's use
[[ ${MY_EXTRAS_VER} == "live" ]] && MYSQL_EXTRAS="git-r3"
# @ECLASS-VARIABLE: MYSQL_CMAKE_NATIVE_DEFINES
# @DEFAULT_UNSET
# @DESCRIPTION:
# An array of extra CMake arguments for native multilib builds
# @ECLASS-VARIABLE: MYSQL_CMAKE_NONNATIVE_DEFINES
# @DEFAULT_UNSET
# @DESCRIPTION:
# An array of extra CMake arguments for non-native multilib builds
# @ECLASS-VARIABLE: MYSQL_CMAKE_EXTRA_DEFINES
# @DEFAULT_UNSET
# @DESCRIPTION:
# An array of CMake arguments added to native and non-native
@ -188,7 +192,6 @@ DEPEND="
# prefix: first need to implement something for #196294
RDEPEND="${DEPEND}
selinux? ( sec-policy/selinux-mysql )
abi_x86_32? ( !app-emulation/emul-linux-x86-db[-abi_x86_32(-)] )
"
# Having different flavours at the same time is not a good idea
@ -887,7 +890,7 @@ mysql-multilib-r1_pkg_config() {
${EROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null
for opt in grant-tables host-cache name-resolve networking slave-start \
federated ssl log-bin relay-log slow-query-log external-locking \
ndbcluster log-slave-updates \
ndbcluster log-slave-updates wsrep-on \
; do
optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}"
egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}"

File diff suppressed because it is too large Load Diff

View File

@ -41,6 +41,7 @@ esac
MYSQL_EXTRAS=""
# @ECLASS-VARIABLE: MYSQL_EXTRAS_VER
# @DEFAULT_UNSET
# @DESCRIPTION:
# The version of the MYSQL_EXTRAS repo to use to build mysql
# Use "none" to disable it's use
@ -795,7 +796,7 @@ mysql-v2_pkg_config() {
${EROOT}/usr/sbin/mysqld --verbose --help >"${helpfile}" 2>/dev/null
for opt in grant-tables host-cache name-resolve networking slave-start \
federated ssl log-bin relay-log slow-query-log external-locking \
ndbcluster log-slave-updates \
ndbcluster log-slave-updates wsrep-on \
; do
optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}"
egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}"

View File

@ -1,17 +1,26 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Author: Francesco Riosa (Retired) <vivo@gentoo.org>
# Maintainer:
# DEPRECATED
# Recent versions have begun deprecating this eclass.
# Do not use it in new series.
# @ECLASS: mysql_fx.eclass
# @MAINTAINER:
# - MySQL Team <mysql-bugs@gentoo.org>
# - Luca Longinotti <chtekk@gentoo.org>
# @AUTHOR: Francesco Riosa (Retired) <vivo@gentoo.org>
# @BLURB: This eclass provides some helper functions for mysql ebuilds
# @DESCRIPTION:
# This eclass providers helpers to build mysql servers including patching
# from an index and initializing certain variables as part of the build.
inherit multilib
#
# @FUNCTION: stripdots
# @DESCRIPTION:
# Helper function, version (integer) may have sections separated by dots
# for readability.
#
stripdots() {
local dotver=${1:-"0"}
local v=""
@ -39,12 +48,12 @@ stripdots() {
fi
}
#
# @FUNCTION: mysql_check_version_range
# @DESCRIPTION:
# Check if a version number falls inside a given range.
# The range includes the extremes and must be specified as
# "low_version to high_version" i.e. "4.1.2 to 5.1.99.99".
# Returns true if inside the range.
#
mysql_check_version_range() {
local lbound="${1%% to *}" ; lbound=$(stripdots "${lbound}")
local rbound="${1#* to }" ; rbound=$(stripdots "${rbound}")
@ -53,9 +62,10 @@ mysql_check_version_range() {
return 1
}
#
# @FUNCTION: _mysql_test_patch_ver_pn
# @INTERNAL
# @DESCRIPTION:
# True if at least one applicable range is found for the patch.
#
_mysql_test_patch_ver_pn() {
local allelements=", version, package name"
# So that it fails the directory test if none of them exist
@ -88,7 +98,8 @@ _mysql_test_patch_ver_pn() {
return 1
}
#
# @FUNCTION: mysql_mv_patches
# @DESCRIPTION:
# Parse a "index_file" looking for patches to apply to the
# current MySQL version.
# If the patch applies, print its description.
@ -119,6 +130,8 @@ mysql_mv_patches() {
_mysql_mv_patches "${index_file}" "${my_ver}" "${my_test_fx}"
}
# @FUNCTION: _mysql_mv_patches
# @INTERNAL
_mysql_mv_patches() {
local index_file="${1}"
local my_ver="${2}"
@ -168,7 +181,8 @@ _mysql_mv_patches() {
&& for (( i=0 ; $i < $ndsc ; i++ )) ; do einfo "> ${dsc[$i]}" ; done
}
#
# @FUNCTION: mysql_version_is_at_least
# @DESCRIPTION:
# Is $2 (defaults to $MYSQL_VERSION_ID) at least version $1?
# (nice) idea from versionator.eclass
#
@ -178,9 +192,10 @@ mysql_version_is_at_least() {
[[ ${want_s} -le ${have_s} ]] && return 0 || return 1
}
#
# @FUNCTION: mysql_lib_symlinks
# @DESCRIPTION:
# To be called on the live filesystem, reassigning symlinks of each MySQL
# library to the best version available.
# library to the best version available. (Obsolete)
#
mysql_lib_symlinks() {

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ninja-utils.eclass
@ -22,7 +22,7 @@ if [[ -z ${_NINJA_UTILS_ECLASS} ]]; then
case ${EAPI:-0} in
0|1|3) die "EAPI=${EAPI:-0} is not supported (too old)";;
# copied from cmake-utils
2|4|5|6) ;;
2|4|5|6|7) ;;
*) die "EAPI=${EAPI} is not yet supported" ;;
esac

View File

@ -34,7 +34,7 @@ output of nvidia-bug-report.sh included.
"
# the data below is derived from
# http://us.download.nvidia.com/XFree86/Linux-x86_64/319.12/README/supportedchips.html
# http://us.download.nvidia.com/XFree86/Linux-x86_64/396.18/README/supportedchips.html
drv_71xx="
0020 0028 0029 002c 002d 00a0 0100 0101 0103 0150 0151 0152 0153
@ -86,11 +86,23 @@ drv_340x="
0caf 0cb0 0cb1 0cbc 10c0 10c3 10c5 10d8
"
drv_390x="
06c0 06c4 06ca 06cd 06d1 06d2 06d8 06d9 06da 06dc 06dd 06de 06df 0dc0 0dc4
0dc5 0dc6 0dcd 0dce 0dd1 0dd2 0dd3 0dd6 0dd8 0dda 0de0 0de1 0de2 0de3 0de4
0de5 0de7 0de8 0de9 0dea 0deb 0dec 0ded 0dee 0def 0df0 0df1 0df2 0df3 0df4
0df5 0df6 0df7 0df8 0df9 0dfa 0dfc 0e22 0e23 0e24 0e30 0e31 0e3a 0e3b 0f00
0f01 0f02 0f03 1040 1042 1048 1049 104a 104b 104c 1050 1051 1052 1054 1055
1056 1057 1058 1059 105a 105b 107c 107d 1080 1081 1082 1084 1086 1087 1088
1089 108b 1091 1094 1096 109a 109b 1140 1200 1201 1203 1205 1206 1207 1208
1210 1211 1212 1213 1241 1243 1244 1245 1246 1247 1248 1249 124b 124d 1251
"
mask_71xx=">=x11-drivers/nvidia-drivers-72.0.0"
mask_96xx=">=x11-drivers/nvidia-drivers-97.0.0"
mask_173x=">=x11-drivers/nvidia-drivers-177.0.0"
mask_304x=">=x11-drivers/nvidia-drivers-305.0.0"
mask_340x=">=x11-drivers/nvidia-drivers-341.0.0"
mask_390x=">=x11-drivers/nvidia-drivers-391.0.0"
# @FUNCTION: nvidia-driver-get-card
# @DESCRIPTION:
@ -98,7 +110,7 @@ mask_340x=">=x11-drivers/nvidia-drivers-341.0.0"
nvidia-driver-get-card() {
local NVIDIA_CARD=$(
[ -x /usr/sbin/lspci ] && /usr/sbin/lspci -d 10de: -n \
| awk -F'[: ]' '/ 0300: /{print $6}'
| awk -F'[: ]' '/ 03[0-9][0-9]: /{print $6}'
)
if [ -n "${NVIDIA_CARD}" ]; then
@ -147,6 +159,13 @@ nvidia-driver-get-mask() {
return 0
fi
done
for drv in ${drv_390x}; do
if [ "x${card}" = "x${drv}" ]; then
echo "${mask_390x}"
return 0
fi
done
done
echo ''

View File

@ -3,7 +3,7 @@
# @ECLASS: obs-download.eclass
# @MAINTAINER:
# suse@gentoo.org
# maintainer-needed@gentoo.org
# @BLURB: Simplifies downloading from openSUSE Build Service.
# @DESCRIPTION:
# This eclass constructs OBS_URI based on provided project in openSUSE Build
@ -27,7 +27,7 @@
# @DEFAULT_UNSET
# @DESCRIPTION:
# In which obs project pakage is.
# This variable does not have to be set and is overriden, if
# This variable does not have to be set and is overridden, if
# OPENSUSE_RELEASE is provided.
# @ECLASS-VARIABLE: OBS_PACKAGE

View File

@ -3,7 +3,7 @@
# @ECLASS: obs-service.eclass
# @MAINTAINER:
# suse@gentoo.org
# maintainer-needed@gentoo.org
# @BLURB: Reduces code duplication in the Open Build Service services.
# @DESCRIPTION:
# This eclass makes it easier to package Open Build Service services. Based on

View File

@ -8,7 +8,7 @@
# Tomáš Chvátal <scarabeus@gentoo.org>
# @BLURB: Eclass for installing libreoffice/openoffice extensions
# @DESCRIPTION:
# Eclass for easing maitenance of libreoffice/openoffice extensions.
# Eclass for easing maintenance of libreoffice/openoffice extensions.
case "${EAPI:-0}" in
5|6) OEXT_EXPORTED_FUNCTIONS="src_unpack src_install pkg_postinst pkg_prerm" ;;

View File

@ -0,0 +1,124 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: out-of-source.eclass
# @MAINTAINER:
# Michał Górny <mgorny@gentoo.org>
# @BLURB: convenient wrapper to build autotools packages out-of-source
# @DESCRIPTION:
# This eclass provides a minimalistic wrapper interface to easily
# build autotools (and alike) packages out-of-source. It is meant
# to resemble the interface used by multilib-minimal without actually
# requiring the package to be multilib.
#
# For the simplest ebuilds, it is enough to inherit the eclass
# and the new phase functions will automatically build the package
# out-of-source. If you need to redefine one of the default phases
# src_configure() through src_install(), you need to define
# the matching sub-phases: my_src_configure(), my_src_compile(),
# my_src_test() and/or my_src_install(). Those sub-phase functions
# will be run inside the build directory. Additionally,
# my_src_install_all() is provided to perform doc-install and other
# common tasks that are done in source directory.
#
# Example use:
# @CODE
# inherit out-of-source
#
# my_src_configure() {
# econf \
# --disable-static
# }
# @CODE
case ${EAPI} in
6|7);;
*) die "EAPI ${EAPI:-0} unsupported (too old)";;
esac
EXPORT_FUNCTIONS src_configure src_compile src_test src_install
if [[ ! ${_OUT_OF_SOURCE_ECLASS} ]]; then
# @FUNCTION: out-of-source_src_configure
# @DESCRIPTION:
# The default src_configure() implementation establishes a BUILD_DIR,
# sets ECONF_SOURCE to the current directory (usually S), and runs
# my_src_configure() (or the default) inside it.
out-of-source_src_configure() {
debug-print-function ${FUNCNAME} "$@"
# set some BUILD_DIR if we don't have one yet
: "${BUILD_DIR:=${WORKDIR}/${P}_build}"
local ECONF_SOURCE=${PWD}
mkdir -p "${BUILD_DIR}" || die
pushd "${BUILD_DIR}" >/dev/null || die
if declare -f my_src_configure >/dev/null ; then
my_src_configure
else
default_src_configure
fi
popd >/dev/null || die
}
# @FUNCTION: out-of-source_src_compile
# @DESCRIPTION:
# The default src_compile() implementation runs my_src_compile()
# (or the default) inside the build directory.
out-of-source_src_compile() {
debug-print-function ${FUNCNAME} "$@"
pushd "${BUILD_DIR}" >/dev/null || die
if declare -f my_src_compile >/dev/null ; then
my_src_compile
else
default_src_compile
fi
popd >/dev/null || die
}
# @FUNCTION: out-of-source_src_test
# @DESCRIPTION:
# The default src_test() implementation runs my_src_test()
# (or the default) inside the build directory.
out-of-source_src_test() {
debug-print-function ${FUNCNAME} "$@"
pushd "${BUILD_DIR}" >/dev/null || die
if declare -f my_src_test >/dev/null ; then
my_src_test
else
default_src_test
fi
popd >/dev/null || die
}
# @FUNCTION: out-of-source_src_install
# @DESCRIPTION:
# The default src_install() implementation runs my_src_install()
# (or the 'make install' part of the default) inside the build directory,
# followed by a call to my_src_install_all() (or 'einstalldocs' part
# of the default) in the original working directory.
out-of-source_src_install() {
debug-print-function ${FUNCNAME} "$@"
pushd "${BUILD_DIR}" >/dev/null || die
if declare -f my_src_install >/dev/null ; then
my_src_install
else
if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
emake DESTDIR="${D}" install
fi
fi
popd >/dev/null || die
if declare -f my_src_install_all >/dev/null ; then
my_src_install_all
else
einstalldocs
fi
}
_OUT_OF_SOURCE_ECLASS=1
fi

View File

@ -47,7 +47,7 @@ PAX_MARKINGS=${PAX_MARKINGS:="PT XT"}
# @CODE
#
# Default flags are 'PeMRS', which are the most restrictive settings. Refer
# to http://pax.grsecurity.net/ for details on what these flags are all about.
# to https://pax.grsecurity.net/ for details on what these flags are all about.
#
# Please confirm any relaxation of restrictions with the Gentoo Hardened team.
# Either ask on the gentoo-hardened mailing list, or CC/assign hardened@g.o on

View File

@ -1,105 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @DEAD
# @ECLASS: php-ext-pecl-r2.eclass
# @MAINTAINER:
# Gentoo PHP team <php-bugs@gentoo.org>
# @AUTHOR:
# Author: Tal Peer <coredumb@gentoo.org>
# Author: Luca Longinotti <chtekk@gentoo.org>
# Author: Jakub Moc <jakub@gentoo.org>
# @BLURB: A uniform way of installing PECL extensions
# @DESCRIPTION:
# This eclass should be used by all dev-php[45]/pecl-* ebuilds
# as a uniform way of installing PECL extensions.
# For more information about PECL, see http://pecl.php.net/
# @ECLASS-VARIABLE: PHP_EXT_PECL_PKG
# @DESCRIPTION:
# Set in ebuild before inheriting this eclass if the tarball name
# differs from ${PN/pecl-/} so that SRC_URI and HOMEPAGE gets set
# correctly by the eclass.
#
# Setting this variable manually also affects PHP_EXT_NAME and ${S}
# unless you override those in ebuild. Also see PHP_EXT_PECL_FILENAME
# if this is not desired for whatever reason.
# @ECLASS-VARIABLE: PHP_EXT_PECL_FILENAME
# @DESCRIPTION:
# Set in ebuild before inheriting this eclass if the tarball name
# differs from ${PN/pecl-/} so that SRC_URI gets set correctly by
# the eclass.
#
# Unlike PHP_EXT_PECL_PKG, setting this variable does not affect
# HOMEPAGE, PHP_EXT_NAME or ${S}.
[[ -z "${PHP_EXT_PECL_PKG}" ]] && PHP_EXT_PECL_PKG="${PN/pecl-/}"
[[ -z ${MY_PV} ]] && MY_PV=${PV}
PECL_PKG="${PHP_EXT_PECL_PKG}"
MY_PV="${MY_PV/_/}"
PECL_PKG_V="${PECL_PKG}-${MY_PV}"
[[ -z "${PHP_EXT_NAME}" ]] && PHP_EXT_NAME="${PECL_PKG}"
S="${WORKDIR}/${PECL_PKG_V}"
inherit php-ext-source-r2
EXPORT_FUNCTIONS src_compile src_install src_test
if [[ -n "${PHP_EXT_PECL_FILENAME}" ]] ; then
FILENAME="${PHP_EXT_PECL_FILENAME}-${MY_PV}.tgz"
else
FILENAME="${PECL_PKG_V}.tgz"
fi
SRC_URI="http://pecl.php.net/get/${FILENAME}"
HOMEPAGE="http://pecl.php.net/${PECL_PKG}"
# @FUNCTION: php-ext-pecl-r2_src_compile
# @DESCRIPTION:
# Takes care of standard compile for PECL packages.
php-ext-pecl-r2_src_compile() {
php-ext-source-r2_src_compile
}
# @FUNCTION: php-ext-pecl-r2_src_install
# @DESCRIPTION:
# Takes care of standard install for PECL packages.
# You can also simply add examples to IUSE to automagically install
# examples supplied with the package.
# @VARIABLE: DOCS
# @DESCRIPTION:
# Set in ebuild if you wish to install additional, package-specific documentation.
php-ext-pecl-r2_src_install() {
php-ext-source-r2_src_install
for doc in ${DOCS} "${WORKDIR}"/package.xml CREDITS ; do
[[ -s ${doc} ]] && dodoc ${doc}
done
if has examples ${IUSE} && use examples ; then
insinto /usr/share/doc/${CATEGORY}/${PF}/examples
doins -r examples/*
fi
}
# @FUNCTION: php-ext-pecl-r2_src_test
# @DESCRIPTION:
# Takes care of running any tests delivered with the PECL package.
# Standard phpize generates a run-tests.php file that is executed in make test
# We only need to force it to non-interactive mode
php-ext-pecl-r2_src_test() {
for slot in `php_get_slots`; do
php_init_slot_env ${slot}
NO_INTERACTION="yes" emake test || die "emake test failed for slot ${slot}"
done
}

View File

@ -8,7 +8,7 @@
# @DESCRIPTION:
# This eclass should be used by all dev-php/pecl-* ebuilds as a uniform
# way of installing PECL extensions. For more information about PECL,
# see http://pecl.php.net/
# see https://pecl.php.net/
# @ECLASS-VARIABLE: PHP_EXT_PECL_PKG
# @DESCRIPTION:
@ -47,15 +47,15 @@ inherit php-ext-source-r3
EXPORT_FUNCTIONS src_install src_test
if [[ -z "${PHP_EXT_PECL_FILENAME}" ]] ; then
SRC_URI="http://pecl.php.net/get/${PHP_EXT_PECL_PKG_V}.tgz"
SRC_URI="https://pecl.php.net/get/${PHP_EXT_PECL_PKG_V}.tgz"
else
SRC_URI="http://pecl.php.net/get/${PHP_EXT_PECL_FILENAME}"
SRC_URI="https://pecl.php.net/get/${PHP_EXT_PECL_FILENAME}"
fi
# Don't leave this laying around in the environment.
unset PHP_EXT_PECL_PKG_V
HOMEPAGE="http://pecl.php.net/${PHP_EXT_PECL_PKG}"
HOMEPAGE="https://pecl.php.net/${PHP_EXT_PECL_PKG}"
# @FUNCTION: php-ext-pecl-r3_src_install

View File

@ -1,4 +1,4 @@
# Copyright 1999-2016 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: php-ext-source-r3.eclass
@ -11,7 +11,7 @@
inherit autotools
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install src_test
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
case ${EAPI} in
6) ;;
@ -73,6 +73,33 @@ esac
# 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
@ -85,6 +112,9 @@ for _php_target in ${USE_PHP}; do
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
@ -111,33 +141,33 @@ DEPEND="${DEPEND}
# @ECLASS-VARIABLE: PHP_EXT_SKIP_PHPIZE
# @DEFAULT_UNSET
# @DESCRIPTION:
# By default, we run "phpize" in php-ext-source-r3_src_unpack(). Set
# 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).
# @FUNCTION: php-ext-source-r3_src_unpack
# @ECLASS-VARIABLE: PHP_EXT_SKIP_PATCHES
# @DEFAULT_UNSET
# @DESCRIPTION:
# Runs the default src_unpack and then makes a copy for each PHP slot.
php-ext-source-r3_src_unpack() {
default
local slot orig_s="${PHP_EXT_S}"
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}"
done
}
# 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:
# For each PHP slot, we initialize the environment, run the default
# src_prepare() for PATCHES/eapply_user support, and then call
# php-ext-source-r3_phpize.
# 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() {
for slot in $(php_get_slots); do
php_init_slot_env "${slot}"
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
}
@ -295,7 +325,7 @@ php_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_EXT_NAME}.ini"
slot_ini_files+=" etc/php/${x}-${1}/ext/${PHP_INI_NAME}.ini"
fi
done
@ -324,7 +354,7 @@ php-ext-source-r3_createinifiles() {
einfo "Added contents of ${FILESDIR}/${PHP_EXT_INIFILE}" \
"to ${file}"
fi
inidir="${file/${PHP_EXT_NAME}.ini/}"
inidir="${file/${PHP_INI_NAME}.ini/}"
inidir="${inidir/ext/ext-active}"
dodir "/${inidir}"
dosym "/${file}" "/${file/ext/ext-active}"

View File

@ -1,60 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: php-lib-r1.eclass
# @MAINTAINER:
# Gentoo PHP team <php-bugs@gentoo.org>
# @AUTHOR:
# Author: Stuart Herbert <stuart@gentoo.org>
# Author: Luca Longinotti <chtekk@gentoo.org>
# @BLURB: A unified interface for adding new PHP libraries.
# @DESCRIPTION:
# This eclass provides a unified interface for adding new PHP libraries.
# PHP libraries are PHP scripts designed for reuse inside other PHP scripts.
EXPORT_FUNCTIONS src_install
# Silence repoman warnings
case "${EAPI:-0}" in
0|1|2|3|4)
DEPEND="dev-lang/php"
;;
*)
DEPEND="dev-lang/php:*"
;;
esac
RDEPEND="${DEPEND}"
# @ECLASS-VARIABLE: PHP_LIB_NAME
# @DESCRIPTION:
# Defaults to ${PN} unless set manually in the ebuild.
[[ -z "${PHP_LIB_NAME}" ]] && PHP_LIB_NAME="${PN}"
# @FUNCTION: php-lib-r1_src_install
# @USAGE: <directory to install from> <list of files>
# @DESCRIPTION:
# Takes care of install for PHP libraries.
# You have to pass in a list of the PHP files to install.
# @VARIABLE: DOCS
# @DESCRIPTION:
# Set in ebuild if you wish to install additional, package-specific documentation.
# $1 - directory in ${S} to insert from
# $2 ... list of files to install
php-lib-r1_src_install() {
local x
S_DIR="$1"
shift
for x in $@ ; do
SUBDIR="$(dirname ${x})"
insinto "/usr/share/php/${PHP_LIB_NAME}/${SUBDIR}"
doins "${S_DIR}/${x}"
done
for doc in ${DOCS} ; do
[[ -s ${doc} ]] && dodoc ${doc}
done
}

View File

@ -1,121 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: php-pear-r1.eclass
# @MAINTAINER:
# Gentoo PHP Team <php-bugs@gentoo.org>
# @AUTHOR:
# Author: Tal Peer <coredumb@gentoo.org>
# Author: Luca Longinotti <chtekk@gentoo.org>
# @BLURB: Provides means for an easy installation of PEAR packages.
# @DESCRIPTION:
# This eclass provides means for an easy installation of PEAR packages.
# For more information on PEAR, see http://pear.php.net/
# Note that this eclass doesn't handle dependencies of PEAR packages
# on purpose; please use (R)DEPEND to define them correctly!
inherit multilib
EXPORT_FUNCTIONS pkg_setup src_install
case "${EAPI:-0}" in
0|1|2|3|4)
PHP_DEPEND="dev-lang/php"
;;
5|6)
# Repoman will complain about the missing slot in newer EAPIs.
PHP_DEPEND="dev-lang/php:*"
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
;;
esac
DEPEND="${PHP_DEPEND}
>=dev-php/pear-1.8.1"
RDEPEND="${DEPEND}"
# @ECLASS-VARIABLE: PHP_PEAR_PKG_NAME
# @DESCRIPTION:
# Set this if the the PEAR package name differs from ${PN/PEAR-/}
# (generally shouldn't be the case).
[[ -z "${PHP_PEAR_PKG_NAME}" ]] && PHP_PEAR_PKG_NAME="${PN/PEAR-/}"
fix_PEAR_PV() {
tmp="${PV}"
tmp="${tmp/_/}"
tmp="${tmp/rc/RC}"
tmp="${tmp/beta/b}"
tmp="${tmp/alpha/a}"
PEAR_PV="${tmp}"
}
# @ECLASS-VARIABLE: PEAR_PV
# @DESCRIPTION:
# Set in ebuild if the eclass ${PV} mangling breaks SRC_URI for alpha/beta/rc versions
[[ -z "${PEAR_PV}" ]] && fix_PEAR_PV
PEAR_PN="${PHP_PEAR_PKG_NAME}-${PEAR_PV}"
: ${PHP_PEAR_URI:=pear.php.net}
: ${PHP_PEAR_CHANNEL:=${FILESDIR}/channel.xml}
[[ -z "${SRC_URI}" ]] && SRC_URI="http://${PHP_PEAR_URI}/get/${PEAR_PN}.tgz"
[[ -z "${HOMEPAGE}" ]] && HOMEPAGE="http://${PHP_PEAR_URI}/${PHP_PEAR_PKG_NAME}"
S="${WORKDIR}/${PEAR_PN}"
# @FUNCTION: php-pear-lib-r1_pkg_setup
# @DESCRIPTION:
# Adds required PEAR channel if necessary
php-pear-r1_pkg_setup() {
if [[ -f $PHP_PEAR_CHANNEL ]]; then
pear channel-add $PHP_PEAR_CHANNEL || einfo "Ignore any errors about existing channels"
fi
}
# @FUNCTION: php-pear-r1_src_install
# @DESCRIPTION:
# Takes care of standard install for PEAR packages.
php-pear-r1_src_install() {
# SNMP support
addpredict /usr/share/snmp/mibs/.index
addpredict /var/lib/net-snmp/
addpredict /var/lib/net-snmp/mib_indexes
addpredict /session_mm_cli0.sem
PHP_BIN="/usr/bin/php"
cd "${S}"
# metadata_dir needs to be set relative to ${D} for >=dev-php/PEAR-PEAR-1.10
if [[ -f "${WORKDIR}"/package2.xml ]] ; then
mv -f "${WORKDIR}/package2.xml" "${S}"
if has_version '>=dev-php/PEAR-PEAR-1.7.0' ; then
local WWW_DIR="/usr/share/webapps/${PN}/${PVR}/htdocs"
peardev -d php_bin="${PHP_BIN}" -d www_dir="${WWW_DIR}" -d metadata_dir="/usr/share/php" \
install --force --loose --nodeps --offline --packagingroot="${D}" \
"${S}/package2.xml" || die "Unable to install PEAR package"
else
peardev -d php_bin="${PHP_BIN}" install --force --loose --nodeps --offline --packagingroot="${D}" \
"${S}/package2.xml" || die "Unable to install PEAR package"
fi
else
mv -f "${WORKDIR}/package.xml" "${S}"
if has_version '>=dev-php/PEAR-PEAR-1.7.0' ; then
local WWW_DIR="/usr/share/webapps/${PN}/${PVR}/htdocs"
peardev -d php_bin="${PHP_BIN}" -d www_dir="${WWW_DIR}" -d metadata_dir="/usr/share/php" \
install --force --loose --nodeps --offline --packagingroot="${D}" \
"${S}/package.xml" || die "Unable to install PEAR package"
else
peardev -d php_bin="${PHP_BIN}" install --force --loose --nodeps --offline --packagingroot="${D}" \
"${S}/package.xml" || die "Unable to install PEAR package"
fi
fi
rm -Rf "${D}/usr/share/php/.channels" \
"${D}/usr/share/php/.depdblock" \
"${D}/usr/share/php/.depdb" \
"${D}/usr/share/php/.filemap" \
"${D}/usr/share/php/.lock" \
"${D}/usr/share/php/.registry"
}

View File

@ -36,6 +36,9 @@ RDEPEND=">=dev-php/pear-1.8.1"
# Set in ebuild if the ${PV} breaks SRC_URI for alpha/beta/rc versions
: ${PEAR_PV:=${PV}}
# @ECLASS-VARIABLE: PEAR-P
# @INTERNAL
# @DESCRIPTION: Combines PHP_PEAR_PKG_NAME and PEAR_PV
PEAR_P="${PHP_PEAR_PKG_NAME}-${PEAR_PV}"
# @ECLASS-VARIABLE: PHP_PEAR_DOMAIN
@ -60,7 +63,7 @@ fi
S="${WORKDIR}/${PEAR_P}"
# @FUNCTION php-pear-r2_install_packagexml
# @FUNCTION: php-pear-r2_install_packagexml
# @DESCRIPTION:
# Copies the package2.xml or package.xml file and, optionally, the channel.xml
# file to a Gentoo-specific location so that pkg_postinst can install the package

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
inherit user
@ -26,7 +26,7 @@ esac
# @DESCRIPTION:
# List of versions to reverse sort POSTGRES_COMPAT slots
_POSTGRES_ALL_VERSIONS=( 11 10 9.6 9.5 9.4 9.3 9.2 )
_POSTGRES_ALL_VERSIONS=( 12 11 10 9.6 9.5 9.4 9.3 9.2 )

View File

@ -1,4 +1,4 @@
# Copyright 1999-2009 Gentoo Foundation
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: prefix.eclass
@ -48,8 +48,7 @@ eprefixify() {
}
# @FUNCTION: hprefixify
# @USAGE: [ -w <line match> ] [ -e <extended regex> ] [ -q <quotation char> ]
# <list of files>
# @USAGE: [ -w <line match> ] [ -e <extended regex> ] [ -q <quotation char> ] <list of files>
# @DESCRIPTION:
# Tries a set of heuristics to prefixify the given files. Dies if no
# arguments are given, a file does not exist, or changing a file failed.

View File

@ -0,0 +1,74 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: preserve-libs.eclass
# @MAINTAINER:
# base-system@gentoo.org
# @BLURB: preserve libraries after SONAME changes
if [[ -z ${_PRESERVE_LIBS_ECLASS} ]]; then
_PRESERVE_LIBS_ECLASS=1
# @FUNCTION: preserve_old_lib
# @USAGE: <libs to preserve> [more libs]
# @DESCRIPTION:
# These functions are useful when a lib in your package changes ABI SONAME.
# An example might be from libogg.so.0 to libogg.so.1. Removing libogg.so.0
# would break packages that link against it. Most people get around this
# by using the portage SLOT mechanism, but that is not always a relevant
# solution, so instead you can call this from pkg_preinst. See also the
# preserve_old_lib_notify function.
preserve_old_lib() {
if [[ ${EBUILD_PHASE} != "preinst" ]] ; then
eerror "preserve_old_lib() must be called from pkg_preinst() only"
die "Invalid preserve_old_lib() usage"
fi
[[ -z $1 ]] && die "Usage: preserve_old_lib <library to preserve> [more libraries to preserve]"
# let portage worry about it
has preserve-libs ${FEATURES} && return 0
has "${EAPI:-0}" 0 1 2 && local ED=${D} EROOT=${ROOT}
local lib dir
for lib in "$@" ; do
[[ -e ${EROOT}/${lib} ]] || continue
dir=${lib%/*}
dodir ${dir} || die "dodir ${dir} failed"
cp "${EROOT}"/${lib} "${ED}"/${lib} || die "cp ${lib} failed"
touch "${ED}"/${lib}
done
}
# @FUNCTION: preserve_old_lib_notify
# @USAGE: <libs to notify> [more libs]
# @DESCRIPTION:
# Spit helpful messages about the libraries preserved by preserve_old_lib.
preserve_old_lib_notify() {
if [[ ${EBUILD_PHASE} != "postinst" ]] ; then
eerror "preserve_old_lib_notify() must be called from pkg_postinst() only"
die "Invalid preserve_old_lib_notify() usage"
fi
# let portage worry about it
has preserve-libs ${FEATURES} && return 0
has "${EAPI:-0}" 0 1 2 && local EROOT=${ROOT}
local lib notice=0
for lib in "$@" ; do
[[ -e ${EROOT}/${lib} ]] || continue
if [[ ${notice} -eq 0 ]] ; then
notice=1
ewarn "Old versions of installed libraries were detected on your system."
ewarn "In order to avoid breaking packages that depend on these old libs,"
ewarn "the libraries are not being removed. You need to run revdep-rebuild"
ewarn "in order to remove these old dependencies. If you do not have this"
ewarn "helper program, simply emerge the 'gentoolkit' package."
ewarn
fi
ewarn " # revdep-rebuild --library '${lib}' && rm '${lib}'"
done
}
fi

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: python-any-r1.eclass
@ -36,7 +36,7 @@
# https://wiki.gentoo.org/wiki/Project:Python/python-any-r1
case "${EAPI:-0}" in
0|1|2|3|4|5|6)
0|1|2|3|4|5|6|7)
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: python-r1.eclass
@ -32,7 +32,7 @@ case "${EAPI:-0}" in
0|1|2|3|4)
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
5|6)
5|6|7)
# EAPI=5 is required for sane USE_EXPAND dependencies
;;
*)
@ -810,6 +810,7 @@ python_replicate_script() {
python_export PYTHON_SCRIPTDIR
(
exeopts -m 0755
exeinto "${PYTHON_SCRIPTDIR#${EPREFIX}}"
doexe "${files[@]}"
)

View File

@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: python-single-r1.eclass
@ -34,7 +34,7 @@ case "${EAPI:-0}" in
0|1|2|3|4)
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
5|6)
5|6|7)
# EAPI=5 is required for sane USE_EXPAND dependencies
;;
*)

Some files were not shown because too many files have changed in this diff Show More