PKGBUILDs/extra/valgrind/PKGBUILD

144 lines
5.7 KiB
Bash
Raw Normal View History

2018-01-06 20:32:44 +00:00
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2023-12-05 21:58:11 +00:00
# Maintainer: Christian Heusel <gromit@archlinux.org>
2018-01-06 20:32:44 +00:00
# Contributor: Dan McGee <dan@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
2012-06-06 20:28:35 +00:00
2022-05-13 23:49:24 +00:00
# README
# this package requires glibc-debug to run the check() function
# as -debug packages are not available in [core], it has to be applied manually
# whenever the tests shall run
#
# For a fresh build:
2024-02-09 13:13:48 +00:00
# pkgctl build -I ../../glibc/trunk/glibc-debug*.pkg.tar.zst
# pkgctl build
2022-05-13 23:49:24 +00:00
2012-06-06 20:28:35 +00:00
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
2022-02-13 17:32:05 +00:00
# - hold for toolchain update
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
2022-03-22 00:12:27 +00:00
noautobuild=1
2012-06-06 20:28:35 +00:00
pkgname=valgrind
2023-12-05 21:58:11 +00:00
pkgver=3.22.0
2024-02-09 13:13:48 +00:00
pkgrel=3
2018-01-06 20:32:44 +00:00
pkgdesc='Tool to help find memory-management problems in programs'
arch=('x86_64')
2024-02-09 13:13:48 +00:00
license=('GPL-2.0-or-later')
2023-03-08 00:43:14 +00:00
url='https://valgrind.org/'
2022-05-15 19:56:05 +00:00
depends=('glibc' 'perl' 'debuginfod')
2020-07-23 02:02:51 +00:00
makedepends=('gdb' 'docbook-xml'
'docbook-xsl' 'docbook-sgml')
2018-01-06 20:32:44 +00:00
checkdepends=('procps-ng')
2024-02-09 13:13:48 +00:00
optdepends=(
'python: cg_* scripts'
)
2018-01-06 20:32:44 +00:00
provides=('valgrind-multilib')
replaces=('valgrind-multilib')
options=('!emptydirs' '!strip')
2020-07-23 02:02:51 +00:00
source=(https://sourceware.org/pub/valgrind/valgrind-${pkgver}.tar.bz2{,.asc}
2018-01-06 20:32:44 +00:00
valgrind-3.7.0-respect-flags.patch
2024-02-09 13:13:48 +00:00
# https://sourceware.org/git/?p=valgrind.git;a=commit;h=372d09fd9a8d76847c81092ebff71c80fd6c145d
# dropped changes to NEWS as that did not apply
valgrind_3_22_0_s390x-linux_memfd_secret.patch
valgrind_3_22_0_fchmodat2_syscall.patch
2018-01-06 20:32:44 +00:00
valgrind-3.13.0-arm64-hwcap.patch)
2020-07-23 02:02:51 +00:00
validpgpkeys=(
0E9FFD0C16A1856CF9C7C690BA0166E698FA6035 # Julian Seward <jseward@acm.org>
2021-12-26 16:24:00 +00:00
EC3CFE88F6CA0788774F5C1D1AA44BE649DE760A # Mark Wielaard <mjw@gnu.org>
2020-07-23 02:02:51 +00:00
)
2023-12-05 21:58:11 +00:00
sha512sums=('2904c13f68245bbafcea70998c6bd20725271300a7e94b6751ca00916943595fc3fac8557da7ea8db31b54a43f092823a0a947bc142829da811d074e1fe49777'
2020-07-23 02:02:51 +00:00
'SKIP'
2018-01-06 20:32:44 +00:00
'e0cec39381cefeca09ae4794cca309dfac7c8693e6315e137e64f5c33684598726d41cfbb4edf764fe985503b13ff596184ca5fc32b159d500ec092e4cf8838c'
2024-02-09 13:13:48 +00:00
'6393ddf84eec93cc9b3e20f9c43a8f3ef37436980c9d91350ebd27d5c41057fe982308ba5d194feddaea4a75a4a9ef14fb404388cc9f4628edbe9ef58787afba'
'1e22b75b95252583774916dab9dcbc8663495107e15dd1ddf397744b288265fcffd1f456d306bc610989a1f650ae66a8ebeb84d253be312db2ab9fdc9fe1407f'
2017-10-27 13:03:57 +00:00
'5af853399c6abdf8016fd1c2be854b3952b7d7e9ca16c870f84eed72e606e639d5f64de32e60105899f5201b53156380ae460111e05209e843301492742c9bfd')
2023-12-05 21:58:11 +00:00
b2sums=('80024371b3e70521996077fba24e233097a6190477ced1b311cd41fead687dcc2511ac0ef723792488f4af08867dff3e1f474816fda09c1604b89059e31c2514'
2020-07-23 02:02:51 +00:00
'SKIP'
'af556fdf3c02e37892bfe9afebc954cf2f1b2fa9b75c1caacfa9f3b456ebc02bf078475f9ee30079b3af5d150d41415a947c3d04235c1ea8412cf92b959c484a'
2024-02-09 13:13:48 +00:00
'5af1f467c8d22334e14e6c2878120550ce5f1e36b61f8180601b8673493a85cca8a0c3a804c281ab51fb04fe5e3706edeb897bbd5486f87d9143f472cd4c46b5'
'305234e118eeb389c95ca8afa45239b0386199dee6f5058a3ddca06a91b2069e1b9831ac5e31badf6d8bd0d43eef3f260d95b976a509d73284149a64d9ea0563'
2020-07-23 02:02:51 +00:00
'ff8cf51a6034c13ffbc412c387e83a32fa59f96e01be8faf6b52aa6d55bd5e5836c16d75f2291d87450709d0c75689b21870514006c603c6419940a9b977e609')
2021-12-26 16:24:00 +00:00
options=(!lto) # https://bugs.kde.org/show_bug.cgi?id=338252
2017-10-27 13:03:57 +00:00
prepare() {
2020-07-23 02:02:51 +00:00
cd valgrind-${pkgver}
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
2021-01-21 13:17:48 +00:00
sed -i 's|sgml/docbook/xsl-stylesheets|xml/docbook/xsl-stylesheets-1.79.2-nons|' docs/Makefile.am
2024-02-09 13:13:48 +00:00
# can be dropped with the next release, see
# https://gitlab.archlinux.org/archlinux/packaging/packages/valgrind/-/issues/2
patch -Np1 < ../valgrind_3_22_0_s390x-linux_memfd_secret.patch
patch -Np1 < ../valgrind_3_22_0_fchmodat2_syscall.patch
autoreconf -ifv
2017-10-27 13:03:57 +00:00
}
2014-02-10 04:08:27 +00:00
build() {
2020-07-23 02:02:51 +00:00
cd valgrind-${pkgver}
2018-01-06 20:32:44 +00:00
./configure \
--prefix=/usr \
2019-10-06 15:28:10 +00:00
--sysconfdir=/etc \
--localstatedir=/var \
--libexecdir=/usr/lib \
2024-02-09 13:13:48 +00:00
--mandir=/usr/share/man \
--enable-lto=no
2012-06-06 20:28:35 +00:00
make
make -C docs man-pages
2012-06-06 20:28:35 +00:00
}
2018-01-06 20:32:44 +00:00
check() {
2022-05-13 23:49:24 +00:00
# only run if glibc-debug is supplied manually
if ! pacman -Q glibc-debug; then echo -e "\033[1;31mcheck() not run, supply glibc-debug if unintended!\033[0m"; return 0; fi
2020-07-23 02:02:51 +00:00
cd valgrind-${pkgver}
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
2019-10-06 15:28:10 +00:00
# Make sure no extra FLAGS leak through, the testsuite
# sets all flags necessary. See also configure above.
make check CPPFLAGS= CFLAGS= CXXFLAGS= LDFLAGS=
2018-01-06 20:32:44 +00:00
2020-07-23 02:02:51 +00:00
# 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 || true
# Make sure test failures show up in build.log
# Gather up the diffs (at most the first 20 lines for each one)
#local f max_lines=20 diff_files=()
#mapfile -d '' diff_files < <(find . -name '*.diff' -print0 | sort -z)
#if (( ${#diff_files[@]} == 0 )); then
#echo "Congratulations, all tests passed!"
#else
#warning "Some tests failed!"
#for f in "${diff_files[@]}"; do
#echo "================================================="
#echo "${f}"
#echo "================================================="
#if (( $(wc -l < "${f}") < ${max_lines} )); then
#cat "${f}"
#else
#head -n ${max_lines} "${f}"
#echo "<truncated beyond ${max_lines} lines>"
#fi
#done | tee diffs
#fi
#echo "===============END TESTING==============="
2018-01-06 20:32:44 +00:00
}
2012-06-06 20:28:35 +00:00
package() {
2020-07-23 02:02:51 +00:00
cd valgrind-${pkgver}
2018-01-06 20:32:44 +00:00
make DESTDIR="${pkgdir}" install
2019-10-06 15:28:10 +00:00
install -Dm644 docs/*.1 -t "$pkgdir/usr/share/man/man1"
if check_option 'debug' n; then
2019-10-06 15:28:10 +00:00
find "${pkgdir}/usr/bin" -type f -executable -exec strip $STRIP_BINARIES {} + || :
fi
2012-06-06 20:28:35 +00:00
}
2018-01-06 20:32:44 +00:00
# vim: ts=2 sw=2 et: