Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-mitchell committed Aug 26, 2024
1 parent 1162860 commit 094cffe
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
20 changes: 15 additions & 5 deletions PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,26 @@ Dependencies := rec(
),

AvailabilityTest := function()
if CompareVersionNumbers("gap", "4.12.1") then
if not IsKernelExtensionAvailable("crypting") then
LogPackageLoadingMessage(PACKAGE_WARNING,
["the kernel module is not compiled, ",
"the package cannot be loaded."]);
return fail;
fi;
else
if Filename(DirectoriesPackagePrograms("crypting"), "crypting.so") = fail then
return fail;
fi;
return true;
LogPackageLoadingMessage(PACKAGE_WARNING,
["the kernel module is not compiled, ",
"the package cannot be loaded."]);
return fail;
fi;
fi;
return true;
end,

TestFile := "tst/testall.g",

#Keywords := [ "TODO" ],

));


14 changes: 11 additions & 3 deletions init.g
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
#
# Reading the declaration part of the package.
#
_PATH_SO:=Filename(DirectoriesPackagePrograms("crypting"), "crypting.so");
if _PATH_SO <> fail then

if CompareVersionNumbers(GAPInfo.Version, "4.12") then
if not LoadKernelExtension("crypting") then
Error("failed to load the crypting package kernel extension");
fi;
else
# TODO this clause can be removed once Digraphs requires GAP>=4.12.1
_PATH_SO:=Filename(DirectoriesPackagePrograms("crypting"), "crypting.so");
if _PATH_SO <> fail then
LoadDynamicModule(_PATH_SO);
fi;
Unbind(_PATH_SO);
fi;
Unbind(_PATH_SO);

ReadPackage( "crypting", "gap/crypting.gd");

0 comments on commit 094cffe

Please sign in to comment.