summaryrefslogtreecommitdiff
path: root/user/valgrind/APKBUILD
blob: 77772afc9d1b780f4caaf9a74bec2e5545848062 (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
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=valgrind
pkgver=3.19.0
pkgrel=0
pkgdesc="A tool to help find memory-management problems in programs"
url="http://valgrind.org/"
arch="all"
# 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"
license="GPL-2.0+"
depends=""
makedepends="autoconf automake libtool bash perl cmd:which"
subpackages="$pkgname-dev $pkgname-doc"
source="ftp://sourceware.org/pub/$pkgname/$pkgname-$pkgver.tar.bz2
	0001-Ensure-ELFv2-is-supported-on-PPC64.patch
	arm.patch
	ppc64-support-tkill.patch
	realloc.patch
	"

prepare() {
	default_prepare
	aclocal && autoconf && automake --add-missing
	echo '#include <linux/a.out.h>' > include/a.out.h
}

build() {
	# 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() {
	make check
}

package() {
	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="f720a89dc4c4989cc5714bff9efe97529f71990bcfad7a92b889ce099c4326d6da07fa4d5fbab2e9125e20f352354f6178471e49e419b613a3c82c2a1c667ab2  valgrind-3.19.0.tar.bz2
f90aa3cef5d3561d4602ff63b8f355b8427cbe6bb2ecd6bfc2e2bb063915fa40a70d923dbc60a643ee3fb7bcfbbddac049c6f6133c541189dd82b891f7ad9dbc  0001-Ensure-ELFv2-is-supported-on-PPC64.patch
9ee297d1b2b86891584443ad0caadc4977e1447979611ccf1cc55dbee61911b0b063bc4ad936d86c451cedae410cb3219b5a088b2ad0aa17df182d564fe36cfe  arm.patch
daf819d0f9bbbaf4243c7bf931fed840f1f55304df1b45d4a72ceaf8403b8e0e1fc8079343b86106f0741aa812560a466389d7d3878c5547f3ff7a9e46e63df7  ppc64-support-tkill.patch
57086a768f3876b26b0e507bc159a73f0955f03d5af8cc30e21103e348ca67f2e58b5555a5a97f299751c6602692ad43d8346bb68a80917d740fb4d65bba9665  realloc.patch"