summary refs log tree commit diff
path: root/pkgs/applications/science/math/gap/default.nix
blob: 3d9e06527c9d5aa41158f9f76d0cfc4cff267062 (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
{ stdenv, fetchurl, m4, gmp }:

let
  baseName = "gap";
  version = "4r8p3";

  pkgVer = "2016_03_19-22_17";
in

stdenv.mkDerivation rec {
  name = "${baseName}-${version}";

  src = fetchurl {
    url = "ftp://ftp.gap-system.org/pub/gap/gap48/tar.gz/${baseName}${version}_${pkgVer}.tar.gz";
    sha256 = "1rmb0lj43avv456sjwb7ia3y0wwk5shlqylpkdwnnqpjnvjbnzv6";
  };

  configureFlags = [ "--with-gmp=system" ];
  buildInputs = [ m4 gmp ];
  
  postBuild = ''
    pushd pkg
    bash ../bin/BuildPackages.sh
    popd
  '';
  
  installPhase = ''
    mkdir -p "$out/bin" "$out/share/gap/"

    cp -r . "$out/share/gap/build-dir"

    sed -e "/GAP_DIR=/aGAP_DIR='$out/share/gap/build-dir/'" -i "$out/share/gap/build-dir/bin/gap.sh"

    ln -s "$out/share/gap/build-dir/bin/gap.sh" "$out/bin"
  '';

  meta = with stdenv.lib; {
    description = "Computational discrete algebra system";
    maintainers = with maintainers;
    [
      raskin
      chrisjefferson
    ];
    platforms = platforms.all;
    license = licenses.gpl2;
    homepage = http://gap-system.org/;
  };
}