summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
commit3cf7c3ef441822c889356fd1812ebf2944a59851 (patch)
treec513fe68548b40365c1c2ebfe35c58ad431cdd77 /eclass
parent05b8b0e0af1d72e51a3ee61522941bf7605cd01c (diff)
gentoo resync : 25.08.2020
Diffstat (limited to 'eclass')
-rw-r--r--eclass/Manifest.gzbin36120 -> 35934 bytes
-rw-r--r--eclass/cmake-utils.eclass6
-rw-r--r--eclass/cmake.eclass6
-rw-r--r--eclass/cuda.eclass4
-rw-r--r--eclass/distutils-r1.eclass6
-rw-r--r--eclass/ecm.eclass1
-rw-r--r--eclass/elisp-common.eclass42
-rw-r--r--eclass/emboss-r2.eclass3
-rw-r--r--eclass/flag-o-matic.eclass9
-rw-r--r--eclass/fortran-2.eclass1
-rw-r--r--eclass/kde.org.eclass2
-rw-r--r--eclass/kernel-build.eclass5
-rw-r--r--eclass/kernel-install.eclass11
-rw-r--r--eclass/linux-mod.eclass2
-rw-r--r--eclass/llvm.eclass2
-rw-r--r--eclass/llvm.org.eclass2
-rw-r--r--eclass/mate.eclass15
-rw-r--r--eclass/meson.eclass17
-rw-r--r--eclass/netsurf.eclass177
-rw-r--r--eclass/nvidia-driver.eclass2
-rw-r--r--eclass/php-ext-source-r2.eclass379
-rw-r--r--eclass/python-r1.eclass6
-rw-r--r--eclass/python-single-r1.eclass4
-rw-r--r--eclass/python-utils-r1.eclass34
-rw-r--r--eclass/ros-catkin.eclass91
-rw-r--r--eclass/ruby-fakegem.eclass6
-rw-r--r--eclass/ruby-ng-gnome2.eclass105
-rw-r--r--eclass/ruby-ng.eclass2
-rw-r--r--eclass/ruby-utils.eclass4
-rw-r--r--eclass/sword-module.eclass94
-rw-r--r--eclass/texlive-common.eclass1
-rw-r--r--eclass/toolchain.eclass201
-rw-r--r--eclass/vala.eclass2
-rw-r--r--eclass/xorg-3.eclass195
34 files changed, 570 insertions, 867 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz
index c952bb5b18bc..9fec9cae23f3 100644
--- a/eclass/Manifest.gz
+++ b/eclass/Manifest.gz
Binary files differ
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index b08c969707ec..8127a66c2b52 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -657,6 +657,12 @@ cmake-utils_src_configure() {
SET (CMAKE_INSTALL_MANDIR "${EPREFIX}/usr/share/man" CACHE PATH "")
SET (CMAKE_USER_MAKE_RULES_OVERRIDE "${build_rules}" CACHE FILEPATH "Gentoo override rules")
_EOF_
+
+ # See bug 689410
+ if [[ "${ARCH}" == riscv ]]; then
+ echo 'SET (CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX '"${libdir#lib}"' CACHE STRING "library search suffix" FORCE)' >> "${common_config}" || die
+ fi
+
[[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}"
if [[ ${EAPI} != [56] ]]; then
diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index 3da3b9aeb555..f43d5af0f7ab 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -471,6 +471,12 @@ cmake_src_configure() {
SET (CMAKE_INSTALL_DOCDIR "${EPREFIX}/usr/share/doc/${PF}" CACHE PATH "")
SET (BUILD_SHARED_LIBS ON CACHE BOOL "")
_EOF_
+
+ # See bug 689410
+ if [[ "${ARCH}" == riscv ]]; then
+ echo 'SET (CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX '"${libdir#lib}"' CACHE STRING "library search suffix" FORCE)' >> "${common_config}" || die
+ fi
+
if [[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]]; then
echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}" || die
fi
diff --git a/eclass/cuda.eclass b/eclass/cuda.eclass
index f1c09ca2e453..b1da77c69dda 100644
--- a/eclass/cuda.eclass
+++ b/eclass/cuda.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
case "${EAPI:-0}" in
@@ -14,7 +14,7 @@ esac
# @ECLASS: cuda.eclass
# @MAINTAINER:
-# Justin Lecher <jlec@gentoo.org>
+# Gentoo Science Project <sci@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7
# @BLURB: Common functions for cuda packages
# @DESCRIPTION:
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 092c0887d878..e0e7a945ab87 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -561,6 +561,7 @@ distutils_install_for_testing() {
TEST_DIR=${BUILD_DIR}/test
local bindir=${TEST_DIR}/scripts
local libdir=${TEST_DIR}/lib
+ PATH=${bindir}:${PATH}
PYTHONPATH=${libdir}:${PYTHONPATH}
local add_args=(
@@ -951,6 +952,11 @@ distutils-r1_run_phase() {
fi
local -x PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}"
+ # make PATH local for distutils_install_for_testing calls
+ # it makes little sense to let user modify PATH in per-impl phases
+ # and _all() already localizes it
+ local -x PATH=${PATH}
+
# Bug 559644
# using PYTHONPATH when the ${BUILD_DIR}/lib is not created yet might lead to
# problems in setup.py scripts that try to import modules/packages from that path
diff --git a/eclass/ecm.eclass b/eclass/ecm.eclass
index 12b31e4ef327..8d358a91f989 100644
--- a/eclass/ecm.eclass
+++ b/eclass/ecm.eclass
@@ -322,7 +322,6 @@ _ecm_strip_handbook_translations() {
for po in ${ECM_PO_DIRS}; do
if [[ -d ${po} ]] ; then
pushd ${po} > /dev/null || die
- local lang
for lang in *; do
if [[ -e ${lang} ]] && ! has ${lang/.po/} ${LINGUAS} ; then
case ${lang} in
diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass
index 6fa2bbea614b..0bf6c014af1f 100644
--- a/eclass/elisp-common.eclass
+++ b/eclass/elisp-common.eclass
@@ -180,6 +180,12 @@ SITELISP=/usr/share/emacs/site-lisp
# Directory where packages install miscellaneous (not Lisp) files.
SITEETC=/usr/share/emacs/etc
+# @ECLASS-VARIABLE: EMACSMODULES
+# @DESCRIPTION:
+# Directory where packages install dynamically loaded modules.
+# May contain a @libdir@ token which will be replaced by $(get_libdir).
+EMACSMODULES=/usr/@libdir@/emacs/modules
+
# @ECLASS-VARIABLE: EMACS
# @DESCRIPTION:
# Path of Emacs executable.
@@ -362,17 +368,37 @@ elisp-install() {
eend $? "elisp-install: doins failed" || die
}
+# @FUNCTION: elisp-modules-install
+# @USAGE: <subdirectory> <list of files>
+# @DESCRIPTION:
+# Install dynamic modules in EMACSMODULES directory.
+
+elisp-modules-install() {
+ local subdir="$1"
+ shift
+ # Don't bother inheriting multilib.eclass for get_libdir(), but
+ # error out in old EAPIs that don't support it natively.
+ [[ ${EAPI} == [45] ]] \
+ && die "${ECLASS}: Dynamic modules not supported in EAPI ${EAPI}"
+ ebegin "Installing dynamic modules for GNU Emacs support"
+ ( # subshell to avoid pollution of calling environment
+ exeinto "${EMACSMODULES//@libdir@/$(get_libdir)}/${subdir}"
+ doexe "$@"
+ )
+ eend $? "elisp-modules-install: doins failed" || die
+}
+
# @FUNCTION: elisp-site-file-install
# @USAGE: <site-init file> [subdirectory]
# @DESCRIPTION:
# Install Emacs site-init file in SITELISP directory. Automatically
-# inserts a standard comment header with the name of the package (unless
-# it is already present). Tokens @SITELISP@ and @SITEETC@ are replaced
-# by the path to the package's subdirectory in SITELISP and SITEETC,
-# respectively.
+# inserts a standard comment header with the name of the package
+# (unless it is already present). Tokens @SITELISP@, @SITEETC@, and
+# @EMACSMODULES@ are replaced by the path to the package's subdirectory
+# in SITELISP, SITEETC, and EMACSMODULES, respectively.
elisp-site-file-install() {
- local sf="${1##*/}" my_pn="${2:-${PN}}" ret
+ local sf="${1##*/}" my_pn="${2:-${PN}}" modules ret
local header=";;; ${PN} site-lisp configuration"
[[ ${sf} == [0-9][0-9]*-gentoo*.el ]] \
@@ -381,9 +407,13 @@ elisp-site-file-install() {
sf="${T}/${sf}"
ebegin "Installing site initialisation file for GNU Emacs"
[[ $1 = "${sf}" ]] || cp "$1" "${sf}"
+ [[ ${EAPI} == [45] ]] && grep -q "@EMACSMODULES@" "${sf}" \
+ && die "${ECLASS}: Dynamic modules not supported in EAPI ${EAPI}"
+ modules=${EMACSMODULES//@libdir@/$(get_libdir)}
sed -i -e "1{:x;/^\$/{n;bx;};/^;.*${PN}/I!s:^:${header}\n\n:;1s:^:\n:;}" \
-e "s:@SITELISP@:${EPREFIX}${SITELISP}/${my_pn}:g" \
- -e "s:@SITEETC@:${EPREFIX}${SITEETC}/${my_pn}:g;\$q" "${sf}"
+ -e "s:@SITEETC@:${EPREFIX}${SITEETC}/${my_pn}:g" \
+ -e "s:@EMACSMODULES@:${EPREFIX}${modules}/${my_pn}:g;\$q" "${sf}"
( # subshell to avoid pollution of calling environment
insinto "${SITELISP}/site-gentoo.d"
doins "${sf}"
diff --git a/eclass/emboss-r2.eclass b/eclass/emboss-r2.eclass
index 1eca48b42b36..7d13f194eb7a 100644
--- a/eclass/emboss-r2.eclass
+++ b/eclass/emboss-r2.eclass
@@ -1,10 +1,9 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: emboss-r2.eclass
# @MAINTAINER:
# sci-biology@gentoo.org
-# jlec@gentoo.org
# ted.tanberry@gmail.com
# @AUTHOR:
# Original author: Author Olivier Fisette <ofisette@gmail.com>
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 0c67ec9f7a76..20ee39d98bad 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -27,7 +27,14 @@ 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+ -gz
+
+ # debugging symbols should generally be very safe to add
+ -g '-g[0-9]'
+ -ggdb '-ggdb[0-9]'
+ -gdwarf '-gdwarf-*'
+ -gstabs -gstabs+
+ -gz
+
-fno-ident -fpermissive -frecord-gcc-switches
'-fdiagnostics*' '-fplugin*'
'-W*' -w
diff --git a/eclass/fortran-2.eclass b/eclass/fortran-2.eclass
index 42df4a1ff8e9..6049b03b8f14 100644
--- a/eclass/fortran-2.eclass
+++ b/eclass/fortran-2.eclass
@@ -3,7 +3,6 @@
# @ECLASS: fortran-2.eclass
# @MAINTAINER:
-# jlec@gentoo.org
# sci@gentoo.org
# @AUTHOR:
# Author Justin Lecher <jlec@gentoo.org>
diff --git a/eclass/kde.org.eclass b/eclass/kde.org.eclass
index 634833ab2e32..37a631499e14 100644
--- a/eclass/kde.org.eclass
+++ b/eclass/kde.org.eclass
@@ -174,7 +174,7 @@ _kde.org_calculate_live_repo() {
# @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}
+ EGIT_MIRROR=${EGIT_MIRROR:=https://invent.kde.org/kde}
if [[ ${PV} == ??.??.49.9999 && ${KDE_RELEASE_SERVICE} = true ]]; then
EGIT_BRANCH="release/$(ver_cut 1-2)"
diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index 9f7a8e3296f0..47b0db349561 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -147,6 +147,11 @@ kernel-build_src_install() {
mv include scripts "${ED}/usr/src/linux-${ver}/" || die
mv "arch/${kern_arch}/include" \
"${ED}/usr/src/linux-${ver}/arch/${kern_arch}/" || die
+ # some arches need module.lds linker script to build external modules
+ if [[ -f arch/${kern_arch}/kernel/module.lds ]]; then
+ insinto "/usr/src/linux-${ver}/arch/${kern_arch}/kernel"
+ doins "arch/${kern_arch}/kernel/module.lds"
+ fi
# remove everything but Makefile* and Kconfig*
find -type f '!' '(' -name 'Makefile*' -o -name 'Kconfig*' ')' \
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index ab886d28faf0..558e4979168d 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -49,13 +49,17 @@ SRC_URI+="
https://dev.gentoo.org/~mgorny/dist/tinycorelinux-${TCL_VER}-amd64.qcow2
)
x86? (
- https://dev.gentoo.org/~mgorny/dist/tinycorelinux-${TCL_VER}-x86.qcow2
+ https://dev.gentoo.org/~mgorny/dist/tinycorelinux-${TCL_VER}-x86.qcow2
)
)"
SLOT="${PV}"
IUSE="+initramfs test"
-RESTRICT+=" !test? ( test ) test? ( userpriv )"
+RESTRICT+="
+ !test? ( test )
+ test? ( userpriv )
+ arm? ( test )
+ arm64? ( test )"
# install-DEPEND actually
# note: we need installkernel with initramfs support!
@@ -228,9 +232,12 @@ kernel-install_test() {
"${T}/fs.qcow2" || die
cd "${T}" || die
+ local qemu_extra_args=
+ [[ ${qemu_arch} == x86_64 ]] && qemu_extra_args='-cpu max'
cat > run.sh <<-EOF || die
#!/bin/sh
exec qemu-system-${qemu_arch} \
+ ${qemu_extra_args} \
-m 256M \
-display none \
-no-reboot \
diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
index 7c26a4a1539d..f5a5a4276369 100644
--- a/eclass/linux-mod.eclass
+++ b/eclass/linux-mod.eclass
@@ -146,7 +146,7 @@ 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:+)}"
+RDEPEND="${MODULES_OPTIONAL_USE}${MODULES_OPTIONAL_USE:+? (} kernel_linux? ( sys-apps/kmod[tools] ) ${MODULES_OPTIONAL_USE:+)}"
DEPEND="${RDEPEND}
${MODULES_OPTIONAL_USE}${MODULES_OPTIONAL_USE:+? (}
sys-apps/sed
diff --git a/eclass/llvm.eclass b/eclass/llvm.eclass
index 61b34d4985eb..761ffdbad5e2 100644
--- a/eclass/llvm.eclass
+++ b/eclass/llvm.eclass
@@ -85,7 +85,7 @@ DEPEND="!!sys-devel/llvm:0"
# @INTERNAL
# @DESCRIPTION:
# Correct values of LLVM slots, newest first.
-declare -g -r _LLVM_KNOWN_SLOTS=( 11 10 9 8 )
+declare -g -r _LLVM_KNOWN_SLOTS=( {12..8} )
# @FUNCTION: get_llvm_prefix
# @USAGE: [-b|-d] [<max_slot>]
diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index 36c4f52650fd..3bb0465c3773 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -44,7 +44,7 @@ esac
# @DESCRIPTION:
# The major version of current LLVM trunk. Used to determine
# the correct branch to use.
-_LLVM_MASTER_MAJOR=11
+_LLVM_MASTER_MAJOR=12
# @ECLASS-VARIABLE: _LLVM_SOURCE_TYPE
# @INTERNAL
diff --git a/eclass/mate.eclass b/eclass/mate.eclass
index db511aedb1f1..d7dd2dbceec0 100644
--- a/eclass/mate.eclass
+++ b/eclass/mate.eclass
@@ -29,7 +29,8 @@ esac
# - "yes": will run prune_libtool_files --modules
# - If it is not set, it will run prune_libtool_files
# MATE_LA_PUNT is a stub to GNOME2_LA_PUNT
-GNOME2_LA_PUNT=${MATE_LA_PUNT:-""}
+MATE_LA_PUNT=${MATE_LA_PUNT:-""}
+GNOME2_LA_PUNT="${MATE_LA_PUNT}"
inherit gnome2 autotools mate-desktop.org
@@ -115,7 +116,17 @@ mate_src_prepare() {
# MATE specific configure handling
# Stub to gnome2_src_configure()
mate_src_configure() {
- gnome2_src_configure "$@"
+
+ local mateconf=()
+
+ # Pass --disable-static whenever possible
+ if ! use_if_iuse static-libs; then
+ if grep -q "enable-static" "${ECONF_SOURCE:-.}"/configure; then
+ mateconf+=( --disable-static )
+ fi
+ fi
+
+ gnome2_src_configure "${mateconf[@]}" "$@"
}
# @FUNCTION: mate_src_install
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 1590c1f14cf5..21338280df33 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -54,7 +54,7 @@ EXPORT_FUNCTIONS src_configure src_compile src_test src_install
if [[ -z ${_MESON_ECLASS} ]]; then
_MESON_ECLASS=1
-MESON_DEPEND=">=dev-util/meson-0.51.2
+MESON_DEPEND=">=dev-util/meson-0.54.0
>=dev-util/ninja-1.8.2"
if [[ ${EAPI:-0} == [6] ]]; then
@@ -373,20 +373,7 @@ meson_src_configure() {
local -x BOOST_LIBRARYDIR="${BOOST_LIBRARYDIR-${EPREFIX}/usr/$(get_libdir)}"
(
- # https://bugs.gentoo.org/720860
- if ver_test "$(meson --version)" -lt "0.54"; then
- local -x CFLAGS=${BUILD_CFLAGS}
- local -x CPPFLAGS=${BUILD_CPPFLAGS}
- local -x CXXFLAGS=${BUILD_CXXFLAGS}
- local -x FFLAGS=${BUILD_FCFLAGS}
- local -x OBJCFLAGS=${BUILD_OBJCFLAGS}
- local -x OBJCXXFLAGS=${BUILD_OBJCXXFLAGS}
- local -x LDFLAGS=${BUILD_LDFLAGS}
- else
- # https://bugs.gentoo.org/720818
- export -n {C,CPP,CXX,F,OBJC,OBJCXX,LD}FLAGS PKG_CONFIG_{LIBDIR,PATH}
- fi
-
+ export -n {C,CPP,CXX,F,OBJC,OBJCXX,LD}FLAGS PKG_CONFIG_{LIBDIR,PATH}
echo "${mesonargs[@]}" >&2
"${mesonargs[@]}"
) || die
diff --git a/eclass/netsurf.eclass b/eclass/netsurf.eclass
index 3d371811752b..065ed1e568f3 100644
--- a/eclass/netsurf.eclass
+++ b/eclass/netsurf.eclass
@@ -1,179 +1,42 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-# @DEAD
# @ECLASS: netsurf.eclass
# @MAINTAINER:
# maintainer-needed@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 7
# @BLURB: Handle buildsystem of www.netsurf-browser.org components
# @DESCRIPTION:
-# Handle unpacking and usage of separate buildsystem tarball and manage
-# multilib build, static-libs generation and debug building.
-#
-# Supports PATCHES and DOCS as in base.eclass
+# Handle settings build environment for netsurf build system
-case ${EAPI:-0} in
- 0|1|2|3|4) die "this eclass doesn't support EAPI<5" ;;
- *) ;;
+case "${EAPI:-0}" in
+ 7) ;;
+ *) die "EAPI=${EAPI} is not supported" ;;
esac
-inherit eutils toolchain-funcs multilib-minimal
+inherit toolchain-funcs
-EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install
-
-# @ECLASS-VARIABLE: NETSURF_BUILDSYSTEM
-# @DESCRIPTION:
-# Select version of buildsystem tarball to be used along the component
-# defaults to buildsystem-1.0
-NETSURF_BUILDSYSTEM="${NETSURF_BUILDSYSTEM:-buildsystem-1.0}"
-
-# @ECLASS-VARIABLE: NETSURF_BUILDSYSTEM_SRC_URI
-# @DESCRIPTION:
-# Download link for NETSURF_BUILDSYSTEM, add to SRC_URI iff set explicitly.
-NETSURF_BUILDSYSTEM_SRC_URI="http://download.netsurf-browser.org/libs/releases/${NETSURF_BUILDSYSTEM}.tar.gz -> netsurf-${NETSURF_BUILDSYSTEM}.tar.gz"
-
-# @ECLASS-VARIABLE: NETSURF_COMPONENT_TYPE
-# @DESCRIPTION:
-# Passed to buildsystem as COMPONENT_TYPE, valid values are
-# lib-shared, lib-static and binary. Defaults to "lib-static lib-shared"
-NETSURF_COMPONENT_TYPE="${NETSURF_COMPONENT_TYPE:-lib-static lib-shared}"
-
-# @ECLASS-VARIABLE: SRC_URI
-# @DESCRIPTION:
-# Defaults to http://download.netsurf-browser.org/libs/releases/${P}-src.tar.gz
-# and NETSURF_BUILDSYSTEM_SRC_URI.
-if [ -z "${SRC_URI}" ] ; then
- SRC_URI="http://download.netsurf-browser.org/libs/releases/${P}-src.tar.gz
- ${NETSURF_BUILDSYSTEM_SRC_URI}"
-fi
-
-IUSE="debug"
-if has lib-static ${NETSURF_COMPONENT_TYPE} ; then
- IUSE+=" static-libs"
-fi
-
-DEPEND="virtual/pkgconfig"
-
-# @FUNCTION: netsurf_src_prepare
-# @DESCRIPTION:
-# Apply and PATCHES and multilib_copy_sources for in-source build.
-netsurf_src_prepare() {
- [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
- debug-print "$FUNCNAME: applying user patches"
- epatch_user
-
- multilib_copy_sources
-}
-
-# @ECLASS-VARIABLE: netsurf_makeconf
+# @FUNCTION: netsurf_define_makeconf
+# @USAGE:
# @DESCRIPTION:
-# Configuration variable bash array to be passed to emake calls.
-# Defined at netsurf_src_configure and can be altered afterwards.
-
-# @FUNCTION: netsurf_src_configure
-# @DESCRIPTION:
-# Setup netsurf_makeconf and run multilib-minimal_src_configure.
-# A default multilib_src_configure is provided by this eclass.
-netsurf_src_configure() {
- netsurf_makeconf=(
- NSSHARED=${WORKDIR}/${NETSURF_BUILDSYSTEM}
+# This function sets NETSURF_MAKECONF as needed by netsurf build system
+netsurf_define_makeconf() {
+ NETSURF_MAKECONF=(
+ PREFIX="${EPREFIX}/usr"
+ NSSHARED="${EPREFIX}/usr/share/netsurf-buildsystem"
+ LIBDIR="$(get_libdir)"
Q=
+ CC="$(tc-getCC)"
+ LD="$(tc-getLD)"
HOST_CC="\$(CC)"
+ BUILD_CC="$(tc-getBUILD_CC)"
+ CXX="$(tc-getCXX)"
+ BUILD_CXX="$(tc-getBUILD_CXX)"
CCOPT=
CCNOOPT=
CCDBG=
LDDBG=
AR="$(tc-getAR)"
- BUILD=$(usex debug debug release)
- PREFIX="${EROOT}"usr
+ WARNFLAGS=
)
-
- multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
- sed -e "/^INSTALL_ITEMS/s: /lib: /$(get_libdir):g" \
- -i Makefile || die
- if [ -f ${PN}.pc.in ] ; then
- sed -e "/^libdir/s:/lib:/$(get_libdir):g" \
- -i ${PN}.pc.in || die
- fi
- sed -e 's:/bin/which:which:' \
- -i ../${NETSURF_BUILDSYSTEM}/makefiles/Makefile.tools || die
-}
-
-# @FUNCTION: netsurf_make
-# @DESCRIPTION:
-# Calls emake with netsurf_makeconf and toolchain CC/LD
-# as arguments for every NETSURF_COMPONENT_TYPE if activated.
-netsurf_make() {
- for COMPONENT_TYPE in ${NETSURF_COMPONENT_TYPE} ; do
- if [ "${COMPONENT_TYPE}" == "lib-static" ] ; then
- if ! use static-libs ; then
- continue
- fi
- fi
- emake CC="$(tc-getCC)" LD="$(tc-getLD)" "${netsurf_makeconf[@]}" \
- COMPONENT_TYPE=${COMPONENT_TYPE} LIBDIR="$(get_libdir)" "$@"
- done
-}
-
-# @FUNCTION: netsurf_src_compile
-# @DESCRIPTION:
-# Calls multilib-minimal_src_compile and netsurf_make doc if USE=doc.
-# A default multilib_src_compile is provided by this eclass.
-netsurf_src_compile() {
- local problems=$(egrep -Hn -- ' (-O.?|-g)( |$)' \
- $(find . -type f -name 'Makefile*'))
- if [ -n "${problems}" ] ; then
- elog "found bad flags:
-${problems}"
- fi
-
- multilib-minimal_src_compile "$@"
-
- if has doc ${USE} ; then
- netsurf_make "$@" docs
- fi
-}
-
-multilib_src_compile() {
- netsurf_make "$@"
-}
-
-# @FUNCTION: netsurf_src_test
-# @DESCRIPTION:
-# Calls multilib-minimal_src_test.
-# A default multilib_src_test is provided by this eclass.
-netsurf_src_test() {
- multilib-minimal_src_test "$@"
-}
-
-multilib_src_test() {
- netsurf_make test "$@"
-}
-
-# @FUNCTION: netsurf_src_install
-# @DESCRIPTION:
-# Calls multilib-minimal_src_install.
-# A default multilib_src_test is provided by this eclass.
-# A default multilib_src_install is provided by this eclass.
-netsurf_src_install() {
- multilib-minimal_src_install "$@"
-}
-
-multilib_src_install() {
- #DEFAULT_ABI may not be the last.
- #install to clean dir, rename binaries, move everything back
- if [ "${ABI}" == "${DEFAULT_ABI}" ] ; then
- netsurf_make DESTDIR="${D}" install "$@"
- else
- netsurf_make DESTDIR="${D}"${ABI} install "$@"
- if [ "${ABI}" != "${DEFAULT_ABI}" ] ; then
- find "${D}"${ABI}/usr/bin -type f -exec mv {} {}.${ABI} \;
- fi
- mv "${D}"${ABI}/* "${D}" || die
- rmdir "${D}"${ABI} || die
- fi
}
diff --git a/eclass/nvidia-driver.eclass b/eclass/nvidia-driver.eclass
index 50c5395a686d..d0b6cd41d598 100644
--- a/eclass/nvidia-driver.eclass
+++ b/eclass/nvidia-driver.eclass
@@ -237,5 +237,5 @@ nvidia-driver_check() {
# nvidia-driver.eclass
nvidia-driver_check_gpu
- use kernel_linux && nvidia-driver_check_kernel
+ use driver && use kernel_linux && nvidia-driver_check_kernel
}
diff --git a/eclass/php-ext-source-r2.eclass b/eclass/php-ext-source-r2.eclass
deleted file mode 100644
index a3658cce461d..000000000000
--- a/eclass/php-ext-source-r2.eclass
+++ /dev/null
@@ -1,379 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# @DEAD
-# @ECLASS: php-ext-source-r2.eclass
-# @MAINTAINER:
-# Gentoo PHP team <php-bugs@gentoo.org>
-# @AUTHOR:
-# Author: Tal Peer <coredumb@gentoo.org>
-# Author: Stuart Herbert <stuart@gentoo.org>
-# Author: Luca Longinotti <chtekk@gentoo.org>
-# Author: Jakub Moc <jakub@gentoo.org> (documentation)
-# Author: Ole Markus With <olemarkus@gentoo.org>
-# @SUPPORTED_EAPIS: 4 5
-# @BLURB: A unified interface for compiling and installing standalone PHP extensions.
-# @DESCRIPTION:
-# This eclass provides a unified interface for compiling and installing standalone
-# PHP extensions (modules).
-
-inherit autotools multilib
-
-EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install
-
-DEPEND=">=sys-devel/m4-1.4.3
- >=sys-devel/libtool-1.5.18"
-RDEPEND=""
-
-# Because of USE deps, we require at least EAPI 2
-case ${EAPI} in
- 4|5) ;;
- *)
- die "php-ext-source-r2 is not compatible with EAPI=${EAPI}"
-esac
-
-# @ECLASS-VARIABLE: PHP_EXT_NAME
-# @REQUIRED
-# @DESCRIPTION:
-# The extension name. This must be set, otherwise the eclass dies.
-# Only automagically set by php-ext-pecl-r2.eclass, so unless your ebuild
-# inherits that eclass, you must set this manually before inherit.
-[[ -z "${PHP_EXT_NAME}" ]] && die "No module name specified for the php-ext-source-r2 eclass"
-
-# @ECLASS-VARIABLE: PHP_EXT_INI
-# @DESCRIPTION:
-# Controls whether or not to add a line to php.ini for the extension.
-# Defaults to "yes" and should not be changed in most cases.
-[[ -z "${PHP_EXT_INI}" ]] && PHP_EXT_INI="yes"
-
-# @ECLASS-VARIABLE: PHP_EXT_ZENDEXT
-# @DESCRIPTION:
-# Controls whether the extension is a ZendEngine extension or not.
-# Defaults to "no" and if you don't know what is it, you don't need it.
-[[ -z "${PHP_EXT_ZENDEXT}" ]] && PHP_EXT_ZENDEXT="no"
-
-# @ECLASS-VARIABLE: USE_PHP
-# @REQUIRED
-# @DESCRIPTION:
-# Lists the PHP slots compatibile the extension is compatibile with
-# Example:
-# @CODE
-# USE_PHP="php5-5 php5-6"
-# @CODE
-[[ -z "${USE_PHP}" ]] && die "USE_PHP is not set for the php-ext-source-r2 eclass"
-
-# @ECLASS-VARIABLE: PHP_EXT_OPTIONAL_USE
-# @DESCRIPTION:
-# If set, this is the USE flag that the PHP dependencies are behind
-# Most commonly set as PHP_EXT_OPTIONAL_USE=php to get the dependencies behind
-# USE=php.
-
-# @ECLASS-VARIABLE: PHP_EXT_S
-# @DESCRIPTION:
-# The relative location of the temporary build directory for the PHP extension within
-# the source package. This is useful for packages that bundle the PHP extension.
-# Defaults to ${S}
-[[ -z "${PHP_EXT_S}" ]] && PHP_EXT_S="${S}"
-
-#Make sure at least one target is installed.
-REQUIRED_USE="${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( }|| ( "
-for target in ${USE_PHP}; do
- IUSE="${IUSE} php_targets_${target}"
- target=${target/+}
- REQUIRED_USE+="php_targets_${target} "
- slot=${target/php}
- slot=${slot/-/.}
- PHPDEPEND="${PHPDEPEND}
- php_targets_${target}? ( dev-lang/php:${slot} )"
-done
-REQUIRED_USE+=") ${PHP_EXT_OPTIONAL_USE:+ )}"
-
-RDEPEND="${RDEPEND}
- ${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( }
- ${PHPDEPEND}
- ${PHP_EXT_OPTIONAL_USE:+ )}"
-
-DEPEND="${DEPEND}
- ${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( }
- ${PHPDEPEND}
- ${PHP_EXT_OPTIONAL_USE:+ )}
-"
-
-# @FUNCTION: php-ext-source-r2_src_unpack
-# @DESCRIPTION:
-# runs standard src_unpack + _phpize
-
-# @ECLASS-VARIABLE: PHP_EXT_SKIP_PHPIZE
-# @DESCRIPTION:
-# phpize will be run by default for all ebuilds that use
-# php-ext-source-r2_src_unpack
-# Set PHP_EXT_SKIP_PHPIZE="yes" in your ebuild if you do not want to run phpize.
-
-php-ext-source-r2_src_unpack() {
- unpack ${A}
- local slot orig_s="${PHP_EXT_S}"
- for slot in $(php_get_slots); do
- cp -r "${orig_s}" "${WORKDIR}/${slot}" || die "Failed to copy source ${orig_s} to PHP target directory"
- done
-}
-
-php-ext-source-r2_src_prepare() {
- local slot orig_s="${PHP_EXT_S}"
- for slot in $(php_get_slots); do
- php_init_slot_env ${slot}
- php-ext-source-r2_phpize
- done
-}
-
-# @FUNCTION: php-ext-source-r2_phpize
-# @DESCRIPTION:
-# Runs phpize and autotools in addition to the standard src_unpack
-php-ext-source-r2_phpize() {
- if [[ "${PHP_EXT_SKIP_PHPIZE}" != 'yes' ]] ; then
- # Create configure out of config.m4. We use autotools_run_tool
- # to avoid some warnings about WANT_AUTOCONF and
- # WANT_AUTOMAKE (see bugs #329071 and #549268).
- autotools_run_tool ${PHPIZE}
- # force run of libtoolize and regeneration of related autotools
- # files (bug 220519)
- rm aclocal.m4
- eautoreconf
- fi
-}
-
-# @FUNCTION: php-ext-source-r2_src_configure
-# @DESCRIPTION:
-# Takes care of standard configure for PHP extensions (modules).
-
-# @ECLASS-VARIABLE: my_conf
-# @DESCRIPTION:
-# Set this in the ebuild to pass configure options to econf.
-
-php-ext-source-r2_src_configure() {
- # net-snmp creates this file #385403
- addpredict /usr/share/snmp/mibs/.index
- addpredict /var/lib/net-snmp/mib_indexes
-
- local slot
- for slot in $(php_get_slots); do
- php_init_slot_env ${slot}
- # Set the correct config options
- econf --with-php-config=${PHPCONFIG} ${my_conf} || die "Unable to configure code to compile"
- done
-}
-
-# @FUNCTION: php-ext-source-r2_src_compile
-# @DESCRIPTION:
-# Takes care of standard compile for PHP extensions (modules).
-php-ext-source-r2_src_compile() {
- # net-snmp creates this file #324739
- addpredict /usr/share/snmp/mibs/.index
- addpredict /var/lib/net-snmp/mib_indexes
-
- # shm extension createss a semaphore file #173574
- addpredict /session_mm_cli0.sem
- local slot
- for slot in $(php_get_slots); do
- php_init_slot_env ${slot}
- emake || die "Unable to make code"
-
- done
-}
-
-# @FUNCTION: php-ext-source-r2_src_install
-# @DESCRIPTION:
-# Takes care of standard install for PHP extensions (modules).
-
-# @ECLASS-VARIABLE: DOCS
-# @DESCRIPTION:
-# Set in ebuild if you wish to install additional, package-specific documentation.
-php-ext-source-r2_src_install() {
- local slot
- for slot in $(php_get_slots); do
- php_init_slot_env ${slot}
-
- # Let's put the default module away. Strip $EPREFIX from
- # $EXT_DIR before calling newins (which handles EPREFIX itself).
- insinto "${EXT_DIR#$EPREFIX}"
- newins "modules/${PHP_EXT_NAME}.so" "${PHP_EXT_NAME}.so" || die "Unable to install extension"
-
- local doc
- for doc in ${DOCS} ; do
- [[ -s ${doc} ]] && dodoc ${doc}
- done
-
- INSTALL_ROOT="${D}" emake install-headers
- done
- php-ext-source-r2_createinifiles
-}
-
-
-php_get_slots() {
- local s slot
- for slot in ${USE_PHP}; do
- use php_targets_${slot} && s+=" ${slot/-/.}"
- done
- echo $s
-}
-
-php_init_slot_env() {
- libdir=$(get_libdir)
-
- PHPIZE="${EPREFIX}/usr/${libdir}/${1}/bin/phpize"
- PHPCONFIG="${EPREFIX}/usr/${libdir}/${1}/bin/php-config"
- PHPCLI="${EPREFIX}/usr/${libdir}/${1}/bin/php"
- PHPCGI="${EPREFIX}/usr/${libdir}/${1}/bin/php-cgi"
- PHP_PKG="$(best_version =dev-lang/php-${1:3}*)"
- PHPPREFIX="${EPREFIX}/usr/${libdir}/${slot}"
- EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)"
- PHP_CURRENTSLOT=${1:3}
-
- PHP_EXT_S="${WORKDIR}/${1}"
- cd "${PHP_EXT_S}"
-}
-
-php-ext-source-r2_buildinilist() {
- # Work out the list of <ext>.ini files to edit/add to
- if [[ -z "${PHPSAPILIST}" ]] ; then
- PHPSAPILIST="apache2 cli cgi fpm embed phpdbg"
- fi
-
- PHPINIFILELIST=""
- local x
- for x in ${PHPSAPILIST} ; do
- if [[ -f "${EPREFIX}/etc/php/${x}-${1}/php.ini" ]] ; then
- PHPINIFILELIST="${PHPINIFILELIST} etc/php/${x}-${1}/ext/${PHP_EXT_NAME}.ini"
- fi
- done
- PHPFULLINIFILELIST="${PHPFULLINIFILELIST} ${PHPINIFILELIST}"
-}
-
-# @FUNCTION: php-ext-source-r2_createinifiles
-# @DESCRIPTION:
-# Builds ini files for every enabled slot and SAPI
-php-ext-source-r2_createinifiles() {
- local slot
- for slot in $(php_get_slots); do
- php_init_slot_env ${slot}
- # Pull in the PHP settings
-
- # Build the list of <ext>.ini files to edit/add to
- php-ext-source-r2_buildinilist ${slot}
-
-
- # Add the needed lines to the <ext>.ini files
- local file
- if [[ "${PHP_EXT_INI}" = "yes" ]] ; then
- for file in ${PHPINIFILELIST}; do
- php-ext-source-r2_addextension "${PHP_EXT_NAME}.so" "${file}"
- done
- fi
-
- # Symlink the <ext>.ini files from ext/ to ext-active/
- local inifile
- for inifile in ${PHPINIFILELIST} ; do
- if [[ -n "${PHP_EXT_INIFILE}" ]]; then
- cat "${FILESDIR}/${PHP_EXT_INIFILE}" >> "${ED}/${inifile}"
- einfo "Added content of ${FILESDIR}/${PHP_EXT_INIFILE} to ${inifile}"
- fi
- inidir="${inifile/${PHP_EXT_NAME}.ini/}"
- inidir="${inidir/ext/ext-active}"
- dodir "/${inidir}"
- dosym "/${inifile}" "/${inifile/ext/ext-active}"
- done
-
- # Add support for installing PHP files into a version dependant directory
- PHP_EXT_SHARED_DIR="${EPREFIX}/usr/share/php/${PHP_EXT_NAME}"
- done
-}
-
-php-ext-source-r2_addextension() {
- if [[ "${PHP_EXT_ZENDEXT}" = "yes" ]] ; then
- # We need the full path for ZendEngine extensions
- # and we need to check for debugging enabled!
- if has_version "dev-lang/php:${PHP_CURRENTSLOT}[threads]" ; then
- if has_version "dev-lang/php:${PHP_CURRENTSLOT}[debug]" ; then
- ext_type="zend_extension_debug_ts"
- else
- ext_type="zend_extension_ts"
- fi
- ext_file="${EXT_DIR}/${1}"
- else
- if has_version "dev-lang/php:${PHP_CURRENTSLOT}[debug]"; then
- ext_type="zend_extension_debug"
- else
- ext_type="zend_extension"
- fi
- ext_file="${EXT_DIR}/${1}"
- fi
-
- # php-5.3 unifies zend_extension loading and just requires the
- # zend_extension keyword with no suffix
- # TODO: drop previous code and this check once <php-5.3 support is
- # discontinued
- if has_version '>=dev-lang/php-5.3' ; then
- ext_type="zend_extension"
- fi
- else
- # We don't need the full path for normal extensions!
- ext_type="extension"
- ext_file="${1}"
- fi
-
- php-ext-source-r2_addtoinifile "${ext_type}" "${ext_file}" "${2}" "Extension added"
-}
-
-# $1 - Setting name
-# $2 - Setting value
-# $3 - File to add to
-# $4 - Sanitized text to output
-php-ext-source-r2_addtoinifile() {
- local inifile="${WORKDIR}/${3}"
- if [[ ! -d $(dirname ${inifile}) ]] ; then
- mkdir -p $(dirname ${inifile})
- fi
-
- # Are we adding the name of a section?
- if [[ ${1:0:1} == "[" ]] ; then
- echo "${1}" >> "${inifile}"
- my_added="${1}"
- else
- echo "${1}=${2}" >> "${inifile}"
- my_added="${1}=${2}"
- fi
-
- if [[ -z "${4}" ]] ; then
- einfo "Added '${my_added}' to /${3}"
- else
- einfo "${4} to /${3}"
- fi
-
- insinto /$(dirname ${3})
- doins "${inifile}"
-}
-
-# @FUNCTION: php-ext-source-r2_addtoinifiles
-# @USAGE: <setting name> <setting value> [message to output]; or just [section name]
-# @DESCRIPTION:
-# Add value settings to php.ini file installed by the extension (module).
-# You can also add a [section], see examples below.
-#
-# @CODE
-# Add some settings for the extension:
-#
-# php-ext-source-r2_addtoinifiles "zend_optimizer.optimization_level" "15"
-# php-ext-source-r2_addtoinifiles "zend_optimizer.enable_loader" "0"
-# php-ext-source-r2_addtoinifiles "zend_optimizer.disable_licensing" "0"
-#
-# Adding values to a section in php.ini file installed by the extension:
-#
-# php-ext-source-r2_addtoinifiles "[Debugger]"
-# php-ext-source-r2_addtoinifiles "debugger.enabled" "on"
-# php-ext-source-r2_addtoinifiles "debugger.profiler_enabled" "on"
-# @CODE
-php-ext-source-r2_addtoinifiles() {
- local x
- for x in ${PHPFULLINIFILELIST} ; do
- php-ext-source-r2_addtoinifile "${1}" "${2}" "${x}" "${3}"
- done
-}
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index 8c3ff5b08095..40944684ec8b 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -297,6 +297,7 @@ _python_gen_usedep() {
local impl matches=()
+ _python_verify_patterns "${@}"
for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
if _python_impl_matches "${impl}" "${@}"; then
matches+=(
@@ -380,6 +381,7 @@ python_gen_useflags() {
local impl matches=()
+ _python_verify_patterns "${@}"
for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
if _python_impl_matches "${impl}" "${@}"; then
matches+=( "python_targets_${impl}" )
@@ -428,6 +430,7 @@ python_gen_cond_dep() {
local dep=${1}
shift
+ _python_verify_patterns "${@}"
for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
if _python_impl_matches "${impl}" "${@}"; then
# substitute ${PYTHON_USEDEP} if used
@@ -486,6 +489,7 @@ python_gen_impl_dep() {
local PYTHON_REQ_USE=${1}
shift
+ _python_verify_patterns "${@}"
for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
if _python_impl_matches "${impl}" "${@}"; then
local PYTHON_PKG_DEP
@@ -564,6 +568,7 @@ python_gen_any_dep() {
shift
local i PYTHON_PKG_DEP out=
+ _python_verify_patterns "${@}"
for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
if _python_impl_matches "${i}" "${@}"; then
local PYTHON_USEDEP="python_targets_${i}(-),python_single_target_${i}(+)"
@@ -751,6 +756,7 @@ python_setup() {
# (reverse iteration -- newest impl first)
local found
+ _python_verify_patterns "${@}"
for (( i = ${#_PYTHON_SUPPORTED_IMPLS[@]} - 1; i >= 0; i-- )); do
local impl=${_PYTHON_SUPPORTED_IMPLS[i]}
diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass
index 6fedc7cdf4e0..dc032379cd84 100644
--- a/eclass/python-single-r1.eclass
+++ b/eclass/python-single-r1.eclass
@@ -291,6 +291,7 @@ _python_gen_usedep() {
local impl matches=()
+ _python_verify_patterns "${@}"
for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
if _python_impl_matches "${impl}" "${@}"; then
matches+=(
@@ -333,6 +334,7 @@ python_gen_useflags() {
local impl matches=()
+ _python_verify_patterns "${@}"
for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
if _python_impl_matches "${impl}" "${@}"; then
matches+=( "python_single_target_${impl}" )
@@ -382,6 +384,7 @@ python_gen_cond_dep() {
local dep=${1}
shift
+ _python_verify_patterns "${@}"
for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
if _python_impl_matches "${impl}" "${@}"; then
# substitute ${PYTHON_SINGLE_USEDEP} if used
@@ -445,6 +448,7 @@ python_gen_impl_dep() {
local PYTHON_REQ_USE=${1}
shift
+ _python_verify_patterns "${@}"
for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
if _python_impl_matches "${impl}" "${@}"; then
local PYTHON_PKG_DEP
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 9bad72a77e98..87cb662c64fd 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -45,6 +45,18 @@ _PYTHON_ALL_IMPLS=(
)
readonly _PYTHON_ALL_IMPLS
+# @ECLASS-VARIABLE: _PYTHON_HISTORICAL_IMPLS
+# @INTERNAL
+# @DESCRIPTION:
+# All historical Python implementations that are no longer supported.
+_PYTHON_HISTORICAL_IMPLS=(
+ jython2_7
+ pypy pypy1_{8,9} pypy2_0
+ python2_{5,6}
+ python3_{1,2,3,4,5}
+)
+readonly _PYTHON_HISTORICAL_IMPLS
+
# @ECLASS-VARIABLE: PYTHON_COMPAT_NO_STRICT
# @INTERNAL
# @DESCRIPTION:
@@ -89,6 +101,28 @@ _python_impl_supported() {
esac
}
+# @FUNCTION: _python_verify_patterns
+# @USAGE: <pattern>...
+# @INTERNAL
+# @DESCRIPTION:
+# Verify whether the patterns passed to the eclass function are correct
+# (i.e. can match any valid implementation). Dies on wrong pattern.
+_python_verify_patterns() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ local impl pattern
+ for pattern; do
+ [[ ${pattern} == -[23] ]] && continue
+
+ for impl in "${_PYTHON_ALL_IMPLS[@]}" "${_PYTHON_HISTORICAL_IMPLS[@]}"
+ do
+ [[ ${impl} == ${pattern/./_} ]] && continue 2
+ done
+
+ die "Invalid implementation pattern: ${pattern}"
+ done
+}
+
# @FUNCTION: _python_set_impls
# @INTERNAL
# @DESCRIPTION:
diff --git a/eclass/ros-catkin.eclass b/eclass/ros-catkin.eclass
index a79cef7bd217..b47f2160cbbc 100644
--- a/eclass/ros-catkin.eclass
+++ b/eclass/ros-catkin.eclass
@@ -10,23 +10,13 @@
# @BLURB: Template eclass for catkin based ROS packages.
# @DESCRIPTION:
# Provides function for building ROS packages on Gentoo.
-# It supports selectively building messages, multi-python installation, live ebuilds (git only).
-
-# @ECLASS-VARIABLE: CMAKE_ECLASS
-# @INTERNAL
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Set to "cmake-utils" for EAPI 5 and 6, "cmake" for EAPI-7.
+# It supports selectively building messages, single-python installation, live ebuilds (git only).
case "${EAPI:-0}" in
- 0|1|2|3|4)
+ 0|1|2|3|4|5|6)
die "EAPI='${EAPI}' is not supported"
;;
- [56])
- CMAKE_ECLASS=cmake-utils
- ;;
*)
- CMAKE_ECLASS=cmake
;;
esac
@@ -53,15 +43,12 @@ if [ "${PV#9999}" != "${PV}" ] ; then
SCM="git-r3"
fi
-# This should be temporary. ROS only really works with one global python
-# version. The idea here is to have a ROS_COMPAT in the same vein as
-# PYTHON_COMPAT where packages would define what distro they can work on, then
-# we'd have ros_distro_gentoo_python_2_7 & co plus the OSRF ones (lunar, etc.).
-# Note that this unconditionally pulls python but in the ROS world there will
-# most certainly be something pulling python anyway.
-PYTHON_COMPAT=( python3_6 )
+# ROS only really works with one global python version and the target
+# version depends on the release. Noetic targets 3.7 and 3.8.
+# py3.8 or later are ok to add there as long as dev-ros/* have their deps satisfied.
+PYTHON_COMPAT=( python3_7 )
-inherit ${SCM} python-r1 ${CMAKE_ECLASS} flag-o-matic
+inherit ${SCM} python-single-r1 cmake flag-o-matic
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
@@ -69,8 +56,8 @@ IUSE="test"
RESTRICT="!test? ( test )"
RDEPEND="${PYTHON_DEPS}"
DEPEND="${RDEPEND}
- dev-util/catkin[${PYTHON_USEDEP}]
- dev-python/empy[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep "dev-util/catkin[\${PYTHON_USEDEP}]")
+ $(python_gen_cond_dep "dev-python/empy[\${PYTHON_USEDEP}]")
"
# @ECLASS-VARIABLE: CATKIN_HAS_MESSAGES
@@ -86,20 +73,20 @@ DEPEND="${RDEPEND}
if [ -n "${CATKIN_HAS_MESSAGES}" ] ; then
IUSE="${IUSE} +ros_messages_python +ros_messages_cxx ros_messages_eus ros_messages_lisp ros_messages_nodejs"
RDEPEND="${RDEPEND}
- ros_messages_cxx? ( dev-ros/gencpp:= dev-ros/gencpp[${PYTHON_USEDEP}] )
- ros_messages_eus? ( dev-ros/geneus:= dev-ros/geneus[${PYTHON_USEDEP}] )
- ros_messages_python? ( dev-ros/genpy:= dev-ros/genpy[${PYTHON_USEDEP}] )
- ros_messages_lisp? ( dev-ros/genlisp:= dev-ros/genlisp[${PYTHON_USEDEP}] )
- ros_messages_nodejs? ( dev-ros/gennodejs:= dev-ros/gennodejs[${PYTHON_USEDEP}] )
+ ros_messages_cxx? ( dev-ros/gencpp:=[${PYTHON_SINGLE_USEDEP}] )
+ ros_messages_eus? ( dev-ros/geneus:=[${PYTHON_SINGLE_USEDEP}] )
+ ros_messages_python? ( dev-ros/genpy:=[${PYTHON_SINGLE_USEDEP}] )
+ ros_messages_lisp? ( dev-ros/genlisp:=[${PYTHON_SINGLE_USEDEP}] )
+ ros_messages_nodejs? ( dev-ros/gennodejs:=[${PYTHON_SINGLE_USEDEP}] )
dev-ros/message_runtime
"
DEPEND="${DEPEND} ${RDEPEND}
dev-ros/message_generation
- dev-ros/genmsg[${PYTHON_USEDEP}]
+ dev-ros/genmsg[${PYTHON_SINGLE_USEDEP}]
"
if [ -n "${CATKIN_MESSAGES_TRANSITIVE_DEPS}" ] ; then
for i in ${CATKIN_MESSAGES_TRANSITIVE_DEPS} ; do
- ds="${i}[ros_messages_python(-)?,ros_messages_cxx(-)?,ros_messages_lisp(-)?,ros_messages_eus(-)?,ros_messages_nodejs(-)?] ros_messages_python? ( ${i}[${PYTHON_USEDEP}] )"
+ ds="${i}[ros_messages_python(-)?,ros_messages_cxx(-)?,ros_messages_lisp(-)?,ros_messages_eus(-)?,ros_messages_nodejs(-)?] ros_messages_python? ( ${i}[${PYTHON_SINGLE_USEDEP}] )"
RDEPEND="${RDEPEND} ${ds}"
DEPEND="${DEPEND} ${ds}"
done
@@ -114,7 +101,7 @@ CATKIN_MESSAGES_CXX_USEDEP="ros_messages_cxx(-)"
# @ECLASS-VARIABLE: CATKIN_MESSAGES_PYTHON_USEDEP
# @DESCRIPTION:
# Use it as cat/pkg[${CATKIN_MESSAGES_PYTHON_USEDEP}] to indicate a dependency on the Python messages of cat/pkg.
-CATKIN_MESSAGES_PYTHON_USEDEP="ros_messages_python(-),${PYTHON_USEDEP}"
+CATKIN_MESSAGES_PYTHON_USEDEP="ros_messages_python(-),${PYTHON_SINGLE_USEDEP}"
# @ECLASS-VARIABLE: CATKIN_MESSAGES_LISP_USEDEP
# @DESCRIPTION:
@@ -150,7 +137,7 @@ ros-catkin_src_prepare() {
# If no multibuild, just use cmake IN_SOURCE support
[ -n "${CATKIN_IN_SOURCE_BUILD}" ] && export CMAKE_IN_SOURCE_BUILD=yes
- ${CMAKE_ECLASS}_src_prepare
+ cmake_src_prepare
if [ ! -f "${S}/CMakeLists.txt" ] ; then
catkin_init_workspace || die
@@ -161,17 +148,6 @@ ros-catkin_src_prepare() {
append-cxxflags '-std=c++14'
}
-# @FUNCTION: ros-catkin_python_setup
-# @DESCRIPTION:
-# Sets up python environment for ROS packages.
-ros-catkin_python_setup() {
- # Todo: Need to match this with ros distro.
- local pyimpl="${PYTHON_COMPAT[0]}"
- python_export "${pyimpl}" EPYTHON PYTHON
- python_wrapper_setup
- python_export PYTHON_SCRIPTDIR
-}
-
# @VARIABLE: mycatkincmakeargs
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -182,10 +158,10 @@ ros-catkin_python_setup() {
# @DESCRIPTION:
# Configures a catkin-based package.
ros-catkin_src_configure() {
- ros-catkin_python_setup
-
export CATKIN_PREFIX_PATH="${EPREFIX}/usr"
export ROS_ROOT="${EPREFIX}/usr/share/ros"
+ export ROS_PYTHON_VERSION="${EPYTHON#python}"
+
if [ -n "${CATKIN_HAS_MESSAGES}" ] ; then
ROS_LANG_DISABLE=""
use ros_messages_cxx || ROS_LANG_DISABLE="${ROS_LANG_DISABLE}:gencpp"
@@ -212,15 +188,14 @@ ros-catkin_src_configure() {
export CMAKE_USE_DIR="${BUILD_DIR}"
fi
- ${CMAKE_ECLASS}_src_configure "${@}"
+ cmake_src_configure "${@}"
}
# @FUNCTION: ros-catkin_src_compile
# @DESCRIPTION:
# Builds a catkin-based package.
ros-catkin_src_compile() {
- ros-catkin_python_setup
- ${CMAKE_ECLASS}_src_compile "${@}"
+ cmake_src_compile "${@}"
}
# @FUNCTION: ros-catkin_src_test
@@ -229,40 +204,26 @@ ros-catkin_src_compile() {
ros-catkin_src_test() {
cd "${BUILD_DIR}" || die
- ros-catkin_python_setup
-
# Regenerate env for tests, PYTHONPATH is not set properly otherwise...
if [ -f catkin_generated/generate_cached_setup.py ] ; then
einfo "Regenerating setup_cached.sh for tests"
${PYTHON:-python} catkin_generated/generate_cached_setup.py || die
fi
- if [[ ${CMAKE_ECLASS} = cmake-utils ]]; then
- nonfatal cmake-utils_src_make tests
- else
- nonfatal cmake_build tests
- fi
- ${CMAKE_ECLASS}_src_test "${@}"
+ nonfatal cmake_build tests
+ cmake_src_test "${@}"
}
# @FUNCTION: ros-catkin_src_install
# @DESCRIPTION:
# Installs a catkin-based package.
ros-catkin_src_install() {
- ros-catkin_python_setup
-
if [ -n "${CATKIN_IN_SOURCE_BUILD}" ] ; then
export CMAKE_USE_DIR="${BUILD_DIR}"
fi
- ${CMAKE_ECLASS}_src_install "${@}"
- if [ ! -f "${T}/.catkin_python_symlinks_generated" -a -d "${D}/${PYTHON_SCRIPTDIR}" ]; then
- dodir /usr/bin
- for i in "${D}/${PYTHON_SCRIPTDIR}"/* ; do
- dosym ../lib/python-exec/python-exec2 "/usr/bin/${i##*/}"
- done
- touch "${T}/.catkin_python_symlinks_generated" || die
- fi
+ cmake_src_install "${@}"
+ python_optimize
}
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index d0956082f816..8ab448765946 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ruby-fakegem.eclass
@@ -182,7 +182,9 @@ esac
SRC_URI="https://rubygems.org/gems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}${RUBY_FAKEGEM_SUFFIX:+-${RUBY_FAKEGEM_SUFFIX}}.gem"
-ruby_add_bdepend virtual/rubygems
+# dev-ruby/psych is no longer installed and is incompatible with modern
+# ruby versions.
+ruby_add_bdepend "virtual/rubygems !!dev-ruby/psych"
ruby_add_rdepend virtual/rubygems
case ${EAPI} in
4|5|6)
diff --git a/eclass/ruby-ng-gnome2.eclass b/eclass/ruby-ng-gnome2.eclass
index ce52f27789a2..3b18faf95aae 100644
--- a/eclass/ruby-ng-gnome2.eclass
+++ b/eclass/ruby-ng-gnome2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ruby-ng-gnome2.eclass
@@ -6,15 +6,15 @@
# Ruby herd <ruby@gentoo.org>
# @AUTHOR:
# Author: Hans de Graaff <graaff@gentoo.org>
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6
+# @SUPPORTED_EAPIS: 6 7
# @BLURB: An eclass to simplify handling of various ruby-gnome2 parts.
# @DESCRIPTION:
# This eclass simplifies installation of the various pieces of
# ruby-gnome2 since they share a very common installation procedure.
case "${EAPI:-0}" in
- 0|1|2|3|4|5|6)
- ;;
+ 6) inherit eapi7-ver ;;
+ 7) ;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
;;
@@ -24,35 +24,65 @@ RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN#ruby-}}"
RUBY_FAKEGEM_TASK_TEST=""
RUBY_FAKEGEM_TASK_DOC=""
-inherit ruby-fakegem multilib versionator
+# @ECLASS-VARIABLE: RUBY_GNOME2_NEED_VIRTX
+# @PRE_INHERIT
+# @DESCRIPTION:
+# If set to 'yes', the test is run with virtx. Set before inheriting this
+# eclass.
+: ${RUBY_GNOME2_NEED_VIRTX:="no"}
-IUSE=""
+inherit ruby-fakegem
+if [[ ${RUBY_GNOME2_NEED_VIRTX} == yes ]]; then
+ inherit virtualx
+fi
-# Define EPREFIX if needed
-has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+IUSE="test"
+RESTRICT+=" !test? ( test )"
-subbinding=${PN#ruby-}
-if [ $(get_version_component_range "1-2") == "0.19" ]; then
- subbinding=${subbinding/%2}
-else
- subbinding=${subbinding/-/_}
- DEPEND="virtual/pkgconfig"
- ruby_add_bdepend "dev-ruby/pkg-config"
-fi
-if has "${EAPI:-0}" 0 1 2 3 ; then
- S=${WORKDIR}/ruby-gnome2-all-${PV}/${subbinding}
-else
- RUBY_S=ruby-gnome2-all-${PV}/${subbinding}
-fi
+DEPEND="virtual/pkgconfig"
+ruby_add_bdepend "
+ dev-ruby/pkg-config
+ test? ( >=dev-ruby/test-unit-2 )"
SRC_URI="mirror://sourceforge/ruby-gnome2/ruby-gnome2-all-${PV}.tar.gz"
HOMEPAGE="https://ruby-gnome2.osdn.jp/"
-LICENSE="Ruby"
+LICENSE="LGPL-2.1+"
SLOT="0"
+if ver_test -ge "3.4.0"; then
+ SRC_URI="https://github.com/ruby-gnome/ruby-gnome/archive/${PV}.tar.gz -> ruby-gnome2-${PV}.tar.gz"
+ RUBY_S=ruby-gnome-${PV}/${RUBY_FAKEGEM_NAME}
+else
+ SRC_URI="mirror://sourceforge/ruby-gnome2/ruby-gnome2-all-${PV}.tar.gz"
+ RUBY_S=ruby-gnome2-all-${PV}/${RUBY_FAKEGEM_NAME}
+fi
+
+ruby-ng-gnome2_all_ruby_prepare() {
+ # Avoid compilation of dependencies during test.
+ if [[ -e test/run-test.rb ]]; then
+ sed -i -e '/system(/s/which make/true/' test/run-test.rb || die
+ fi
+
+ # work on top directory
+ pushd .. >/dev/null
+
+ # Avoid native installer
+ if [[ -e glib2/lib/mkmf-gnome.rb ]]; then
+ sed -i -e '/native-package-installer/ s:^:#:' \
+ -e '/^setup_homebrew/ s:^:#:' glib2/lib/mkmf-gnome.rb || die
+ fi
+
+ popd >/dev/null
+}
+
+all_ruby_prepare() {
+ ruby-ng-gnome2_all_ruby_prepare
+}
# @FUNCTION: each_ruby_configure
# @DESCRIPTION:
# Run the configure script in the subbinding for each specific ruby target.
each_ruby_configure() {
+ [[ -e extconf.rb ]] || return
+
${RUBY} extconf.rb || die "extconf.rb failed"
}
@@ -60,6 +90,8 @@ each_ruby_configure() {
# @DESCRIPTION:
# Compile the C bindings in the subbinding for each specific ruby target.
each_ruby_compile() {
+ [[ -e Makefile ]] || return
+
# We have injected --no-undefined in Ruby as a safety precaution
# against broken ebuilds, but the Ruby-Gnome bindings
# unfortunately rely on the lazy load of other extensions; see bug
@@ -69,18 +101,20 @@ each_ruby_compile() {
-e "s/^ldflags = /ldflags = $\(LDFLAGS\) /" \
|| die "--no-undefined removal failed"
- emake V=1 || die "emake failed"
+ emake V=1
}
# @FUNCTION: each_ruby_install
# @DESCRIPTION:
# Install the files in the subbinding for each specific ruby target.
each_ruby_install() {
- # Create the directories, or the package will create them as files.
- local archdir=$(ruby_rbconfig_value "sitearchdir")
- dodir ${archdir#${EPREFIX}} /usr/$(get_libdir)/pkgconfig
+ if [[ -e Makefile ]]; then
+ # Create the directories, or the package will create them as files.
+ local archdir=$(ruby_rbconfig_value "sitearchdir")
+ dodir ${archdir#${EPREFIX}} /usr/$(get_libdir)/pkgconfig
- emake DESTDIR="${D}" install || die "make install failed"
+ emake DESTDIR="${D}" install
+ fi
each_fakegem_install
}
@@ -90,12 +124,25 @@ each_ruby_install() {
# Install the files common to all ruby targets.
all_ruby_install() {
for doc in ../AUTHORS ../NEWS ChangeLog README; do
- [ -s "$doc" ] && dodoc $doc
+ [[ -s ${doc} ]] && dodoc $doc
done
if [[ -d sample ]]; then
insinto /usr/share/doc/${PF}
- doins -r sample || die "sample install failed"
+ doins -r sample
fi
all_fakegem_install
}
+
+# @FUNCTION: each_ruby_test
+# @DESCRIPTION:
+# Run the tests for this package.
+each_ruby_test() {
+ [[ -e test/run-test.rb ]] || return
+
+ if [[ ${RUBY_GNOME2_NEED_VIRTX} == yes ]]; then
+ virtx ${RUBY} test/run-test.rb
+ else
+ ${RUBY} test/run-test.rb || die
+ fi
+}
diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index f92547b49a9f..e52c507d8010 100644
--- a/eclass/ruby-ng.eclass
+++ b/eclass/ruby-ng.eclass
@@ -118,7 +118,7 @@ _ruby_get_all_impls() {
for i in ${USE_RUBY}; do
case ${i} in
# removed implementations
- ruby19|ruby20|ruby21|ruby22|ruby23|jruby)
+ ruby19|ruby20|ruby21|ruby22|ruby23|ruby24|jruby)
;;
*)
echo ${i};;
diff --git a/eclass/ruby-utils.eclass b/eclass/ruby-utils.eclass
index 2934c94ffac9..3f2acc023a5f 100644
--- a/eclass/ruby-utils.eclass
+++ b/eclass/ruby-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ruby-utils.eclass
@@ -28,7 +28,7 @@ if [[ ! ${_RUBY_UTILS} ]]; then
# provide for a better first installation experience.
# All stable RUBY_TARGETS
-RUBY_TARGETS_PREFERENCE="ruby25 ruby24 "
+RUBY_TARGETS_PREFERENCE="ruby25 "
# All other active ruby targets
RUBY_TARGETS_PREFERENCE+="ruby26 ruby27"
diff --git a/eclass/sword-module.eclass b/eclass/sword-module.eclass
index 6e8d38c769d7..2ae58d1e51bc 100644
--- a/eclass/sword-module.eclass
+++ b/eclass/sword-module.eclass
@@ -1,33 +1,95 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+# @ECLASS: sword-module.eclass
+# @MAINTAINER:
+# Marek Szuba <marecki@gentoo.org>
+# @SUPPORTED_EAPIS: 7
+# @BLURB: Simplify installation of SWORD modules
+# @DESCRIPTION:
+# This eclass provides dependencies, ebuild environment and the src_install
+# function common to all app-text/sword modules published by the SWORD Project.
#
-# eclass to simplify installation of Sword modules
-# Bugs to theology@gentoo.org
+# Note that as of 2020-07-26 module archives published by SWORD are still
+# not versioned and it is necessary to look at respective module pages in
+# order to see what versions the currently available files are. Once
+# a module file has been replicated to the Gentoo mirror network it will be
+# versioned and remain available even after upstream has changed their
+# version, however users not using mirrors will encounter hash conflicts
+# on updated modules. Should that happen, please notify the relevant
+# package maintainers that a new version is available.
#
+# @EXAMPLE:
+# sword-Personal-1.0.ebuild, a typical ebuild using sword-module.eclass:
+#
+# @CODE
+# EAPI=7
+#
+# SWORD_MINIMUM_VERSION="1.5.1a"
+#
+# inherit sword-module
+#
+# DESCRIPTION="SWORD module for storing one's own commentary"
+# HOMEPAGE="https://crosswire.org/sword/modules/ModInfo.jsp?modName=Personal"
+# LICENSE="public-domain"
+# KEYWORDS="~amd64 ~ppc ~x86"
+#
+# @CODE
-HOMEPAGE="http://www.crosswire.org/sword/modules/"
+case ${EAPI:-0} in
+ 0|1|2|3|4|5|6)
+ die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}"
+ ;;
+ 7)
+ ;;
+ *)
+ die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
+ ;;
+esac
-# Sword packages are generally released as FooBar.zip in their 'rawzip' form
-# The files are also unversioned, so the packager will need to rename the
-# original file to something else and host it somewhere to avoid breaking
-# the digest when new versions are released.
+# @ECLASS-VARIABLE: SWORD_MINIMUM_VERSION
+# @DEFAULT_UNSET
+# @PRE_INHERIT
+# @DESCRIPTION:
+# If set to a non-null value, specifies the minimum version of app-text/sword
+# the module requires. This will be included in RDEPEND. If null or unset,
+# the dependency will be unversioned.
+# Needs to be set before the inherit line.
-SRC_URI="mirror://gentoo/${SWORD_MODULE}-${PV}.zip"
+# @ECLASS-VARIABLE: SWORD_MODULE
+# @PRE_INHERIT
+# @DESCRIPTION:
+# Case-sensitive name of the SWORD-Project module to install. If unset
+# or null, use the name produced by removing the prefix 'sword-' from PN.
+# Needs to be set before the inherit line.
+: ${SWORD_MODULE:=${PN#sword-}}
+
+EXPORT_FUNCTIONS src_install
+
+# Unless overridden at ebuild level, append version to the name of the file
+# fetched from upstream and let the Gentoo mirror network take care of
+# persisting the versioned archive.
+SRC_URI="https://crosswire.org/ftpmirror/pub/sword/packages/rawzip/${SWORD_MODULE}.zip -> ${SWORD_MODULE}-${PV}.zip"
SLOT="0"
-IUSE=""
+# Module archives contain no top-level directory.
S="${WORKDIR}"
-RDEPEND="app-text/sword"
-DEPEND="app-arch/unzip"
+if [[ ${SWORD_MINIMUM_VERSION} ]]; then
+ RDEPEND=">=app-text/sword-${SWORD_MINIMUM_VERSION}"
+else
+ RDEPEND="app-text/sword"
+fi
+
+BDEPEND="app-arch/unzip"
+# @FUNCTION: sword-module_src_install
+# @DESCRIPTION:
+# Install all the module files into directories used by app-text/sword.
sword-module_src_install() {
insinto /usr/share/sword/modules
- doins -r "${S}"/modules/*
+ doins -r modules/*
insinto /usr/share/sword/mods.d
- doins "${S}"/mods.d/*
+ doins mods.d/*
}
-
-EXPORT_FUNCTIONS src_install
diff --git a/eclass/texlive-common.eclass b/eclass/texlive-common.eclass
index 67e06adf0909..1fe33444f1e5 100644
--- a/eclass/texlive-common.eclass
+++ b/eclass/texlive-common.eclass
@@ -64,6 +64,7 @@ texlive-common_is_file_present_in_texmf() {
if [[ -d texmf-dist ]]; then
find texmf-dist -name ${1} -exec touch ${mark} {} + || die
fi
+ [ -f "${mark}" ]
}
# @FUNCTION: texlive-common_do_symlinks
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 8384e565d867..5bbf46ecd3d5 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -7,7 +7,7 @@
DESCRIPTION="The GNU Compiler Collection"
HOMEPAGE="https://gcc.gnu.org/"
-inherit eutils fixheadtails flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs prefix
+inherit eutils flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs prefix
tc_is_live() {
[[ ${PV} == *9999* ]]
@@ -99,11 +99,7 @@ fi
PREFIX=${TOOLCHAIN_PREFIX:-${EPREFIX}/usr}
-if tc_version_is_at_least 3.4.0 ; then
- LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/lib/gcc/${CTARGET}/${GCC_CONFIG_VER}}
-else
- LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/lib/gcc-lib/${CTARGET}/${GCC_CONFIG_VER}}
-fi
+LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/lib/gcc/${CTARGET}/${GCC_CONFIG_VER}}
INCLUDEPATH=${TOOLCHAIN_INCLUDEPATH:-${LIBPATH}/include}
if is_crosscompile ; then
@@ -121,20 +117,7 @@ STDCXX_INCDIR=${TOOLCHAIN_STDCXX_INCDIR:-${LIBPATH}/include/g++-v${GCC_BRANCH_VE
#---->> LICENSE+SLOT+IUSE logic <<----
-if tc_version_is_at_least 4.6 ; then
- LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.3+"
-elif tc_version_is_at_least 4.4 ; then
- LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.2+"
-elif tc_version_is_at_least 4.3 ; then
- LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ ) FDL-1.2+"
-elif tc_version_is_at_least 4.2 ; then
- LICENSE="GPL-3+ LGPL-2.1+ || ( GPL-3+ libgcc libstdc++ ) FDL-1.2+"
-elif tc_version_is_at_least 3.3 ; then
- LICENSE="GPL-2+ LGPL-2.1+ FDL-1.2+"
-else
- LICENSE="GPL-2+ LGPL-2.1+ FDL-1.1+"
-fi
-
+LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.3+"
IUSE="test vanilla +nls"
RESTRICT="!test? ( test )"
@@ -163,8 +146,6 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
fi
IUSE+=" debug +cxx +nptl" TC_FEATURES+=(nptl)
[[ -n ${PIE_VER} ]] && IUSE+=" nopie"
- [[ -n ${HTB_VER} ]] && IUSE+=" boundschecking"
- [[ -n ${D_VER} ]] && IUSE+=" d"
[[ -n ${SPECS_VER} ]] && IUSE+=" nossp"
# fortran support appeared in 4.1, but 4.1 needs outdated mpfr
tc_version_is_at_least 4.2 && IUSE+=" +fortran" TC_FEATURES+=(fortran)
@@ -173,7 +154,6 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
tc_version_is_at_least 3.3 && IUSE+=" pgo"
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"
tc_version_is_at_least 4.3 && IUSE+=" fixed-point"
@@ -200,6 +180,7 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
tc_version_is_at_least 9.0 && IUSE+=" d"
tc_version_is_at_least 9.1 && IUSE+=" lto"
tc_version_is_at_least 10 && IUSE+=" zstd" TC_FEATURES+=(zstd)
+ tc_version_is_at_least 11 && IUSE+=" valgrind" TC_FEATURES+=(valgrind)
fi
if tc_version_is_at_least 10; then
@@ -272,11 +253,15 @@ if tc_has_feature zstd ; then
DEPEND+=" zstd? ( app-arch/zstd )"
fi
+if tc_has_feature valgrind; then
+ BDEPEND+=" valgrind? ( dev-util/valgrind )"
+fi
+
case ${EAPI:-0} in
5*|6) DEPEND+=" ${BDEPEND}" ;;
esac
-PDEPEND=">=sys-devel/gcc-config-1.7"
+PDEPEND=">=sys-devel/gcc-config-2.3"
#---->> S + SRC_URI essentials <<----
@@ -348,13 +333,6 @@ gentoo_urls() {
# The resulting filename of this tarball will be:
# gcc-${SPECS_GCC_VER:-${GCC_RELEASE_VER}}-specs-${SPECS_VER}.tar.bz2
#
-# HTB_VER
-# HTB_GCC_VER
-# These variables control whether or not an ebuild supports Herman
-# ten Brugge's bounds-checking patches. If you want to use a patch
-# for an older gcc version with a new gcc, make sure you set
-# HTB_GCC_VER to that version of gcc.
-#
# CYGWINPORTS_GITREV
# If set, this variable signals that we should apply additional patches
# maintained by upstream Cygwin developers at github/cygwinports/gcc,
@@ -399,19 +377,6 @@ get_gcc_src_uri() {
[[ -n ${SPECS_VER} ]] && \
GCC_SRC_URI+=" $(gentoo_urls gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.bz2)"
- # gcc bounds checking patch
- if [[ -n ${HTB_VER} ]] ; then
- local HTBFILE="bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch.bz2"
- GCC_SRC_URI+="
- boundschecking? (
- mirror://sourceforge/boundschecking/${HTBFILE}
- $(gentoo_urls ${HTBFILE})
- )"
- fi
-
- [[ -n ${D_VER} ]] && \
- GCC_SRC_URI+=" d? ( mirror://sourceforge/dgcc/gdc-${D_VER}-src.tar.bz2 )"
-
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 )"
@@ -482,20 +447,7 @@ toolchain_src_prepare() {
export BRANDING_GCC_PKGVERSION="Gentoo ${GCC_PVR}"
cd "${S}"
- if [[ -n ${D_VER} ]] && use d ; then
- mv "${WORKDIR}"/d gcc/d || die
- ebegin "Adding support for the D language"
- ./gcc/d/setup-gcc.sh >& "${T}"/dgcc.log
- if ! eend $? ; then
- eerror "The D GCC package failed to apply"
- eerror "Please include this log file when posting a bug report:"
- eerror " ${T}/dgcc.log"
- die "failed to include the D language"
- fi
- fi
-
do_gcc_gentoo_patches
- do_gcc_HTB_patches
do_gcc_PIE_patches
do_gcc_CYGWINPORTS_patches
@@ -513,38 +465,19 @@ toolchain_src_prepare() {
make_gcc_hard
fi
- # install the libstdc++ python into the right location
- # http://gcc.gnu.org/PR51368
- if tc_version_is_between 4.5 4.7 ; then
- sed -i \
- '/^pythondir =/s:=.*:= $(datadir)/python:' \
- "${S}"/libstdc++-v3/python/Makefile.in || die
- fi
-
# make sure the pkg config files install into multilib dirs.
# since we configure with just one --libdir, we can't use that
# (as gcc itself takes care of building multilibs). #435728
find "${S}" -name Makefile.in \
-exec sed -i '/^pkgconfigdir/s:=.*:=$(toolexeclibdir)/pkgconfig:' {} +
- # No idea when this first started being fixed, but let's go with 4.3.x for now
- if ! tc_version_is_at_least 4.3 ; then
- fix_files=""
- for x in contrib/test_summary libstdc++-v3/scripts/check_survey.in ; do
- [[ -e ${x} ]] && fix_files="${fix_files} ${x}"
- done
- ht_fix_file ${fix_files} */configure *.sh */Makefile.in
- fi
-
setup_multilib_osdirnames
gcc_version_patch
- if tc_version_is_at_least 4.1 ; then
- local actual_version=$(< "${S}"/gcc/BASE-VER)
- if [[ "${GCC_RELEASE_VER}" != "${actual_version}" ]] ; then
- eerror "'${S}/gcc/BASE-VER' contains '${actual_version}', expected '${GCC_RELEASE_VER}'"
- die "Please set 'TOOLCHAIN_GCC_PV' to '${actual_version}'"
- fi
+ local actual_version=$(< "${S}"/gcc/BASE-VER)
+ if [[ "${GCC_RELEASE_VER}" != "${actual_version}" ]] ; then
+ eerror "'${S}/gcc/BASE-VER' contains '${actual_version}', expected '${GCC_RELEASE_VER}'"
+ die "Please set 'TOOLCHAIN_GCC_PV' to '${actual_version}'"
fi
# >= gcc-4.3 doesn't bundle ecj.jar, so copy it
@@ -558,19 +491,6 @@ toolchain_src_prepare() {
fi
fi
- # disable --as-needed from being compiled into gcc specs
- # natively when using a gcc version < 3.4.4
- # http://gcc.gnu.org/PR14992
- if ! tc_version_is_at_least 3.4.4 ; then
- sed -i -e s/HAVE_LD_AS_NEEDED/USE_LD_AS_NEEDED/g "${S}"/gcc/config.in
- fi
-
- # In gcc 3.3.x and 3.4.x, rename the java bins to gcc-specific names
- # in line with gcc-4.
- if tc_version_is_between 3.3 4.0 ; then
- do_gcc_rename_java_bins
- fi
-
# Prevent libffi from being installed
if tc_version_is_between 3.0 4.8 ; then
sed -i -e 's/\(install.*:\) install-.*recursive/\1/' "${S}"/libffi/Makefile.in || die
@@ -620,14 +540,6 @@ do_gcc_gentoo_patches() {
fi
}
-do_gcc_HTB_patches() {
- use_if_iuse boundschecking || return 0
-
- # modify the bounds checking patch with a regression patch
- tc_apply_patches "Bounds checking patch" "${WORKDIR}/bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch"
- BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, HTB-${HTB_GCC_VER}-${HTB_VER}"
-}
-
do_gcc_PIE_patches() {
want_pie || return 0
use vanilla && return 0
@@ -793,41 +705,6 @@ gcc_version_patch() {
sed -i "${gcc_sed[@]}" "${S}"/gcc/version.c || die
}
-do_gcc_rename_java_bins() {
- # bug #139918 - conflict between gcc and java-config-2 for ownership of
- # /usr/bin/rmi{c,registry}. Done with mv & sed rather than a patch
- # because patches would be large (thanks to the rename of man files),
- # and it's clear from the sed invocations that all that changes is the
- # rmi{c,registry} names to grmi{c,registry} names.
- # Kevin F. Quinn 2006-07-12
- einfo "Renaming jdk executables rmic and rmiregistry to grmic and grmiregistry."
- # 1) Move the man files if present (missing prior to gcc-3.4)
- for manfile in rmic rmiregistry ; do
- [[ -f ${S}/gcc/doc/${manfile}.1 ]] || continue
- mv "${S}"/gcc/doc/${manfile}.1 "${S}"/gcc/doc/g${manfile}.1
- done
- # 2) Fixup references in the docs if present (mission prior to gcc-3.4)
- for jfile in gcc/doc/gcj.info gcc/doc/grmic.1 gcc/doc/grmiregistry.1 gcc/java/gcj.texi ; do
- [[ -f ${S}/${jfile} ]] || continue
- sed -i -e 's:rmiregistry:grmiregistry:g' "${S}"/${jfile} ||
- die "Failed to fixup file ${jfile} for rename to grmiregistry"
- sed -i -e 's:rmic:grmic:g' "${S}"/${jfile} ||
- die "Failed to fixup file ${jfile} for rename to grmic"
- done
- # 3) Fixup Makefiles to build the changed executable names
- # These are present in all 3.x versions, and are the important bit
- # to get gcc to build with the new names.
- for jfile in libjava/Makefile.am libjava/Makefile.in gcc/java/Make-lang.in ; do
- sed -i -e 's:rmiregistry:grmiregistry:g' "${S}"/${jfile} ||
- die "Failed to fixup file ${jfile} for rename to grmiregistry"
- # Careful with rmic on these files; it's also the name of a directory
- # which should be left unchanged. Replace occurrences of 'rmic$',
- # 'rmic_' and 'rmic '.
- sed -i -e 's:rmic\([$_ ]\):grmic\1:g' "${S}"/${jfile} ||
- die "Failed to fixup file ${jfile} for rename to grmic"
- done
-}
-
#---->> src_configure <<----
toolchain_src_configure() {
@@ -1025,6 +902,9 @@ toolchain_src_configure() {
esac
if [[ -n ${needed_libc} ]] ; then
local confgcc_no_libc=( --disable-shared )
+ # requires libc: bug #734820
+ tc_version_is_at_least 4.6 && confgcc_no_libc+=( --disable-libquadmath )
+ # requires libc
tc_version_is_at_least 4.8 && confgcc_no_libc+=( --disable-libatomic )
if ! has_version ${CATEGORY}/${needed_libc} ; then
confgcc+=(
@@ -1032,6 +912,14 @@ toolchain_src_configure() {
--disable-threads
--without-headers
)
+ if [[ $needed_libc == glibc ]]; then
+ # By default gcc looks at glibc's headers
+ # to detect long double support. This does
+ # not work for --disable-headers mode.
+ # Any >=glibc-2.4 is good enough for float128.
+ # The option appeared in gcc-4.2.
+ confgcc+=( --with-long-double-128 )
+ fi
elif has_version "${CATEGORY}/${needed_libc}[headers-only(-)]" ; then
confgcc+=(
"${confgcc_no_libc[@]}"
@@ -1236,12 +1124,6 @@ toolchain_src_configure() {
fi
if tc_version_is_at_least 4.0 ; then
- if in_iuse mudflap ; then
- confgcc+=( $(use_enable mudflap libmudflap) )
- else
- confgcc+=( --disable-libmudflap )
- fi
-
if use_if_iuse libssp ; then
confgcc+=( --enable-libssp )
else
@@ -1278,6 +1160,10 @@ toolchain_src_configure() {
confgcc+=( $(use_enable systemtap) )
fi
+ if in_iuse valgrind ; then
+ confgcc+=( $(use_enable valgrind valgrind-annotations) )
+ fi
+
if in_iuse vtv ; then
confgcc+=(
$(use_enable vtv vtable-verify)
@@ -1290,12 +1176,6 @@ toolchain_src_configure() {
confgcc+=( $(use_with zstd) )
fi
- # newer gcc's come with libquadmath, but only fortran uses
- # it, so auto punt it when we don't care
- if tc_version_is_at_least 4.6 && ! is_fortran ; then
- confgcc+=( --disable-libquadmath )
- fi
-
if tc_version_is_at_least 4.6 ; then
confgcc+=( --enable-lto )
elif tc_version_is_at_least 4.5 ; then
@@ -1698,8 +1578,7 @@ gcc_do_make() {
# Older versions of GCC could not do profiledbootstrap in parallel due to
# collisions with profiling info.
- # boundschecking also seems to introduce parallel build issues.
- if [[ ${GCC_MAKE_TARGET} == "profiledbootstrap" ]] || use_if_iuse boundschecking ; then
+ if [[ ${GCC_MAKE_TARGET} == "profiledbootstrap" ]]; then
! tc_version_is_at_least 4.6 && export MAKEOPTS="${MAKEOPTS} -j1"
fi
@@ -1914,11 +1793,6 @@ toolchain_src_install() {
# prune empty dirs left behind
find "${ED}" -depth -type d -delete 2>/dev/null
- if ! is_crosscompile && [[ ${PN} != "kgcc64" ]] ; then
- exeinto "${DATAPATH#${EPREFIX}}"
- doexe "${FILESDIR}"/c{89,99} || die
- fi
-
# libstdc++.la: Delete as it doesn't add anything useful: g++ itself
# handles linkage correctly in the dynamic & static case. It also just
# causes us pain: any C++ progs/libs linking with libtool will gain a
@@ -2008,6 +1882,12 @@ gcc_movelibs() {
dodir "${HOSTLIBPATH#${EPREFIX}}"
mv "${ED}"/usr/$(get_libdir)/libcc1* "${D}${HOSTLIBPATH}" || die
fi
+ # libgccjit gets installed to /usr/lib, not /usr/$(get_libdir). Probably
+ # due to a bug in gcc build system.
+ if is_jit ; then
+ dodir "${LIBPATH#${EPREFIX}}"
+ mv "${ED}"/usr/lib/libgccjit* "${D}${LIBPATH}" || die
+ fi
# For all the libs that are built for CTARGET, move them into the
# compiler-specific CTARGET internal dir.
@@ -2223,12 +2103,8 @@ toolchain_pkg_postinst() {
# gcc stopped installing .la files fixer in June 2020.
# Cleaning can be removed in June 2022.
rm -f "${EROOT%/}"/sbin/fix_libtool_files.sh
+ rm -f "${EROOT%/}"/usr/sbin/fix_libtool_files.sh
rm -f "${EROOT%/}"/usr/share/gcc-data/fixlafiles.awk
-
- mkdir -p "${EROOT%/}"/usr/bin
- # Since these aren't critical files and portage sucks with
- # handling of binpkgs, don't require these to be found
- cp "${ROOT%/}${DATAPATH}"/c{89,99} "${EROOT%/}"/usr/bin/ 2>/dev/null
fi
}
@@ -2238,11 +2114,6 @@ toolchain_pkg_postrm() {
eselect compiler-shadow clean all
fi
- # to make our lives easier (and saner), we do the fix_libtool stuff here.
- # rather than checking SLOT's and trying in upgrade paths, we just see if
- # the common libstdc++.la exists in the ${LIBPATH} of the gcc that we are
- # unmerging. if it does, that means this was a simple re-emerge.
-
# clean up the cruft left behind by cross-compilers
if is_crosscompile ; then
if [[ -z $(ls "${EROOT%/}"/etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then
diff --git a/eclass/vala.eclass b/eclass/vala.eclass
index c0620dbaa0b9..52899f163dcf 100644
--- a/eclass/vala.eclass
+++ b/eclass/vala.eclass
@@ -32,7 +32,7 @@ VALA_MIN_API_VERSION=${VALA_MIN_API_VERSION:-0.36}
# @ECLASS-VARIABLE: VALA_MAX_API_VERSION
# @DESCRIPTION:
# Maximum vala API version (e.g. 0.36).
-VALA_MAX_API_VERSION=${VALA_MAX_API_VERSION:-0.48}
+VALA_MAX_API_VERSION=${VALA_MAX_API_VERSION:-0.50}
# @ECLASS-VARIABLE: VALA_USE_DEPEND
# @DEFAULT_UNSET
diff --git a/eclass/xorg-3.eclass b/eclass/xorg-3.eclass
index 168e58b42c81..78c843401cc7 100644
--- a/eclass/xorg-3.eclass
+++ b/eclass/xorg-3.eclass
@@ -27,6 +27,20 @@ if [[ ${PV} == *9999* ]]; then
XORG_EAUTORECONF="yes"
fi
+# If we're a font package, but not the font.alias one
+FONT_ECLASS=""
+if [[ ${CATEGORY} = media-fonts ]]; then
+ case ${PN} in
+ font-alias|font-util)
+ ;;
+ font*)
+ # Activate font code in the rest of the eclass
+ FONT="yes"
+ FONT_ECLASS="font"
+ ;;
+ esac
+fi
+
# @ECLASS-VARIABLE: XORG_MULTILIB
# @DESCRIPTION:
# If set to 'yes', the multilib support for package will be enabled. Set
@@ -34,13 +48,14 @@ fi
: ${XORG_MULTILIB:="no"}
# we need to inherit autotools first to get the deps
-inherit autotools libtool multilib toolchain-funcs flag-o-matic ${GIT_ECLASS}
+inherit autotools libtool multilib toolchain-funcs flag-o-matic \
+ ${FONT_ECLASS} ${GIT_ECLASS}
if [[ ${XORG_MULTILIB} == yes ]]; then
inherit multilib-minimal
fi
-EXPORTED_FUNCTIONS="src_prepare src_configure src_unpack src_compile src_install"
+EXPORTED_FUNCTIONS="src_prepare src_configure src_unpack src_compile src_install pkg_postinst pkg_postrm"
case "${EAPI:-0}" in
7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
@@ -66,19 +81,20 @@ IUSE=""
# @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
+# doc, data, util, driver, font, 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/ ;;
- media-fonts) XORG_MODULE=font/ ;;
- 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= ;;
+ case "${CATEGORY}/${P}" in
+ app-doc/*) XORG_MODULE=doc/ ;;
+ media-fonts/*) XORG_MODULE=font/ ;;
+ 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/xcb-util-*) XORG_MODULE=xcb/ ;;
+ x11-libs/*) XORG_MODULE=lib/ ;;
+ *) XORG_MODULE= ;;
esac
fi
@@ -116,7 +132,9 @@ 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"
+ EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.18"
+ # Required even by xorg-server
+ [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0"
fi
WANT_AUTOCONF="latest"
WANT_AUTOMAKE="latest"
@@ -129,6 +147,31 @@ BDEPEND+=" ${EAUTORECONF_DEPENDS}"
unset EAUTORECONF_DEPENDS
unset EAUTORECONF_DEPEND
+if [[ ${FONT} == yes ]]; then
+ RDEPEND+=" media-fonts/encodings
+ >=x11-apps/mkfontscale-1.2.0"
+ PDEPEND+=" media-fonts/font-alias"
+ DEPEND+=" >=media-fonts/font-util-1.2.0
+ >=x11-apps/mkfontscale-1.2.0"
+ BDEPEND+=" x11-apps/bdftopcf"
+
+ # @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.
+ [[ -z ${FONT_DIR} ]] && 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}
+
+ [[ ${PN} = font-misc-misc || ${PN} = font-schumacher-misc || ${PN##*-} = 75dpi || ${PN##*-} = 100dpi || ${PN##*-} = cyrillic ]] && IUSE+=" nls"
+fi
+
# @ECLASS-VARIABLE: XORG_STATIC
# @DESCRIPTION:
# Enables static-libs useflag. Set to no, if your package gets:
@@ -138,6 +181,7 @@ unset EAUTORECONF_DEPEND
# Add static-libs useflag where useful.
if [[ ${XORG_STATIC} == yes \
+ && ${FONT} != yes \
&& ${CATEGORY} != app-doc \
&& ${CATEGORY} != x11-apps \
&& ${CATEGORY} != x11-drivers \
@@ -224,6 +268,15 @@ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND=${RDEPEND}"
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: PDEPEND=${PDEPEND}"
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: BDEPEND=${BDEPEND}"
+# @FUNCTION: xorg-3_pkg_setup
+# @DESCRIPTION:
+# Setup prefix compat
+xorg-3_pkg_setup() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ [[ ${FONT} == yes ]] && font_pkg_setup "$@"
+}
+
# @FUNCTION: xorg-3_src_unpack
# @DESCRIPTION:
# Simply unpack source code.
@@ -235,6 +288,8 @@ xorg-3_src_unpack() {
else
unpack ${A}
fi
+
+ [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}"
}
# @FUNCTION: xorg-3_reconf_source
@@ -270,6 +325,40 @@ xorg-3_src_prepare() {
xorg-3_reconf_source
}
+# @FUNCTION: xorg-3_font_configure
+# @DESCRIPTION:
+# If a font package, perform any necessary configuration steps
+xorg-3_font_configure() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ if has nls ${IUSE//+} && ! use nls; then
+ if grep -q -s "disable-all-encodings" ${ECONF_SOURCE:-.}/configure; then
+ FONT_OPTIONS+="
+ --disable-all-encodings
+ --enable-iso8859-1"
+ else
+ 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: xorg-3_flags_setup
# @DESCRIPTION:
# Set up CFLAGS for a debug build
@@ -308,6 +397,8 @@ xorg-3_src_configure() {
# @DEFAULT_UNSET
local xorgconfadd=("${XORG_CONFIGURE_OPTIONS[@]}")
+ [[ -n "${FONT}" ]] && xorg-3_font_configure
+
# Check if package supports disabling of dep tracking
# Fixes warnings like:
# WARNING: unrecognized options: --disable-dependency-tracking
@@ -323,6 +414,7 @@ xorg-3_src_configure() {
local econfargs=(
${dep_track}
${selective_werror}
+ ${FONT_OPTIONS}
"${xorgconfadd[@]}"
)
@@ -388,4 +480,81 @@ xorg-3_src_install() {
# Don't install libtool archives (even for modules)
find "${D}" -type f -name '*.la' -delete || die
+
+ [[ -n ${FONT} ]] && remove_font_metadata
+}
+
+# @FUNCTION: xorg-3_pkg_postinst
+# @DESCRIPTION:
+# Run X-specific post-installation tasks on the live filesystem. The
+# only task right now is some setup for font packages.
+xorg-3_pkg_postinst() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ if [[ -n ${FONT} ]]; then
+ create_fonts_scale
+ create_fonts_dir
+ font_pkg_postinst "$@"
+
+ ewarn "Installed fonts changed. Run 'xset fp rehash' if you are using non-fontconfig applications."
+ fi
+}
+
+# @FUNCTION: xorg-3_pkg_postrm
+# @DESCRIPTION:
+# Run X-specific post-removal tasks on the live filesystem. The only
+# task right now is some cleanup for font packages.
+xorg-3_pkg_postrm() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ if [[ -n ${FONT} ]]; then
+ # if we're doing an upgrade, postinst will do
+ if [[ -z ${REPLACED_BY_VERSION} ]]; then
+ create_fonts_scale
+ create_fonts_dir
+ font_pkg_postrm "$@"
+ fi
+ fi
+}
+
+# @FUNCTION: remove_font_metadata
+# @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() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then
+ einfo "Removing font metadata"
+ rm -rf "${ED}"/usr/share/fonts/${FONT_DIR}/fonts.{scale,dir,cache-1}
+ fi
+}
+
+# @FUNCTION: create_fonts_scale
+# @DESCRIPTION:
+# Create fonts.scale file, used by the old server-side fonts subsystem.
+create_fonts_scale() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then
+ ebegin "Generating fonts.scale"
+ mkfontscale \
+ -a "${EROOT}/usr/share/fonts/encodings/encodings.dir" \
+ -- "${EROOT}/usr/share/fonts/${FONT_DIR}"
+ eend $?
+ fi
+}
+
+# @FUNCTION: create_fonts_dir
+# @DESCRIPTION:
+# Create fonts.dir file, used by the old server-side fonts subsystem.
+create_fonts_dir() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ ebegin "Generating fonts.dir"
+ mkfontdir \
+ -e "${EROOT}"/usr/share/fonts/encodings \
+ -e "${EROOT}"/usr/share/fonts/encodings/large \
+ -- "${EROOT}/usr/share/fonts/${FONT_DIR}"
+ eend $?
}