File plugdata.spec of Package plugdata

#
# spec file for package plugdata
#
# 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/
#

%define source_date_epoch_from_changelog 0

Name:           plugdata
Version:        0.8.0+git.1.56f661f
Release:        0
Summary:        Pure Data as a plugin, with a new GUI
License:        GPL-3.0-only
Group:          Productivity/Multimedia/Sound/Midi
URL:            https://github.com/timothyschoen/PlugData/
Source0:        https://github.com/timothyschoen/PlugData/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        PlugData.desktop
BuildRequires:  cmake
%if 0%{?is_opensuse} && 0%{?suse_version} < 1600
BuildRequires:  gcc12-c++
%else
BuildRequires:  gcc-c++
%endif
BuildRequires:  pkgconfig
BuildRequires:  python3
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glu)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xcomposite)
BuildRequires:  pkgconfig(xcursor)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xi)
BuildRequires:  pkgconfig(xinerama)
BuildRequires:  pkgconfig(xrandr)
%if %{defined fedora}
BuildRequires:  jack-audio-connection-kit-devel
%elif 0%{?mageia} == 9
BuildRequires:  lib64jack-devel
%else
BuildRequires:  pkgconfig(jack)
%endif
Conflicts:      plugdata

%description

Plugin wrapper around PureData to allow patching in a wide selection of DAWs.

%package -n vst3-%{name}
Summary:        Pure Data as a plugin, with a new GUI (VST3)

%description -n vst3-%{name}

Plugin wrapper around PureData to allow patching in a wide selection of DAWs.

%package -n lv2-%{name}
Summary:        Pure Data as a plugin, with a new GUI (LV2)

%description -n lv2-%{name}

Plugin wrapper around PureData to allow patching in a wide selection of DAWs.

%package -n clap-%{name}
Summary:        Pure Data as a plugin, with a new GUI (CLAP)

%description -n clap-%{name}

Plugin wrapper around PureData to allow patching in a wide selection of DAWs.

%package full
Summary:        Pure Data as a plugin, with a new GUI (Standalone and Plugins meta package)
Requires:       %{name}-%{version}
Requires:       clap-%{name}-%{version}
Requires:       lv2-%{name}-%{version}
Requires:       vst3-%{name}-%{version}

%description full

This is meta package which installs Standalone version of PlugData and it's Plugin (VST3 and LV2) binaries.
PlugData is a plugin wrapper around PureData to allow patching in a wide selection of DAWs.

%prep
%autosetup -p1

sed -i '/JUCE_WEB_BROWSER=0/a JUCE_JACK=1' CMakeLists.txt

%build
%cmake -DBUILD_SHARED_LIBS:BOOL=OFF \
%ifarch armv7hl
        -DENABLE_SFONT=OFF
%endif
%if 0%{?is_opensuse} && 0%{?suse_version} < 1600
       -DCMAKE_C_COMPILER=gcc-12 \
       -DCMAKE_CXX_COMPILER=g++-12 \
%endif

%cmake_build

%install
mkdir -p %{buildroot}%{_bindir}
install Plugins/Standalone/* %{buildroot}%{_bindir}/
mkdir -p %{buildroot}%{_libdir}/vst3
cp -r Plugins/VST3/*.vst3 %{buildroot}%{_libdir}/vst3/
mkdir -p %{buildroot}%{_libdir}/lv2
cp -r Plugins/LV2/*.lv2 %{buildroot}%{_libdir}/lv2/
mkdir -p %{buildroot}%{_libdir}/clap
cp -r Plugins/CLAP/*.clap %{buildroot}%{_libdir}/clap/

mkdir -p %{buildroot}%{_datadir}/pixmaps
cp Resources/Icons/plugdata_logo.png %{buildroot}%{_datadir}/pixmaps/PlugData.png
mkdir -p %{buildroot}%{_datadir}/applications
cp %{SOURCE1} %{buildroot}%{_datadir}/applications/

%files
%{_bindir}/*
%license LICENSE
%doc README.md
%{_datadir}/pixmaps/
%{_datadir}/applications/

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

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

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

%files full
%doc README.md
%license LICENSE

%changelog
openSUSE Build Service is sponsored by