summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-16 10:53:11 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-16 10:53:11 -0500
commit8e65dc62f3f9f6b8f7b890fefedbf4ac05dfde0b (patch)
treebb1e83c18d1cc77cdebfc5aeb9b12ad39c9787b5 /eclass
parentf997c3ee588099e4f43e9ec845935868e3e60b8e (diff)
downloadbaldeagleos-repo-8e65dc62f3f9f6b8f7b890fefedbf4ac05dfde0b.tar.gz
baldeagleos-repo-8e65dc62f3f9f6b8f7b890fefedbf4ac05dfde0b.tar.xz
baldeagleos-repo-8e65dc62f3f9f6b8f7b890fefedbf4ac05dfde0b.zip
Adding metadata
Diffstat (limited to 'eclass')
-rw-r--r--eclass/cmake.eclass107
-rw-r--r--eclass/dist-kernel-utils.eclass25
-rw-r--r--eclass/distutils-r1.eclass155
-rw-r--r--eclass/ecm-common.eclass168
-rw-r--r--eclass/ecm.eclass219
-rw-r--r--eclass/frameworks.kde.org.eclass15
-rw-r--r--eclass/gear.kde.org.eclass18
-rw-r--r--eclass/kde.org.eclass73
-rw-r--r--eclass/kernel-2.eclass30
-rw-r--r--eclass/kernel-build.eclass119
-rw-r--r--eclass/llvm.org.eclass3
-rw-r--r--eclass/plasma.kde.org.eclass53
-rw-r--r--eclass/python-utils-r1.eclass20
-rw-r--r--eclass/secureboot.eclass58
-rw-r--r--eclass/toolchain.eclass7
15 files changed, 511 insertions, 559 deletions
diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index 5ea90aa4da24..e938a1119b21 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -561,9 +561,10 @@ cmake_src_configure() {
# Fix xdg collision with sandbox
xdg_environment_reset
+ local libdir=$(get_libdir)
+
# Prepare Gentoo override rules (set valid compiler, append CPPFLAGS etc.)
local build_rules=${BUILD_DIR}/gentoo_rules.cmake
-
cat > "${build_rules}" <<- _EOF_ || die
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE)
set(CMAKE_ASM-ATT_COMPILE_OBJECT "<CMAKE_ASM-ATT_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c -x assembler <SOURCE>" CACHE STRING "ASM-ATT compile command" FORCE)
@@ -571,10 +572,39 @@ cmake_src_configure() {
set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE)
set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE)
set(CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> ${FCFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "Fortran compile command" FORCE)
+
+ # in Prefix we need rpath and must ensure cmake gets our default linker path
+ # right ... except for Darwin hosts
+ if($(usex prefix-guest 1 0)) # if use prefix-guest
+ if(NOT APPLE)
+ set(CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
+ set(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH "${EPREFIX}/usr/${CHOST}/lib/gcc;${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/${libdir};${EPREFIX}/${libdir}" CACHE STRING "" FORCE)
+ else()
+ set(CMAKE_PREFIX_PATH "${EPREFIX}/usr" CACHE STRING "" FORCE)
+ set(CMAKE_MACOSX_RPATH ON CACHE BOOL "" FORCE)
+ set(CMAKE_SKIP_BUILD_RPATH OFF CACHE BOOL "" FORCE)
+ set(CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "" FORCE)
+ endif()
+ endif()
_EOF_
local myCC=$(tc-getCC) myCXX=$(tc-getCXX) myFC=$(tc-getFC)
+ # We are using the C compiler for assembly by default.
+ local -x ASMFLAGS=${CFLAGS}
+ local -x PKG_CONFIG=$(tc-getPKG_CONFIG)
+
+ local sysname
+ case "${KERNEL:-linux}" in
+ Cygwin) sysname="CYGWIN_NT-5.1" ;;
+ HPUX) sysname="HP-UX" ;;
+ Hurd) sysname="GNU" ;;
+ linux) sysname="Linux" ;;
+ Winnt) sysname="Windows" ;;
+ *) sysname="${KERNEL}" ;;
+ esac
+
# !!! IMPORTANT NOTE !!!
# Single slash below is intentional. CMake is weird and wants the
# CMAKE_*_VARIABLES split into two elements: the first one with
@@ -589,65 +619,26 @@ cmake_src_configure() {
set(CMAKE_Fortran_COMPILER "${myFC/ /;}")
set(CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE)
set(CMAKE_RANLIB $(type -P $(tc-getRANLIB)) CACHE FILEPATH "Archive index generator" FORCE)
+ set(CMAKE_SYSTEM_NAME "${sysname}")
+ set(CMAKE_CROSSCOMPILING $(tc-is-cross-compiler && echo TRUE || echo FALSE))
set(CMAKE_SYSTEM_PROCESSOR "${CHOST%%-*}")
- _EOF_
-
- # We are using the C compiler for assembly by default.
- local -x ASMFLAGS=${CFLAGS}
- local -x PKG_CONFIG=$(tc-getPKG_CONFIG)
-
- if tc-is-cross-compiler; then
- local sysname
- case "${KERNEL:-linux}" in
- Cygwin) sysname="CYGWIN_NT-5.1" ;;
- HPUX) sysname="HP-UX" ;;
- Hurd) sysname="GNU" ;;
- linux) sysname="Linux" ;;
- Winnt)
- sysname="Windows"
- cat >> "${toolchain_file}" <<- _EOF_ || die
- set(CMAKE_RC_COMPILER $(tc-getRC))
- _EOF_
- ;;
- *) sysname="${KERNEL}" ;;
- esac
- cat >> "${toolchain_file}" <<- _EOF_ || die
- set(CMAKE_SYSTEM_NAME "${sysname}")
- _EOF_
- fi
+ if(CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ set(CMAKE_RC_COMPILER $(tc-getRC))
+ endif()
- if [[ ${SYSROOT:-/} != / ]] ; then
# When building with a sysroot (e.g. with crossdev's emerge wrappers)
# we need to tell cmake to use libs/headers from the sysroot but programs from / only.
- cat >> "${toolchain_file}" <<- _EOF_ || die
+ if($(if [[ ${SYSROOT:-/} != / ]] ; then echo 1; else echo 0; fi)) # if \${SYSROOT:-/} != /
set(CMAKE_SYSROOT "${ESYSROOT}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
- _EOF_
- fi
-
- if use prefix-guest; then
- cat >> "${build_rules}" <<- _EOF_ || die
- # in Prefix we need rpath and must ensure cmake gets our default linker path
- # right ... except for Darwin hosts
- if(NOT APPLE)
- set(CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
- set(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH "${EPREFIX}/usr/${CHOST}/lib/gcc;${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/$(get_libdir);${EPREFIX}/$(get_libdir)" CACHE STRING "" FORCE)
- else()
- set(CMAKE_PREFIX_PATH "${EPREFIX}/usr" CACHE STRING "" FORCE)
- set(CMAKE_MACOSX_RPATH ON CACHE BOOL "" FORCE)
- set(CMAKE_SKIP_BUILD_RPATH OFF CACHE BOOL "" FORCE)
- set(CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE)
- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "" FORCE)
- endif()
- _EOF_
- fi
+ endif()
+ _EOF_
# Common configure parameters (invariants)
local common_config=${BUILD_DIR}/gentoo_common_config.cmake
- local libdir=$(get_libdir)
cat > "${common_config}" <<- _EOF_ || die
set(CMAKE_GENTOO_BUILD ON CACHE BOOL "Indicate Gentoo package build")
set(LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE)
@@ -664,19 +655,17 @@ cmake_src_configure() {
set(CMAKE_TLS_VERIFY ON CACHE BOOL "")
set(CMAKE_COMPILE_WARNING_AS_ERROR OFF CACHE BOOL "")
set(CMAKE_LINK_WARNING_AS_ERROR OFF 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
+ # See Gentoo-bug 689410
+ if($(if [[ "${ARCH}" == riscv ]]; then echo 1; else echo 0; fi)) # if \${ARCH} == riscv
+ set(CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX '"${libdir#lib}"' CACHE STRING "library search suffix" FORCE)
+ endif()
- if [[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]]; then
- echo 'set(CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}" || die
- fi
+ if($(if [[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]]; then echo 1; else echo 0; fi)) # if NOCOLOR=(true|yes)
+ set(CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)
+ endif()
- # Wipe the default optimization flags out of CMake
- cat >> ${common_config} <<- _EOF_ || die
+ # Wipe the default optimization flags out of CMake
set(CMAKE_ASM_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
set(CMAKE_ASM-ATT_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
set(CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
@@ -782,7 +771,9 @@ cmake_build() {
;;
esac
+ local rc=$? # save build tool's exit code in case of running under nonfatal
popd > /dev/null || die
+ return $rc
}
# @ECLASS_VARIABLE: CTEST_JOBS
diff --git a/eclass/dist-kernel-utils.eclass b/eclass/dist-kernel-utils.eclass
index 78cdd1fa2de7..ae56f844b78f 100644
--- a/eclass/dist-kernel-utils.eclass
+++ b/eclass/dist-kernel-utils.eclass
@@ -53,7 +53,7 @@ dist-kernel_get_image_path() {
arm)
echo arch/arm/boot/zImage
;;
- hppa|ppc|ppc64|s390|sparc)
+ alpha|hppa|m68k|mips|ppc|ppc64|s390|sparc)
# https://www.kernel.org/doc/html/latest/powerpc/bootwrapper.html
# ./ is required because of ${image_path%/*}
# substitutions in the code
@@ -405,6 +405,20 @@ dist-kernel_update_src_symlink() {
ebegin "Updating ${target} symlink"
ln -f -n -s "${target##*/}-${version}" "${target}"
eend ${?}
+ # If we're upgrading from older versions of g-k-bin that did not
+ # use the "-bin" suffix in KV_LOCALVERSION, we need to override
+ # the check in the eclass to successfully migrate the symlink.
+ # Since sys-kernel/gentoo-kernel was not co-installable with g-k-bin
+ # then, let's use its non-presence as a good heuristic whether to
+ # trigger the migration path.
+ elif [[ ${CATEGORY}/${PN} == sys-kernel/gentoo-kernel-bin ]] &&
+ ! has_version sys-kernel/gentoo-kernel &&
+ KV_LOCALVERSION=${KV_LOCALVERSION%-bin} \
+ dist-kernel_can_update_src_symlink "${target}"
+ then
+ ebegin "Updating ${target} symlink"
+ ln -f -n -s "${target##*/}-${version}" "${target}"
+ eend ${?}
else
elog "${target} points at another kernel, leaving it as-is."
elog "Please use 'eselect kernel' to update it when desired."
@@ -425,10 +439,13 @@ dist-kernel_update_lib_symlinks() {
if [[ -L ${EROOT}/lib && ${EROOT}/lib -ef ${EROOT}/usr/lib ]]; then
# Adjust symlinks for merged-usr.
- rm "${ED}/lib/modules/${version}"/{build,source} || die
- dosym "../../../src/linux-${version}" "/usr/lib/modules/${version}/build"
- dosym "../../../src/linux-${version}" "/usr/lib/modules/${version}/source"
local file
+ for file in build source; do
+ if [[ -L "${ED}/lib/modules/${version}/${file}" ]]; then
+ rm "${ED}/lib/modules/${version}/${file}" || die
+ dosym "../../../src/linux-${version}" "/usr/lib/modules/${version}/${file}"
+ fi
+ done
for file in .config System.map; do
if [[ -L "${ED}/lib/modules/${version}/${file#.}" ]]; then
rm "${ED}/lib/modules/${version}/${file#.}" || die
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 176a8b33ba9a..9141ec8e76be 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -94,38 +94,16 @@
# @PRE_INHERIT
# @REQUIRED
# @DESCRIPTION:
-# Specifies the PEP517 build system used for the package. Currently,
-# the following values are supported:
+# Specifies the PEP517 build system used for the package. Normally,
+# the values match the name of the package providing this backend.
#
-# - flit - flit-core backend
+# The currently supported backends are: flit-core, flit-scm, hatchling,
+# jupyter-packaging, maturin, meson-python, pbr, pdm-backend,
+# poetry-core, scikit-build-core, setuptools, sip, uv-build.
#
-# - flit_scm - flit_scm backend
-#
-# - hatchling - hatchling backend (from hatch)
-#
-# - jupyter - jupyter_packaging backend
-#
-# - maturin - maturin backend
-#
-# - meson-python - meson-python (mesonpy) backend
-#
-# - no - no PEP517 build system (see below)
-#
-# - pbr - pbr backend
-#
-# - pdm-backend - pdm.backend backend
-#
-# - poetry - poetry-core backend
-#
-# - scikit-build-core - scikit-build-core backend
-#
-# - setuptools - distutils or setuptools (incl. legacy mode)
-#
-# - sip - sipbuild backend
-#
-# - standalone - standalone/local build systems
-#
-# - uv-build - uv-build backend (using dev-python/uv)
+# Additionally, two special values are supported: "no" to indicate
+# no PEP517 build system, and "standalone" to indicate a standalone
+# (local to the package) build backend. Both are described further on.
#
# The variable needs to be set before the inherit line. If another
# value than "standalone" and "no" is used, The eclass adds appropriate
@@ -235,32 +213,42 @@ else
fi
_distutils_set_globals() {
+ # convert deprecated values
+ if [[ ${EAPI} == [78] ]]; then
+ case ${DISTUTILS_USE_PEP517} in
+ flit)
+ DISTUTILS_USE_PEP517=flit-core
+ ;;
+ flit_scm)
+ DISTUTILS_USE_PEP517=flit-scm
+ ;;
+ jupyter)
+ DISTUTILS_USE_PEP517=jupyter-packaging
+ ;;
+ poetry)
+ DISTUTILS_USE_PEP517=poetry-core
+ ;;
+ esac
+ fi
+
local rdep bdep
bdep='
>=dev-python/gpep517-16[${PYTHON_USEDEP}]
'
case ${DISTUTILS_USE_PEP517} in
- flit)
- bdep+='
- >=dev-python/flit-core-3.11.0[${PYTHON_USEDEP}]
- '
+ flit-core|hatchling|jupyter-packaging|meson-python|pbr|pdm-backend)
+ ;&
+ poetry-core|scikit-build-core|setuptools|sip|uv-build)
+ bdep+="
+ dev-python/${DISTUTILS_USE_PEP517}[\${PYTHON_USEDEP}]
+ "
;;
- flit_scm)
+ flit-scm)
bdep+='
>=dev-python/flit-core-3.11.0[${PYTHON_USEDEP}]
>=dev-python/flit-scm-1.7.0[${PYTHON_USEDEP}]
'
;;
- hatchling)
- bdep+='
- >=dev-python/hatchling-1.27.0[${PYTHON_USEDEP}]
- '
- ;;
- jupyter)
- bdep+='
- >=dev-python/jupyter-packaging-0.12.3[${PYTHON_USEDEP}]
- '
- ;;
maturin)
bdep+='
>=dev-util/maturin-1.8.2[${PYTHON_USEDEP}]
@@ -270,48 +258,8 @@ _distutils_set_globals() {
# undo the generic deps added above
bdep=
;;
- meson-python)
- bdep+='
- >=dev-python/meson-python-0.17.1[${PYTHON_USEDEP}]
- '
- ;;
- pbr)
- bdep+='
- >=dev-python/pbr-6.1.1[${PYTHON_USEDEP}]
- '
- ;;
- pdm-backend)
- bdep+='
- >=dev-python/pdm-backend-2.4.3[${PYTHON_USEDEP}]
- '
- ;;
- poetry)
- bdep+='
- >=dev-python/poetry-core-2.1.1[${PYTHON_USEDEP}]
- '
- ;;
- scikit-build-core)
- bdep+='
- >=dev-python/scikit-build-core-0.11.5[${PYTHON_USEDEP}]
- '
- ;;
- setuptools)
- bdep+='
- >=dev-python/setuptools-78.1.0[${PYTHON_USEDEP}]
- '
- ;;
- sip)
- bdep+='
- >=dev-python/sip-6.10.0[${PYTHON_USEDEP}]
- '
- ;;
standalone)
;;
- uv-build)
- bdep+='
- dev-python/uv-build[${PYTHON_USEDEP}]
- '
- ;;
*)
die "Unknown DISTUTILS_USE_PEP517=${DISTUTILS_USE_PEP517}"
;;
@@ -742,12 +690,12 @@ _distutils-r1_print_package_versions() {
)
fi
case ${DISTUTILS_USE_PEP517} in
- flit)
+ flit-core|meson-python|poetry-core|scikit-build-core|sip)
packages+=(
- dev-python/flit-core
+ "dev-python/${DISTUTILS_USE_PEP517}"
)
;;
- flit_scm)
+ flit-scm)
packages+=(
dev-python/flit-core
dev-python/flit-scm
@@ -761,7 +709,7 @@ _distutils-r1_print_package_versions() {
dev-python/hatch-vcs
)
;;
- jupyter)
+ jupyter-packaging)
packages+=(
dev-python/jupyter-packaging
dev-python/setuptools
@@ -777,11 +725,6 @@ _distutils-r1_print_package_versions() {
no)
return
;;
- meson-python)
- packages+=(
- dev-python/meson-python
- )
- ;;
pbr)
packages+=(
dev-python/pbr
@@ -795,16 +738,6 @@ _distutils-r1_print_package_versions() {
dev-python/setuptools
)
;;
- poetry)
- packages+=(
- dev-python/poetry-core
- )
- ;;
- scikit-build-core)
- packages+=(
- dev-python/scikit-build-core
- )
- ;;
setuptools)
packages+=(
dev-python/setuptools
@@ -813,11 +746,6 @@ _distutils-r1_print_package_versions() {
dev-python/wheel
)
;;
- sip)
- packages+=(
- dev-python/sip
- )
- ;;
uv-build)
packages+=(
dev-python/uv
@@ -867,16 +795,16 @@ _distutils-r1_key_to_backend() {
local key=${1}
case ${key} in
- flit)
+ flit-core)
echo flit_core.buildapi
;;
- flit_scm)
+ flit-scm)
echo flit_scm:buildapi
;;
hatchling)
echo hatchling.build
;;
- jupyter)
+ jupyter-packaging)
echo jupyter_packaging.build_api
;;
maturin)
@@ -891,7 +819,7 @@ _distutils-r1_key_to_backend() {
pdm-backend)
echo pdm.backend
;;
- poetry)
+ poetry-core)
echo poetry.core.masonry.api
;;
scikit-build-core)
@@ -1859,6 +1787,7 @@ _distutils-r1_post_python_install() {
eqawarn "QA Notice: Python extension modules (*$(get_modname)) found installed. Please set:"
eqawarn " DISTUTILS_EXT=1"
eqawarn "in the ebuild."
+ [[ ${EAPI} != [78] ]] && die "DISTUTILS_EXT not set"
_DISTUTILS_EXT_WARNED=1
fi
fi
diff --git a/eclass/ecm-common.eclass b/eclass/ecm-common.eclass
index 9db2d68e6f41..d14aa2bd3cdb 100644
--- a/eclass/ecm-common.eclass
+++ b/eclass/ecm-common.eclass
@@ -1,4 +1,4 @@
-# Copyright 2024-2025 Gentoo Authors
+# Copyright 2024-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ecm-common.eclass
@@ -28,51 +28,16 @@ inherit cmake
# @ECLASS_VARIABLE: KFMIN
# @DEFAULT_UNSET
# @DESCRIPTION:
-# Minimum version of Frameworks to require. Default value for kde-frameworks
-# is ${PV} and 6.0.0 baseline for everything else.
-# If set to <5.240, it is assumed dependencies are fulfilled by KF5/Qt5
-# alternatively, thus a block of SLOT=5 shadow dependencies added.
-if [[ ${CATEGORY} = kde-frameworks ]]; then
- : "${KFMIN:=$(ver_cut 1-2)}"
-fi
-: "${KFMIN:=6.0.0}"
-
-# @ECLASS_VARIABLE: _KFSLOT
-# @INTERNAL
-# @DESCRIPTION:
-# KDE Frameworks main slot dependency for consistently finding all KF5 or KF6
-# in CMakeLists.txt. Consistency over installed KF packages is established via
-# BDEPEND, then detected in pkg_setup().
-# Is passed as -DQT_MAJOR_VERSION=${_KFSLOT} in src_configure() too.
-_KFSLOT=6
-
-# @ECLASS_VARIABLE: KF5_BDEPEND
-# @PRE_INHERIT
-# @DESCRIPTION:
-# Dynamic KF5 dependency list.
-if [[ ${KF5_BDEPEND} ]]; then
- [[ ${KF5_BDEPEND@a} == *a* ]] ||
- die "KF5_BDEPEND must be an array"
-else
- KF5_BDEPEND=( )
-fi
+# Minimum version of Frameworks to require. Baseline value is 6.22.0.
+: "${KFMIN:=6.22.0}"
-# @ECLASS_VARIABLE: KF6_BDEPEND
-# @PRE_INHERIT
-# @DESCRIPTION:
-# Dynamic KF6 dependency list.
-if [[ ${KF6_BDEPEND} ]]; then
- [[ ${KF6_BDEPEND@a} == *a* ]] ||
- die "KF6_BDEPEND must be an array"
-else
- KF6_BDEPEND=( )
-fi
+ver_test ${KFMIN} -lt 5.240 && die "KF5 is unsupported!"
# @ECLASS_VARIABLE: ECM_I18N
# @PRE_INHERIT
# @DESCRIPTION:
# Will accept "true" (default) or "false". If set to "false", do nothing.
-# Otherwise, add kde-frameworks/ki18n:* to BDEPEND, find KF[56]I18n and let
+# Otherwise, add kde-frameworks/ki18n:6 to BDEPEND, find KF6I18n and let
# ki18n_install(po) generate and install translations.
: "${ECM_I18N:=true}"
@@ -80,8 +45,8 @@ fi
# @PRE_INHERIT
# @DESCRIPTION:
# Will accept "true" or "false" (default). If set to "false", do nothing.
-# Otherwise, add "+handbook" to IUSE, add kde-frameworks/kdoctools:* to BDEPEND
-# find KF[56]DocTools in CMake, call add_subdirectory(ECM_HANDBOOK_DIRS)
+# Otherwise, add "+handbook" to IUSE, add kde-frameworks/kdoctools:6 to BDEPEND
+# find KF6DocTools in CMake, call add_subdirectory(ECM_HANDBOOK_DIRS)
# and let let kdoctools_install(po) generate and install translated docbook
# files.
: "${ECM_HANDBOOK:=false}"
@@ -123,9 +88,11 @@ fi
# @DEFAULT_UNSET
# @PRE_INHERIT
# @DESCRIPTION:
+# If empty, do nothing. Otherwise, add kde-frameworks/kcmutils:6 to BDEPEND
+# and set up the CMaḱeLists.txt according to the content of ECM_KCM_TARGETS:
# Array of <target>:<subdir> tuples to feed to ECMInstallIcons via
-# ecmcommon_generate_desktop_file(<target> <subdir>), which is this
-# eclass adaptation of kcmutils_generate_desktop_file.
+# ecmcommon_generate_desktop_file(<target> <subdir>), which is this eclass'
+# adaptation of kcmutils_generate_desktop_file.
if [[ ${ECM_KCM_TARGETS} ]]; then
[[ ${ECM_KCM_TARGETS@a} == *a* ]] ||
die "ECM_KCM_TARGETS must be an array"
@@ -135,13 +102,13 @@ DESCRIPTION="Common files for ${PN/-common/}"
BDEPEND="
>=dev-build/cmake-3.31.9-r1
+ dev-qt/qtbase:6
>=kde-frameworks/extra-cmake-modules-${KFMIN}:*
"
case ${ECM_I18N} in
true)
- KF5_BDEPEND+=( "kde-frameworks/ki18n:5" )
- KF6_BDEPEND+=( "kde-frameworks/ki18n:6" )
+ BDEPEND+=" kde-frameworks/ki18n:6"
;;
false) ;;
*)
@@ -153,8 +120,7 @@ esac
case ${ECM_HANDBOOK} in
true)
IUSE+=" +handbook"
- KF5_BDEPEND+=( "handbook? ( kde-frameworks/kdoctools:5 )" )
- KF6_BDEPEND+=( "handbook? ( kde-frameworks/kdoctools:6 )" )
+ BDEPEND+=" handbook? ( kde-frameworks/kdoctools:6 )"
;;
false) ;;
*)
@@ -164,22 +130,7 @@ case ${ECM_HANDBOOK} in
esac
if [[ ${ECM_KCM_TARGETS} ]]; then
- KF5_BDEPEND+=( "kde-frameworks/kcmutils:5" )
- KF6_BDEPEND+=( "kde-frameworks/kcmutils:6" )
-fi
-
-KF6_BDEPEND+=( "dev-qt/qtbase:6" )
-
-if $(ver_test ${KFMIN} -lt 5.240) && [[ ${KF6_BDEPEND} && ${KF5_BDEPEND} ]]; then
- BDEPEND+=" || (
- ( ${KF6_BDEPEND[*]} )
- (
- ${KF5_BDEPEND[*]}
- dev-qt/qtcore:5
- )
- )"
-else
- BDEPEND+=" ${KF6_BDEPEND[*]}"
+ BDEPEND+=" kde-frameworks/kcmutils:6"
fi
# @FUNCTION: _ecm-common_preamble
@@ -194,13 +145,13 @@ _ecm-common_preamble() {
find_package(ECM "${KFMIN}" REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH \${ECM_MODULE_PATH})
- # Set by pkg_setup(); Use this if need to differ between KF5 or KF6
- set(KFSLOT ${_KFSLOT})
+ # TODO EAPI-9: No longer used after KF5 cleanup.
+ set(KFSLOT 6)
set(KDE_INSTALL_DOCBUNDLEDIR "${EPREFIX}/usr/share/help" CACHE PATH "")
include(KDEInstallDirs)
include(ECMOptionalAddSubdirectory) # commonly used
- include(FeatureSummary)
+ include(ECMFeatureSummary)
_EOF_
if [[ ${ECM_INSTALL_ICONS} ]]; then
@@ -213,11 +164,11 @@ _ecm-common_preamble() {
# @FUNCTION: _ecm-common_i18n
# @INTERNAL
# @DESCRIPTION:
-# Find KF[56]I18n and call ki18n_install(po).
+# Find KF6I18n and call ki18n_install(po).
_ecm-common_i18n() {
[[ ${ECM_I18N} == true ]] || return
cat >> CMakeLists.txt <<- _EOF_ || die
- find_package(KF\${KFSLOT}I18n REQUIRED)
+ find_package(KF6I18n REQUIRED)
ki18n_install(po)
_EOF_
}
@@ -225,13 +176,13 @@ _ecm-common_i18n() {
# @FUNCTION: _ecm-common_docs
# @INTERNAL
# @DESCRIPTION:
-# Find KF[56]DocTools, call kdoctools_install(po) and
+# Find KF6DocTools, call kdoctools_install(po) and
# add_subdirectory(${ECM_HANDBOOK_DIRS})
_ecm-common_docs() {
{ in_iuse handbook && use handbook; } || return
cat >> CMakeLists.txt <<- _EOF_ || die
- find_package(KF\${KFSLOT}DocTools REQUIRED)
+ find_package(KF6DocTools REQUIRED)
kdoctools_install(po)
_EOF_
@@ -248,19 +199,19 @@ _ecm-common_docs() {
# @FUNCTION: _ecm-common_generate_desktop_file
# @INTERNAL
# @DESCRIPTION:
-# Find KF[56]KCMUtils and iterate through ECM_KCM_TARGETS to generate
+# Find KF6KCMUtils and iterate through ECM_KCM_TARGETS to generate
# desktop files out of json.
_ecm-common_generate_desktop_file() {
[[ ${ECM_KCM_TARGETS} ]] || return
cat >> CMakeLists.txt <<- _EOF_ || die
- find_package(KF\${KFSLOT}KCMUtils REQUIRED)
+ find_package(KF6KCMUtils REQUIRED)
# extracted from kcmutils_generate_desktop_file(kcm_target)
function(ecmcommon_generate_desktop_file kcm_target subdir)
set(IN_FILE \${CMAKE_CURRENT_SOURCE_DIR}/\${subdir}\${kcm_target}.json)
set(OUT_FILE \${CMAKE_CURRENT_BINARY_DIR}/\${kcm_target}.desktop)
add_custom_target(\${kcm_target}-kcm-desktop-gen ALL
- COMMAND KF\${KFSLOT}::kcmdesktopfilegenerator \${IN_FILE} \${OUT_FILE}
+ COMMAND KF6::kcmdesktopfilegenerator \${IN_FILE} \${OUT_FILE}
DEPENDS \${IN_FILE})
install(FILES \${OUT_FILE} DESTINATION \${KDE_INSTALL_APPDIR})
endfunction()
@@ -312,72 +263,27 @@ ecm-common_inject_heredoc() {
# @FUNCTION: _ecm-common_summary
# @INTERNAL
# @DESCRIPTION:
-# Just calls feature_summary
+# Just calls ecm_feature_summary
_ecm-common_summary() {
cat >> CMakeLists.txt <<- _EOF_ || die
- feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
+ ecm_feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
_EOF_
}
-# @FUNCTION: _ecm-common-check_deps
-# @INTERNAL
-# @DESCRIPTION:
-# Check existence of requested KF6 dependencies.
-_ecm-common-check_deps() {
- local chk=0
- case ${1} in
- i18n)
- if [[ ${ECM_I18N} ]]; then
- chk=$(has_version -b "kde-frameworks/ki18n:6")
- fi
- ;;
- doctools)
- if [[ ${ECM_HANDBOOK} ]] && in_iuse handbook; then
- if use handbook; then
- chk=$(has_version -b "kde-frameworks/kdoctools:6")
- fi
- fi
- ;;
- kcmutils)
- if [[ ${ECM_KCM_TARGETS} ]]; then
- chk=$(has_version -b "kde-frameworks/kcmutils:6")
- fi
- ;;
- *)
- eerror "Unknown value for _ecm-common-check_deps()"
- die "Value ${1} is not supported"
- ;;
- esac
- return ${chk}
-}
-
# @FUNCTION: ecm-common-check_deps
# @DESCRIPTION:
-# Override this to add more KF6 has_version checks to pkg_setup(),
-# corresponding with any additional KF6_BDEPEND defined pre-inherit.
-# If false, we'll assume KF5 dependencies are fulfilled via BDEPEND.
+# No-op function since KF5 support was dropped.
ecm-common-check_deps() {
return 0
}
+if [[ ${EAPI} == 8 ]]; then
# @FUNCTION: ecm-common_pkg_setup
# @DESCRIPTION:
-# If KFMIN is not lower than 5.240 (default is 6.0.0), do nothing.
-# Otherwise, dDetermine which of KF5 or KF6-based depgraph is complete,
-# preferring KF6. The result is stored in _KFSLOT, which is then handed
-# to CMakeLists.txt as KFSLOT var for further use.
-ecm-common_pkg_setup() {
- $(ver_test ${KFMIN} -ge 5.240) && return
-
- if _ecm-common-check_deps i18n && _ecm-common-check_deps doctools &&
- _ecm-common-check_deps kcmutils && ecm-common-check_deps
- then
- _KFSLOT=6
- else
- _KFSLOT=5
- fi
-}
+# No-op function since KF5 support was dropped.
+ecm-common_pkg_setup() { :; }
+fi
# @FUNCTION: ecm-common_src_prepare
# @DESCRIPTION:
@@ -400,10 +306,10 @@ ecm-common_src_prepare() {
# @FUNCTION: ecm-common_src_configure
# @DESCRIPTION:
-# Passes -DQT_MAJOR_VERSION=${_KFSLOT} only.
+# Passes -DQT_MAJOR_VERSION=6 only.
ecm-common_src_configure() {
# necessary for at least KF6KCMUtils
- local cmakeargs=( -DQT_MAJOR_VERSION=${_KFSLOT} )
+ local cmakeargs=( -DQT_MAJOR_VERSION=6 )
# allow the ebuild to override what we set here
mycmakeargs=("${cmakeargs[@]}" "${mycmakeargs[@]}")
@@ -413,4 +319,8 @@ ecm-common_src_configure() {
fi
-EXPORT_FUNCTIONS pkg_setup src_prepare src_configure
+if [[ ${EAPI} == 8 ]]; then
+ EXPORT_FUNCTIONS pkg_setup
+fi
+
+EXPORT_FUNCTIONS src_prepare src_configure
diff --git a/eclass/ecm.eclass b/eclass/ecm.eclass
index f656a6559ffd..2997872ac471 100644
--- a/eclass/ecm.eclass
+++ b/eclass/ecm.eclass
@@ -49,10 +49,9 @@ fi
# @ECLASS_VARIABLE: ECM_NONGUI
# @DESCRIPTION:
-# By default, for all CATEGORIES except kde-frameworks, assume we are building
-# a GUI application. Add dependency on kde-frameworks/breeze-icons or
-# kde-frameworks/oxygen-icons. With KFMIN lower than 6.9.0, inherit xdg.eclass,
-# run pkg_preinst, pkg_postinst and pkg_postrm. If set to "true", do nothing.
+# By default, for all CATEGORIES except kde-frameworks, set to "false", which
+# assumes we are building a GUI application, and depend on breeze-icons or
+# oxygen-icons. If set to "true", do nothing.
: "${ECM_NONGUI:=false}"
if [[ ${CATEGORY} == kde-frameworks ]]; then
ECM_NONGUI=true
@@ -81,28 +80,27 @@ fi
# Will accept "true", "false", "optional", "forceoptional", "forceoff".
# If set to "false" (default), do nothing.
# Otherwise, add "+handbook" to IUSE, add the appropriate dependency, and let
-# KF${_KFSLOT}DocTools generate and install the handbook from docbook file(s)
-# found in ECM_HANDBOOK_DIR. However if !handbook, disable build of
-# ECM_HANDBOOK_DIR in CMakeLists.txt.
-# If set to "optional", build with
-# -DCMAKE_DISABLE_FIND_PACKAGE_KF${_KFSLOT}DocTools=ON when !handbook. In case
-# package requires KF5KDELibs4Support, see next:
-# If set to "forceoptional", remove a KF${_KFSLOT}DocTools dependency from the
-# root CMakeLists.txt in addition to the above.
+# KF6DocTools generate and install the handbook from docbook file(s) found in
+# ECM_HANDBOOK_DIR. However if !handbook, disable build of ECM_HANDBOOK_DIR in
+# CMakeLists.txt.
+# If set to "optional", build with -DCMAKE_DISABLE_FIND_PACKAGE_KF6DocTools=ON
+# when !handbook.
+# If set to "forceoptional", remove a KF6DocTools dependency from the root
+# CMakeLists.txt in addition to the above.
: "${ECM_HANDBOOK:=false}"
# @ECLASS_VARIABLE: ECM_HANDBOOK_DIR
# @DESCRIPTION:
# Specifies the directory containing the docbook file(s) relative to ${S} to
-# be processed by KF${_KFSLOT}DocTools (kdoctools_install).
+# be processed by KF6DocTools (kdoctools_install).
: "${ECM_HANDBOOK_DIR:=doc}"
# @ECLASS_VARIABLE: ECM_PO_DIRS
# @PRE_INHERIT
# @DESCRIPTION:
# Specifies directories of l10n files relative to ${S} to be processed by
-# KF${_KFSLOT}I18n (ki18n_install). If IUSE nls exists and is disabled then
-# disable build of these directories in CMakeLists.txt.
+# KF6I18n (ki18n_install). If IUSE nls exists and is disabled then disable
+# build of these directories in CMakeLists.txt.
if [[ ${ECM_PO_DIRS} ]]; then
[[ ${ECM_PO_DIRS@a} == *a* ]] ||
die "ECM_PO_DIRS must be an array"
@@ -124,10 +122,10 @@ fi
# If set to "true", add "doc" to IUSE, add the appropriate dependency, let
# -DBUILD_QCH=ON generate and install Qt compressed help files when USE=doc.
# If set to "false", do nothing.
-if [[ ${CATEGORY} = kde-frameworks && ${_KFSLOT} == 5 ]]; then
+if [[ ${CATEGORY} = kde-frameworks ]]; then
# TODO: Implement KF 6.15 changes how API documentation is built. See also:
# https://mail.kde.org/pipermail/distributions/2025-June/001595.html
- : "${ECM_QTHELP:=true}"
+ : "${ECM_QTHELP:=false}"
fi
: "${ECM_QTHELP:=false}"
@@ -143,20 +141,11 @@ fi
# @ECLASS_VARIABLE: ECM_TEST
# @DEFAULT_UNSET
# @DESCRIPTION:
-# Will accept "true", "false", "forceoptional", and "forceoptional-recursive".
-# For KF5-based ebuilds, additionally accepts "optional".
+# Will accept "true", "false" or "forceoptional".
# Default value is "false", except for CATEGORY=kde-frameworks where it is
# set to "true". If set to "false", do nothing.
# For any other value, add "test" to IUSE. If set to "forceoptional", ignore
-# "autotests", "test", "tests" subdirs from top-level CMakeLists.txt when
-# USE=!test. If set to "forceoptional-recursive", make autotest(s), unittest(s)
-# and test(s) subdirs from *any* CMakeLists.txt in ${S} and below conditional
-# on BUILD_TESTING when USE=!test. This is always meant as a short-term fix and
-# creates ${T}/${P}-tests-optional.patch to refine and submit upstream.
-# For KF5-based ebuilds:
-# Additionally DEPEND on dev-qt/qttest:5 if USE=test, but punt Qt5Test
-# dependency if set to "forceoptional*" with USE=!test.
-# If set to "optional", build with -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Test=ON
+# "appiumtests", "autotests", "test", "tests" subdirs from root CMakeLists.txt
# when USE=!test.
if [[ ${CATEGORY} = kde-frameworks ]]; then
: "${ECM_TEST:=true}"
@@ -168,33 +157,17 @@ fi
# @DEFAULT_UNSET
# @DESCRIPTION:
# Minimum version of Frameworks to require. Default value for kde-frameworks
-# is ${PV} and 5.116.0 baseline for everything else.
-# If set to >=5.240, KF6/Qt6 is assumed thus SLOT=6 dependencies added and
-# -DQT_MAJOR_VERSION=6 added to cmake args.
+# is ${PV} and 6.22.0 baseline for everything else. KF5 is unsupported.
if [[ ${CATEGORY} = kde-frameworks ]]; then
: "${KFMIN:=$(ver_cut 1-2)}"
fi
-: "${KFMIN:=5.116.0}"
+: "${KFMIN:=6.22.0}"
if ver_test ${KFMIN} -lt 6.9 && [[ ${ECM_NONGUI} == false ]]; then
inherit xdg
fi
-# @ECLASS_VARIABLE: _KFSLOT
-# @INTERNAL
-# @DESCRIPTION:
-# KDE Frameworks and Qt main slot dependency, implied by KFMIN version, *not*
-# necessarily the package's SLOT. This is being used throughout the eclass to
-# depend on either :5 or :6 Qt/KF packages as well as setting correctly
-# prefixed cmake args.
-: "${_KFSLOT:=5}"
-if [[ ${CATEGORY} == kde-frameworks ]]; then
- ver_test ${KFMIN} -ge 5.240 && _KFSLOT=6
-else
- if [[ ${KFMIN/.*} == 6 ]] || $(ver_test ${KFMIN} -ge 5.240); then
- _KFSLOT=6
- fi
-fi
+ver_test ${KFMIN} -lt 5.240 && die "KF5 is unsupported!"
# @ECLASS_VARIABLE: KDE_GCC_MINIMAL
# @DEFAULT_UNSET
@@ -233,11 +206,7 @@ esac
case ${ECM_DESIGNERPLUGIN} in
true)
IUSE+=" designer"
- if [[ ${_KFSLOT} == 6 ]]; then
- BDEPEND+=" designer? ( dev-qt/qttools:${_KFSLOT}[designer] )"
- else
- BDEPEND+=" designer? ( dev-qt/designer:${_KFSLOT} )"
- fi
+ BDEPEND+=" designer? ( dev-qt/qttools:6[designer] )"
;;
false) ;;
*)
@@ -260,7 +229,7 @@ esac
case ${ECM_HANDBOOK} in
true|optional|forceoptional)
IUSE+=" +handbook"
- BDEPEND+=" handbook? ( >=kde-frameworks/kdoctools-${KFMIN}:${_KFSLOT} )"
+ BDEPEND+=" handbook? ( >=kde-frameworks/kdoctools-${KFMIN}:6 )"
;;
false|forceoff) ;;
*)
@@ -281,13 +250,11 @@ esac
case ${ECM_QTHELP} in
true)
IUSE+=" doc"
- COMMONDEPEND+=" doc? ( dev-qt/qt-docs:${_KFSLOT} )"
- BDEPEND+=" doc? ( >=app-text/doxygen-1.8.13-r1 )"
- if [[ ${_KFSLOT} == 6 ]]; then
- BDEPEND+=" doc? ( dev-qt/qttools:${_KFSLOT}[assistant] )"
- else
- BDEPEND+=" doc? ( dev-qt/qthelp:${_KFSLOT} )"
- fi
+ COMMONDEPEND+=" doc? ( dev-qt/qt-docs:6 )"
+ BDEPEND+=" doc? (
+ >=app-text/doxygen-1.8.13-r1
+ dev-qt/qttools:6[assistant]
+ )"
;;
false) ;;
*)
@@ -298,13 +265,10 @@ esac
case ${ECM_TEST} in
optional)
- if [[ ${_KFSLOT} != 5 ]]; then
- eerror "Banned value for \${ECM_TEST}"
- die "Value ${ECM_TEST} is only supported in KF5"
- fi
+ eerror "Banned value for \${ECM_TEST}"
+ die "Value ${ECM_TEST} was only supported in KF5"
;;
- true|forceoptional|forceoptional-recursive) ;;
- false) ;;
+ true|false|forceoptional) ;;
*)
eerror "Unknown value for \${ECM_TEST}"
die "Value ${ECM_TEST} is not supported"
@@ -319,16 +283,8 @@ if [[ ${ECM_TEST} != false ]]; then
IUSE+=" test"
RESTRICT+=" !test? ( test )"
fi
-if [[ ${_KFSLOT} == 6 ]]; then
- RDEPEND+=" >=kde-frameworks/kf-env-6"
- COMMONDEPEND+=" dev-qt/qtbase:${_KFSLOT}"
-else
- RDEPEND+=" >=kde-frameworks/kf-env-4"
- COMMONDEPEND+=" dev-qt/qtcore:${_KFSLOT}"
- if [[ ${ECM_TEST} != false ]]; then
- DEPEND+=" test? ( dev-qt/qttest:5 )"
- fi
-fi
+RDEPEND+=" >=kde-frameworks/kf-env-6"
+COMMONDEPEND+=" dev-qt/qtbase:6"
DEPEND+=" ${COMMONDEPEND}"
RDEPEND+=" ${COMMONDEPEND}"
@@ -338,12 +294,37 @@ unset COMMONDEPEND
# @INTERNAL
# @DESCRIPTION:
# Use with ECM_HANDBOOK=optional; ticks either -DBUILD_DOC if available,
-# or -DCMAKE_DISABLE_FIND_PACKAGE_KF${_KFSLOT}DocTools
+# or -DCMAKE_DISABLE_FIND_PACKAGE_KF6DocTools
_ecm_handbook_optional() {
if grep -Eq "option.*BUILD_DOC" CMakeLists.txt; then
echo "-DBUILD_DOC=$(usex handbook)"
else
- echo "-DCMAKE_DISABLE_FIND_PACKAGE_KF${_KFSLOT}DocTools=$(usex !handbook)"
+ echo "-DCMAKE_DISABLE_FIND_PACKAGE_KF6DocTools=$(usex !handbook)"
+ fi
+}
+
+# @FUNCTION: _ecm_buildqch_optional
+# @INTERNAL
+# @DESCRIPTION:
+# Used with ECM_QTHELP; ticks -DBUILD_QCH only if available.
+_ecm_buildqch_optional() {
+ if use doc; then
+ echo "-DBUILD_QCH=ON"
+ elif grep -Eq "option.*BUILD_QCH" CMakeLists.txt; then
+ echo "-DBUILD_QCH=OFF"
+ fi
+}
+
+# @FUNCTION: _ecm_disable_unwanted
+# @INTERNAL
+# @DESCRIPTION:
+# Disable unwanted CMake options if they are present.
+_ecm_disable_unwanted() {
+ if grep -Eq "option.*ENABLE_PCH" CMakeLists.txt; then
+ echo "-DENABLE_PCH=OFF"
+ fi
+ if grep -Eq "option.*WARNINGS_AS_ERRORS" CMakeLists.txt; then
+ echo "-DWARNINGS_AS_ERRORS=OFF"
fi
}
@@ -564,51 +545,27 @@ ecm_src_prepare() {
# limit playing field of locale stripping to kde-*/ categories
if [[ ${CATEGORY} = kde-* ]] ; then
- # TODO: cleanup after KF5 removal:
- # always install unconditionally for <kconfigwidgets-6.16 - if you use
- # language X as system language, and there is a combobox with language
- # names, the translated language name for language Y is taken from
- # /usr/share/locale/Y/kf${_KFSLOT}_entry.desktop
- if ! [[ ${PN} == kconfigwidgets && ${_KFSLOT} == 5 ]]; then
- _ecm_strip_handbook_translations
- fi
+ _ecm_strip_handbook_translations
fi
# only build unit tests when required
if ! { in_iuse test && use test; } ; then
- if [[ ${ECM_TEST} = forceoptional ]] ; then
- [[ ${_KFSLOT} = 5 ]] && ecm_punt_qt_module Test
- # if forceoptional, also cover non-kde categories
- cmake_comment_add_subdirectory appiumtests autotests test tests
- elif [[ ${ECM_TEST} = forceoptional-recursive ]] ; then
- [[ ${_KFSLOT} = 5 ]] && ecm_punt_qt_module Test
- local f pf="${T}/${P}"-tests-optional.patch
- touch ${pf} || die "Failed to touch patch file"
- for f in $(find . -type f -name "CMakeLists.txt" -exec \
- grep -li "^\s*add_subdirectory\s*\(\s*.*\(auto|unit\)\?tests\?\s*)\s*\)" {} \;); do
- cp ${f} ${f}.old || die "Failed to prepare patch origfile"
- pushd ${f%/*} > /dev/null || die
- ecm_punt_qt_module Test
- sed -i CMakeLists.txt -e \
- "/^#/! s/add_subdirectory\s*\(\s*.*\(auto|unit\)\?tests\?\s*)\s*\)/if(BUILD_TESTING)\n&\nendif()/I" \
- || die
- popd > /dev/null || die
- diff -Naur ${f}.old ${f} 1>>${pf}
- rm ${f}.old || die "Failed to clean up"
- done
- eqawarn "QA Notice: Build system modified by ECM_TEST=forceoptional-recursive."
- eqawarn "Unified diff file ready for pickup in:"
- eqawarn " ${pf}"
- eqawarn "Push it upstream to make this message go away."
- elif [[ -n ${_KDE_ORG_ECLASS} ]] ; then
+ if has kde.org ${INHERITED} && [[ ${ECM_TEST} != forceoptional ]]; then
cmake_comment_add_subdirectory appiumtests autotests test tests
fi
fi
# in frameworks, tests = manual tests so never build them
- if [[ -n ${_FRAMEWORKS_KDE_ORG_ECLASS} ]] && [[ ${PN} != extra-cmake-modules ]]; then
+ if has frameworks.kde.org ${INHERITED}; then
cmake_comment_add_subdirectory tests
fi
+
+ # disable upstream git hooks (program detection, hook installation ...)
+ if [[ -d .git ]]; then
+ if grep -Eq "\s*set.*GIT_SOURCE_TARBALL TRUE" CMakeLists.txt; then
+ sed -e "/\s*set.*GIT_SOURCE_TARBALL/s/TRUE/FALSE/" -i CMakeLists.txt || die
+ fi
+ fi
}
# @FUNCTION: ecm_src_configure
@@ -624,20 +581,21 @@ ecm_src_configure() {
local cmakeargs
- if [[ ${_KFSLOT} == 6 ]]; then
- cmakeargs+=( -DQT_MAJOR_VERSION=6 )
+ if in_iuse test; then
+ cmakeargs+=( $(usev !test -DBUILD_TESTING=OFF) )
fi
- if in_iuse test && ! use test ; then
- cmakeargs+=( -DBUILD_TESTING=OFF )
+ if [[ ${ECM_HANDBOOK} = optional ]] ; then
+ cmakeargs+=( $(_ecm_handbook_optional) )
+ fi
- if [[ ${_KFSLOT} = 5 && ${ECM_TEST} = optional ]] ; then
- cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Test=ON )
- fi
+ if [[ ${ECM_QTHELP} = true ]]; then
+ cmakeargs+=( $(_ecm_buildqch_optional) )
fi
- if [[ ${ECM_HANDBOOK} = optional ]] ; then
- cmakeargs+=( $(_ecm_handbook_optional) )
+ # disable upstream CMake settings ... currently mostly PIM
+ if has gear.kde.org ${INHERITED}; then
+ cmakeargs+=( $(_ecm_disable_unwanted) )
fi
if in_iuse designer && [[ ${ECM_DESIGNERPLUGIN} = true ]]; then
@@ -648,10 +606,6 @@ ecm_src_configure() {
cmakeargs+=( -DBUILD_PYTHON_BINDINGS=OFF )
fi
- if [[ ${ECM_QTHELP} = true ]]; then
- cmakeargs+=( -DBUILD_QCH=$(usex doc) )
- fi
-
# Common ECM configure parameters (invariants)
local ecm_config=${BUILD_DIR}/gentoo_ecm_config.cmake
cat > ${ecm_config} <<- _EOF_ || die
@@ -660,21 +614,18 @@ ecm_src_configure() {
set(ECM_DISABLE_APPSTREAMTEST ON CACHE BOOL "") # *-disable-appstreamtest.patch
set(ECM_DISABLE_GIT ON CACHE BOOL "") # *-disable-git-commit-hooks.patch
- # KDEInstallDirs[56] section
+ set(BUILD_WITH_QT6 ON CACHE BOOL "") # QtVersionOption.cmake: Hard-require Qt6
+ # KDEInstallDirs6 section
set(KDE_INSTALL_USE_QT_SYS_PATHS ON CACHE BOOL "") # install mkspecs in same dir as Qt stuff
# move handbook outside of doc dir, bug #667138
set(KDE_INSTALL_DOCBUNDLEDIR "${EPREFIX}/usr/share/help" CACHE PATH "")
set(KDE_INSTALL_INFODIR "${EPREFIX}/usr/share/info" CACHE PATH "")
set(KDE_INSTALL_LIBDIR $(get_libdir) CACHE PATH "Output directory for libraries")
set(KDE_INSTALL_MANDIR "${EPREFIX}/usr/share/man" CACHE PATH "")
- _EOF_
- if [[ ${_KFSLOT} == 6 ]]; then
- cat >> ${ecm_config} <<- _EOF_ || die
- # TODO: Ask upstream why LIBEXECDIR is set to EXECROOTDIR/LIBDIR/libexec, bug #928345
- set(KDE_INSTALL_LIBEXECDIR "${EPREFIX}/usr/libexec" CACHE PATH "")
- _EOF_
- fi
+ # TODO: Ask upstream why LIBEXECDIR is set to EXECROOTDIR/LIBDIR/libexec, bug #928345
+ set(KDE_INSTALL_LIBEXECDIR "${EPREFIX}/usr/libexec" CACHE PATH "")
+ _EOF_
# allow the ebuild to override what we set here
mycmakeargs=(
@@ -761,7 +712,7 @@ ecm_src_install() {
fi
}
- if [[ -n ${_KDE_ORG_ECLASS} && -d "${ED}"/usr/share/metainfo/ ]]; then
+ if has kde.org ${INHERITED} && [[ -d "${ED}"/usr/share/metainfo/ ]]; then
if [[ ${KDE_ORG_NAME} != ${PN} ]]; then
local ecm_metainfo mainslot=${SLOT%/*}
pushd "${ED}"/usr/share/metainfo/ > /dev/null || die
diff --git a/eclass/frameworks.kde.org.eclass b/eclass/frameworks.kde.org.eclass
index d14037de0af3..5cde157ab702 100644
--- a/eclass/frameworks.kde.org.eclass
+++ b/eclass/frameworks.kde.org.eclass
@@ -1,10 +1,10 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: frameworks.kde.org.eclass
# @MAINTAINER:
# kde@gentoo.org
-# @SUPPORTED_EAPIS: 8
+# @SUPPORTED_EAPIS: 8 9
# @PROVIDES: kde.org
# @BLURB: Support eclass for KDE Frameworks packages.
# @DESCRIPTION:
@@ -17,14 +17,14 @@
# variables and helper functions (not phase functions) may be considered as
# part of this eclass's API.
+if [[ -z ${_FRAMEWORKS_KDE_ORG_ECLASS} ]]; then
+_FRAMEWORKS_KDE_ORG_ECLASS=1
+
case ${EAPI} in
- 8) ;;
+ 8|9) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-if [[ -z ${_FRAMEWORKS_KDE_ORG_ECLASS} ]]; then
-_FRAMEWORKS_KDE_ORG_ECLASS=1
-
# @ECLASS_VARIABLE: KDE_CATV
# @DESCRIPTION:
# Holds main Frameworks release number (major.minor) for use on same-category
@@ -43,9 +43,6 @@ inherit kde.org
HOMEPAGE="https://develop.kde.org/products/frameworks/"
SLOT=6
-if ver_test ${PV} -lt 5.240; then
- SLOT=5
-fi
case ${PN} in
extra-cmake-modules|kapidox)
SLOT=0
diff --git a/eclass/gear.kde.org.eclass b/eclass/gear.kde.org.eclass
index a9654557beda..5829b43bbc7e 100644
--- a/eclass/gear.kde.org.eclass
+++ b/eclass/gear.kde.org.eclass
@@ -1,10 +1,10 @@
-# Copyright 1999-2025 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: gear.kde.org.eclass
# @MAINTAINER:
# kde@gentoo.org
-# @SUPPORTED_EAPIS: 8
+# @SUPPORTED_EAPIS: 8 9
# @PROVIDES: kde.org
# @BLURB: Support eclass for KDE Gear packages.
# @DESCRIPTION:
@@ -17,14 +17,14 @@
# variables and helper functions (not phase functions) may be considered as
# part of this eclass's API.
+if [[ -z ${_GEAR_KDE_ORG_ECLASS} ]]; then
+_GEAR_KDE_ORG_ECLASS=1
+
case ${EAPI} in
- 8) ;;
+ 8|9) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-if [[ -z ${_GEAR_KDE_ORG_ECLASS} ]]; then
-_GEAR_KDE_ORG_ECLASS=1
-
# @ECLASS_VARIABLE: KDE_PV_UNRELEASED
# @INTERNAL
# @DESCRIPTION:
@@ -63,7 +63,7 @@ elif [[ -z ${KDE_ORG_COMMIT} ]]; then
SRC_URI="${_KDE_SRC_URI}${KDE_ORG_TAR_PN}-${PV}.tar.xz"
fi
-# list of applications ported to KF6 having to block SLOT=5
+# list of applications ported to KF6 having to block SLOT=5; TODO: drop on 2026-09-01
if $(ver_test -gt 24.01.75); then
case ${PN} in
akonadi | \
@@ -71,7 +71,6 @@ if $(ver_test -gt 24.01.75); then
akonadi-contacts | \
akonadi-import-wizard | \
akonadi-mime | \
- akonadi-notes | \
akonadi-search | \
akonadiconsole | \
akregator | \
@@ -173,7 +172,6 @@ if $(ver_test -gt 24.01.75); then
knavalbattle | \
knetwalk | \
knights | \
- knotes | \
kolf | \
kollision | \
konqueror | \
@@ -252,10 +250,8 @@ fi
if $(ver_test -gt 24.04.75); then
case ${PN} in
audex | \
- itinerary | \
kio-perldoc | \
kolourpaint | \
- libkcompactdisc | \
signon-kwallet-extension)
RDEPEND+=" !${CATEGORY}/${PN}:5" ;;
*) ;;
diff --git a/eclass/kde.org.eclass b/eclass/kde.org.eclass
index 47a52ef0234c..06f3929d3fbd 100644
--- a/eclass/kde.org.eclass
+++ b/eclass/kde.org.eclass
@@ -1,10 +1,10 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: kde.org.eclass
# @MAINTAINER:
# kde@gentoo.org
-# @SUPPORTED_EAPIS: 8
+# @SUPPORTED_EAPIS: 8 9
# @BLURB: Support eclass for packages that are hosted on kde.org infrastructure.
# @DESCRIPTION:
# This eclass is mainly providing facilities for the three upstream release
@@ -15,14 +15,14 @@
# It also contains default meta variables for settings not specific to any
# particular build system.
+if [[ -z ${_KDE_ORG_ECLASS} ]]; then
+_KDE_ORG_ECLASS=1
+
case ${EAPI} in
- 8) ;;
+ 8|9) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-if [[ -z ${_KDE_ORG_ECLASS} ]]; then
-_KDE_ORG_ECLASS=1
-
# @ECLASS_VARIABLE: KDE_BUILD_TYPE
# @DESCRIPTION:
# If PV matches "*9999*", this is automatically set to "live".
@@ -34,7 +34,10 @@ fi
export KDE_BUILD_TYPE
if [[ ${KDE_BUILD_TYPE} == live ]]; then
- inherit git-r3
+ case ${EAPI} in
+ 8) inherit eapi9-pipestatus ;&
+ *) inherit git-r3 ;;
+ esac
fi
# @ECLASS_VARIABLE: KDE_ORG_CATEGORIES
@@ -160,20 +163,10 @@ has ${PV} "${KDE_PV_UNRELEASED[*]}" && KDE_ORG_UNRELEASED=true
HOMEPAGE="https://kde.org/"
-if [[ ${CATEGORY} == dev-qt ]]; then
- KDE_ORG_NAME=${QT5_MODULE:-${PN}}
- HOMEPAGE="https://community.kde.org/Qt5PatchCollection
- https://invent.kde.org/qt/qt/ https://www.qt.io/"
-fi
-
case ${KDE_BUILD_TYPE} in
live)
EGIT_MIRROR=${EGIT_MIRROR:=https://invent.kde.org/${KDE_ORG_CATEGORY}}
EGIT_REPO_URI="${EGIT_MIRROR}/${EGIT_REPONAME:=$KDE_ORG_NAME}.git"
-
- if [[ ${PV} == 5.15.*.9999 && ${CATEGORY} == dev-qt ]]; then
- EGIT_BRANCH="kde/$(ver_cut 1-2)"
- fi
;;
*)
if [[ -n ${KDE_ORG_COMMIT} ]]; then
@@ -182,15 +175,11 @@ case ${KDE_BUILD_TYPE} in
SRC_URI+=" https://invent.kde.org/${KDE_ORG_CATEGORY}/${KDE_ORG_NAME}/-/"
SRC_URI+="archive/${KDE_ORG_COMMIT}/${KDE_ORG_NAME}-${KDE_ORG_COMMIT}.tar.gz"
SRC_URI+=" -> ${_KDE_ORG_TARFILE}"
- fi
- [[ ${KDE_ORG_UNRELEASED} == true ]] && RESTRICT+=" fetch"
- debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
- if [[ -n ${KDE_ORG_COMMIT} ]]; then
S=${WORKDIR}/${KDE_ORG_NAME}-${KDE_ORG_COMMIT}
- [[ ${CATEGORY} == dev-qt ]] && QT5_BUILD_DIR="${S}_build"
else
S=${WORKDIR}/${KDE_ORG_TAR_PN}-${PV}
fi
+ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
;;
esac
@@ -223,15 +212,51 @@ kde.org_pkg_nofetch() {
eerror "${KDE_ORG_SCHEDULE_URI}"
}
+# @FUNCTION: _kde.org_live_corrosion_unpack
+# @INTERNAL
+# @DESCRIPTION:
+# Handle rust crates for live packages. Iterates S directory with
+# corrosion_import_crate to fetch with cargo_live_src_unpack.
+_kde.org_live_corrosion_unpack() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ # Need to handle every corrosion "project" individually.
+ local path
+ while IFS= read -r -d '' path ; do
+ S="${path%/*}" cargo_live_src_unpack
+ done < <(find "${S}" -type f -iname CMakeLists.txt -print0 | xargs -0 grep -z -Z -l -i corrosion_import_crate; pipestatus || die)
+}
+
# @FUNCTION: kde.org_src_unpack
# @DESCRIPTION:
# Unpack the sources, automatically handling both release and live ebuilds.
+# For releases, if cargo.eclass is inherited, call cargo_src_unpack instead of
+# default. For live ebuilds, if both cmake.eclass and cargo.eclass are
+# inherited, deal with potential Corrosion.
kde.org_src_unpack() {
debug-print-function ${FUNCNAME} "$@"
+ # cargo detection, but only if rust_pkg_setup was called (CARGO_OPTIONAL support)
+ local isrusty
+ if has cargo ${INHERITED} && [[ -n "${CARGO}" ]]; then
+ isrusty=true
+ fi
+
case ${KDE_BUILD_TYPE} in
- live) git-r3_src_unpack ;&
- *) default ;;
+ live)
+ git-r3_src_unpack
+ default
+ if has cmake ${INHERITED} && [[ ${isrusty} ]]; then
+ _kde.org_live_corrosion_unpack
+ fi
+ ;;
+ *)
+ if [[ ${isrusty} ]]; then
+ cargo_src_unpack
+ else
+ default
+ fi
+ ;;
esac
}
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index 44b1bce504a9..8a675db7a74a 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -181,6 +181,15 @@
# this is useful for things like wolk. IE:
# EXTRAVERSION would be something like : -wolk-4.19-r1
+# @ECLASS_VARIABLE: K_NO_VERSION_CHECK
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If this is set, skip the sanity check that make sure
+# a kernel version patch number is present that
+# matches the kernel version indicated by the build name
+# This should be used in X.Y.0 kernels as the initial
+# ebuild does not contain a separate point release
+
# @ECLASS_VARIABLE: K_WANT_GENPATCHES
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -667,7 +676,7 @@ if [[ ${ETYPE} == sources ]]; then
SLOT=${SLOT:=${PVR}}
DESCRIPTION="Sources based on the Linux Kernel"
- IUSE="symlink build"
+ IUSE="symlink build vanilla"
# Bug #266157, deblob for libre support
if [[ -z ${K_PREDEBLOBBED} ]]; then
@@ -1131,7 +1140,7 @@ unipatch() {
fi
done < <(find "$KPATCH_DIR" -type f -print0)
- if [[ -z ${KV_PATCH_FOUND} ]]; then
+ if [[ -z ${K_NO_VERSION_CHECK} && -z ${KV_PATCH_FOUND} ]]; then
eerror "GENPATCHES does not contain linux patch ${OKV}"
eerror "Please check your ebuild for the proper K_GENPATCHES_VER=N"
die "GENPATCHES appears to be missing Linux patch ${OKV}"
@@ -1234,11 +1243,26 @@ unipatch() {
# So now lets get rid of the patch numbers we want to exclude
UNIPATCH_DROP="${UNIPATCH_EXCLUDE} ${UNIPATCH_DROP}"
for i in ${UNIPATCH_DROP}; do
- ebegin "Excluding Patch #${i}"
+ ebegin "Excluding Patch ${i}"
for x in ${KPATCH_DIR}; do rm -f ${x}/${i}* 2>/dev/null; done
eend $?
done
+ # for USE=vanilla, remove non-upstream patches
+ # which should be labeled as 1000_ through 1499_
+ if in_iuse vanilla && use vanilla; then
+ for patch in ${KPATCH_DIR}/*; do
+ patchname="${patch##*/}" # Extract filename without path
+ numericprefix="${patchname:0:4}" # Get first 4 characters
+ # Check if it's exactly 4 digits and greater than 1499
+ if [[ $numericprefix =~ ^[0-9]{4}$ ]] && (( numericprefix > 1499 )); then
+ ebegin "Excluding Patch ${patchname}"
+ rm ${patch} 2>/dev/null
+ eend $?
+ fi
+ done
+ fi
+
# and now, finally, we patch it :)
for x in ${KPATCH_DIR}; do
for i in $(find ${x} -maxdepth 1 -iname "*.patch*" -or -iname "*.diff*" | sort -n); do
diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index 14785efd8eed..a66481aeeb5c 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -36,7 +36,7 @@ esac
if [[ -z ${_KERNEL_BUILD_ECLASS} ]]; then
_KERNEL_BUILD_ECLASS=1
-PYTHON_COMPAT=( python3_{11..14} )
+PYTHON_COMPAT=( python3_{12..14} )
inherit branding multiprocessing python-any-r1 savedconfig secureboot
inherit toolchain-funcs kernel-install
@@ -65,6 +65,37 @@ fi
IUSE="+strip modules-sign"
REQUIRED_USE="secureboot? ( modules-sign )"
+# @ECLASS_VARIABLE: MEASUREDBOOT_SIGN_CERT
+# @USER_VARIABLE
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Used with USE=generic-uki. May be set to the path of the public key
+# certificate in PEM format to use for signing PCR policies. Useful
+# for automatically unlocking encrypted disks with a TPM.
+# If unspecified defaults to the value of SECUREBOOT_SIGN_CERT.
+: "${MEASUREDBOOT_SIGN_CERT:=${SECUREBOOT_SIGN_CERT}}"
+
+# @ECLASS_VARIABLE: MEASUREDBOOT_SIGN_HASH
+# @USER_VARIABLE
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Used with USE=generic-uki. Can be set to a comma or space-separated
+# list specifying which PCR banks to perform measurements for. If
+# unset all PCR banks are used which will fail if not supported by the
+# system.
+#
+# Valid values: sha512,sha384,sha256,sha1
+
+# @ECLASS_VARIABLE: MEASUREDBOOT_SIGN_KEY
+# @USER_VARIABLE
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Used with USE=generic-uki. May be set to the path of the private
+# key in PEM format to use for signing PCR policies. Useful for
+# automatically unlocking encrypted disks with a TPM.
+# If unspecified defaults to the value of SECUREBOOT_SIGN_KEY.
+: "${MEASUREDBOOT_SIGN_KEY:=${SECUREBOOT_SIGN_KEY}}"
+
# @ECLASS_VARIABLE: MODULES_SIGN_HASH
# @USER_VARIABLE
# @DEFAULT_UNSET
@@ -75,6 +106,7 @@ REQUIRED_USE="secureboot? ( modules-sign )"
# Valid values: sha512,sha384,sha256,sha224,sha1
#
# Default if unset: sha512
+: "${MODULES_SIGN_HASH:=sha512}"
# @ECLASS_VARIABLE: MODULES_SIGN_KEY
# @USER_VARIABLE
@@ -162,6 +194,30 @@ kernel-build_pkg_setup() {
fi
fi
fi
+
+ if [[ ${KERNEL_IUSE_GENERIC_UKI} ]] && use generic-uki; then
+ if [[ -n ${MEASUREDBOOT_SIGN_KEY} ]]; then
+ if [[ -z ${MEASUREDBOOT_SIGN_CERT} ]]; then
+ ewarn "A MEASUREDBOOT_SIGN_KEY was specified but no MEASUREDBOOT_SIGN_CERT"
+ ewarn "was set. Assuming the certificate is in the same file as the key."
+ export MEASUREDBOOT_SIGN_CERT=${MEASUREDBOOT_SIGN_KEY}
+ fi
+
+ # Sanity check: fail early if key/cert in DER format or does not exist
+ local openssl_args=(
+ -inform PEM -in "${MEASUREDBOOT_SIGN_CERT}"
+ -noout -nocert
+ )
+ if [[ ${MEASUREDBOOT_SIGN_KEY} == pkcs11:* ]]; then
+ openssl_args+=( -engine pkcs11 -keyform ENGINE -key "${MEASUREDBOOT_SIGN_KEY}" )
+ else
+ openssl_args+=( -keyform PEM -key "${MEASUREDBOOT_SIGN_KEY}" )
+ fi
+
+ openssl x509 "${openssl_args[@]}" ||
+ die "Measured Boot signing certificate or key not found or not PEM format."
+ fi
+ fi
fi
}
@@ -482,6 +538,9 @@ kernel-build_src_install() {
# add a dist-kernel identifier file
echo "${CATEGORY}/${PF}:${SLOT}" > "${ED}${kernel_dir}/dist-kernel" || die
+ # Clean up dead symlinks
+ find -L "${ED}${kernel_dir}/" -type l -delete || die
+
# fix source tree and build dir symlinks
dosym "../../../${kernel_dir}" "/lib/modules/${KV_FULL}/build"
dosym "../../../${kernel_dir}" "/lib/modules/${KV_FULL}/source"
@@ -622,37 +681,42 @@ kernel-build_src_install() {
done
if use secureboot; then
+ if [[ ${SECUREBOOT_SIGN_KEY} == pkcs11:* ]]; then
+ ukify_args+=(
+ --signing-engine="pkcs11"
+ )
+ fi
+ # systemd-sbsign does not support --sign-kernel.
+ # Disable unconditionally since we know the kernel
+ # image is already signed always.
+ ukify_args+=(
+ --secureboot-private-key="${SECUREBOOT_SIGN_KEY}"
+ --secureboot-certificate="${SECUREBOOT_SIGN_CERT}"
+ --signtool="${SECUREBOOT_SIGN_TOOL}"
+ --no-sign-kernel
+ )
+ fi
+ if [[ -n ${MEASUREDBOOT_SIGN_KEY} ]]; then
# The PCR public key option should contain *only* the
# public key, not the full certificate containing the
# public key. Bug #960276
openssl x509 \
- -in "${SECUREBOOT_SIGN_CERT}" -inform PEM \
+ -in "${MEASUREDBOOT_SIGN_CERT}" -inform PEM \
-noout -pubkey > "${T}/pcrpkey.pem" ||
die "Failed to extract public key"
ukify_args+=(
- --secureboot-private-key="${SECUREBOOT_SIGN_KEY}"
- --secureboot-certificate="${SECUREBOOT_SIGN_CERT}"
- --pcrpkey="${T}/pcrpkey.pem"
--measure
+ --pcrpkey="${T}/pcrpkey.pem"
+ --pcr-private-key="${MEASUREDBOOT_SIGN_KEY}"
+ --pcr-public-key="${T}/pcrpkey.pem"
+ --phases="enter-initrd"
+ --pcr-private-key="${MEASUREDBOOT_SIGN_KEY}"
+ --pcr-public-key="${T}/pcrpkey.pem"
+ --phases="enter-initrd:leave-initrd enter-initrd:leave-initrd:sysinit enter-initrd:leave-initrd:sysinit:ready"
)
- if [[ ${SECUREBOOT_SIGN_KEY} == pkcs11:* ]]; then
+ if [[ -n ${MEASUREDBOOT_SIGN_HASH} ]]; then
ukify_args+=(
- --signing-engine="pkcs11"
- --pcr-private-key="${SECUREBOOT_SIGN_KEY}"
- --pcr-public-key="${T}/pcrpkey.pem"
- --phases="enter-initrd"
- --pcr-private-key="${SECUREBOOT_SIGN_KEY}"
- --pcr-public-key="${T}/pcrpkey.pem"
- --phases="enter-initrd:leave-initrd enter-initrd:leave-initrd:sysinit enter-initrd:leave-initrd:sysinit:ready"
- )
- else
- ukify_args+=(
- --pcr-private-key="${SECUREBOOT_SIGN_KEY}"
- --pcr-public-key="${T}/pcrpkey.pem"
- --phases="enter-initrd"
- --pcr-private-key="${SECUREBOOT_SIGN_KEY}"
- --pcr-public-key="${T}/pcrpkey.pem"
- --phases="enter-initrd:leave-initrd enter-initrd:leave-initrd:sysinit enter-initrd:leave-initrd:sysinit:ready"
+ --pcr-banks="${MEASUREDBOOT_SIGN_HASH}"
)
fi
fi
@@ -732,7 +796,6 @@ kernel-build_merge_configs() {
local merge_configs=( "${@}" )
if use modules-sign; then
- : "${MODULES_SIGN_HASH:=sha512}"
cat <<-EOF > "${WORKDIR}/modules-sign.config" || die
## Enable module signing
CONFIG_MODULE_SIG=y
@@ -740,8 +803,16 @@ kernel-build_merge_configs() {
CONFIG_MODULE_SIG_FORCE=y
CONFIG_MODULE_SIG_${MODULES_SIGN_HASH^^}=y
EOF
- merge_configs+=( "${WORKDIR}/modules-sign.config" )
+ else
+ cat <<-EOF > "${WORKDIR}/modules-sign.config" || die
+ ## Disable module signing
+ # CONFIG_MODULE_SIG is not set
+ # CONFIG_MODULE_SIG_ALL is not set
+ # CONFIG_MODULE_SIG_FORCE is not set
+ # CONFIG_MODULE_SIG_KEY is not set
+ EOF
fi
+ merge_configs+=( "${WORKDIR}/modules-sign.config" )
# Only semi-related but let's use that to avoid changing stable ebuilds.
if [[ ${KERNEL_IUSE_GENERIC_UKI} ]]; then
diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index 21e48802ca21..e956ea06945c 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -72,6 +72,9 @@ if [[ -z ${_LLVM_SOURCE_TYPE+1} ]]; then
_LLVM_SOURCE_TYPE=snapshot
case ${PV} in
+ 23.0.0_pre20260605)
+ EGIT_COMMIT=6d4cd34d861baec5a761d15b81395fbe88f4391b
+ ;;
23.0.0_pre20260512)
EGIT_COMMIT=8789401c6f0b2c53ba348860c1b0c5df1fa40c8c
;;
diff --git a/eclass/plasma.kde.org.eclass b/eclass/plasma.kde.org.eclass
index 4b21d4f60bd5..792f1c38fc55 100644
--- a/eclass/plasma.kde.org.eclass
+++ b/eclass/plasma.kde.org.eclass
@@ -1,10 +1,10 @@
-# Copyright 1999-2025 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: plasma.kde.org.eclass
# @MAINTAINER:
# kde@gentoo.org
-# @SUPPORTED_EAPIS: 8
+# @SUPPORTED_EAPIS: 8 9
# @PROVIDES: kde.org
# @BLURB: Support eclass for KDE Plasma packages.
# @DESCRIPTION:
@@ -17,14 +17,14 @@
# variables and helper functions (not phase functions) may be considered as
# part of this eclass's API.
+if [[ -z ${_PLASMA_KDE_ORG_ECLASS} ]]; then
+_PLASMA_KDE_ORG_ECLASS=1
+
case ${EAPI} in
- 8) ;;
+ 8|9) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-if [[ -z ${_PLASMA_KDE_ORG_ECLASS} ]]; then
-_PLASMA_KDE_ORG_ECLASS=1
-
# @ECLASS_VARIABLE: KDE_CATV
# @DESCRIPTION:
# Holds main Plasma release number (major.minor.micro) for use on same-category
@@ -38,16 +38,6 @@ readonly KDE_CATV
# For proper description see kde.org.eclass manpage.
KDE_PV_UNRELEASED=( )
-# @ECLASS_VARIABLE: _PSLOT
-# @INTERNAL
-# @DESCRIPTION:
-# KDE Plasma major version mapping, implied by package version. This is being
-# used throughout the eclass as a switch between Plasma 5 and 6 packages.
-_PSLOT=6
-if $(ver_test -lt 5.27.50); then
- _PSLOT=5
-fi
-
inherit kde.org
HOMEPAGE="https://kde.org/plasma-desktop"
@@ -56,7 +46,7 @@ HOMEPAGE="https://kde.org/plasma-desktop"
# @INTERNAL
# @DESCRIPTION:
# For proper description see kde.org.eclass manpage.
-KDE_ORG_SCHEDULE_URI+="/Plasma_${_PSLOT}"
+KDE_ORG_SCHEDULE_URI+="/Plasma_6"
# @ECLASS_VARIABLE: _KDE_SRC_URI
# @INTERNAL
@@ -80,22 +70,17 @@ elif [[ -z ${KDE_ORG_COMMIT} ]]; then
SRC_URI="${_KDE_SRC_URI}${KDE_ORG_TAR_PN}-${PV}.tar.xz"
fi
-if [[ ${_PSLOT} == 6 ]]; then
- case ${PN} in
- breeze | \
- kglobalacceld | \
- kwayland | \
- kwayland-integration | \
- libplasma | \
- ocean-sound-theme | \
- oxygen | \
- plasma-activities | \
- plasma-activities-stats | \
- plasma-integration | \
- plasma5support | \
- print-manager) ;;
- *) RDEPEND+=" !kde-plasma/${PN}:5" ;;
- esac
-fi
+case ${PN} in
+ breeze | \
+ kglobalacceld | \
+ kwayland | \
+ libplasma | \
+ oxygen | \
+ plasma-activities | \
+ plasma-activities-stats | \
+ plasma-integration | \
+ print-manager) ;;
+ *) RDEPEND+=" !kde-plasma/${PN}:5" ;;
+esac
fi
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 3dfd1400d167..023d951d54dc 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -139,7 +139,14 @@ _python_set_impls() {
case ${i} in
python3_1[2-5]|python3_1[4-5]t)
;;
+ # implementations deprecated prior to EAPI 9 are fatal
jython2_7|pypy|pypy1_[89]|pypy2_0|pypy3|pypy3_11|python2_[5-7]|python3_[1-9]|python3_1[01]|python3_13t)
+ [[ ${EAPI} != [78] ]] &&
+ die "Please remove old implementations from PYTHON_COMPAT for EAPI ${EAPI}"
+ ;&
+ # implementations deprecated after EAPI 9 are non-fatal
+ # (none yet, hence placeholder)
+ python3_x)
obsolete+=( "${i}" )
;;
*)
@@ -230,10 +237,18 @@ _python_impl_matches() {
fi
return 0
;;
- 3.[89]|3.1[0-5])
+ 3.[89]|3.10)
+ [[ ${EAPI} != [78] ]] &&
+ die "Please remove old implementations from ${FUNCNAME[1]} in EAPI ${EAPI}"
+ ;&
+ 3.1[1-5])
[[ ${impl%t} == python${pattern/./_} || ${impl} == pypy${pattern/./_} ]] &&
return 0
;;
+ jython2_7|pypy|pypy1_[89]|pypy2_0|pypy3|python2_[5-7]|python3_[1-9]|python3_10)
+ [[ ${EAPI} != [78] ]] &&
+ die "Please remove old implementations from ${FUNCNAME[1]} in EAPI ${EAPI}"
+ ;;
*)
# unify value style to allow lax matching
[[ ${impl} == ${pattern/./_} ]] && return 0
@@ -1590,7 +1605,8 @@ epytest() {
)
if [[ ${MAKEFLAGS} == *--jobserver-auth=* ]]; then
- if has_version "dev-python/pytest-jobserver[${PYTHON_USEDEP}]"
+ local usedep="python_targets_${EPYTHON/./_}(-)"
+ if has_version "dev-python/pytest-jobserver[${usedep}]"
then
args+=( -p jobserver )
elif [[ ! ${_EPYTEST_JOBSERVER_WARNED} ]]; then
diff --git a/eclass/secureboot.eclass b/eclass/secureboot.eclass
index 7361465ee2d3..15c86e58ffab 100644
--- a/eclass/secureboot.eclass
+++ b/eclass/secureboot.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2025 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: secureboot.eclass
@@ -51,6 +51,15 @@ BDEPEND="
)
"
+# @ECLASS_VARIABLE: SECUREBOOT_SIGN_CERT
+# @USER_VARIABLE
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Used with USE=secureboot. Should be set to the path of the public
+# key certificate in PEM format to use.
+# If unspecified the SECUREBOOT_SIGN_KEY is assumed to also contain the
+# certificate belonging to it.
+
# @ECLASS_VARIABLE: SECUREBOOT_SIGN_KEY
# @USER_VARIABLE
# @DEFAULT_UNSET
@@ -65,14 +74,16 @@ BDEPEND="
# If none of these exist, a new key will be generated at
# /etc/portage/secureboot.pem.
-# @ECLASS_VARIABLE: SECUREBOOT_SIGN_CERT
+# @ECLASS_VARIABLE: SECUREBOOT_SIGN_TOOL
# @USER_VARIABLE
-# @DEFAULT_UNSET
# @DESCRIPTION:
-# Used with USE=secureboot. Should be set to the path of the public
-# key certificate in PEM format to use.
-# If unspecified the SECUREBOOT_SIGN_KEY is assumed to also contain the
-# certificate belonging to it.
+# Used with USE=secureboot. May be set to a signing tool to use when
+# signing EFI files.
+#
+# Valid values: sbsign,systemd-sbsign
+#
+# Default if unset: sbsign
+: "${SECUREBOOT_SIGN_TOOL:=sbsign}"
if [[ -z ${_SECUREBOOT_ECLASS} ]]; then
_SECUREBOOT_ECLASS=1
@@ -220,15 +231,36 @@ secureboot_sign_efi_file() {
ewarn "${input_file} already signed, skipping"
return=0
else
+ # Common arguments
local args=(
- "--key=${SECUREBOOT_SIGN_KEY}"
- "--cert=${SECUREBOOT_SIGN_CERT}"
+ "--output=${output_file}"
)
- if [[ ${SECUREBOOT_SIGN_KEY} == pkcs11:* ]]; then
- args+=( --engine=pkcs11 )
- fi
- sbsign "${args[@]}" "${input_file}" --output "${output_file}"
+ case ${SECUREBOOT_SIGN_TOOL} in
+ sbsign)
+ args+=(
+ "--key=${SECUREBOOT_SIGN_KEY}"
+ "--cert=${SECUREBOOT_SIGN_CERT}"
+ )
+ if [[ ${SECUREBOOT_SIGN_KEY} == pkcs11:* ]]; then
+ args+=( "--engine=pkcs11" )
+ fi
+
+ "${EPREFIX}/usr/bin/sbsign" "${input_file}" "${args[@]}"
+ ;;
+ systemd-sbsign)
+ args+=(
+ "--private-key=${SECUREBOOT_SIGN_KEY}"
+ "--certificate=${SECUREBOOT_SIGN_CERT}"
+ )
+ if [[ ${SECUREBOOT_SIGN_KEY} == pkcs11:* ]]; then
+ args+=( "--private-key-source=engine:pkcs11" )
+ fi
+
+ "${EPREFIX}/usr/lib/systemd/systemd-sbsign" sign "${input_file}" "${args[@]}"
+ ;;
+ *) die "Unsupported value SECUREBOOT_SIGN_TOOL=${SECUREBOOT_SIGN_TOOL}" ;;
+ esac
return=${?}
fi
eend ${return} || die "Signing ${input_file} failed"
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index f2da4e1d30f1..cff86e804ee2 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1115,6 +1115,7 @@ toolchain_setup_ada() {
! tc-is-cross-compiler && _toolchain_make_gnat_wrappers
export CC="$(tc-getCC) -specs=${T}/ada.spec"
+ export CXX="$(tc-getCXX) -specs=${T}/ada.spec"
if ver_test ${PV} -lt 13 && [[ ${CTARGET#accel-} == hppa* ]] ; then
# For HPPA, the ada-bootstrap binaries seem to default
@@ -1287,8 +1288,12 @@ toolchain_src_configure() {
_tc_use_if_iuse d && [[ ${GCCMAJOR} -ge 12 ]]
}
- _need_ada_bootstrap_mangling && toolchain_setup_ada
+ # D goes first because while we'd like a matching CC/CXX for it,
+ # it's not critical like it is for Ada, where a configure test
+ # fails when trying to find GNAT w/o it. D has the benefit of the
+ # GDC envvar.
_need_d_bootstrap && toolchain_setup_d
+ _need_ada_bootstrap_mangling && toolchain_setup_ada
confgcc+=( --enable-languages=${GCC_LANG} )