From 076ebc5b5177af8743b597a4a17f63b37e63fc6b Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 22:13:36 +0100 Subject: [PATCH] package created using the webbuild interface [release 2.30.5-1mamba;Wed May 12 2021] --- README.md | 4 + faust-2.30.5-llvm-11.1.0.patch | 116 +++++++++++++++ faust-2.30.5-missing-include-limits.patch | 10 ++ ....5-sound2file-missing-include-limits.patch | 10 ++ faust.spec | 134 ++++++++++++++++++ 5 files changed, 274 insertions(+) create mode 100644 faust-2.30.5-llvm-11.1.0.patch create mode 100644 faust-2.30.5-missing-include-limits.patch create mode 100644 faust-2.30.5-sound2file-missing-include-limits.patch create mode 100644 faust.spec diff --git a/README.md b/README.md index fbfc749..900b086 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # faust +Faust (Functional Audio Stream) is a functional programming language specifically designed for real-time signal processing and synthesis. A distinctive characteristic of Faust is to be fully compiled. +The Faust compiler translates DSP specifications into very efficient code for various languages (C++, C, JAVA, LLVM IR, WebAssembly etc.) working at sample level. It targets high-performance signal processing applications, libraries and audio plug-ins for a variety of audio platforms and standards. A same Faust specification can be used to easily generate various kinds of native standalone applications, iOS and Android apps, as well as Csound, LADSPA, Max/MSP, PD, Q, SuperCollider, VST, AU plugins, etc. (see the README in the /architecture folder for an exhaustive list). +While there are Faust contributors everywhere across the globe, Faust is mainly being developed at Grame, Centre National de Creation Musicale (https://www.grame.fr), its birthplace. + diff --git a/faust-2.30.5-llvm-11.1.0.patch b/faust-2.30.5-llvm-11.1.0.patch new file mode 100644 index 0000000..2e0a244 --- /dev/null +++ b/faust-2.30.5-llvm-11.1.0.patch @@ -0,0 +1,116 @@ +diff -ruN a/compiler/generator/llvm/llvm_code_container.cpp b/compiler/generator/llvm/llvm_code_container.cpp +--- a/compiler/generator/llvm/llvm_code_container.cpp 2021-01-12 15:20:11.000000000 +0100 ++++ b/compiler/generator/llvm/llvm_code_container.cpp 2021-04-16 18:28:55.131765843 +0200 +@@ -77,7 +77,7 @@ + + // Set "-fast-math" + FastMathFlags FMF; +-#if defined(LLVM_80) || defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_120) ++#if defined(LLVM_80) || defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_111) || defined(LLVM_120) + FMF.setFast(); // has replaced the following function + #else + FMF.setUnsafeAlgebra(); +diff -ruN a/compiler/generator/llvm/llvm_dsp_aux.cpp b/compiler/generator/llvm/llvm_dsp_aux.cpp +--- a/compiler/generator/llvm/llvm_dsp_aux.cpp 2021-01-12 15:20:11.000000000 +0100 ++++ b/compiler/generator/llvm/llvm_dsp_aux.cpp 2021-04-16 18:30:44.412026167 +0200 +@@ -116,7 +116,7 @@ + { + if (llvm_dsp_factory_aux::gInstance++ == 0) { + // Install an LLVM error handler +- #if defined(__APPLE__) && (defined(LLVM_110) || defined(LLVM_120)) ++ #if defined(__APPLE__) && (defined(LLVM_110) || defined(LLVM_111) || defined(LLVM_120)) + #warning Crash on OSX with LLVM_11 or LLVM_12, so deactivated in this case + #else + LLVMInstallFatalErrorHandler(llvm_dsp_factory_aux::LLVMFatalErrorHandler); +diff -ruN a/compiler/generator/llvm/llvm_dynamic_dsp_aux.cpp b/compiler/generator/llvm/llvm_dynamic_dsp_aux.cpp +--- a/compiler/generator/llvm/llvm_dynamic_dsp_aux.cpp 2021-01-12 15:20:11.000000000 +0100 ++++ b/compiler/generator/llvm/llvm_dynamic_dsp_aux.cpp 2021-04-16 18:29:59.778586506 +0200 +@@ -65,7 +65,7 @@ + #include + #include + +-#if defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_120) ++#if defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_111) || defined(LLVM_120) + #include + #include + #endif +@@ -114,7 +114,7 @@ + string res; + raw_string_ostream out_str(res); + if (binary) { +-#if defined(LLVM_80) || defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_120) ++#if defined(LLVM_80) || defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_111) || defined(LLVM_120) + WriteBitcodeToFile(*fModule, out_str); + #else + WriteBitcodeToFile(fModule, out_str); +@@ -130,7 +130,7 @@ + { + string res; + raw_string_ostream out(res); +-#if defined(LLVM_80) || defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_120) ++#if defined(LLVM_80) || defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_111) || defined(LLVM_120) + WriteBitcodeToFile(*fModule, out); + #else + WriteBitcodeToFile(fModule, out); +@@ -147,7 +147,7 @@ + cerr << "ERROR : writeDSPFactoryToBitcodeFile could not open file : " << err.message(); + return false; + } +-#if defined(LLVM_80) || defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_120) ++#if defined(LLVM_80) || defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_111) || defined(LLVM_120) + WriteBitcodeToFile(*fModule, out); + #else + WriteBitcodeToFile(fModule, out); +@@ -285,11 +285,11 @@ + targetOptions.GuaranteedTailCallOpt = true; + targetOptions.NoTrappingFPMath = true; + +-#if defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_120) ++#if defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_111) || defined(LLVM_120) + targetOptions.NoSignedZerosFPMath = true; + #endif + +-#if defined(LLVM_110) || defined(LLVM_120) ++#if defined(LLVM_110) || defined(LLVM_111) || defined(LLVM_120) + targetOptions.setFPDenormalMode(DenormalMode::getIEEE()); + #else + targetOptions.FPDenormalMode = FPDenormal::IEEE; +@@ -434,7 +434,7 @@ + + legacy::PassManager pass; + +-#if defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_120) ++#if defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_111) || defined(LLVM_120) + if (TheTargetMachine->addPassesToEmitFile(pass, dest, nullptr, CGFT_ObjectFile)) { + #elif defined(LLVM_80) || defined(LLVM_90) + if (TheTargetMachine->addPassesToEmitFile(pass, dest, nullptr, TargetMachine::CGFT_ObjectFile)) { +diff -ruN a/compiler/generator/llvm/llvm_instructions.hh b/compiler/generator/llvm/llvm_instructions.hh +--- a/compiler/generator/llvm/llvm_instructions.hh 2021-01-12 15:20:11.000000000 +0100 ++++ b/compiler/generator/llvm/llvm_instructions.hh 2021-04-16 18:30:28.765322226 +0200 +@@ -238,7 +238,7 @@ + + list fMathLibTable; // All standard math functions + +-#if defined(LLVM_80) || defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_120) ++#if defined(LLVM_80) || defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_111) || defined(LLVM_120) + map fUnaryIntrinsicTable; // LLVM unary intrinsic + map fBinaryIntrinsicTable; // LLVM binary intrinsic + #endif +@@ -312,7 +312,7 @@ + fTypeMap[Typed::kObj_ptr] = dsp_ptr; + fAllocaBuilder = new IRBuilder<>(fModule->getContext()); + +- #if defined(LLVM_80) || defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_120) ++ #if defined(LLVM_80) || defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_111) || defined(LLVM_120) + + /* This does not work in visit(FunCallInst* inst) for intrinsic, which are deactivated for now + call_inst->addAttribute(AttributeList::FunctionIndex, Attribute::Builtin); +@@ -839,7 +839,7 @@ + fCurValue = generateFunPolymorphicMinMax(fun_args[0], fun_args[1], kLT); + } else if (checkMax(inst->fName) && fun_args.size() == 2) { + fCurValue = generateFunPolymorphicMinMax(fun_args[0], fun_args[1], kGT); +- #if defined(LLVM_80) || defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_120) ++ #if defined(LLVM_80) || defined(LLVM_90) || defined(LLVM_100) || defined(LLVM_110) || defined(LLVM_111) || defined(LLVM_120) + // LLVM unary intrinsic + } else if (fUnaryIntrinsicTable.find(inst->fName) != fUnaryIntrinsicTable.end()) { + diff --git a/faust-2.30.5-missing-include-limits.patch b/faust-2.30.5-missing-include-limits.patch new file mode 100644 index 0000000..b300a54 --- /dev/null +++ b/faust-2.30.5-missing-include-limits.patch @@ -0,0 +1,10 @@ +--- faust-2.30.5/architecture/faust/gui/JSONUI.h.orig 2021-05-12 20:53:48.232206302 +0200 ++++ faust-2.30.5/architecture/faust/gui/JSONUI.h 2021-05-12 20:54:03.421460949 +0200 +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + + #include "faust/gui/UI.h" + #include "faust/gui/PathBuilder.h" diff --git a/faust-2.30.5-sound2file-missing-include-limits.patch b/faust-2.30.5-sound2file-missing-include-limits.patch new file mode 100644 index 0000000..ee27556 --- /dev/null +++ b/faust-2.30.5-sound2file-missing-include-limits.patch @@ -0,0 +1,10 @@ +--- faust-2.30.5/tools/sound2faust/sound2file.cpp.orig 2021-06-18 22:13:55.425423287 +0200 ++++ faust-2.30.5/tools/sound2faust/sound2file.cpp 2021-06-18 22:14:16.269306979 +0200 +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #ifndef _WIN32 + #include diff --git a/faust.spec b/faust.spec new file mode 100644 index 0000000..279dddb --- /dev/null +++ b/faust.spec @@ -0,0 +1,134 @@ +Name: faust +Version: 2.30.5 +Release: 1mamba +Summary: Functional programming language for signal processing and sound synthesis +Group: Applications/Development +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://faust.grame.fr/ +Source: https://github.com/grame-cncm/faust/releases/download/%{version}/faust-%{version}.tar.gz +Patch0: faust-2.30.5-llvm-11.1.0.patch +Patch1: faust-2.30.5-missing-include-limits.patch +Patch2: faust-2.30.5-sound2file-missing-include-limits.patch +License: GPL +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libflac-devel +BuildRequires: libgcc +BuildRequires: libllvm-devel +BuildRequires: libmicrohttpd-devel +BuildRequires: libogg-devel +BuildRequires: libopus-devel +BuildRequires: libsndfile-devel +BuildRequires: libstdc++6-devel +BuildRequires: libvorbis-devel +## AUTOBUILDREQ-END +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description +Faust (Functional Audio Stream) is a functional programming language specifically designed for real-time signal processing and synthesis. A distinctive characteristic of Faust is to be fully compiled. +The Faust compiler translates DSP specifications into very efficient code for various languages (C++, C, JAVA, LLVM IR, WebAssembly etc.) working at sample level. It targets high-performance signal processing applications, libraries and audio plug-ins for a variety of audio platforms and standards. A same Faust specification can be used to easily generate various kinds of native standalone applications, iOS and Android apps, as well as Csound, LADSPA, Max/MSP, PD, Q, SuperCollider, VST, AU plugins, etc. (see the README in the /architecture folder for an exhaustive list). +While there are Faust contributors everywhere across the globe, Faust is mainly being developed at Grame, Centre National de Creation Musicale (https://www.grame.fr), its birthplace. + +%package -n lib%{name} +Group: System/Libraries +Summary: Shared libraries for %{name} + +%description -n lib%{name} +This package contains shared libraries for %{name}. + +%package -n lib%{name}-devel +Group: Development/Libraries +Summary: Development files for %{name} +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description -n lib%{name}-devel +This package contains libraries and header files for developing applications that use %{name}. + +%debug_package + +%prep +%setup -q +#-D -T +#:<< _EOF +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +%build +#:<< _EOF +export CC=clang +export CXX=clang++ + +cmake \ + -C build/backends/all.cmake \ + -C build/targets/all.cmake \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DLIBSDIR=%{_lib} \ + -DCMAKE_BUILD_TYPE='None' \ + -DINCLUDE_DYNAMIC=ON \ + -DINCLUDE_STATIC=ON \ + -DINCLUDE_ITP=ON \ + -B "faust-build" \ + -S build \ + -W no-dev \ +%ifarch arm + -DFAUST_LIBS="-latomic" +%endif + +%make -C faust-build +%make -C tools/sound2faust + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall PREFIX=%{_prefix} -C faust-build +%makeinstall PREFIX=%{_prefix} -C tools/sound2faust + +rm -f %{buildroot}%{_libdir}/ios-libsndfile.a + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post -n lib%{name} -p /sbin/ldconfig +%postun -n lib%{name} -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%{_bindir}/faust* +%{_bindir}/encoderunitypackage +%{_bindir}/filename2ident +%{_bindir}/sound2faust +%{_bindir}/sound2file +%{_bindir}/sound2reader +%{_bindir}/usage.sh +%dir %{_datadir}/faust +%{_datadir}/faust/* +%{_mandir}/man1/faust.1* + +%files -n lib%{name} +%defattr(-,root,root) +%{_libdir}/libHTTPDFaust.so.* +%{_libdir}/libOSCFaust.so.* +%{_libdir}/libfaustmachine.so.* +%{_libdir}/libfaust.so.* +%doc COPYING.txt + +%files -n lib%{name}-devel +%defattr(-,root,root) +%dir %{_includedir}/faust +%{_includedir}/faust/* +%{_libdir}/libHTTPDFaust.a +%{_libdir}/libHTTPDFaust.so +%{_libdir}/libOSCFaust.a +%{_libdir}/libOSCFaust.so +%{_libdir}/libfaust.a +%{_libdir}/libfaust.so +%{_libdir}/libfaustmachine.a +%{_libdir}/libfaustmachine.so +%doc README.md + + +%changelog +* Wed May 12 2021 Silvan Calarco 2.30.5-1mamba +- package created using the webbuild interface