summaryrefslogtreecommitdiff
path: root/llvm-core/clang-common/clang-common-22.0.0.9999.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'llvm-core/clang-common/clang-common-22.0.0.9999.ebuild')
-rw-r--r--llvm-core/clang-common/clang-common-22.0.0.9999.ebuild30
1 files changed, 27 insertions, 3 deletions
diff --git a/llvm-core/clang-common/clang-common-22.0.0.9999.ebuild b/llvm-core/clang-common/clang-common-22.0.0.9999.ebuild
index 4f0d35918328..163c1c4f6814 100644
--- a/llvm-core/clang-common/clang-common-22.0.0.9999.ebuild
+++ b/llvm-core/clang-common/clang-common-22.0.0.9999.ebuild
@@ -3,7 +3,7 @@
EAPI=8
-inherit bash-completion-r1 llvm.org multilib
+inherit bash-completion-r1 elisp-common llvm.org multilib
DESCRIPTION="Common files shared between multiple slots of clang"
HOMEPAGE="https://llvm.org/"
@@ -12,7 +12,7 @@ LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
SLOT="0"
IUSE="
default-compiler-rt default-libcxx default-lld
- bootstrap-prefix cet hardened llvm-libunwind
+ bootstrap-prefix cet emacs hardened llvm-libunwind
"
PDEPEND="
@@ -30,15 +30,21 @@ PDEPEND="
# enforce flags on clang-runtime as well to aid transition
PDEPEND+="
llvm-runtimes/clang-runtime[default-compiler-rt(-)?,default-libcxx(-)?,default-lld(-)?,llvm-libunwind(-)?]
+ emacs? ( >=app-editors/emacs-26.3:* )
"
IDEPEND="
!default-compiler-rt? ( sys-devel/gcc-config )
!default-libcxx? ( sys-devel/gcc-config )
"
+BDEPEND="
+ emacs? ( >=app-editors/emacs-26.3:* )
+"
-LLVM_COMPONENTS=( clang/utils )
+LLVM_COMPONENTS=( clang/utils clang/tools/clang-format )
llvm.org_set_globals
+SITEFILE="50clang-gentoo.el"
+
pkg_pretend() {
[[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
@@ -142,6 +148,11 @@ doclang_cfg() {
esac
}
+src_compile() {
+ default
+ use emacs && elisp-compile ../tools/clang-format/clang-format.el
+}
+
src_install() {
newbashcomp bash-autocomplete.sh clang
@@ -299,6 +310,11 @@ src_install() {
-isysroot ${EPREFIX}/MacOSX.sdk
EOF
fi
+
+ if use emacs ; then
+ elisp-install clang ../tools/clang-format/clang-format.{el,elc}
+ elisp-make-site-file "${SITEFILE}" clang
+ fi
}
pkg_preinst() {
@@ -312,3 +328,11 @@ pkg_preinst() {
fi
fi
}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}