archrelease: copy trunk to extra-x86_64
[arch-packages.git] / valgrind / repos / extra-x86_64 / PKGBUILD
blob4128d5c749ae45b06cef1cfe08fa5c82f0315be9
1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Contributor: Dan McGee <dan@archlinux.org>
3 # Contributor: Allan McRae <allan@archlinux.org>
5 pkgname=valgrind
6 pkgver=3.19.0
7 pkgrel=1
8 pkgdesc='Tool to help find memory-management problems in programs'
9 arch=('x86_64')
10 license=('GPL')
11 url='http://valgrind.org/'
12 depends=('glibc' 'perl')
13 makedepends=('gdb' 'lib32-glibc' 'lib32-gcc-libs' 'docbook-xml'
14              'docbook-xsl' 'docbook-sgml')
15 checkdepends=('procps-ng')
16 optdepends=('lib32-glibc: 32-bit ABI support')
17 provides=('valgrind-multilib')
18 replaces=('valgrind-multilib')
19 options=('!emptydirs' '!strip')
20 source=(https://sourceware.org/pub/valgrind/valgrind-${pkgver}.tar.bz2{,.asc}
21         valgrind-3.7.0-respect-flags.patch)
22 validpgpkeys=(
23   0E9FFD0C16A1856CF9C7C690BA0166E698FA6035 # Julian Seward <jseward@acm.org>
24   EC3CFE88F6CA0788774F5C1D1AA44BE649DE760A # Mark Wielaard <mjw@gnu.org>
26 sha512sums=('f720a89dc4c4989cc5714bff9efe97529f71990bcfad7a92b889ce099c4326d6da07fa4d5fbab2e9125e20f352354f6178471e49e419b613a3c82c2a1c667ab2'
27             'SKIP'
28             'e0cec39381cefeca09ae4794cca309dfac7c8693e6315e137e64f5c33684598726d41cfbb4edf764fe985503b13ff596184ca5fc32b159d500ec092e4cf8838c')
29 b2sums=('d3ccd25789ec4d87a0ddab58d8098246a33a083505b42adaa94ee3af659cbe073e516bc98163ef56233e6cd9de2125839b71ee443fbc0db6557dcb35a6c05280'
30         'SKIP'
31         'af556fdf3c02e37892bfe9afebc954cf2f1b2fa9b75c1caacfa9f3b456ebc02bf078475f9ee30079b3af5d150d41415a947c3d04235c1ea8412cf92b959c484a')
32 options=(!lto) # https://bugs.kde.org/show_bug.cgi?id=338252
34 prepare() {
35   cd valgrind-${pkgver}
36   patch -Np1 < ../valgrind-3.7.0-respect-flags.patch
37   sed -i 's|sgml/docbook/xsl-stylesheets|xml/docbook/xsl-stylesheets-1.79.2-nons|' docs/Makefile.am
39   autoreconf -ifv
42 build() {
43   # valgrind does not like some of our flags
44   CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
45   CFLAGS=${CFLAGS/-fno-plt/}
46   CXXFLAGS=${CXXFLAGS/-fno-plt/}
48   cd valgrind-${pkgver}
49   ./configure \
50     --prefix=/usr \
51     --sysconfdir=/etc \
52     --localstatedir=/var \
53     --libexecdir=/usr/lib \
54     --mandir=/usr/share/man
55   make
56   make -C docs man-pages
59 check() {
60   cd valgrind-${pkgver}
62   # Make sure a basic binary runs. There should be no errors.
63   ./vg-in-place --error-exitcode=1 /bin/true
65   # Make sure no extra FLAGS leak through, the testsuite
66   # sets all flags necessary. See also configure above.
67   make check CPPFLAGS= CFLAGS= CXXFLAGS= LDFLAGS=
69   # XXX: run full regtest but only report issues some tests fail duo
70   # current toolchain and expectations, take a manual look if its fine
71   #echo "===============TESTING==================="
72   #make regtest || true
74   # Make sure test failures show up in build.log
75   # Gather up the diffs (at most the first 20 lines for each one)
76   #local f max_lines=20 diff_files=()
77   #mapfile -d '' diff_files < <(find . -name '*.diff' -print0 | sort -z)
78   #if (( ${#diff_files[@]} == 0 )); then
79     #echo "Congratulations, all tests passed!"
80   #else
81     #warning "Some tests failed!"
82     #for f in "${diff_files[@]}"; do
83         #echo "================================================="
84         #echo "${f}"
85         #echo "================================================="
86         #if (( $(wc -l < "${f}") < ${max_lines} )); then
87           #cat "${f}"
88         #else
89           #head -n ${max_lines} "${f}"
90           #echo "<truncated beyond ${max_lines} lines>"
91         #fi
92     #done | tee diffs
93   #fi
94   #echo "===============END TESTING==============="
97 package() {
98   cd valgrind-${pkgver}
99   make DESTDIR="${pkgdir}" install
101   install -Dm644 docs/*.1 -t "$pkgdir/usr/share/man/man1"
103   if check_option 'debug' n; then
104     find "${pkgdir}/usr/bin" -type f -executable -exec strip $STRIP_BINARIES {} + || :
105   fi
108 # vim: ts=2 sw=2 et: