commit:     2f1d8601108aca38dab9bd33edd1695cfa0441a6
Author:     Christopher Fore <csfore <AT> posteo <DOT> net>
AuthorDate: Wed Jan 24 05:16:47 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jan 24 07:28:08 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f1d8601

sys-fs/bcachefs-tools: add 1.4.1

- Remove itertools dependency
- Add some sandbox tests back (passing now)
- Add remote id to metadata.xml for rust-bindgen-bcachefs (pkgcheck scan
  warning)
- Mask >= 1.4.1 on Musl systems (see comment)

Signed-off-by: Christopher Fore <csfore <AT> posteo.net>
Closes: https://github.com/gentoo/gentoo/pull/34969
Signed-off-by: Sam James <sam <AT> gentoo.org>

 profiles/features/musl/package.mask               |   4 +
 sys-fs/bcachefs-tools/Manifest                    |   1 +
 sys-fs/bcachefs-tools/bcachefs-tools-1.4.1.ebuild | 257 ++++++++++++++++++++++
 sys-fs/bcachefs-tools/metadata.xml                |   1 +
 4 files changed, 263 insertions(+)

diff --git a/profiles/features/musl/package.mask 
b/profiles/features/musl/package.mask
index 4d3f75c16632..42cb762efabd 100644
--- a/profiles/features/musl/package.mask
+++ b/profiles/features/musl/package.mask
@@ -394,3 +394,7 @@ sys-block/wait-for-dri-devices-rules
 dev-lang/rust-bin
 mail-client/thunderbird-bin
 www-client/firefox-bin
+
+# >=sys-fs/bcachefs-tools-1.4.1 uses functions currently not in Musl
+# https://github.com/koverstreet/bcachefs-tools/issues/213
+>=sys-fs/bcachefs-tools-1.4.1

diff --git a/sys-fs/bcachefs-tools/Manifest b/sys-fs/bcachefs-tools/Manifest
index 56df948ec10d..3f642fbd9b00 100644
--- a/sys-fs/bcachefs-tools/Manifest
+++ b/sys-fs/bcachefs-tools/Manifest
@@ -9,6 +9,7 @@ DIST atty-0.2.14.crate 5470 BLAKE2B 
2db856a9e898a430258f059aeaf7c844a153293e8856
 DIST autocfg-1.1.0.crate 13272 BLAKE2B 
7724055c337d562103f191f4e36cab469e578f0c51cc24d33624dea155d108a07578703766341fd6a4cc1ef52acda406e7dba1650d59115f18261281e5b40203
 SHA512 
df972c09abbdc0b6cb6bb55b1e29c7fed706ece38a62613d9e275bac46a19574a7f96f0152cccb0239efea04ee90083a146b58b15307696c4c81878cd12de28f
 DIST bcachefs-tools-1.3.5_p20231216.tar.gz 1059604 BLAKE2B 
0f3a138b0586c04c53967b801917372486f6558e8d1c9230bc33b1de39a1f7c82ba53bea0b063e1609742ec345fed9f374328ee4990d9bdf456f96ae5219334a
 SHA512 
52b49598ceb5308e7ff235d87fb1e628836b7b297f06a02232307ae34b63fa7cd3eeb4919022bda40aa05954e0237284db7d7cb2e1bfecad629f01cf08caaeec
 DIST bcachefs-tools-1.4.0.tar.gz 1060158 BLAKE2B 
c972de13e305b07910ab4acdfea05df85bfe70ed350dea5fb578a150a9e116f054dc99bf6dd185aa26dab799832939276a6248203717b918c1d7e0e9f2e0fdd9
 SHA512 
f374c3b2ec1836ea79ed37f188aaf9c98d6d217b2b05c050304467068a1e042e2e5ea99f2e67d546cd68f3e39be065e62bae73ff13e92ceb29a15df9fe63e4e2
+DIST bcachefs-tools-1.4.1.tar.gz 1069244 BLAKE2B 
7be0a343758a221a39dad5eca1c11c74d049e208712d30ffdfd919c97ef87e561983b85b2fbefa932cb69ef50418dce761a9c01afe0114f67b8ddd55b5d62a2c
 SHA512 
65d0f182982d942d1263d60cf435a1142393b9dcf1e7dbea53a873925a82954b47422ade04bbc5b69c955de80ef820e9eeefcfed47aaab3bcc27d3916a94ff4a
 DIST bitfield-0.14.0.crate 16776 BLAKE2B 
abca546581d912133e7344f049d93b8d793de323eba7780fab162c53a244b845582ec2bd14b529b9491c363c2da6228b7de58407afc554cc718a9df8370f5535
 SHA512 
703d534f0684b19af68a18048ecff37367ccbe5a52a3e8d987f2420b980e4a20da9640019ca610b1a73841cbe45dbf4d6a1cfb10cf0e7d09f53199b1fcd141fe
 DIST bitflags-1.3.2.crate 23021 BLAKE2B 
eb990bb27b2bdeb66fd7212ce582cb36e1c616debbac85df642d0c82b25439e6bf9b1e811fac76b59e58ea3c1bbea6170d03a61e8f9a395e4334a0e2e2987eda
 SHA512 
3c698f757b5cc62f815f9a1cce365c3d2dd88e4db71f331dff8bba86c2865f755b81cb4c9bfc59bd86b7643b0943f9e09a7c4f8ad75eb2ab0e714803d0129f62
 DIST bitflags-2.4.1.crate 37043 BLAKE2B 
f61c45b142265e9c2944c7054e01704de47510735e9ee5351cd02b98676cc4eb42d68b1fc4849ad5f54654617a74f20cb533b4207c2fe76516b724ba9318b414
 SHA512 
