Greetings developers!
The build system currently checks the jack version by first trying to execute jackd and then, if jackd does not work, trying to find pkg-config files. To make ffado build properly in Gentoo the check using jackd must be avoided, since calling jackd from the build system causes the build to fail with a so called sandbox error (jackd tries to write outside the build directory). To avoid calling jackd a patch has been used. The problem is that whenever the source code of that part of the build system changes this patch have to be re-written.
Thus, I have written a patch that simply swaps the two checks, so that the pkg-config files are checked before jackd is called. This preserves the intent to not force users to have jack pkg-config files just to build ffado as well as it removes the need for additional downstream patching. Since the patch does not remove any functionality I believe it is alright to apply here (upstream).
Here is the patch:
Index: SConstruct
===================================================================
--- SConstruct (revision 2574)
+++ SConstruct (working copy)
@@ -250,21 +250,22 @@
# Provide a way for users to compile newer libffado which will work
# against older jack installations which will not accept the new API
# version reported at runtime.
- jackd_ver = CheckJackdVer()
- if (jackd_ver != -1):
- # If jackd is available, use the version number reported by it. This
- # means users don't have to have jack development files present on
- # their system for this to work.
- have_jack = (jackd_ver >= VersionInt('0.0.0'))
- good_jack1 = (jackd_ver < VersionInt('1.9.0')) and (jackd_ver >= VersionInt('0.121.4'))
- good_jack2 = (jackd_ver >= VersionInt('1.9.9'))
- else:
- # Jackd is not runnable. Attempt to identify a version from
- # pkgconfig on the off-chance jack details are available from there.
- print "Will retry jack detection using pkg-config"
- have_jack = conf.CheckPKG('jack >= 0.0.0')
+ # The following code tries to determine the jack version using the
+ # pkg-config files. If these are not found it tries to determine the
+ # version using the jackd binary. The order of these checks is
+ # relevant since checking pkg-config files before calling jackd
+ # reduces the work for gentoo maintainers.
+ have_jack = conf.CheckPKG('jack')
+ if have_jack:
good_jack1 = conf.CheckPKG('jack < 1.9.0') and conf.CheckPKG('jack >= 0.122.0')
good_jack2 = conf.CheckPKG('jack >= 1.9.9')
+ else:
+ jackd_ver = CheckJackdVer()
+ if (jackd_ver != -1):
+ have_jack = (jackd_ver >= VersionInt('0.0.0'))
+ good_jack1 = (jackd_ver < VersionInt('1.9.0')) and (jackd_ver >= VersionInt('0.121.4'))
+ good_jack2 = (jackd_ver >= VersionInt('1.9.9'))
+
if env['ENABLE_SETBUFFERSIZE_API_VER'] == 'auto':
if not(have_jack):
print """
Thanks in advance,
Karl