File Richter-Tremolo.spec of Package Richter-Tremolo

#
# spec file for package juce
#
# 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 binname Richter
Name:           Richter-Tremolo
Version:        2.0.2+git11.gfe418e8
Release:        0
Summary:        Four Oscillator Tremolo
License:        GPL-2.0-only
Group:          Productivity/Multimedia/Sound/Midi
URL:            https://github.com/jd-13/Richter-Tremolo
Source0:        %{name}-%{version}.tar.xz
Source1:        generate-lv2-ttl.py
Source2:        LV2.mak.in
Source3:        AppConfig.h.in
Source4:	WE-Core-0.1.5.tar.xz
Source6:        Montserrat-Regular.ttf
Patch1:		01-richter-tremolo-juce-string.patch
BuildRequires:  xorg-x11-libs
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xinerama)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  Mesa-libGL-devel
BuildRequires:  libXrandr-devel
BuildRequires:  libXcursor-devel
BuildRequires:	libjack-devel
BuildRequires:	libcurl-devel
BuildRequires:	JUCE-devel
BuildRequires:	JUCE-Projucer
BuildRequires:  xorg-x11-server
BuildRequires:  lv2-devel
BuildRequires:  python3

Requires:		alsa

%description

Richter is a two LFO tremolo, the interaction of which creates far more complex volume oscillations than can be created with a single LFO.
The rate and depth controls of each LFO can each be modulated by two more LFOs to create variations in frequency and depth, and tempo sync is available on all oscillators. 

https://www.whiteelephantaudio.com/plugins/richter

%package -n lv2-%{name}
Summary:        Four Oscillator Tremolo (LV2)

%description -n lv2-%{name}
Richter is a two LFO tremolo, the interaction of which creates far more complex volume oscillations than can be created with a single LFO.
The rate and depth controls of each LFO can each be modulated by two more LFOs to create variations in frequency and depth, and tempo sync is available on all oscillators. 

https://www.whiteelephantaudio.com/plugins/richter

%package -n vst-%{name}
Summary:        Four Oscillator Tremolo (VST)

%description -n vst-%{name}
Richter is a two LFO tremolo, the interaction of which creates far more complex volume oscillations than can be created with a single LFO.
The rate and depth controls of each LFO can each be modulated by two more LFOs to create variations in frequency and depth, and tempo sync is available on all oscillators. 

https://www.whiteelephantaudio.com/plugins/richter

%prep
%setup
%patch1 -p0

#mkdir -p JuceLibraryCode
tar xf %{SOURCE4}
mv WE-Core-0.1.5 WE-Core
mkdir -p JuceLibraryCode
cp -f %{SOURCE3} JuceLibraryCode/
cp %{SOURCE2} .
cp %{SOURCE1} .
cp %{SOURCE6} Source/Graphics/

sed -i -e 's/pluginFormats="buildVST,buildVST3,buildAU"/pluginFormats="buildStandalone,buildVST,buildVST3"/' %{binname}.jucer
sed -i -e 's/JUCEOPTIONS/JUCEOPTIONS JUCE_JACK="1" JUCE_WEB_BROWSER="0"/'  %{binname}.jucer
sed -i -e 's/name="Release"/name="Release" headerPath="..\/..\/WE-Core\/WECore\/"/'   %{binname}.jucer
sed -i -e 's/useLocalCopy="0"/useLocalCopy="0" useGlobalPath="1"/' %{binname}.jucer
sed -i -e '/<MODULES id="juce_audio_formats" showAllCode="1" useLocalCopy="0" useGlobalPath="1"\/>/a <MODULES id="juce_audio_utils" showAllCode="1" useLocalCopy="0" useGlobalPath="1"\/>'  %{binname}.jucer

lv2uri="https://whiteelephantaudio.com/plugins/Richter-Tremolo/"
sed "s/_lv2uri_pattern_/${lv2uri//\//\\/}/g" JuceLibraryCode/AppConfig.h.in >JuceLibraryCode/AppConfig.h
sed "s/_juce_target_/%{binname}/g" LV2.mak.in >LV2.mak

%build


%define X_display ":98"


#############################################
### Launch a virtual framebuffer X server ###
#############################################
export DISPLAY=%{X_display}
Xvfb %{X_display} >& Xvfb.log &
trap "kill $! || true" EXIT
sleep 4

Projucer --set-global-search-path linux defaultJuceModulePath /usr/share/juce/modules
Projucer --resave %{binname}.jucer
echo "include ../../LV2.mak" >> Builds/LinuxMakefile/Makefile

cd Builds/LinuxMakefile
V=1 CONFIG=Release make %{?_smp_mflags}

%install

mkdir -p %{buildroot}%{_bindir}
install Builds/LinuxMakefile/build/%{binname} %{buildroot}%{_bindir}/
mkdir -p %{buildroot}%{_libdir}/vst
install Builds/LinuxMakefile/build/%{binname}.so %{buildroot}%{_libdir}/vst/
mkdir -p %{buildroot}%{_libdir}/lv2
cp -r Builds/LinuxMakefile/build/*.lv2 %{buildroot}%{_libdir}/lv2/


%files 
%{_bindir}/%{binname}
%doc README.md
%license License
%files -n vst-%{name}
%dir %{_libdir}/vst
%{_libdir}/vst/%{binname}.so
%doc README.md
%license License
%files -n lv2-%{name}
%dir %{_libdir}/lv2
%{_libdir}/lv2/*
%doc README.md
%license License
%changelog