diff options
| author | Alfred Persson Forsberg <cat@catcream.org> | 2025-09-23 23:00:47 +0200 |
|---|---|---|
| committer | Michał Górny <mgorny@gentoo.org> | 2025-10-03 13:39:12 +0200 |
| commit | 260bf947a8e105471d97f9c921540bdee968d8a0 (patch) | |
| tree | 09b43b91a40c1a6dbd2c8ca984129a9cec71be60 /llvm-core/clang-common/clang-common-22.0.0.9999.ebuild | |
| parent | 4ce683b27278764752801f0899f4ab649e2ea0d0 (diff) | |
| download | gentoo-260bf947a8e105471d97f9c921540bdee968d8a0.tar.gz gentoo-260bf947a8e105471d97f9c921540bdee968d8a0.tar.bz2 gentoo-260bf947a8e105471d97f9c921540bdee968d8a0.zip | |
llvm-core/clang-common: install clang-format.el with IUSE=emacs
Signed-off-by: Alfred Persson Forsberg <cat@catcream.org>
Part-of: https://github.com/gentoo/gentoo/pull/43898
Closes: https://github.com/gentoo/gentoo/pull/43898
Signed-off-by: Michał Górny <mgorny@gentoo.org>
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.ebuild | 30 |
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 +} |
