File purrdata-faustgen2.spec of Package purrdata-faustgen2

# Maintainer: <aggraef at gmail.com>

# installation directory
%define pdlibdir /opt/purr-data/lib/pd-l2ork

# XXXFIXME: Debianism. We use that version number for convenience here since
# we actually use the Debian snapshot (.orig tarball) to build the package. Is
# there a versioning scheme for git packages in RPM land that we should use?
Name:           purrdata-faustgen2
Version:        2.2.0+git520+ec2f802
Release:        1%{?dist}
Summary:        Faust external for Pd
Group:          Development/Libraries
URL:            https://github.com/agraef/pd-faustgen
License:        MIT
Source0:        %{name}_%{version}.orig.tar.gz
BuildRequires:  gcc-c++, cmake, make, llvm-devel, ncurses-static

%description
"The Faust compiler in a box:" faustgen2~ is a Faust external for Pd
a.k.a. Pure Data, Miller Puckette's interactive multimedia programming
environment. Yann Orlarey's Faust is a functional programming language
developed by Grame, which is tailored for real-time signal processing and
synthesis.

faustgen2~ is based on Pierre Guillot's faustgen~ which in turn was inspired
by Grame's faustgen~ object for Max/MSP. It uses Faust's LLVM-based
just-in-time (JIT) compiler to load, compile and play Faust programs on the
fly. faustgen2~ is an extensive update which offers plenty of new
functionality such as MIDI, polyphony, Scala tunings, OSC, and Pd GUI support,
as well as a Pd loader extension for Faust.

%prep
%setup -q -n pd-faustgen2-2.2.0

# XXXFIXME: For some reason the compiled binaries don't include any debug
# info, so we need to disable debug packages for now to prevent an error from
# rpmbuild. (While the OBS doesn't build any debug packages anyway, we'd like
# to be able to build them locally at least.)
%global debug_package %{nil}

%build
# Not sure why Fedora's llvm-config prints multiple lines here, fix it.
LLVMLIBS=$(llvm-config --ldflags --link-shared --libs engine | tr '\n' ' ')
mkdir -p build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX="%{pdlibdir}" -DINSTALL_DIR="extra/faustgen2~" -DUSE_LLVM_CONFIG=off -Dllvm_libs="$LLVMLIBS"
make

%install
rm -rf $RPM_BUILD_ROOT
cd build
make install DESTDIR=$RPM_BUILD_ROOT

%files
%license LICENSE
%{pdlibdir}

%changelog
* Wed Jul 27 2022 Albert Graef <aggraef@gmail.com>
- Initial release
openSUSE Build Service is sponsored by