File vmpc2000xl.spec of Package vmpc2000xl
#
# spec file for package vmpc2000xl
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2023 Konstantin Voinov konstantin.voinov@gmail.com
#
# 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: vmpc2000xl
Version: 0.9.0.9+git.0.78704fa
Release: 0
Summary: JUCE implementation of VMPC2000XL
License: GPL-3.0-only
Group: Productivity/Multimedia/Sound
URL: https://github.com/izzyreal/vmpc-juce
Source0: %{name}-%{version}.tar.xz
Source1: akaifat-git.main.tar.xz
Source2: platformfolders-git.master.tar.xz
Source3: concurrentqueue-git.master.tar.xz
Source4: mpc-git.master.tar.xz
Source5: juce-raw-keyboard-input-module-git.main.tar.xz
Source6: rapidjson-git.master.tar.xz
Source7: Catch2-3.3.2.tar.xz
Source8: filesystem-1.5.14.tar.xz
Source9: expected-1.0.0.tar.xz
Source10: rtmidi-git.master.tar.xz
Source11: readerwriterqueue-git.master.tar.xz
Source12: json-3.11.3.tar.xz
Source13: juce-vmpc-7.0.9.tar.xz
Source14: melatonin_blur-git.main.tar.xz
Source15: libsamplerate-git.master.tar.xz
BuildRequires: cmake
%if 0%{?is_opensuse} && 0%{?suse_version} < 1600
BuildRequires: gcc12
BuildRequires: gcc12-c++
%else
BuildRequires: gcc-c++
%endif
BuildRequires: pkgconfig
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xinerama)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(xcomposite)
BuildRequires: pkgconfig(xrandr)
BuildRequires: pkgconfig(xcursor)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(udisks2)
BuildRequires: pkgconfig(rtmidi)
BuildRequires: pkgconfig(samplerate)
%if %{defined fedora}
BuildRequires: jack-audio-connection-kit-devel
BuildRequires: ninja-build
%else
BuildRequires: pkgconfig(jack)
BuildRequires: ninja
%endif
%description
JUCE implementation of VMPC2000XL, the Akai MPC2000XL emulator
%package -n vst3-%{name}
Summary: JUCE implementation of VMPC2000XL (VST3)
%description -n vst3-%{name}
JUCE implementation of VMPC2000XL, the Akai MPC2000XL emulator
%package -n lv2-%{name}
Summary: JUCE implementation of VMPC2000XL (LV2)
%description -n lv2-%{name}
JUCE implementation of VMPC2000XL, the Akai MPC2000XL emulator
%package full
Summary: JUCE implementation of VMPC2000XL (Standalone and Plugins meta package)
Requires: %{name}
Requires: vst3-%{name}
Requires: lv2-%{name}
%description full
This is meta package which installs Standalone version of VMPC2000XL and it's Plugin (VST3 and LV2) binaries.
%prep
%autosetup
tar xf %{SOURCE13} --strip-components=1 --one-top-level=editables/JUCE
tar xf %{SOURCE1} --strip-components=1 --one-top-level=editables/akaifat
tar xf %{SOURCE4} --strip-components=1 --one-top-level=editables/mpc
tar xf %{SOURCE5} --strip-components=1 --one-top-level=editables/juce-raw-keyboard-input-module
tar xf %{SOURCE2} --strip-components=1 --one-top-level=deps/platformfolders
tar xf %{SOURCE3} --strip-components=1 --one-top-level=deps/concurrentqueue
tar xf %{SOURCE6} --strip-components=1 --one-top-level=deps/rapidjson
tar xf %{SOURCE7} --strip-components=1 --one-top-level=deps/Catch2
tar xf %{SOURCE8} --strip-components=1 --one-top-level=deps/filesystem
tar xf %{SOURCE9} --strip-components=1 --one-top-level=deps/expected
tar xf %{SOURCE10} --strip-components=1 --one-top-level=deps/rtmidi
tar xf %{SOURCE11} --strip-components=1 --one-top-level=deps/readerwriterqueue
tar xf %{SOURCE12} --strip-components=1 --one-top-level=deps/json
tar xf %{SOURCE14} --strip-components=1 --one-top-level=deps/melatonin_blur
tar xf %{SOURCE15} --strip-components=1 --one-top-level=deps/libsamplerate
sed -i -e 's/JUCE_COPY_PLUGIN_AFTER_BUILD\ ON/JUCE_COPY_PLUGIN_AFTER_BUILD\ OFF/' CMakeLists.txt
sed -i -e 's/CMAKE_CURRENT_BINARY_DIR}\/melatonin_blur/CMAKE_SOURCE_DIR}\/deps\/melatonin_blur/' CMakeLists.txt
sed -i -e '/display = xWindowSystem->getDisplay();/d' editables/juce-raw-keyboard-input-module/raw_keyboard_input/src/LinuxKeyboard.cpp
%build
%cmake -DFETCHCONTENT_FULLY_DISCONNECTED=ON \
-DBUILD_SHARED_LIBS:BOOL=OFF \
%if 0%{?is_opensuse} && 0%{?suse_version} < 1600
-DCMAKE_CXX_COMPILER=g++-12 \
%endif
-DBUILD_STATIC_LIBS:BOOL=ON
%cmake_build
%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_libdir}/vst3
mkdir -p %{buildroot}%{_libdir}/lv2
%if %{defined fedora}
install redhat-linux-build/%{name}_artefacts/RelWithDebInfo/Standalone/* %{buildroot}%{_bindir}/
cp -r redhat-linux-build/%{name}_artefacts/RelWithDebInfo/VST3/*.vst3 %{buildroot}%{_libdir}/vst3/
cp -r redhat-linux-build/%{name}_artefacts/RelWithDebInfo/LV2/*.lv2 %{buildroot}%{_libdir}/lv2/
%else
install build/%{name}_artefacts/RelWithDebInfo/Standalone/* %{buildroot}%{_bindir}/
cp -r build/%{name}_artefacts/RelWithDebInfo/VST3/*.vst3 %{buildroot}%{_libdir}/vst3/
cp -r build/%{name}_artefacts/RelWithDebInfo/LV2/*.lv2 %{buildroot}%{_libdir}/lv2/
%endif
%files
%{_bindir}/*
%license LICENSE.txt
%doc README.md
%files -n vst3-%{name}
%{_libdir}/vst3/
%doc README.md
%license LICENSE.txt
%files -n lv2-%{name}
%{_libdir}/lv2/
%doc README.md
%license LICENSE.txt
%files full
%doc README.md
%license LICENSE.txt
%changelog