File Maim.spec of Package Maim

#
# spec file for package Maim
#
# 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:           Maim
Version:        1.0.0+git.5.b028907
Release:        0
Summary:        Audio plugin for custom MP3 distortion and digital glitches 
License:        GPL-3.0-only
URL:            https://github.com/ArdenButterfield/Maim/
Source0:        %{name}-%{version}.tar.gz
BuildRequires:  JUCE7_05-devel
BuildRequires:  Mesa-libGL-devel
BuildRequires:  cmake >= 3.22
%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
MAIM is an audio plugin that circuit bends an MP3 encoder in real time,
disrupting the control flow sending data down unexpected paths to create
digital distortions. With heavily hacked real MP3 encoders at its core,
MAIM gives you the full gamut of digital distortion, from the realistic
to the fantastical.

%package -n vst-%{name}
Summary:        Audio plugin for custom MP3 distortion and digital glitches (VST)

%description -n vst-%{name}
MAIM is an audio plugin that circuit bends an MP3 encoder in real time,
disrupting the control flow sending data down unexpected paths to create
digital distortions. With heavily hacked real MP3 encoders at its core,
MAIM gives you the full gamut of digital distortion, from the realistic
to the fantastical.

%package -n vst3-%{name}
Summary:        Audio plugin for custom MP3 distortion and digital glitches (VST3)

%description -n vst3-%{name}
MAIM is an audio plugin that circuit bends an MP3 encoder in real time,
disrupting the control flow sending data down unexpected paths to create
digital distortions. With heavily hacked real MP3 encoders at its core,
MAIM gives you the full gamut of digital distortion, from the realistic
to the fantastical.

%package -n lv2-%{name}
Summary:        Audio plugin for custom MP3 distortion and digital glitches (LV2)

%description -n lv2-%{name}
MAIM is an audio plugin that circuit bends an MP3 encoder in real time,
disrupting the control flow sending data down unexpected paths to create
digital distortions. With heavily hacked real MP3 encoders at its core,
MAIM gives you the full gamut of digital distortion, from the realistic
to the fantastical.

%prep
%setup -q

sed -i -e 's/AUv3/LV2\ VST\ Standalone/' CMakeLists.txt
sed -i -e 's/add_subdirectory(JUCE)/find_package(JUCE)/' CMakeLists.txt
sed -i -e '/COMPANY_NAME Wildergarden/a \    LV2URI "https://github.com/ArdenButterfield/Maim/"' CMakeLists.txt
sed -i -e '/JUCE_USE_CURL=0/a \    JUCE_JACK=1' CMakeLists.txt

%build
pushd Source/lib/lame
./configure CFLAGS="-fPIC"  --disable-frontend --enable-expopt=full --disable-shared --enable-static
make %{?_smp_mflags}
popd
%cmake -DLAME_LIB=Source/lib/lame/libmp3lame/.libs/libmp3lame.a \
%if 0%{?is_opensuse} && 0%{?suse_version} < 1600
       -DCMAKE_CXX_COMPILER=g++-12
%endif

%cmake_build

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

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

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

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

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

%changelog
openSUSE Build Service is sponsored by