d3fd7abc95acc1cb5bf16d6acc12dbb8eadd250f069268df13c2e8dc3d5f5c15a929cd17ca931c77393b64dce0516ef8674c469789ed32d78e315b5faada062b

diff --git a/sys-fs/bcachefs-tools/bcachefs-tools-1.4.1.ebuild 
b/sys-fs/bcachefs-tools/bcachefs-tools-1.4.1.ebuild
new file mode 100644
index 000000000000..e7396e664d7a
--- /dev/null
+++ b/sys-fs/bcachefs-tools/bcachefs-tools-1.4.1.ebuild
@@ -0,0 +1,257 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CRATES="
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+       [email protected]
+"
+
+# Upstream have a fork of bindgen and use cgit
+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 llvm multiprocessing python-any-r1 toolchain-funcs 
unpacker
+
+DESCRIPTION="Tools for bcachefs"
+HOMEPAGE="https://bcachefs.org/";
+if [[ ${PV} == "9999" ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://evilpiepirate.org/git/bcachefs-tools.git";
+else
+       
SRC_URI="https://github.com/koverstreet/bcachefs-tools/archive/refs/tags/v${PV}.tar.gz
 -> ${P}.tar.gz
+               ${CARGO_CRATE_URIS}"
+       S="${WORKDIR}/${P}"
+       KEYWORDS="~amd64"
+fi
+
+LICENSE="Apache-2.0 BSD GPL-2 MIT"
+SLOT="0"
+IUSE="fuse test"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+       app-arch/lz4:=
+       app-arch/zstd:=
+       dev-libs/libaio
+       dev-libs/libsodium:=
+       dev-libs/userspace-rcu:=
+       sys-apps/keyutils:=
+       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 '
+               dev-python/docutils[${PYTHON_USEDEP}]
+               test? (
+                       dev-python/pytest[${PYTHON_USEDEP}]
+                       dev-python/pytest-xdist[${PYTHON_USEDEP}]
+               )
+       ')
+       $(unpacker_src_uri_depends)
+       <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 \
+                       "dev-python/pytest[${PYTHON_USEDEP}]" \
+                       "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() {
+       if [[ ${PV} == "9999" ]]; then
+               git-r3_src_unpack
+               S="${S}/rust-src" cargo_live_src_unpack
+       else
+               unpack ${P}.tar.gz
+               cargo_src_unpack
+       fi
+}
+
+src_prepare() {
+       default
+       tc-export CC
+       sed \
+               -e '/^CFLAGS/s:-O2::' \
+               -e '/^CFLAGS/s:-g::' \
+               -i Makefile || die
+       # Patch our cargo-ebuild patch definition to pretend that our GIT_CRATE 
is upstream's URI.
+       if ! [[ ${PV} == "9999" ]]; then
+               sed -e 's https://gitlab.com/Matt.Jolly/rust-bindgen-bcachefs 
https://evilpiepirate.org/git/rust-bindgen.git ' \
+                       -i "${WORKDIR}/cargo_home/config" || die
+       fi
+       append-lfs-flags
+}
+
+src_compile() {
+       use fuse && export BCACHEFS_FUSE=1
+       export BUILD_VERBOSE=1
+       export VERSION=${PV}
+
+       default
+
+       use test && emake tests
+}
+
+src_test() {
+       if ! use fuse; then
+               EPYTEST_IGNORE=( tests/test_fuse.py )
+       fi
+       EPYTEST_DESELECT=(
+               # Valgrind
+               'tests/test_fixture.py::test_read_after_free'
+               'tests/test_fixture.py::test_undefined'
+               'tests/test_fixture.py::test_write_after_free'
+               'tests/test_fixture.py::test_undefined_branch'
+               'tests/test_fixture.py::test_leak'
+               'tests/test_fixture.py::test_check'
+               # Fails in portage because of usersandbox; ensure that these 
pass before bumping!
+               'tests/test_basic.py::test_list_inodes'
+               'tests/test_basic.py::test_list_dirent'
+       )
+       epytest -v -n "$(makeopts_jobs)"
+}
+
+src_install() {
+       into /
+       dosbin bcachefs
+
+       dosym bcachefs /sbin/fsck.bcachefs
+       dosym bcachefs /sbin/mkfs.bcachefs
+       dosym bcachefs /sbin/mount.bcachefs
+
+       if use fuse; then
+               dosym bcachefs /sbin/fsck.fuse.bcachefs
+               dosym bcachefs /sbin/mkfs.fuse.bcachefs
+               dosym bcachefs /sbin/mount.fuse.bcachefs
+       fi
+
+       doman bcachefs.8
+}
+
+pkg_postinst() {
+       if use fuse; then
+               ewarn "FUSE support is experimental."
+               ewarn "Please only use it for development purposes at the risk 
of losing your data."
+               ewarn "You have been warned."
+       fi
+}

diff --git a/sys-fs/bcachefs-tools/metadata.xml 
b/sys-fs/bcachefs-tools/metadata.xml
index 2bc62d23a4f2..f86ecd3e8764 100644
--- a/sys-fs/bcachefs-tools/metadata.xml
+++ b/sys-fs/bcachefs-tools/metadata.xml
@@ -14,5 +14,6 @@
        </use>
        <upstream>
                <remote-id type="github">koverstreet/bcachefs-tools</remote-id>
+               <remote-id 
type="gitlab">Matt.Jolly/rust-bindgen-bcachefs</remote-id>
        </upstream>
 </pkgmetadata>

Reply via email to