Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libffado/, media-libs/libffado/files/
Date: Sun, 25 Jun 2017 19:41:05
Message-Id: 1498419631.0e4e3a0c73b44a7a2506cdc2aaa698d57c39b99e.aballier@gentoo
1 commit: 0e4e3a0c73b44a7a2506cdc2aaa698d57c39b99e
2 Author: Hector Martin <marcan <AT> marcan <DOT> st>
3 AuthorDate: Fri Jun 23 12:33:04 2017 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 25 19:40:31 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e4e3a0c
7
8 media-libs/libffado: New package.
9
10 FFADO is a userspace driver for IEEE1394 (FireWire) audio interfaces.
11
12 From audio-overlay: https://github.com/gentoo-audio/audio-overlay
13 (Previously from the proaudio overlay)
14
15 Gentoo-Bug: https://bugs.gentoo.org/622520
16 Package-Manager: Portage-2.3.6, Repoman-2.3.2
17
18 media-libs/libffado/Manifest | 1 +
19 .../libffado/files/libffado-2.3.0-gcc6.patch | 26 +++++
20 .../files/libffado-2.3.0-modelname-strip.patch | 45 +++++++++
21 media-libs/libffado/libffado-2.3.0.ebuild | 106 +++++++++++++++++++++
22 media-libs/libffado/metadata.xml | 20 ++++
23 5 files changed, 198 insertions(+)
24
25 diff --git a/media-libs/libffado/Manifest b/media-libs/libffado/Manifest
26 new file mode 100644
27 index 00000000000..dd5225ee1b8
28 --- /dev/null
29 +++ b/media-libs/libffado/Manifest
30 @@ -0,0 +1 @@
31 +DIST libffado-2.3.0.tgz 1239253 SHA256 18e3c7e610b7cee58b837c921ebb985e324cb2171f8d130f79de02a3fc435f88 SHA512 24a8853281a17b04623e41dc590f7a9b8f4aebe4dfaece2e3b8fe28457a6ff011586e817712b4913d1fca660b701dddc70576c12d8c56470cf991eb17b4297c4 WHIRLPOOL 8eb1c3f6372b25b173d230500cfad7ef7207d730ec8e048bdb84cd7436e196e5429d85afcea0f626a411c1f792f20f1ab59f0c0b0f5a97b114f646c4a7423053
32
33 diff --git a/media-libs/libffado/files/libffado-2.3.0-gcc6.patch b/media-libs/libffado/files/libffado-2.3.0-gcc6.patch
34 new file mode 100644
35 index 00000000000..2a73ee1cf8c
36 --- /dev/null
37 +++ b/media-libs/libffado/files/libffado-2.3.0-gcc6.patch
38 @@ -0,0 +1,26 @@
39 +------------------------------------------------------------------------
40 +r2629 | jwoithe | 2016-10-09 13:00:28 +0900 (Sun, 09 Oct 2016) | 1 line
41 +
42 +TimestampedBuffer.cpp: move the include of math.h to the top of the file which is where most people would expect it to be. The patch comes from a Fedora RPM source package via Simon Lewis, who suggested that without it gcc6 had trouble with the file (the nature of the problem is not known by the FFADO project at this time). Earlier versions of gcc (for example, 4.8.2) had no trouble compiling this file without any math.h include, so the issue that some have seen with gcc6 must be due to math.h being removed from some other system-level include file at some point.
43 +------------------------------------------------------------------------
44 +Index: src/libutil/TimestampedBuffer.cpp
45 +===================================================================
46 +--- a/src/libutil/TimestampedBuffer.cpp (revision 2628)
47 ++++ b/src/libutil/TimestampedBuffer.cpp (revision 2629)
48 +@@ -32,6 +32,7 @@
49 +
50 + #include <cstdlib>
51 + #include <cstring>
52 ++#include <math.h>
53 +
54 + #define DLL_PI (3.141592653589793238)
55 + #define DLL_SQRT2 (1.414213562373095049)
56 +@@ -179,8 +180,6 @@
57 + m_wrap_at=w;
58 + return true;
59 + }
60 +-#include <math.h>
61 +-
62 + /**
63 + * \brief return the effective rate
64 + *
65
66 diff --git a/media-libs/libffado/files/libffado-2.3.0-modelname-strip.patch b/media-libs/libffado/files/libffado-2.3.0-modelname-strip.patch
67 new file mode 100644
68 index 00000000000..8f28b6ac0f7
69 --- /dev/null
70 +++ b/media-libs/libffado/files/libffado-2.3.0-modelname-strip.patch
71 @@ -0,0 +1,45 @@
72 +------------------------------------------------------------------------
73 +r2677 | jwoithe | 2017-03-22 07:43:24 +0900 (Wed, 22 Mar 2017) | 1 line
74 +
75 +configrom: there is no obvious reason why a space should be added to the end of the vendor and model strings returned from the interface. Retain the explicit null termination of these strings to cover for the case where an interface may not return any null bytes. Also fix indentation associated with the null termination code. The issue with the trailing space was noticed and reported by Nils Philippsen: its presence broke a test in the saffire_dice mixer python code.
76 +------------------------------------------------------------------------
77 +Index: src/libieee1394/configrom.cpp
78 +===================================================================
79 +--- a/src/libieee1394/configrom.cpp (revision 2676)
80 ++++ b/src/libieee1394/configrom.cpp (revision 2677)
81 +@@ -176,13 +176,11 @@
82 + ( void* )CSR1212_TEXTUAL_DESCRIPTOR_LEAF_DATA( m_vendorNameKv ),
83 + len );
84 +
85 +- while ((buf + len - 1) == '\0') {
86 +- len--;
87 ++ while (*(buf + len - 1) == '\0') {
88 ++ len--;
89 + }
90 +- // \todo XXX seems a bit strage to do this but the nodemgr.c code does
91 +- // it. try to figure out why this is needed (or not)
92 +- buf[len++] = ' ';
93 +- buf[len] = '\0';
94 ++ // Ensure vendor string is null terminated
95 ++ buf[len] = '\0';
96 +
97 +
98 + debugOutput( DEBUG_LEVEL_VERBOSE, "Vendor name: '%s'\n", buf );
99 +@@ -195,13 +193,11 @@
100 + memcpy( buf,
101 + ( void* )CSR1212_TEXTUAL_DESCRIPTOR_LEAF_DATA( m_modelNameKv ),
102 + len );
103 +- while ((buf + len - 1) == '\0') {
104 +- len--;
105 ++ while (*(buf + len - 1) == '\0') {
106 ++ len--;
107 + }
108 +- // \todo XXX for edirol fa-66 it seems somehow broken. see above
109 +- // todo as well.
110 +- buf[len++] = ' ';
111 +- buf[len] = '\0';
112 ++ // Ensure model name string is null terminated
113 ++ buf[len] = '\0';
114 +
115 + debugOutput( DEBUG_LEVEL_VERBOSE, "Model name: '%s'\n", buf);
116 + m_modelName = buf;
117
118 diff --git a/media-libs/libffado/libffado-2.3.0.ebuild b/media-libs/libffado/libffado-2.3.0.ebuild
119 new file mode 100644
120 index 00000000000..4a017d149f2
121 --- /dev/null
122 +++ b/media-libs/libffado/libffado-2.3.0.ebuild
123 @@ -0,0 +1,106 @@
124 +# Copyright 1999-2017 Gentoo Foundation
125 +# Distributed under the terms of the GNU General Public License v2
126 +
127 +EAPI="6"
128 +
129 +PYTHON_COMPAT=( python2_7 )
130 +
131 +inherit eutils python-single-r1 scons-utils toolchain-funcs udev multilib-minimal
132 +
133 +DESCRIPTION="Driver for IEEE1394 (Firewire) audio interfaces"
134 +HOMEPAGE="http://www.ffado.org"
135 +
136 +if [ "${PV}" = "9999" ]; then
137 + inherit subversion
138 + ESVN_REPO_URI="http://subversion.ffado.org/ffado/trunk/${PN}"
139 + KEYWORDS=""
140 +else
141 + SRC_URI="http://www.ffado.org/files/${P}.tgz"
142 + KEYWORDS="~amd64"
143 +fi
144 +
145 +LICENSE="GPL-2 GPL-3"
146 +SLOT="0"
147 +IUSE="debug qt4 test-programs"
148 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
149 +
150 +RDEPEND="dev-cpp/libxmlpp:2.6[${MULTILIB_USEDEP}]
151 + dev-libs/dbus-c++
152 + dev-libs/libconfig[cxx,${MULTILIB_USEDEP}]
153 + media-libs/alsa-lib
154 + media-libs/libiec61883[${MULTILIB_USEDEP}]
155 + !<media-sound/jack-audio-connection-kit-0.122.0:0
156 + !<media-sound/jack-audio-connection-kit-1.9.9:2
157 + sys-apps/dbus
158 + sys-libs/libraw1394[${MULTILIB_USEDEP}]
159 + sys-libs/libavc1394[${MULTILIB_USEDEP}]
160 + ${PYTHON_DEPS}
161 + qt4? (
162 + dev-python/PyQt4[dbus,${PYTHON_USEDEP}]
163 + dev-python/dbus-python[${PYTHON_USEDEP}]
164 + x11-misc/xdg-utils
165 + )"
166 +DEPEND="${RDEPEND}
167 + virtual/pkgconfig"
168 +
169 +PATCHES=(
170 + "${FILESDIR}/libffado-2.3.0-modelname-strip.patch"
171 + "${FILESDIR}/libffado-2.3.0-gcc6.patch"
172 +)
173 +
174 +myescons() {
175 + local myesconsargs=(
176 + PREFIX="${EPREFIX}/usr"
177 + LIBDIR="${EPREFIX}/usr/$(get_libdir)"
178 + MANDIR="${EPREFIX}/usr/share/man"
179 + UDEVDIR="$(get_udevdir)/rules.d"
180 + CUSTOM_ENV=true
181 + DETECT_USERSPACE_ENV=false
182 + DEBUG=$(usex debug)
183 + # ENABLE_OPTIMIZATIONS detects cpu type and sets flags accordingly
184 + # -fomit-frame-pointer is added also which can cripple debugging.
185 + # we set flags from portage instead
186 + ENABLE_OPTIMIZATIONS=false
187 + # This only works for JACK1>=0.122.0 or JACK2>=1.9.9, so we block
188 + # lower versions.
189 + ENABLE_SETBUFFERSIZE_API_VER=force
190 + )
191 + if multilib_is_native_abi; then
192 + myesconsargs+=(
193 + BUILD_MIXER=$(usex qt4 true false)
194 + BUILD_TESTS=$(usex test-programs)
195 + )
196 + else
197 + myesconsargs+=(
198 + BUILD_MIXER=false
199 + BUILD_TESTS=false
200 + )
201 + fi
202 + escons "${myesconsargs[@]}" "${@}"
203 +}
204 +
205 +src_prepare() {
206 + default
207 + multilib_copy_sources
208 +}
209 +
210 +multilib_src_compile() {
211 + tc-export CC CXX
212 + myescons
213 +}
214 +
215 +multilib_src_install() {
216 + myescons DESTDIR="${D}" WILL_DEAL_WITH_XDG_MYSELF="True" install
217 +}
218 +
219 +multilib_src_install_all() {
220 + einstalldocs
221 +
222 + python_fix_shebang "${D}"
223 + python_optimize "${D}"
224 +
225 + if use qt4; then
226 + newicon "support/xdg/hi64-apps-ffado.png" "ffado.png"
227 + newmenu "support/xdg/ffado.org-ffadomixer.desktop" "ffado-mixer.desktop"
228 + fi
229 +}
230
231 diff --git a/media-libs/libffado/metadata.xml b/media-libs/libffado/metadata.xml
232 new file mode 100644
233 index 00000000000..52a13df73d6
234 --- /dev/null
235 +++ b/media-libs/libffado/metadata.xml
236 @@ -0,0 +1,20 @@
237 +<?xml version="1.0" encoding="UTF-8"?>
238 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
239 +<pkgmetadata>
240 + <maintainer type="person">
241 + <email>marcan@××××××.st</email>
242 + <name>Hector Martin</name>
243 + </maintainer>
244 + <maintainer type="project">
245 + <email>proxy-maint@g.o</email>
246 + <name>Proxy Maintainers</name>
247 + </maintainer>
248 + <maintainer type="project">
249 + <email>proaudio@g.o</email>
250 + <name>Gentoo ProAudio Project</name>
251 + </maintainer>
252 + <use>
253 + <flag name="qt4">Install qt4-based mixer frontend</flag>
254 + <flag name="test-programs">Install standalone test programs</flag>
255 + </use>
256 +</pkgmetadata>