summary refs log tree commit diff
path: root/pkgs/applications/science/math/singular/default.nix
blob: 884d202e98e3cda7ca0067a8cddd942eccdae805 (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
x@{builderDefsPackage
  , gmp, bison, perl, autoconf, ncurses, readline
  , coreutils
  , ...}:
builderDefsPackage
(a :  
let 
  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
    [];

  buildInputs = map (n: builtins.getAttr n x)
    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
  sourceInfo = rec {
    baseName="Singular";
    version="3-1-2";
    revision="-1";
    name="${baseName}-${version}${revision}";
    url="http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${version}/${name}.tar.gz";
    hash="04f9i1xar0r7qrrbfki1h9rrmx5y2xg4w7rrvlbx05v2dy6s8djv";
  };
in
rec {
  src = a.fetchurl {
    url = sourceInfo.url;
    sha256 = sourceInfo.hash;
  };

  inherit (sourceInfo) name version;
  inherit buildInputs;

  /* doConfigure should be removed if not needed */
  phaseNames = ["doFixPaths" "doConfigure" "doMakeInstall"];
  doFixPaths = a.fullDepEntry (''
    find . -exec sed -e 's@/bin/rm@${a.coreutils}&@g' -i '{}' ';'
    find . -exec sed -e 's@/bin/uname@${a.coreutils}&@g' -i '{}' ';'
  '') ["minInit" "doUnpack"];
      
  meta = {
    description = "A CAS for polynomial computations";
    maintainers = with a.lib.maintainers;
    [
      raskin
    ];
    platforms = with a.lib.platforms;
      linux;
    license = "GPLv3"; # Or GPLv2 at your option - but not GPLv4
    homepage = "http://www.singular.uni-kl.de/index.php";
  };
  passthru = {
    updateInfo = {
      downloadPage = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/";
    };
  };
}) x