Skip to content

Commit a381f04

Browse files
committed
scalapack: fix cmake files and version string
1 parent 34b8677 commit a381f04

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

pkgs/by-name/sc/scalapack/package.nix

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
lib,
33
stdenv,
44
fetchFromGitHub,
5+
fetchpatch,
56
cmake,
67
mpiCheckPhaseHook,
78
mpi,
@@ -18,14 +19,22 @@ stdenv.mkDerivation rec {
1819
src = fetchFromGitHub {
1920
owner = "Reference-ScaLAPACK";
2021
repo = pname;
21-
rev = "v${version}";
22-
sha256 = "sha256-KDMW/D7ubGaD2L7eTwULJ04fAYDPAKl8xKPZGZMkeik=";
22+
tag = "v${version}";
23+
hash = "sha256-KDMW/D7ubGaD2L7eTwULJ04fAYDPAKl8xKPZGZMkeik=";
2324
};
2425

2526
passthru = { inherit (blas) isILP64; };
2627

2728
__structuredAttrs = true;
2829

30+
patches = [
31+
(fetchpatch {
32+
name = "version-string";
33+
url = "https://github.com/Reference-ScaLAPACK/scalapack/commit/76cc1ed3032e9a4158a4513c9047c3746b269f04.patch";
34+
hash = "sha256-kmllLa9GUeTrHRYeS0yIk9I8LwaIoEytdyQGRuinn3A=";
35+
})
36+
];
37+
2938
# Required to activate ILP64.
3039
# See https://github.com/Reference-ScaLAPACK/scalapack/pull/19
3140
postPatch = lib.optionalString passthru.isILP64 ''
@@ -76,6 +85,14 @@ stdenv.mkDerivation rec {
7685
# sometimes fail due to this
7786
checkFlags = [ "ARGS=--timeout 10000" ];
7887

88+
postFixup = ''
89+
# _IMPORT_PREFIX, used to point to lib, points to dev output. Every package using the generated
90+
# cmake file will thus look for the library in the dev output instead of out.
91+
# Use the absolute path to $out instead to fix the issue.
92+
substituteInPlace $dev/lib/cmake/scalapack-${version}/scalapack-targets-release.cmake \
93+
--replace "\''${_IMPORT_PREFIX}" "$out"
94+
'';
95+
7996
meta = with lib; {
8097
homepage = "http://www.netlib.org/scalapack/";
8198
description = "Library of high-performance linear algebra routines for parallel distributed memory machines";

0 commit comments

Comments
 (0)