aboutsummaryrefslogtreecommitdiffstats
path: root/main/valgrind/APKBUILD
blob: b9b207b6668e48a4455ae2caace2ad53676bc2e8 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=valgrind
pkgver=3.6.0
pkgrel=0
pkgdesc="A tool to help find memory-management problems in programs"
url="http://valgrind.org/"
license="GPL"
depends=""
# it seems like busybox sed works but the configure script requires GNU sed
makedepends="sed paxctl pax-utils perl bash"
# 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"
subpackages="$pkgname-dev $pkgname-doc"
source="http://$pkgname.org/downloads/$pkgname-$pkgver.tar.bz2
	"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$_builddir"
	local i
	for i in "$srcdir"/*.patch; do
		[ -f "$i" ] || continue
		msg "Applying $i"
		patch -p1 < $i || return 1
	done
}

build() {
	cd "$_builddir"
	# fails to build with ccache
	export CC="gcc"
	./configure --prefix=/usr \
		 --without-mpicc \
		--mandir=/usr/share/man || return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1

	# we have options=!strip above so we strip the /usr/bin/* manually
	strip "$pkgdir"/usr/bin/valgrind \
		"$pkgdir"/usr/bin/no_op_client_for_valgrind \
		"$pkgdir"/usr/bin/valgrind-listener \
		"$pkgdir"/usr/bin/cg_merge 

	# pax causes some issues
	# http://marc.info/?l=gentoo-hardened&m=119512627126298&w=2
#	scanelf "$pkgdir"/usr/lib/valgrind/x86-linux \
#		| awk '$1 == "ET_EXEC" {print $2}' | xargs paxctl -c -m

}

md5sums="b289c5f4ab8e39741602445f1dd09b34  valgrind-3.6.0.tar.bz2"