summary refs log tree commit diff
path: root/pkgs/applications/audio/faust
diff options
context:
space:
mode:
authorJoachim Fasting <joachifm@fastmail.fm>2016-03-09 00:15:48 +0100
committerJoachim Fasting <joachifm@fastmail.fm>2016-03-10 15:32:18 +0100
commit2f73decba80dc354e3b4e56c267ce1e10200c084 (patch)
tree39325c0f2c9a9b01b6847d7b292dfbcae456adef /pkgs/applications/audio/faust
parent88ca16831291fafdb92efaf544846ea69ee68c15 (diff)
downloadnixlib-2f73decba80dc354e3b4e56c267ce1e10200c084.tar
nixlib-2f73decba80dc354e3b4e56c267ce1e10200c084.tar.gz
nixlib-2f73decba80dc354e3b4e56c267ce1e10200c084.tar.bz2
nixlib-2f73decba80dc354e3b4e56c267ce1e10200c084.tar.lz
nixlib-2f73decba80dc354e3b4e56c267ce1e10200c084.tar.xz
nixlib-2f73decba80dc354e3b4e56c267ce1e10200c084.tar.zst
nixlib-2f73decba80dc354e3b4e56c267ce1e10200c084.zip
faust2: fix build
Fixes https://github.com/NixOS/nixpkgs/issues/12749

The build failure was caused by brittle detection of the
llvm version. See the code for (excessive) details. This fix
is a quick hack, a proper fix would be to parse the version
of the input llvm derivation and use that to derive a proper
value. Here we just pin the version.

Also move build-time deps to `nativeBuildInputs`.
Diffstat (limited to 'pkgs/applications/audio/faust')
-rw-r--r--pkgs/applications/audio/faust/faust2.nix17
1 files changed, 16 insertions, 1 deletions
diff --git a/pkgs/applications/audio/faust/faust2.nix b/pkgs/applications/audio/faust/faust2.nix
index 4759f228e358..612a3dab99fe 100644
--- a/pkgs/applications/audio/faust/faust2.nix
+++ b/pkgs/applications/audio/faust/faust2.nix
@@ -37,7 +37,8 @@ let
 
     inherit src;
 
-    buildInputs = [ makeWrapper llvm emscripten openssl libsndfile pkgconfig libmicrohttpd vim ];
+    nativeBuildInputs = [ makeWrapper pkgconfig vim ];
+    buildInputs = [ llvm emscripten openssl libsndfile libmicrohttpd ];
 
 
     passthru = {
@@ -53,6 +54,20 @@ let
       # 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=3.7.0' -i compiler/Makefile.unix
     '';
 
     # Remove most faust2appl scripts since they won't run properly