--- /dev/null
+Add knob to disable valgrind at test runtime.
+
+When valgrind is installed in system but is not
+working we should still be able to run tests.
+
+Reported-by: Diego Elio Pettenò
+Bug: https://bugs.gentoo.org/424377
+diff --git a/waftools/unittest.py b/waftools/unittest.py
+index 4317287..6179dfd 100644
+--- a/waftools/unittest.py
++++ b/waftools/unittest.py
+@@ -64,7 +64,8 @@ def generate_coverage(bld):
+
+ def configure(conf):
+ conf.load("waf_unit_test")
+- conf.find_program("valgrind", var="VALGRIND", mandatory=False)
++ if conf.options.enable_valgrind is True:
++ conf.find_program("valgrind", var="VALGRIND", mandatory=False)
+ conf.find_program("lcov", var="LCOV", mandatory=False)
+ conf.find_program("genhtml", var="GENHTML", mandatory=False)
+
+diff --git a/wscript b/wscript
+index 99c1fa3..a98d5e3 100644
+--- a/wscript
++++ b/wscript
+@@ -501,6 +501,10 @@ def options(opt):
+ dest='ldconfig', help="Run ldconfig after install even if not root")
+ opt.add_option('--without-ldconfig', action='store_false',
+ dest='ldconfig', help="Don't run ldconfig after install")
++ opt.add_option('--with-valgrind', action='store_true', default=None,
++ dest='enable_valgrind', help="Run testsuite under valgrind (if present).")
++ opt.add_option('--without-valgrind', action='store_false', default=None,
++ dest='enable_valgrind', help="Don't run testsuite under valgrind.")
+
+ opt.sub_options("src/xmms")
+ for o in optional_subdirs + subdirs:
<flag name="phonehome">This client sends anonymous usage-statistics to the xmms2</flag>
<flag name="server">Build xmms2 player daemon (otherwise only clients are built)</flag>
<flag name="sid">Support for C64 SID</flag>
+ <flag name="valgrind">Run unit tests under valgrind.</flag>
<flag name="vocoder">Phase vocoder effect plugin</flag>
<flag name="mlib-update">Enable building of xmms2-mlib-updater client</flag>
<flag name="xml">Enable support for various XML based playlists and sources: RSS, XSPF</flag>
IUSE="aac airplay +alsa ao asf avahi cdda curl cxx ffmpeg flac gvfs ices
jack mac mlib-update mms +mad modplug mp3 mp4 musepack ofa oss
perl phonehome pulseaudio python ruby
-samba +server sid sndfile speex test +vorbis vocoder wavpack xml"
+samba +server sid sndfile speex test valgrind +vorbis vocoder wavpack xml"
RDEPEND="server? (
>=dev-db/sqlite-3.3.4
perl? ( dev-perl/Module-Build
virtual/perl-Module-Metadata )
virtual/pkgconfig
- test? ( dev-util/cunit )
+ test? ( dev-util/cunit
+ valgrind? ( dev-util/valgrind ) )
"
S="${WORKDIR}/${MY_P}"
epatch "${FILESDIR}/${P}"-ffmpeg2.patch #536232
epatch "${FILESDIR}/${P}"-cpython.patch
epatch "${FILESDIR}/${P}"-modpug.patch #536046
- epatch "${FILESDIR}/${P}"-audio4-p1.patch
+ epatch "${FILESDIR}/${P}"-audio4-p1.patch #540890
epatch "${FILESDIR}/${P}"-audio4-p2.patch
epatch "${FILESDIR}/${P}"-audio4-p3.patch
epatch "${FILESDIR}/${P}"-audio4-p4.patch
epatch "${FILESDIR}/${P}"-audio4-p5.patch
epatch "${FILESDIR}/${P}"-audio4-p6.patch
epatch "${FILESDIR}/${P}"-audio4-p7.patch
+ epatch "${FILESDIR}/${P}"-rtvg.patch #424377
if has_version dev-libs/libcdio-paranoia; then
sed -i -e 's:cdio/cdda.h:cdio/paranoia/cdda.h:' src/plugins/cdda/cdda.c || die
# pass them explicitely even if empty as we try to avoid magic deps
waf_params+=" --with-optionals=${optionals:1}" # skip first ',' if yet
waf_params+=" --with-plugins=${plugins:1}"
+ waf_params+=" $(use_with valgrind)"
CC="$(tc-getCC)" \
CPP="$(tc-getCPP)" \