Blame ardour7.spec

bed82b1
# the test scripts seem to be broken
bed82b1
%bcond_with tests
bed82b1
bed82b1
# whether to do a verbose build
bed82b1
%bcond_without verbose_build
bed82b1
%if %{with verbose_build}
bed82b1
%global _verbose -v
bed82b1
%else
bed82b1
%global _verbose %{nil}
bed82b1
%endif
bed82b1
bed82b1
# whether to use system libraries
bed82b1
%bcond_without system_libs
bed82b1
bed82b1
# whether or not to apply 64-bit patches
bed82b1
%if "%_lib" == "lib64"
bed82b1
%bcond_without apply_64bit_patches
bed82b1
%else
bed82b1
%bcond_with apply_64bit_patches
bed82b1
%endif
bed82b1
bed82b1
# Don't generate provides for internal shared objects and plugins
bed82b1
%global internal_libs_re (alsa_audiobackend|ardour.*|audiographer|canvas|dummy_audiobackend|evoral|gtkmm2ext|jack_audiobackend|midipp|pan[12]in2out|panbalance|panvbap|pbd|ptformat|pulseaudio_backend.so|qmdsp|temporal|timecode|waveview|widgets)
bed82b1
%global __provides_exclude_from ^%{_libdir}/(%{name}|lv2)/.*$
bed82b1
%global __requires_exclude ^lib%{internal_libs_re}\.so.*$
bed82b1
bed82b1
# This package is named ardour7 to allow parallel installation with older versions of Ardour.
bed82b1
Name:       ardour7
2048db7
Version:    7.5.0
bed82b1
bed82b1
Release:    %autorelease
bed82b1
Summary:    Digital Audio Workstation
bed82b1
cb687aa
License:    GPL-3.0-only
bed82b1
URL:        https://ardour.org
bed82b1
# Not available via direct download. Download via
bed82b1
# https://ardour.org/download.html
bed82b1
Source0: Ardour-%{version}.tar.bz2
bed82b1
# BSD 2/3-clause, ISC licenses and GPLv3+ license terms used in some code files
bed82b1
Source1:    LICENSING
bed82b1
Source2:    gpl-3.0.txt
bed82b1
6cc3a7f
# Fixes for Python 3.12, picked from upstream
6cc3a7f
Patch0:     0001-wscript-fix-regexp-escaping-with-the-more-strict-Pyt.patch
6cc3a7f
Patch1:     0002-remove-unused-function-from-autowaf.py-it-no-longer-.patch
6cc3a7f
Patch2:     0003-upgrade-waf-to-2.0.26-includes-new-autowaf.py-versio.patch
6cc3a7f
de9a755
# Deal with kissfft >= 130. Upstream PR: https://github.com/Ardour/ardour/pull/833
de9a755
Patch3:     0001-Deal-with-kissfft-130.patch
de9a755
13cca27
# Fix FTBFS with libxml2 version 2.12.
13cca27
# Upstream PR: https://github.com/Ardour/ardour/pull/841
13cca27
Patch4:     0001-Fix-failure-to-build-with-libxml2-version-2.12.patch
13cca27
e4e5f01
Patch5:     ardour7-c99.patch
e4e5f01
bed82b1
# Search VST plugins in lib64 paths on 64-bit platforms. This isn't according
bed82b1
# to the VST standard, but enough packaged plugins use these paths to make it
bed82b1
# worthwhile. Patch number >= 100 applies this only on 64-bit systems.
bed82b1
Patch100:   %{name}-vst-lib64.patch
bed82b1
bed82b1
BuildRequires:  boost-devel >= 1.56
bed82b1
BuildRequires:  coreutils
bed82b1
BuildRequires:  desktop-file-utils
bed82b1
BuildRequires:  doxygen
bed82b1
BuildRequires:  fontconfig
bed82b1
BuildRequires:  gcc-c++
bed82b1
BuildRequires:  gettext
bed82b1
BuildRequires:  graphviz
bed82b1
BuildRequires:  itstool >= 2.0.0
bed82b1
BuildRequires:  kernel-headers
bed82b1
BuildRequires:  libappstream-glib
bed82b1
BuildRequires:  pkgconfig(alsa)
bed82b1
BuildRequires:  pkgconfig(aubio) >= 0.3.2
bed82b1
BuildRequires:  pkgconfig(cairo) >= 1.12.0
bed82b1
BuildRequires:  pkgconfig(cairomm-1.0) >= 1.8.4
bed82b1
BuildRequires:  pkgconfig(cppunit) >= 1.12.0
bed82b1
BuildRequires:  pkgconfig(dbus-1)
bed82b1
BuildRequires:  pkgconfig(fftw3f)
bed82b1
BuildRequires:  pkgconfig(flac) >= 1.2.1
bed82b1
BuildRequires:  pkgconfig(fluidsynth) >= 2.0.1
bed82b1
BuildRequires:  pkgconfig(giomm-2.4) >= 2.2
bed82b1
BuildRequires:  pkgconfig(glib-2.0) >= 2.28.0
bed82b1
BuildRequires:  pkgconfig(glibmm-2.4) >= 2.32.0
bed82b1
BuildRequires:  pkgconfig(gthread-2.0) >= 2.2
bed82b1
BuildRequires:  pkgconfig(gtk+-2.0) >= 2.18
bed82b1
BuildRequires:  pkgconfig(gtkmm-2.4) >= 2.18
bed82b1
BuildRequires:  pkgconfig(hidapi-hidraw)
bed82b1
BuildRequires:  pkgconfig(jack) >= 1.9.10
bed82b1
BuildRequires:  pkgconfig(libarchive) >= 3.0.0
bed82b1
BuildRequires:  pkgconfig(libcurl) >= 7.0.0
bed82b1
BuildRequires:  pkgconfig(liblo) >= 0.26
bed82b1
BuildRequires:  pkgconfig(libpulse)
bed82b1
BuildRequires:  pkgconfig(libusb-1.0)
bed82b1
BuildRequires:  pkgconfig(libwebsockets) >= 2.0.0
bed82b1
BuildRequires:  pkgconfig(libxml-2.0)
bed82b1
BuildRequires:  pkgconfig(lilv-0) >= 0.24.2
bed82b1
BuildRequires:  pkgconfig(lrdf) >= 0.4.0
bed82b1
BuildRequires:  pkgconfig(ltc) >= 1.1.1
bed82b1
BuildRequires:  pkgconfig(lv2) >= 1.0.0
bed82b1
BuildRequires:  pkgconfig(ogg) >= 1.1.2
bed82b1
BuildRequires:  pkgconfig(pangoft2) >= 1.36.8
bed82b1
BuildRequires:  pkgconfig(pangomm-1.4) >= 1.4
bed82b1
BuildRequires:  pkgconfig(readline)
bed82b1
BuildRequires:  pkgconfig(rubberband) >= 3.0.0
bed82b1
BuildRequires:  pkgconfig(samplerate) >= 0.1.7
bed82b1
BuildRequires:  pkgconfig(serd-0) >= 0.14.0
bed82b1
BuildRequires:  pkgconfig(sigc++-2.0) >= 2.0
bed82b1
BuildRequires:  pkgconfig(sndfile) >= 1.0.18
bed82b1
BuildRequires:  pkgconfig(sord-0) >= 0.8.0
bed82b1
BuildRequires:  pkgconfig(soundtouch-1.0)
bed82b1
BuildRequires:  pkgconfig(sratom-0) >= 0.2.0
bed82b1
BuildRequires:  pkgconfig(suil-0) >= 0.6.0
bed82b1
BuildRequires:  pkgconfig(taglib) >= 1.9
bed82b1
BuildRequires:  pkgconfig(vamp-hostsdk) >= 2.1
bed82b1
BuildRequires:  pkgconfig(vamp-sdk) >= 2.1
bed82b1
BuildRequires:  pkgconfig(x11) >= 1.1
bed82b1
BuildRequires:  python3
bed82b1
BuildRequires:  python-unversioned-command
bed82b1
BuildRequires:  kiss-fft-static
bed82b1
BuildRequires:  qm-dsp-static
bed82b1
BuildRequires:  symlinks
bed82b1
bed82b1
Requires:       google-droid-sans-mono-fonts
bed82b1
Requires:       google-noto-sans-fonts
bed82b1
bed82b1
# custom variant of the clearlooks engine used by ardour
bed82b1
# version guessed (conservatively) by copyright of 2007
bed82b1
Provides:       bundled(gtk-theme-engine-clearlooks) = 2.9.0
bed82b1
# stripped down variant of libsmf, the complete version can be found at
bed82b1
# https://sourceforge.net/projects/libsmf/
bed82b1
Provides:       bundled(libsmf) = 1.2
bed82b1
# lua 5.3.5 with custom C++ wrapper
bed82b1
Provides:       bundled(lua) = 5.3.5
bed82b1
# copylib: only a header
bed82b1
# https://github.com/vinniefalco/LuaBridge -- 1.0.2-111-g04b47d7
bed82b1
Provides:       bundled(LuaBridge) = 1.0.2
bed82b1
# libmidi++ and libpbd are internal to ardour, written by the main author
bed82b1
Provides:       bundled(midi++) = 4.1.0
bed82b1
Provides:       bundled(pbd) = 4.1.0
bed82b1
bed82b1
%description
bed82b1
Ardour is a multi-channel digital audio workstation, allowing users to record,
bed82b1
edit, mix and master audio and MIDI projects. It is targeted at audio
bed82b1
engineers, musicians, soundtrack editors and composers.
bed82b1
bed82b1
%prep
bed82b1
%autosetup -S gendiff -N -n Ardour-%{version}
bed82b1
%autopatch -p1 %{!?with_apply_64bit_patches:-M 99}
bed82b1
bed82b1
%if %{with system_libs}
bed82b1
# remove bundled library sources
bed82b1
for i in fluidsynth hidapi libltc qm-dsp; do
bed82b1
    find "libs/$i" \( -name \*.\[ch\] -o -name \*.cc -o -name \*.\[ch\]pp \) -delete
