commit:     7133a4cc49d1299e0a90ebf19ea6d2a92ed6f8b5
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Apr  2 12:03:58 2016 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Apr  2 12:04:07 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7133a4cc

media-sound/xmms2: Add knob to disable valgrind at test runtime, bug #424377

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

Package-Manager: portage-2.2.28

 media-sound/xmms2/files/xmms2-0.8-rtvg.patch | 36 ++++++++++++++++++++++++++++
 media-sound/xmms2/metadata.xml               |  1 +
 media-sound/xmms2/xmms2-0.8-r2.ebuild        |  9 ++++---
 3 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/media-sound/xmms2/files/xmms2-0.8-rtvg.patch 
b/media-sound/xmms2/files/xmms2-0.8-rtvg.patch
new file mode 100644
index 0000000..20be342
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8-rtvg.patch
@@ -0,0 +1,36 @@
+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:

diff --git a/media-sound/xmms2/metadata.xml b/media-sound/xmms2/metadata.xml
index 099b501..acb8313 100644
--- a/media-sound/xmms2/metadata.xml
+++ b/media-sound/xmms2/metadata.xml
@@ -40,6 +40,7 @@
                <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>

diff --git a/media-sound/xmms2/xmms2-0.8-r2.ebuild 
b/media-sound/xmms2/xmms2-0.8-r2.ebuild
index 4500c37..515550e 100644
--- a/media-sound/xmms2/xmms2-0.8-r2.ebuild
+++ b/media-sound/xmms2/xmms2-0.8-r2.ebuild
@@ -19,7 +19,7 @@ KEYWORDS="alpha amd64 ppc x86"
 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
@@ -73,7 +73,8 @@ DEPEND="${RDEPEND}
        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}"
@@ -116,13 +117,14 @@ src_prepare() {
        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
@@ -242,6 +244,7 @@ src_configure() {
        # 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)"       \

Reply via email to