Merge pull request #2192 from flatcar/krnowak/eclass-automation

Add more eclasses to package automation
This commit is contained in:
Krzesimir Nowak 2024-08-08 12:50:55 +02:00 committed by GitHub
commit 918e66d493
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 746 additions and 420 deletions

View File

@ -364,8 +364,11 @@ eclass/app-alternatives.eclass
eclass/autotools.eclass
eclass/bash-completion-r1.eclass
eclass/cargo.eclass
eclass/check-reqs.eclass
eclass/cmake-multilib.eclass
eclass/cmake.eclass
eclass/crossdev.eclass
eclass/db-use.eclass
eclass/desktop.eclass
eclass/dist-kernel-utils.eclass
eclass/distutils-r1.eclass
@ -382,19 +385,30 @@ eclass/fcaps.eclass
eclass/flag-o-matic.eclass
eclass/git-r3.eclass
eclass/gnome.org.eclass
eclass/gnome2-utils.eclass
eclass/gnuconfig.eclass
eclass/go-env.eclass
eclass/go-module.eclass
eclass/golang-base.eclass
eclass/golang-vcs-snapshot.eclass
eclass/golang-vcs.eclass
eclass/java-pkg-opt-2.eclass
eclass/java-utils-2.eclass
eclass/kernel-2.eclass
eclass/libtool.eclass
eclass/linux-info.eclass
eclass/linux-mod-r1.eclass
eclass/linux-mod.eclass
eclass/llvm-r1.eclass
eclass/llvm-utils.eclass
eclass/llvm.eclass
eclass/ltprune.eclass
eclass/lua-single.eclass
eclass/lua-utils.eclass
eclass/mercurial.eclass
eclass/meson-multilib.eclass
eclass/meson.eclass
eclass/mono-env.eclass
eclass/mount-boot-utils.eclass
eclass/mount-boot.eclass
eclass/multibuild.eclass
@ -405,9 +419,11 @@ eclass/multiprocessing.eclass
eclass/ninja-utils.eclass
eclass/optfeature.eclass
eclass/out-of-source-utils.eclass
eclass/out-of-source.eclass
eclass/pam.eclass
eclass/pax-utils.eclass
eclass/perl-functions.eclass
eclass/perl-module.eclass
eclass/plocale.eclass
eclass/portability.eclass
eclass/prefix.eclass
@ -417,14 +433,19 @@ eclass/python-any-r1.eclass
eclass/python-r1.eclass
eclass/python-single-r1.eclass
eclass/python-utils-r1.eclass
eclass/qmake-utils.eclass
eclass/readme.gentoo-r1.eclass
eclass/rpm.eclass
eclass/ruby-single.eclass
eclass/ruby-utils.eclass
eclass/rust-toolchain.eclass
eclass/savedconfig.eclass
eclass/secureboot.eclass
eclass/selinux-policy-2.eclass
eclass/sgml-catalog-r1.eclass
eclass/ssl-cert.eclass
eclass/strip-linguas.eclass
eclass/subversion.eclass
eclass/systemd.eclass
eclass/tmpfiles.eclass
eclass/toolchain-autoconf.eclass
@ -437,6 +458,7 @@ eclass/user-info.eclass
#
# eclass/usr-ldscript.eclass
eclass/vcs-clean.eclass
eclass/vcs-snapshot.eclass
eclass/verify-sig.eclass
eclass/versionator.eclass
eclass/vim-doc.eclass
@ -445,6 +467,7 @@ eclass/virtualx.eclass
eclass/waf-utils.eclass
eclass/wrapper.eclass
eclass/xdg-utils.eclass
eclass/xdg.eclass
eclass/xorg-3.eclass
licenses

View File

@ -162,3 +162,4 @@ dev-util/bpftool -llvm
# Do not tinker with /boot partition at installation time.
sys-firmware/intel-microcode -initramfs
sys-fs/zfs-kmod -initramfs

View File

@ -1,4 +1,4 @@
# Copyright 2004-2021 Gentoo Authors
# Copyright 2004-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: check-reqs.eclass
@ -40,35 +40,33 @@
case ${EAPI} in
6|7|8) ;;
*) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
EXPORT_FUNCTIONS pkg_pretend pkg_setup
if [[ ! ${_CHECK_REQS_ECLASS} ]]; then
if [[ -z ${_CHECK_REQS_ECLASS} ]]; then
_CHECK_REQS_ECLASS=1
# @ECLASS-VARIABLE: CHECKREQS_MEMORY
# @ECLASS_VARIABLE: CHECKREQS_MEMORY
# @DEFAULT_UNSET
# @DESCRIPTION:
# How much RAM is needed? Eg.: CHECKREQS_MEMORY=15M
# @ECLASS-VARIABLE: CHECKREQS_DISK_BUILD
# @ECLASS_VARIABLE: CHECKREQS_DISK_BUILD
# @DEFAULT_UNSET
# @DESCRIPTION:
# How much diskspace is needed to build the package? Eg.: CHECKREQS_DISK_BUILD=2T
# @ECLASS-VARIABLE: CHECKREQS_DISK_USR
# @ECLASS_VARIABLE: CHECKREQS_DISK_USR
# @DEFAULT_UNSET
# @DESCRIPTION:
# How much space in /usr is needed to install the package? Eg.: CHECKREQS_DISK_USR=15G
# @ECLASS-VARIABLE: CHECKREQS_DISK_VAR
# @ECLASS_VARIABLE: CHECKREQS_DISK_VAR
# @DEFAULT_UNSET
# @DESCRIPTION:
# How much space is needed in /var? Eg.: CHECKREQS_DISK_VAR=3000M
# @ECLASS-VARIABLE: CHECKREQS_DONOTHING
# @ECLASS_VARIABLE: CHECKREQS_DONOTHING
# @USER_VARIABLE
# @DEFAULT_UNSET
# @DESCRIPTION:
@ -76,6 +74,12 @@ _CHECK_REQS_ECLASS=1
# This is a user flag and should under _no circumstances_ be set in the ebuild.
[[ -n ${I_KNOW_WHAT_I_AM_DOING} ]] && CHECKREQS_DONOTHING=1
# @ECLASS_VARIABLE: CHECKREQS_FAILED
# @INTERNAL
# @DESCRIPTION:
# If set the checks failed and eclass should abort the build.
# Internal, do not set yourself.
# @FUNCTION: check-reqs_pkg_setup
# @DESCRIPTION:
# Exported function running the resources checks in pkg_setup phase.
@ -287,9 +291,11 @@ _check-reqs_output() {
[[ ${EBUILD_PHASE} == "pretend" && -z ${CHECKREQS_DONOTHING} ]] && msg="eerror"
if [[ -n ${CHECKREQS_FAILED} ]]; then
${msg}
${msg} "Space constraints set in the ebuild were not met!"
${msg} "The build will most probably fail, you should enhance the space"
${msg} "as per failed tests."
${msg} "Memory or space constraints set in the ebuild were not met!"
${msg} "The build will most probably fail, you should:"
${msg} "- enhance the memory (reduce MAKEOPTS, add swap), or"
${msg} "- add more space"
${msg} "as required depending on the failed tests."
${msg}
[[ ${EBUILD_PHASE} == "pretend" && -z ${CHECKREQS_DONOTHING} ]] && \
@ -457,12 +463,9 @@ _check-reqs_unsatisfied() {
[[ ${EBUILD_PHASE} == "pretend" && -z ${CHECKREQS_DONOTHING} ]] && msg="eerror"
${msg} "There is NOT at least ${sizeunit} ${location}"
# @ECLASS-VARIABLE: CHECKREQS_FAILED
# @INTERNAL
# @DESCRIPTION:
# If set the checks failed and eclass should abort the build.
# Internal, do not set yourself.
CHECKREQS_FAILED="true"
}
fi
EXPORT_FUNCTIONS pkg_pretend pkg_setup

View File

@ -8,7 +8,7 @@
# maintainer-needed@gentoo.org
# @AUTHOR:
# Paul de Vrieze <pauldv@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7 8
# @SUPPORTED_EAPIS: 7 8
# @BLURB: This is a common location for functions that aid the use of sys-libs/db
# @DESCRIPTION:
# This eclass is designed to provide helpful functions for depending on
@ -16,7 +16,6 @@
# multilib is used for get_libname in all EAPI
case ${EAPI} in
5|6) inherit eapi7-ver ;& # fallthrough
7|8) inherit multilib ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@ -53,7 +52,7 @@ db_findver() {
PKG="$(best_version $1)"
VER="$(ver_cut 1-2 "${PKG/*db-/}")"
if [ -d "${EPREFIX}"/usr/include/db$(db_ver_to_slot "$VER") ]; then
if [ -d "${ESYSROOT}"/usr/include/db$(db_ver_to_slot "$VER") ]; then
#einfo "Found db version ${VER}" >&2
echo -n "$VER"
return 0
@ -72,8 +71,8 @@ db_includedir() {
VER="$(db_findver sys-libs/db)" || return 1
VER="$(db_ver_to_slot "$VER")"
echo "include version ${VER}" >&2
if [ -d "${EPREFIX}/usr/include/db${VER}" ]; then
echo -n "${EPREFIX}/usr/include/db${VER}"
if [ -d "${ESYSROOT}/usr/include/db${VER}" ]; then
echo -n "${ESYSROOT}/usr/include/db${VER}"
return 0
else
eerror "sys-libs/db package requested, but headers not found" >&2
@ -84,8 +83,8 @@ db_includedir() {
for x in $@
do
if VER=$(db_findver "=sys-libs/db-${x}*") &&
[ -d "${EPREFIX}/usr/include/db$(db_ver_to_slot $VER)" ]; then
echo -n "${EPREFIX}/usr/include/db$(db_ver_to_slot $VER)"
[ -d "${ESYSROOT}/usr/include/db$(db_ver_to_slot $VER)" ]; then
echo -n "${ESYSROOT}/usr/include/db$(db_ver_to_slot $VER)"
return 0
fi
done
@ -103,7 +102,7 @@ db_includedir() {
db_libname() {
if [ $# -eq 0 ]; then
VER="$(db_findver sys-libs/db)" || return 1
if [ -e "${EPREFIX}/usr/$(get_libdir)/libdb-${VER}$(get_libname)" ]; then
if [ -e "${ESYSROOT}/usr/$(get_libdir)/libdb-${VER}$(get_libname)" ]; then
echo -n "db-${VER}"
return 0
else
@ -115,7 +114,7 @@ db_libname() {
for x in $@
do
if VER=$(db_findver "=sys-libs/db-${x}*"); then
if [ -e "${EPREFIX}/usr/$(get_libdir)/libdb-${VER}$(get_libname)" ]; then
if [ -e "${ESYSROOT}/usr/$(get_libdir)/libdb-${VER}$(get_libname)" ]; then
echo -n "db-${VER}"
return 0
fi

View File

@ -1,10 +1,10 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: gnome2-utils.eclass
# @MAINTAINER:
# gnome@gentoo.org
# @SUPPORTED_EAPIS: 5 6 7 8
# @SUPPORTED_EAPIS: 7 8
# @PROVIDES: xdg-utils
# @BLURB: Auxiliary functions commonly used by Gnome packages.
# @DESCRIPTION:
@ -15,65 +15,68 @@
# * GConf schemas management
# * scrollkeeper (old Gnome help system) management
[[ ${EAPI} == 5 ]] && inherit multilib
# toolchain-funs.eclass: tc-is-cross-compiler
# xdg-utils.eclass: xdg_environment_reset, xdg_icon_cache_update
inherit toolchain-funcs xdg-utils
case ${EAPI} in
5|6|7|8) ;;
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
# @ECLASS-VARIABLE: GCONFTOOL_BIN
# @ECLASS_VARIABLE: GCONFTOOL_BIN
# @INTERNAL
# @DESCRIPTION:
# Path to gconftool-2
: ${GCONFTOOL_BIN:="/usr/bin/gconftool-2"}
: "${GCONFTOOL_BIN:="/usr/bin/gconftool-2"}"
# @ECLASS-VARIABLE: SCROLLKEEPER_DIR
# @ECLASS_VARIABLE: SCROLLKEEPER_DIR
# @INTERNAL
# @DESCRIPTION:
# Directory where scrollkeeper-update should do its work
: ${SCROLLKEEPER_DIR:="/var/lib/scrollkeeper"}
: "${SCROLLKEEPER_DIR:="/var/lib/scrollkeeper"}"
# @ECLASS-VARIABLE: SCROLLKEEPER_UPDATE_BIN
# @ECLASS_VARIABLE: SCROLLKEEPER_UPDATE_BIN
# @INTERNAL
# @DESCRIPTION:
# Path to scrollkeeper-update
: ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
: "${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}"
# @ECLASS-VARIABLE: GLIB_COMPILE_SCHEMAS
# @INTERNAL
# @ECLASS_VARIABLE: GLIB_COMPILE_RESOURCES
# @DESCRIPTION:
# Path to glib-compile-resources
: "${GLIB_COMPILE_RESOURCES:="/usr/bin/glib-compile-resources"}"
# @ECLASS_VARIABLE: GLIB_COMPILE_SCHEMAS
# @DESCRIPTION:
# Path to glib-compile-schemas
: ${GLIB_COMPILE_SCHEMAS:="/usr/bin/glib-compile-schemas"}
: "${GLIB_COMPILE_SCHEMAS:="/usr/bin/glib-compile-schemas"}"
# @ECLASS-VARIABLE: GNOME2_ECLASS_SCHEMAS
# @ECLASS_VARIABLE: GNOME2_ECLASS_SCHEMAS
# @INTERNAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# List of GConf schemas provided by the package
# @ECLASS-VARIABLE: GNOME2_ECLASS_ICONS
# @ECLASS_VARIABLE: GNOME2_ECLASS_ICONS
# @INTERNAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# List of icons provided by the package
# @ECLASS-VARIABLE: GNOME2_ECLASS_SCROLLS
# @ECLASS_VARIABLE: GNOME2_ECLASS_SCROLLS
# @INTERNAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# List of scrolls (documentation files) provided by the package
# @ECLASS-VARIABLE: GNOME2_ECLASS_GLIB_SCHEMAS
# @ECLASS_VARIABLE: GNOME2_ECLASS_GLIB_SCHEMAS
# @INTERNAL
# @DEFAULT_UNSET
# @DESCRIPTION:
# List of GSettings schemas provided by the package
# @ECLASS-VARIABLE: GNOME2_ECLASS_GDK_PIXBUF_LOADERS
# @ECLASS_VARIABLE: GNOME2_ECLASS_GDK_PIXBUF_LOADERS
# @INTERNAL
# @DEFAULT_UNSET
# @DESCRIPTION:
@ -82,7 +85,7 @@ esac
# @FUNCTION: gnome2_environment_reset
# @DESCRIPTION:
# Reset various variables inherited from root's evironment to a reasonable
# Reset various variables inherited from root's environment to a reasonable
# default for ebuilds to help avoid access violations and test failures.
gnome2_environment_reset() {
xdg_environment_reset
@ -96,7 +99,7 @@ gnome2_environment_reset() {
# Ensure we don't rely on dconf/gconf while building, bug #511946
export GSETTINGS_BACKEND="memory"
if has ${EAPI} 6 7; then
if [[ ${EAPI} == 7 ]]; then
# Try to cover the packages honoring this variable, bug #508124
export GST_INSPECT="$(type -P true)"
@ -122,7 +125,7 @@ gnome2_gconf_savelist() {
# using gconftool-2.
# This function should be called from pkg_postinst.
gnome2_gconf_install() {
local updater="${EROOT%/}${GCONFTOOL_BIN}"
local updater="${EROOT}${GCONFTOOL_BIN}"
if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
debug-print "No GNOME 2 GConf schemas found"
@ -144,15 +147,15 @@ gnome2_gconf_install() {
# We are ready to install the GCONF Scheme now
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT%/}/;")"
export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT}/;")"
einfo "Installing GNOME 2 GConf schemas"
local F
for F in ${GNOME2_ECLASS_SCHEMAS}; do
if [[ -e "${EROOT%/}/${F}" ]]; then
if [[ -e "${EROOT}/${F}" ]]; then
debug-print "Installing schema: ${F}"
"${updater}" --makefile-install-rule "${EROOT%/}/${F}" 1>/dev/null
"${updater}" --makefile-install-rule "${EROOT}/${F}" 1>/dev/null
fi
done
@ -170,7 +173,7 @@ gnome2_gconf_install() {
# Removes schema files previously installed by the current ebuild from Gconf's
# database.
gnome2_gconf_uninstall() {
local updater="${EROOT%/}${GCONFTOOL_BIN}"
local updater="${EROOT}${GCONFTOOL_BIN}"
if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
debug-print "No GNOME 2 GConf schemas found"
@ -190,15 +193,15 @@ gnome2_gconf_uninstall() {
fi
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT%/}/;")"
export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT}/;")"
einfo "Uninstalling GNOME 2 GConf schemas"
local F
for F in ${GNOME2_ECLASS_SCHEMAS}; do
if [[ -e "${EROOT%/}/${F}" ]]; then
if [[ -e "${EROOT}/${F}" ]]; then
debug-print "Uninstalling gconf schema: ${F}"
"${updater}" --makefile-uninstall-rule "${EROOT%/}/${F}" 1>/dev/null
"${updater}" --makefile-uninstall-rule "${EROOT}/${F}" 1>/dev/null
fi
done
@ -217,31 +220,29 @@ gnome2_gconf_uninstall() {
# calls to scrollkeeper-update and sandbox violations.
# This function should be called from src_prepare.
gnome2_omf_fix() {
local omf_makefiles filename
omf_makefiles="$@"
local omf_makefiles=( "$@" )
if [[ -f ${S}/omf.make ]] ; then
omf_makefiles="${omf_makefiles} ${S}/omf.make"
omf_makefiles+=( "${S}"/omf.make )
fi
if [[ -f ${S}/gnome-doc-utils.make ]] ; then
omf_makefiles="${omf_makefiles} ${S}/gnome-doc-utils.make"
omf_makefiles+=( "${S}"/gnome-doc-utils.make )
fi
# testing fixing of all makefiles found
# The sort is important to ensure .am is listed before the respective .in for
# maintainer mode regeneration not kicking in due to .am being newer than .in
for filename in $(find "${S}" -name "Makefile.in" -o -name "Makefile.am" |sort) ; do
omf_makefiles="${omf_makefiles} ${filename}"
done
local filename
while IFS="" read -r filename ; do
omf_makefiles+=( "${filename}" )
done < <(find "${S}" -name "Makefile.in" -o -name "Makefile.am" | sort)
ebegin "Fixing OMF Makefiles"
local retval=0
local omf retval=0
local fails=( )
for omf in ${omf_makefiles} ; do
for omf in "${omf_makefiles[@]}" ; do
sed -i -e 's:scrollkeeper-update:true:' "${omf}"
retval=$?
@ -249,7 +250,7 @@ gnome2_omf_fix() {
debug-print "updating of ${omf} failed"
# Add to the list of failures
fails[$(( ${#fails[@]} + 1 ))]=$omf
fails+=( "${omf}" )
retval=2
fi
@ -257,6 +258,7 @@ gnome2_omf_fix() {
eend $retval
local f
for f in "${fails[@]}" ; do
eerror "Failed to update OMF Makefile $f"
done
@ -278,7 +280,7 @@ gnome2_scrollkeeper_savelist() {
# Updates the global scrollkeeper database.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_scrollkeeper_update() {
local updater="${EROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
local updater="${EROOT}${SCROLLKEEPER_UPDATE_BIN}"
if [[ -z "${GNOME2_ECLASS_SCROLLS}" ]]; then
debug-print "No scroll cache to update"
@ -299,7 +301,7 @@ gnome2_scrollkeeper_update() {
fi
ebegin "Updating scrollkeeper database ..."
"${updater}" -q -p "${EROOT%/}${SCROLLKEEPER_DIR}"
"${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
eend $?
}
@ -320,7 +322,7 @@ gnome2_schemas_savelist() {
# Updates GSettings schemas.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_schemas_update() {
local updater="${EROOT%/}${GLIB_COMPILE_SCHEMAS}"
local updater="${EROOT}${GLIB_COMPILE_SCHEMAS}"
if tc-is-cross-compiler ; then
ewarn "Updating of GSettings schemas skipped due to cross-compilation."
@ -336,7 +338,7 @@ gnome2_schemas_update() {
fi
ebegin "Updating GSettings schemas"
${updater} --allow-any-name "$@" "${EROOT%/}/usr/share/glib-2.0/schemas" &>/dev/null
${updater} --allow-any-name "$@" "${EROOT}/usr/share/glib-2.0/schemas" &>/dev/null
eend $?
}
@ -356,13 +358,8 @@ gnome2_gdk_pixbuf_savelist() {
# Updates gdk-pixbuf loader cache if GNOME2_ECLASS_GDK_PIXBUF_LOADERS has some.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_gdk_pixbuf_update() {
local updater="${EROOT%/}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
[[ -x ${updater} ]] || updater="${EROOT%/}/usr/bin/gdk-pixbuf-query-loaders"
if [[ -z ${GNOME2_ECLASS_GDK_PIXBUF_LOADERS} ]]; then
debug-print "gdk-pixbuf loader cache does not need an update"
return
fi
local updater="${EROOT}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
[[ -x ${updater} ]] || updater="${EROOT}/usr/bin/gdk-pixbuf-query-loaders"
if tc-is-cross-compiler ; then
ewarn "Updating of gdk-pixbuf loader cache skipped due to cross-compilation."
@ -381,7 +378,7 @@ gnome2_gdk_pixbuf_update() {
local tmp_file=$(mktemp "${T}"/tmp.XXXXXXXXXX) || die "Failed to create temporary file"
${updater} 1> "${tmp_file}" &&
chmod 0644 "${tmp_file}" &&
cp -f "${tmp_file}" "${EROOT%/}/usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
cp -f "${tmp_file}" "${EROOT}/usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
rm "${tmp_file}" # don't replace this with mv, required for SELinux support
eend $?
}
@ -399,7 +396,7 @@ gnome2_query_immodules_gtk2() {
fi
ebegin "Updating gtk2 input method module cache"
GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
GTK_IM_MODULE_FILE="${EROOT}/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
"${updater}" --update-cache
eend $?
}
@ -417,7 +414,7 @@ gnome2_query_immodules_gtk3() {
fi
ebegin "Updating gtk3 input method module cache"
GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
GTK_IM_MODULE_FILE="${EROOT}/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
"${updater}" --update-cache
eend $?
}
@ -427,8 +424,8 @@ gnome2_query_immodules_gtk3() {
# Updates glib's gio modules cache.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_giomodule_cache_update() {
local updater="${EROOT%/}/usr/bin/${CHOST}-gio-querymodules"
[[ -x ${updater} ]] || updater="${EROOT%/}/usr/bin/gio-querymodules"
local updater="${EROOT}/usr/bin/${CHOST}-gio-querymodules"
[[ -x ${updater} ]] || updater="${EROOT}/usr/bin/gio-querymodules"
if tc-is-cross-compiler ; then
ewarn "Updating of GIO modules cache skipped due to cross-compilation."
@ -444,7 +441,7 @@ gnome2_giomodule_cache_update() {
fi
ebegin "Updating GIO modules cache"
${updater} "${EROOT%/}"/usr/$(get_libdir)/gio/modules
${updater} "${EROOT}"/usr/$(get_libdir)/gio/modules
eend $?
}
@ -487,30 +484,3 @@ gnome2_disable_deprecation_warning() {
ewarn "Failed to disable deprecation warnings in ${makefile}"
done
}
case ${EAPI} in
5|6)
# @FUNCTION: gnome2_icon_savelist
# @DESCRIPTION:
# Find the icons that are about to be installed and save their location
# in the GNOME2_ECLASS_ICONS environment variable. This is only
# necessary for eclass implementations that call
# gnome2_icon_cache_update conditionally.
# This function should be called from pkg_preinst.
gnome2_icon_savelist() {
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
popd > /dev/null || die
}
# @FUNCTION: gnome2_icon_cache_update
# @DESCRIPTION:
# Updates Gtk+ icon cache files under /usr/share/icons.
# Deprecated. Please use xdg_icon_cache_update from xdg-utils.eclass
gnome2_icon_cache_update() {
xdg_icon_cache_update
}
;;
esac

View File

@ -1,48 +1,131 @@
# Copyright 2023 Gentoo Authors
# Copyright 2023-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: go-env.eclass
# @MAINTAINER:
# Flatcar Maintainers <infra@flatcar.org>
# Flatcar Linux Maintainers <infra@flatcar-linux.org>
# @AUTHOR:
# Flatcar Maintainers <infra@flatcar.org>
# Flatcar Linux Maintainers <infra@flatcar-linux.org>
# @SUPPORTED_EAPIS: 7 8
# @BLURB: Helper eclass for setting the Go compile environment. Required for cross-compiling.
# @DESCRIPTION:
# This eclass includes a helper function for setting the compile environment for Go ebuilds.
# This eclass includes helper functions for setting the compile environment for Go ebuilds.
# Intended to be called by other Go eclasses in an early build stage, e.g. src_unpack.
case ${EAPI} in
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_GO_ENV_ECLASS} ]]; then
_GO_ENV_ECLASS=1
inherit toolchain-funcs
inherit flag-o-matic toolchain-funcs
# @FUNCTION: go-env_set_compile_environment
# @DESCRIPTION:
# Set up basic compile environment: CC, CXX, and GOARCH.
# Necessary platform-specific settings such as GOARM or GO386 are also set
# according to the Portage configuration when building for those architectures.
# Also carry over CFLAGS, LDFLAGS and friends.
# Required for cross-compiling with crossdev.
# If not set, host defaults will be used and the resulting binaries are host arch.
# (e.g. "emerge-aarch64-cross-linux-gnu foo" run on x86_64 will emerge "foo" for x86_64
# instead of aarch64)
go-env_set_compile_environment() {
local arch=$(tc-arch "${CHOST}}")
case "${arch}" in
x86) GOARCH="386" ;;
x64-*) GOARCH="amd64" ;;
ppc64) if [[ "$(tc-endian "${${CHOST}}")" = "big" ]] ; then
GOARCH="ppc64"
else
GOARCH="ppc64le"
fi ;;
*) GOARCH="${arch}" ;;
esac
tc-export CC CXX PKG_CONFIG
export GOARCH="$(go-env_goarch)"
use arm && export GOARM=$(go-env_goarm)
use x86 && export GO386=$(go-env_go386)
# XXX: Hack for checking ICE (bug #912152, gcc PR113204)
has_version -b "sys-devel/gcc[debug]" && filter-lto
tc-export CC CXX
export GOARCH
export CGO_CFLAGS="${CGO_CFLAGS:-$CFLAGS}"
export CGO_CPPFLAGS="${CGO_CPPFLAGS:-$CPPFLAGS}"
export CGO_CXXFLAGS="${CGO_CXXFLAGS:-$CXXFLAGS}"
export CGO_LDFLAGS="${CGO_LDFLAGS:-$LDFLAGS}"
}
# @FUNCTION: go-env_goos
# @USAGE: [toolchain prefix]
# @DESCRIPTION:
# Returns the appropriate GOOS setting for the target operating system.
go-env_goos() {
local target=${1:-${CHOST}}
case "${target}" in
*-linux*) echo linux ;;
*-darwin*) echo darwin ;;
*-freebsd*) echo freebsd ;;
*-netbsd*) echo netbsd ;;
*-openbsd*) echo openbsd ;;
*-solaris*) echo solaris ;;
*-cygwin*|*-interix*|*-winnt*) echo windows ;;
*) die "unknown GOOS for ${target}" ;;
esac
}
# @FUNCTION: go-env_goarch
# @USAGE: [toolchain prefix]
# @DESCRIPTION:
# Returns the appropriate GOARCH setting for the target architecture.
go-env_goarch() {
local target=${1:-${CHOST}}
# Some Portage arch names match Go.
local arch=$(tc-arch "${target}") cpu=${target%%-*}
case "${arch}" in
x86) echo 386 ;;
loong) echo loong64 ;;
*) case "${cpu}" in
aarch64*be) echo arm64be ;;
arm64) echo arm64 ;;
arm*b*) echo armbe ;;
mips64*l*) echo mips64le ;;
mips*l*) echo mipsle ;;
powerpc64le*) echo ppc64le ;;
arm64|s390x) echo "${cpu}" ;;
mips64*|riscv64*|sparc64*) echo "${arch}64" ;;
*) echo "${arch}" ;;
esac ;;
esac
}
# @FUNCTION: go-env_go386
# @DESCRIPTION:
# Returns the appropriate GO386 setting for the CFLAGS in use.
go-env_go386() {
# Piggy-back off any existing CPU_FLAGS_X86 usage in the ebuild if
# it's there.
if in_iuse cpu_flags_x86_sse2 && use cpu_flags_x86_sse2 ; then
echo 'sse2'
return
fi
if tc-cpp-is-true "defined(__SSE2__)" ${CFLAGS} ${CXXFLAGS} ; then
echo 'sse2'
return
fi
# Go 1.16 dropped explicit support for 386 FP and relies on software
# emulation instead in the absence of SSE2.
echo 'softfloat'
}
# @FUNCTION: go-env_goarm
# @USAGE: [CHOST-value]
# @DESCRIPTION:
# Returns the appropriate GOARM setting for the CHOST given, or the default
# CHOST.
go-env_goarm() {
case "${1:-${CHOST}}" in
armv5*) echo 5;;
armv6*) echo 6;;
armv7*) echo 7;;
*)
die "unknown GOARM for ${1:-${CHOST}}"
;;
esac
}
fi

View File

@ -1,4 +1,4 @@
# Copyright 2019-2023 Gentoo Authors
# Copyright 2019-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: go-module.eclass
@ -14,7 +14,7 @@
# written in the go programming language that uses modules.
# If the software you are packaging has a file named go.mod in its top level
# directory, it uses modules.
#
#
# Modules have been the preferred method of tracking dependencies in software
# written in Go since version 1.16,
# so if the software isn't using modules, it should be updated.
@ -45,7 +45,7 @@
# Since Go programs are statically linked, it is important that your ebuild's
# LICENSE= setting includes the licenses of all statically linked
# dependencies. So please make sure it is accurate.
# You can use a utility like dev-go/golicense (network connectivity is
# You can use a utility like dev-go/lichen (network connectivity is
# required) to extract this information from the compiled binary.
#
# @EXAMPLE:
@ -68,11 +68,10 @@ esac
if [[ -z ${_GO_MODULE_ECLASS} ]]; then
_GO_MODULE_ECLASS=1
# Flatcar: Keep this change until upstream has merged https://github.com/gentoo/gentoo/pull/33539
inherit multiprocessing toolchain-funcs go-env
if [[ ! ${GO_OPTIONAL} ]]; then
BDEPEND=">=dev-lang/go-1.18"
BDEPEND=">=dev-lang/go-1.20:="
# Workaround for pkgcheck false positive: https://github.com/pkgcore/pkgcheck/issues/214
# MissingUnpackerDep: version ...: missing BDEPEND="app-arch/unzip"
@ -389,7 +388,6 @@ go-module_src_unpack() {
fi
fi
# Flatcar: Keep this change until upstream has merged https://github.com/gentoo/gentoo/pull/33539
go-env_set_compile_environment
}

View File

@ -1,10 +1,10 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: golang-base.eclass
# @MAINTAINER:
# William Hubbs <williamh@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7
# @SUPPORTED_EAPIS: 7
# @BLURB: Eclass that provides base functions for Go packages.
# @DEPRECATED: go-module.eclass
# @DESCRIPTION:
@ -12,12 +12,9 @@
# programming language; it also provides the build-time dependency on
# dev-lang/go.
case "${EAPI:-0}" in
5|6|7)
;;
*)
die "${ECLASS}: Unsupported EAPI (EAPI=${EAPI})"
;;
case ${EAPI} in
7) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_GOLANG_BASE} ]]; then

View File

@ -1,10 +1,10 @@
# Copyright 1999-2023 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: golang-vcs-snapshot.eclass
# @MAINTAINER:
# William Hubbs <williamh@gentoo.org>
# @SUPPORTED_EAPIS: 6 7
# @SUPPORTED_EAPIS: 7
# @PROVIDES: golang-base
# @BLURB: eclass to unpack VCS snapshot tarballs for Go software
# @DEPRECATED: go-module.eclass
@ -45,14 +45,13 @@
# and add the vendored tarballs to ${WORKDIR}/src/${EGO_PN}/vendor
case ${EAPI} in
6|7) ;;
7) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_GOLANG_VCS_SNAPSHOT_ECLASS} ]]; then
_GOLANG_VCS_SNAPSHOT_ECLASS=1
# Flatcar: Keep this change until upstream has merged https://github.com/gentoo/gentoo/pull/33539
inherit golang-base go-env
# @ECLASS_VARIABLE: EGO_VENDOR
@ -120,7 +119,6 @@ golang-vcs-snapshot_src_unpack() {
done
fi
# Flatcar: Keep this change until upstream has merged https://github.com/gentoo/gentoo/pull/33539
go-env_set_compile_environment
}

View File

@ -1,10 +1,10 @@
# Copyright 1999-2023 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: golang-vcs.eclass
# @MAINTAINER:
# William Hubbs <williamh@gentoo.org>
# @SUPPORTED_EAPIS: 6 7
# @SUPPORTED_EAPIS: 7
# @PROVIDES: golang-base
# @BLURB: Eclass for fetching and unpacking go repositories.
# @DEPRECATED: go-module.eclass
@ -13,14 +13,13 @@
# of software written in the Go programming language.
case ${EAPI} in
6|7) ;;
7) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_GOLANG_VCS_ECLASS} ]]; then
_GOLANG_VCS_ECLASS=1
# Flatcar: Keep this change until upstream has merged https://github.com/gentoo/gentoo/pull/33539
inherit estack golang-base go-env
PROPERTIES+=" live"
@ -87,7 +86,6 @@ _golang-vcs_env_setup() {
die "${ECLASS}: unable to create ${WORKDIR}/${P}"
return 0
# Flatcar: Keep this change until upstream has merged https://github.com/gentoo/gentoo/pull/33539
go-env_set_compile_environment
}

View File

@ -1,4 +1,4 @@
# Copyright 2023 Gentoo Authors
# Copyright 2023-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: linux-mod-r1.eclass
@ -109,9 +109,9 @@ esac
if [[ ! ${_LINUX_MOD_R1_ECLASS} ]]; then
_LINUX_MOD_R1_ECLASS=1
inherit edo linux-info multiprocessing toolchain-funcs
inherit dist-kernel-utils edo linux-info multiprocessing toolchain-funcs
IUSE="dist-kernel modules-sign +strip ${MODULES_OPTIONAL_IUSE}"
IUSE="dist-kernel modules-compress modules-sign +strip ${MODULES_OPTIONAL_IUSE}"
RDEPEND="
sys-apps/kmod[tools]
@ -131,6 +131,16 @@ IDEPEND="
sys-apps/kmod[tools]
"
if [[ ${MODULES_INITRAMFS_IUSE} ]]; then
inherit mount-boot-utils
IUSE+=" ${MODULES_INITRAMFS_IUSE}"
IDEPEND+="
${MODULES_INITRAMFS_IUSE#+}? (
sys-kernel/installkernel
)
"
fi
if [[ -n ${MODULES_OPTIONAL_IUSE} ]]; then
: "${MODULES_OPTIONAL_IUSE#+}? ( | )"
RDEPEND=${_/|/${RDEPEND}} DEPEND=${_/|/${DEPEND}} \
@ -179,6 +189,22 @@ fi
#
# May want to look at KERNEL_CHOST before considering this.
# @ECLASS_VARIABLE: MODULES_INITRAMFS_IUSE
# @DEFAULT_UNSET
# @PRE_INHERIT
# @DESCRIPTION:
# If set, adds the specified USE flag. When this flag is enabled the
# installed kernel modules are registered for inclusion in the dracut
# initramfs. Additionally, if distribution kernels are used
# (USE="dist-kernel") then these kernels are re-installed.
#
# The typical recommended value is "initramfs" or "+initramfs" (global
# IUSE).
#
# If MODULES_INITRAMFS_IUSE is not set, or the specified flag is not
# enabled, then the installed kernel modules are omitted from the
# dracut initramfs.
# @ECLASS_VARIABLE: MODULES_SIGN_HASH
# @USER_VARIABLE
# @DEFAULT_UNSET
@ -303,9 +329,19 @@ fi
# 3. perform various sanity checks to fail early on issues
linux-mod-r1_pkg_setup() {
debug-print-function ${FUNCNAME[0]} "${@}"
[[ ${MERGE_TYPE} != binary ]] || return 0
_MODULES_GLOBAL[ran:pkg_setup]=1
_modules_check_function ${#} 0 0 || return 0
if [[ -z ${ROOT} && ${MODULES_INITRAMFS_IUSE} ]] &&
use dist-kernel && use ${MODULES_INITRAMFS_IUSE#+}
then
# Check, but don't die because we can fix the problem and then
# emerge --config ... to re-run installation.
nonfatal mount-boot_check_status
fi
[[ ${MERGE_TYPE} != binary ]] || return 0
_modules_check_migration
_modules_prepare_kernel
@ -468,8 +504,22 @@ linux-mod-r1_pkg_postinst() {
debug-print-function ${FUNCNAME[0]} "${@}"
_modules_check_function ${#} 0 0 || return 0
dist-kernel_compressed_module_cleanup "${EROOT}/lib/modules/${KV_FULL}"
_modules_update_depmod
if [[ -z ${ROOT} && ${MODULES_INITRAMFS_IUSE} ]] &&
use dist-kernel && use ${MODULES_INITRAMFS_IUSE#+}
then
dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
fi
if has_version virtual/dist-kernel && ! use dist-kernel; then
ewarn "virtual/dist-kernel is installed, but USE=\"dist-kernel\""
ewarn "is not enabled for ${CATEGORY}/${PN}."
ewarn "It's recommended to globally enable the dist-kernel USE flag"
ewarn "to automatically trigger initramfs rebuilds on kernel updates"
fi
# post_process ensures modules were installed and that the eclass' USE
# are likely not no-ops (unfortunately postinst itself may be missed)
[[ -v _MODULES_GLOBAL[ran:post_process] ]] ||
@ -544,11 +594,13 @@ modules_post_process() {
(( ${#mods[@]} )) ||
die "${FUNCNAME[0]} was called with no installed modules under ${path}"
# TODO?: find way for sane use with dracut (its 90kernel-modules-extra
# parses depmod.d files directly and assumes should include its modules
# which can lead to unnecessarily increased size or stale modules)
# _modules_process_depmod.d "${mods[@]#"${path}/"}"
# TODO?: look into re-introducing after verifying it works as expected,
# formerly omitted because dracut's 90kernel-modules-extra parses depmod.d
# files directly and assumes should include its modules but we now create
# dracut omit files that *hopefully* prevent this
# _modules_process_depmod.d "${mods[@]##*/}"
_modules_process_dracut.conf.d "${mods[@]##*/}"
_modules_process_strip "${mods[@]}"
_modules_process_sign "${mods[@]}"
_modules_sanity_modversion "${mods[@]}" # after strip/sign in case broke it
@ -621,6 +673,11 @@ _modules_check_migration() {
# Handles linux-info bits to provide usable sources, KV_ variables,
# and CONFIG_CHECK use.
_modules_prepare_kernel() {
# The modules we build are specific to each kernel version, we don't
# want to reset the environment to use the user selected kernel version.
# Bug 931213, 926063
SKIP_KERNEL_BINPKG_ENV_RESET=1
get_version
# linux-info allows skipping checks if SKIP_KERNEL_CHECK is set and
@ -793,7 +850,7 @@ _modules_prepare_toolchain() {
# can work but raises concerns about breaking packages that may use these
if linux_chkconfig_present LTO_CLANG_THIN && tc-ld-is-lld; then
KERNEL_LD=${T}/linux-mod-r1_ld.lld
printf '#!/usr/bin/env sh\nexec %s "${@}" --thinlto-cache-dir=\n' \
printf '#!/usr/bin/env sh\nexec %q "${@}" --thinlto-cache-dir=\n' \
"${LD}" > "${KERNEL_LD}" || die
chmod +x -- "${KERNEL_LD}" || die
fi
@ -835,9 +892,18 @@ _modules_prepare_toolchain() {
# If enabled in the kernel configuration, this compresses the given
# modules using the same format.
_modules_process_compress() {
use modules-compress || return 0
local -a compress
if linux_chkconfig_present MODULE_COMPRESS_XZ; then
compress=(xz -qT"$(makeopts_jobs)" --memlimit-compress=50%)
compress=(
xz -q
--memlimit-compress=50%
--threads="$(makeopts_jobs)"
# match options from kernel's Makefile.modinst (bug #920837)
--check=crc32
--lzma2=dict=1MiB
)
elif linux_chkconfig_present MODULE_COMPRESS_GZIP; then
if type -P pigz &>/dev/null; then
compress=(pigz -p"$(makeopts_jobs)")
@ -846,13 +912,13 @@ _modules_process_compress() {
fi
elif linux_chkconfig_present MODULE_COMPRESS_ZSTD; then
compress=(zstd -qT"$(makeopts_jobs)" --rm)
else
die "USE=modules-compress enabled but no MODULE_COMPRESS* configured"
fi
if [[ -v compress ]]; then
# could fail, assumes have commands that were needed for the kernel
einfo "Compressing modules (matching the kernel configuration) ..."
edob "${compress[@]}" -- "${@}"
fi
# could fail, assumes have commands that were needed for the kernel
einfo "Compressing modules (matching the kernel configuration) ..."
edob "${compress[@]}" -- "${@}"
}
# @FUNCTION: _modules_process_depmod.d
@ -876,6 +942,21 @@ _modules_process_depmod.d() {
)
}
# @FUNCTION: _modules_process_dracut.conf.d
# @USAGE: <module>...
# @INTERNAL
# @DESCRIPTION:
# Create dracut.conf.d snippet defining if module should be included in the
# initramfs.
_modules_process_dracut.conf.d() {
(
insinto /usr/lib/dracut/dracut.conf.d
[[ ${MODULES_INITRAMFS_IUSE} ]] && use ${MODULES_INITRAMFS_IUSE#+} &&
: add || : omit
newins - 10-${PN}.conf <<<"${_}_drivers+=\" ${*%.ko} \""
)
}
# @FUNCTION: _modules_process_sign
# @USAGE: <module>...
# @INTERNAL
@ -1056,7 +1137,10 @@ _modules_sanity_kernelbuilt() {
# @DESCRIPTION:
# Prints a warning if the kernel version is greater than to
# MODULES_KERNEL_MAX (while only considering same amount of version
# components), or aborts if it is less than MODULES_KERNEL_MIN
# components), or aborts if it is less than MODULES_KERNEL_MIN.
#
# With USE=dist-kernel, also warn if virtual/dist-kernel is of a
# different version than the one being built against.
_modules_sanity_kernelversion() {
local kv=${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}
@ -1106,6 +1190,24 @@ _modules_sanity_kernelversion() {
ewarn
fi
fi
if use dist-kernel &&
! has_version "~virtual/dist-kernel-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
then
ewarn
ewarn "The kernel modules in ${CATEGORY}/${PN} are being built for"
ewarn "kernel version ${KV_FULL}. But this does not match the"
ewarn "installed version of virtual/dist-kernel."
ewarn
ewarn "If this is not intentional, the problem may be corrected by"
ewarn "using \"eselect kernel\" to set the default kernel version to"
ewarn "the same version as the installed version of virtual/dist-kernel."
ewarn
ewarn "If the distribution kernel is being downgraded, ensure that"
ewarn "virtual/dist-kernel is also downgraded to the same version"
ewarn "before rebuilding external kernel modules."
ewarn
fi
}
# @FUNCTION: _modules_sanity_modversion
@ -1232,7 +1334,7 @@ _modules_update_depmod() {
# EROOT from -b is not used when looking for configuration
# directories, so pass the whole list from kmod's tools/depmod.c
--config="${EROOT}"/{etc,run,usr/local/lib,lib}/depmod.d
--config="${EROOT}"/{etc,run,{usr/{local/,},}lib}/depmod.d
)
nonfatal edob depmod "${depmodargs[@]}" && return 0

View File

@ -31,8 +31,8 @@
# DEPEND="
# dev-libs/libfoo[${LLVM_USEDEP}]
# $(llvm_gen_dep '
# sys-devel/clang:${LLVM_SLOT}
# sys-devel/llvm:${LLVM_SLOT}
# sys-devel/clang:${LLVM_SLOT}=
# sys-devel/llvm:${LLVM_SLOT}=
# ')
# "
# @CODE
@ -61,7 +61,7 @@ _LLVM_OLDEST_SLOT=15
# @DESCRIPTION:
# The newest stable LLVM version. Versions newer than that won't
# be automatically enabled via USE defaults.
_LLVM_NEWEST_STABLE=17
_LLVM_NEWEST_STABLE=18
# == control variables ==
@ -123,11 +123,16 @@ _llvm_set_globals() {
fi
if [[ ${stable[@]} ]]; then
# If there is at least one stable slot supported, then enable
# the newest stable slot by default.
IUSE="+llvm_slot_${stable[-1]}"
unset 'stable[-1]'
else
IUSE="+llvm_slot_${unstable[-1]}"
unset 'unstable[-1]'
# Otherwise, enable the "oldest" ~arch slot. We really only
# expect a single ~arch version, so this primarily prevents
# defaulting to non-keyworded slots.
IUSE="+llvm_slot_${unstable[0]}"
unset 'unstable[0]'
fi
local nondefault=( "${stable[@]}" "${unstable[@]}" )
IUSE+=" ${nondefault[*]/#/llvm_slot_}"
@ -158,8 +163,8 @@ unset -f _llvm_set_globals
# @CODE
# DEPEND="
# $(llvm_gen_dep '
# sys-devel/clang:${LLVM_SLOT}
# sys-devel/llvm:${LLVM_SLOT}
# sys-devel/clang:${LLVM_SLOT}=
# sys-devel/llvm:${LLVM_SLOT}=
# ')
# "
# @CODE

View File

@ -1,9 +1,9 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: mercurial.eclass
# @MAINTAINER:
# Christoph Junghans <junghans@gentoo.org>
# No maintainer <maintainer-needed@gentoo.org>
# @AUTHOR:
# Next gen author: Krzysztof Pawlik <nelchael@gentoo.org>
# Original author: Aron Griffis <agriffis@gentoo.org>
@ -25,35 +25,27 @@ _MERCURIAL_ECLASS=1
PROPERTIES+=" live"
case ${EAPI:-0} in
7)
# For compatibiilty only (indirect inherits).
# Eclass itself doesn't need it.
inherit eutils
;;
esac
BDEPEND="dev-vcs/mercurial"
# @ECLASS-VARIABLE: EHG_REPO_URI
# @ECLASS_VARIABLE: EHG_REPO_URI
# @DESCRIPTION:
# Mercurial repository URI.
# @ECLASS-VARIABLE: EHG_REVISION
# @ECLASS_VARIABLE: EHG_REVISION
# @DESCRIPTION:
# Create working directory for specified revision, defaults to default.
#
# EHG_REVISION is passed as a value for --updaterev parameter, so it can be more
# than just a revision, please consult `hg help revisions' for more details.
: ${EHG_REVISION:="default"}
: "${EHG_REVISION:="default"}"
# @ECLASS-VARIABLE: EHG_STORE_DIR
# @ECLASS_VARIABLE: EHG_STORE_DIR
# @USER_VARIABLE
# @DESCRIPTION:
# Mercurial sources store directory. Users may override this in /etc/portage/make.conf
[[ -z "${EHG_STORE_DIR}" ]] && EHG_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/hg-src"
# @ECLASS-VARIABLE: EHG_PROJECT
# @ECLASS_VARIABLE: EHG_PROJECT
# @DESCRIPTION:
# Project name.
#
@ -61,39 +53,43 @@ BDEPEND="dev-vcs/mercurial"
# between several ebuilds.
[[ -z "${EHG_PROJECT}" ]] && EHG_PROJECT="${PN}"
# @ECLASS-VARIABLE: EHG_CHECKOUT_DIR
# @ECLASS_VARIABLE: EHG_CHECKOUT_DIR
# @DESCRIPTION:
# The directory to check the hg sources out to.
#
# EHG_CHECKOUT_DIR=${S}
# @ECLASS-VARIABLE: EHG_QUIET
# @ECLASS_VARIABLE: EHG_QUIET
# @DESCRIPTION:
# Suppress some extra noise from mercurial, set it to 'ON' to be quiet.
: ${EHG_QUIET:="OFF"}
: "${EHG_QUIET:="OFF"}"
[[ "${EHG_QUIET}" == "ON" ]] && EHG_QUIET_CMD_OPT="--quiet"
# @ECLASS-VARIABLE: EHG_CONFIG
# @ECLASS_VARIABLE: EHG_CONFIG
# @DESCRIPTION:
# Extra config option to hand to hg clone/pull
# @ECLASS-VARIABLE: EHG_CLONE_CMD
# @ECLASS_VARIABLE: EHG_CLONE_CMD
# @DESCRIPTION:
# Command used to perform initial repository clone.
[[ -z "${EHG_CLONE_CMD}" ]] && EHG_CLONE_CMD="hg clone ${EHG_CONFIG:+--config ${EHG_CONFIG}} ${EHG_QUIET_CMD_OPT} --pull --noupdate"
# @ECLASS-VARIABLE: EHG_PULL_CMD
# @ECLASS_VARIABLE: EHG_PULL_CMD
# @DESCRIPTION:
# Command used to update repository.
[[ -z "${EHG_PULL_CMD}" ]] && EHG_PULL_CMD="hg pull ${EHG_CONFIG:+--config ${EHG_CONFIG}} ${EHG_QUIET_CMD_OPT}"
# @ECLASS-VARIABLE: EHG_OFFLINE
# @ECLASS_VARIABLE: EHG_OFFLINE
# @DESCRIPTION:
# Set this variable to a non-empty value to disable the automatic updating of
# a mercurial source tree. This is intended to be set outside the ebuild by
# users.
EHG_OFFLINE="${EHG_OFFLINE:-${EVCS_OFFLINE}}"
# @ECLASS_VARIABLE: EHG_BOOTSTRAP
# @DESCRIPTION:
# Command to be executed after checkout and clone of the specified repository.
# @FUNCTION: mercurial_fetch
# @USAGE: [repository_uri] [module] [sourcedir]
# @DESCRIPTION:
@ -106,8 +102,6 @@ EHG_OFFLINE="${EHG_OFFLINE:-${EVCS_OFFLINE}}"
mercurial_fetch() {
debug-print-function ${FUNCNAME} "${@}"
has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
EHG_REPO_URI=${1-${EHG_REPO_URI}}
[[ -z "${EHG_REPO_URI}" ]] && die "EHG_REPO_URI is empty"
@ -173,10 +167,6 @@ mercurial_fetch() {
mercurial_bootstrap() {
debug-print-function ${FUNCNAME} "$@"
# @ECLASS-VARIABLE: EHG_BOOTSTRAP
# @DESCRIPTION:
# Command to be executed after checkout and clone of the specified
# repository.
if [[ ${EHG_BOOTSTRAP} ]]; then
pushd "${S}" > /dev/null
einfo "Starting bootstrap"

View File

@ -1,21 +1,19 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: mono-env.eclass
# @MAINTAINER:
# maintainer-needed@gentoo.org
# @SUPPORTED_EAPIS: 5 6 7
# @SUPPORTED_EAPIS: 6 7
# @BLURB: Set environment variables commonly used by dotnet packages.
# @DESCRIPTION:
# Set environment variables commonly used by dotnet packages.
case ${EAPI:-0} in
[567]) ;;
case ${EAPI} in
6|7) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
EXPORT_FUNCTIONS pkg_setup
if [[ -z ${_MONO_ENV_ECLASS} ]] ; then
_MONO_ENV_ECLASS=1
@ -48,3 +46,5 @@ mono-env_pkg_setup() {
}
fi
EXPORT_FUNCTIONS pkg_setup

View File

@ -1,4 +1,4 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: perl-module.eclass
@ -21,11 +21,11 @@
case ${EAPI} in
7)
inherit multiprocessing perl-functions
inherit multiprocessing perl-functions toolchain-funcs
PERL_EXPF="src_prepare src_configure src_compile src_test src_install"
;;
8)
inherit multiprocessing perl-functions readme.gentoo-r1
inherit multiprocessing perl-functions readme.gentoo-r1 toolchain-funcs
PERL_EXPF="src_prepare src_configure src_compile src_test src_install"
;;
*)
@ -44,6 +44,28 @@ esac
# a use-conditional build time dependency on virtual/perl-Test-Simple, and
# the required RESTRICT setting.
# @ECLASS_VARIABLE: PERL_USEDEP
# @OUTPUT_VARIABLE
# @DESCRIPTION:
# An eclass-generated USE-dependency string for the features of the
# installed Perl. While by far not as critical as for Python, this should
# be used to depend at least on Perl packages installing compiled
# (binary) files.
#
# Example use:
# @CODE
# RDEPEND=dev-perl/DBI[${PERL_USEDEP}]
# @CODE
#
# Example value:
# @CODE
# perl_features_debug=,perl_features_ithreads=,perl_features_quadmath=
# @CODE
PERL_USEDEP="perl_features_debug=,perl_features_ithreads=,perl_features_quadmath="
GENTOO_PERL_DEPSTRING=">=dev-lang/perl-5.38.2-r3[${PERL_USEDEP}]"
GENTOO_PERL_USESTRING="perl_features_debug perl_features_ithreads perl_features_quadmath"
case ${EAPI} in
7)
[[ ${CATEGORY} == perl-core ]] && \
@ -51,14 +73,16 @@ case ${EAPI} in
case "${GENTOO_DEPEND_ON_PERL:-yes}" in
yes)
DEPEND="dev-lang/perl"
BDEPEND="dev-lang/perl"
RDEPEND="dev-lang/perl:="
IUSE=${GENTOO_PERL_USESTRING}
DEPEND=${GENTOO_PERL_DEPSTRING}
BDEPEND=${GENTOO_PERL_DEPSTRING}
RDEPEND="${GENTOO_PERL_DEPSTRING} dev-lang/perl:="
;;
noslotop)
DEPEND="dev-lang/perl"
BDEPEND="dev-lang/perl"
RDEPEND="dev-lang/perl"
IUSE=${GENTOO_PERL_USESTRING}
DEPEND=${GENTOO_PERL_DEPSTRING}
BDEPEND=${GENTOO_PERL_DEPSTRING}
RDEPEND=${GENTOO_PERL_DEPSTRING}
;;
esac
@ -78,17 +102,18 @@ case ${EAPI} in
case "${GENTOO_DEPEND_ON_PERL:-yes}" in
yes|noslotop)
DEPEND="dev-lang/perl"
BDEPEND="dev-lang/perl
test? ( virtual/perl-Test-Simple )"
IUSE="test"
IUSE=${GENTOO_PERL_USESTRING}
DEPEND=${GENTOO_PERL_DEPSTRING}
BDEPEND="${GENTOO_PERL_DEPSTRING}
test? ( >=virtual/perl-Test-Simple-1 )"
IUSE+=" test"
RESTRICT="!test? ( test )"
;;&
yes)
RDEPEND="dev-lang/perl:="
RDEPEND="${GENTOO_PERL_DEPSTRING} dev-lang/perl:="
;;
noslotop)
RDEPEND="dev-lang/perl"
RDEPEND=${GENTOO_PERL_DEPSTRING}
;;
esac
@ -209,6 +234,10 @@ perl-module_src_prepare() {
perl-module_src_configure() {
debug-print-function ${FUNCNAME} "$@"
# Perl runs LD with LDFLAGS
export CCLD=$(tc-getCC)
unset LD
perl_check_env
perl_set_version
@ -216,6 +245,8 @@ perl-module_src_configure() {
[[ -z ${pm_echovar} ]] && export PERL_MM_USE_DEFAULT=1
# Disable ExtUtils::AutoInstall from prompting
export PERL_EXTUTILS_AUTOINSTALL="--skipdeps"
# Noisy and not really appropriate to show to the user in a PM
export PERL_CANARY_STABILITY_DISABLE=1
if [[ $(declare -p myconf 2>&-) != "declare -a myconf="* ]]; then
local myconf_local=(${myconf})
@ -241,8 +272,15 @@ perl-module_src_configure() {
set -- \
--installdirs=vendor \
--libdoc= \
--destdir="${D}" \
--create_packlist=1 \
--config ar="$(tc-getAR)" \
--config cc="$(tc-getCC)" \
--config cpp="$(tc-getCPP)" \
--config ld="$(tc-getCC)" \
--config nm="$(tc-getNM)" \
--config ranlib="$(tc-getRANLIB)" \
--config optimize="${CFLAGS}" \
--config ldflags="${LDFLAGS}" \
"${myconf_local[@]}"
einfo "perl Build.PL" "$@"
perl Build.PL "$@" <<< "${pm_echovar}" \
@ -250,10 +288,17 @@ perl-module_src_configure() {
elif [[ -f Makefile.PL ]] ; then
einfo "Using ExtUtils::MakeMaker"
set -- \
PREFIX=${EPREFIX}/usr \
AR="$(tc-getAR)" \
CC="$(tc-getCC)" \
CPP="$(tc-getCPP)" \
LD="$(tc-getCC)" \
NM="$(tc-getNM)" \
RANLIB="$(tc-getRANLIB)" \
OPTIMIZE="${CFLAGS}" \
LDFLAGS="${LDFLAGS}" \
PREFIX="${EPREFIX}"/usr \
INSTALLDIRS=vendor \
INSTALLMAN3DIR='none' \
DESTDIR="${D}" \
"${myconf_local[@]}"
einfo "perl Makefile.PL" "$@"
perl Makefile.PL "$@" <<< "${pm_echovar}" \
@ -329,6 +374,7 @@ perl-module_src_test() {
local my_test_control
local my_test_verbose
local my_test_makeopts
[[ -n "${DIST_TEST_OVERRIDE}" ]] && ewarn "DIST_TEST_OVERRIDE is set to ${DIST_TEST_OVERRIDE}"
my_test_control=${DIST_TEST_OVERRIDE:-${DIST_TEST:-do parallel}}
@ -338,6 +384,10 @@ perl-module_src_test() {
return 0
fi
if has 'do' ${my_test_control} && ! has 'parallel' ${my_test_control} ; then
my_test_makeopts="-j1"
fi
if has verbose ${my_test_control} ; then
my_test_verbose=1
else
@ -354,6 +404,13 @@ perl-module_src_test() {
export NO_NETWORK_TESTING=1
fi
# See https://www.perlmonks.org/?node_id=1225311
# * AUTOMATED_TESTING appears inappropriate for us, as it affects
# exit codes and might mask failures if configuration is wrong.
# * EXTENDED_TESTING is something we could consider if we had
# some way to opt-in to expensive tests.
export NONINTERACTIVE_TESTING=1
case ${EAPI} in
7)
;;
@ -370,7 +427,7 @@ perl-module_src_test() {
if [[ -f Build ]] ; then
./Build test verbose=${my_test_verbose} || die "test failed"
elif [[ -f Makefile ]] ; then
emake test TEST_VERBOSE=${my_test_verbose}
emake ${my_test_makeopts} test TEST_VERBOSE=${my_test_verbose}
fi
}
@ -387,7 +444,7 @@ perl-module_src_install() {
if [[ -f Build ]]; then
mytargets="${mytargets:-install}"
mbparams="${mbparams:---pure}"
mbparams="${mbparams:---destdir="${D}" --pure}"
einfo "./Build ${mytargets} ${mbparams}"
./Build ${mytargets} ${mbparams} \
|| die "./Build ${mytargets} ${mbparams} failed"
@ -401,7 +458,7 @@ perl-module_src_install() {
else
local myinst_local=("${myinst[@]}")
fi
emake "${myinst_local[@]}" ${mytargets}
emake DESTDIR="${D}" "${myinst_local[@]}" ${mytargets}
fi
case ${EAPI} in

View File

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: qmake-utils.eclass
@ -9,7 +9,7 @@
# @SUPPORTED_EAPIS: 7 8
# @BLURB: Common functions for qmake-based packages.
# @DESCRIPTION:
# Utility eclass providing wrapper functions for Qt5 qmake.
# Utility eclass providing wrapper functions for Qt qmake.
#
# This eclass does not set any metadata variables nor export any phase
# functions. It can be inherited safely.
@ -60,6 +60,36 @@ qt5_get_plugindir() {
echo $(qt5_get_libdir)/qt5/plugins
}
# @FUNCTION: qt5_get_qmake_args
# @DESCRIPTION:
# Echoes a multi-line string containing arguments to pass to qmake.
qt5_get_qmake_args() {
cat <<-EOF
QMAKE_AR="$(tc-getAR) cqs"
QMAKE_CC="$(tc-getCC)"
QMAKE_LINK_C="$(tc-getCC)"
QMAKE_LINK_C_SHLIB="$(tc-getCC)"
QMAKE_CXX="$(tc-getCXX)"
QMAKE_LINK="$(tc-getCXX)"
QMAKE_LINK_SHLIB="$(tc-getCXX)"
QMAKE_OBJCOPY="$(tc-getOBJCOPY)"
QMAKE_RANLIB=
QMAKE_STRIP=
QMAKE_CFLAGS="${CFLAGS}"
QMAKE_CFLAGS_RELEASE=
QMAKE_CFLAGS_DEBUG=
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO=
QMAKE_CXXFLAGS="${CXXFLAGS}"
QMAKE_CXXFLAGS_RELEASE=
QMAKE_CXXFLAGS_DEBUG=
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO=
QMAKE_LFLAGS="${LDFLAGS}"
QMAKE_LFLAGS_RELEASE=
QMAKE_LFLAGS_DEBUG=
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO=
EOF
}
# @FUNCTION: eqmake5
# @USAGE: [arguments for qmake]
# @DESCRIPTION:
@ -75,28 +105,10 @@ eqmake5() {
ebegin "Running qmake"
"$(qt5_get_bindir)"/qmake \
-makefile \
QMAKE_AR="$(tc-getAR) cqs" \
QMAKE_CC="$(tc-getCC)" \
QMAKE_LINK_C="$(tc-getCC)" \
QMAKE_LINK_C_SHLIB="$(tc-getCC)" \
QMAKE_CXX="$(tc-getCXX)" \
QMAKE_LINK="$(tc-getCXX)" \
QMAKE_LINK_SHLIB="$(tc-getCXX)" \
QMAKE_OBJCOPY="$(tc-getOBJCOPY)" \
QMAKE_RANLIB= \
QMAKE_STRIP= \
QMAKE_CFLAGS="${CFLAGS}" \
QMAKE_CFLAGS_RELEASE= \
QMAKE_CFLAGS_DEBUG= \
QMAKE_CXXFLAGS="${CXXFLAGS}" \
QMAKE_CXXFLAGS_RELEASE= \
QMAKE_CXXFLAGS_DEBUG= \
QMAKE_LFLAGS="${LDFLAGS}" \
QMAKE_LFLAGS_RELEASE= \
QMAKE_LFLAGS_DEBUG= \
"$@"
local -a args
mapfile -t args <<<"$(qt5_get_qmake_args)"
# NB: we're passing literal quotes in but qmake doesn't seem to mind
"$(qt5_get_bindir)"/qmake -makefile "${args[@]}" "$@"
if ! eend $? ; then
echo
@ -107,4 +119,99 @@ eqmake5() {
fi
}
# @FUNCTION: qt6_get_bindir
# @DESCRIPTION:
# Echoes the directory where Qt6 binaries are installed.
# EPREFIX is already prepended to the returned path.
qt6_get_bindir() {
echo ${EPREFIX}$(qt6_get_libdir)/qt6/bin
}
# @FUNCTION: qt6_get_headerdir
# @DESCRIPTION:
# Echoes the directory where Qt6 headers are installed.
qt6_get_headerdir() {
echo /usr/include/qt6
}
# @FUNCTION: qt6_get_libdir
# @DESCRIPTION:
# Echoes the directory where Qt6 libraries are installed.
qt6_get_libdir() {
echo /usr/$(get_libdir)
}
# @FUNCTION: qt6_get_mkspecsdir
# @DESCRIPTION:
# Echoes the directory where Qt6 mkspecs are installed.
qt6_get_mkspecsdir() {
echo $(qt6_get_libdir)/qt6/mkspecs
}
# @FUNCTION: qt6_get_plugindir
# @DESCRIPTION:
# Echoes the directory where Qt6 plugins are installed.
qt6_get_plugindir() {
echo $(qt6_get_libdir)/qt6/plugins
}
# @FUNCTION: qt6_get_qmake_args
# @DESCRIPTION:
# Echoes a multi-line string containing arguments to pass to qmake.
qt6_get_qmake_args() {
cat <<-EOF
QMAKE_AR="$(tc-getAR) cqs"
QMAKE_CC="$(tc-getCC)"
QMAKE_LINK_C="$(tc-getCC)"
QMAKE_LINK_C_SHLIB="$(tc-getCC)"
QMAKE_CXX="$(tc-getCXX)"
QMAKE_LINK="$(tc-getCXX)"
QMAKE_LINK_SHLIB="$(tc-getCXX)"
QMAKE_OBJCOPY="$(tc-getOBJCOPY)"
QMAKE_RANLIB=
QMAKE_STRIP=
QMAKE_CFLAGS="${CFLAGS}"
QMAKE_CFLAGS_RELEASE=
QMAKE_CFLAGS_DEBUG=
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO=
QMAKE_CXXFLAGS="${CXXFLAGS}"
QMAKE_CXXFLAGS_RELEASE=
QMAKE_CXXFLAGS_DEBUG=
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO=
QMAKE_LFLAGS="${LDFLAGS}"
QMAKE_LFLAGS_RELEASE=
QMAKE_LFLAGS_DEBUG=
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO=
EOF
}
# @FUNCTION: eqmake6
# @USAGE: [arguments for qmake]
# @DESCRIPTION:
# Wrapper for Qt6's qmake. All arguments are passed to qmake.
#
# For recursive build systems, i.e. those based on the subdirs template,
# you should run eqmake6 on the top-level project file only, unless you
# have a valid reason to do otherwise. During the building, qmake will
# be automatically re-invoked with the right arguments on every directory
# specified inside the top-level project file.
eqmake6() {
debug-print-function ${FUNCNAME} "$@"
ebegin "Running qmake"
local -a args
mapfile -t args <<<"$(qt6_get_qmake_args)"
# NB: we're passing literal quotes in but qmake doesn't seem to mind
"$(qt6_get_bindir)"/qmake -makefile "${args[@]}" "$@"
if ! eend $? ; then
echo
eerror "Running qmake has failed! (see above for details)"
eerror "This shouldn't happen - please send a bug report to https://bugs.gentoo.org/"
echo
die "eqmake6 failed"
fi
}
fi

View File

@ -1,4 +1,4 @@
# Copyright 1999-2023 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: secureboot.eclass
@ -44,7 +44,12 @@ case ${EAPI} in
esac
IUSE="secureboot"
BDEPEND="secureboot? ( app-crypt/sbsigntools )"
BDEPEND="
secureboot? (
app-crypt/sbsigntools
dev-libs/openssl
)
"
# @ECLASS_VARIABLE: SECUREBOOT_SIGN_KEY
# @USER_VARIABLE
@ -75,12 +80,19 @@ _secureboot_die_if_unset() {
if [[ -z ${SECUREBOOT_SIGN_KEY} || -z ${SECUREBOOT_SIGN_CERT} ]]; then
die "USE=secureboot enabled but SECUREBOOT_SIGN_KEY and/or SECUREBOOT_SIGN_CERT not set."
fi
if [[ ! ${SECUREBOOT_SIGN_KEY} == pkcs11:* && ! -r ${SECUREBOOT_SIGN_KEY} ]]; then
die "SECUREBOOT_SIGN_KEY=${SECUREBOOT_SIGN_KEY} not found or not readable!"
fi
if [[ ! -r ${SECUREBOOT_SIGN_CERT} ]]; then
die "SECUREBOOT_SIGN_CERT=${SECUREBOOT_SIGN_CERT} not found or not readable!"
# Sanity check: fail early if key/cert in DER format or does not exist
local openssl_args=(
-inform PEM -in "${SECUREBOOT_SIGN_CERT}"
-noout -nocert
)
if [[ ${SECUREBOOT_SIGN_KEY} == pkcs11:* ]]; then
openssl_args+=( -engine pkcs11 -keyform ENGINE -key "${SECUREBOOT_SIGN_KEY}" )
else
openssl_args+=( -keyform PEM -key "${SECUREBOOT_SIGN_KEY}" )
fi
openssl x509 "${openssl_args[@]}" ||
die "Secure Boot signing certificate or key not found or not PEM format."
}
# @FUNCTION: secureboot_pkg_setup

View File

@ -1,4 +1,4 @@
# Copyright 2019-2021 Gentoo Authors
# Copyright 2019-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: sgml-catalog-r1.eclass
@ -12,14 +12,13 @@
# This eclass regenerates /etc/sgml/catalog as necessary for the DocBook
# tooling. This is done via exported pkg_postinst and pkg_postrm phases.
case ${EAPI:-0} in
case ${EAPI} in
7) ;;
*) die "Unsupported EAPI=${EAPI} for ${ECLASS}";;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
EXPORT_FUNCTIONS pkg_postinst pkg_postrm
if [[ ! ${_SGML_CATALOG_R1} ]]; then
if [[ -z ${_SGML_CATALOG_R1_ECLASS} ]]; then
_SGML_CATALOG_R1_ECLASS=1
if [[ ${CATEGORY}/${PN} != app-text/sgml-common ]]; then
RDEPEND=">=app-text/sgml-common-0.6.3-r7"
@ -36,7 +35,7 @@ sgml-catalog-r1_update_catalog() {
if [[ ${#cats[@]} -gt 0 ]]; then
ebegin "Updating ${EROOT}/etc/sgml/catalog"
printf 'CATALOG "%s"\n' "${cats[@]}" > "${T}"/catalog &&
printf 'CATALOG "%s"\n' "${cats[@]#${ROOT}}" > "${T}"/catalog &&
mv "${T}"/catalog "${EROOT}"/etc/sgml/catalog
eend "${?}"
else
@ -64,5 +63,6 @@ sgml-catalog-r1_pkg_postrm() {
sgml-catalog-r1_update_env
}
_SGML_CATALOG_R1=1
fi
EXPORT_FUNCTIONS pkg_postinst pkg_postrm

View File

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ssl-cert.eclass
@ -6,7 +6,7 @@
# maintainer-needed@gentoo.org
# @AUTHOR:
# Max Kalika <max@gentoo.org>
# @SUPPORTED_EAPIS: 6 7 8
# @SUPPORTED_EAPIS: 7 8
# @BLURB: Eclass for SSL certificates
# @DESCRIPTION:
# This eclass implements a standard installation procedure for installing
@ -14,50 +14,39 @@
# @EXAMPLE:
# "install_cert /foo/bar" installs ${ROOT}/foo/bar.{key,csr,crt,pem}
case "${EAPI}" in
6|7|8) ;;
*) die "EAPI=${EAPI:-0} is not supported" ;;
case ${EAPI} in
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ ! ${_SSL_CERT_ECLASS} ]]; then
if [[ -z ${_SSL_CERT_ECLASS} ]]; then
_SSL_CERT_ECLASS=1
# @ECLASS-VARIABLE: SSL_CERT_MANDATORY
# @ECLASS_VARIABLE: SSL_CERT_MANDATORY
# @PRE_INHERIT
# @DESCRIPTION:
# Set to non zero if ssl-cert is mandatory for ebuild.
: ${SSL_CERT_MANDATORY:=0}
: "${SSL_CERT_MANDATORY:=0}"
# @ECLASS-VARIABLE: SSL_CERT_USE
# @ECLASS_VARIABLE: SSL_CERT_USE
# @PRE_INHERIT
# @DESCRIPTION:
# Use flag to append dependency to.
: ${SSL_CERT_USE:=ssl}
: "${SSL_CERT_USE:=ssl}"
# @ECLASS-VARIABLE: SSL_DEPS_SKIP
# @ECLASS_VARIABLE: SSL_DEPS_SKIP
# @PRE_INHERIT
# @DESCRIPTION:
# Set to non zero to skip adding to DEPEND and IUSE.
: ${SSL_DEPS_SKIP:=0}
: "${SSL_DEPS_SKIP:=0}"
if [[ "${SSL_DEPS_SKIP}" == "0" ]]; then
if [[ "${SSL_CERT_MANDATORY}" == "0" ]]; then
SSL_DEPEND="${SSL_CERT_USE}? ( dev-libs/openssl:0 )"
BDEPEND="${SSL_CERT_USE}? ( dev-libs/openssl )"
IUSE="${SSL_CERT_USE}"
else
SSL_DEPEND="dev-libs/openssl:0"
BDEPEND="dev-libs/openssl"
fi
case "${EAPI}" in
6)
DEPEND="${SSL_DEPEND}"
;;
*)
BDEPEND="${SSL_DEPEND}"
;;
esac
unset SSL_DEPEND
fi
# @FUNCTION: gen_cnf

View File

@ -1,4 +1,4 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: subversion.eclass
@ -6,58 +6,54 @@
# Akinori Hattori <hattya@gentoo.org>
# @AUTHOR:
# Original Author: Akinori Hattori <hattya@gentoo.org>
# @SUPPORTED_EAPIS: 6 7 8
# @SUPPORTED_EAPIS: 7 8
# @BLURB: Fetch software sources from subversion repositories
# @DESCRIPTION:
# The subversion eclass provides functions to fetch software sources
# from subversion repositories.
ESVN="${ECLASS}"
case ${EAPI} in
6|7|8) inherit estack ;;
*) die "${ESVN}: EAPI ${EAPI:-0} is not supported" ;;
7|8) inherit estack ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_SUBVERSION_ECLASS} ]]; then
_SUBVERSION_ECLASS=1
PROPERTIES+=" live"
DEPEND="
BDEPEND="
dev-vcs/subversion[http(+)]
net-misc/rsync"
case ${EAPI} in
6) ;;
*) BDEPEND="${DEPEND}"; DEPEND="" ;;
esac
# @ECLASS-VARIABLE: ESVN_STORE_DIR
# @ECLASS_VARIABLE: ESVN_STORE_DIR
# @USER_VARIABLE
# @DESCRIPTION:
# subversion sources store directory. Users may override this in /etc/portage/make.conf
[[ -z ${ESVN_STORE_DIR} ]] && ESVN_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/svn-src"
# @ECLASS-VARIABLE: ESVN_FETCH_CMD
# @ECLASS_VARIABLE: ESVN_FETCH_CMD
# @DESCRIPTION:
# subversion checkout command
ESVN_FETCH_CMD="svn checkout"
# @ECLASS-VARIABLE: ESVN_UPDATE_CMD
# @ECLASS_VARIABLE: ESVN_UPDATE_CMD
# @DESCRIPTION:
# subversion update command
ESVN_UPDATE_CMD="svn update"
# @ECLASS-VARIABLE: ESVN_SWITCH_CMD
# @ECLASS_VARIABLE: ESVN_SWITCH_CMD
# @DESCRIPTION:
# subversion switch command
ESVN_SWITCH_CMD="svn switch"
# @ECLASS-VARIABLE: ESVN_OPTIONS
# @ECLASS_VARIABLE: ESVN_OPTIONS
# @DESCRIPTION:
# the options passed to checkout or update. If you want a specific revision see
# ESVN_REPO_URI instead of using -rREV.
ESVN_OPTIONS="${ESVN_OPTIONS:-}"
# @ECLASS-VARIABLE: ESVN_REPO_URI
# @ECLASS_VARIABLE: ESVN_REPO_URI
# @DESCRIPTION:
# repository uri
#
@ -73,7 +69,7 @@ ESVN_OPTIONS="${ESVN_OPTIONS:-}"
# to peg to a specific revision, append @REV to the repo's uri
ESVN_REPO_URI="${ESVN_REPO_URI:-}"
# @ECLASS-VARIABLE: ESVN_REVISION
# @ECLASS_VARIABLE: ESVN_REVISION
# @DESCRIPTION:
# User configurable revision checkout or update to from the repository
#
@ -83,17 +79,17 @@ ESVN_REPO_URI="${ESVN_REPO_URI:-}"
# Note: This should never be set in an ebuild!
ESVN_REVISION="${ESVN_REVISION:-}"
# @ECLASS-VARIABLE: ESVN_USER
# @ECLASS_VARIABLE: ESVN_USER
# @DESCRIPTION:
# User name
ESVN_USER="${ESVN_USER:-}"
# @ECLASS-VARIABLE: ESVN_PASSWORD
# @ECLASS_VARIABLE: ESVN_PASSWORD
# @DESCRIPTION:
# Password
ESVN_PASSWORD="${ESVN_PASSWORD:-}"
# @ECLASS-VARIABLE: ESVN_PROJECT
# @ECLASS_VARIABLE: ESVN_PROJECT
# @DESCRIPTION:
# project name of your ebuild (= name space)
#
@ -116,7 +112,7 @@ ESVN_PASSWORD="${ESVN_PASSWORD:-}"
# default: ${PN/-svn}.
ESVN_PROJECT="${ESVN_PROJECT:-${PN/-svn}}"
# @ECLASS-VARIABLE: ESVN_RESTRICT
# @ECLASS_VARIABLE: ESVN_RESTRICT
# @DESCRIPTION:
# this should be a space delimited list of subversion eclass features to
# restrict.
@ -124,7 +120,7 @@ ESVN_PROJECT="${ESVN_PROJECT:-${PN/-svn}}"
# don't export the working copy to S.
ESVN_RESTRICT="${ESVN_RESTRICT:-}"
# @ECLASS-VARIABLE: ESVN_OFFLINE
# @ECLASS_VARIABLE: ESVN_OFFLINE
# @USER_VARIABLE
# @DEFAULT_UNSET
# @DESCRIPTION:
@ -133,7 +129,7 @@ ESVN_RESTRICT="${ESVN_RESTRICT:-}"
# tree by users.
ESVN_OFFLINE="${ESVN_OFFLINE:-${EVCS_OFFLINE}}"
# @ECLASS-VARIABLE: ESVN_UMASK
# @ECLASS_VARIABLE: ESVN_UMASK
# @USER_VARIABLE
# @DESCRIPTION:
# Set this variable to a custom umask. This is intended to be set by users.
@ -144,15 +140,15 @@ ESVN_OFFLINE="${ESVN_OFFLINE:-${EVCS_OFFLINE}}"
# already can screw the system over in more creative ways.
ESVN_UMASK="${ESVN_UMASK:-${EVCS_UMASK}}"
# @ECLASS-VARIABLE: ESVN_UP_FREQ
# @ECLASS_VARIABLE: ESVN_UP_FREQ
# @USER_VARIABLE
# @DESCRIPTION:
# Set the minimum number of hours between svn up'ing in any given svn module. This is particularly
# useful for split KDE ebuilds where we want to ensure that all submodules are compiled for the same
# revision. It should also be kept user overrideable.
# revision. It should also be kept user overridable.
ESVN_UP_FREQ="${ESVN_UP_FREQ:=}"
# @ECLASS-VARIABLE: ESCM_LOGDIR
# @ECLASS_VARIABLE: ESCM_LOGDIR
# @USER_VARIABLE
# @DESCRIPTION:
# User configuration variable. If set to a path such as e.g. /var/log/scm any
@ -176,10 +172,10 @@ subversion_fetch() {
local S_dest="${2}"
if [[ -z ${repo_uri} ]]; then
die "${ESVN}: ESVN_REPO_URI (or specified URI) is empty."
die "${ECLASS}: ESVN_REPO_URI (or specified URI) is empty."
fi
[[ -n "${ESVN_REVISION}" ]] && revision="${ESVN_REVISION}"
[[ -n ${ESVN_REVISION} ]] && revision="${ESVN_REVISION}"
# check for the scheme
local scheme="${repo_uri%%:*}"
@ -191,30 +187,30 @@ subversion_fetch() {
file)
;;
*)
die "${ESVN}: fetch from '${scheme}' is not yet implemented."
die "${ECLASS}: fetch from '${scheme}' is not yet implemented."
;;
esac
addread "/etc/subversion"
addwrite "${ESVN_STORE_DIR}"
if [[ -n "${ESVN_UMASK}" ]]; then
if [[ -n ${ESVN_UMASK} ]]; then
eumask_push "${ESVN_UMASK}"
fi
if [[ ! -d ${ESVN_STORE_DIR} ]]; then
debug-print "${FUNCNAME}: initial checkout. creating subversion directory"
mkdir -m 775 -p "${ESVN_STORE_DIR}" || die "${ESVN}: can't mkdir ${ESVN_STORE_DIR}."
mkdir -m 775 -p "${ESVN_STORE_DIR}" || die "${ECLASS}: can't mkdir ${ESVN_STORE_DIR}."
fi
pushd "${ESVN_STORE_DIR}" >/dev/null || die "${ESVN}: can't chdir to ${ESVN_STORE_DIR}"
pushd "${ESVN_STORE_DIR}" >/dev/null || die "${ECLASS}: can't chdir to ${ESVN_STORE_DIR}"
local wc_path="$(subversion__get_wc_path "${repo_uri}")"
local options="${ESVN_OPTIONS} --config-dir ${ESVN_STORE_DIR}/.subversion"
[[ -n "${revision}" ]] && options="${options} -r ${revision}"
[[ -n ${revision} ]] && options="${options} -r ${revision}"
if [[ "${ESVN_OPTIONS}" = *-r* ]]; then
if [[ ${ESVN_OPTIONS} == *-r* ]]; then
ewarn "\${ESVN_OPTIONS} contains -r, this usage is unsupported. Please"
ewarn "see \${ESVN_REPO_URI}"
fi
@ -237,32 +233,32 @@ subversion_fetch() {
debug-print "${FUNCNAME}: ${ESVN_FETCH_CMD} ${options} ${repo_uri}"
mkdir -m 775 -p "${ESVN_PROJECT}" || die "${ESVN}: can't mkdir ${ESVN_PROJECT}."
cd "${ESVN_PROJECT}" || die "${ESVN}: can't chdir to ${ESVN_PROJECT}"
if [[ -n "${ESVN_USER}" ]]; then
${ESVN_FETCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}."
mkdir -m 775 -p "${ESVN_PROJECT}" || die "${ECLASS}: can't mkdir ${ESVN_PROJECT}."
cd "${ESVN_PROJECT}" || die "${ECLASS}: can't chdir to ${ESVN_PROJECT}"
if [[ -n ${ESVN_USER} ]]; then
${ESVN_FETCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" "${repo_uri}" || die "${ECLASS}: can't fetch to ${wc_path} from ${repo_uri}."
else
${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}."
${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ECLASS}: can't fetch to ${wc_path} from ${repo_uri}."
fi
elif [[ -n ${ESVN_OFFLINE} ]]; then
svn upgrade "${wc_path}" &>/dev/null
svn cleanup "${wc_path}" &>/dev/null
subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy."
subversion_wc_info "${repo_uri}" || die "${ECLASS}: unknown problem occurred while accessing working copy."
if [[ -n ${ESVN_REVISION} && ${ESVN_REVISION} != ${ESVN_WC_REVISION} ]]; then
die "${ESVN}: You requested off-line updating and revision ${ESVN_REVISION} but only revision ${ESVN_WC_REVISION} is available locally."
die "${ECLASS}: You requested off-line updating and revision ${ESVN_REVISION} but only revision ${ESVN_WC_REVISION} is available locally."
fi
einfo "Fetching disabled: Using existing repository copy at revision ${ESVN_WC_REVISION}."
else
svn upgrade "${wc_path}" &>/dev/null
svn cleanup "${wc_path}" &>/dev/null
subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy."
subversion_wc_info "${repo_uri}" || die "${ECLASS}: unknown problem occurred while accessing working copy."
local esvn_up_freq=
if [[ -n ${ESVN_UP_FREQ} ]]; then
if [[ -n ${ESVN_UP_FREQ//[[:digit:]]} ]]; then
die "${ESVN}: ESVN_UP_FREQ must be an integer value corresponding to the minimum number of hours between svn up."
die "${ECLASS}: ESVN_UP_FREQ must be an integer value corresponding to the minimum number of hours between svn up."
elif [[ -z $(find "${wc_path}/.svn/entries" -mmin "+$((ESVN_UP_FREQ*60))") ]]; then
einfo "Fetching disabled since ${ESVN_UP_FREQ} hours has not passed since last update."
einfo "Using existing repository copy at revision ${ESVN_WC_REVISION}."
@ -278,16 +274,16 @@ subversion_fetch() {
einfo " new UUID: $(subversion__svn_info "${repo_uri}" "Repository UUID")"
einfo " repository: ${repo_uri}${revision:+@}${revision}"
rm -fr "${ESVN_PROJECT}" || die
rm -rf "${ESVN_PROJECT}" || die
debug-print "${FUNCNAME}: ${ESVN_FETCH_CMD} ${options} ${repo_uri}"
mkdir -m 775 -p "${ESVN_PROJECT}" || die "${ESVN}: can't mkdir ${ESVN_PROJECT}."
cd "${ESVN_PROJECT}" || die "${ESVN}: can't chdir to ${ESVN_PROJECT}"
if [[ -n "${ESVN_USER}" ]]; then
${ESVN_FETCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}."
mkdir -m 775 -p "${ESVN_PROJECT}" || die "${ECLASS}: can't mkdir ${ESVN_PROJECT}."
cd "${ESVN_PROJECT}" || die "${ECLASS}: can't chdir to ${ESVN_PROJECT}"
if [[ -n ${ESVN_USER} ]]; then
${ESVN_FETCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" "${repo_uri}" || die "${ECLASS}: can't fetch to ${wc_path} from ${repo_uri}."
else
${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}."
${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ECLASS}: can't fetch to ${wc_path} from ${repo_uri}."
fi
elif [[ ${ESVN_WC_URL} != $(subversion__get_repository_uri "${repo_uri}") ]]; then
einfo "subversion switch start -->"
@ -296,11 +292,11 @@ subversion_fetch() {
debug-print "${FUNCNAME}: ${ESVN_SWITCH_CMD} ${options} ${repo_uri}"
cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}"
if [[ -n "${ESVN_USER}" ]]; then
${ESVN_SWITCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" ${repo_uri} || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
cd "${wc_path}" || die "${ECLASS}: can't chdir to ${wc_path}"
if [[ -n ${ESVN_USER} ]]; then
${ESVN_SWITCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" ${repo_uri} || die "${ECLASS}: can't update ${wc_path} from ${repo_uri}."
else
${ESVN_SWITCH_CMD} ${options} ${repo_uri} || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
${ESVN_SWITCH_CMD} ${options} ${repo_uri} || die "${ECLASS}: can't update ${wc_path} from ${repo_uri}."
fi
else
# update working copy
@ -309,35 +305,35 @@ subversion_fetch() {
debug-print "${FUNCNAME}: ${ESVN_UPDATE_CMD} ${options}"
cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}"
if [[ -n "${ESVN_USER}" ]]; then
${ESVN_UPDATE_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
cd "${wc_path}" || die "${ECLASS}: can't chdir to ${wc_path}"
if [[ -n ${ESVN_USER} ]]; then
${ESVN_UPDATE_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" || die "${ECLASS}: can't update ${wc_path} from ${repo_uri}."
else
${ESVN_UPDATE_CMD} ${options} || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
${ESVN_UPDATE_CMD} ${options} || die "${ECLASS}: can't update ${wc_path} from ${repo_uri}."
fi
fi
# export updated information for the working copy
subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy."
subversion_wc_info "${repo_uri}" || die "${ECLASS}: unknown problem occurred while accessing working copy."
fi
fi
if [[ -n "${ESVN_UMASK}" ]]; then
if [[ -n ${ESVN_UMASK} ]]; then
eumask_pop
fi
einfo " working copy: ${wc_path}"
if ! has "export" ${ESVN_RESTRICT}; then
cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}"
cd "${wc_path}" || die "${ECLASS}: can't chdir to ${wc_path}"
local S="${S}/${S_dest}"
mkdir -p "${S}"
# export to the ${WORKDIR}
#* "svn export" has a bug. see https://bugs.gentoo.org/119236
#* svn export . "${S}" || die "${ESVN}: can't export to ${S}."
rsync -rlpgo --exclude=".svn/" . "${S}" || die "${ESVN}: can't export to ${S}."
#* svn export . "${S}" || die "${ECLASS}: can't export to ${S}."
rsync -rlpgo --exclude=".svn/" . "${S}" || die "${ECLASS}: can't export to ${S}."
fi
popd >/dev/null
@ -374,7 +370,7 @@ subversion_wc_info() {
# @DESCRIPTION:
# Default src_unpack. Fetch.
subversion_src_unpack() {
subversion_fetch || die "${ESVN}: unknown problem occurred in subversion_fetch."
subversion_fetch || die "${ECLASS}: unknown problem occurred in subversion_fetch."
}
# @FUNCTION: subversion_pkg_preinst
@ -386,7 +382,7 @@ subversion_src_unpack() {
subversion_pkg_preinst() {
local pkgdate=$(date "+%Y%m%d %H:%M:%S")
if [[ -n ${ESCM_LOGDIR} ]]; then
local dir="${EROOT%/}${ESCM_LOGDIR}/${CATEGORY}"
local dir="${EROOT}${ESCM_LOGDIR}/${CATEGORY}"
if [[ ! -d ${dir} ]]; then
mkdir -p "${dir}" || eerror "Failed to create '${dir}' for logging svn revision"
fi
@ -401,11 +397,9 @@ subversion_pkg_preinst() {
## -- Private Functions
## -- subversion__svn_info() ------------------------------------------------- #
#
# param $1 - a target.
# param $2 - a key name.
#
# @FUNCTION: subversion__svn_info
# @USAGE: <target> <key name>
# @INTERNAL
subversion__svn_info() {
local target="${1}"
local key="${2}"
@ -415,15 +409,15 @@ subversion__svn_info() {
| cut -d" " -f2-
}
## -- subversion__get_repository_uri() --------------------------------------- #
#
# param $1 - a repository URI.
# @FUNCTION: subversion__get_repository_uri
# @USAGE: <repository URI>
# @INTERNAL
subversion__get_repository_uri() {
local repo_uri="${1}"
debug-print "${FUNCNAME}: repo_uri = ${repo_uri}"
if [[ -z ${repo_uri} ]]; then
die "${ESVN}: ESVN_REPO_URI (or specified URI) is empty."
die "${ECLASS}: ESVN_REPO_URI (or specified URI) is empty."
fi
# delete trailing slash
if [[ -z ${repo_uri##*/} ]]; then
@ -434,9 +428,9 @@ subversion__get_repository_uri() {
echo "${repo_uri}"
}
## -- subversion__get_wc_path() ---------------------------------------------- #
#
# param $1 - a repository URI.
# @FUNCTION: subversion__get_wc_path
# @USAGE: <repository URI>
# @INTERNAL
subversion__get_wc_path() {
local repo_uri="$(subversion__get_repository_uri "${1}")"
@ -445,16 +439,16 @@ subversion__get_wc_path() {
echo "${ESVN_STORE_DIR}/${ESVN_PROJECT}/${repo_uri##*/}"
}
## -- subversion__get_peg_revision() ----------------------------------------- #
#
# param $1 - a repository URI.
# @FUNCTION: subversion__get_peg_revision
# @USAGE: <repository URI>
# @INTERNAL
subversion__get_peg_revision() {
local repo_uri="${1}"
local peg_rev=
debug-print "${FUNCNAME}: repo_uri = ${repo_uri}"
# repo_uri has peg revision?
if [[ ${repo_uri} = *@* ]]; then
if [[ ${repo_uri} == *@* ]]; then
peg_rev="${repo_uri##*@}"
debug-print "${FUNCNAME}: peg_rev = ${peg_rev}"
else
@ -464,4 +458,6 @@ subversion__get_peg_revision() {
echo "${peg_rev}"
}
fi
EXPORT_FUNCTIONS src_unpack pkg_preinst

View File

@ -1,10 +1,10 @@
# Copyright 1999-2022 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: vcs-snapshot.eclass
# @MAINTAINER:
# mgorny@gentoo.org
# @SUPPORTED_EAPIS: 6 7 8
# @SUPPORTED_EAPIS: 7 8
# @BLURB: support eclass for unpacking VCS snapshot tarballs
# @DESCRIPTION:
# THIS ECLASS IS NOT NECESSARY FOR MODERN GITHUB AND GITLAB SNAPSHOTS.
@ -43,7 +43,7 @@
# in ${WORKDIR}/${P} and ${WORKDIR}/${P}-otherstuff respectively.
case ${EAPI} in
6|7|8) ;;
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
@ -102,13 +102,10 @@ vcs-snapshot_src_unpack() {
done
if [[ ! ${renamed_any} ]]; then
local w=eerror
[[ ${EAPI} == 6 ]] && w=eqawarn
"${w}" "${FUNCNAME} did not find any archives that needed renaming."
"${w}" "Please verify that its usage is really necessary, and remove"
"${w}" "the inherit if it is not."
[[ ${w} == eerror ]] && die "${FUNCNAME}: Unnecessary usage detected"
eerror "${FUNCNAME} did not find any archives that needed renaming."
eerror "Please verify that its usage is really necessary, and remove"
eerror "the inherit if it is not."
die "${FUNCNAME}: Unnecessary usage detected"
fi
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: xdg.eclass
@ -6,56 +6,54 @@
# freedesktop-bugs@gentoo.org
# @AUTHOR:
# Original author: Gilles Dartiguelongue <eva@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7 8
# @SUPPORTED_EAPIS: 6 7 8
# @PROVIDES: xdg-utils
# @BLURB: Provides phases for XDG compliant packages.
# @DESCRIPTION:
# Utility eclass to update the desktop, icon and shared mime info as laid
# out in the freedesktop specs & implementations
case ${EAPI} in
6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_XDG_ECLASS} ]]; then
_XDG_ECLASS=1
inherit xdg-utils
_DEFINE_XDG_SRC_PREPARE=false
case "${EAPI}" in
5|6|7)
# src_prepare is only exported in EAPI < 8.
EXPORT_FUNCTIONS src_prepare
_DEFINE_XDG_SRC_PREPARE=true
;;
8)
;;
*) die "${ECLASS}: EAPI=${EAPI} is not supported" ;;
esac
EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm
# Avoid dependency loop as both depend on glib-2
if [[ ${CATEGORY}/${P} != dev-libs/glib-2.* ]] ; then
_XDG_DEPEND="
[[ ${CATEGORY}/${P} != dev-libs/glib-2.* ]] && _XDG_DEPEND="
dev-util/desktop-file-utils
x11-misc/shared-mime-info
"
case "${EAPI}" in
5|6|7)
case ${EAPI} in
6|7)
# src_prepare is only exported in EAPI < 8.
# @FUNCTION: xdg_src_prepare
# @DESCRIPTION:
# Prepare sources to work with XDG standards.
# Note that this function is only defined and exported in EAPIs < 8.
xdg_src_prepare() {
xdg_environment_reset
default
}
EXPORT_FUNCTIONS src_prepare
DEPEND="${_XDG_DEPEND}"
;;
*)
xdg_src_prepare() {
die "Called xdg_src_prepare in EAPI >= 8"
}
IDEPEND="${_XDG_DEPEND}"
;;
esac
fi
if ${_DEFINE_XDG_SRC_PREPARE}; then
# @FUNCTION: xdg_src_prepare
# @DESCRIPTION:
# Prepare sources to work with XDG standards.
# Note that this function is only defined and exported in EAPIs < 8.
xdg_src_prepare() {
xdg_environment_reset
[[ ${EAPI} != 5 ]] && default
}
fi
unset _XDG_DEPEND
# @FUNCTION: xdg_pkg_preinst
# @DESCRIPTION:
@ -127,3 +125,6 @@ xdg_pkg_postrm() {
fi
}
fi
EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm