diff options
author | Michał Górny <mgorny@gentoo.org> | 2021-04-22 12:26:14 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2021-04-22 13:21:36 +0200 |
commit | 2eba65b97fdae4de9930322fbb24662335dfbb36 (patch) | |
tree | 6a043435cd578e33610581394fde2e657f39a54a /eclass | |
parent | media-libs/chromaprint: fixed running tests in 1.5.0 (diff) | |
download | gentoo-2eba65b97fdae4de9930322fbb24662335dfbb36.tar.gz gentoo-2eba65b97fdae4de9930322fbb24662335dfbb36.tar.bz2 gentoo-2eba65b97fdae4de9930322fbb24662335dfbb36.zip |
llvm.org.eclass: Support Gentoo patchsets
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/llvm.org.eclass | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass index e532c953cb70..394df33df047 100644 --- a/eclass/llvm.org.eclass +++ b/eclass/llvm.org.eclass @@ -89,6 +89,11 @@ inherit multiprocessing # the manpages. If set to 'pregenerated', fetch and install # pregenerated manpages from the archive. +# @ECLASS-VARIABLE: LLVM_PATCHSET +# @DEFAULT_UNSET +# @DESCRIPTION: +# LLVM patchset version. No patchset is used if unset. + # == global scope logic == @@ -145,6 +150,11 @@ llvm.org_set_globals() { die "Invalid LLVM_MANPAGES=${LLVM_MANPAGES}" esac + if [[ -n ${LLVM_PATCHSET} ]]; then + SRC_URI+=" + https://dev.gentoo.org/~mgorny/dist/llvm/llvm-gentoo-patchset-${LLVM_PATCHSET}.tar.xz" + fi + # === useful defaults for cmake-based packages === # least intrusive of all @@ -192,6 +202,15 @@ llvm.org_src_unpack() { [[ ${x} != ${archive} ]] && unpack "${x}" done fi + + if [[ -n ${LLVM_PATCHSET} ]]; then + # strip patches that don't match current components + local IFS='|' + grep -E -r -L "^Gentoo-Component:.*(${components[*]})" \ + "${WORKDIR}/llvm-gentoo-patchset-${LLVM_PATCHSET}" | + xargs rm + assert + fi } # @FUNCTION: llvm.org_src_prepare @@ -201,6 +220,13 @@ llvm.org_src_unpack() { # ${WORKDIR}, so that patches straight from llvm-project repository # work correctly with -p1. llvm.org_src_prepare() { + if [[ -n ${LLVM_PATCHSET} ]]; then + local PATCHES=( + "${PATCHES[@]}" + "${WORKDIR}/llvm-gentoo-patchset-${LLVM_PATCHSET}" + ) + fi + if declare -f cmake_src_prepare >/dev/null; then # cmake eclasses force ${S} for default_src_prepare # but use ${CMAKE_USE_DIR} for everything else |