bed82b1
done
bed82b1
%endif
bed82b1
bed82b1
# use versionized name for man page
bed82b1
cp -p ardour.1 %{name}.1
bed82b1
bed82b1
cp %{SOURCE1} %{SOURCE2} .
bed82b1
bed82b1
%build
bed82b1
export LC_ALL=C.UTF-8
bed82b1
%set_build_flags
bed82b1
./waf configure \
bed82b1
%if %{with tests}
bed82b1
    --test \
bed82b1
%endif
bed82b1
    --prefix="%_prefix" \
bed82b1
    --bindir="%_bindir" \
bed82b1
    --configdir="%_sysconfdir" \
bed82b1
    --datadir="%_datadir" \
bed82b1
    --includedir="%_includedir" \
bed82b1
    --libdir="%_libdir" \
bed82b1
    --mandir="%_mandir" \
bed82b1
    --docdir="%_docdir" \
bed82b1
    --docs \
bed82b1
    --lxvst \
bed82b1
    --vst3 \
bed82b1
    --nls \
bed82b1
    --noconfirm \
bed82b1
    --no-phone-home \
bed82b1
    --optimize \
bed82b1
%ifarch %ix86 x86_64
bed82b1
    --arch="%optflags -msse -mfpmath=sse -DUSE_XMMINTRIN" \
