faust: 2.5.23 -> 2.20.2

This commit is contained in:
Bart Brouns 2020-01-27 12:48:57 +01:00 committed by Frederik Rietdijk
parent 4562d76dde
commit bd90b5a5cf
4 changed files with 40 additions and 42 deletions

View File

@ -3,25 +3,30 @@
, fetchFromGitHub , fetchFromGitHub
, makeWrapper , makeWrapper
, pkgconfig , pkgconfig
, cmake
, llvm , llvm
, emscripten , emscripten
, openssl , openssl
, libsndfile , libsndfile
, libmicrohttpd , libmicrohttpd
, gnutls
, libtasn1
, p11-kit
, vim , vim
, which
}: }:
with stdenv.lib.strings; with stdenv.lib.strings;
let let
version = "2.5.23"; version = "2.20.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "grame-cncm"; owner = "grame-cncm";
repo = "faust"; repo = "faust";
rev = version; rev = version;
sha256 = "1pci8ac6sqrm3mb3yikmmr3iy35g3nj4iihazif1amqkbdz719rc"; sha256 = "08hv8gyj6c83128z3si92r1ka5ckf9sdpn5jdnlhrqyzja4mrxsy";
fetchSubmodules = true; fetchSubmodules = true;
}; };
@ -40,8 +45,8 @@ let
inherit src; inherit src;
nativeBuildInputs = [ makeWrapper pkgconfig vim ]; nativeBuildInputs = [ makeWrapper pkgconfig cmake vim which ];
buildInputs = [ llvm emscripten openssl libsndfile libmicrohttpd ]; buildInputs = [ llvm emscripten openssl libsndfile libmicrohttpd gnutls libtasn1 p11-kit ];
passthru = { passthru = {
@ -50,39 +55,13 @@ let
preConfigure = '' preConfigure = ''
makeFlags="$makeFlags prefix=$out LLVM_CONFIG='${llvm}/bin/llvm-config' world" cd build
# The faust makefiles use 'system ?= $(shell uname -s)' but nix
# defines 'system' env var, so undefine that so faust detects the
# correct system.
unset system
# sed -e "232s/LLVM_STATIC_LIBS/LLVMLIBS/" -i compiler/Makefile.unix
# The makefile sets LLVM_<version> depending on the current llvm
# version, but the detection code is quite brittle.
#
# Failing to properly detect the llvm version means that the macro
# LLVM_VERSION ends up being the raw output of `llvm-config --version`, while
# the code assumes that it's set to a symbol like `LLVM_35`. Two problems result:
# * <command-line>:0:1: error: macro names must be identifiers.; and
# * a bunch of undefined reference errors due to conditional definitions relying on
# LLVM_XY being defined.
#
# For now, fix this by 1) pinning the llvm version; 2) manually setting LLVM_VERSION
# to something the makefile will recognize.
sed '52iLLVM_VERSION=${stdenv.lib.getVersion llvm}' -i compiler/Makefile.unix
''; '';
postPatch = '' cmakeFlags = ''
# fix build with llvm 5.0.2 by adding it to the list of known versions -C ../backends/all.cmake -C ../targets/all.cmake ..
# TODO: check if still needed on next update
substituteInPlace compiler/Makefile.unix \
--replace "5.0.0 5.0.1" "5.0.0 5.0.1 5.0.2"
''; '';
# Remove most faust2appl scripts since they won't run properly
# without additional paths setup. See faust.wrap,
# faust.wrapWithBuildEnv.
postInstall = '' postInstall = ''
# syntax error when eval'd directly # syntax error when eval'd directly
pattern="faust2!(*@(atomsnippets|graph|graphviewer|md|plot|sig|sigviewer|svg))" pattern="faust2!(*@(atomsnippets|graph|graphviewer|md|plot|sig|sigviewer|svg))"
@ -90,10 +69,6 @@ let
''; '';
postFixup = '' postFixup = ''
# Set faustpath explicitly.
substituteInPlace "$out"/bin/faustpath \
--replace "/usr/local /usr /opt /opt/local" "$out"
# The 'faustoptflags' is 'source'd into other faust scripts and # The 'faustoptflags' is 'source'd into other faust scripts and
# not used as an executable, so patch 'uname' usage directly # not used as an executable, so patch 'uname' usage directly
# rather than use makeWrapper. # rather than use makeWrapper.
@ -160,8 +135,6 @@ let
# 'faustoptflags' to absolute paths. # 'faustoptflags' to absolute paths.
for script in "$out"/bin/*; do for script in "$out"/bin/*; do
substituteInPlace "$script" \ substituteInPlace "$script" \
--replace ". faustpath" ". '${faust}/bin/faustpath'" \
--replace ". faustoptflags" ". '${faust}/bin/faustoptflags'" \
--replace " error " "echo" --replace " error " "echo"
done done
''; '';
@ -200,19 +173,22 @@ let
propagatedBuildInputs = [ faust ] ++ propagatedBuildInputs; propagatedBuildInputs = [ faust ] ++ propagatedBuildInputs;
libPath = stdenv.lib.makeLibraryPath propagatedBuildInputs;
postFixup = '' postFixup = ''
# export parts of the build environment # export parts of the build environment
for script in "$out"/bin/*; do for script in "$out"/bin/*; do
wrapProgram "$script" \ wrapProgram "$script" \
--set FAUSTLDDIR "${faust}/lib" \
--set FAUSTLIB "${faust}/share/faust" \ --set FAUSTLIB "${faust}/share/faust" \
--set FAUST_LIB_PATH "${faust}/share/faust" \
--set FAUSTINC "${faust}/include/faust" \ --set FAUSTINC "${faust}/include/faust" \
--set FAUSTARCH "${faust}/share/faust" \
--prefix PATH : "$PATH" \ --prefix PATH : "$PATH" \
--prefix PKG_CONFIG_PATH : "$PKG_CONFIG_PATH" \ --prefix PKG_CONFIG_PATH : "$PKG_CONFIG_PATH" \
--set NIX_CFLAGS_COMPILE "$NIX_CFLAGS_COMPILE" \ --set NIX_CFLAGS_COMPILE "$NIX_CFLAGS_COMPILE" \
--set NIX_LDFLAGS "$NIX_LDFLAGS" --set NIX_LDFLAGS "$NIX_LDFLAGS -lpthread" \
--prefix LIBRARY_PATH $libPath
done done
''; '';
}); });

View File

@ -1,6 +1,7 @@
{ faust { faust
, gtk2 , gtk2
, jack2Full , jack2Full
, alsaLib
, opencv , opencv
, libsndfile , libsndfile
}: }:
@ -18,6 +19,7 @@ faust.wrapWithBuildEnv {
propagatedBuildInputs = [ propagatedBuildInputs = [
gtk2 gtk2
jack2Full jack2Full
alsaLib
opencv opencv
libsndfile libsndfile
]; ];

View File

@ -0,0 +1,18 @@
{ stdenv
, faust
, libjack2
, cargo
, binutils
, gcc
, gnumake
, openssl
, pkgconfig
}:
faust.wrapWithBuildEnv {
baseName = "faust2jackrust";
propagatedBuildInputs = [ libjack2 cargo binutils gcc gnumake openssl pkgconfig ];
}

View File

@ -24759,7 +24759,7 @@ in
faust1 = callPackage ../applications/audio/faust/faust1.nix { }; faust1 = callPackage ../applications/audio/faust/faust1.nix { };
faust2 = callPackage ../applications/audio/faust/faust2.nix { faust2 = callPackage ../applications/audio/faust/faust2.nix {
llvm = llvm_5; llvm = llvm_9;
}; };
faust2alqt = callPackage ../applications/audio/faust/faust2alqt.nix { }; faust2alqt = callPackage ../applications/audio/faust/faust2alqt.nix { };
@ -24772,6 +24772,8 @@ in
faust2jack = callPackage ../applications/audio/faust/faust2jack.nix { }; faust2jack = callPackage ../applications/audio/faust/faust2jack.nix { };
faust2jackrust = callPackage ../applications/audio/faust/faust2jackrust.nix { };
faust2jaqt = callPackage ../applications/audio/faust/faust2jaqt.nix { }; faust2jaqt = callPackage ../applications/audio/faust/faust2jaqt.nix { };
faust2ladspa = callPackage ../applications/audio/faust/faust2ladspa.nix { }; faust2ladspa = callPackage ../applications/audio/faust/faust2ladspa.nix { };