diff --git a/libffado-mixer-py3.patch b/libffado-mixer-py3.patch new file mode 100644 index 0000000..4b49423 --- /dev/null +++ b/libffado-mixer-py3.patch @@ -0,0 +1,39 @@ +diff -rupN libffado-2.4.1.org/SConstruct libffado-2.4.1/SConstruct +--- libffado-2.4.1.org/SConstruct 2018-03-04 01:13:17.000000000 -0500 ++++ libffado-2.4.1/SConstruct 2019-09-18 19:38:12.105388609 -0400 +@@ -719,8 +719,8 @@ def is_userspace_32bit(cpuinfo): + # /bin/mount: file format elf64-x86-64 + # or like this: + # /bin/mount: file format elf32-powerpc +- for line in x.split(b'\n'): +- line = line.strip().decode() ++ for line in x.split('\n'): ++ line = line.strip() + if line.startswith(real_exe): + x, fmt = line.rsplit(None, 1) + answer = 'elf32' in fmt +diff -rupN libffado-2.4.1.org/support/mixer-qt4/SConscript libffado-2.4.1/support/mixer-qt4/SConscript +--- libffado-2.4.1.org/support/mixer-qt4/SConscript 2015-04-12 07:18:15.000000000 -0400 ++++ libffado-2.4.1/support/mixer-qt4/SConscript 2019-09-18 19:37:50.112436538 -0400 +@@ -29,16 +29,13 @@ Import( 'env' ) + if env['BUILD_MIXER'] == 'true': + e = env.Clone() + +- def findfiles( arg, dirname, names ): +- for name in names: ++ pythonfiles = [ 'ffado/config.py' ] ++ for dirpath, dirnames, files in os.walk( "ffado"): ++ for name in files: + if name.startswith("."): +- names.remove(name) +- for name in names: ++ continue + if '.pyc' not in name and '.in' not in name: +- arg.append( os.path.join( dirname, name ) ) +- +- pythonfiles = [ 'ffado/config.py' ] +- os.path.walk( "ffado", findfiles, pythonfiles ) ++ pythonfiles.append(os.path.join(dirpath, name)) + + e.ScanReplace( "ffado/config.py.in" ) + e.Depends( "ffado/config.py", "#/SConstruct" ) diff --git a/libffado.spec b/libffado.spec index 332055f..576eca9 100644 --- a/libffado.spec +++ b/libffado.spec @@ -1,12 +1,14 @@ Summary: Free firewire audio driver library Name: libffado Version: 2.4.1 -Release: 8%{?dist} +Release: 9%{?dist} # src/libutil/float_cast.h is LGPLv2+. # The rest is (GPLv2 or GPLv3) License: LGPLv2+ and (GPLv2 or GPLv3) URL: http://www.ffado.org/ Source0: http://www.ffado.org/files/%{name}-%{version}.tgz +# Convert the package to Python3. Sent upstream via email. +Patch0: libffado-mixer-py3.patch # The trunk is tarballed as follows: # bash libffado-snapshot.sh 2088 # The fetch script @@ -15,9 +17,8 @@ Source9: libffado-snapshot.sh BuildRequires: alsa-lib-devel BuildRequires: dbus-c++-devel BuildRequires: dbus-devel -# the following got renamed to python2-dbus on F28. We are using the backward-compatible Provides -BuildRequires: python2-dbus -BuildRequires: python2-rpm-macros +BuildRequires: python3-dbus +BuildRequires: python3-rpm-macros BuildRequires: desktop-file-utils BuildRequires: doxygen BuildRequires: gcc-c++ @@ -29,10 +30,9 @@ BuildRequires: libiec61883-devel BuildRequires: libraw1394-devel BuildRequires: libxml++-devel BuildRequires: pkgconfig -BuildRequires: python2-PyQt5-devel -BuildRequires: python2-devel -BuildRequires: python2-enum34 -BuildRequires: python2-scons +BuildRequires: python3-qt5-devel +BuildRequires: python3-devel +BuildRequires: python3-scons BuildRequires: subversion ExcludeArch: s390 s390x Requires: udev @@ -59,8 +59,8 @@ License: GPLv3 and GPLv3+ and (GPLv2 or GPLv3) Requires: %{name}%{?_isa} = %{version}-%{release} Requires: dbus # the following got renamed to python2-dbus on F28. We are using the backward-compatible Provides -Requires: python2-dbus -Requires: python2-qt5 +Requires: python3-dbus +Requires: python3-qt5 %description -n ffado Applications and utilities for use with libffado. @@ -68,6 +68,7 @@ Applications and utilities for use with libffado. %prep %setup -q +%patch0 -p1 -b .py3 # We don't want to install all tests sed -i '/Install/d' tests/{,*/}SConscript @@ -76,7 +77,7 @@ sed -i '/Install/d' tests/{,*/}SConscript sed -i 's|hi64-apps-ffado.png|ffado.png|' support/mixer-qt4/ffado/ffadowindow.py # Fix Python shebangs -sed -i 's|/usr/bin/.*python$|/usr/bin/python2|' \ +sed -i 's|/usr/bin/.*python$|/usr/bin/python3|' \ admin/*.py doc/SConscript tests/python/*.py tests/*.py \ support/mixer-qt4/ffado-mixer* support/mixer-qt4/SConscript \ support/tools/*.py support/tools/SConscript @@ -87,7 +88,7 @@ sed -i 's|-m32||' SConstruct export CFLAGS="%{optflags} -ffast-math" export CXXFLAGS="%{optflags} -ffast-math --std=gnu++11" export LDFLAGS="%{build_ldflags}" -scons-2 %{?_smp_mflags} \ +scons-3 %{?_smp_mflags} \ ENABLE_SETBUFFERSIZE_API_VER=True \ ENABLE_OPTIMIZATIONS=True \ CUSTOM_ENV=True \ @@ -96,8 +97,8 @@ scons-2 %{?_smp_mflags} \ LIBDIR=%{_libdir} \ MANDIR=%{_mandir} \ UDEVDIR=%{_prefix}/lib/udev/rules.d/ \ - PYPKGDIR=%{python2_sitelib}/ffado/ \ - PYTHON_INTERPRETER=/usr/bin/python2 \ + PYPKGDIR=%{python3_sitelib}/ffado/ \ + PYTHON_INTERPRETER=/usr/bin/python3 \ BUILD_TESTS=1 %install @@ -105,7 +106,7 @@ scons-2 %{?_smp_mflags} \ export CFLAGS="%{optflags} -ffast-math" export CXXFLAGS="%{optflags} -ffast-math --std=gnu++11" export LDFLAGS="%{build_ldflags}" -scons-2 DESTDIR=%{buildroot} PREFIX=%{_prefix}\ +scons-3 DESTDIR=%{buildroot} PREFIX=%{_prefix}\ install # We need to install the xdg stuff manually @@ -153,10 +154,13 @@ appstream-util validate-relax --nonet \ %{_datadir}/applications/ffado.org-ffadomixer.desktop %{_datadir}/icons/hicolor/64x64/apps/ffado.png %{_datadir}/metainfo/ffado-mixer.appdata.xml -%{python2_sitelib}/ffado/ +%{python3_sitelib}/ffado/ %changelog +* Wed Sep 18 2019 Orcan Ogetbil - 2.4.1-9 +- Convert the package from Python2 to Python3 + * Sat Aug 03 2019 Orcan Ogetbil - 2.4.1-8 - scons renamed to scons-2 in the recent Fedora package