aboutsummaryrefslogtreecommitdiff
blob: 48b9e6dce21b73c509b557e107bbbfbae0b76b8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

src_configure() {
	local myconf=(
		--bindir="/sbin"
		--disable-shared
		--disable-convert
		--disable-python
		--disable-documentation
	)

	if isTrue "$(is_glibc)"
	then
		myconf+=( --enable-backtrace )
	else
		# backtrace does not work on musl, bug #815676
		myconf+=( --disable-backtrace )
	fi

	gkconf "${myconf[@]}"
}

src_compile() {
	gkmake V=1 static
}

src_install() {
	mkdir "${D}"/sbin || die "Failed to create '${D}/sbin'!"

	cp -a btrfs.static "${D}"/sbin/btrfs \
		|| die "Failed to copy '${S}/btrfs.static' to '${D}/sbin/btrfs'!"

	"${STRIP}" --strip-all "${D}"/sbin/btrfs \
		|| die "Failed to strip '${D}/sbin/btrfs'!"

	ln -s btrfs "${D}"/sbin/btrfsck \
		|| die "Failed to create symlink '${D}/sbin/btrfsck' to '${D}/sbin/btrfs'!"
}