Commit da415351 authored by FliegendeWurst's avatar FliegendeWurst
Browse files

faust2: fix cross / strictDeps build

parent f28864e0
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -78,12 +78,24 @@ let
      passthru = { inherit wrap wrapWithBuildEnv faust2ApplBase; };

      preConfigure = ''
        # include llvm-config in path
        export PATH="${lib.getDev llvm_18}/bin:$PATH"
        cd build
        sed -i 's@LIBNCURSES_PATH ?= .*@LIBNCURSES_PATH ?= ${ncurses_static}/lib/libncurses.a@'  Make.llvm.static
        substituteInPlace Make.llvm.static \
          --replace 'mkdir -p $@ && cd $@ && ar -x ../../$<' 'mkdir -p $@ && cd $@ && ar -x ../source/build/lib/libfaust.a && cd ../source/build/'
        substituteInPlace Make.llvm.static \
          --replace 'rm -rf $(TMP)' ' '
          --replace 'rm -rf $(TMP)' ' ' \
          --replace-fail "ar" "${stdenv.cc.targetPrefix}ar"
        sed -i 's@LIBNCURSES_PATH ?= .*@LIBNCURSES_PATH ?= ${ncurses_static}/lib/libncurses.a@'  Make.llvm.static
        cd ..
        shopt -s globstar
        for f in **/Makefile **/Makefile.library **/CMakeLists.txt build/Make.llvm.static embedded/faustjava/faust2engine architecture/autodiff/autodiff.sh source/tools/faust2appls/* **/llvm.cmake tools/benchmark/faust2object; do
          echo $f "llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}"
          substituteInPlace $f \
            --replace-quiet "llvm-config" "llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}"
        done
        shopt -u globstar
        cd build
      '';

      cmakeFlags = [