Wrap ROS Python scripts

This commit is contained in:
hacker1024 2023-07-30 11:28:13 +10:00 committed by Ben Wolsieffer
parent dc92e61225
commit 8f7ca8f00f

View file

@ -11,7 +11,8 @@
, dontWrapQtApps ? true
, nativeBuildInputs ? [ ]
, CXXFLAGS ? ""
, passthru ? {}
, postFixup ? ""
, passthru ? { }
, ...
}@args:
@ -36,6 +37,8 @@ else stdenv.mkDerivation) (args // {
nativeBuildInputs = nativeBuildInputs ++ [ pythonPackages.setuptools ];
dontWrapPythonPrograms = true;
buildPhase = ''
runHook preBuild
@ -53,4 +56,11 @@ else stdenv.mkDerivation) (args // {
runHook postInstall
'';
postFixup = ''
${postFixup}
find "$out/lib" -mindepth 1 -maxdepth 1 -type d ! -name '${pythonPackages.python.libPrefix}' -print0 | while read -d '''''' d; do
wrapPythonProgramsIn "$d" "$out $pythonPath"
done
'';
})