File carla.spec of Package carla

# spec file for package carla
# 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} == 1315
# Leap does not have it
%bcond_with rdflib
%bcond_without rdflib
Name:           carla
Version:        1.9.7+git20171111.5b97ec1e
Release:        0
Summary:        An audio plugin host
License:        GPL-2.0-or-later
Group:          Productivity/Multimedia/Sound/Utilities
ExclusiveArch:  x86_64
Source:         %{name}-%{version}.tar.xz
Patch1:         carla-systemlibs.patch
Patch2:         carla.libjack-soversion.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  alsa-devel
BuildRequires:  file-devel
BuildRequires:  python-qt4-devel
BuildRequires:  pkgconfig(flac)
BuildRequires:  pkgconfig(vorbisenc)

%if %{defined fedora}
BuildRequires:  pulseaudio-libs-devel
BuildRequires:  python3-PyQt4-devel
Requires:       python3-PyQt4
BuildRequires:  qt5-qtbase-devel
BuildRequires:  libpulse-devel
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  python3-qt4-devel
Requires:       python3-qt4

%if 0%{?suse_version}
BuildRequires:  fdupes
BuildRequires:  python3-devel
BuildRequires:  update-desktop-files
%if %{with rdflib}
# optional but recommended
BuildRequires:  python3-rdflib

# for extra native plugins
BuildRequires:  fftw3-devel
BuildRequires:  fltk-devel
BuildRequires:  fluidsynth-devel
BuildRequires:  zlib-devel
# for plugin GUIs
BuildRequires:  gtk2-devel
BuildRequires:  gtk3-devel
BuildRequires:  libX11-devel
# for extra samplers support
BuildRequires:  libgig-devel
BuildRequires:  liblo-devel
BuildRequires:  libqt4-devel
BuildRequires:  mxml-devel
BuildRequires:  pkg-config

Carla is an audio plugin host, with support for many audio drivers
and plugin formats. It features automation of parameters via MIDI CC
and full OSC control. It currently supports LADSPA, DSSI, LV2, VST2/3
and AU plugin formats, plus GIG, SF2 and SFZ sounds banks.
It futher supports bridging Window plugins using Wine.

%package devel
Summary:        Header files to access Carla's API
Group:          Development/Libraries/C and C++
BuildRequires:  pkg-config

%description devel
This package contains header files needed when writing software using
Carla's several APIs.

%package vst
Summary:        CarlaRack and CarlaPatchbay VST plugins
Group:          Productivity/Multimedia/Sound/Utilities

%description vst
This package contanis Carla VST plugins, including CarlaPatchbayFX,
CarlaPatchbay, CarlaRackFX, and CarlaRack.

%setup -q
%patch1 -p1
%patch2 -p1

rm -rfv source/modules/juce_audio_formats/codecs/flac
rm -rfv source/modules/juce_audio_formats/codecs/oggvorbis
export CXXFLAGS="%{optflags}"
export CFLAGS="%{optflags}"

make \
%ifnarch %ix86 x86_64
	%{?_smp_mflags} \

# bulding with high -j numbers often results in build failures, thus we're disabling _smp_flags for now 
make \
%ifnarch %ix86 x86_64

make install DESTDIR=%{buildroot} PREFIX="%{_prefix}" LIBDIR="%{_libdir}"
# Move arch depended files (wrong installed)
mv %{buildroot}%{_datadir}/carla/resources/zynaddsubfx-ui %{buildroot}%{_libdir}/carla
ln -s %{_libdir}/carla/zynaddsubfx-ui %{buildroot}%{_datadir}/carla/resources/zynaddsubfx-ui
# flags
for file in; do
	chmod +x "%{buildroot}%{_datadir}/carla/$file"
# SUSE specific
%if 0%{?suse_version}
 %suse_update_desktop_file -r carla AudioVideo Music
 %suse_update_desktop_file -r carla-control AudioVideo Music
 %fdupes -s %{buildroot}%{_datadir}

%doc doc
%dir %{_libdir}/carla
%dir %{_libdir}/lv2
%dir %{_libdir}/lv2/carla.lv2
%dir %{_libdir}/python3
%dir %{_libdir}/python3/dist-packages
%dir %{_datadir}/carla

%files vst
%dir %{_libdir}/vst
%dir %{_libdir}/vst/carla.vst

%files devel
%dir %{_includedir}/carla

openSUSE Build Service is sponsored by