summaryrefslogtreecommitdiff
path: root/media-libs/libffado
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-07-31 03:04:46 -0500
committerroot <root@alpha.trunkmasters.com>2026-07-31 03:04:46 -0500
commit3f283d6a71e35a9c6d89dc73d76f01aec1c1a6b3 (patch)
treebe269d99a452403d508fed631b1bdd5ebdc98d9f /media-libs/libffado
parent0fb86e044f244e00302b1878b3e15e0db0e4b7e5 (diff)
downloadbaldeagleos-repo-3f283d6a71e35a9c6d89dc73d76f01aec1c1a6b3.tar.gz
baldeagleos-repo-3f283d6a71e35a9c6d89dc73d76f01aec1c1a6b3.tar.xz
baldeagleos-repo-3f283d6a71e35a9c6d89dc73d76f01aec1c1a6b3.zip
Adding metadata
Diffstat (limited to 'media-libs/libffado')
-rw-r--r--media-libs/libffado/Manifest2
-rw-r--r--media-libs/libffado/files/libffado-2.5.0-fix_literal_concat.patch13
-rw-r--r--media-libs/libffado/files/libffado-2.5.0-fix_pkgconfig.patch121
-rw-r--r--media-libs/libffado/files/libffado-2.5.0-use_shutil_which.patch97
-rw-r--r--media-libs/libffado/libffado-2.5.0_p5.ebuild149
5 files changed, 382 insertions, 0 deletions
diff --git a/media-libs/libffado/Manifest b/media-libs/libffado/Manifest
index c328265b457d..55edd0696a6f 100644
--- a/media-libs/libffado/Manifest
+++ b/media-libs/libffado/Manifest
@@ -1 +1,3 @@
DIST libffado-2.4.9.tgz 1229651 BLAKE2B ec8300066d47d685aa701316efa6831f05d678c509de341d1b74551bf8a3f04b59dcd80d592e2111670212d4056bd1c150cc23dbf43a797a915bf65ae441c85e SHA512 0a0c61cf9339ab542c85eaefbe017b7613f716ae0ed08d11a37782dd7ef5815b18256c5d1b9240f077c9f59bbf4b4878019cefbd6cab78140477bcad6a9d3e44
+DIST libffado-2.5.0.tgz 1235980 BLAKE2B 4828b308628d5ccea13993a0c80bd9ead5762943f01ad004169bd0e6018cd68ce4868ae18c286433e08d9d4ce770d6ea82e4da252d52fff6baae9ff3fd3c37b9 SHA512 0c2e21e1ac13111c8090e97cf56ba82e977463e3e0465b603899922aebcefb5144e3779d23f874be1dc269104bb631ad4edd198a13a65bb1e3d2ed3e52bee4c1
+DIST libffado_2.5.0-5.debian.tar.xz 18960 BLAKE2B 3245d5fbed5affe7281c2b09ecb993b9e7022380dbf612eb5314fad9ac2666c6277053c92f9959ebdbbad9f0c85a2c9b3613e8d76ab19f014e0bf6f3f8cdf5cd SHA512 d8af4fc6c0a6773d07879a93d1a2941d650b0682e794ab073cfeb724e3686bc658f2924bf640f0d4b4c24117381d4803e54e2b5ebea1cca3bc9a7150c7c5e16a
diff --git a/media-libs/libffado/files/libffado-2.5.0-fix_literal_concat.patch b/media-libs/libffado/files/libffado-2.5.0-fix_literal_concat.patch
new file mode 100644
index 000000000000..7fc36f7b2c7f
--- /dev/null
+++ b/media-libs/libffado/files/libffado-2.5.0-fix_literal_concat.patch
@@ -0,0 +1,13 @@
+fix C++11 string literal concatenation w/ clang
+error: invalid suffix on literal; C++11 requires a space between literal and identifier
+--- a/src/libutil/serialize_expat.cpp
++++ b/src/libutil/serialize_expat.cpp
+@@ -118,7 +118,7 @@ Util::XMLSerialize::write( std::string strMemberName,
+ // element to be added
+ Xml::Node& n = pNode->add( Xml::Node(tokens[tokens.size() - 1].c_str(), NULL) );
+ char* valstr;
+- asprintf( &valstr, "%"PRId64"", value );
++ asprintf( &valstr, "%" PRId64, value );
+ n.set_child_text( valstr );
+ free( valstr );
+ } else {
diff --git a/media-libs/libffado/files/libffado-2.5.0-fix_pkgconfig.patch b/media-libs/libffado/files/libffado-2.5.0-fix_pkgconfig.patch
new file mode 100644
index 000000000000..981555fa847d
--- /dev/null
+++ b/media-libs/libffado/files/libffado-2.5.0-fix_pkgconfig.patch
@@ -0,0 +1,121 @@
+first try PKG_CONFIG instead of hardcoded pkg-config
+see https://bugs.gentoo.org/791724
+--- a/SConstruct
++++ b/SConstruct
+@@ -198,7 +198,7 @@ int main() {
+
+ def CheckPKG(context, name):
+ context.Message( 'Checking for %s... ' % name )
+- ret = context.TryAction('pkg-config --exists \'%s\'' % name)[0]
++ ret = context.TryAction("%s --exists '%s'" % (context.env['PKG_CONFIG'], name))[0]
+ context.Result( ret )
+ return ret
+
+--- a/admin/pkgconfig.py
++++ b/admin/pkgconfig.py
+@@ -26,6 +26,7 @@
+ # and heavily modified
+ #
+
++import os
+ import subprocess
+
+ #
+@@ -33,7 +34,7 @@ import subprocess
+ #
+ def CheckForPKGConfig( context, version='0.0.0' ):
+ context.Message( "Checking for pkg-config (at least version %s)... " % version )
+- ret = context.TryAction( "pkg-config --atleast-pkgconfig-version=%s" %version )[0]
++ ret = context.TryAction( "%s --atleast-pkgconfig-version=%s" % (context.env['PKG_CONFIG'], version) )[0]
+ context.Result( ret )
+ return ret
+
+@@ -49,13 +50,13 @@ def CheckForPKG( context, name, version="" ):
+
+ if version == "":
+ context.Message( "Checking for %s... \t" % name )
+- ret = context.TryAction( "pkg-config --exists '%s'" % name )[0]
++ ret = context.TryAction( "%s --exists '%s'" % (context.env['PKG_CONFIG'], name) )[0]
+ else:
+ context.Message( "Checking for %s (%s or higher)... \t" % (name,version) )
+- ret = context.TryAction( "pkg-config --atleast-version=%s '%s'" % (version,name) )[0]
++ ret = context.TryAction( "%s --atleast-version=%s '%s'" % (context.env['PKG_CONFIG'], version, name) )[0]
+
+ if ret:
+- context.env['%s_FLAGS' % name2.upper()] = context.env.ParseFlags("!pkg-config --cflags --libs %s" % name)
++ context.env['%s_FLAGS' % name2.upper()] = context.env.ParseFlags("!%s --cflags --libs %s" % (context.env['PKG_CONFIG'], name))
+
+ context.Result( ret )
+ return ret
+@@ -66,20 +67,18 @@ def CheckForPKG( context, name, version="" ):
+ # This should allow caching of the flags so that pkg-config is called only once.
+ #
+ def GetPKGFlags( context, name, version="" ):
+- import os
+-
+ if version == "":
+ context.Message( "Checking for %s... \t" % name )
+- ret = context.TryAction( "pkg-config --exists '%s'" % name )[0]
++ ret = context.TryAction( "%s --exists '%s'" % (context.env['PKG_CONFIG'], name) )[0]
+ else:
+ context.Message( "Checking for %s (%s or higher)... \t" % (name,version) )
+- ret = context.TryAction( "pkg-config --atleast-version=%s '%s'" % (version,name) )[0]
++ ret = context.TryAction( "%s --atleast-version=%s '%s'" % (context.env['PKG_CONFIG'], version, name) )[0]
+
+ if not ret:
+ context.Result( ret )
+ return ret
+
+- out = subprocess.Popen(['pkg-config', '--cflags', '--libs', name], stdout=subprocess.PIPE)
++ out = subprocess.Popen([context.env['PKG_CONFIG'], '--cflags', '--libs', name], stdout=subprocess.PIPE)
+ ret = out.stdout.read()
+
+ context.Result( True )
+@@ -89,23 +88,22 @@ def GetPKGFlags( context, name, version="" ):
+ # Checks for the existance of the package and returns the value of the specified variable.
+ #
+ def GetPKGVariable( context, name, variable ):
+- import os
+-
+ context.Message( "Checking for variable %s in package %s... \t" % (variable,name) )
+
+- ret = context.TryAction( "pkg-config --exists '%s'" % name )[0]
++ ret = context.TryAction( "%s --exists '%s'" % (context.env['PKG_CONFIG'], name) )[0]
+ if not ret:
+ context.Result( ret )
+ return ret
+
+- out = subprocess.Popen(['pkg-config', '--variable=%s' % variable, name], stdout=subprocess.PIPE)
++ out = subprocess.Popen([context.env['PKG_CONFIG'], '--variable=%s' % variable, name], stdout=subprocess.PIPE)
+ ret = out.stdout.read()
+
+ context.Result( True )
+ return ret
+
+ def generate( env, **kw ):
+- env['PKGCONFIG_TESTS' ] = { 'CheckForPKGConfig' : CheckForPKGConfig, 'CheckForPKG' : CheckForPKG, 'GetPKGFlags' : GetPKGFlags, 'GetPKGVariable' : GetPKGVariable }
++ env.setdefault('PKG_CONFIG', os.environ.get('PKG_CONFIG', 'pkg-config'))
++ env['PKGCONFIG_TESTS' ] = { 'CheckForPKGConfig' : CheckForPKGConfig, 'CheckForPKG' : CheckForPKG, 'GetPKGFlags' : GetPKGFlags, 'GetPKGVariable' : GetPKGVariable }
+
+ def exists( env ):
+ return 1
+--- a/support/tools/ffado-diag.in
++++ b/support/tools/ffado-diag.in
+@@ -22,7 +22,7 @@ static_info = "$LIBDATADIR/static_info.txt"
+ # Test for common FFADO problems
+
+ import glob
+-import os.path
++import os
+ import re
+ import subprocess
+ import sys
+@@ -96,7 +96,7 @@ if path:
+ version = version.decode ("utf8")
+ show_pair ('', version [:version.find ("\n")])
+
+-pkg_config = which ("pkg-config")
++pkg_config = os.environ.get("PKG_CONFIG") or which("pkg-config")
+ show_pair ("pkg-config", pkg_config)
+
+ if pkg_config:
diff --git a/media-libs/libffado/files/libffado-2.5.0-use_shutil_which.patch b/media-libs/libffado/files/libffado-2.5.0-use_shutil_which.patch
new file mode 100644
index 000000000000..515fba8f9ef8
--- /dev/null
+++ b/media-libs/libffado/files/libffado-2.5.0-use_shutil_which.patch
@@ -0,0 +1,97 @@
+use shutil.which instead of sys-apps/which
+see https://bugs.gentoo.org/940711
+--- a/SConstruct
++++ b/SConstruct
+@@ -27,7 +27,8 @@ from __future__ import print_function
+ FFADO_API_VERSION = "9"
+ FFADO_VERSION="2.5.0"
+
+-from subprocess import Popen, PIPE, check_output
++from shutil import which
++from subprocess import check_output
+ import os
+ import re
+ import sys
+@@ -162,10 +163,10 @@ def ConfigGuess( context ):
+ return ret.decode()
+
+ def CheckForApp( context, app ):
+- context.Message( "Checking whether '" + app + "' executes " )
+- ret = context.TryAction( app )
+- context.Result( ret[0] )
+- return ret[0]
++ context.Message( "Checking whether '" + app + "' exists " )
++ ret = which(app) is not None
++ context.Result(ret)
++ return ret
+
+ def CheckForPyModule( context, module ):
+ context.Message( "Checking for the python module '" + module + "' " )
+@@ -220,13 +221,10 @@ version_re = re.compile(r'^(\d+)\.(\d+)\.(\d+)')
+
+ def CheckJackdVer():
+ print('Checking jackd version...', end='')
+- popen = Popen(("which", 'jackd'), stdout=PIPE, stderr=PIPE)
+- stdout, stderr = popen.communicate()
+- assert popen.returncode in (0, 1), "which returned a unexpected status"
+- if popen.returncode == 1:
++ jackd = which("jackd")
++ if jackd is None:
+ print("not installed")
+ return None
+- jackd = stdout.decode ().rstrip ()
+ ret = check_output ((jackd, '--version')).decode() .rstrip ()
+ ret = ret.split ('\n') [-1]; # Last line.
+ ret = ret.split () [2]; # Third field.
+@@ -413,10 +411,10 @@ are retried.
+
+ # PyQT checks
+ if env['BUILD_MIXER'] != 'false':
+- if ( conf.CheckForApp( 'which pyuic6' ) \
++ if ( conf.CheckForApp( 'pyuic6' ) \
+ and conf.CheckForPyModule( 'PyQt6' ) \
+ and conf.CheckForPyModule( 'dbus.mainloop.pyqt6' )) \
+- or ( conf.CheckForApp( 'which pyuic5' ) \
++ or ( conf.CheckForApp( 'pyuic5' ) \
+ and conf.CheckForPyModule( 'PyQt5' ) \
+ and conf.CheckForPyModule( 'dbus.mainloop.pyqt5' )):
+ env['BUILD_MIXER'] = 'true'
+@@ -446,7 +444,7 @@ for pkg in pkgs:
+ name2 = pkg.replace("+","").replace(".","").replace("-","").upper()
+ env['%s_FLAGS' % name2] = conf.GetPKGFlags( pkg, pkgs[pkg] )
+
+-if not env['DBUS1_FLAGS'] or not env['DBUSC1_FLAGS'] or not conf.CheckForApp('which dbusxx-xml2cpp'):
++if not env['DBUS1_FLAGS'] or not env['DBUSC1_FLAGS'] or not conf.CheckForApp('dbusxx-xml2cpp'):
+ env['DBUS1_FLAGS'] = b""
+ env['DBUSC1_FLAGS'] = b""
+ print("""
+--- a/support/tools/ffado-diag.in
++++ b/support/tools/ffado-diag.in
+@@ -21,6 +21,8 @@ static_info = "$LIBDATADIR/static_info.txt"
+
+ # Test for common FFADO problems
+
++from shutil import which
++
+ import glob
+ import os.path
+ import re
+@@ -41,18 +43,6 @@ def indent (lines):
+ def stdout (*args):
+ return subprocess.check_output (args).decode ("utf8")
+
+-def which (command):
+- popen = subprocess.Popen (("which", command), stdout=subprocess.PIPE,
+- stderr=subprocess.PIPE)
+- stdout, stderr = popen.communicate ()
+- if popen.returncode == 0:
+- return stdout.decode ("utf8").rstrip ()
+- elif popen.returncode == 1:
+- return None
+- else:
+- print (stderr)
+- sys.exit (1)
+-
+ # Parse command line.
+ usage = """Usage: ffado-diag [--static | -V | --version | --usage]
+ --static Only display executable paths and libraries.
diff --git a/media-libs/libffado/libffado-2.5.0_p5.ebuild b/media-libs/libffado/libffado-2.5.0_p5.ebuild
new file mode 100644
index 000000000000..2d7d9cab628d
--- /dev/null
+++ b/media-libs/libffado/libffado-2.5.0_p5.ebuild
@@ -0,0 +1,149 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{13..14} )
+inherit desktop python-single-r1 scons-utils toolchain-funcs udev xdg multilib-minimal
+
+DESCRIPTION="Driver for IEEE1394 (Firewire) audio interfaces"
+HOMEPAGE="https://ffado.org/"
+if [[ ${PV} == *9999* ]]; then
+ inherit subversion
+ ESVN_REPO_URI="http://subversion.ffado.org/ffado/trunk/${PN}"
+else
+ SRC_URI="
+ https://ffado.org/files/${PN}-${PV%_p*}.tgz
+ mirror://debian/pool/main/libf/libffado/${PN}_${PV/_p/-}.debian.tar.xz
+ "
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
+ S="${WORKDIR}/${PN}-${PV%_p*}"
+fi
+
+LICENSE="GPL-2 GPL-3"
+SLOT="0"
+IUSE="debug gui test-programs"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+BDEPEND="
+ >=dev-libs/dbus-c++-0.9.0-r5
+ virtual/pkgconfig
+ $(python_gen_cond_dep 'dev-python/setuptools[${PYTHON_USEDEP}]')
+"
+RDEPEND="
+ ${PYTHON_DEPS}
+ >=dev-libs/dbus-c++-0.9.0-r5
+ dev-libs/expat[${MULTILIB_USEDEP}]
+ dev-libs/libconfig:=[cxx,${MULTILIB_USEDEP}]
+ media-libs/alsa-lib
+ media-libs/libiec61883[${MULTILIB_USEDEP}]
+ sys-apps/dbus
+ sys-libs/libraw1394[${MULTILIB_USEDEP}]
+ gui? (
+ $(python_gen_cond_dep '
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-python/qtpy[dbus,gui,pyqt6,widgets,${PYTHON_USEDEP}]
+ ')
+ x11-misc/xdg-utils
+ )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ # missing includes for expat
+ "${WORKDIR}"/debian/patches/0002-Include-config.h.patch
+ # qtpy/PyQt6 port
+ "${WORKDIR}"/debian/patches/0003-Replace-PyQt4-with-PyQt6.patch
+
+ # use shutil.which instead of sys-apps/which
+ "${FILESDIR}"/${PN}-2.5.0-use_shutil_which.patch
+ # first try PKG_CONFIG from env
+ "${FILESDIR}"/${PN}-2.5.0-fix_pkgconfig.patch
+ # fix clang
+ "${FILESDIR}"/${PN}-2.5.0-fix_literal_concat.patch
+)
+
+myescons() {
+ local myesconsargs=(
+ PREFIX="${EPREFIX}/usr"
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)"
+ MANDIR="${EPREFIX}/usr/share/man"
+ UDEVDIR="$(get_udevdir)/rules.d"
+ CUSTOM_ENV=true
+ DETECT_USERSPACE_ENV=false
+ DEBUG=$(usex debug)
+ # unused and will show a wrong target w/ cross-compile
+ DIST_TARGET=none
+ PYPKGDIR="$(python_get_sitedir)"
+ PYTHON_INTERPRETER="${PYTHON}"
+ # use dev-libs/expat instead of dev-cpp/libxmlpp
+ SERIALIZE_USE_EXPAT=true
+ # ENABLE_OPTIMIZATIONS detects cpu type and sets flags accordingly
+ # -fomit-frame-pointer is added also which can cripple debugging.
+ # we set flags from portage instead
+ ENABLE_OPTIMIZATIONS=false
+ # This only works for JACK1>=0.122.0 or JACK2>=1.9.9.
+ ENABLE_SETBUFFERSIZE_API_VER=force
+ )
+ if multilib_is_native_abi; then
+ myesconsargs+=(
+ BUILD_MIXER=$(usex gui true false)
+ BUILD_TESTS=$(usex test-programs)
+ )
+ else
+ myesconsargs+=(
+ BUILD_MIXER=false
+ BUILD_TESTS=false
+ )
+ fi
+ escons "${myesconsargs[@]}" "${@}"
+}
+
+src_prepare() {
+ default
+
+ # Bug #808853
+ cp "${BROOT}"/usr/share/gnuconfig/config.guess admin/ || die "Failed to update config.guess"
+
+ # Bugs #658052, #659226
+ sed -i -e 's/^CacheDir/#CacheDir/' SConstruct || die
+
+ # skip CompilerCheck with TryRun
+ if tc-is-cross-compiler; then
+ sed -e '/"CompilerCheck" :/s/: CompilerCheck,/: lambda context: (context.Message("Checking C-compiler... "), context.Result("skipped")) and True,/' \
+ -i SConstruct || die
+ fi
+
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ tc-export CC CXX PKG_CONFIG
+ myescons
+}
+
+multilib_src_install() {
+ myescons DESTDIR="${D}" WILL_DEAL_WITH_XDG_MYSELF="True" install
+}
+
+multilib_src_install_all() {
+ einstalldocs
+
+ python_fix_shebang "${D}"
+ python_optimize "${D}"
+
+ if use gui; then
+ newicon "support/xdg/hi64-apps-ffado.png" "ffado.png"
+ newmenu "support/xdg/org.ffado.FfadoMixer.desktop" "ffado-mixer.desktop"
+ fi
+}
+
+pkg_postinst() {
+ xdg_icon_cache_update
+ udev_reload
+}
+
+pkg_postrm() {
+ xdg_icon_cache_update
+ udev_reload
+}