bed82b1
%else
bed82b1
    --arch="%optflags" \
bed82b1
%endif
bed82b1
%if %{with system_libs}
bed82b1
    --use-external-libs \
bed82b1
%endif
bed82b1
    --cxx11 \
bed82b1
    --freedesktop \
bed82b1
    --with-backends=dummy,alsa,jack,pulseaudio
bed82b1
bed82b1
./waf build %{_verbose} %{?_smp_mflags}
bed82b1
./waf i18n %{_verbose} %{?_smp_mflags}
bed82b1
bed82b1
%install
bed82b1
./waf --destdir=%{buildroot} install %{_verbose}
bed82b1
bed82b1
# ArdourMono.ttf is really Droid Sans Mono
bed82b1
%if ! 0%{?fedora}%{?rhel} || 0%{?fedora} >= 32 || 0%{?rhel} >= 9
bed82b1
ln -snf ../fonts/google-droid-sans-mono-fonts/DroidSansMono.ttf \
bed82b1
    %{buildroot}%{_datadir}/%{name}/ArdourMono.ttf
bed82b1
%else
bed82b1
ln -snf ../fonts/google-droid/DroidSansMono.ttf %{buildroot}%{_datadir}/%{name}/ArdourMono.ttf
bed82b1
%endif
bed82b1
bed82b1
# ArdourSans.ttf is originally Noto Sans Regular
bed82b1
ln -snf ../fonts/google-noto/NotoSans-Regular.ttf %{buildroot}%{_datadir}/%{name}/ArdourSans.ttf
bed82b1
bed82b1
# install man page
bed82b1
install -d -m755 %{buildroot}%{_mandir}/man1
bed82b1
install -p -m644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
bed82b1
bed82b1
# tweak and install desktop file
bed82b1
mkdir -p %{buildroot}%{_datadir}/applications/
bed82b1
desktop-file-install --dir %{buildroot}%{_datadir}/applications \
bed82b1
    --set-key=Name --set-value="Ardour %{version}" \
