aboutsummaryrefslogtreecommitdiffstats
path: root/main/valgrind/APKBUILD
blob: bbc58ee123903ba19c260e5bec933143572a4a0a (plain) (blame)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=valgrind
pkgver=3.17.0
pkgrel=1
pkgdesc="A tool to help find memory-management problems in programs"
url="https://valgrind.org/"
arch="all !mips64 !riscv64" # TODO: fix with mips64 softfloat
license="GPL-2.0-or-later"
# it seems like busybox sed works but the configure script requires GNU sed
makedepends="sed perl bash autoconf automake libtool"
# from README_PACKAGERS:
#   Don't strip the debug info off lib/valgrind/$platform/vgpreload*.so
#   in the installation tree.  Either Valgrind won't work at all, or it
#   will still work if you do, but will generate less helpful error
#   messages.
options="!strip !check"
subpackages="$pkgname-dev $pkgname-doc"
source="https://sourceware.org/pub/valgrind/valgrind-$pkgver.tar.bz2
	musl.supp
	uclibc.patch
	arm.patch
	valgrind-3.13.0-malloc.patch
	"
builddir="$srcdir"/$pkgname-$pkgver

prepare() {
	default_prepare
	cd "$builddir"
	cp "$srcdir"/musl.supp .
	aclocal && autoconf && automake --add-missing
	echo '#include <linux/a.out.h>' > include/a.out.h
}

build() {
	cd "$builddir"
	# fails to build with ccache
	export CC="gcc"
	export CFLAGS="$CFLAGS -fno-stack-protector -no-pie"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--without-mpicc
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install

	# we have options=!strip above so we strip the /usr/bin/* manually
	if [ -z "$DEBUG" ]; then
		strip "$pkgdir"/usr/bin/valgrind \
			"$pkgdir"/usr/bin/valgrind-di-server \
			"$pkgdir"/usr/bin/vgdb \
			"$pkgdir"/usr/bin/valgrind-listener \
			"$pkgdir"/usr/bin/cg_merge
	fi
}

sha512sums="94de78942a7059e1ab84d1c0c0b8f3efd1c2d15c70b97bc7edc8136812778adb6f8187149d53a60a8c6a7c8b40534f9be5cfed0eb3c0c314545b681f950b108f  valgrind-3.17.0.tar.bz2
49df485f158a7f4d354b2ed0d46dcc691f0490f50913c83dabfdd513b47ef1045f140fd59f54b560df05e4f3a4aba63de7124553b396189fa3ac89c908831e45  musl.supp
d59a10db9037e120df2ee94a103402ca95a79abee9d8be63e4e1bca29c82dca775cc402a79b854ec11a2160a4d2da202c237369418e221d1925267ea2613fd5d  uclibc.patch
9ee297d1b2b86891584443ad0caadc4977e1447979611ccf1cc55dbee61911b0b063bc4ad936d86c451cedae410cb3219b5a088b2ad0aa17df182d564fe36cfe  arm.patch
57086a768f3876b26b0e507bc159a73f0955f03d5af8cc30e21103e348ca67f2e58b5555a5a97f299751c6602692ad43d8346bb68a80917d740fb4d65bba9665  valgrind-3.13.0-malloc.patch"