File JUCE7_05.spec of Package JUCE7_05

#
# spec file for package JUCE
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2022 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 distname JUCE7_05
Name:           JUCE
Version:        7.0.5+git102.505285bb
Release:        0
Summary:        The JUCE cross-platform C++ framework https://juce.com
License:        ISC AND GPL-3.0-only AND BSD-3-Clause AND Apache-2.0
Group:          Productivity/Multimedia/Sound/Utilities
URL:            https://github.com/juce-framework/JUCE/
Source0:        https://github.com/juce-framework/JUCE/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        juce_VSTInterface.h
Source3:        Projucer.desktop
Source4:        Projucer.png
Source5:        AudioPluginHost.desktop
Source6:        AudioPluginHost.png
Patch0:         LV2-Host-Avoid-removing-anchors-from-plugin-URIs-when-loading-editors.patch
Patch2:         JUCE7-cmake-libdir-path.patch
Patch98:        JUCE7-Use-old-JUCE-VST2-interface.patch
Patch99:        AudioPluginHost-cmake.patch
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  ladspa-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xinerama)
BuildRequires:  pkgconfig(xrandr)
BuildRequires:  pkgconfig(xcursor)
%if %{defined fedora}
BuildRequires:  jack-audio-connection-kit-devel
%else
BuildRequires:  libjack-devel
%endif
Conflicts:     JUCE7
%description

JUCE is an open-source cross-platform C++ application framework used for rapidly developing high quality desktop and mobile applications, including VST, AU (and AUv3), RTAS and AAX audio plug-ins.
JUCE can be easily integrated with existing projects or can be used as a project generation tool via the Projucer, which supports exporting projects for Xcode (macOS and iOS), Visual Studio, Android Studio,
Code::Blocks, CLion and Linux Makefiles as well as containing a source code editor and live-coding engine which can be used for rapid prototyping.

%package -n %{distname}-Projucer
Summary:        Projucer IDE from the JUCE project
Group:          Development/Tools/Other
Conflicts:     JUCE7-Projucer
Provides:      Projucer

%description -n %{distname}-Projucer

The Projucer is a convenient application that allows you to develop, manage and deploy cross-platform applications in conjunction with your preferred IDE

%package -n %{distname}-AudioPluginHost
Summary:        AudioPluginHost from the JUCE project
Group:          Development/Tools/Other
Conflicts:     JUCE7-AudioPluginHost

%description -n %{distname}-AudioPluginHost

The AudioPluginHost is a simple VST/VST3/LADSPA/LV2 host made in JUCE Framework.

%package -n %{distname}-devel
Summary:        JUCE modules and build tools from the JUCE project
Group:          Development/Libraries/C and C++
Conflicts:      JUCE7-devel

%description -n %{distname}-devel

JUCE is an open-source cross-platform C++ application framework used for rapidly developing high quality desktop and mobile applications, including VST, AU (and AUv3), RTAS and AAX audio plug-ins.
JUCE can be easily integrated with existing projects or can be used as a project generation tool via the Projucer, which supports exporting projects for Xcode (macOS and iOS), Visual Studio, Android Studio,
Code::Blocks, CLion and Linux Makefiles as well as containing a source code editor and live-coding engine which can be used for rapid prototyping.

%package -n %{distname}-source
Summary:        The sources of the JUCE project
Group:          Development/Libraries/C and C++
BuildArch:      noarch

%description -n %{distname}-source

JUCE is an open-source cross-platform C++ application framework used for rapidly developing high quality desktop and mobile applications, including VST, AU (and AUv3), RTAS and AAX audio plug-ins.
JUCE can be easily integrated with existing projects or can be used as a project generation tool via the Projucer, which supports exporting projects for Xcode (macOS and iOS), Visual Studio, Android Studio,
Code::Blocks, CLion and Linux Makefiles as well as containing a source code editor and live-coding engine which can be used for rapid prototyping.

%prep
%setup -q
%autopatch -p1

cp %{SOURCE1} modules/juce_audio_processors/format_types/

%if 0%{?suse_version} > 1500
sed -i 's/webkit2gtk-4.0/webkit2gtk-4.1/' extras/Build/CMake/JUCEUtils.cmake
sed -i 's/webkit2gtk-4.0/webkit2gtk-4.1/' extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp
%endif

%build
%cmake -DJUCE_BUILD_EXTRAS=ON \
       -DJUCE_INSTALL_DESTINATION="%{_lib}/cmake/JUCE-7.0.5" \
       -DJUCE_GLOBAL_VST2_SDK_PATH=/usr/include \
       -DJUCE_TOOL_INSTALL_DIR=bin
%cmake_build

%install
%cmake_install

mkdir -p %{buildroot}%{_bindir}

%if %{defined fedora}
install redhat-linux-build/extras/Projucer/Projucer_artefacts/Projucer %{buildroot}%{_bindir}
install redhat-linux-build/extras/AudioPluginHost/AudioPluginHost_artefacts/AudioPluginHost %{buildroot}%{_bindir}
%else
install build/extras/Projucer/Projucer_artefacts/RelWithDebInfo/Projucer %{buildroot}%{_bindir}
install build/extras/AudioPluginHost/AudioPluginHost_artefacts/RelWithDebInfo/AudioPluginHost %{buildroot}%{_bindir}
%endif

mkdir -p %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_datadir}/pixmaps
cp %{SOURCE3} %{buildroot}%{_datadir}/applications/
cp %{SOURCE4} %{buildroot}%{_datadir}/pixmaps
cp %{SOURCE5} %{buildroot}%{_datadir}/applications/
cp %{SOURCE6} %{buildroot}%{_datadir}/pixmaps

mkdir -p %{buildroot}%{_usrsrc}
rm -rf build
cp -r ../%{name}-%{version}  %{buildroot}%{_usrsrc}/

find %{buildroot}/%{_includedir} -type f -executable -exec chmod -x '{}' \;
find %{buildroot}%{_usrsrc}/%{name}-%{version}/ -type f -executable -exec chmod -x '{}' \;
%fdupes -s %{buildroot}%{_usrsrc}/%{name}-%{version}/

%posttrans -n %{distname}-source
if [[ -e %{_usrsrc}/%{distname} ]]; then rm %{_usrsrc}/%{distname}; fi; ln -s %{_usrsrc}/%{name}-%{version} %{_usrsrc}/%{distname}

%preun -n %{distname}-source
if [[ -e %{_usrsrc}/%{distname} ]]; then rm %{_usrsrc}/%{distname}; fi

%files -n %{distname}-Projucer
%{_bindir}/Projucer
%{_datadir}/applications/Projucer.desktop
%{_datadir}/pixmaps/Projucer.png

%files -n %{distname}-AudioPluginHost
%{_bindir}/AudioPluginHost
%{_datadir}/applications/AudioPluginHost.desktop
%{_datadir}/pixmaps/AudioPluginHost.png

%files -n %{distname}-devel
%exclude %{_bindir}/Projucer
%exclude %{_bindir}/AudioPluginHost
%{_bindir}/*
%{_includedir}/*
%{_libdir}/*

%files -n %{distname}-source
%{_usrsrc}/%{name}-%{version}

%changelog
openSUSE Build Service is sponsored by