commit:     94c75c62f7d212c48db20c9b289653d8fe0dc041
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 17 08:16:25 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 17 08:23:50 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94c75c62

dev-libs/castxml: use llvm.eclass

This is needed to make sure that the right LLVM implementation is built
against & the needed env vars are setup.

Also, castxml doesn't seem compatible with >= LLVM 16 yet, so this is needed
to let us build w/ 15 if newer are installed.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/castxml/castxml-0.5.1-r1.ebuild | 48 ++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/dev-libs/castxml/castxml-0.5.1-r1.ebuild 
b/dev-libs/castxml/castxml-0.5.1-r1.ebuild
new file mode 100644
index 000000000000..e8addf5bbe5e
--- /dev/null
+++ b/dev-libs/castxml/castxml-0.5.1-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_MAX_SLOT=15
+inherit cmake llvm
+
+DESCRIPTION="C-family abstract syntax tree XML output tool"
+HOMEPAGE="https://github.com/CastXML/CastXML";
+SRC_URI="https://github.com/CastXML/CastXML/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+S="${WORKDIR}/CastXML-${PV}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~riscv ~x86"
+IUSE="+man test"
+RESTRICT="!test? ( test )"
+
+# See comment in llvm.eclass for why we don't depend on LLVM if we already
+# depend on Clang.
+RDEPEND="
+       <sys-devel/clang-$((LLVM_MAX_SLOT + 1)):=
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       ${RDEPEND}
+       man? ( dev-python/sphinx )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-fix-tests.patch
+)
+
+llvm_check_deps() {
+       has_version "sys-devel/clang:${LLVM_SLOT}"
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DCastXML_INSTALL_DOC_DIR="share/doc/${P}"
+               -DCastXML_INSTALL_MAN_DIR="share/man"
+               -DSPHINX_MAN="$(usex man)"
+               -DSPHINX_HTML=OFF
+               -DBUILD_TESTING="$(usex test)"
+       )
+       cmake_src_configure
+}

Reply via email to