File carla.spec of Package carla

#
# spec file for package carla
#
# Copyright (c) 2019 Giordano Boschetti, GeekosDAW.
# Copyright (c) 2019 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 https://bugs.opensuse.org/
#


%define rev 9249bebbf5a8f2358cb912a5b8c429bc0c5b479b

%define __provides_exclude_from ^%{_libdir}/carla/jack/.*.so.0$
Name:           carla
Version:        2.2.0
Release:        0
Summary:        An audio plugin host
License:        GPL-2.0-or-later AND BSD-2-Clause AND BSD-3-Clause
Group:          Productivity/Multimedia/Sound/Utilities
URL:            https://kxstudio.linuxaudio.org/Applications:Carla
Source0:        https://github.com/falkTX/Carla/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        carla-warning
Source2:        bsd-2-clause.txt
#Patch0:         carla-systemlibs.patch
# PATCH-FIX-OPENSUSE -- Remove rpath from .pc files davejplater@gmail.com
Patch1:         carla-remove-pkgconf-rpath.patch
# Fix for default correct plugin location
Patch2:         defaut-plugins-libdir.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires: gcc gcc-c++
BuildRequires:  fdupes
BuildRequires:  file-devel
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  pkg-config
BuildRequires:  python3-devel
BuildRequires:  python3-qt5-devel
BuildRequires:  python3-rdflib
BuildRequires:  libgobject-2_0-0
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(flac)
BuildRequires:  ffmpeg-devel
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(sndfile)
BuildRequires:  pkgconfig(vorbisenc)
# for extra native plugins
BuildRequires:  non-ntk-fluid
BuildRequires:  pkgconfig(fftw3f)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(liblo)
BuildRequires:  pkgconfig(libprojectM)
BuildRequires:  pkgconfig(mxml)
BuildRequires:  pkgconfig(zlib)
# for plugin GUIs
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(x11)
# for extra samplers support
BuildRequires:  libfluidsynth-devel
BuildRequires:  sane-backends-devel
Requires:       python3-base
Requires:       python3-qt5
Requires:       python3-pyliblo

%description
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.
THIS BUILD add carla-bridges package for 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
Requires:       %{name}%{?_isa} = %{version}-%{release}

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

%package -n lv2-%{name}
Summary:        CarlaRack and CarlaPatchbay LV2 plugins
Group:          Productivity/Multimedia/Sound/Utilities
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description -n lv2-%{name}
This package contains the Carla LV2 plugin.

%package bridges
Summary: Bridges with support for Windows VST 64bit via wine
Group:          Productivity/Multimedia/Sound/Utilities
# for wine bridges
BuildRequires:  wine-devel, wine
BuildRequires:  mingw64-cross-gcc
BuildRequires:  mingw64-cross-gcc-c++
Requires:       wine
Requires:       %{name}%{?_isa} = %{version}-%{release}

%package bridges-32bit
Summary: Bridges with support for Linux 32bit VST and Windows VST 32bit via wine
Group:          Productivity/Multimedia/Sound/Utilities
# for wine bridges

BuildRequires:  wine-devel-32bit, wine-32bit
BuildRequires:  mingw32-cross-gcc
BuildRequires:  mingw32-cross-gcc-c++
BuildRequires:  glibc-devel-32bit
BuildRequires:  gcc-c++-32bit gcc-32bit
BuildRequires:  libX11-devel-32bit
BuildRequires:  freetype2-devel-32bit
BuildRequires:  libXext-devel-32bit
Requires:       wine
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description bridges
Bridges with support for Windows VST 64bit via wine

%description bridges-32bit
Bridges with support for Linux 32bit VST and Windows VST 32bit via wine


%prep
%autosetup -p1 -n Carla-%{version}
rm -rf data/windows/unzipfx-carla-control data/windows/unzipfx-carla
#for i in `grep -rl "/usr/bin/env python3"`;do $(sed -i '1s/^#!.*/#!\/usr\/bin\/python3/' ${i}; chmod +x ${i}) ;done

%build

# list build configuration, no need for optflags or -j
make features

make %{?_smp_mflags}\
%ifnarch %ix86 x86_64
	BASE_OPTS= \
