File audacity.spec of Package audacity

# spec file for package audacity
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%if 0%{?suse_version} >= 1330 || 0%{?leap_version} >= 420300
%bcond_without mad
%bcond_with mad

Name:           audacity
Version:        2.2.2
Release:        0
Summary:        A Multi Track Digital Audio Editor
License:        GPL-2.0+
Group:          Productivity/Multimedia/Sound/Editors and Convertors
Source1:        audacity-license-nyquist
Source2:        audacity-rpmlintrc
# PATCH-FIX-OPENSUSE audacity-no_buildstamp.patch -- Remove the buildstamp.
Patch0:         audacity-no_buildstamp.patch
# PATCH-FIX-OPENSUSE audacity-flacversion.patch -- Patch to fix build against libflac 1.3.1+.
Patch1:         audacity-flacversion.patch
# PATCH-FIX-UPSTREAM audacity-no_return_in_nonvoid.patch
Patch3:         audacity-no_return_in_nonvoid.patch
Patch2:         audacity-misc-errors.patch
# PATCH-FIX-CVE-2020-11867 audacity-CVE-2020-11867.patch
Patch4:         audacity-CVE-2020-11867.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  cmake
BuildRequires:  desktop-file-utils
#Audacity only builds with gcc >= 4.9
# WARNING: Anything built against wxWidgets with gcc >= 5 needs widgets built with relax-abi.diff and gcc >= 5
%if 0%{?suse_version} < 1330
BuildRequires:  cpp7
BuildRequires:  gcc7
BuildRequires:  gcc7-c++
BuildRequires:  gcc-c++
#!BuildIgnore:  gstreamer-0_10-plugins-base
BuildRequires:  hicolor-icon-theme
BuildRequires:  wxWidgets-3_0-nostl-devel
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(expat)
BuildRequires:  pkgconfig(flac) >= 1.3.1
BuildRequires:  pkgconfig(flac++)
BuildRequires:  pkgconfig(gtk+-2.0) >= 2.4.0
BuildRequires:  pkgconfig(id3tag)
BuildRequires:  pkgconfig(jack)
BuildRequires:  pkgconfig(libavcodec) = 57.107.100
BuildRequires:  pkgconfig(libavformat) = 57.83.100
BuildRequires:  pkgconfig(libavutil) = 55.78.100
BuildRequires:  pkgconfig(lilv-0) >= 0.16
BuildRequires:  pkgconfig(lv2)
BuildRequires:  pkgconfig(ogg)
BuildRequires:  pkgconfig(shared-mime-info)
BuildRequires:  pkgconfig(sndfile)
BuildRequires:  pkgconfig(soundtouch)
BuildRequires:  pkgconfig(soxr)
BuildRequires:  pkgconfig(suil-0) >= 0.8.2
BuildRequires:  pkgconfig(vamp-hostsdk)
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(vorbisenc)
BuildRequires:  pkgconfig(vorbisfile)
%if %{with mad}
BuildRequires:  libmp3lame-devel
BuildRequires:  pkgconfig(mad)
BuildRequires:  pkgconfig(twolame)
# This would require to patch our portaudio package with "PortMixer"... an extra API that never got integrated in PortAudio.
#BuildRequires:  portaudio-devel
Recommends:     %{name}-lang
Requires:       libmp3lame0
Requires:       libFLAC++6 >= 1.3.1
Requires:       libFLAC8 >= 1.3.1

Audacity is a program that manipulates digital audio wave forms.
In addition to multitrack recording capabilities with effects, it
imports and exports many sound file formats, including WAV, AIFF,
AU, IRCAM, MP, and Ogg Vorbis. Wave data larger than the available
physical memory size can be edited.


%setup -q -n %{name}-Audacity-%{version}
%autopatch -p1

# Make sure we use the system versions.
rm -rf lib-src/{expat,libvamp,libsoxr,ffmpeg}/
%if %{with mad}
rm -rf lib-src/lame

# WARNING: Do not alter, only for Leap.
test -x "$(type -p %{_bindir}/gcc-7)" && export CC="%{_bindir}/gcc-7"
test -x "$(type -p %{_bindir}/g++-7)" && export CXX="%{_bindir}/g++-7"
test -x "$(type -p %{_bindir}/cpp-7)" && export CPP="%{_bindir}/cpp-7"

export CFLAGS="%{optflags} -fno-strict-aliasing"
export CXXFLAGS="$CFLAGS -std=gnu++11"
aclocal -I m4
%configure \
%ifnarch %ix86 x86_64
  --disable-sse                \
  --with-ffmpeg=system \
%if %{with mad}
  --with-libmad=system \
  --with-libtwolame=system \
  --with-lame=system \
  --without-libmad \
  --without-libtwolame \

make %{?_smp_mflags}


# E-mail wrote to
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/mimetypes/
mv -f %{buildroot}%{_datadir}/pixmaps/gnome-mime-application-x-audacity-project.xpm \
rm -rf %{buildroot}%{_datadir}/pixmaps/
%find_lang %{name}



%doc README.txt
%doc %{_docdir}/%{name}/
%dir %{_datadir}/appdata/

%files lang -f %{name}.lang

openSUSE Build Service is sponsored by