Skip to content

Commit 7ddd785

Browse files
1 parent fa9462c commit 7ddd785

File tree

2 files changed

+33
-14
lines changed

2 files changed

+33
-14
lines changed

PackageInfo.g

+16-5
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,24 @@ Dependencies := rec(
399399

400400
AvailabilityTest := function()
401401
local digraphs_so;
402-
digraphs_so := Filename(DirectoriesPackagePrograms("digraphs"),
403-
"digraphs.so");
404-
if (not "digraphs" in SHOW_STAT()) and digraphs_so = fail then
405-
LogPackageLoadingMessage(PACKAGE_WARNING,
402+
403+
if CompareVersionNumbers(GAPInfo.Version, "4.12") then
404+
if not IsKernelExtensionAvailable("digraphs") then
405+
LogPackageLoadingMessage(PACKAGE_WARNING,
406406
["the kernel module is not compiled, ",
407407
"the package cannot be loaded."]);
408-
return fail;
408+
return fail;
409+
fi;
410+
else
411+
# TODO this clause can be removed once Digraphs requires GAP>=4.12.1
412+
digraphs_so := Filename(DirectoriesPackagePrograms("digraphs"),
413+
"digraphs.so");
414+
if (not "digraphs" in SHOW_STAT()) and digraphs_so = fail then
415+
LogPackageLoadingMessage(PACKAGE_WARNING,
416+
["the kernel module is not compiled, ",
417+
"the package cannot be loaded."]);
418+
return fail;
419+
fi;
409420
fi;
410421
return true;
411422
end,

init.g

+17-9
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,23 @@ if not IsBound(UserHomeExpand) then
1313
BindGlobal("UserHomeExpand", USER_HOME_EXPAND);
1414
fi;
1515

16-
# load kernel function if it is installed:
17-
if not IsBound(DIGRAPH_OUT_NBS) and "digraphs" in SHOW_STAT() then
18-
# try static module
19-
LoadStaticModule("digraphs");
20-
fi;
21-
if not IsBound(DIGRAPH_OUT_NBS) and
22-
Filename(DirectoriesPackagePrograms("digraphs"), "digraphs.so") <> fail then
23-
LoadDynamicModule(Filename(DirectoriesPackagePrograms("digraphs"),
24-
"digraphs.so"));
16+
if CompareVersionNumbers(GAPInfo.Version, "4.12") then
17+
if not LoadKernelExtension("digraphs") then
18+
Error("failed to load the Digraphs package kernel extension");
19+
fi;
20+
else
21+
# TODO this clause can be removed once Digraphs requires GAP>=4.12.1
22+
# load kernel function if it is installed:
23+
if not IsBound(DIGRAPH_OUT_NBS) and "digraphs" in SHOW_STAT() then
24+
# try static module
25+
LoadStaticModule("digraphs");
26+
fi;
27+
if not IsBound(DIGRAPH_OUT_NBS) and
28+
Filename(DirectoriesPackagePrograms("digraphs"),
29+
"digraphs.so") <> fail then
30+
LoadDynamicModule(Filename(DirectoriesPackagePrograms("digraphs"),
31+
"digraphs.so"));
32+
fi;
2533
fi;
2634

2735
BindGlobal("DIGRAPHS_IsGrapeLoaded",

0 commit comments

Comments
 (0)