extra/valgrind to 3.15.0-1

This commit is contained in:
Kevin Mihelich 2019-10-06 15:28:10 +00:00
parent ee22451dcf
commit 44e1d40846

View file

@ -8,25 +8,24 @@
# - removed lib32 package make/optdepends # - removed lib32 package make/optdepends
buildarch=12 buildarch=12
#noautobuild=1 noautobuild=1
pkgname=valgrind pkgname=valgrind
_commit=3a3000290b4af0e8ef9880293c54659a6819ba78 _commit=608cb11914e5f23d0fc12c61dad29c5c7952a1de # tags/VALGRIND_3_15_0^0
pkgver=3.14.0 pkgver=3.15.0
pkgrel=1 pkgrel=1
pkgdesc='Tool to help find memory-management problems in programs' pkgdesc='Tool to help find memory-management problems in programs'
arch=('x86_64') arch=('x86_64')
license=('GPL') license=('GPL')
url='http://valgrind.org/' url='http://valgrind.org/'
depends=('glibc' 'perl') depends=('glibc' 'perl')
makedepends=('gdb' 'openmpi' 'git' 'docbook-xml' makedepends=('gdb' 'git' 'docbook-xml'
'docbook-xsl' 'docbook-sgml') 'docbook-xsl' 'docbook-sgml')
checkdepends=('procps-ng') checkdepends=('procps-ng')
optdepends=('openmpi: MPI support')
provides=('valgrind-multilib') provides=('valgrind-multilib')
replaces=('valgrind-multilib') replaces=('valgrind-multilib')
options=('!emptydirs' '!strip') options=('!emptydirs' '!strip')
source=("git+http://repo.or.cz/valgrind.git#commit=$_commit" source=("git+https://repo.or.cz/valgrind.git#commit=$_commit"
valgrind-3.7.0-respect-flags.patch valgrind-3.7.0-respect-flags.patch
valgrind-3.13.0-arm64-hwcap.patch) valgrind-3.13.0-arm64-hwcap.patch)
md5sums=('SKIP' md5sums=('SKIP'
@ -51,16 +50,18 @@ prepare() {
} }
build() { build() {
# valgrind does not like stack protector flags # valgrind does not like some of our flags
CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/} CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
CFLAGS=${CFLAGS/-fstack-protector-strong -fno-plt/} CFLAGS=${CFLAGS/-fno-plt/}
CXXFLAGS=${CXXFLAGS/-fstack-protector-strong -fno-plt/} CXXFLAGS=${CXXFLAGS/-fno-plt/}
cd valgrind cd valgrind
./configure \ ./configure \
--prefix=/usr \ --prefix=/usr \
--mandir=/usr/share/man \ --sysconfdir=/etc \
--with-mpicc=mpicc --localstatedir=/var \
--libexecdir=/usr/lib \
--mandir=/usr/share/man
make make
make -C docs man-pages make -C docs man-pages
} }
@ -71,48 +72,46 @@ check() {
# Make sure a basic binary runs. There should be no errors. # Make sure a basic binary runs. There should be no errors.
./vg-in-place --error-exitcode=1 /bin/true ./vg-in-place --error-exitcode=1 /bin/true
# Make sure no extra CFLAGS, CXXFLAGS or LDFLAGS leak through, # Make sure no extra FLAGS leak through, the testsuite
# the testsuite sets all flags necessary. See also configure above. # sets all flags necessary. See also configure above.
make check CFLAGS="" CXXFLAGS="" LDFLAGS="" make check CPPFLAGS= CFLAGS= CXXFLAGS= LDFLAGS=
# XXX: run full regtest but only report issues some tests fail duo # XXX: run full regtest but only report issues some tests fail duo
# current toolchain and expectations, take a manual look if its fine # current toolchain and expectations, take a manual look if its fine
echo ===============TESTING=================== echo "===============TESTING==================="
make regtest || : make regtest || :
# Make sure test failures show up in build.log # Make sure test failures show up in build.log
# Gather up the diffs (at most the first 20 lines for each one) # Gather up the diffs (at most the first 20 lines for each one)
MAX_LINES=20 local f max_lines=20 diff_files=()
diff_files=$(find . -name '*.diff' | sort) mapfile -d '' diff_files < <(find . -name '*.diff' -print0 | sort -z)
if [ z"${diff_files}" = z ] ; then if (( ${#diff_files[@]} == 0 )); then
echo "Congratulations, all tests passed!" echo "Congratulations, all tests passed!"
else else
warning "Some tests failed!" warning "Some tests failed!"
for f in ${diff_files} ; do for f in "${diff_files[@]}"; do
echo "=================================================" >> diffs echo "================================================="
echo "${f}" >> diffs echo "${f}"
echo "=================================================" >> diffs echo "================================================="
if [ "$(wc -l < "${f}")" -le ${MAX_LINES} ] ; then if (( $(wc -l < "${f}") < ${max_lines} )); then
cat "${f}" >> diffs cat "${f}"
else else
head -n ${MAX_LINES} "${f}" >> diffs head -n ${max_lines} "${f}"
echo "<truncated beyond ${MAX_LINES} lines>" >> diffs echo "<truncated beyond ${max_lines} lines>"
fi fi
done done | tee diffs
fi fi
cat diffs echo "===============END TESTING==============="
echo ===============END TESTING===============
} }
package() { package() {
cd valgrind cd valgrind
make DESTDIR="${pkgdir}" install make DESTDIR="${pkgdir}" install
install -d "$pkgdir/usr/share/man/man1" install -Dm644 docs/*.1 -t "$pkgdir/usr/share/man/man1"
install -m644 docs/*.1 -t "$pkgdir/usr/share/man/man1"
if check_option 'debug' n; then if check_option 'debug' n; then
find "${pkgdir}/usr/bin" -type f -executable -exec strip $STRIP_BINARIES {} + || true find "${pkgdir}/usr/bin" -type f -executable -exec strip $STRIP_BINARIES {} + || :
fi fi
} }