File CHOW.spec of Package CHOW
#
# spec file for package juce
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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: CHOW
Version: 1.0.0+git18.g2fb7a15
Release: 1
Summary: CHOW - a maximally truculent distortion effect
License: GPL-3.0-Only
Group: Productivity/Multimedia/Sound/Utilities
URL: https://github.com/jatinchowdhury18/CHOW
Source0: %{name}-%{version}.tar.gz
Source1: generate-lv2-ttl.py
Source2: LV2.mak.in
Source3: AppConfig.h.in
BuildRequires: gcc-c++
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(jack)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xinerama)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(freetype2)
BuildRequires: Mesa-libGL-devel
BuildRequires: libXrandr-devel
BuildRequires: libXcursor-devel
BuildRequires: libjack-devel
BuildRequires: libcurl-devel
BuildRequires: ladspa-devel
BuildRequires: JUCE-devel
BuildRequires: JUCE-Projucer
BuildRequires: xorg-x11-server
BuildRequires: lv2-devel
BuildRequires: python3
Requires: alsa
%description
CHOW is a digital ditortion effect designed for maximum truculence, somewhere between a true half-wave rectifier and a noisy vintage compressor.
Useful for mixing guitars, drums, even vocals when a heavily degraded sound is desired. Feel free to build and use for your own enjoyment!
https://github.com/jatinchowdhury18/CHOW
%package -n lv2-%{name}
Summary: CHOW - a maximally truculent distortion effect (LV2)
%description -n lv2-%{name}
CHOW is a digital ditortion effect designed for maximum truculence, somewhere between a true half-wave rectifier and a noisy vintage compressor.
Useful for mixing guitars, drums, even vocals when a heavily degraded sound is desired. Feel free to build and use for your own enjoyment!
https://github.com/jatinchowdhury18/CHOW
%package -n vst-%{name}
Summary: CHOW - a maximally truculent distortion effect (VST)
%description -n vst-%{name}
CHOW is a digital ditortion effect designed for maximum truculence, somewhere between a true half-wave rectifier and a noisy vintage compressor.
Useful for mixing guitars, drums, even vocals when a heavily degraded sound is desired. Feel free to build and use for your own enjoyment!
https://github.com/jatinchowdhury18/CHOW
%prep
%setup -q
#%patch0 -p1
#%patch1 -p2
%build
#cd Plug-in
mkdir -p JuceLibraryCode
cp -f %{SOURCE3} JuceLibraryCode/
cp %{SOURCE2} .
cp %{SOURCE1} .
#%define _lto_cflags %{nil}
%define X_display ":98"
#sed -i -e /'<\/EXPORTFORMATS>/i <LINUX_MAKE targetFolder="Builds/LinuxMakefile">\ <CONFIGURATIONS>\ <CONFIGURATION isDebug="1" name="Debug"/>\ <CONFIGURATION isDebug="0" name="Release"/>\ </CONFIGURATIONS>\ <MODULEPATHS>\ </MODULEPATHS>\ </LINUX_MAKE>' %{name}.jucer
sed -i -e 's/pluginFormats="buildAU,buildVST3"/pluginFormats="buildStandalone,buildVST"/' %{name}.jucer
sed -i -e 's/JUCEOPTIONS/JUCEOPTIONS JUCE_JACK="1" JUCE_WEB_BROWSER="0" JUCE_USE_CURL="0"/' %{name}.jucer
lv2uri="https://github.com/jatinchowdhury18/CHOW"
sed "s/_lv2uri_pattern_/${lv2uri//\//\\/}/g" JuceLibraryCode/AppConfig.h.in >JuceLibraryCode/AppConfig.h
sed "s/_juce_target_/CHOW/g" LV2.mak.in >LV2.mak
#############################################
### Launch a virtual framebuffer X server ###
#############################################
export DISPLAY=%{X_display}
Xvfb %{X_display} >& Xvfb.log &
trap "kill $! || true" EXIT
sleep 10
Projucer --set-global-search-path linux defaultJuceModulePath /usr/share/juce/modules
Projucer --resave %{name}.jucer
echo "include ../../LV2.mak" >> Builds/LinuxMakefile/Makefile
cd Builds/LinuxMakefile
TARGET_ARCH=-Wl,--as-needed CONFIG=Release make %{?_smp_mflags}
%install
mkdir -p %{buildroot}%{_bindir}
install Builds/LinuxMakefile/build/%{name} %{buildroot}%{_bindir}/
mkdir -p %{buildroot}%{_libdir}/vst
install Builds/LinuxMakefile/build/%{name}.so %{buildroot}%{_libdir}/vst/
mkdir -p %{buildroot}%{_libdir}/lv2
cp -r Builds/LinuxMakefile/build/*.lv2 %{buildroot}%{_libdir}/lv2/
%files
%{_bindir}/%{name}
%doc README.md
%license LICENSE
%files -n lv2-%{name}
%{_libdir}/lv2/
%doc README.md
%license LICENSE
%files -n vst-%{name}
%dir %{_libdir}/vst
%{_libdir}/vst/
%doc README.md
%license LICENSE
%changelog