From d97e8407b28090e919779b4a16037378cf7bb1f5 Mon Sep 17 00:00:00 2001 From: reiniscirpons Date: Mon, 26 Aug 2024 13:39:48 +0100 Subject: [PATCH] Use IsKernelExtensionAvailable method, bump minimum GAP version to 4.12 --- .github/workflows/CI.yml | 4 +--- PackageInfo.g | 29 +++++++++-------------------- init.g | 7 +++---- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b9cd972..ac82246 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -25,10 +25,8 @@ jobs: matrix: gap-branch: - master + - stable-4.13 - stable-4.12 - - stable-4.11 - - stable-4.10 - - stable-4.9 steps: - uses: actions/checkout@v3 diff --git a/PackageInfo.g b/PackageInfo.g index 218cd05..634bec8 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -74,35 +74,24 @@ PackageDoc := rec( ), Dependencies := rec( - GAP := ">= 4.9", + GAP := ">= 4.12", NeededOtherPackages := [ [ "GAPDoc", ">= 1.5" ] ], SuggestedOtherPackages := [ ], ExternalConditions := [ ], ), -AvailabilityTest := +AvailabilityTest := function() - local path, file; - - path:= DirectoriesPackagePrograms( "CddInterface" ); - - file := Filename( path, "CddInterface.so" ); - - if file = fail then - - LogPackageLoadingMessage( PACKAGE_WARNING, - [ - "The library `libcdd' is not yet installed on the system,", - " or it is not correctly compiled!,", - "Please, see the installation instructions in README.md." - ] ); - + if not IsKernelExtensionAvailable("CddInterface") then + LogPackageLoadingMessage(PACKAGE_WARNING, [ + "The library `libcdd' is not yet installed on the system,", + " or it is not correctly compiled!,", + "Please, see the installation instructions in README.md." + ]); return fail; - fi; - + return true; - end, TestFile := "tst/testall.g", diff --git a/init.g b/init.g index eece57e..6cca5da 100644 --- a/init.g +++ b/init.g @@ -3,11 +3,10 @@ # # Reading the declaration part of the package. # -_PATH_SO:=Filename(DirectoriesPackagePrograms("CddInterface"), "CddInterface.so"); -if _PATH_SO <> fail then - LoadDynamicModule(_PATH_SO); + +if not LoadKernelExtension("CddInterface") then + Error("failed to load the CddInterface package kernel extension"); fi; -Unbind(_PATH_SO); ReadPackage( "CddInterface", "gap/polyhedra.gd"); ReadPackage( "CddInterface", "gap/tools.gd");