nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 perl,
6}:
7
8stdenv.mkDerivation (finalAttrs: {
9 pname = "spooles";
10 version = "2.2";
11
12 src = fetchurl {
13 url = "http://www.netlib.org/linalg/spooles/spooles.${finalAttrs.version}.tgz";
14 sha256 = "1pf5z3vvwd8smbpibyabprdvcmax0grzvx2y0liy98c7x6h5jid8";
15 };
16
17 sourceRoot = ".";
18
19 patches = [
20 ./spooles.patch
21 # fix compiler error where NULL is used as a zero parameter
22 ./transform.patch
23 # use proper format specifier for size_t
24 ./allocate.patch
25 ];
26
27 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
28 substituteInPlace makefile --replace "-Wl,-soname," "-Wl,-install_name,$out/lib/"
29 '';
30
31 buildPhase = ''
32 make lib
33 '';
34
35 installPhase = ''
36 mkdir -p $out/lib $out/include/spooles
37 cp libspooles.a libspooles.so.2.2 $out/lib/
38 ln -s libspooles.so.2.2 $out/lib/libspooles.so.2
39 ln -s libspooles.so.2 $out/lib/libspooles.so
40 for h in *.h; do
41 if [ $h != 'MPI.h' ]; then
42 cp $h $out/include/spooles
43 d=`basename $h .h`
44 if [ -d $d ]; then
45 mkdir $out/include/spooles/$d
46 cp $d/*.h $out/include/spooles/$d
47 fi
48 fi
49 done
50 '';
51
52 nativeBuildInputs = [ perl ];
53
54 meta = {
55 homepage = "http://www.netlib.org/linalg/spooles/";
56 description = "Library for solving sparse real and complex linear systems of equations";
57 license = lib.licenses.publicDomain;
58 maintainers = [ ];
59 platforms = lib.platforms.unix;
60 };
61})