Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/bpmdetect/, media-sound/bpmdetect/files/
Date: Wed, 27 Jan 2016 18:45:08
Message-Id: 1453920295.cfb62d0d06d25269c935b7029a1ca656ceecf86f.soap@gentoo
1 commit: cfb62d0d06d25269c935b7029a1ca656ceecf86f
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 27 18:42:56 2016 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 27 18:44:55 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cfb62d0d
7
8 media-sound/bpmdetect: Add patch to respect user flags
9
10 Gentoo-Bug: 334465
11 * EAPI=6
12 * Added patch by Gavin Pryke to respect all user flags
13 * Fixed QA issues caused by non-compliant .desktop file
14 * Fixed QA issues caused by wrong printf() handling
15
16 Package-Manager: portage-2.2.27
17
18 media-sound/bpmdetect/bpmdetect-0.6.1-r1.ebuild | 53 +++++++++++++++++
19 .../files/bpmdetect-0.6.1-fix-buildsystem.patch | 67 ++++++++++++++++++++++
20 .../files/bpmdetect-0.6.1-fix-printf-format.patch | 37 ++++++++++++
21 3 files changed, 157 insertions(+)
22
23 diff --git a/media-sound/bpmdetect/bpmdetect-0.6.1-r1.ebuild b/media-sound/bpmdetect/bpmdetect-0.6.1-r1.ebuild
24 new file mode 100644
25 index 0000000..351532a
26 --- /dev/null
27 +++ b/media-sound/bpmdetect/bpmdetect-0.6.1-r1.ebuild
28 @@ -0,0 +1,53 @@
29 +# Copyright 1999-2016 Gentoo Foundation
30 +# Distributed under the terms of the GNU General Public License v2
31 +# $Id$
32 +
33 +EAPI=6
34 +
35 +inherit eutils toolchain-funcs
36 +
37 +DESCRIPTION="Automatic BPM detection utility"
38 +HOMEPAGE="http://sourceforge.net/projects/bpmdetect"
39 +SRC_URI="mirror://sourceforge/${PN}/${P}-src.tar.bz2"
40 +
41 +LICENSE="GPL-2"
42 +SLOT="0"
43 +KEYWORDS="~amd64 ~x86"
44 +IUSE=""
45 +
46 +RDEPEND="media-libs/taglib
47 + media-libs/id3lib
48 + >=media-libs/fmod-4.25.07-r1:1
49 + dev-qt/qtgui:4"
50 +DEPEND="${RDEPEND}
51 + sys-apps/sed
52 + dev-util/scons
53 + virtual/pkgconfig"
54 +
55 +S=${WORKDIR}/${PN}
56 +PATCHES=(
57 + "${FILESDIR}/${P}-gcc44_and_fmodex_path.patch"
58 + "${FILESDIR}/${P}-fix-buildsystem.patch"
59 + "${FILESDIR}/${P}-fix-printf-format.patch"
60 +)
61 +
62 +src_prepare() {
63 + default
64 + tc-export CC CXX
65 +}
66 +
67 +src_configure() {
68 + :
69 +}
70 +
71 +src_compile() {
72 + export QTDIR="/usr/$(get_libdir)"
73 + scons prefix=/usr || die "scons failed"
74 +}
75 +
76 +src_install() {
77 + dobin build/${PN}
78 + doicon src/${PN}-icon.png
79 + domenu src/${PN}.desktop
80 + dodoc authors readme todo
81 +}
82
83 diff --git a/media-sound/bpmdetect/files/bpmdetect-0.6.1-fix-buildsystem.patch b/media-sound/bpmdetect/files/bpmdetect-0.6.1-fix-buildsystem.patch
84 new file mode 100644
85 index 0000000..fa6c0e5
86 --- /dev/null
87 +++ b/media-sound/bpmdetect/files/bpmdetect-0.6.1-fix-buildsystem.patch
88 @@ -0,0 +1,67 @@
89 +* Fix QA issues in desktop file
90 +* Make buildsystem respect CXX, CXXFLAGS and LDFLAGS
91 +https://bugs.gentoo.org/show_bug.cgi?id=334465
92 +
93 +--- bpmdetect/src/bpmdetect.desktop
94 ++++ bpmdetect/src/bpmdetect.desktop
95 +@@ -2,7 +2,7 @@
96 + Encoding=UTF-8
97 + Name=BPMDetect
98 + Exec=bpmdetect
99 +-Icon=bpmdetect-icon.png
100 ++Icon=bpmdetect-icon
101 + Type=Application
102 + Comment=Automatic BPM detection utility
103 +-Categories=Application;AudioVideo;Audio:
104 ++Categories=AudioVideo;Audio;
105 +--- bpmdetect/src/SConscript
106 ++++ bpmdetect/src/SConscript
107 +@@ -1,5 +1,6 @@
108 + #! /usr/bin/env python
109 + import os, sys, glob
110 ++import SCons.Util
111 +
112 + if not sys.platform.startswith('win'):
113 + BOLD ="\033[1m"
114 +@@ -156,17 +157,18 @@
115 + env.__delitem__('CPPPATH')
116 + if env.has_key('CPPDEFINES'):
117 + env.__delitem__('CPPDEFINES')
118 +- if env.has_key('CXXFLAGS'):
119 +- env.__delitem__('CXXFLAGS')
120 + if env.has_key('LIBPATH'):
121 + env.__delitem__('LIBPATH')
122 + if env.has_key('LIBS'):
123 + env.__delitem__('LIBS')
124 +- if env.has_key('LINKFLAGS'):
125 +- env.__delitem__('LINKFLAGS')
126 + if env.has_key('QT3'):
127 + env.__delitem__('QT3')
128 +
129 ++ if os.environ.has_key('CXXFLAGS'):
130 ++ env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
131 ++ if os.environ.has_key('LDFLAGS'):
132 ++ env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
133 ++
134 + print BOLD + """
135 + --------------------------------------------------""" + NORMAL
136 + print "Use MinGW compiler : ",
137 +@@ -189,7 +191,6 @@
138 + env.Append(CXXFLAGS = '-g')
139 + else:
140 + print 'no '
141 +- env.Append(CXXFLAGS = '-O2' )
142 + env.Append(CPPDEFINES = ['NDEBUG', 'NO_DEBUG'])
143 + env['DEBUG'] = 0
144 +
145 +@@ -309,6 +310,10 @@
146 + ( 'LINKFLAGS', 'linker flags'),
147 + ( 'QT3', 'use qt3')
148 + )
149 ++if os.environ.has_key('CC'):
150 ++ env['CC'] = os.environ['CC']
151 ++if os.environ.has_key('CXX'):
152 ++ env['CXX'] = os.environ['CXX']
153 + opts.Update(env)
154 +
155 + # to avoid an error message 'how to make target configure... ?'
156
157 diff --git a/media-sound/bpmdetect/files/bpmdetect-0.6.1-fix-printf-format.patch b/media-sound/bpmdetect/files/bpmdetect-0.6.1-fix-printf-format.patch
158 new file mode 100644
159 index 0000000..89bf644
160 --- /dev/null
161 +++ b/media-sound/bpmdetect/files/bpmdetect-0.6.1-fix-printf-format.patch
162 @@ -0,0 +1,37 @@
163 +Fix broken printf statements:
164 +* src/main.cpp:49:62: warning: too many arguments for format [-Wformat-extra-args]
165 +* printf("Usage:\n bpmdetect [switches] [files]\n\n", version);
166 +*
167 +* src/track.cpp:111:57: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘double’ [-Wformat=]
168 +* snprintf(buffer, BPM_LEN, "%05d", (int) dBPM * 100. );
169 +
170 +--- bpmdetect/src/main.cpp
171 ++++ bpmdetect/src/main.cpp
172 +@@ -34,6 +34,7 @@
173 + #endif
174 +
175 + #include <getopt.h>
176 ++#include <stdio.h>
177 +
178 + #include "track.h"
179 + #include "trackfmod.h" // for FMOD system
180 +@@ -46,7 +47,7 @@
181 +
182 + void display_help() {
183 + printf("BPMDetect version %s\n\n", version);
184 +- printf("Usage:\n bpmdetect [switches] [files]\n\n", version);
185 ++ fputs("Usage:\n bpmdetect [switches] [files]\n\n", stdout);
186 + printf("Switches:\n");
187 + #ifndef NO_GUI
188 + printf("-c --console - run in console mode\n");
189 +--- bpmdetect/src/track.cpp
190 ++++ bpmdetect/src/track.cpp
191 +@@ -108,7 +108,7 @@
192 + } else if( format == "000" ) {
193 + snprintf(buffer, BPM_LEN, "%03d", (int) dBPM );
194 + } else if( format == "00000" ) {
195 +- snprintf(buffer, BPM_LEN, "%05d", (int) dBPM * 100. );
196 ++ snprintf(buffer, BPM_LEN, "%05d", static_cast<int>(dBPM * 100.) );
197 + } else { // all other formats are converted to "0.00"
198 + snprintf(buffer, BPM_LEN, "%.2f", dBPM );
199 + }