nixpkgs/pkgs/applications/audio/faust/faust2jaqt.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.1 KiB
Nix
Raw Normal View History

2015-03-23 18:01:27 +01:00
{ faust
2021-03-14 17:03:47 +01:00
, jack2
2023-04-03 16:04:07 +02:00
, qtbase
2018-01-05 23:24:06 +01:00
, libsndfile
, alsa-lib
2023-04-03 16:04:07 +02:00
, writeText
, buildPackages
, which
2015-03-23 18:01:27 +01:00
}:
2023-04-03 16:04:07 +02:00
let
# Wrap the binary coming out of the the compilation script, so it knows QT_PLUGIN_PATH
wrapBinary = writeText "wrapBinary" ''
source ${buildPackages.makeWrapper}/nix-support/setup-hook
2023-04-03 16:04:07 +02:00
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
2015-03-23 18:01:27 +01:00
faust.wrapWithBuildEnv {
baseName = "faust2jaqt";
scripts = [
"faust2jaqt"
"faust2jackserver"
];
propagatedBuildInputs = [
2021-03-14 17:03:47 +01:00
jack2
2023-04-03 16:04:07 +02:00
qtbase
2018-01-05 23:24:06 +01:00
libsndfile
alsa-lib
which
2015-03-23 18:01:27 +01:00
];
2023-04-03 16:04:07 +02:00
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
'';
2015-03-23 18:01:27 +01:00
}