summary refs log tree commit diff
path: root/pkgs/applications/science/math/colpack/default.nix
blob: d5ab38ff751492bb5c9af8462973970c19bee365 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ lib, stdenv, fetchFromGitHub, autoreconfHook }:

stdenv.mkDerivation rec {

  pname = "ColPack";
  version = "1.0.10";

  src = fetchFromGitHub {
    owner = "CSCsw";
    repo = pname;
    rev = "v" + version;
    sha256 = "1p05vry940mrjp6236c0z83yizmw9pk6ly2lb7d8rpb7j9h03glr";
  };

  nativeBuildInputs = [ autoreconfHook ];

  configureFlags = [
    "--enable-openmp=${if stdenv.isLinux then "yes" else "no"}"
    "--enable-examples=no"
  ];

  postInstall = ''
    # Remove libtool archive
    rm $out/lib/*.la

    # Remove compiled examples (Basic examples get compiled anyway)
    rm -r $out/examples

    # Copy the example sources (Basic tree contains scripts and object files)
    mkdir -p $out/share/ColPack/examples/Basic
    cp SampleDrivers/Basic/*.cpp $out/share/ColPack/examples/Basic
    cp -r SampleDrivers/Matrix* $out/share/ColPack/examples
  '';

  meta = with lib; {
    description = "A package comprising of implementations of algorithms for
    vertex coloring and derivative computation";
    homepage = "https://cscapes.cs.purdue.edu/coloringpage/software.htm#functionalities";
    license = licenses.lgpl3Plus;
    platforms = platforms.unix;
    maintainers = with maintainers; [ edwtjo ];
  };
}