liblapack: Add meta.pkgConfigModules and test

This commit is contained in:
John Ericson 2023-02-12 15:01:20 -05:00
parent b7e9a15ab9
commit 3f8b15788f

View File

@ -6,16 +6,17 @@
, shared ? true
# Compile with ILP64 interface
, blas64 ? false
, testers
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "liblapack";
version = "3.11";
src = fetchFromGitHub {
owner = "Reference-LAPACK";
repo = "lapack";
rev = "v${version}";
rev = "v${finalAttrs.version}";
sha256 = "sha256-AYD78u70y8cY19hmM/aDjQEzxO8u9lPWhCFxRe5cqXI=";
};
@ -40,7 +41,7 @@ stdenv.mkDerivation rec {
postInstall = let
canonicalExtension = if stdenv.hostPlatform.isLinux
then "${stdenv.hostPlatform.extensions.sharedLibrary}.${lib.versions.major version}"
then "${stdenv.hostPlatform.extensions.sharedLibrary}.${lib.versions.major finalAttrs.version}"
else stdenv.hostPlatform.extensions.sharedLibrary;
in lib.optionalString blas64 ''
ln -s $out/lib/liblapack64${canonicalExtension} $out/lib/liblapack${canonicalExtension}
@ -65,15 +66,18 @@ stdenv.mkDerivation rec {
checkPhase = ''
runHook preCheck
ctest ${ctestArgs}
ctest ${finalAttrs.ctestArgs}
runHook postCheck
'';
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = with lib; {
description = "Linear Algebra PACKage";
homepage = "http://www.netlib.org/lapack/";
maintainers = with maintainers; [ markuskowa ];
license = licenses.bsd3;
pkgConfigModules = [ "lapack" ];
platforms = platforms.all;
};
}
})