File nam-juce.spec of Package nam-juce

#
# spec file for package nam-juce
#
# Copyright (c) 2021 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:           nam-juce
Version:        0.4.0+git.1.77e29aa
Release:        0
Summary:        A JUCE implementation of the Neural Amp Modeler Plugin
License:        GPL-3.0-only
URL:            https://github.com/Tr3m/nam-juce
Source0:        %{name}-%{version}.tar.xz
BuildRequires:  JUCE7-devel
BuildRequires:  Mesa-libGL-devel
BuildRequires:  cmake
%if 0%{?is_opensuse} && 0%{?suse_version} <= 1600
BuildRequires:  gcc12
BuildRequires:  gcc12-c++
%else
BuildRequires:  gcc-c++
%endif
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

A JUCE implementation of Steven Atkinson's NeuralAmpModelerPlugin https://github.com/sdatkinson/NeuralAmpModelerPlugin

%package -n vst-%{name}
Summary:        %{summary} (VST)

%description -n vst-%{name}
A JUCE implementation of Steven Atkinson's NeuralAmpModelerPlugin https://github.com/sdatkinson/NeuralAmpModelerPlugin

%package -n vst3-%{name}
Summary:        %{summary} (VST3)

%description -n vst3-%{name}
A JUCE implementation of Steven Atkinson's NeuralAmpModelerPlugin https://github.com/sdatkinson/NeuralAmpModelerPlugin

%package -n lv2-%{name}
Summary:        %{summary} (LV2)

%description -n lv2-%{name}
A JUCE implementation of Steven Atkinson's NeuralAmpModelerPlugin https://github.com/sdatkinson/NeuralAmpModelerPlugin

%prep
%setup -q

sed -i -e '/COMPANY_NAME/a \    LV2URI "%{URL}"' CMakeLists.txt
sed -i -e 's/FORMATS AU/FORMATS LV2 VST/' CMakeLists.txt
sed -i -e '/JUCE_USE_CURL=0/a \    JUCE_JACK=1' CMakeLists.txt

%build
%cmake -DCMAKE_SKIP_BUILD_RPATH=ON \
       -DCMAKE_PREFIX_PATH=/usr/lib64/juce7/lib/cmake \
%if 0%{?is_opensuse} && 0%{?suse_version} <= 1600
       -DCMAKE_CXX_COMPILER=g++-12 \
       -DCMAKE_C_COMPILER=gcc-12
%endif
%{nil}
%cmake_build

%install
mkdir -p %{buildroot}%{_bindir}
install build/NEURAL_AMP_MODELER_artefacts/RelWithDebInfo/Standalone/* %{buildroot}%{_bindir}/
mkdir -p %{buildroot}%{_libdir}/vst
install build/NEURAL_AMP_MODELER_artefacts/RelWithDebInfo/VST/*.so %{buildroot}%{_libdir}/vst/
mkdir -p %{buildroot}%{_libdir}/vst3
cp -r build/NEURAL_AMP_MODELER_artefacts/RelWithDebInfo/VST3/*.vst3 %{buildroot}%{_libdir}/vst3/
mkdir -p %{buildroot}%{_libdir}/lv2
cp -r build/NEURAL_AMP_MODELER_artefacts/RelWithDebInfo/LV2/*.lv2 %{buildroot}%{_libdir}/lv2/

%files
%{_bindir}/*
%license LICENSE.txt
%doc README.md

%files -n vst-%{name}
%{_libdir}/vst/
%doc README.md
%license LICENSE.txt

%files -n vst3-%{name}
%{_libdir}/vst3/
%doc README.md
%license LICENSE.txt

%files -n lv2-%{name}
%{_libdir}/lv2/
%doc README.md
%license LICENSE.txt

%changelog
openSUSE Build Service is sponsored by