%endif
	--trace
# build native bridge 32bit
make %{?_smp_mflags} posix32

export CXXFLAGS="-fno-stack-protector"
# build wine bridge 32bit - require mingw32
make %{?_smp_mflags} win32 CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++

# build wine bridge 64bit - require mingw64
make %{?_smp_mflags} win64 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++

export JACKBRIDGE_FLAGS="-D__WIDL_objidl_generated_name_0000000C="
unset LDFLAGS
make %{?_smp_mflags} wine32
make %{?_smp_mflags} wine64

%install
make install DESTDIR=%{buildroot} PREFIX="%{_prefix}" LIBDIR="%{_libdir}"

pushd %{buildroot}
for i in `grep -rl "/usr/bin/env python"`;do $(sed -i '1s/^#!.*/#!\/usr\/bin\/python3/' ${i}; chmod +x ${i}) ;done
for i in `grep -rl "/usr/bin/env python3"`;do $(sed -i '1s/^#!.*/#!\/usr\/bin\/python3/' ${i}; chmod +x ${i}) ;done
for i in `grep -rl "/usr/bin/python3"`;do chmod +x ${i} ;done
popd

cp -v source/modules/lilv/serd-0.24.0/tests/TurtleTests/LICENSE LICENSE.TurtleTests

# 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}
%endif

%files
%defattr(-,root,root)
%doc README.md
%license doc/GPL.txt doc/LGPL.txt
%{_bindir}/*
%dir %{_libdir}/carla
%exclude %{_libdir}/carla/*.exe
%exclude %{_libdir}/carla/*.dll
%exclude %{_libdir}/carla/*posix32
%{_libdir}/carla/*
%dir %{_datadir}/carla
%{_datadir}/carla/*
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/
%{_datadir}/mime/packages/carla.xml

%files bridges
%dir %{_libdir}/carla
%{_libdir}/carla/*64.exe
%{_libdir}/carla/*64.dll
%dir %{_libdir}/lv2
%dir %{_libdir}/lv2/carla.lv2
%{_libdir}/lv2/carla.lv2/*64.exe
%{_libdir}/lv2/carla.lv2/*64.dll
%dir %{_libdir}/vst
%dir %{_libdir}/vst/carla.vst
%{_libdir}/vst/carla.vst/*64.exe
%{_libdir}/vst/carla.vst/*64.dll

%files bridges-32bit
%dir %{_libdir}/carla
%{_libdir}/carla/*32.exe
%{_libdir}/carla/*32.dll
%{_libdir}/carla/*posix32
%dir %{_libdir}/lv2
%dir %{_libdir}/lv2/carla.lv2
%{_libdir}/lv2/carla.lv2/*32.exe
%{_libdir}/lv2/carla.lv2/*32.dll
%{_libdir}/lv2/carla.lv2/*posix32
%dir %{_libdir}/vst
%dir %{_libdir}/vst/carla.vst
%{_libdir}/vst/carla.vst/*32.exe
%{_libdir}/vst/carla.vst/*32.dll
%{_libdir}/vst/carla.vst/*posix32

%files -n lv2-%{name}
%defattr(-,root,root)
%dir %{_libdir}/lv2
%dir %{_libdir}/lv2/carla.lv2
%exclude %{_libdir}/lv2/carla.lv2/*.exe
%exclude %{_libdir}/lv2/carla.lv2/*.dll
%exclude %{_libdir}/lv2/carla.lv2/*posix32
%{_libdir}/lv2/carla.lv2/*

%files vst
%defattr(-,root,root)
%dir %{_libdir}/vst
%dir %{_libdir}/vst/carla.vst
%exclude %{_libdir}/vst/carla.vst/*.exe
%exclude %{_libdir}/vst/carla.vst/*.dll
%exclude %{_libdir}/vst/carla.vst/*posix32
%{_libdir}/vst/carla.vst/*

%files devel
%defattr(-,root,root)
%dir %{_includedir}/carla
%{_includedir}/carla/*
%{_libdir}/pkgconfig/*

%changelog
openSUSE Build Service is sponsored by