File Wilsonic.spec of Package Wilsonic

#
# spec file for package Wilsonic
#
# Copyright (c) 2022 SUSE LLC
#
# 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/
#


Name:           Wilsonic
Version:        0.43beta+git.20.949f0c1
Release:        0
Summary:        Automate the microtonal scale designs of Erv Wilson in your DAW 
License:        MIT
Group:          Productivity/Multimedia/Sound/Midi
URL:            https://github.com/marcus-w-hobbs/Wilsonic-MTS-ESP
Source0:        %{URL}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  JUCE7_12-Projucer
BuildRequires:  JUCE7_12-devel
BuildRequires:  Mesa-libGL-devel
%if 0%{?is_opensuse} && 0%{?suse_version} < 1600
BuildRequires:  gcc12-c++
%else
BuildRequires:  gcc-c++
%endif
BuildRequires:  ladspa-devel
BuildRequires:  libXcursor-devel
BuildRequires:  libXrandr-devel
BuildRequires:  libcurl-devel
BuildRequires:  libjack-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xinerama)

%description
Wilsonic MTS-ESP is an advanced audio plugin and standalone application for creative sound design and music production.
It tunes up the software synthesizers in your DAW via MTS-ESP to the scale designs of Erv Wilson;
it has a simple synth that you can use to confirm your synths are all in tune.

The Wilsonic Controller target outputs MIDI, while also tuning up all soft synths in your DAW via MTS-ESP.
You can use WilsonicController to perform on Wilson's generalized keyboard designs.

%package -n vst3-%{name}
Summary:        Automate the microtonal scale designs of Erv Wilson in your DAW  (VST3)
%description -n vst3-%{name}
Wilsonic MTS-ESP is an advanced audio plugin and standalone application for creative sound design and music production.
It tunes up the software synthesizers in your DAW via MTS-ESP to the scale designs of Erv Wilson;
it has a simple synth that you can use to confirm your synths are all in tune.

The Wilsonic Controller target outputs MIDI, while also tuning up all soft synths in your DAW via MTS-ESP.
You can use WilsonicController to perform on Wilson's generalized keyboard designs.

%package -n lv2-%{name}
Summary:        Automate the microtonal scale designs of Erv Wilson in your DAW  (VST3)
%description -n lv2-%{name}
Wilsonic MTS-ESP is an advanced audio plugin and standalone application for creative sound design and music production.
It tunes up the software synthesizers in your DAW via MTS-ESP to the scale designs of Erv Wilson;
it has a simple synth that you can use to confirm your synths are all in tune.

The Wilsonic Controller target outputs MIDI, while also tuning up all soft synths in your DAW via MTS-ESP.
You can use WilsonicController to perform on Wilson's generalized keyboard designs.

%prep
%setup -q
sed -i -e 's#targetFolder="Builds/LinuxMakefile"#targetFolder="Builds/LinuxMakefile" extraCompilerFlags="-fvisibility=hidden -fpermissive" extraLinkerFlags="-fdata-sections \
           -ffunction-sections -Wl,--gc-sections -Wl,-O1 -Wl,--as-needed -Wl,--strip-all"#' %{name}.jucer

sed -i -e 's#targetFolder="Builds/LinuxMakefile"#targetFolder="Builds/LinuxMakefile" extraCompilerFlags="-fvisibility=hidden -fpermissive" extraLinkerFlags="-fdata-sections \
           -ffunction-sections -Wl,--gc-sections -Wl,-O1 -Wl,--as-needed -Wl,--strip-all"#' %{name}Controller.jucer

sed -i -e 's/JUCEOPTIONS/JUCEOPTIONS JUCE_JACK="1" JUCE_WEB_BROWSER="0" JUCE_USE_CURL="0"/' %{name}.jucer
sed -i -e 's/JUCEOPTIONS/JUCEOPTIONS JUCE_JACK="1" JUCE_WEB_BROWSER="0" JUCE_USE_CURL="0"/' %{name}Controller.jucer

sed -i -e 's/buildVST3/buildVST3,buildLV2/' %{name}.jucer
sed -i -e 's/buildVST3/buildVST3,buildLV2/' %{name}Controller.jucer

lv2uri=%{URL}
sed -i -e 's#jucerFormatVersion="1"#jucerFormatVersion="1" lv2Uri='"'$lv2uri'"'#' %{name}.jucer

%build
%if 0%{?is_opensuse} && 0%{?suse_version} < 1600
export CXX=g++-12
%endif

Projucer --set-global-search-path linux defaultJuceModulePath /usr/include/JUCE-*/modules
Projucer --resave %{name}.jucer
CONFIG=Release make %{?_smp_mflags} -C Builds/LinuxMakefile

mkdir -p tmpBuilds
cp Builds/LinuxMakefile/build/%{name} tmpBuilds/
cp -r Builds/LinuxMakefile/build/*.vst3 tmpBuilds/
cp -r Builds/LinuxMakefile/build/*.lv2 tmpBuilds/

rm -rf Builds/LinuxMakefile

Projucer --resave %{name}Controller.jucer
CONFIG=Release make %{?_smp_mflags} -C Builds/LinuxMakefile

%install

mkdir -p %{buildroot}%{_bindir}
install tmpBuilds/%{name} %{buildroot}%{_bindir}/
install Builds/LinuxMakefile/build/%{name}Controller %{buildroot}%{_bindir}/
mkdir -p %{buildroot}%{_libdir}/vst3
cp -r Builds/LinuxMakefile/build/*.vst3 %{buildroot}%{_libdir}/vst3/
cp -r tmpBuilds/*.vst3 %{buildroot}%{_libdir}/vst3/
mkdir -p %{buildroot}%{_libdir}/lv2
cp -r tmpBuilds/*.lv2 %{buildroot}%{_libdir}/lv2/
cp -r Builds/LinuxMakefile/build/*.lv2 %{buildroot}%{_libdir}/lv2/

%files
%{_bindir}/
%doc README.md daw_automated_params.txt

%files -n vst3-%{name}
%dir %{_libdir}/vst3
%{_libdir}/vst3/*
%doc README.md daw_automated_params.txt

%files -n lv2-%{name}
%dir %{_libdir}/lv2
%{_libdir}/lv2/*
%doc README.md daw_automated_params.txt

%changelog
openSUSE Build Service is sponsored by