aboutsummaryrefslogtreecommitdiff
blob: 720da66cc32d0fe465e23f8ce314c026be630ee2 (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
40
41
42
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

src_prepare() {
	default

	tc-export CC
	sed \
		-e '/^CFLAGS/s:-O2::' \
		-e '/^CFLAGS/s:-g::' \
		-e '/.*INSTALL.*share\/man/d' \
		-e '/.*INSTALL.*bcache-status/d' \
		-i Makefile || die

	append-lfs-flags
}

src_configure() {
	append-ldflags -static
}

src_compile() {
	PKG_CONFIG="$(tc-getPKG_CONFIG) --static" \
	gkmake V=1
}

src_install() {
	mkdir -p "${D}"/usr/sbin "${D}$(get_udevdir)"/rules.d
	gkmake V=1 UDEVLIBDIR="$(get_udevdir)" DESTDIR="${D}" install

	rm -rf \
		"${D}"/lib \
		"${D}"/usr/lib/initcpio \
		"${D}"/usr/sbin \
		"${D}"/usr/share

	"${STRIP}" --strip-all "${D}"/usr/lib/udev/bcache-register \
		|| die "Failed to strip '${D}/usr/lib/udev/bcache-register'!"

	"${STRIP}" --strip-all "${D}"/usr/lib/udev/probe-bcache \
		|| die "Failed to strip '${D}/usr/lib/udev/probe-bcache'!"
}