2811b032d6
Go beyond the obvious setup hooks now, with a bit of sed, with a skipped case: - cc-wrapper's `dontlink`, because it already is handled. Also, in nix files escaping was manually added. EMP
17 lines
637 B
Bash
17 lines
637 B
Bash
# Setup hook for checking whether Python imports succeed
|
|
echo "Sourcing python-imports-check-hook.sh"
|
|
|
|
pythonImportsCheckPhase () {
|
|
echo "Executing pythonImportsCheckPhase"
|
|
|
|
if [ -n "$pythonImportsCheck" ]; then
|
|
echo "Check whether the following modules can be imported: $pythonImportsCheck"
|
|
cd $out && eval "@pythonCheckInterpreter@ -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ[\"pythonImportsCheck\"].split()))'"
|
|
fi
|
|
}
|
|
|
|
if [ -z "${dontUsePythonImportsCheck-}" ]; then
|
|
echo "Using pythonImportsCheckPhase"
|
|
preDistPhases+=" pythonImportsCheckPhase"
|
|
fi
|