summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-09-16 10:59:25 +0200
committerMichał Górny <mgorny@gentoo.org>2022-09-16 14:14:28 +0200
commit2fcc322a9306ef0d3ce5d96c582bc4bb8ffcb579 (patch)
tree73e705db133a623875c0da342399ff0a5f38d134 /eclass
parentprofiles: package.mask x11-themes/e-flat-theme (diff)
downloadgentoo-2fcc322a9306ef0d3ce5d96c582bc4bb8ffcb579.tar.gz
gentoo-2fcc322a9306ef0d3ce5d96c582bc4bb8ffcb579.tar.bz2
gentoo-2fcc322a9306ef0d3ce5d96c582bc4bb8ffcb579.zip
llvm.org.eclass: Introduce snapshot support
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/llvm.org.eclass152
1 files changed, 95 insertions, 57 deletions
diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index 578077f67ed5..527b4fca0a9f 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -56,13 +56,28 @@ _LLVM_NEWEST_MANPAGE_RELEASE=15.0.0
# @ECLASS_VARIABLE: _LLVM_SOURCE_TYPE
# @INTERNAL
# @DESCRIPTION:
-# Source type to use: 'git' or 'tar'.
+# Source type to use: 'git', 'tar' or 'snapshot'.
if [[ -z ${_LLVM_SOURCE_TYPE+1} ]]; then
- if [[ ${PV} == *.9999 ]]; then
- _LLVM_SOURCE_TYPE=git
- else
- _LLVM_SOURCE_TYPE=tar
- fi
+ case ${PV} in
+ *.9999)
+ _LLVM_SOURCE_TYPE=git
+ ;;
+ *_pre*)
+ _LLVM_SOURCE_TYPE=snapshot
+
+ case ${PV} in
+ 16.0.0_pre20220915)
+ EGIT_COMMIT=02a27b38909edc46c41732f79a837c95c9992d5a
+ ;;
+ *)
+ die "Unknown snapshot: ${PV}"
+ ;;
+ esac
+ ;;
+ *)
+ _LLVM_SOURCE_TYPE=tar
+ ;;
+ esac
fi
[[ ${_LLVM_SOURCE_TYPE} == git ]] && inherit git-r3
@@ -193,33 +208,42 @@ llvm.org_set_globals() {
fi
fi
- if [[ ${_LLVM_SOURCE_TYPE} == git ]]; then
- EGIT_REPO_URI="https://github.com/llvm/llvm-project.git"
+ case ${_LLVM_SOURCE_TYPE} in
+ git)
+ EGIT_REPO_URI="https://github.com/llvm/llvm-project.git"
- [[ ${PV} != ${_LLVM_MASTER_MAJOR}.* ]] &&
- EGIT_BRANCH="release/${PV%%.*}.x"
- elif [[ ${_LLVM_SOURCE_TYPE} == tar ]]; then
- if ver_test -ge 14.0.5; then
- SRC_URI+="
- https://github.com/llvm/llvm-project/releases/download/llvmorg-${PV/_/-}/llvm-project-${PV/_/}.src.tar.xz
- verify-sig? (
- https://github.com/llvm/llvm-project/releases/download/llvmorg-${PV/_/-}/llvm-project-${PV/_/}.src.tar.xz.sig
- )
- "
- BDEPEND+="
- verify-sig? (
- >=sec-keys/openpgp-keys-llvm-15
- )
- "
- VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/llvm.asc
- else
+ [[ ${PV} != ${_LLVM_MASTER_MAJOR}.* ]] &&
+ EGIT_BRANCH="release/${PV%%.*}.x"
+ ;;
+ tar)
+ if ver_test -ge 14.0.5; then
+ SRC_URI+="
+ https://github.com/llvm/llvm-project/releases/download/llvmorg-${PV/_/-}/llvm-project-${PV/_/}.src.tar.xz
+ verify-sig? (
+ https://github.com/llvm/llvm-project/releases/download/llvmorg-${PV/_/-}/llvm-project-${PV/_/}.src.tar.xz.sig
+ )
+ "
+ BDEPEND+="
+ verify-sig? (
+ >=sec-keys/openpgp-keys-llvm-15
+ )
+ "
+ VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/llvm.asc
+ else
+ SRC_URI+="
+ https://github.com/llvm/llvm-project/archive/llvmorg-${PV/_/-}.tar.gz
+ "
+ fi
+ ;;
+ snapshot)
SRC_URI+="
- https://github.com/llvm/llvm-project/archive/llvmorg-${PV/_/-}.tar.gz
+ https://github.com/llvm/llvm-project/archive/${EGIT_COMMIT}.tar.gz
+ -> llvm-project-${EGIT_COMMIT}.tar.gz
"
- fi
- else
- die "Invalid _LLVM_SOURCE_TYPE: ${LLVM_SOURCE_TYPE}"
- fi
+ ;;
+ *)
+ die "Invalid _LLVM_SOURCE_TYPE: ${LLVM_SOURCE_TYPE}"
+ esac
S=${WORKDIR}/${LLVM_COMPONENTS[0]}
@@ -295,38 +319,52 @@ llvm.org_src_unpack() {
components+=( "${LLVM_TEST_COMPONENTS[@]}" )
fi
- if [[ ${_LLVM_SOURCE_TYPE} == git ]]; then
- git-r3_fetch
- git-r3_checkout '' . '' "${components[@]}"
- default_src_unpack
- else
- local archive=llvmorg-${PV/_/-}.tar.gz
- if ver_test -ge 14.0.5; then
- archive=llvm-project-${PV/_/}.src.tar.xz
- if use verify-sig; then
- verify-sig_verify_detached \
- "${DISTDIR}/${archive}" "${DISTDIR}/${archive}.sig"
+ local archive=
+ case ${_LLVM_SOURCE_TYPE} in
+ git)
+ git-r3_fetch
+ git-r3_checkout '' . '' "${components[@]}"
+ ;;
+ tar)
+ archive=llvmorg-${PV/_/-}.tar.gz
+ if ver_test -ge 14.0.5; then
+ archive=llvm-project-${PV/_/}.src.tar.xz
+ if use verify-sig; then
+ verify-sig_verify_detached \
+ "${DISTDIR}/${archive}" "${DISTDIR}/${archive}.sig"
+ fi
fi
- fi
- ebegin "Unpacking from ${archive}"
- if ver_test -ge 14.0.5; then
- tar -x -J -o --strip-components 1 \
- -f "${DISTDIR}/${archive}" \
- "${components[@]/#/${archive%.tar*}/}" || die
- else
+ ebegin "Unpacking from ${archive}"
+ if ver_test -ge 14.0.5; then
+ tar -x -J -o --strip-components 1 \
+ -f "${DISTDIR}/${archive}" \
+ "${components[@]/#/${archive%.tar*}/}" || die
+ else
+ tar -x -z -o --strip-components 1 \
+ -f "${DISTDIR}/${archive}" \
+ "${components[@]/#/llvm-project-${archive%.tar*}/}" || die
+ fi
+ eend ${?}
+ ;;
+ snapshot)
+ archive=llvm-project-${EGIT_COMMIT}.tar.gz
+ ebegin "Unpacking from ${archive}"
tar -x -z -o --strip-components 1 \
-f "${DISTDIR}/${archive}" \
- "${components[@]/#/llvm-project-${archive%.tar*}/}" || die
- fi
- eend ${?}
+ "${components[@]/#/${archive%.tar*}/}" || die
+ eend ${?}
+ ;;
+ *)
+ die "Invalid _LLVM_SOURCE_TYPE: ${LLVM_SOURCE_TYPE}"
+ ;;
+ esac
- # unpack all remaining distfiles
- local x
- for x in ${A}; do
- [[ ${x} != ${archive} ]] && unpack "${x}"
- done
- fi
+ # unpack all remaining distfiles
+ local x
+ for x in ${A}; do
+ [[ ${x} != ${archive} ]] && unpack "${x}"
+ done
if [[ -n ${LLVM_PATCHSET} ]]; then
local nocomp=$(grep -r -L "^Gentoo-Component:" \