Unverified Commit e64b8e89 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #215561 from magnetophon/faust_QT5

faust: replace qt4 with qt5
parents 38616ad5 7735e9b1
Loading
Loading
Loading
Loading
+29 −3
Original line number Diff line number Diff line
{ faust
, alsa-lib
, qt4
, qtbase
, writeText
, makeWrapper
}:

let
  # Wrap the binary coming out of the the compilation script, so it knows QT_PLUGIN_PATH
  wrapBinary = writeText "wrapBinary" ''
    source ${makeWrapper}/nix-support/setup-hook
    for p in $FILES; do
      workpath=$PWD
      cd -- "$(dirname "$p")"
      binary=$(basename --suffix=.dsp "$p")
      rm -f .$binary-wrapped
      wrapProgram $binary --set QT_PLUGIN_PATH "${qtbase}/${qtbase.qtPluginPrefix}"
      sed -i $binary -e 's@exec@cd "$(dirname "$(readlink -f "''${BASH_SOURCE[0]}")")" \&\& exec@g'
      cd $workpath
    done
  '';
in
faust.wrapWithBuildEnv {

  baseName = "faust2alqt";

  propagatedBuildInputs = [
    alsa-lib
    qt4
    qtbase
  ];

  dontWrapQtApps = true;

  preFixup = ''
    for script in "$out"/bin/*; do
      # append the wrapping code to the compilation script
      cat ${wrapBinary} >> $script
      # prevent the qmake error when running the script
      sed -i "/QMAKE=/c\ QMAKE="${qtbase.dev}/bin/qmake"" $script
    done
  '';
}
+30 −3
Original line number Diff line number Diff line
{ faust
, jack2
, qt4
, qtbase
, libsndfile
, alsa-lib
, writeText
, makeWrapper
, which
}:

let
  # Wrap the binary coming out of the the compilation script, so it knows QT_PLUGIN_PATH
  wrapBinary = writeText "wrapBinary" ''
    source ${makeWrapper}/nix-support/setup-hook
    for p in $FILES; do
      workpath=$PWD
      cd -- "$(dirname "$p")"
      binary=$(basename --suffix=.dsp "$p")
      rm -f .$binary-wrapped
      wrapProgram $binary --set QT_PLUGIN_PATH "${qtbase}/${qtbase.qtPluginPrefix}"
      sed -i $binary -e 's@exec@cd "$(dirname "$(readlink -f "''${BASH_SOURCE[0]}")")" \&\& exec@g'
      cd $workpath
    done
  '';
in
faust.wrapWithBuildEnv {

  baseName = "faust2jaqt";
@@ -17,10 +33,21 @@ faust.wrapWithBuildEnv {

  propagatedBuildInputs = [
    jack2
    qt4
    qtbase
    libsndfile
    alsa-lib
    which
  ];


  dontWrapQtApps = true;

  preFixup = ''
    for script in "$out"/bin/*; do
      # append the wrapping code to the compilation script
      cat ${wrapBinary} >> $script
      # prevent the qmake error when running the script
      sed -i "/QMAKE=/c\ QMAKE="${qtbase.dev}/bin/qmake"" $script
    done
  '';
}
+7 −3
Original line number Diff line number Diff line
{ boost
, faust
, lv2
, qt4
, qtbase
, which

}:

faust.wrapWithBuildEnv {

  baseName = "faust2lv2";

  propagatedBuildInputs = [ boost lv2 qt4 which ];
  propagatedBuildInputs = [ boost lv2 qtbase ];

  dontWrapQtApps = true;

  preFixup = ''
    sed -i "/QMAKE=/c\ QMAKE="${qtbase.dev}/bin/qmake"" "$out"/bin/faust2lv2;
  '';
}
+2 −0
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@ stdenv.mkDerivation rec {

  buildInputs = [ faust2jaqt faust2lv2 ];

  dontWrapQtApps = true;

  buildPhase = ''
    cd examples/physicalModeling

+0 −40
Original line number Diff line number Diff line
{ stdenv, lib, fetchFromGitHub, faust2jaqt, faust2lv2 }:

stdenv.mkDerivation rec {
  pname = "faustPhhysicalModeling";
  version = "2.20.2";

  src = fetchFromGitHub {
    owner = "grame-cncm";
    repo = "faust";
    rev = version;
    sha256 = "1mm93ba26b7q69hvabzalg30dh8pl858nj4m2bb57pznnp09lq9a";
  };

  buildInputs = [ faust2jaqt faust2lv2 ];

  buildPhase = ''
    cd examples/physicalModeling/faust-stk

    for f in *.dsp; do
      faust2jaqt -time -vec  -midi -nvoices 8 -t 99999 $f
      faust2lv2  -time -vec -double -gui -nvoices 32 -t 99999 $f
    done
  '';

  installPhase = ''
    mkdir -p $out/lib/lv2 $out/bin
    mv *.lv2/ $out/lib/lv2
    for f in $(find . -executable -type f); do
      cp $f $out/bin/
    done
  '';
  meta = with lib; {
    broken = (stdenv.isLinux && stdenv.isAarch64);
    description = "The physical modeling instruments included with faust, compiled as jack standalone and lv2 instruments";
    homepage = "https://ccrma.stanford.edu/~rmichon/faustSTK/";
    license = licenses.stk;
    platforms = platforms.linux;
    maintainers = with maintainers; [ magnetophon ];
  };
}
Loading