2020-04-24 23:36:52 +00:00
|
|
|
{ faust
|
2021-06-28 23:13:55 +00:00
|
|
|
, alsa-lib
|
2023-07-15 17:15:38 +00:00
|
|
|
, qtbase
|
|
|
|
, writeText
|
|
|
|
, makeWrapper
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2023-07-15 17:15:38 +00:00
|
|
|
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
|
2020-04-24 23:36:52 +00:00
|
|
|
faust.wrapWithBuildEnv {
|
|
|
|
|
|
|
|
baseName = "faust2alqt";
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-06-28 23:13:55 +00:00
|
|
|
alsa-lib
|
2023-07-15 17:15:38 +00:00
|
|
|
qtbase
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00: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
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|