commit:     7b7ccd412ab04783edaa21da93bf2955e90fae08
Author:     Matt Jolly <Matt.Jolly <AT> footclan <DOT> ninja>
AuthorDate: Sat Sep  2 18:21:35 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Sep  3 07:14:35 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b7ccd41

sys-fs/bcachefs-tools: add llvm.eclass

also update src_unpack to reduce console spam during the phase

Bug: https://bugs.gentoo.org/913520
Signed-off-by: Matt Jolly <Matt.Jolly <AT> footclan.ninja>
Closes: https://github.com/gentoo/gentoo/pull/32565
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../bcachefs-tools-1.2_p20230813.ebuild               | 18 +++++++++++++++---
 sys-fs/bcachefs-tools/bcachefs-tools-9999.ebuild      | 19 +++++++++++++++----
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/sys-fs/bcachefs-tools/bcachefs-tools-1.2_p20230813.ebuild 
b/sys-fs/bcachefs-tools/bcachefs-tools-1.2_p20230813.ebuild
index 35de8ac80ee3..5a6adc90c67f 100644
--- a/sys-fs/bcachefs-tools/bcachefs-tools-1.2_p20230813.ebuild
+++ b/sys-fs/bcachefs-tools/bcachefs-tools-1.2_p20230813.ebuild
@@ -117,9 +117,10 @@ declare -A GIT_CRATES=(
        
[bindgen]="https://gitlab.com/Matt.Jolly/rust-bindgen-bcachefs;f773267b090bf16b9e8375fcbdcd8ba5e88806a8;rust-bindgen-bcachefs-%commit%/bindgen";
 )
 
+LLVM_MAX_SLOT=17
 PYTHON_COMPAT=( python3_{10..12} )
 
-inherit cargo flag-o-matic multiprocessing python-any-r1 toolchain-funcs 
unpacker
+inherit cargo flag-o-matic llvm multiprocessing python-any-r1 toolchain-funcs 
unpacker
 
 DESCRIPTION="Tools for bcachefs"
 HOMEPAGE="https://bcachefs.org/";
@@ -153,6 +154,7 @@ DEPEND="
 
 RDEPEND="${DEPEND}"
 
+# Clang is required for bindgen
 BDEPEND="
        ${PYTHON_DEPS}
        $(python_gen_any_dep '
@@ -163,10 +165,15 @@ BDEPEND="
                )
        ')
        $(unpacker_src_uri_depends)
-       sys-devel/clang
+       <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1))
+       virtual/pkgconfig
        virtual/rust
 "
 
+llvm_check_deps() {
+       has_version -b "sys-devel/clang:${LLVM_SLOT}"
+}
+
 python_check_deps() {
        if use test; then
                python_has_version \
@@ -177,12 +184,17 @@ python_check_deps() {
 
 }
 
+pkg_setup() {
+       llvm_pkg_setup
+       python-any-r1_pkg_setup
+}
+
 src_unpack() {
        if [[ ${PV} == "9999" ]]; then
                git-r3_src_unpack
                S="${S}/rust-src" cargo_live_src_unpack
        else
-               default
+               unpack ${P}.tar.gz
                cargo_src_unpack
        fi
 }

diff --git a/sys-fs/bcachefs-tools/bcachefs-tools-9999.ebuild 
b/sys-fs/bcachefs-tools/bcachefs-tools-9999.ebuild
index e0dd0d66a627..b30dc1f3b7ae 100644
--- a/sys-fs/bcachefs-tools/bcachefs-tools-9999.ebuild
+++ b/sys-fs/bcachefs-tools/bcachefs-tools-9999.ebuild
@@ -11,9 +11,10 @@ EAPI=8
 #      
[bindgen]="https://gitlab.com/Matt.Jolly/rust-bindgen-bcachefs;f773267b090bf16b9e8375fcbdcd8ba5e88806a8;rust-bindgen-bcachefs-%commit%/bindgen";
 # )
 
+LLVM_MAX_SLOT=17
 PYTHON_COMPAT=( python3_{10..12} )
 
-inherit cargo flag-o-matic multiprocessing python-any-r1 toolchain-funcs 
unpacker
+inherit cargo flag-o-matic llvm multiprocessing python-any-r1 toolchain-funcs 
unpacker
 
 DESCRIPTION="Tools for bcachefs"
 HOMEPAGE="https://bcachefs.org/";
@@ -34,6 +35,7 @@ IUSE="fuse test"
 RESTRICT="!test? ( test )"
 
 DEPEND="
+       fuse? ( >=sys-fs/fuse-3.7.0 )
        app-arch/lz4
        dev-libs/libaio
        dev-libs/libsodium
@@ -42,11 +44,11 @@ DEPEND="
        sys-apps/util-linux
        sys-libs/zlib
        virtual/udev
-       fuse? ( >=sys-fs/fuse-3.7.0 )
 "
 
 RDEPEND="${DEPEND}"
 
+# Clang is required for bindgen
 BDEPEND="
        ${PYTHON_DEPS}
        $(python_gen_any_dep '
@@ -57,10 +59,15 @@ BDEPEND="
                )
        ')
        $(unpacker_src_uri_depends)
-       sys-devel/clang
+       <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1))
+       virtual/pkgconfig
        virtual/rust
 "
 
+llvm_check_deps() {
+       has_version -b "sys-devel/clang:${LLVM_SLOT}"
+}
+
 python_check_deps() {
        if use test; then
                python_has_version \
@@ -68,7 +75,11 @@ python_check_deps() {
                        "dev-python/pytest-xdist[${PYTHON_USEDEP}]"
        fi
        python_has_version "dev-python/docutils[${PYTHON_USEDEP}]"
+}
 
+pkg_setup() {
+       llvm_pkg_setup
+       python-any-r1_pkg_setup
 }
 
 src_unpack() {
@@ -76,7 +87,7 @@ src_unpack() {
                git-r3_src_unpack
                S="${S}/rust-src" cargo_live_src_unpack
        else
-               default
+               unpack ${P}.tar.gz
                cargo_src_unpack
        fi
 }

Reply via email to