bed82b1
    --set-generic-name="Digital Audio Workstation" \
bed82b1
    --set-key=X-GNOME-FullName \
bed82b1
    --set-value="Ardour v%{version} (Digital Audio Workstation)" \
bed82b1
    --set-comment="Record, mix and master audio" \
bed82b1
    --remove-category=AudioEditing \
bed82b1
    --add-category=X-AudioEditing \
bed82b1
    build/gtk2_ardour/%{name}.desktop
bed82b1
bed82b1
# Delete zero length file (probably needed to keep empty dir in GIT)
bed82b1
rm %{buildroot}%{_datadir}/%{name}/templates/.stub
bed82b1
bed82b1
%find_lang %{name}
bed82b1
%find_lang gtk2_%{name}
bed82b1
%find_lang gtkmm2ext3
bed82b1
bed82b1
# Collect non-locale data files and (all) directories
bed82b1
find %{buildroot}%{_datadir}/%{name} | \
bed82b1
    sed 's|^%{buildroot}||g' | \
bed82b1
    while read f; do
bed82b1
        # *sigh*
bed82b1
        if [ "$f" = "${f/ /}" ]; then
bed82b1
            _f="$f"
bed82b1
        else
bed82b1
            _f="\"${f}\""
bed82b1
        fi
bed82b1
bed82b1
        if [ -d "%{buildroot}${f}" ]; then
bed82b1
            echo "%%dir ${_f}"
bed82b1
        else
bed82b1
            if [ "${f}" = "${f#%{_datadir}/%{name}/locale}" ]; then
bed82b1
                echo "${_f}"
bed82b1
            fi
bed82b1
        fi
bed82b1
    done > %{name}-datafiles.list
bed82b1
bed82b1
# Convert dangling absolute symlinks to resolvable ones
bed82b1
find %{buildroot} -type l | while read src; do
bed82b1
    tgt="$(readlink "$src")"
bed82b1
    if [ "${tgt#/}" != "$tgt" -a "${tgt#%{buildroot}/}" = "$tgt" ]; then
bed82b1
        ln -snf "%{buildroot}${tgt}" "$src"
bed82b1
    fi
bed82b1
done
bed82b1
bed82b1
# Convert absolute to relative symlinks
bed82b1
symlinks -r -c %{buildroot}
bed82b1
bed82b1
%check
bed82b1
%if %{with tests}
bed82b1
WAFTPATH="$PWD/doc/waft"
bed82b1
pushd libs/ardour
bed82b1
sh "$WAFTPATH" --targets=libardour-tests && LV2_PATH= ./run-tests.sh
bed82b1
popd
bed82b1
%endif
bed82b1
bed82b1
# check appdata file
bed82b1
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/%{name}.appdata.xml
bed82b1
bed82b1
rm -f %{buildroot}%{_bindir}/run-tests
bed82b1
bed82b1
%files -f %{name}.lang -f gtk2_%{name}.lang -f gtkmm2ext3.lang -f %{name}-datafiles.list
bed82b1
%license COPYING gpl-3.0.txt LICENSING
bed82b1
%{_bindir}/%{name}
bed82b1
%{_bindir}/%{name}-copy-mixer
bed82b1
%{_bindir}/%{name}-export
bed82b1
%{_bindir}/%{name}-lua
bed82b1
%{_bindir}/%{name}-new_empty_session
bed82b1
%{_bindir}/%{name}-new_session
bed82b1
%config(noreplace) %{_sysconfdir}/%{name}
bed82b1
%{_libdir}/%{name}
bed82b1
%{_datadir}/icons/hicolor/*/apps/%{name}.png
bed82b1
%{_datadir}/applications/%{name}.desktop
bed82b1
# intentionally unversioned
bed82b1
%{_datadir}/mime/packages/ardour.xml
bed82b1
%{_datadir}/appdata/%{name}.appdata.xml
bed82b1
%{_mandir}/man1/%{name}.1*
bed82b1
bed82b1
%changelog
bed82b1
%autochangelog