2018-01-06 20:32:44 +00:00
|
|
|
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
|
|
|
|
# Contributor: Dan McGee <dan@archlinux.org>
|
|
|
|
# Contributor: Allan McRae <allan@archlinux.org>
|
2012-06-06 20:28:35 +00:00
|
|
|
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
2015-10-27 03:46:58 +00:00
|
|
|
# - hold for toolchain update, only build for v7/v8
|
2017-10-27 13:03:57 +00:00
|
|
|
# - patch from Fedora for AArch64
|
2018-01-06 20:32:44 +00:00
|
|
|
# - removed lib32 package make/optdepends
|
2013-08-15 12:37:29 +00:00
|
|
|
|
2015-10-27 03:46:58 +00:00
|
|
|
buildarch=12
|
2018-01-06 20:32:44 +00:00
|
|
|
#noautobuild=1
|
2014-02-10 04:08:27 +00:00
|
|
|
|
2012-06-06 20:28:35 +00:00
|
|
|
pkgname=valgrind
|
2018-10-24 23:31:02 +00:00
|
|
|
_commit=3a3000290b4af0e8ef9880293c54659a6819ba78
|
|
|
|
pkgver=3.14.0
|
2018-08-24 05:23:52 +00:00
|
|
|
pkgrel=1
|
2018-01-06 20:32:44 +00:00
|
|
|
pkgdesc='Tool to help find memory-management problems in programs'
|
|
|
|
arch=('x86_64')
|
|
|
|
license=('GPL')
|
2014-04-06 02:27:51 +00:00
|
|
|
url='http://valgrind.org/'
|
2018-04-24 12:17:36 +00:00
|
|
|
depends=('glibc' 'perl')
|
2018-08-24 05:23:52 +00:00
|
|
|
makedepends=('gdb' 'openmpi' 'git' 'docbook-xml'
|
|
|
|
'docbook-xsl' 'docbook-sgml')
|
2018-01-06 20:32:44 +00:00
|
|
|
checkdepends=('procps-ng')
|
2014-09-19 19:17:55 +00:00
|
|
|
optdepends=('openmpi: MPI support')
|
2018-01-06 20:32:44 +00:00
|
|
|
provides=('valgrind-multilib')
|
|
|
|
replaces=('valgrind-multilib')
|
|
|
|
options=('!emptydirs' '!strip')
|
2018-10-24 23:31:02 +00:00
|
|
|
source=("git+http://repo.or.cz/valgrind.git#commit=$_commit"
|
2018-01-06 20:32:44 +00:00
|
|
|
valgrind-3.7.0-respect-flags.patch
|
|
|
|
valgrind-3.13.0-arm64-hwcap.patch)
|
2018-08-24 05:23:52 +00:00
|
|
|
md5sums=('SKIP'
|
2018-01-06 20:32:44 +00:00
|
|
|
'470d9881870aacc210b7a6efb64cc9a9'
|
2017-10-27 13:03:57 +00:00
|
|
|
'b7c24e58fa058578c9bf6fef4ccdd47d')
|
2018-08-24 05:23:52 +00:00
|
|
|
sha512sums=('SKIP'
|
2018-01-06 20:32:44 +00:00
|
|
|
'e0cec39381cefeca09ae4794cca309dfac7c8693e6315e137e64f5c33684598726d41cfbb4edf764fe985503b13ff596184ca5fc32b159d500ec092e4cf8838c'
|
2017-10-27 13:03:57 +00:00
|
|
|
'5af853399c6abdf8016fd1c2be854b3952b7d7e9ca16c870f84eed72e606e639d5f64de32e60105899f5201b53156380ae460111e05209e843301492742c9bfd')
|
|
|
|
|
2018-08-24 05:23:52 +00:00
|
|
|
pkgver() {
|
|
|
|
cd valgrind
|
2018-10-24 23:31:02 +00:00
|
|
|
git describe --tags --always|sed -e 's|-|+|g' -e 's|VALGRIND_||g' -e 's|_|.|g'
|
2018-08-24 05:23:52 +00:00
|
|
|
}
|
|
|
|
|
2017-10-27 13:03:57 +00:00
|
|
|
prepare() {
|
2018-08-24 05:23:52 +00:00
|
|
|
cd valgrind
|
2018-01-06 20:32:44 +00:00
|
|
|
patch -Np1 < ../valgrind-3.7.0-respect-flags.patch
|
|
|
|
patch -Np1 < ../valgrind-3.13.0-arm64-hwcap.patch
|
2018-08-24 05:23:52 +00:00
|
|
|
sed -i 's|sgml/docbook/xsl-stylesheets|xml/docbook/xsl-stylesheets-1.79.2|' docs/Makefile.am
|
|
|
|
|
|
|
|
autoreconf -ifv
|
2017-10-27 13:03:57 +00:00
|
|
|
}
|
2014-02-10 04:08:27 +00:00
|
|
|
|
|
|
|
build() {
|
2017-03-11 03:43:42 +00:00
|
|
|
# valgrind does not like stack protector flags
|
|
|
|
CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
|
2018-01-06 20:32:44 +00:00
|
|
|
CFLAGS=${CFLAGS/-fstack-protector-strong -fno-plt/}
|
|
|
|
CXXFLAGS=${CXXFLAGS/-fstack-protector-strong -fno-plt/}
|
2015-10-02 00:26:51 +00:00
|
|
|
|
2018-08-24 05:23:52 +00:00
|
|
|
cd valgrind
|
2018-01-06 20:32:44 +00:00
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--with-mpicc=mpicc
|
2012-06-06 20:28:35 +00:00
|
|
|
make
|
2018-08-24 05:23:52 +00:00
|
|
|
make -C docs man-pages
|
2012-06-06 20:28:35 +00:00
|
|
|
}
|
|
|
|
|
2018-01-06 20:32:44 +00:00
|
|
|
check() {
|
2018-08-24 05:23:52 +00:00
|
|
|
cd valgrind
|
2018-01-06 20:32:44 +00:00
|
|
|
|
|
|
|
# Make sure a basic binary runs. There should be no errors.
|
|
|
|
./vg-in-place --error-exitcode=1 /bin/true
|
|
|
|
|
|
|
|
# Make sure no extra CFLAGS, CXXFLAGS or LDFLAGS leak through,
|
|
|
|
# the testsuite sets all flags necessary. See also configure above.
|
|
|
|
make check CFLAGS="" CXXFLAGS="" LDFLAGS=""
|
|
|
|
|
|
|
|
# XXX: run full regtest but only report issues some tests fail duo
|
|
|
|
# current toolchain and expectations, take a manual look if its fine
|
|
|
|
echo ===============TESTING===================
|
|
|
|
make regtest || :
|
|
|
|
|
|
|
|
# Make sure test failures show up in build.log
|
|
|
|
# Gather up the diffs (at most the first 20 lines for each one)
|
|
|
|
MAX_LINES=20
|
|
|
|
diff_files=$(find . -name '*.diff' | sort)
|
|
|
|
if [ z"${diff_files}" = z ] ; then
|
|
|
|
echo "Congratulations, all tests passed!"
|
|
|
|
else
|
|
|
|
warning "Some tests failed!"
|
|
|
|
for f in ${diff_files} ; do
|
|
|
|
echo "=================================================" >> diffs
|
|
|
|
echo "${f}" >> diffs
|
|
|
|
echo "=================================================" >> diffs
|
|
|
|
if [ "$(wc -l < "${f}")" -le ${MAX_LINES} ] ; then
|
|
|
|
cat "${f}" >> diffs
|
|
|
|
else
|
|
|
|
head -n ${MAX_LINES} "${f}" >> diffs
|
|
|
|
echo "<truncated beyond ${MAX_LINES} lines>" >> diffs
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
cat diffs
|
|
|
|
echo ===============END TESTING===============
|
|
|
|
}
|
|
|
|
|
2012-06-06 20:28:35 +00:00
|
|
|
package() {
|
2018-08-24 05:23:52 +00:00
|
|
|
cd valgrind
|
2018-01-06 20:32:44 +00:00
|
|
|
make DESTDIR="${pkgdir}" install
|
2018-08-24 05:23:52 +00:00
|
|
|
|
|
|
|
install -d "$pkgdir/usr/share/man/man1"
|
|
|
|
install -m644 docs/*.1 -t "$pkgdir/usr/share/man/man1"
|
|
|
|
|
|
|
|
if check_option 'debug' n; then
|
|
|
|
find "${pkgdir}/usr/bin" -type f -executable -exec strip $STRIP_BINARIES {} + || true
|
|
|
|
fi
|
2012-06-06 20:28:35 +00:00
|
|
|
}
|
2018-01-06 20:32:44 +00:00
|
|
|
|
|
|
|
# vim: ts=2 sw=2 et:
|