zoxide: 0.9.6 -> 0.9.7 (#380745)
[NixPkgs.git] / pkgs / by-name / sp / spooles / package.nix
blobc2d895e5e9fcd0c1298bb07f19d6bc870e664a98
2   lib,
3   stdenv,
4   fetchurl,
5   perl,
6 }:
8 stdenv.mkDerivation rec {
9   pname = "spooles";
10   version = "2.2";
12   src = fetchurl {
13     url = "http://www.netlib.org/linalg/spooles/spooles.${version}.tgz";
14     sha256 = "1pf5z3vvwd8smbpibyabprdvcmax0grzvx2y0liy98c7x6h5jid8";
15   };
17   sourceRoot = ".";
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   ];
27   postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
28     substituteInPlace makefile --replace "-Wl,-soname," "-Wl,-install_name,$out/lib/"
29   '';
31   buildPhase = ''
32     make lib
33   '';
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   '';
52   nativeBuildInputs = [ perl ];
54   meta = with lib; {
55     homepage = "http://www.netlib.org/linalg/spooles/";
56     description = "Library for solving sparse real and complex linear systems of equations";
57     license = licenses.publicDomain;
58     maintainers = with maintainers; [ gebner ];
59     platforms = platforms.unix;
60   };