openmolcas: fix shebangs in python scripts

patchShebangs replaces the shebang with the bare python
interpreter, but not with our defined environment.

This patch fixes the shebang manually and restores function
of all python scripts in $out/bin
This commit is contained in:
Markus Kowalewski 2024-11-04 14:14:01 +01:00
parent efd6331c95
commit fa58667f93

View File

@ -159,9 +159,10 @@ stdenv.mkDerivation rec {
noAuditTmpdir = true;
postFixup = ''
# Wrong store path in shebang (no Python pkgs), force re-patching
sed -i "1s:/.*:/usr/bin/env python:" $out/bin/pymolcas
patchShebangs $out/bin
# Wrong store path in shebang (bare Python, no Python pkgs), force manual re-patching
for exe in $(find $out/bin/ -type f -name "*.py"); do
sed -i "1s:.*:#!${python}/bin/python:" "$exe"
done
wrapProgram $out/bin/pymolcas --set MOLCAS $out
'';