summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/Manifest.gzbin37446 -> 37610 bytes
-rw-r--r--eclass/kernel-2.eclass5
-rw-r--r--eclass/ltprune.eclass4
-rw-r--r--eclass/qt5-build.eclass13
-rw-r--r--eclass/toolchain.eclass45
-rw-r--r--eclass/user.eclass4
-rw-r--r--eclass/vala.eclass3
-rw-r--r--eclass/webapp.eclass14
-rw-r--r--eclass/xorg-2.eclass29
-rw-r--r--eclass/xorg-3.eclass372
10 files changed, 435 insertions, 54 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz
index 061ddf4fd7f4..cad42ae3aea0 100644
--- a/eclass/Manifest.gz
+++ b/eclass/Manifest.gz
Binary files differ
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index ece1edfb36c6..6303e3e6c499 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -1230,9 +1230,6 @@ unipatch() {
local GCC_MAJOR_VER=$(gcc-major-version)
local GCC_MINOR_VER=$(gcc-minor-version)
- # support old kernels for a period. For now, remove as all gcc versions required are masked
- UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc.patch"
-
# optimization patch for gcc < 8.X and kernel > 4.13
if [[ ${GCC_MAJOR_VER} -lt 8 ]] && [[ ${GCC_MAJOR_VER} -gt 4 ]]; then
if kernel_is ge 4 13 ; then
@@ -1241,6 +1238,8 @@ unipatch() {
# optimization patch for gcc >= 8 and kernel ge 4.13
elif [[ "${GCC_MAJOR_VER}" -ge 8 ]]; then
if kernel_is ge 4 13; then
+ # support old kernels for a period. For now, remove as all gcc versions required are masked
+ UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc.patch"
UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
fi
fi
diff --git a/eclass/ltprune.eclass b/eclass/ltprune.eclass
index c0fa391bdff2..d8e93b6fb4b3 100644
--- a/eclass/ltprune.eclass
+++ b/eclass/ltprune.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ltprune.eclass
@@ -11,7 +11,7 @@
#
# Discouraged. Whenever possible, please use much simpler:
# @CODE
-# find "${D}" -name '*.la' -delete || die
+# find "${D}" -name '*.la' -type f -delete || die
# @CODE
if [[ -z ${_LTPRUNE_ECLASS} ]]; then
diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index d0a73287222e..613af912b93a 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -256,7 +256,9 @@ qt5-build_src_install() {
popd >/dev/null || die
- docompress -x "${QT5_DOCDIR#${EPREFIX}}"/global
+ if [[ ${QT5_MINOR_VERSION} -lt 12 ]]; then
+ docompress -x "${QT5_DOCDIR#${EPREFIX}}"/global
+ fi
# install an empty Gentoo/gentoo-qconfig.h in ${D}
# so that it's placed under package manager control
@@ -414,7 +416,11 @@ qt5_prepare_env() {
QT5_IMPORTDIR=${QT5_ARCHDATADIR}/imports
QT5_QMLDIR=${QT5_ARCHDATADIR}/qml
QT5_DATADIR=${QT5_PREFIX}/share/qt5
- QT5_DOCDIR=${QT5_PREFIX}/share/doc/qt-${PV}
+ if [[ ${QT5_MINOR_VERSION} -lt 12 ]]; then
+ QT5_DOCDIR=${QT5_PREFIX}/share/doc/qt-${PV}
+ else
+ QT5_DOCDIR=${QT5_PREFIX}/share/qt5-doc
+ fi
QT5_TRANSLATIONDIR=${QT5_DATADIR}/translations
QT5_EXAMPLESDIR=${QT5_DATADIR}/examples
QT5_TESTSDIR=${QT5_DATADIR}/tests
@@ -574,8 +580,7 @@ qt5_base_configure() {
-no-openssl -no-libproxy
-no-xcb-xlib
$([[ ${QT5_MINOR_VERSION} -lt 12 ]] && echo -no-xinput2 -no-xkbcommon-x11 -no-xkbcommon-evdev)
- $([[ ${PV} = 5.12.0* ]] && echo -no-xcb-xinput -no-xkbcommon-x11 -no-xkbcommon-evdev) # bug 672340
- $([[ ${QT5_MINOR_VERSION} -ge 12 && ${PV} != 5.12.0* ]] && echo -no-xcb-xinput -no-xkbcommon) # bug 672340
+ $([[ ${QT5_MINOR_VERSION} -ge 12 ]] && echo -no-xcb-xinput -no-xkbcommon) # bug 672340
# cannot use -no-gif because there is no way to override it later
#-no-gif
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index daa62e3a67c0..be94db869d52 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
# Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
-# @SUPPORTED_EAPIS: 5
+# @SUPPORTED_EAPIS: 5 6
DESCRIPTION="The GNU Compiler Collection"
HOMEPAGE="https://gcc.gnu.org/"
@@ -26,7 +26,7 @@ FEATURES=${FEATURES/multilib-strict/}
case ${EAPI:-0} in
0|1|2|3|4*) die "Need to upgrade to at least EAPI=5" ;;
- 5*) inherit eapi7-ver ;;
+ 5*|6) inherit eapi7-ver ;;
*) die "I don't speak EAPI ${EAPI}." ;;
esac
EXPORT_FUNCTIONS pkg_pretend pkg_setup src_unpack src_prepare src_configure \
@@ -138,16 +138,23 @@ else
fi
IUSE="${GCC_EBUILD_TEST_FLAG} vanilla +nls +nptl"
+TC_FEATURES=()
+
+tc_has_feature() {
+ has "$1" "${TC_FEATURES[@]}"
+}
+
if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
- IUSE+=" altivec debug +cxx +fortran"
+ IUSE+=" altivec debug +cxx +fortran" TC_FEATURES+=(fortran)
[[ -n ${PIE_VER} ]] && IUSE+=" nopie"
[[ -n ${HTB_VER} ]] && IUSE+=" boundschecking"
[[ -n ${D_VER} ]] && IUSE+=" d"
[[ -n ${SPECS_VER} ]] && IUSE+=" nossp"
tc_version_is_at_least 3 && IUSE+=" doc hardened multilib objc"
- tc_version_is_between 3 7 && IUSE+=" awt gcj"
+ tc_version_is_between 3 7 && IUSE+=" awt gcj" TC_FEATURES+=(gcj)
tc_version_is_at_least 3.3 && IUSE+=" pgo"
- tc_version_is_at_least 4.0 && IUSE+=" objc-gc"
+ tc_version_is_at_least 4.0 &&
+ IUSE+=" objc-gc" TC_FEATURES+=(objc-gc)
tc_version_is_between 4.0 4.9 && IUSE+=" mudflap"
tc_version_is_at_least 4.1 && IUSE+=" libssp objc++"
tc_version_is_at_least 4.2 && IUSE+=" +openmp"
@@ -156,13 +163,15 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
# Note: while <=gcc-4.7 also supported graphite, it required forked ppl
# versions which we dropped. Since graphite was also experimental in
# the older versions, we don't want to bother supporting it. #448024
- tc_version_is_at_least 4.8 && IUSE+=" graphite +sanitize"
+ tc_version_is_at_least 4.8 &&
+ IUSE+=" graphite +sanitize" TC_FEATURES+=(graphite)
tc_version_is_between 4.9 8 && IUSE+=" cilk"
tc_version_is_at_least 4.9 && IUSE+=" +vtv"
tc_version_is_at_least 5.0 && IUSE+=" jit mpx"
tc_version_is_at_least 6.0 && IUSE+=" +pie +ssp +pch"
# systemtap is a gentoo-specific switch: bug #654748
- tc_version_is_at_least 8.0 && IUSE+=" systemtap"
+ tc_version_is_at_least 8.0 &&
+ IUSE+=" systemtap" TC_FEATURES+=(systemtap)
fi
SLOT="${GCC_CONFIG_VER}"
@@ -178,20 +187,20 @@ if tc_version_is_at_least 4 ; then
GMP_MPFR_DEPS=">=dev-libs/gmp-4.3.2:0= >=dev-libs/mpfr-2.4.2:0="
if tc_version_is_at_least 4.3 ; then
RDEPEND+=" ${GMP_MPFR_DEPS}"
- elif in_iuse fortran ; then
+ elif tc_has_feature fortran ; then
RDEPEND+=" fortran? ( ${GMP_MPFR_DEPS} )"
fi
fi
tc_version_is_at_least 4.5 && RDEPEND+=" >=dev-libs/mpc-0.8.1:0="
-if in_iuse objc-gc ; then
+if tc_has_feature objc-gc ; then
if tc_version_is_at_least 7 ; then
RDEPEND+=" objc-gc? ( >=dev-libs/boehm-gc-7.4.2 )"
fi
fi
-if in_iuse graphite ; then
+if tc_has_feature graphite ; then
if tc_version_is_at_least 5.0 ; then
RDEPEND+=" graphite? ( >=dev-libs/isl-0.14:0= )"
elif tc_version_is_at_least 4.8 ; then
@@ -212,7 +221,7 @@ DEPEND="${RDEPEND}
>=sys-devel/autogen-5.5.4
)"
-if in_iuse gcj ; then
+if tc_has_feature gcj ; then
GCJ_DEPS=">=media-libs/libart_lgpl-2.1"
GCJ_GTK_DEPS="
x11-base/xorg-proto
@@ -227,7 +236,7 @@ if in_iuse gcj ; then
DEPEND+=" gcj? ( awt? ( ${GCJ_GTK_DEPS} ) ${GCJ_DEPS} )"
fi
-if in_iuse systemtap ; then
+if tc_has_feature systemtap ; then
# gcc needs sys/sdt.h headers on target
DEPEND+=" systemtap? ( dev-util/systemtap )"
fi
@@ -380,7 +389,7 @@ get_gcc_src_uri() {
[[ -n ${D_VER} ]] && \
GCC_SRC_URI+=" d? ( mirror://sourceforge/dgcc/gdc-${D_VER}-src.tar.bz2 )"
- if in_iuse gcj ; then
+ if tc_has_feature gcj ; then
if tc_version_is_at_least 4.5 ; then
GCC_SRC_URI+=" gcj? ( ftp://sourceware.org/pub/java/ecj-4.5.jar )"
elif tc_version_is_at_least 4.3 ; then
@@ -526,7 +535,12 @@ toolchain_src_prepare() {
do_gcc_HTB_patches
do_gcc_PIE_patches
do_gcc_CYGWINPORTS_patches
- epatch_user
+
+ case ${EAPI:-0} in
+ 5*) epatch_user;;
+ 6) eapply_user ;;
+ *) die "Update toolchain_src_prepare() for ${EAPI}." ;;
+ esac
if ( tc_version_is_at_least 4.8.2 || use_if_iuse hardened ) && ! use vanilla ; then
make_gcc_hard
@@ -1731,7 +1745,8 @@ gcc_do_make() {
toolchain_src_test() {
if use ${GCC_EBUILD_TEST_FLAG} ; then
cd "${WORKDIR}"/build
- emake -k check
+ # enable verbose test run and result logging
+ emake -k check RUNTESTFLAGS='-a -v'
fi
}
diff --git a/eclass/user.eclass b/eclass/user.eclass
index 97e417a7be9d..f6a10a6bee28 100644
--- a/eclass/user.eclass
+++ b/eclass/user.eclass
@@ -88,8 +88,8 @@ egetent() {
grep "${key}:\*:" /etc/${db}
;;
*)
- # ignore output if nscd doesn't exist, or we're not running as root
- nscd -i "${db}" 2>/dev/null
+ # ignore nscd output if we're not running as root
+ type -p nscd >/dev/null && nscd -i "${db}" 2>/dev/null
getent "${db}" "${key}"
;;
esac
diff --git a/eclass/vala.eclass b/eclass/vala.eclass
index 7ce2a5e681fd..1f92a7cc17c7 100644
--- a/eclass/vala.eclass
+++ b/eclass/vala.eclass
@@ -53,7 +53,8 @@ vala_api_versions() {
minimal_supported_minor_version="32"
for ((minor_version = ${VALA_MAX_API_VERSION#*.}; minor_version >= ${VALA_MIN_API_VERSION#*.}; minor_version = minor_version - 2)); do
- if ((minor_version >= minimal_supported_minor_version)); then
+ # 0.38 was never in main tree; remove the special case once minimal_supported_minor_version >= 40
+ if ((minor_version >= minimal_supported_minor_version)) && ((minor_version != 38)); then
echo "0.${minor_version}"
fi
done
diff --git a/eclass/webapp.eclass b/eclass/webapp.eclass
index 8983af334ab8..e11835735cac 100644
--- a/eclass/webapp.eclass
+++ b/eclass/webapp.eclass
@@ -42,9 +42,9 @@ IS_REPLACE=0
INSTALL_CHECK_FILE="installed_by_webapp_eclass"
SETUP_CHECK_FILE="setup_by_webapp_eclass"
-ETC_CONFIG="${ROOT}etc/vhosts/webapp-config"
-WEBAPP_CONFIG="${ROOT}usr/sbin/webapp-config"
-WEBAPP_CLEANER="${ROOT}usr/sbin/webapp-cleaner"
+ETC_CONFIG="${ROOT%/}/etc/vhosts/webapp-config"
+WEBAPP_CONFIG="${ROOT%/}/usr/sbin/webapp-config"
+WEBAPP_CLEANER="${ROOT%/}/usr/sbin/webapp-cleaner"
# ==============================================================================
# INTERNAL FUNCTIONS
@@ -365,7 +365,7 @@ webapp_src_preinst() {
# @DESCRIPTION:
# The default pkg_setup() for this eclass. This will gather required variables
# from webapp-config and check if there is an application installed to
-# `${ROOT}/var/www/localhost/htdocs/${PN}/' if USE=vhosts is not set.
+# `${ROOT%/}/var/www/localhost/htdocs/${PN}/' if USE=vhosts is not set.
#
# You need to call this function BEFORE anything else has run in your custom
# pkg_setup().
@@ -389,7 +389,7 @@ webapp_pkg_setup() {
G_HOSTNAME="localhost"
webapp_read_config
- local my_dir="${ROOT}${VHOST_ROOT}/${MY_HTDOCSBASE}/${PN}"
+ local my_dir="${ROOT%/}/${VHOST_ROOT}/${MY_HTDOCSBASE}/${PN}"
# if USE=vhosts is enabled OR no application is installed we're done here
if ! has vhosts ${IUSE} || use vhosts || [[ ! -d "${my_dir}" ]]; then
@@ -453,7 +453,7 @@ webapp_src_install() {
# @FUNCTION: webapp_pkg_postinst
# @DESCRIPTION:
# The default pkg_postinst() for this eclass. This installs the web application to
-# `${ROOT}/var/www/localhost/htdocs/${PN}/' if USE=vhosts is not set. Otherwise
+# `${ROOT%/}/var/www/localhost/htdocs/${PN}/' if USE=vhosts is not set. Otherwise
# display a short notice how to install this application with webapp-config.
#
# You need to call this function AFTER everything else has run in your custom
@@ -464,7 +464,7 @@ webapp_pkg_postinst() {
webapp_read_config
# sanity checks, to catch bugs in the ebuild
- if [[ ! -f "${ROOT}${MY_APPDIR}/${INSTALL_CHECK_FILE}" ]]; then
+ if [[ ! -f "${ROOT%/}/${MY_APPDIR}/${INSTALL_CHECK_FILE}" ]]; then
eerror
eerror "This ebuild did not call webapp_src_install() at the end"
eerror "of the src_install() function"
diff --git a/eclass/xorg-2.eclass b/eclass/xorg-2.eclass
index 4ed65e676a01..416a3ae30ec0 100644
--- a/eclass/xorg-2.eclass
+++ b/eclass/xorg-2.eclass
@@ -7,7 +7,7 @@
# @AUTHOR:
# Author: Tomáš Chvátal <scarabeus@gentoo.org>
# Author: Donnie Berkholz <dberkholz@gentoo.org>
-# @SUPPORTED_EAPIS: 3 4 5
+# @SUPPORTED_EAPIS: 4 5
# @BLURB: Reduces code duplication in the modularized X11 ebuilds.
# @DESCRIPTION:
# This eclass makes trivial X ebuilds possible for apps, fonts, drivers,
@@ -53,7 +53,7 @@ fi
EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm"
case "${EAPI:-0}" in
- 3|4|5) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;;
+ 4|5) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
@@ -80,7 +80,8 @@ HOMEPAGE="https://www.x.org/wiki/ https://cgit.freedesktop.org/"
# The subdirectory to download source from. Possible settings are app,
# doc, data, util, driver, font, lib, proto, xserver. Set above the
# inherit to override the default autoconfigured module.
-if [[ -z ${XORG_MODULE} ]]; then
+: ${XORG_MODULE:="auto"}
+if [[ ${XORG_MODULE} == auto ]]; then
case ${CATEGORY} in
app-doc) XORG_MODULE=doc/ ;;
media-fonts) XORG_MODULE=font/ ;;
@@ -236,7 +237,7 @@ fi
DOC_DEPEND="
doc? (
- app-text/asciidoc
+ || ( app-text/asciidoc dev-ruby/asciidoctor )
app-text/xmlto
app-doc/doxygen
app-text/docbook-xml-dtd:4.1.2
@@ -257,21 +258,9 @@ case ${XORG_DOC} in
esac
unset DOC_DEPEND
-# @ECLASS-VARIABLE: XORG_MODULE_REBUILD
-# @DESCRIPTION:
-# Describes whether a package contains modules that need to be rebuilt on
-# xorg-server upgrade. This has an effect only since EAPI=5.
-# Possible values are "yes" or "no". Default value is "yes" for packages which
-# are recognized as DRIVER by this eclass and "no" for all other packages.
-if [[ "${DRIVER}" == yes ]]; then
- : ${XORG_MODULE_REBUILD:="yes"}
-else
- : ${XORG_MODULE_REBUILD:="no"}
-fi
-
-if [[ ${XORG_MODULE_REBUILD} == yes ]]; then
+if [[ ${DRIVER} == yes ]]; then
case ${EAPI} in
- 3|4)
+ 4)
;;
*)
RDEPEND+=" x11-base/xorg-server:="
@@ -500,7 +489,7 @@ xorg-2_src_install() {
fi
# Don't install libtool archives (even for modules)
- prune_libtool_files --all
+ find "${D}" -type f -name '*.la' -delete || die
[[ -n ${FONT} ]] && remove_font_metadata
}
@@ -530,7 +519,7 @@ xorg-2_pkg_postrm() {
if [[ -n ${FONT} ]]; then
# if we're doing an upgrade, postinst will do
- if [[ ${EAPI} -lt 4 || -z ${REPLACED_BY_VERSION} ]]; then
+ if [[ -z ${REPLACED_BY_VERSION} ]]; then
create_fonts_scale
create_fonts_dir
font_pkg_postrm "$@"
diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass
new file mode 100644
index 000000000000..4577767a77b1
--- /dev/null
+++ b/eclass/xorg-3.eclass
@@ -0,0 +1,372 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: xorg-3.eclass
+# @MAINTAINER:
+# x11@gentoo.org
+# @AUTHOR:
+# Author: Tomáš Chvátal <scarabeus@gentoo.org>
+# Author: Donnie Berkholz <dberkholz@gentoo.org>
+# Author: Matt Turner <mattst88@gentoo.org>
+# @SUPPORTED_EAPIS: 7
+# @BLURB: Reduces code duplication in the modularized X11 ebuilds.
+# @DESCRIPTION:
+# This eclass makes trivial X ebuilds possible for apps, drivers,
+# and more. Many things that would normally be done in various functions
+# can be accessed by setting variables instead, such as patching,
+# running eautoreconf, passing options to configure and installing docs.
+#
+# All you need to do in a basic ebuild is inherit this eclass and set
+# DESCRIPTION, KEYWORDS and RDEPEND/DEPEND. If your package is hosted
+# with the other X packages, you don't need to set SRC_URI. Pretty much
+# everything else should be automatic.
+
+GIT_ECLASS=""
+if [[ ${PV} == *9999* ]]; then
+ GIT_ECLASS="git-r3"
+ XORG_EAUTORECONF="yes"
+fi
+
+# @ECLASS-VARIABLE: XORG_MULTILIB
+# @DESCRIPTION:
+# If set to 'yes', the multilib support for package will be enabled. Set
+# before inheriting this eclass.
+: ${XORG_MULTILIB:="no"}
+
+# we need to inherit autotools first to get the deps
+inherit autotools eutils libtool multilib toolchain-funcs \
+ flag-o-matic ${GIT_ECLASS}
+
+if [[ ${XORG_MULTILIB} == yes ]]; then
+ inherit multilib-minimal
+fi
+
+EXPORTED_FUNCTIONS="src_prepare src_configure src_unpack src_compile src_install"
+case "${EAPI:-0}" in
+ 7) ;;
+ *) die "EAPI=${EAPI} is not supported" ;;
+esac
+
+# exports must be ALWAYS after inherit
+EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
+
+IUSE=""
+HOMEPAGE="https://www.x.org/wiki/ https://cgit.freedesktop.org/"
+
+# @ECLASS-VARIABLE: XORG_EAUTORECONF
+# @DESCRIPTION:
+# If set to 'yes' and configure.ac exists, eautoreconf will run. Set
+# before inheriting this eclass.
+: ${XORG_EAUTORECONF:="no"}
+
+# @ECLASS-VARIABLE: XORG_BASE_INDIVIDUAL_URI
+# @DESCRIPTION:
+# Set up SRC_URI for individual modular releases. If set to an empty
+# string, no SRC_URI will be provided by the eclass.
+: ${XORG_BASE_INDIVIDUAL_URI="https://www.x.org/releases/individual"}
+
+# @ECLASS-VARIABLE: XORG_MODULE
+# @DESCRIPTION:
+# The subdirectory to download source from. Possible settings are app,
+# doc, data, util, driver, lib, proto, xserver. Set above the
+# inherit to override the default autoconfigured module.
+: ${XORG_MODULE:="auto"}
+if [[ ${XORG_MODULE} == auto ]]; then
+ case ${CATEGORY} in
+ app-doc) XORG_MODULE=doc/ ;;
+ x11-apps|x11-wm) XORG_MODULE=app/ ;;
+ x11-misc|x11-themes) XORG_MODULE=util/ ;;
+ x11-base) XORG_MODULE=xserver/ ;;
+ x11-drivers) XORG_MODULE=driver/ ;;
+ x11-libs) XORG_MODULE=lib/ ;;
+ *) XORG_MODULE= ;;
+ esac
+fi
+
+# @ECLASS-VARIABLE: XORG_PACKAGE_NAME
+# @DESCRIPTION:
+# For git checkout the git repository might differ from package name.
+# This variable can be used for proper directory specification
+: ${XORG_PACKAGE_NAME:=${PN}}
+
+if [[ -n ${GIT_ECLASS} ]]; then
+ : ${EGIT_REPO_URI:="https://anongit.freedesktop.org/git/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}.git"}
+elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then
+ SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.bz2"
+fi
+
+: ${SLOT:=0}
+
+# Set the license for the package. This can be overridden by setting
+# LICENSE after the inherit. Nearly all FreeDesktop-hosted X packages
+# are under the MIT license. (This is what Red Hat does in their rpms)
+: ${LICENSE:=MIT}
+
+# Set up autotools shared dependencies
+# Remember that all versions here MUST be stable
+XORG_EAUTORECONF_ARCHES="ppc-aix x86-winnt"
+EAUTORECONF_DEPEND+="
+ >=sys-devel/libtool-2.2.6a
+ sys-devel/m4"
+if [[ ${PN} != util-macros ]] ; then
+ EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.18 >=media-fonts/font-util-1.2.0"
+fi
+WANT_AUTOCONF="latest"
+WANT_AUTOMAKE="latest"
+for arch in ${XORG_EAUTORECONF_ARCHES}; do
+ EAUTORECONF_DEPENDS+=" ${arch}? ( ${EAUTORECONF_DEPEND} )"
+done
+DEPEND+=" ${EAUTORECONF_DEPENDS}"
+[[ ${XORG_EAUTORECONF} != no ]] && BDEPEND+=" ${EAUTORECONF_DEPEND}"
+unset EAUTORECONF_DEPENDS
+unset EAUTORECONF_DEPEND
+
+# @ECLASS-VARIABLE: XORG_STATIC
+# @DESCRIPTION:
+# Enables static-libs useflag. Set to no, if your package gets:
+#
+# QA: configure: WARNING: unrecognized options: --disable-static
+: ${XORG_STATIC:="yes"}
+
+# Add static-libs useflag where useful.
+if [[ ${XORG_STATIC} == yes \
+ && ${CATEGORY} != app-doc \
+ && ${CATEGORY} != x11-apps \
+ && ${CATEGORY} != x11-drivers \
+ && ${PN} != util-macros \
+ && ${PN} != xbitmaps \
+ && ${PN} != xorg-cf-files \
+ && ${PN/xcursor} = ${PN} ]]; then
+ IUSE+=" static-libs"
+fi
+
+DEPEND+=" virtual/pkgconfig"
+
+# @ECLASS-VARIABLE: XORG_DRI
+# @DESCRIPTION:
+# Possible values are "always" or the value of the useflag DRI capabilities
+# are required for. Default value is "no"
+#
+# Eg. XORG_DRI="opengl" will pull all dri dependent deps for opengl useflag
+: ${XORG_DRI:="no"}
+
+DRI_COMMON_DEPEND="
+ x11-base/xorg-server[-minimal]
+ x11-libs/libdrm
+"
+case ${XORG_DRI} in
+ no)
+ ;;
+ always)
+ COMMON_DEPEND+=" ${DRI_COMMON_DEPEND}"
+ ;;
+ *)
+ COMMON_DEPEND+=" ${XORG_DRI}? ( ${DRI_COMMON_DEPEND} )"
+ IUSE+=" ${XORG_DRI}"
+ ;;
+esac
+unset DRI_COMMON_DEPEND
+
+if [[ ${PN} == xf86-video-* || ${PN} == xf86-input-* ]]; then
+ DEPEND+=" x11-base/xorg-proto"
+ RDEPEND+=" x11-base/xorg-server:="
+ COMMON_DEPEND+=" >=x11-base/xorg-server-1.20[xorg]"
+ [[ ${PN} == xf86-video-* ]] && COMMON_DEPEND+=" >=x11-libs/libpciaccess-0.14"
+fi
+
+
+# @ECLASS-VARIABLE: XORG_DOC
+# @DESCRIPTION:
+# Possible values are "always" or the value of the useflag doc packages
+# are required for. Default value is "no"
+#
+# Eg. XORG_DOC="manual" will pull all doc dependent deps for manual useflag
+: ${XORG_DOC:="no"}
+
+DOC_DEPEND="
+ doc? (
+ || ( app-text/asciidoc dev-ruby/asciidoctor )
+ app-text/xmlto
+ app-doc/doxygen
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.3
+ )
+"
+case ${XORG_DOC} in
+ no)
+ ;;
+ always)
+ BDEPEND+=" ${DOC_DEPEND}"
+ ;;
+ *)
+ BDEPEND+=" ${XORG_DOC}? ( ${DOC_DEPEND} )"
+ IUSE+=" ${XORG_DOC}"
+ ;;
+esac
+unset DOC_DEPEND
+
+DEPEND+=" ${COMMON_DEPEND}"
+RDEPEND+=" ${COMMON_DEPEND}"
+unset COMMON_DEPEND
+
+debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND=${DEPEND}"
+debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND=${RDEPEND}"
+debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: PDEPEND=${PDEPEND}"
+debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: BDEPEND=${BDEPEND}"
+
+# @FUNCTION: xorg-3_src_unpack
+# @DESCRIPTION:
+# Simply unpack source code.
+xorg-3_src_unpack() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ if [[ -n ${GIT_ECLASS} ]]; then
+ git-r3_src_unpack
+ else
+ unpack ${A}
+ fi
+}
+
+# @FUNCTION: xorg-3_reconf_source
+# @DESCRIPTION:
+# Run eautoreconf if necessary, and run elibtoolize.
+xorg-3_reconf_source() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ case ${CHOST} in
+ *-aix* | *-winnt*)
+ # some hosts need full eautoreconf
+ [[ -e "./configure.ac" || -e "./configure.in" ]] \
+ && XORG_EAUTORECONF=yes
+ ;;
+ *)
+ # elibtoolize required for BSD
+ [[ ${XORG_EAUTORECONF} != no && ( -e "./configure.ac" || -e "./configure.in" ) ]] \
+ && XORG_EAUTORECONF=yes
+ ;;
+ esac
+
+ [[ ${XORG_EAUTORECONF} != no ]] && eautoreconf
+ elibtoolize --patch-only
+}
+
+# @FUNCTION: xorg-3_src_prepare
+# @DESCRIPTION:
+# Prepare a package after unpacking, performing all X-related tasks.
+xorg-3_src_prepare() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ default
+ xorg-3_reconf_source
+}
+
+# @FUNCTION: xorg-3_flags_setup
+# @DESCRIPTION:
+# Set up CFLAGS for a debug build
+xorg-3_flags_setup() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ # Win32 require special define
+ [[ ${CHOST} == *-winnt* ]] && append-cppflags -DWIN32 -D__STDC__
+ # hardened ldflags
+ [[ ${PN} == xorg-server || ${PN} == xf86-video-* || ${PN} == xf86-input-* ]] \
+ && append-ldflags -Wl,-z,lazy
+
+ # Quite few libraries fail on runtime without these:
+ if has static-libs ${IUSE//+}; then
+ filter-flags -Wl,-Bdirect
+ filter-ldflags -Bdirect
+ filter-ldflags -Wl,-Bdirect
+ fi
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" econf "${econfargs[@]}"
+}
+
+# @FUNCTION: xorg-3_src_configure
+# @DESCRIPTION:
+# Perform any necessary pre-configuration steps, then run configure
+xorg-3_src_configure() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ xorg-3_flags_setup
+
+ # @VARIABLE: XORG_CONFIGURE_OPTIONS
+ # @DESCRIPTION:
+ # Array of an additional options to pass to configure.
+ # @DEFAULT_UNSET
+ local xorgconfadd=("${XORG_CONFIGURE_OPTIONS[@]}")
+
+ # Check if package supports disabling of dep tracking
+ # Fixes warnings like:
+ # WARNING: unrecognized options: --disable-dependency-tracking
+ if grep -q -s "disable-depencency-tracking" ${ECONF_SOURCE:-.}/configure; then
+ local dep_track="--disable-dependency-tracking"
+ fi
+
+ # Check if package supports disabling of selective -Werror=...
+ if grep -q -s "disable-selective-werror" ${ECONF_SOURCE:-.}/configure; then
+ local selective_werror="--disable-selective-werror"
+ fi
+
+ local econfargs=(
+ ${dep_track}
+ ${selective_werror}
+ "${xorgconfadd[@]}"
+ )
+
+ # Handle static-libs found in IUSE, disable them by default
+ if in_iuse static-libs; then
+ econfargs+=(
+ --enable-shared
+ $(use_enable static-libs static)
+ )
+ fi
+
+ if [[ ${XORG_MULTILIB} == yes ]]; then
+ multilib-minimal_src_configure "$@"
+ else
+ econf "${econfargs[@]}" "$@"
+ fi
+}
+
+multilib_src_compile() {
+ emake "$@" || die 'emake failed'
+}
+
+# @FUNCTION: xorg-3_src_compile
+# @DESCRIPTION:
+# Compile a package, performing all X-related tasks.
+xorg-3_src_compile() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ if [[ ${XORG_MULTILIB} == yes ]]; then
+ multilib-minimal_src_compile "$@"
+ else
+ emake "$@" || die 'emake failed'
+ fi
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" "${install_args[@]}" "$@" install || die "emake install failed"
+}
+
+# @FUNCTION: xorg-3_src_install
+# @DESCRIPTION:
+# Install a built package to ${D}, performing any necessary steps.
+xorg-3_src_install() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ local install_args=( docdir="${EPREFIX}/usr/share/doc/${PF}" )
+
+ if [[ ${XORG_MULTILIB} == yes ]]; then
+ multilib-minimal_src_install "$@"
+ else
+ emake DESTDIR="${D}" "${install_args[@]}" "$@" install || die "emake install failed"
+ fi
+
+ # Don't install libtool archives (even for modules)
+ find "${D}" -type f -name '*.la' -delete || die
+}