sys-fs/bcachefs-tools: add 1.38.5

Upstream install_dkms target no longer supports the PREFIX
variable. To account for that, we use DKMSDIR instead. Make module_s a
global variable, since it is now used in src_configure and
src_compile. Therefore, we rename it to an all caps variant and expand
a bit on the _s part.

Allow building with llmv-runtimes/libunwind (bug #976076).

Drop the unnecessary "emake -j$(get_makeopts_jobs)" part as emake
already uses MAKEOPTS. This means we can stop inheriting
multiprocessing.eclass.

Finally, replace the VERSION sed of the Makefile with
    echo "${PV}" > .version
as bcachefs's build looks for its version in such a file and this
is more robust than using sed.

Closes: https://bugs.gentoo.org/977211
Bug: https://bugs.gentoo.org/976075
Signed-off-by: Florian Schmaus <flow@gentoo.org>
This commit is contained in:
Florian Schmaus
2026-06-12 10:33:37 +02:00
parent 2618183cec
commit 44dee5b0a6
2 changed files with 346 additions and 0 deletions

View File

@@ -14,6 +14,8 @@ DIST bcachefs-tools-1.37.4.tar.sign 833 BLAKE2B 0cec7399acf3f7efb44c746d032c557f
DIST bcachefs-tools-1.37.4.tar.zst 1663281 BLAKE2B 6d1eabae9528d209979e10b742653e1e1a019141a6c0f0bbc5bb2b97c1faa9d4c8ca59b701617f6410926799f0b58ac5bd7f26ce3f9077e34adc4c8e07e32bb9 SHA512 48e030d31c9135399072b8ae408abdb9af43cf02b100a5f6019ee00d70db3ba02d94d0e3880d2394f79f72a5b2b57122ae58bb564218d1a7453783d1cd166eca
DIST bcachefs-tools-1.38.2.tar.sign 833 BLAKE2B 0e2605b9b1ffc72287f2a6818a113ec9cac159337dfc367335ecf49ee89cf45cc6d6a36f5fd627e72b4704a587cffdc25be24e982586a7b9fd822f58b5b8f3be SHA512 5f4df669ea8a1b0cbc545ee34436000735b69cee3ff83fcb0987fad4337739cada9840c5ad79f578db593dc0b4e5fdd82b9781044954482377268183b80f6de4
DIST bcachefs-tools-1.38.2.tar.zst 1721027 BLAKE2B 09b4c851ba74759466ba85851529c5b66a0f64ce4c49b2de5e16240b610a11b9ed7d2df20b6b5381ea53cbb8da42e4579f2faecc74290226bcda18b078a1a5fd SHA512 a8de7e61873a40b348dd6751b493a189a6015c30753ae43c3cba0c6858a6529d87ab4cc7776a9e049ec7433fda2b4a2a937bb7119bb71e0ad25f94c36e75f0d9
DIST bcachefs-tools-1.38.5.tar.sign 833 BLAKE2B bdc1328d7a760eb3c19298fd79beb3628ae85937c9198b558c57550838481b05a9e534fb6bc2bc9fe13316b6267bfd0fba09c1688fea6403db93263e5790626d SHA512 202250574b0a61167b0abb4678e18f7093b3f4aca2b759f5b58eed781976b04852a0b17b429d362da70f677bc8ad32138c8f52faea33bad9d61344ae9bc9a9ec
DIST bcachefs-tools-1.38.5.tar.zst 1770064 BLAKE2B 3b03f7d926f12db0932c50347558fc61a3312d70f80e4d9e6733291c265f069b78406aa7fe8c8d7ae3d404e3141d8a4c868067492c9dec33a778ebb3d110ef7a SHA512 0b0322ecca78436184b455b05c9515fa9eeb34684ba734550c8ee0836e99b320b20077ae2bc128c5a0bb78b65f03e155f0fda3232cc91b3516d6d8502abeab23
DIST bindgen-0.69.5.crate 221128 BLAKE2B b89edbf883e1bc11a074c2f37f84bb966749823a6408b9765d6a61ee1179451d67dadde41d27838e8ddc6172dee9c342429f42fbe6959ff9fd7dcbc73d7506ea SHA512 b232b906af7535f8b87198f0a4037a0f09af367e0c913575f3d16453a2c272e7d76033cb3fd12d4223ebda4a0f8130629e67c5883e026a2422db3e0659ed3c3f
DIST bindgen-0.72.1.crate 246071 BLAKE2B b6db53ca86fa3b5f71abbf6d2fd5f83553e167507db2e869ed7f3acf8865478e49430eddce8c255a8fabf8f6e408e7dcc78a9088201cdeea1e48bc387f8a6f28 SHA512 14f4277b62cfc91661400ed1bacb82a9f28b7e6caa17dd4bb4dbeedd5784299d5915c2235af9da42a8a216fa0b14b49f1e38eaa530f1e906bcd74f864ae8a7e2
DIST bitfield-0.14.0.crate 16776 BLAKE2B abca546581d912133e7344f049d93b8d793de323eba7780fab162c53a244b845582ec2bd14b529b9491c363c2da6228b7de58407afc554cc718a9df8370f5535 SHA512 703d534f0684b19af68a18048ecff37367ccbe5a52a3e8d987f2420b980e4a20da9640019ca610b1a73841cbe45dbf4d6a1cfb10cf0e7d09f53199b1fcd141fe
@@ -94,6 +96,7 @@ DIST ref-cast-impl-1.0.25.crate 10167 BLAKE2B 0b648a9d54300e309214d8061f017d8c34
DIST regex-1.11.0.crate 254059 BLAKE2B 9450e54b522c3f12e4f1d814025c3037f8373b9e1feaf2028756b573335cb7f22400b0925e3ceb0716d72aeb19b02b4bcf70b0b435a0252d0d52a7028d95308c SHA512 16c066664ae87497f9880a52222301fb0d44053ae2d6861ea21dc59cab82bd1ab8ac407f9e77228a21a586ee745b02f9eb10e7b9b30df2f3aad73633270bf73d
DIST regex-automata-0.4.8.crate 617784 BLAKE2B 7535c79f6ddf1b1225e21171921594dcf32fc3afd47519d2067b2047b19070cb7e6fdfd1563b884fec6f91dd568522fc95d85bf095c11f8c02daeac128c45020 SHA512 278e3e2ab230ed5fa7d4837e8ea879fae68ebf35c2da5cc3a67f46b7d593abbcf71e6326a0cf34e38edc0f3f2166ff42a4fcc17a400d9604429aa5b4be075a3f
DIST regex-syntax-0.8.5.crate 357541 BLAKE2B fc6d125f7a8574c37d81c75cbfd447cbcff736f2d9991b19814ffc1a414ebc5b76e84fb8fd36c983b38e8e391d165cdd9047832b0d9100f0e1ba7085484b7db5 SHA512 549d8d130fea9ec0d5806126f57f31d433f50e9328c5532ad417c44bb5488ec0d20acb0983dbe54dabaa0b453cbea4533cf7baac7144df119e8f78dfe55c5ab8
DIST rustc-demangle-0.1.27.crate 30448 BLAKE2B c301ebc7d127c679d95dc77798f738263aed592a9d08cc6a5e3f53a4b48fcdb8ddc824550c35c6274093315d71dd720588e1bb7d6145d1e3975dcdef72c45932 SHA512 da827b28e0be62af85b4b5dc15de06d78058bdf19888ebc7c55a46b533d81e2d8ba922bf032bcfa5334c6c43dd5bb272ae9510ffcf9ca2711a284bfbe245fcc4
DIST rustc-hash-1.1.0.crate 9331 BLAKE2B 16ac56622897f47a06b661fb59a196b08d48e782ab87549c8bd5c6fe92f374c9bfd44dcb36588512bd9b6125c2fd79a12d648aaa308fd9694bcca3a7c1b49ac9 SHA512 84e673ea9b046f7b989d47f2c4505557fbd5de991e6fc9f56a03605d40e0b4ba5427cd566954890153cc033ccbec6c984306634571935bfe0d4cdfbe56f39544
DIST rustc-hash-2.1.1.crate 14154 BLAKE2B 7a1b3b82bbbf6a123512815c3e8f068a17890cbbb8b68e88a5a492f62469942fadd776207eebd913052a1c06e1fd37a549e86526b9fc8f08b9ca7cb0044ac16b SHA512 87097d98d47f327d000041ab13acddc366f1500d9c3e5c82169c3358112c7a7c03701c9b3c2c81d9f9da65b7ebac1c479b179dfaf7c059cd0b929b4673e51084
DIST rustix-0.38.37.crate 371243 BLAKE2B bceaa4861747208f1f2b68f8924c7247648d88deb200e97d8ed17c5cbf9c934488065f0ee7e4406bc96e8709b292ee1fe15beb346bff57b5f05af36174420a0c SHA512 6c0ad1be1fcf1b74f670b2c7599ba68c2ce834c760ff7486674d190ae0d552165b0c2abdc35b13eee8c0333a904c67f5dd1efa742c20fd3735c7ccdf2a439619

View File

@@ -0,0 +1,343 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
CRATES="
aho-corasick@1.1.3
android_system_properties@0.1.5
anstream@0.6.15
anstyle-parse@0.2.5
anstyle-query@1.1.1
anstyle-wincon@3.0.4
anstyle@1.0.8
anyhow@1.0.89
ascii@1.1.0
autocfg@1.5.0
bindgen@0.72.1
bitfield@0.14.0
bitflags@1.3.2
bitflags@2.11.0
bumpalo@3.19.1
cc@1.2.55
cexpr@0.6.0
cfg-if@1.0.0
cfg_aliases@0.2.1
chrono@0.4.43
chunked_transfer@1.5.0
clang-sys@1.8.1
clap@4.5.20
clap_builder@4.5.20
clap_complete@4.5.33
clap_derive@4.5.18
clap_lex@0.7.2
colorchoice@1.0.2
core-foundation-sys@0.8.7
crossterm@0.28.1
either@1.13.0
env_logger@0.10.2
equivalent@1.0.2
errno@0.3.9
fiemap@0.2.0
find-msvc-tools@0.1.9
fuser@0.17.0
getrandom@0.2.17
glob@0.3.1
hashbrown@0.16.1
heck@0.5.0
httpdate@1.0.3
iana-time-zone-haiku@0.1.2
iana-time-zone@0.1.65
indexmap@2.13.0
is_terminal_polyfill@1.70.1
itertools@0.12.1
itoa@1.0.17
js-sys@0.3.85
libc@0.2.180
libloading@0.8.5
libudev-sys@0.1.4
linux-raw-sys@0.4.14
lock_api@0.4.14
log@0.4.22
memchr@2.7.4
memoffset@0.9.1
minimal-lexical@0.2.1
mio@1.1.1
nix@0.30.1
nom@7.1.3
num-traits@0.2.19
num_enum@0.7.5
num_enum_derive@0.7.5
once_cell@1.20.2
owo-colors@4.1.0
page_size@0.6.0
parking_lot@0.12.5
parking_lot_core@0.9.12
paste@1.0.15
pkg-config@0.3.31
prettyplease@0.2.22
proc-macro-crate@3.4.0
proc-macro2@1.0.87
quote@1.0.37
redox_syscall@0.5.18
ref-cast-impl@1.0.25
ref-cast@1.0.25
regex-automata@0.4.8
regex-syntax@0.8.5
regex@1.11.0
rustc-demangle@0.1.27
rustc-hash@2.1.1
rustix@0.38.37
rustversion@1.0.17
ryu@1.0.22
scopeguard@1.2.0
serde@1.0.228
serde_core@1.0.228
serde_derive@1.0.228
serde_json@1.0.143
shlex@1.3.0
signal-hook-mio@0.2.5
signal-hook-registry@1.4.8
signal-hook@0.3.18
smallvec@1.15.1
strsim@0.11.1
strum@0.26.3
strum_macros@0.26.4
syn@2.0.87
terminal_size@0.4.0
tiny_http@0.12.0
toml_datetime@0.7.5+spec-1.1.0
toml_edit@0.23.10+spec-1.0.0
toml_parser@1.0.9+spec-1.1.0
udev@0.7.0
unicode-ident@1.0.13
utf8parse@0.2.2
uuid@1.10.0
wasi@0.11.1+wasi-snapshot-preview1
wasm-bindgen-macro-support@0.2.108
wasm-bindgen-macro@0.2.108
wasm-bindgen-shared@0.2.108
wasm-bindgen@0.2.108
winapi-i686-pc-windows-gnu@0.4.0
winapi-x86_64-pc-windows-gnu@0.4.0
winapi@0.3.9
windows-core@0.62.2
windows-implement@0.60.2
windows-interface@0.59.3
windows-link@0.2.1
windows-result@0.4.1
windows-strings@0.5.1
windows-sys@0.52.0
windows-sys@0.59.0
windows-sys@0.61.2
windows-targets@0.52.6
windows_aarch64_gnullvm@0.52.6
windows_aarch64_msvc@0.52.6
windows_i686_gnu@0.52.6
windows_i686_gnullvm@0.52.6
windows_i686_msvc@0.52.6
windows_x86_64_gnu@0.52.6
windows_x86_64_gnullvm@0.52.6
windows_x86_64_msvc@0.52.6
winnow@0.7.14
zerocopy-derive@0.8.27
zerocopy@0.8.27
zeroize@1.8.1
zeroize_derive@1.4.2
"
LLVM_COMPAT=( {17..21} )
MODULES_INITRAMFS_IUSE=+initramfs
MODULES_KERNEL_MIN=6.16
MODULES_OPTIONAL_IUSE=+modules
PYTHON_COMPAT=( python3_{11..14} )
RUST_MIN_VER="1.85.0"
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/kentoverstreet.asc
inherit cargo flag-o-matic linux-mod-r1 llvm-r2 python-any-r1
inherit shell-completion sysroot toolchain-funcs unpacker verify-sig
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://evilpiepirate.org/bcachefs-tools/bcachefs-tools-${PV}.tar.zst
${CARGO_CRATE_URIS}
"
SRC_URI+=" verify-sig? ( https://evilpiepirate.org/bcachefs-tools/bcachefs-tools-${PV}.tar.sign )"
S="${WORKDIR}/${P}"
KEYWORDS="~amd64 ~arm64"
fi
LICENSE="GPL-2"
# Dependent crate licenses
LICENSE+=" Apache-2.0 BSD ISC MIT Unicode-DFS-2016"
SLOT="0"
IUSE="debug llvm-libunwind verify-sig"
RESTRICT="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
llvm-libunwind? ( llvm-runtimes/libunwind:= )
!llvm-libunwind? ( sys-libs/libunwind:= )
virtual/udev
virtual/zlib:=
"
RDEPEND="${DEPEND}"
# Clang is required for bindgen
BDEPEND="
${PYTHON_DEPS}
$(python_gen_any_dep '
dev-python/docutils[${PYTHON_USEDEP}]
')
$(unpacker_src_uri_depends)
$(llvm_gen_dep '
llvm-core/clang:${LLVM_SLOT}
')
elibc_musl? ( >=sys-libs/musl-1.2.5 )
virtual/pkgconfig
modules? ( >=sys-kernel/linux-headers-6.16.0 )
verify-sig? ( >=sec-keys/openpgp-keys-kentoverstreet-20241012 )
"
QA_FLAGS_IGNORED="/sbin/bcachefs"
python_check_deps() {
python_has_version "dev-python/docutils[${PYTHON_USEDEP}]"
}
pkg_setup() {
llvm-r2_pkg_setup
python-any-r1_pkg_setup
rust_pkg_setup
if use modules; then
# grep -r 'depends on\|select ' ${S}/libbcachefs/Kconfig | grep -v '^#'
local CONFIG_CHECK="
!BCACHEFS_FS
BLOCK
EXPORTFS
CRC32
CRC64
FS_POSIX_ACL
LZ4_COMPRESS
LZ4_DECOMPRESS
LZ4HC_COMPRESS
ZLIB_DEFLATE
ZLIB_INFLATE
ZSTD_COMPRESS
ZSTD_DECOMPRESS
CRYPTO_LIB_SHA256
CRYPTO_LIB_CHACHA
CRYPTO_LIB_POLY1305
KEYS
RAID6_PQ
RUST
XOR_BLOCKS
XXHASH
SYMBOLIC_ERRNAME
"
use debug && CONFIG_CHECK+="
DEBUG_INFO
FRAME_POINTER
!DEBUG_INFO_REDUCED
"
linux-mod-r1_pkg_setup
fi
}
src_unpack() {
if [[ ${PV} == "9999" ]]; then
git-r3_src_unpack
S="${S}/src" cargo_live_src_unpack
else
# Upstream signs the uncompressed tarball
if use verify-sig; then
einfo "Unpacking ${P}.tar.zst ..."
verify-sig_verify_detached - "${DISTDIR}"/${P}.tar.sign \
< <(zstd -fdc "${DISTDIR}"/${P}.tar.zst | tee >(tar -xf -))
assert "Unpack failed"
fi
unpacker ${P}.tar.zst
cargo_src_unpack
fi
}
src_prepare() {
default
tc-export CC
echo "${PV}" > .version || die
sed \
-e '/^CFLAGS/s:-O2::' \
-e '/^CFLAGS/s:-g::' \
-i Makefile || die
if use llvm-libunwind; then
sed -i s/libunwind// Makefile || die
fi
append-lfs-flags
}
src_configure() {
cargo_src_configure
MODULE_SRC="module/${PN%-*}-${PV}"
use modules && emake DESTDIR="${WORKDIR}" DKMSDIR="/${MODULE_SRC}" install_dkms
}
src_compile() {
export BUILD_VERBOSE=1
export VERSION=${PV}
local modlist=( "bcachefs=:../${MODULE_SRC}:../${MODULE_SRC}/src/fs/bcachefs" )
local modargs=(
KDIR=${KV_OUT_DIR}
)
# Makefile calls `cargo` directly, so make sure we set our rustflags (etc)
cargo_env emake bcachefs || die
use modules && linux-mod-r1_src_compile
# Recent versions mangle the 'bcachefs' symbolic link, work around it.
[[ -e bcachefs ]] && die "bcachefs symlink is valid, please remove workaround"
ln -rsf target/release/bcachefs bcachefs || die
local shell
for shell in bash fish zsh; do
sysroot_try_run_prefixed ./bcachefs completions ${shell} > ${shell}.completion || die
done
}
src_install() {
into /
dosbin bcachefs
dosym bcachefs /sbin/fsck.bcachefs
dosym bcachefs /sbin/mkfs.bcachefs
dosym bcachefs /sbin/mount.bcachefs
# Uses a crate-based implementation of FUSE, no dependency on sys-fs/fuse and unconditionally included.
dosym bcachefs /sbin/fsck.fuse.bcachefs
dosym bcachefs /sbin/mkfs.fuse.bcachefs
dosym bcachefs /sbin/mount.fuse.bcachefs
newbashcomp bash.completion bcachefs
newfishcomp fish.completion bcachefs.fish
newzshcomp zsh.completion _bcachefs
doman bcachefs.8
use modules && linux-mod-r1_src_install
}