| 5 |
5 |
|
| 6 |
6 |
CRATES="
|
| 7 |
7 |
aho-corasick@1.1.3
|
|
8 |
android_system_properties@0.1.5
|
| 8 |
9 |
anstream@0.6.15
|
| 9 |
10 |
anstyle-parse@0.2.5
|
| 10 |
11 |
anstyle-query@1.1.1
|
| 11 |
12 |
anstyle-wincon@3.0.4
|
| 12 |
13 |
anstyle@1.0.8
|
| 13 |
14 |
anyhow@1.0.89
|
| 14 |
|
bindgen@0.69.5
|
|
15 |
ascii@1.1.0
|
|
16 |
autocfg@1.5.0
|
|
17 |
bindgen@0.72.1
|
| 15 |
18 |
bitfield@0.14.0
|
| 16 |
19 |
bitflags@1.3.2
|
| 17 |
|
bitflags@2.6.0
|
| 18 |
|
cc@1.1.28
|
|
20 |
bitflags@2.11.0
|
|
21 |
bumpalo@3.19.1
|
|
22 |
cc@1.2.55
|
| 19 |
23 |
cexpr@0.6.0
|
| 20 |
24 |
cfg-if@1.0.0
|
|
25 |
cfg_aliases@0.2.1
|
|
26 |
chrono@0.4.43
|
|
27 |
chunked_transfer@1.5.0
|
| 21 |
28 |
clang-sys@1.8.1
|
| 22 |
29 |
clap@4.5.20
|
| 23 |
30 |
clap_builder@4.5.20
|
| ... | ... | |
| 25 |
32 |
clap_derive@4.5.18
|
| 26 |
33 |
clap_lex@0.7.2
|
| 27 |
34 |
colorchoice@1.0.2
|
|
35 |
core-foundation-sys@0.8.7
|
|
36 |
crossterm@0.28.1
|
| 28 |
37 |
either@1.13.0
|
| 29 |
38 |
env_logger@0.10.2
|
| 30 |
|
errno-dragonfly@0.1.2
|
| 31 |
|
errno@0.2.8
|
|
39 |
equivalent@1.0.2
|
| 32 |
40 |
errno@0.3.9
|
|
41 |
fiemap@0.2.0
|
|
42 |
find-msvc-tools@0.1.9
|
|
43 |
fuser@0.17.0
|
|
44 |
getrandom@0.2.17
|
| 33 |
45 |
glob@0.3.1
|
|
46 |
hashbrown@0.16.1
|
| 34 |
47 |
heck@0.5.0
|
| 35 |
|
home@0.5.9
|
|
48 |
httpdate@1.0.3
|
|
49 |
iana-time-zone-haiku@0.1.2
|
|
50 |
iana-time-zone@0.1.65
|
|
51 |
indexmap@2.13.0
|
| 36 |
52 |
is_terminal_polyfill@1.70.1
|
| 37 |
53 |
itertools@0.12.1
|
| 38 |
|
lazy_static@1.5.0
|
| 39 |
|
lazycell@1.3.0
|
| 40 |
|
libc@0.2.159
|
|
54 |
itoa@1.0.17
|
|
55 |
js-sys@0.3.85
|
|
56 |
libc@0.2.180
|
| 41 |
57 |
libloading@0.8.5
|
| 42 |
58 |
libudev-sys@0.1.4
|
| 43 |
59 |
linux-raw-sys@0.4.14
|
|
60 |
lock_api@0.4.14
|
| 44 |
61 |
log@0.4.22
|
| 45 |
62 |
memchr@2.7.4
|
|
63 |
memoffset@0.9.1
|
| 46 |
64 |
minimal-lexical@0.2.1
|
|
65 |
mio@1.1.1
|
|
66 |
nix@0.30.1
|
| 47 |
67 |
nom@7.1.3
|
|
68 |
num-traits@0.2.19
|
|
69 |
num_enum@0.7.5
|
|
70 |
num_enum_derive@0.7.5
|
| 48 |
71 |
once_cell@1.20.2
|
| 49 |
72 |
owo-colors@4.1.0
|
|
73 |
page_size@0.6.0
|
|
74 |
parking_lot@0.12.5
|
|
75 |
parking_lot_core@0.9.12
|
| 50 |
76 |
paste@1.0.15
|
| 51 |
77 |
pkg-config@0.3.31
|
| 52 |
78 |
prettyplease@0.2.22
|
|
79 |
proc-macro-crate@3.4.0
|
| 53 |
80 |
proc-macro2@1.0.87
|
| 54 |
81 |
quote@1.0.37
|
|
82 |
redox_syscall@0.5.18
|
|
83 |
ref-cast-impl@1.0.25
|
|
84 |
ref-cast@1.0.25
|
| 55 |
85 |
regex-automata@0.4.8
|
| 56 |
86 |
regex-syntax@0.8.5
|
| 57 |
87 |
regex@1.11.0
|
| 58 |
|
rustc-hash@1.1.0
|
|
88 |
rustc-hash@2.1.1
|
| 59 |
89 |
rustix@0.38.37
|
| 60 |
90 |
rustversion@1.0.17
|
|
91 |
ryu@1.0.22
|
|
92 |
scopeguard@1.2.0
|
|
93 |
serde@1.0.228
|
|
94 |
serde_core@1.0.228
|
|
95 |
serde_derive@1.0.228
|
|
96 |
serde_json@1.0.143
|
| 61 |
97 |
shlex@1.3.0
|
|
98 |
signal-hook-mio@0.2.5
|
|
99 |
signal-hook-registry@1.4.8
|
|
100 |
signal-hook@0.3.18
|
|
101 |
smallvec@1.15.1
|
| 62 |
102 |
strsim@0.11.1
|
| 63 |
103 |
strum@0.26.3
|
| 64 |
104 |
strum_macros@0.26.4
|
| 65 |
|
syn@2.0.79
|
|
105 |
syn@2.0.87
|
| 66 |
106 |
terminal_size@0.4.0
|
|
107 |
tiny_http@0.12.0
|
|
108 |
toml_datetime@0.7.5+spec-1.1.0
|
|
109 |
toml_edit@0.23.10+spec-1.0.0
|
|
110 |
toml_parser@1.0.9+spec-1.1.0
|
| 67 |
111 |
udev@0.7.0
|
| 68 |
112 |
unicode-ident@1.0.13
|
| 69 |
113 |
utf8parse@0.2.2
|
| 70 |
114 |
uuid@1.10.0
|
| 71 |
|
which@4.4.2
|
|
115 |
wasi@0.11.1+wasi-snapshot-preview1
|
|
116 |
wasm-bindgen-macro-support@0.2.108
|
|
117 |
wasm-bindgen-macro@0.2.108
|
|
118 |
wasm-bindgen-shared@0.2.108
|
|
119 |
wasm-bindgen@0.2.108
|
| 72 |
120 |
winapi-i686-pc-windows-gnu@0.4.0
|
| 73 |
121 |
winapi-x86_64-pc-windows-gnu@0.4.0
|
| 74 |
122 |
winapi@0.3.9
|
|
123 |
windows-core@0.62.2
|
|
124 |
windows-implement@0.60.2
|
|
125 |
windows-interface@0.59.3
|
|
126 |
windows-link@0.2.1
|
|
127 |
windows-result@0.4.1
|
|
128 |
windows-strings@0.5.1
|
| 75 |
129 |
windows-sys@0.52.0
|
| 76 |
130 |
windows-sys@0.59.0
|
|
131 |
windows-sys@0.61.2
|
| 77 |
132 |
windows-targets@0.52.6
|
| 78 |
133 |
windows_aarch64_gnullvm@0.52.6
|
| 79 |
134 |
windows_aarch64_msvc@0.52.6
|
| ... | ... | |
| 83 |
138 |
windows_x86_64_gnu@0.52.6
|
| 84 |
139 |
windows_x86_64_gnullvm@0.52.6
|
| 85 |
140 |
windows_x86_64_msvc@0.52.6
|
|
141 |
winnow@0.7.14
|
|
142 |
zerocopy-derive@0.8.27
|
|
143 |
zerocopy@0.8.27
|
| 86 |
144 |
zeroize@1.8.1
|
| 87 |
145 |
zeroize_derive@1.4.2
|
| 88 |
146 |
"
|
| 89 |
147 |
|
| 90 |
148 |
LLVM_COMPAT=( {17..21} )
|
|
149 |
MODULES_INITRAMFS_IUSE=+initramfs
|
|
150 |
MODDULES_KERNEL_MIN=6.16
|
| 91 |
151 |
PYTHON_COMPAT=( python3_{11..14} )
|
| 92 |
|
RUST_MIN_VER="1.77.0"
|
|
152 |
RUST_MIN_VER="1.85.0"
|
| 93 |
153 |
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/kentoverstreet.asc
|
| 94 |
154 |
|
| 95 |
|
inherit cargo flag-o-matic llvm-r1 python-any-r1 shell-completion toolchain-funcs unpacker verify-sig
|
|
155 |
inherit cargo flag-o-matic linux-mod-r1 llvm-r2 multiprocessing python-any-r1
|
|
156 |
inherit shell-completion sysroot toolchain-funcs unpacker verify-sig
|
| 96 |
157 |
|
| 97 |
158 |
DESCRIPTION="Tools for bcachefs"
|
| 98 |
159 |
HOMEPAGE="https://bcachefs.org/"
|
| ... | ... | |
| 112 |
173 |
# Dependent crate licenses
|
| 113 |
174 |
LICENSE+=" Apache-2.0 BSD ISC MIT Unicode-DFS-2016"
|
| 114 |
175 |
SLOT="0"
|
| 115 |
|
IUSE="fuse verify-sig"
|
|
176 |
IUSE="debug verify-sig +modules"
|
| 116 |
177 |
RESTRICT="test"
|
| 117 |
178 |
|
| 118 |
179 |
DEPEND="
|
| ... | ... | |
| 125 |
186 |
sys-apps/util-linux
|
| 126 |
187 |
virtual/zlib:=
|
| 127 |
188 |
virtual/udev
|
| 128 |
|
fuse? ( >=sys-fs/fuse-3.7.0:3= )
|
| 129 |
189 |
"
|
| 130 |
190 |
|
| 131 |
191 |
RDEPEND="${DEPEND}"
|
| ... | ... | |
| 142 |
202 |
')
|
| 143 |
203 |
elibc_musl? ( >=sys-libs/musl-1.2.5 )
|
| 144 |
204 |
virtual/pkgconfig
|
|
205 |
modules? ( >=sys-kernel/linux-headers-6.16.0 )
|
| 145 |
206 |
verify-sig? ( >=sec-keys/openpgp-keys-kentoverstreet-20241012 )
|
| 146 |
207 |
"
|
| 147 |
208 |
|
| ... | ... | |
| 152 |
213 |
}
|
| 153 |
214 |
|
| 154 |
215 |
pkg_setup() {
|
| 155 |
|
rust_pkg_setup
|
| 156 |
|
llvm-r1_pkg_setup
|
|
216 |
llvm-r2_pkg_setup
|
| 157 |
217 |
python-any-r1_pkg_setup
|
|
218 |
rust_pkg_setup
|
|
219 |
if use modules; then
|
|
220 |
# grep -r 'depends on\|select ' ${S}/libbcachefs/Kconfig | grep -v '^#'
|
|
221 |
local CONFIG_CHECK="
|
|
222 |
!BCACHEFS_FS
|
|
223 |
BLOCK
|
|
224 |
EXPORTFS
|
|
225 |
CRC32
|
|
226 |
CRC64
|
|
227 |
FS_POSIX_ACL
|
|
228 |
LZ4_COMPRESS
|
|
229 |
LZ4_DECOMPRESS
|
|
230 |
LZ4HC_COMPRESS
|
|
231 |
ZLIB_DEFLATE
|
|
232 |
ZLIB_INFLATE
|
|
233 |
ZSTD_COMPRESS
|
|
234 |
ZSTD_DECOMPRESS
|
|
235 |
CRYPTO_LIB_SHA256
|
|
236 |
CRYPTO_LIB_CHACHA
|
|
237 |
CRYPTO_LIB_POLY1305
|
|
238 |
KEYS
|
|
239 |
RAID6_PQ
|
|
240 |
RUST
|
|
241 |
XOR_BLOCKS
|
|
242 |
XXHASH
|
|
243 |
SYMBOLIC_ERRNAME
|
|
244 |
"
|
|
245 |
use debug && CONFIG_CHECK+="
|
|
246 |
DEBUG_INFO
|
|
247 |
FRAME_POINTER
|
|
248 |
!DEBUG_INFO_REDUCED
|
|
249 |
"
|
|
250 |
linux-mod-r1_pkg_setup
|
|
251 |
fi
|
| 158 |
252 |
}
|
| 159 |
253 |
|
| 160 |
254 |
src_unpack() {
|
| 161 |
|
# Upstream signs the uncompressed tarball
|
| 162 |
|
if use verify-sig; then
|
| 163 |
|
einfo "Unpacking ${P}.tar.zst ..."
|
| 164 |
|
verify-sig_verify_detached - "${DISTDIR}"/${P}.tar.sign \
|
| 165 |
|
< <(zstd -fdc "${DISTDIR}"/${P}.tar.zst | tee >(tar -xf -))
|
| 166 |
|
assert "Unpack failed"
|
| 167 |
|
fi
|
| 168 |
|
|
| 169 |
255 |
if [[ ${PV} == "9999" ]]; then
|
| 170 |
256 |
git-r3_src_unpack
|
| 171 |
|
S="${S}/rust-src" cargo_live_src_unpack
|
|
257 |
S="${S}/src" cargo_live_src_unpack
|
| 172 |
258 |
else
|
|
259 |
# Upstream signs the uncompressed tarball
|
|
260 |
if use verify-sig; then
|
|
261 |
einfo "Unpacking ${P}.tar.zst ..."
|
|
262 |
verify-sig_verify_detached - "${DISTDIR}"/${P}.tar.sign \
|
|
263 |
< <(zstd -fdc "${DISTDIR}"/${P}.tar.zst | tee >(tar -xf -))
|
|
264 |
assert "Unpack failed"
|
|
265 |
fi
|
| 173 |
266 |
unpacker ${P}.tar.zst
|
| 174 |
267 |
cargo_src_unpack
|
| 175 |
268 |
fi
|
| ... | ... | |
| 188 |
281 |
append-lfs-flags
|
| 189 |
282 |
}
|
| 190 |
283 |
|
|
284 |
src_configure() {
|
|
285 |
cargo_src_configure
|
|
286 |
use modules && emake DESTDIR="${WORKDIR}" PREFIX="/module" install_dkms
|
|
287 |
}
|
|
288 |
|
| 191 |
289 |
src_compile() {
|
| 192 |
|
use fuse && export BCACHEFS_FUSE=1
|
| 193 |
290 |
export BUILD_VERBOSE=1
|
| 194 |
291 |
export VERSION=${PV}
|
| 195 |
292 |
|
| 196 |
|
default
|
| 197 |
|
|
| 198 |
|
# This version mangles the symbolic link,
|
| 199 |
|
# please check if this can be removed before bumping
|
| 200 |
|
rm "${S}"/bcachefs
|
| 201 |
|
ln -s "${S}"/target/release/bcachefs bcachefs
|
|
293 |
local module_s="module/src/${PN%-*}-${PV}"
|
|
294 |
local modlist=( "bcachefs=:../${module_s}:../${module_s}/src/fs/bcachefs" )
|
|
295 |
local modargs=(
|
|
296 |
KDIR=${KV_OUT_DIR}
|
|
297 |
)
|
|
298 |
|
|
299 |
# Makefile calls `cargo` directly, so make sure we set our rustflags (etc)
|
|
300 |
cargo_env emake -j$(get_makeopts_jobs) bcachefs || die
|
|
301 |
use modules && linux-mod-r1_src_compile
|
|
302 |
|
|
303 |
# Recent versions mangle the 'bcachefs' symbolic link, work around it.
|
|
304 |
[[ -e bcachefs ]] && die "bcachefs symlink is valid, please remove workaround"
|
|
305 |
ln -rsf target/release/bcachefs bcachefs || die
|
| 202 |
306 |
|
| 203 |
307 |
local shell
|
| 204 |
308 |
for shell in bash fish zsh; do
|
| 205 |
|
./bcachefs completions ${shell} > ${shell}.completion || die
|
|
309 |
sysroot_try_run_prefixed ./bcachefs completions ${shell} > ${shell}.completion || die
|
| 206 |
310 |
done
|
| 207 |
311 |
}
|
| 208 |
312 |
|
| ... | ... | |
| 214 |
318 |
dosym bcachefs /sbin/mkfs.bcachefs
|
| 215 |
319 |
dosym bcachefs /sbin/mount.bcachefs
|
| 216 |
320 |
|
| 217 |
|
if use fuse; then
|
| 218 |
|
dosym bcachefs /sbin/fsck.fuse.bcachefs
|
| 219 |
|
dosym bcachefs /sbin/mkfs.fuse.bcachefs
|
| 220 |
|
dosym bcachefs /sbin/mount.fuse.bcachefs
|
| 221 |
|
fi
|
|
321 |
# Uses a crate-based implementation of FUSE, no dependency on sys-fs/fuse and unconditionally included.
|
|
322 |
dosym bcachefs /sbin/fsck.fuse.bcachefs
|
|
323 |
dosym bcachefs /sbin/mkfs.fuse.bcachefs
|
|
324 |
dosym bcachefs /sbin/mount.fuse.bcachefs
|
| 222 |
325 |
|
| 223 |
326 |
newbashcomp bash.completion bcachefs
|
| 224 |
327 |
newfishcomp fish.completion bcachefs.fish
|
| 225 |
328 |
newzshcomp zsh.completion _bcachefs
|
| 226 |
329 |
|
| 227 |
330 |
doman bcachefs.8
|
| 228 |
|
}
|
| 229 |
331 |
|
| 230 |
|
pkg_postinst() {
|
| 231 |
|
if use fuse; then
|
| 232 |
|
ewarn "FUSE support is experimental."
|
| 233 |
|
ewarn "Please only use it for development purposes at the risk of losing your data."
|
| 234 |
|
ewarn "You have been warned."
|
| 235 |
|
fi
|
|
332 |
use modules && linux-mod-r1_src_install
|
| 236 |
333 |
}
|