diff options
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/Manifest.gz | bin | 37342 -> 37343 bytes | |||
-rw-r--r-- | eclass/cargo.eclass | 104 | ||||
-rw-r--r-- | eclass/distutils-r1.eclass | 8 | ||||
-rw-r--r-- | eclass/gkrellm-plugin.eclass | 53 | ||||
-rw-r--r-- | eclass/java-utils-2.eclass | 27 | ||||
-rw-r--r-- | eclass/llvm.org.eclass | 9 | ||||
-rw-r--r-- | eclass/toolchain.eclass | 4 |
7 files changed, 149 insertions, 56 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex bce56d14723c..a33ff26008bd 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index eb9d2e8c3599..911ddabced14 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -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: cargo.eclass @@ -75,6 +75,42 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo" # SRC_URI="$(cargo_crate_uris)" # @CODE +# @ECLASS_VARIABLE: GIT_CRATES +# @DEFAULT_UNSET +# @DESCRIPTION: +# bash associative array containing all crates that a package wants +# to be fetch by git. +# The key is the crate name, the value is a semicolon separated list of +# the following fields: +# +# - the URI to to fetch the crate from +# - this intelligentally handles GitHub URIs and GitLab URIs so +# just the path is needed. +# - the string "%commit%" gets replaced with the commit +# - the hash of the commit to use +# - (optional) the path to look for Cargo.toml in +# - this will also replace the string "%commit%" with the commit +# - if this not provided, it will be generated using the crate name and +# the commit +# Used by cargo_crate_uris +# +# If this is defined, then cargo_src_install will add --frozen to "cargo install" +# +# Example of simple definition of GIT_CRATES without any paths defined +# @CODE +# declare -A GIT_CRATES=( +# [home]="https://github.com/rbtcollins/home;a243ee2fbee6022c57d56f5aa79aefe194eabe53" +# ) +# @CODE +# +# Example code of how to define GIT_CRATES with paths defined. +# @CODE +# declare -A GIT_CRATES=( +# [rustpython-common]="https://github.com/RustPython/RustPython;4f38cb68e4a97aeea9eb19673803a0bd5f655383;RustPython-%commit%/common" +# [rustpython-parser]="https://github.com/RustPython/RustPython;4f38cb68e4a97aeea9eb19673803a0bd5f655383;RustPython-%commit%/compiler/parser" +# ) +# @CODE + # @ECLASS_VARIABLE: CARGO_OPTIONAL # @DEFAULT_UNSET # @PRE_INHERIT @@ -160,6 +196,37 @@ cargo_crate_uris() { url="https://crates.io/api/v1/crates/${name}/${version}/download -> ${crate}.crate" echo "${url}" done + + local git_crates_type + git_crates_type="$(declare -p GIT_CRATES 2>&-)" + if [[ ${git_crates_type} == "declare -A "* ]]; then + local crate commit crate_uri crate_dir repo_ext feat_expr + + for crate in "${!GIT_CRATES[@]}"; do + IFS=';' read -r crate_uri commit crate_dir <<< "${GIT_CRATES[${crate}]}" + + case "${crate_uri}" in + https://github.com/*) + repo_ext=".gh" + repo_name="${crate_uri##*/}" + crate_uri="${crate_uri%/}/archive/%commit%.tar.gz" + ;; + https://gitlab.com/*) + repo_ext=".gl" + repo_name="${crate_uri##*/}" + crate_uri="${crate_uri%/}/archive/-/%commit%/${repo_name}/%commit%.tar.gz" + ;; + *) + repo_ext= + repo_name="${crate}" + ;; + esac + + printf -- '%s -> %s\n' "${crate_uri//%commit%/${commit}}" "${repo_name}-${commit}${repo_ext}.tar.gz" + done + elif [[ -n ${git_crates_type} ]]; then + die "GIT_CRATE must be declared as an associative array" + fi } # @FUNCTION: cargo_gen_config @@ -195,12 +262,46 @@ cargo_gen_config() { [term] verbose = true $([[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo "color = 'never'") + $(_cargo_gen_git_config) _EOF_ export CARGO_HOME="${ECARGO_HOME}" _CARGO_GEN_CONFIG_HAS_RUN=1 } +# @FUNCTION: _cargo_gen_git_config +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Generate the cargo config for git crates, this will output the +# configuration for cargo to override the cargo config so the local git crates +# specified in GIT_CRATES will be used rather than attempting to fetch +# from git. +# +# Called by cargo_gen_config when generating the config. +_cargo_gen_git_config() { + local git_crates_type + git_crates_type="$(declare -p GIT_CRATES 2>&-)" + + if [[ ${git_crates_type} == "declare -A "* ]]; then + local crate commit crate_uri crate_dir + local -A crate_patches + + for crate in "${!GIT_CRATES[@]}"; do + IFS=';' read -r crate_uri commit crate_dir <<< "${GIT_CRATES[${crate}]}" + : "${crate_dir:=${crate}-%commit%}" + crate_patches["${crate_uri}"]+="${crate} = { path = \"${WORKDIR}/${crate_dir//%commit%/${commit}}\" };;" + done + + for crate_uri in "${!crate_patches[@]}"; do + printf -- "[patch.'%s']\\n%s\n" "${crate_uri}" "${crate_patches["${crate_uri}"]//;;/$'\n'}" + done + + elif [[ -n ${git_crates_type} ]]; then + die "GIT_CRATE must be declared as an associative array" + fi +} + # @FUNCTION: cargo_src_unpack # @DESCRIPTION: # Unpacks the package and the cargo registry @@ -412,6 +513,7 @@ cargo_src_install() { set -- cargo install $(has --path ${@} || echo --path ./) \ --root "${ED}/usr" \ + ${GIT_CRATES[@]:+--frozen} \ $(usex debug --debug "") \ ${ECARGO_ARGS[@]} "$@" einfo "${@}" diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index e97789cc1990..e95047e3a1f0 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -248,8 +248,14 @@ _distutils_set_globals() { ' ;; setuptools) + # || ( ... ) dep is a workaround for bug #892525 + # It can be removed once >=67.2.0 is stable and replaced with + # a simple >=67.2.0 dep. bdep+=' - >=dev-python/setuptools-65.7.0[${PYTHON_USEDEP}] + || ( + >=dev-python/setuptools-67.2.0[${PYTHON_USEDEP}] + <dev-python/setuptools-65.7.1[${PYTHON_USEDEP}] + ) >=dev-python/wheel-0.38.4[${PYTHON_USEDEP}] ' ;; diff --git a/eclass/gkrellm-plugin.eclass b/eclass/gkrellm-plugin.eclass index 7e846bbf2faa..1424fdfe53f9 100644 --- a/eclass/gkrellm-plugin.eclass +++ b/eclass/gkrellm-plugin.eclass @@ -8,56 +8,40 @@ # Original author: Jim Ramsay <lack@gentoo.org> # EAPI 6 author: David Seifert <soap@gentoo.org> # EAPI 8 author: Thomas Bracht Laumann Jespersen <t@laumann.xyz> -# @SUPPORTED_EAPIS: 6 8 -# @PROVIDES: multilib +# @SUPPORTED_EAPIS: 8 # @BLURB: Provides src_install used by (almost) all gkrellm plugins # @DESCRIPTION: # - Sets up default dependencies # - Provides a common src_install method to avoid code duplication -# -# Changelog: -# 17 March 2022: Thomas Bracht Laumann Jespersen <t@laumann.xyz> -# - Port to EAPI 8 -# 03 January 2018: David Seifert <soap@gentoo.org> -# - Port to EAPI 6, remove built_with_use, simplify a lot -# 12 March 2007: Jim Ramsay <lack@gentoo.org> -# - Added server plugin support -# 09 March 2007: Jim Ramsay <lack@gentoo.org> -# - Initial commit -# # @ECLASS_VARIABLE: PLUGIN_SO # @DESCRIPTION: # The name of the plugin's .so file which will be installed in -# the plugin dir. Defaults to "${PN}$(get_modname)". Has to be a bash array. +# the plugin dir. Defaults to "${PN}$(get_modname)". Has to be a bash array. # @ECLASS_VARIABLE: PLUGIN_SERVER_SO # @DEFAULT_UNSET # @DESCRIPTION: # The name of the plugin's server plugin $(get_modname) portion. -# Unset by default. Has to be a bash array. +# Unset by default. Has to be a bash array. # @ECLASS_VARIABLE: PLUGIN_DOCS # @DEFAULT_UNSET # @DESCRIPTION: # An optional list of docs to be installed, in addition to the default -# DOCS variable which is respected too. Has to be a bash array. +# DOCS variable which is respected too. Has to be a bash array. case ${EAPI} in - 6|8) ;; + 8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -inherit multilib +if [[ ! ${_GKRELLM_PLUGIN_ECLASS} ]]; then +_GKRELLM_PLUGIN_ECLASS=1 -if [[ ! ${_GKRELLM_PLUGIN_R1} ]]; then -_GKRELLM_PLUGIN_R1=1 +inherit multilib -if [[ ${EAPI} == 6 ]]; then - DEPEND="virtual/pkgconfig" -else - BDEPEND="virtual/pkgconfig" -fi +BDEPEND="virtual/pkgconfig" # @FUNCTION: gkrellm-plugin_src_install # @USAGE: @@ -68,20 +52,13 @@ gkrellm-plugin_src_install() { if ! declare -p PLUGIN_SO >/dev/null 2>&1 ; then doexe ${PN}$(get_modname) - elif declare -p PLUGIN_SO | grep -q "^declare -a " ; then - doexe "${PLUGIN_SO[@]}" else - die "PLUGIN_SO has to be a bash array!" + doexe "${PLUGIN_SO[@]}" fi if [[ -n ${PLUGIN_SERVER_SO} ]]; then exeinto /usr/$(get_libdir)/gkrellm2/plugins-gkrellmd - - if declare -p PLUGIN_SERVER_SO | grep -q "^declare -a " ; then - doexe "${PLUGIN_SERVER_SO[@]}" - else - die "PLUGIN_SERVER_SO has to be a bash array!" - fi + doexe "${PLUGIN_SERVER_SO[@]}" fi einstalldocs @@ -90,13 +67,7 @@ gkrellm-plugin_src_install() { [[ -s "${d}" ]] && dodoc "${d}" done - if [[ -n ${PLUGIN_DOCS} ]]; then - if declare -p PLUGIN_DOCS | grep -q "^declare -a " ; then - dodoc "${PLUGIN_DOCS[@]}" - else - die "PLUGIN_DOCS has to be a bash array!" - fi - fi + [[ -n ${PLUGIN_DOCS} ]] && dodoc "${PLUGIN_DOCS[@]}" } fi diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass index 4f50ce39c5dc..7641f9f40290 100644 --- a/eclass/java-utils-2.eclass +++ b/eclass/java-utils-2.eclass @@ -1,4 +1,4 @@ -# Copyright 2004-2022 Gentoo Authors +# Copyright 2004-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: java-utils-2.eclass @@ -66,6 +66,21 @@ JAVA_PKG_ALLOW_VM_CHANGE=${JAVA_PKG_ALLOW_VM_CHANGE:="yes"} # JAVA_PKG_FORCE_VM=openjdk-11 emerge foo # @CODE +# @ECLASS_VARIABLE: JAVA_PKG_NO_CLEAN +# @DEFAULT_UNSET +# @DESCRIPTION: +# An array of expressions to match *.class or *.jar files in order to protect +# them against deletion by java-pkg_clean. +# +# @CODE +# JAVA_PKG_NO_CLEAN=( +# "*/standard.jar" +# "*/launch4j.jar" +# "*/apps/jetty/apache-tomcat*" +# "*/lib/jetty*" +# ) +# @CODE + # @ECLASS_VARIABLE: JAVA_PKG_WANT_BUILD_VM # @DEFAULT_UNSET # @DESCRIPTION: @@ -2926,11 +2941,13 @@ is-java-strict() { # @FUNCTION: java-pkg_clean # @DESCRIPTION: # Java package cleaner function. This will remove all *.class and *.jar -# files, removing any bundled dependencies. +# files, except those specified by expressions in JAVA_PKG_NO_CLEAN. java-pkg_clean() { - if [[ -z "${JAVA_PKG_NO_CLEAN}" ]]; then - find "${@}" '(' -name '*.class' -o -name '*.jar' ')' -type f -delete -print || die - fi + NO_DELETE=() + for keep in ${JAVA_PKG_NO_CLEAN[@]}; do + NO_DELETE+=( '!' '-wholename' ${keep} ) + done + find "${@}" '(' -name '*.class' -o -name '*.jar' ${NO_DELETE[@]} ')' -type f -delete -print || die } # @FUNCTION: java-pkg_gen-cp diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass index d8d46031f4d4..7ad894c7a9d0 100644 --- a/eclass/llvm.org.eclass +++ b/eclass/llvm.org.eclass @@ -81,15 +81,12 @@ if [[ -z ${_LLVM_SOURCE_TYPE+1} ]]; then _LLVM_SOURCE_TYPE=snapshot case ${PV} in - 16.0.0_pre20230107) - EGIT_COMMIT=6dc85bd3fde7df2999fda07e9e9f2e83d52c6125 - ;; - 16.0.0_pre20230127) - EGIT_COMMIT=46d5a57801bc37e5ebb1a4d6b2acc0fa99c01e8d - ;; 17.0.0_pre20230203) EGIT_COMMIT=08c915fa76ef91efa16df0676ed69e4fb360989f ;; + 17.0.0_pre20230211) + EGIT_COMMIT=22fb66eb94b643c858c2beecbcfac438a7fa29ed + ;; *) die "Unknown snapshot: ${PV}" ;; diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 6d8901d21812..06c044fd1d38 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -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: toolchain.eclass @@ -271,7 +271,7 @@ if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] ; then tc_version_is_at_least 8.0 && IUSE+=" systemtap" TC_FEATURES+=( systemtap ) - tc_version_is_at_least 9.0 && IUSE+=" d" + tc_version_is_at_least 9.0 && IUSE+=" d" TC_FEATURES+=( d ) tc_version_is_at_least 9.1 && IUSE+=" lto" tc_version_is_at_least 10 && IUSE+=" cet" tc_version_is_at_least 10 && IUSE+=" zstd" TC_FEATURES+=( zstd ) |