mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-29 03:10:19 +00:00
guileImportsCheckHook: init
This hook should function similar to how pythonImportsCheck functions in buildPythonApplication or buildPythonPackage. Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
# Setup hook for checking whether Guile imports succeed
|
||||
echo "Sourcing guileImportsCheckHook.sh"
|
||||
|
||||
guileImportsCheckHook () {
|
||||
echo "Executing guileImportsCheckHook"
|
||||
|
||||
if [[ -n "${guileImportsCheck[*]-}" ]]; then
|
||||
echo "Check whether the following modules can be imported: ${guileImportsCheck[*]}"
|
||||
for i in "${guileImportsCheck[@]}"
|
||||
do
|
||||
# prevent guile from trying to AOT compile during import
|
||||
# guile can't find the library to import unless we set this
|
||||
GUILE_LOAD_PATH="$out/share/guile/site/@effectiveVersion@" GUILE_AUTO_COMPILE=0 guile -c "(use-modules (${i}))"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
appendToVar preDistPhases guileImportsCheckHook
|
||||
17
pkgs/by-name/gu/guileImportsCheckHook/package.nix
Normal file
17
pkgs/by-name/gu/guileImportsCheckHook/package.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
lib,
|
||||
makeSetupHook,
|
||||
guile,
|
||||
effectiveVersion ? guile.effectiveVersion,
|
||||
}:
|
||||
|
||||
makeSetupHook {
|
||||
name = "guileImportsCheckHook";
|
||||
substitutions = {
|
||||
effectiveVersion = guile.effectiveVersion;
|
||||
};
|
||||
meta = {
|
||||
description = "Import Guile libraries";
|
||||
maintainers = with lib.maintainers; [ ethancedwards8 ];
|
||||
};
|
||||
} ./guileImportsCheckHook.sh
|
||||
Reference in New Issue
Block a user