nixpkgs/pkgs/applications/science/math/gap/default.nix

51 lines
1.3 KiB
Nix
Raw Normal View History

2015-07-21 13:19:38 +02:00
{ stdenv, fetchurl, pari ? null }:
2014-07-28 11:43:20 +02:00
let
2015-07-21 13:19:38 +02:00
baseName = "gap";
version = "4r4p12";
2015-07-21 13:19:38 +02:00
pkgVer = "2012_01_12-10_47_UTC";
pkgSrc = fetchurl {
url = "ftp://ftp.gap-system.org/pub/gap/gap4/tar.bz2/packages-${pkgVer}.tar.bz2";
sha256 = "0z9ncy1m5gvv4llkclxd1vpcgpb0b81a2pfmnhzvw8x708frhmnb";
};
in
2015-07-21 13:19:38 +02:00
stdenv.mkDerivation rec {
name = "${baseName}-${version}";
2015-07-21 13:19:38 +02:00
src = fetchurl {
url = "ftp://ftp.gap-system.org/pub/gap/gap4/tar.gz/${baseName}${version}.tar.gz";
sha256 = "0flap5lbkvpms3zznq1zwxyxyj0ax3fk7m24f3bvhvr37vyxnf40";
};
2015-07-21 13:19:38 +02:00
buildInputs = [ pari ];
2015-07-21 13:19:38 +02:00
installPhase = ''
mkdir -p "$out/bin" "$out/share/gap/"
cp -r . "$out/share/gap/build-dir"
tar xf "${pkgSrc}" -C "$out/share/gap/build-dir/pkg"
2015-07-21 13:19:38 +02:00
${if pari != null then
2014-07-28 11:43:20 +02:00
''sed -e '2iexport PATH=$PATH:${pari}/bin' -i "$out/share/gap/build-dir/bin/gap.sh" ''
else ""}
2014-07-28 11:43:20 +02:00
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"
2015-07-21 13:19:38 +02:00
'';
2014-07-28 11:43:20 +02:00
2015-07-21 13:19:38 +02:00
meta = with stdenv.lib; {
description = "Computational discrete algebra system";
2015-07-21 13:19:38 +02:00
maintainers = with maintainers;
[
raskin
];
2015-07-21 13:19:38 +02:00
platforms = platforms.linux;
license = licenses.gpl2;
homepage = http://gap-system.org/;
broken = true;
};
2015-07-21 13:19:38 +02:00
}