File vst3sdk.spec of Package vst3sdk

#
# spec file for package vst3sdk
#
# Copyright (c) 2023 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/
#


%define package_name vst3sdk
%define package_version 3.7.3
%define build_id 20
%define vstgui_version 4_10_1
Name:           %{package_name}
Version:        3.7.8
Release:        0
Summary:        VST3 Software Development Kit
#BSD 3-clause, Expat License, SIL Open Font License 1.1
License:        GPL-3.0-only AND BSD-3-Clause AND MIT AND OFL-1.1
Group:          Productivity/Multimedia/Sound/Utilities
##Patch1:         vst3sdk.1-fix-cxx-syntax.patch
URL:            https://github.com/steinbergmedia/vst3sdk
#NOTE:JK: no proper download link
#Source0:        https://www.steinberg.net/vst3sdk
#Source0:        vst-sdk_3.7.2_build-28_2021-03-30.zip
Source0:        %{package_name}-%{version}.tar.gz
BuildRequires:  cairo-devel
#BuildRequires:  libstdc++-devel
BuildRequires:  cmake
BuildRequires:  fontconfig-devel
BuildRequires:  gtkmm3-devel
BuildRequires:  libxcb-devel
BuildRequires:  libxkbcommon-x11-devel
BuildRequires:  sqlite3-devel
BuildRequires:  xcb-proto-devel
BuildRequires:  xcb-util-cursor-devel
BuildRequires:  xcb-util-devel
BuildRequires:  xcb-util-keysyms-devel
%if 0%{?suse_version} <= 1500
BuildRequires:  gcc11-c++
%else
BuildRequires:  gcc-c++
%endif

%description
A VST plug-in is an audio processing component that is utilized
within a host application. This software development kit contains
following development files:

* The VST 3 API
* VST 3 Implementation Helper Classes
* AAX, AU, AUv3 and VST 2 wrappers
* VST 3 plug-ins Examples

%package static-devel
Summary:        VST3 SDK development files
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description static-devel
A VST plug-in is an audio processing component that is utilized
within a host application. This contains the sample plugins of
the SDK.

%prep
%autosetup -p1

%build
%if 0%{?suse_version} <= 1500
export CC=gcc-11
export CXX=g++-11
%endif
export CPATH=%{_prefix}/include:%{_includedir}/X11:%{_includedir}/libxkbcommon
export CXXFLAGS="-include cstdio -include limits -std=c++2a"
%cmake \
       -DCMAKE_BUILD_TYPE=Release \
%if 0%{?suse_version} <= 1500
       -DCMAKE_CXX_COMPILER:FILEPATH=%{_bindir}/g++-11 \
       -DCMAKE_C_COMPILER:FILEPATH=%{_bindir}/gcc-11 \
%endif
       -DSMTG_CREATE_PLUGIN_LINK=0 ..
%make_jobs

%install
cd build
mkdir -p %{buildroot}%{_libdir}/vst3sdk
install -c -p -m 644 lib/Release/*.a %{buildroot}%{_libdir}/vst3sdk
mkdir -p %{buildroot}%{_libdir}/vst3
cp -a VST3/Release/* %{buildroot}%{_libdir}/vst3
mkdir -p %{buildroot}%{_includedir}/vst3sdk
cd ..
find . -type f -name "CMakeLists.txt" -exec cp --parents {} %{buildroot}%{_includedir}/vst3sdk \;
find . -type f -name "LICENSE.txt" -exec cp --parents {} %{buildroot}%{_includedir}/vst3sdk \;
find . -type f -name "*.h" -exec cp --parents {} %{buildroot}%{_includedir}/vst3sdk \;
find . -type f -name "*.cpp" -exec cp --parents {} %{buildroot}%{_includedir}/vst3sdk \;
find %{buildroot}%{_includedir}/vst3sdk -type f -name "CMakeLists.txt" -exec chmod 644 {} \;
find %{buildroot}%{_includedir}/vst3sdk -type f -name "LICENSE.txt" -exec chmod 644 {} \;
find %{buildroot}%{_includedir}/vst3sdk -type f -name "*.h" -exec chmod 644 {} \;
find %{buildroot}%{_includedir}/vst3sdk -type f -name "*.cpp" -exec chmod 644 {} \;

#Licenses need to be copied to unique names
cp -v doc/LICENSE.txt LICENSE.doc.txt
cp -v base/LICENSE.txt LICENSE.base.txt
cp -v pluginterfaces/LICENSE.txt LICENSE.pluginterfaces.txt
cp -v vstgui4/LICENSE LICENSE.vstgui4
cp -v vstgui4/vstgui/standalone/examples/minesweeper/resource/font/LCD14_LICENSE.ttx .
cp -v vstgui4/vstgui/uidescription/miniz/LICENSE LICENSE.miniz && chmod 0644 LICENSE.miniz
cp -v public.sdk/LICENSE.txt LICENSE.public.sdk.txt

%files
%license LICENSE.txt LICENSE.doc.txt LICENSE.base.txt LICENSE.pluginterfaces.txt LICENSE.vstgui4 LCD14_LICENSE.ttx LICENSE.miniz LICENSE.public.sdk.txt
%{_libdir}/vst3

%files static-devel
%doc doc
%{_includedir}/vst3sdk
%{_libdir}/vst3sdk

%changelog
openSUSE Build Service is sponsored by