aboutsummaryrefslogtreecommitdiff
blob: b16379f8c35cbf44cb25bc5e884b87f6dea92923 (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
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

src_prepare() {
	default

	# Force static programs
	find -name Makefile -exec \
		sed -i -r -e 's/-static(-libtool-libs)?/-all-static/' {} +
}

src_configure() {
	export DEBUG=-DNDEBUG
	export OPTIMIZER=${CFLAGS}
	unset PLATFORM # if set in user env, this breaks configure

	local myconf=(
		--enable-blkid
		--disable-libicu
		--disable-gettext
		--disable-readline
		--disable-editline
		--disable-scrub
	)

	gkconf "${myconf[@]}"
}

src_compile() {
	gkmake V=1 headers repair
}

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

	cp repair/xfs_repair "${D}"/sbin \
		|| die "Failed to copy '${S}/repair/xfs_repair' to '${D}/sbin/'!"

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