summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-01-31 20:30:04 +0000
committerV3n3RiX <venerix@redcorelinux.org>2018-01-31 20:30:04 +0000
commit4650985dd0e898b82e0d2ec225931297d4fadccf (patch)
treeeb0e8002cf3ebf1009110b6fec47fa90f873d824 /eclass
parent67f76a858f1ac826bd8a550d756d9ec6e340ed4f (diff)
gentoo resync : 31.01.2018
Diffstat (limited to 'eclass')
-rw-r--r--eclass/Manifest.gzbin41335 -> 41331 bytes
-rw-r--r--eclass/eutils.eclass109
-rw-r--r--eclass/mozconfig-v6.58.eclass395
-rw-r--r--eclass/mozcoreconf-v4.eclass3
-rw-r--r--eclass/mozcoreconf-v5.eclass3
-rw-r--r--eclass/pax-utils.eclass2
-rw-r--r--eclass/php-ext-source-r3.eclass36
-rw-r--r--eclass/ruby-utils.eclass4
-rw-r--r--eclass/systemd.eclass6
-rw-r--r--eclass/x-modular.eclass622
10 files changed, 444 insertions, 736 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz
index 93d2dbcb0463..8e23f833a7a2 100644
--- a/eclass/Manifest.gz
+++ b/eclass/Manifest.gz
Binary files differ
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index 63f73db290f4..8bbd561015ad 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -164,98 +164,6 @@ strip-linguas() {
export LINGUAS=${newls:1}
}
-# @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() {
- 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
-
- has "${EAPI:-0}" 0 1 2 && local EROOT=${ROOT}
- 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:
@@ -454,12 +362,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.
+# installed. The files must exist, otherwise the function will fail.
+# 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.
@@ -516,10 +426,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}()"
diff --git a/eclass/mozconfig-v6.58.eclass b/eclass/mozconfig-v6.58.eclass
new file mode 100644
index 000000000000..c0a337e6b119
--- /dev/null
+++ b/eclass/mozconfig-v6.58.eclass
@@ -0,0 +1,395 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+#
+# @ECLASS: mozconfig-v6.58.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 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
+# 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.34:0=[apng]
+ >=media-libs/mesa-10.2:*
+ media-libs/fontconfig
+ >=media-libs/freetype-2.4.10
+ kernel_linux? ( !pulseaudio? ( media-libs/alsa-lib ) )
+ 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
+ virtual/ffmpeg
+ x11-libs/libX11
+ x11-libs/libXcomposite
+ x11-libs/libXdamage
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXrender
+ x11-libs/libXt
+ 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.20.1:3[secure-delete,debug=] )
+ system-libvpx? ( >=media-libs/libvpx-1.5.0:0=[postproc] )
+ system-harfbuzz? ( >=media-libs/harfbuzz-1.4.2: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 )
+ || (
+ ( >=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+="
+ 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
+
+ # 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
+ 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-crashreporter
+ mozconfig_annotate 'Gentoo default' --with-system-png
+ mozconfig_annotate '' --enable-system-ffi
+ 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}
+
+ # 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
+
+ # For testing purpose only
+ mozconfig_annotate 'Sandbox' --enable-content-sandbox
+
+ 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
+}
diff --git a/eclass/mozcoreconf-v4.eclass b/eclass/mozcoreconf-v4.eclass
index 557a780eb950..eef1b5e7da70 100644
--- a/eclass/mozcoreconf-v4.eclass
+++ b/eclass/mozcoreconf-v4.eclass
@@ -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
diff --git a/eclass/mozcoreconf-v5.eclass b/eclass/mozcoreconf-v5.eclass
index 02ade3994bf2..ab8440b94273 100644
--- a/eclass/mozcoreconf-v5.eclass
+++ b/eclass/mozcoreconf-v5.eclass
@@ -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
diff --git a/eclass/pax-utils.eclass b/eclass/pax-utils.eclass
index ca8f15d9c919..ac64ee35fedb 100644
--- a/eclass/pax-utils.eclass
+++ b/eclass/pax-utils.eclass
@@ -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
diff --git a/eclass/php-ext-source-r3.eclass b/eclass/php-ext-source-r3.eclass
index bc6751562a54..96d55f97a553 100644
--- a/eclass/php-ext-source-r3.eclass
+++ b/eclass/php-ext-source-r3.eclass
@@ -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
@@ -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
@@ -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}"
diff --git a/eclass/ruby-utils.eclass b/eclass/ruby-utils.eclass
index 4be437672d08..2ecef93d3172 100644
--- a/eclass/ruby-utils.eclass
+++ b/eclass/ruby-utils.eclass
@@ -28,10 +28,10 @@ if [[ ! ${_RUBY_UTILS} ]]; then
# provide for a better first installation experience.
# All RUBY_TARGETS
-RUBY_TARGETS_PREFERENCE="ruby22 "
+RUBY_TARGETS_PREFERENCE="ruby23 ruby22 "
# All other active ruby targets
-RUBY_TARGETS_PREFERENCE+="ruby23 ruby24 ruby25"
+RUBY_TARGETS_PREFERENCE+="ruby24 ruby25"
_ruby_implementation_depend() {
diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index b86646052bef..6dda4353064a 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -58,7 +58,7 @@ _systemd_get_dir() {
# @DESCRIPTION:
# Get unprefixed unitdir.
_systemd_get_systemunitdir() {
- _systemd_get_dir systemdsystemunitdir /usr/lib/systemd/system
+ _systemd_get_dir systemdsystemunitdir /lib/systemd/system
}
# @FUNCTION: systemd_get_systemunitdir
@@ -107,7 +107,7 @@ systemd_get_userunitdir() {
# @DESCRIPTION:
# Get unprefixed utildir.
_systemd_get_utildir() {
- _systemd_get_dir systemdutildir /usr/lib/systemd
+ _systemd_get_dir systemdutildir /lib/systemd
}
# @FUNCTION: systemd_get_utildir
@@ -127,7 +127,7 @@ systemd_get_utildir() {
# @DESCRIPTION:
# Get unprefixed systemgeneratordir.
_systemd_get_systemgeneratordir() {
- _systemd_get_dir systemdsystemgeneratordir /usr/lib/systemd/system-generators
+ _systemd_get_dir systemdsystemgeneratordir /lib/systemd/system-generators
}
# @FUNCTION: systemd_get_systemgeneratordir
diff --git a/eclass/x-modular.eclass b/eclass/x-modular.eclass
deleted file mode 100644
index 7c5ea3fbd90c..000000000000
--- a/eclass/x-modular.eclass
+++ /dev/null
@@ -1,622 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-# @DEAD
-# Removal on 2018-02-01.
-#
-# DEPRECATED
-# This eclass has been superseded by xorg-2
-# Please modify your ebuilds to use that instead
-#
-# @ECLASS: x-modular.eclass
-# @MAINTAINER:
-# x11@gentoo.org
-# @BLURB: Reduces code duplication in the modularized X11 ebuilds.
-# @DESCRIPTION:
-# This eclass makes trivial X ebuilds possible for apps, fonts, 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.
-
-if [[ ${PV} = 9999* ]]; then
- GIT_ECLASS="git"
- SNAPSHOT="yes"
- SRC_URI=""
-fi
-
-# If we're a font package, but not the font.alias one
-FONT_ECLASS=""
-if [[ "${PN/#font-}" != "${PN}" ]] \
- && [[ "${CATEGORY}" = "media-fonts" ]] \
- && [[ "${PN}" != "font-alias" ]] \
- && [[ "${PN}" != "font-util" ]]; then
- # Activate font code in the rest of the eclass
- FONT="yes"
-
- # Whether to inherit the font eclass
- FONT_ECLASS="font"
-fi
-
-inherit eutils libtool multilib toolchain-funcs flag-o-matic autotools \
- ${FONT_ECLASS} ${GIT_ECLASS}
-
-EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm"
-
-case "${EAPI:-0}" in
- 0|1)
- ;;
- 2)
- EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure"
- ;;
- *)
- die "Unknown EAPI ${EAPI}"
- ;;
-esac
-
-# exports must be ALWAYS after inherit
-EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
-
-# @ECLASS-VARIABLE: XDIR
-# @DESCRIPTION:
-# Directory prefix to use for everything. If you want to install to a
-# non-default prefix (e.g., /opt/xorg), change XDIR. This has not been
-# recently tested. You may need to uncomment the setting of datadir and
-# mandir in x-modular_src_install() or add it back in if it's no longer
-# there. You may also want to change the SLOT.
-XDIR="/usr"
-
-IUSE=""
-HOMEPAGE="https://www.x.org/wiki/"
-
-# @ECLASS-VARIABLE: SNAPSHOT
-# @DESCRIPTION:
-# If set to 'yes' and configure.ac exists, eautoreconf will run. Set
-# before inheriting this eclass.
-: ${SNAPSHOT:=no}
-
-# Set up SRC_URI for individual modular releases
-BASE_INDIVIDUAL_URI="https://www.x.org/releases/individual"
-# @ECLASS-VARIABLE: MODULE
-# @DESCRIPTION:
-# 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 ${MODULE} ]]; then
- case ${CATEGORY} in
- app-doc) MODULE="doc" ;;
- media-fonts) MODULE="font" ;;
- x11-apps|x11-wm) MODULE="app" ;;
- x11-misc|x11-themes) MODULE="util" ;;
- x11-drivers) MODULE="driver" ;;
- x11-base) MODULE="xserver" ;;
- x11-proto) MODULE="proto" ;;
- x11-libs) MODULE="lib" ;;
- esac
-fi
-
-if [[ -n ${GIT_ECLASS} ]]; then
- EGIT_REPO_URI="https://anongit.freedesktop.org/git/xorg/${MODULE}/${PN}.git"
-else
- SRC_URI="${SRC_URI} ${BASE_INDIVIDUAL_URI}/${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 shared dependencies
-if [[ -n "${SNAPSHOT}" ]]; then
-# FIXME: What's the minimal libtool version supporting arbitrary versioning?
- DEPEND="${DEPEND}
- >=sys-devel/libtool-1.5
- >=sys-devel/m4-1.4"
- WANT_AUTOCONF="latest"
- WANT_AUTOMAKE="latest"
-fi
-
-if [[ -n "${FONT}" ]]; then
- RDEPEND="${RDEPEND}
- media-fonts/encodings
- x11-apps/mkfontscale
- x11-apps/mkfontdir"
- PDEPEND="${PDEPEND}
- media-fonts/font-alias"
-
- # Starting with 7.0RC3, we can specify the font directory
- # But oddly, we can't do the same for encodings or font-alias
-
-# @ECLASS-VARIABLE: FONT_DIR
-# @DESCRIPTION:
-# If you're creating a font package and the suffix of PN is not equal to
-# the subdirectory of /usr/share/fonts/ it should install into, set
-# FONT_DIR to that directory or directories. Set before inheriting this
-# eclass.
- : ${FONT_DIR:=${PN##*-}}
-
- # Fix case of font directories
- FONT_DIR=${FONT_DIR/ttf/TTF}
- FONT_DIR=${FONT_DIR/otf/OTF}
- FONT_DIR=${FONT_DIR/type1/Type1}
- FONT_DIR=${FONT_DIR/speedo/Speedo}
-
- # Set up configure options, wrapped so ebuilds can override if need be
- if [[ -z ${FONT_OPTIONS} ]]; then
- FONT_OPTIONS="--with-fontdir=\"/usr/share/fonts/${FONT_DIR}\""
- fi
-
- if [[ -n "${FONT}" ]]; then
- if [[ ${PN##*-} = misc ]] || [[ ${PN##*-} = 75dpi ]] || [[ ${PN##*-} = 100dpi ]] || [[ ${PN##*-} = cyrillic ]]; then
- IUSE="${IUSE} nls"
- fi
- fi
-fi
-
-# If we're a driver package
-if [[ "${PN/#xf86-video}" != "${PN}" ]] || [[ "${PN/#xf86-input}" != "${PN}" ]]; then
- # Enable driver code in the rest of the eclass
- DRIVER="yes"
-fi
-
-# Debugging -- ignore packages that can't be built with debugging
-if [[ -z "${FONT}" ]] \
- && [[ "${CATEGORY/app-doc}" = "${CATEGORY}" ]] \
- && [[ "${CATEGORY/x11-proto}" = "${CATEGORY}" ]] \
- && [[ "${PN/util-macros}" = "${PN}" ]] \
- && [[ "${PN/xbitmaps}" = "${PN}" ]] \
- && [[ "${PN/xkbdata}" = "${PN}" ]] \
- && [[ "${PN/xorg-cf-files}" = "${PN}" ]] \
- && [[ "${PN/xcursor}" = "${PN}" ]] \
- ; then
- DEBUGGABLE="yes"
- IUSE="${IUSE} debug"
-fi
-
-DEPEND="${DEPEND}
- virtual/pkgconfig"
-
-if [[ "${PN/util-macros}" = "${PN}" ]]; then
- DEPEND="${DEPEND}
- >=x11-misc/util-macros-1.3.0"
-fi
-
-RDEPEND="${RDEPEND}
- !<=x11-base/xorg-x11-6.9"
-# Provides virtual/x11 for temporary use until packages are ported
-# x11-base/x11-env"
-
-# @FUNCTION: x-modular_specs_check
-# @USAGE:
-# @DESCRIPTION:
-# Make any necessary changes related to gcc specs (generally hardened)
-x-modular_specs_check() {
- if [[ ${PN:0:11} = "xorg-server" ]] || [[ -n "${DRIVER}" ]]; then
- append-ldflags -Wl,-z,lazy
- # (#116698) breaks loading
- filter-ldflags -Wl,-z,now
- fi
-}
-
-# @FUNCTION: x-modular_dri_check
-# @USAGE:
-# @DESCRIPTION:
-# Ensures the server supports DRI if building a driver with DRI support
-x-modular_dri_check() {
- # (#120057) Enabling DRI in drivers requires that the server was built with
- # support for it
- # Starting with xorg-server 1.5.3, DRI support is always enabled unless
- # USE=minimal is set (see bug #252084)
- if [[ -n "${DRIVER}" ]]; then
- if has dri ${IUSE} && use dri; then
- einfo "Checking for direct rendering capabilities ..."
- if has_version '>=x11-base/xorg-server-1.5.3'; then
- if built_with_use x11-base/xorg-server minimal; then
- die "You must build x11-base/xorg-server with USE=-minimal."
- fi
- else
- if ! built_with_use x11-base/xorg-server dri; then
- die "You must build x11-base/xorg-server with USE=dri."
- fi
- fi
- fi
- fi
-}
-
-# @FUNCTION: x-modular_server_supports_drivers_check
-# @USAGE:
-# @DESCRIPTION:
-# Ensures the server SDK is installed if a driver is being built
-x-modular_server_supports_drivers_check() {
- # (#135873) Only certain servers will actually use or be capable of
- # building external drivers, including binary drivers.
- if [[ -n "${DRIVER}" ]]; then
- if has_version '>=x11-base/xorg-server-1.1'; then
- if ! built_with_use x11-base/xorg-server xorg; then
- eerror "x11-base/xorg-server is not built with support for external drivers."
- die "You must build x11-base/xorg-server with USE=xorg."
- fi
- fi
- fi
-}
-
-# @FUNCTION: x-modular_unpack_source
-# @USAGE:
-# @DESCRIPTION:
-# Simply unpack source code. Nothing else.
-x-modular_unpack_source() {
- if [[ -n ${GIT_ECLASS} ]]; then
- git_src_unpack
- else
- unpack ${A}
- fi
- cd "${S}"
-
- if [[ -n ${FONT_OPTIONS} ]]; then
- einfo "Detected font directory: ${FONT_DIR}"
- fi
-}
-
-# @FUNCTION: x-modular_patch_source
-# @USAGE:
-# @DESCRIPTION:
-# Apply all patches
-x-modular_patch_source() {
- # Use standardized names and locations with bulk patching
- # Patch directory is ${WORKDIR}/patch
- # See epatch() in eutils.eclass for more documentation
- if [[ -z "${EPATCH_SUFFIX}" ]] ; then
- EPATCH_SUFFIX="patch"
- fi
-
-# @VARIABLE: PATCHES
-# @DESCRIPTION:
-# If you have any patches to apply, set PATCHES to their locations and epatch
-# will apply them. It also handles epatch-style bulk patches, if you know how to
-# use them and set the correct variables. If you don't, read eutils.eclass.
- if [[ ${#PATCHES[@]} -gt 1 ]]; then
- for x in "${PATCHES[@]}"; do
- epatch "${x}"
- done
- elif [[ -n "${PATCHES}" ]]; then
- for x in ${PATCHES}; do
- epatch "${x}"
- done
- # For non-default directory bulk patching
- elif [[ -n "${PATCH_LOC}" ]] ; then
- epatch ${PATCH_LOC}
- # For standard bulk patching
- elif [[ -d "${EPATCH_SOURCE}" ]] ; then
- epatch
- fi
-}
-
-# @FUNCTION: x-modular_reconf_source
-# @USAGE:
-# @DESCRIPTION:
-# Run eautoreconf if necessary, and run elibtoolize.
-x-modular_reconf_source() {
- if [[ "${SNAPSHOT}" = "yes" ]]
- then
- # If possible, generate configure if it doesn't exist
- if [ -f "./configure.ac" ]
- then
- eautoreconf
- fi
- fi
-
- # Joshua Baergen - October 23, 2005
- # Fix shared lib issues on MIPS, FBSD, etc etc
- elibtoolize
-}
-
-# @FUNCTION: x-modular_src_prepare
-# @USAGE:
-# @DESCRIPTION:
-# Prepare a package after unpacking, performing all X-related tasks.
-x-modular_src_prepare() {
- [[ -n ${GIT_ECLASS} ]] && has src_prepare ${EXPORTED_FUNCTIONS} \
- && git_src_prepare
- x-modular_patch_source
- x-modular_reconf_source
-}
-
-# @FUNCTION: x-modular_src_unpack
-# @USAGE:
-# @DESCRIPTION:
-# Unpack a package, performing all X-related tasks.
-x-modular_src_unpack() {
- x-modular_specs_check
- x-modular_server_supports_drivers_check
- x-modular_dri_check
- x-modular_unpack_source
- has src_prepare ${EXPORTED_FUNCTIONS} || x-modular_src_prepare
-}
-
-# @FUNCTION: x-modular_font_configure
-# @USAGE:
-# @DESCRIPTION:
-# If a font package, perform any necessary configuration steps
-x-modular_font_configure() {
- if [[ -n "${FONT}" ]]; then
- # Might be worth adding an option to configure your desired font
- # and exclude all others. Also, should this USE be nls or minimal?
- if has nls ${IUSE//+} && ! use nls; then
- FONT_OPTIONS="${FONT_OPTIONS}
- --disable-iso8859-2
- --disable-iso8859-3
- --disable-iso8859-4
- --disable-iso8859-5
- --disable-iso8859-6
- --disable-iso8859-7
- --disable-iso8859-8
- --disable-iso8859-9
- --disable-iso8859-10
- --disable-iso8859-11
- --disable-iso8859-12
- --disable-iso8859-13
- --disable-iso8859-14
- --disable-iso8859-15
- --disable-iso8859-16
- --disable-jisx0201
- --disable-koi8-r"
- fi
- fi
-}
-
-# @FUNCTION: x-modular_debug_setup
-# @USAGE:
-# @DESCRIPTION:
-# Set up CFLAGS for a debug build
-x-modular_debug_setup() {
- if [[ -n "${DEBUGGABLE}" ]]; then
- if use debug; then
- strip-flags
- append-flags -g
- fi
- fi
-}
-
-# @FUNCTION: x-modular_src_configure
-# @USAGE:
-# @DESCRIPTION:
-# Perform any necessary pre-configuration steps, then run configure
-x-modular_src_configure() {
- x-modular_font_configure
- x-modular_debug_setup
-
-# @VARIABLE: CONFIGURE_OPTIONS
-# @DESCRIPTION:
-# Any extra options to pass to configure
-
- # If prefix isn't set here, .pc files cause problems
- if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
- econf --prefix=${XDIR} \
- --datadir=${XDIR}/share \
- ${FONT_OPTIONS} \
- ${DRIVER_OPTIONS} \
- ${CONFIGURE_OPTIONS}
- fi
-}
-
-# @FUNCTION: x-modular_src_make
-# @USAGE:
-# @DESCRIPTION:
-# Run make.
-x-modular_src_make() {
- emake || die "emake failed"
-}
-
-# @FUNCTION: x-modular_src_compile
-# @USAGE:
-# @DESCRIPTION:
-# Compile a package, performing all X-related tasks.
-x-modular_src_compile() {
- has src_configure ${EXPORTED_FUNCTIONS} || x-modular_src_configure
- x-modular_src_make
-}
-
-# @FUNCTION: x-modular_src_install
-# @USAGE:
-# @DESCRIPTION:
-# Install a built package to ${D}, performing any necessary steps.
-# Creates a ChangeLog from git if using live ebuilds.
-x-modular_src_install() {
- # Install everything to ${XDIR}
- if [[ ${CATEGORY} = x11-proto ]]; then
- make \
- ${PN/proto/}docdir=/usr/share/doc/${PF} \
- DESTDIR="${D}" \
- install \
- || die
- else
- make \
- docdir=/usr/share/doc/${PF} \
- DESTDIR="${D}" \
- install \
- || die
- fi
-# Shouldn't be necessary in XDIR=/usr
-# einstall forces datadir, so we need to re-force it
-# datadir=${XDIR}/share \
-# mandir=${XDIR}/share/man \
-
- if [[ -n ${GIT_ECLASS} ]]; then
- pushd "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}"
- git log ${GIT_TREE} > "${S}"/ChangeLog
- popd
- fi
-
- if [[ -e ${S}/ChangeLog ]]; then
- dodoc "${S}"/ChangeLog
- fi
-# @VARIABLE: DOCS
-# @DESCRIPTION:
-# Any documentation to install via dodoc
- [[ -n ${DOCS} ]] && dodoc ${DOCS}
-
- # Don't install libtool archives for server modules
- if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then
- find "${D}"/usr/$(get_libdir)/xorg/modules -name '*.la' \
- | xargs rm -f
- fi
-
- if [[ -n "${FONT}" ]]; then
- remove_font_metadata
- fi
-
- if [[ -n "${DRIVER}" ]]; then
- install_driver_hwdata
- fi
-}
-
-# @FUNCTION: x-modular_pkg_preinst
-# @USAGE:
-# @DESCRIPTION:
-# This function doesn't do anything right now, but it may in the future.
-x-modular_pkg_preinst() {
- # We no longer do anything here, but we can't remove it from the API
- :
-}
-
-# @FUNCTION: x-modular_pkg_postinst
-# @USAGE:
-# @DESCRIPTION:
-# Run X-specific post-installation tasks on the live filesystem. The
-# only task right now is some setup for font packages.
-x-modular_pkg_postinst() {
- if [[ -n "${FONT}" ]]; then
- setup_fonts
- fi
-}
-
-# @FUNCTION: x-modular_pkg_postrm
-# @USAGE:
-# @DESCRIPTION:
-# Run X-specific post-removal tasks on the live filesystem. The only
-# task right now is some cleanup for font packages.
-x-modular_pkg_postrm() {
- if [[ -n "${FONT}" ]]; then
- font_pkg_postrm
- fi
-}
-
-# @FUNCTION: setup_fonts
-# @USAGE:
-# @DESCRIPTION:
-# Generates needed files for fonts and fixes font permissions
-setup_fonts() {
- if [[ ! -n "${FONT_DIR}" ]]; then
- msg="FONT_DIR is empty. The ebuild should set it to at least one subdir of /usr/share/fonts."
- eerror "${msg}"
- die "${msg}"
- fi
-
- create_fonts_scale
- create_fonts_dir
- create_font_cache
-}
-
-# @FUNCTION: remove_font_metadata
-# @USAGE:
-# @DESCRIPTION:
-# Don't let the package install generated font files that may overlap
-# with other packages. Instead, they're generated in pkg_postinst().
-remove_font_metadata() {
- local DIR
- for DIR in ${FONT_DIR}; do
- if [[ "${DIR}" != "Speedo" ]] && \
- [[ "${DIR}" != "CID" ]] ; then
- # Delete font metadata files
- # fonts.scale, fonts.dir, fonts.cache-1
- rm -f "${D}"/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1}
- fi
- done
-}
-
-# @FUNCTION: install_driver_hwdata
-# @USAGE:
-# @DESCRIPTION:
-# Installs device-to-driver mappings for system-config-display and
-# anything else that uses hwdata.
-install_driver_hwdata() {
- insinto /usr/share/hwdata/videoaliases
- for i in "${FILESDIR}"/*.xinf; do
- # We need this for the case when none exist,
- # so *.xinf doesn't expand
- if [[ -e $i ]]; then
- doins $i
- fi
- done
-}
-
-# @FUNCTION: discover_font_dirs
-# @USAGE:
-# @DESCRIPTION:
-# Deprecated. Sets up the now-unused FONT_DIRS variable.
-discover_font_dirs() {
- FONT_DIRS="${FONT_DIR}"
-}
-
-# @FUNCTION: create_fonts_scale
-# @USAGE:
-# @DESCRIPTION:
-# Create fonts.scale file, used by the old server-side fonts subsystem.
-create_fonts_scale() {
- ebegin "Creating fonts.scale files"
- local x
- for DIR in ${FONT_DIR}; do
- x=${ROOT}/usr/share/fonts/${DIR}
- [[ -z "$(ls ${x}/)" ]] && continue
- [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue
-
- # Only generate .scale files if truetype, opentype or type1
- # fonts are present ...
-
- # NOTE: There is no way to regenerate Speedo/CID fonts.scale
- # <dberkholz@gentoo.org> 2 August 2004
- if [[ "${x/encodings}" = "${x}" ]] \
- && [[ -n "$(find ${x} -iname '*.[pot][ft][abcf]' -print)" ]]; then
- mkfontscale \
- -a "${ROOT}"/usr/share/fonts/encodings/encodings.dir \
- -- ${x}
- fi
- done
- eend 0
-}
-
-# @FUNCTION: create_fonts_dir
-# @USAGE:
-# @DESCRIPTION:
-# Create fonts.dir file, used by the old server-side fonts subsystem.
-create_fonts_dir() {
- ebegin "Generating fonts.dir files"
- for DIR in ${FONT_DIR}; do
- x=${ROOT}/usr/share/fonts/${DIR}
- [[ -z "$(ls ${x}/)" ]] && continue
- [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue
-
- if [[ "${x/encodings}" = "${x}" ]]; then
- mkfontdir \
- -e "${ROOT}"/usr/share/fonts/encodings \
- -e "${ROOT}"/usr/share/fonts/encodings/large \
- -- ${x}
- fi
- done
- eend 0
-}
-
-# @FUNCTION: create_font_cache
-# @USAGE:
-# @DESCRIPTION:
-# Create fonts.cache-1 files, used by the new client-side fonts
-# subsystem.
-create_font_cache() {
- font_pkg_postinst
-}