A new user interface for you!

File carla.spec of Package carla

# spec file for package carla
# Copyright (c) 2016 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 http://bugs.opensuse.org/

%if 0%{?suse_version} == 1315
# Leap does not have it
%bcond_with rdflib
%bcond_without rdflib
Name:           carla
Version:        1.9.6git+20160305.f8933f9
Release:        0
Summary:        An audio plugin host
License:        GPL-2.0+
Group:          Productivity/Multimedia/Sound/Utilities
Url:            http://kxstudio.sourceforge.net/cadence
Source:         %{name}-%{version}.tar.xz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  alsa-devel
BuildRequires:  file-devel
BuildRequires:  python-qt4-devel

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

%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:  liblinuxsampler-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 has some nice features like automation of parameters via MIDI CC and full OSC control.
Currently supports LADSPA, DSSI, LV2, VST2/3 and AU plugin formats, plus GIG, SF2 and SFZ
sounds banks.


1. Carla-Control is not available in the 2.0-beta versions yet
2. Linux release has support for bridging Window plugins using Wine (32bit and 64bit)
3. Linux 32bit release will not load 64bit plugins even if ran on a 64bit system
4. MacOS release is 64bit only but it can load 32bit plugins
5. Windows builds do not support bridges (ie, 32bit plugins on a 64bit Carla) or Carla as a plugin

%package devel
Summary:        Header files to access Carlas API
Group:          Development/Libraries
BuildRequires:  pkg-config

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

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

%description vst
Carla vst plugins including CarlaPatchbayFX, CarlaPatchbay, CarlaRackFX, CarlaRack

%setup -q
sed -i -e "s/__DATE__/\"openSUSE\"/" -e "s/__TIME__/\"BuildService\"/" source/native-plugins/zynaddsubfx/main.cpp
sed -i -e "s/__DATE__/\"openSUSE\"/" source/modules/juce_core/time/juce_Time.cpp

export CXXFLAGS="%{optflags}"
export CFLAGS="%{optflags}"

%if 0%{?suse_version}
sed -i 's:pyuic4:py3uic4:' Makefile
sed -i 's:wildcard /:wildcard $(DESTDIR)/:' Makefile
make %{?_smp_mflags} features

# bulding with high -j numbers often results in build failures, thus we're disabling _smp_flags for now 
%if 0%{?suse_version} > 1310
# make %{?_smp_mflags} --trace
make --trace
# Old make
# make %{?_smp_mflags}

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 carla_modgui.py carla_settings.py digitalpeakmeter.py pixmapdial.py pixmapkeyboard.py; 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 INSTALL.md README.md 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