about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/math/polymake/default.nix
blob: 18d6912a2b8a8521dcd1c35fdeca37a153fcccf6 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{ lib
, stdenv
, fetchurl
, perl
, gmp
, mpfr
, flint
, boost
, bliss
, ppl
, singular
, cddlib
, lrs
, nauty
, ninja
, ant
, openjdk
, perlPackages
, makeWrapper
}:

# polymake compiles its own version of sympol and atint because we
# don't have those packages. other missing optional dependencies:
# javaview, libnormaliz, scip, soplex, jreality.

stdenv.mkDerivation rec {
  pname = "polymake";
  version = "4.10";

  src = fetchurl {
    # "The minimal version is a packager friendly version which omits
    # the bundled sources of cdd, lrs, libnormaliz, nauty and jReality."
    url = "https://polymake.org/lib/exe/fetch.php/download/polymake-${version}-minimal.tar.bz2";
    sha256 = "sha256-YDiyZtbUC76ZVe3oRtzPRBfkEU+qh+d1ZWFhzUyi+Pg=";
  };

  nativeBuildInputs = [
    makeWrapper
    ninja
    ant
    perl
  ];

  buildInputs = [
    perl
    gmp
    mpfr
    flint
    boost
    bliss
    ppl
    singular
    cddlib
    lrs
    nauty
    openjdk
  ] ++ (with perlPackages; [
    JSON
    TermReadLineGnu
    TermReadKey
    XMLSAX
  ]);

  ninjaFlags = [ "-C" "build/Opt" ];

  postInstall = ''
    for i in "$out"/bin/*; do
      wrapProgram "$i" --prefix PERL5LIB : "$PERL5LIB"
    done
  '';

  meta = with lib; {
    description = "Software for research in polyhedral geometry";
    homepage = "https://www.polymake.org/doku.php";
    changelog = "https://github.com/polymake/polymake/blob/V${version}/ChangeLog";
    license = licenses.gpl2Plus;
    maintainers = teams.sage.members;
    platforms = platforms.linux;
  };
}