File tunefish.spec of Package tunefish
# spec file for package tunefish
#
# Copyright (c) 2023 Konstantin Voinov
# Copyright (c) 2019 Fabio Pesari
#
# 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/
Name: tunefish
Version: 4.2.0+git.23.7e48ce8
Release: 0
Summary: Tunefish virtual analog synthesizer
Group: Productivity/Multimedia/Sound/Utilities
License: GPL-3.0
URL: https://github.com/paynebc/tunefish
Source0: tunefish-%{version}.tar.xz
Source1: generate-lv2-ttl.py
Source2: LV2.mak.in
Source3: AppConfig.h.in
Patch0: store-and-reload-program-names-in-presets.patch
BuildRequires: gcc-c++
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xinerama)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(freetype2)
BuildRequires: Mesa-libGL-devel
BuildRequires: libcurl-devel
BuildRequires: libXrandr-devel
BuildRequires: libXcursor-devel
BuildRequires: libjack-devel
BuildRequires: JUCE6-devel
BuildRequires: JUCE6-Projucer
BuildRequires: lv2-devel
BuildRequires: python3
%description
Tunefish is a small, efficient and powerful additive synth with a polished UI.
%package -n lv2-%{name}
Summary: Tunefish virtual analog synthesizer (LV2 version)
%description -n lv2-%{name}
Tunefish is a small, efficient and powerful additive synth with a polished UI.
This is the LV2 version of tunefish.
%package -n vst-%{name}
Summary: Tunefish virtual analog synthesizer (VST version)
%description -n vst-%{name}
Tunefish is a small, efficient and powerful additive synth with a polished UI.
This is the VST2 version of tunefish.
%package -n vst3-%{name}
Summary: Tunefish virtual analog synthesizer (VST3 version)
%description -n vst3-%{name}
Tunefish is a small, efficient and powerful additive synth with a polished UI.
This is the VST2 version of tunefish.
%prep
%setup -q
%autopatch -p1
cd src/tunefish4
mkdir -p JuceLibraryCode
cp -f %{SOURCE3} JuceLibraryCode/
cp %{SOURCE2} .
cp %{SOURCE1} .
sed -i -e 's/JUCEOPTIONS/JUCEOPTIONS JUCE_USE_CURL="0"/' Tunefish4.jucer
sed -i -e 's/useGlobalPath="0"/useGlobalPath="1"/' Tunefish4.jucer
sed -i -e 's/buildAU,buildAUv3,buildVST,buildVST3/buildStandalone,buildVST,buildVST3/' Tunefish4.jucer
sed -i -e 's/extraCompilerFlags="-fpermissive"/extraCompilerFlags="-fpermissive -DJUCE_MODAL_LOOPS_PERMITTED=1 -fvisibility=hidden" \
extraLinkerFlags="-fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-O1 -Wl,--as-needed -Wl,--strip-all"/' Tunefish4.jucer
%build
cd src/tunefish4
lv2uri=%{URL}
sed "s/_lv2uri_pattern_/${lv2uri//\//\\/}/g" JuceLibraryCode/AppConfig.h.in >JuceLibraryCode/AppConfig.h
sed "s/_juce_target_/%{name}/g" LV2.mak.in >LV2.mak
%define JUCE_VERSION `ls /usr/lib64/juce/include/`
Projucer --set-global-search-path linux defaultJuceModulePath %{_libdir}/juce/include/%{JUCE_VERSION}/modules
Projucer --resave Tunefish4.jucer
echo "include ../../LV2.mak" >> Builds/LinuxMakefile/Makefile
%make_build TARGET_ARCH=-Wl,--as-needed CONFIG=Release %{?_smp_mflags} -C Builds/LinuxMakefile
%install
mkdir -p %{buildroot}%{_libdir}/vst
install src/tunefish4/Builds/LinuxMakefile/build/Tunefish4.so %{buildroot}%{_libdir}/vst/
mkdir -p %{buildroot}%{_libdir}/vst3
cp -r src/tunefish4/Builds/LinuxMakefile/build/*.vst3 %{buildroot}%{_libdir}/vst3/
mkdir -p %{buildroot}%{_libdir}/lv2
cp -r src/tunefish4/Builds/LinuxMakefile/build/*.lv2 %{buildroot}%{_libdir}/lv2/
%files -n lv2-%{name}
%{_libdir}/lv2/
%doc README.md
%license COPYING
%files -n vst-%{name}
%{_libdir}/vst/
%doc README.md
%license COPYING
%files -n vst3-%{name}
%dir %{_libdir}/vst3
%{_libdir}/vst3/*
%doc README.md
%license COPYING
%changelog