# Maintainer: Natanael Copa pkgname=valgrind pkgver=3.8.1 pkgrel=0 pkgdesc="A tool to help find memory-management problems in programs" url="http://valgrind.org/" arch="all" 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 uclibc.patch valgrind-3.8.1-glibc-2.17.patch" _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" export CFLAGS="$CFLAGS -fno-stack-protector -fno-pie" ./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 if [ -z "$DEBUG" ]; then strip "$pkgdir"/usr/bin/valgrind \ "$pkgdir"/usr/bin/no_op_client_for_valgrind \ "$pkgdir"/usr/bin/valgrind-listener \ "$pkgdir"/usr/bin/cg_merge fi # pax causes some issues # http://marc.info/?l=gentoo-hardened&m=119512627126298&w=2 # http://bugs.alpinelinux.org/issues/999 paxctl -c -m "$pkgdir"/usr/lib/valgrind/*-*-linux } md5sums="288758010b271119a0ffc0183f1d6e38 valgrind-3.8.1.tar.bz2 c29b4572a070eb0d3a6a977be586c771 uclibc.patch ee22605621de2672e517f37c2ff22f2d valgrind-3.8.1-glibc-2.17.patch"