# Maintainer: Jesus E. pkgname=valgrind pkgver=3.16.1 pkgrel=1 _debver=3.16.1 _debrel=1 pkgdesc='Tool to help find memory management problems in programs' arch=('x86_64' 'i686') license=('GPL-2') url="https://valgrind.org/" depends=('glibc' 'perl') makedepends=('gdb' 'docbook-xml' 'docbook-xsl' 'quilt') options=('!emptydirs' '!strip') source=("https://sourceware.org/pub/${pkgname}/${pkgname}-${pkgver}.tar.bz2"{,.asc} "https://deb.debian.org/debian/pool/main/${pkgname::1}/${pkgname}/${pkgname}_${_debver}-${_debrel}.debian.tar.xz") sha512sums=('2a4173efe1b6facdd2f5c5ee8ed006704168eba1813736fccc8191d60363afd96197512cf42037e65f18d4ddd49adc74a54c47210df216fba3c46bf68ef0f950' 'SKIP' '65d5c08d8d188c458f2379135e58906f3b5c0edf84a6ec93471ec6a952e387d1c85e845c1ecee10ab3d09a750457d1e0f7fd65f1ebb603435d39d70640fd4665') validpgpkeys=('0E9FFD0C16A1856CF9C7C690BA0166E698FA6035') # Julian Seward prepare() { cd ${pkgname}-${pkgver} if [[ ${pkgver%.*} = ${_debver%.*} ]]; then # Debian patches export QUILT_PATCHES=debian/patches export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index" export QUILT_DIFF_ARGS="--no-timestamps" mv "$srcdir"/debian . # Doesn't apply rm -v debian/patches/04_workaround-SIGSEGV-on-PPC.patch || true rm -v debian/patches/10_mpi-pkg-config.patch || true rm -v debian/patches/11_arm64-cache-flush.patch || true quilt push -av fi sed -i 's#sgml/docbook/xsl-stylesheets#xml/docbook/xsl-stylesheets-1.79.2-nons#' docs/Makefile.am autoreconf -fiv } build() { cd ${pkgname}-${pkgver} # Valgrind doesn't like some of our flags. CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/} # Resolve building issue that disables stack-smashing protector flag. CFLAGS="${CFLAGS/-fno-plt/} -fno-stack-protector" CXXFLAGS="${CXXFLAGS/-fno-plt/} -fno-stack-protector" ./configure \ --prefix=/usr \ --libexecdir=/usr/libexec \ --mandir=/usr/share/man \ --sysconfdir=/etc \ --localstatedir=/var make VERBOSE=1 make VERBOSE=1 -C docs man-pages } package() { cd ${pkgname}-${pkgver} make DESTDIR=${pkgdir} VERBOSE=1 install if check_option 'debug' n; then find "${pkgdir}/usr/bin" -type f -executable -exec strip $STRIP_BINARIES {} + || : fi # Install manual and license install -Dvm644 docs/*.1 -t ${pkgdir}/usr/share/man/man1 install -Dvm644 COPYING{,.DOCS} -t ${pkgdir}/usr/share/licenses/${pkgname} }