about summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
authorJoachim Fasting <joachifm@fastmail.fm>2015-07-21 13:19:38 +0200
committerJoachim Fasting <joachifm@fastmail.fm>2015-11-24 14:45:15 +0100
commit6d4ff9020793c43fe5994afef31d21a92895e0ab (patch)
tree367e5defe20bcb21d6b7e69fb3d6a4579ab2546a /pkgs/applications/science
parent6ccf87defe2599c7f6d8dc729c4cc7aa0c97352e (diff)
downloadnixlib-6d4ff9020793c43fe5994afef31d21a92895e0ab.tar
nixlib-6d4ff9020793c43fe5994afef31d21a92895e0ab.tar.gz
nixlib-6d4ff9020793c43fe5994afef31d21a92895e0ab.tar.bz2
nixlib-6d4ff9020793c43fe5994afef31d21a92895e0ab.tar.lz
nixlib-6d4ff9020793c43fe5994afef31d21a92895e0ab.tar.xz
nixlib-6d4ff9020793c43fe5994afef31d21a92895e0ab.tar.zst
nixlib-6d4ff9020793c43fe5994afef31d21a92895e0ab.zip
gap: reimplement using mkDerivation
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/math/gap/default.nix66
1 files changed, 24 insertions, 42 deletions
diff --git a/pkgs/applications/science/math/gap/default.nix b/pkgs/applications/science/math/gap/default.nix
index e810879eba60..dcd0734d85d9 100644
--- a/pkgs/applications/science/math/gap/default.nix
+++ b/pkgs/applications/science/math/gap/default.nix
@@ -1,68 +1,50 @@
-x@{builderDefsPackage
-  , pari ? null
-  , ...}:
-builderDefsPackage
-(a :
+{ stdenv, fetchurl, pari ? null }:
+
 let
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
-    [];
+  baseName = "gap";
+  version = "4r4p12";
 
-  buildInputs = map (n: builtins.getAttr n x)
-    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
-  sourceInfo = rec {
-    baseName="gap";
-    version="4r4p12";
-    name="${baseName}-${version}";
-    url="ftp://ftp.gap-system.org/pub/gap/gap4/tar.gz/${baseName}${version}.tar.gz";
-    hash="0flap5lbkvpms3zznq1zwxyxyj0ax3fk7m24f3bvhvr37vyxnf40";
-    pkgVer="2012_01_12-10_47_UTC";
-    pkgURL="ftp://ftp.gap-system.org/pub/gap/gap4/tar.bz2/packages-${pkgVer}.tar.bz2";
-    pkgHash="0z9ncy1m5gvv4llkclxd1vpcgpb0b81a2pfmnhzvw8x708frhmnb";
+  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
-rec {
-  src = a.fetchurl {
-    url = sourceInfo.url;
-    sha256 = sourceInfo.hash;
-  };
 
-  pkgSrc = a.fetchurl {
-    url=sourceInfo.pkgURL;
-    sha256=sourceInfo.pkgHash;
-  };
+stdenv.mkDerivation rec {
+  name = "${baseName}-${version}";
 
-  inherit (sourceInfo) name version;
-  inherit buildInputs;
+  src = fetchurl {
+    url = "ftp://ftp.gap-system.org/pub/gap/gap4/tar.gz/${baseName}${version}.tar.gz";
+    sha256 = "0flap5lbkvpms3zznq1zwxyxyj0ax3fk7m24f3bvhvr37vyxnf40";
+  };
 
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["doConfigure" "doMake" "doDeploy"];
+  buildInputs = [ pari ];
 
-  doDeploy = a.fullDepEntry ''
+  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"
 
-    ${if a.pari != null then
+    ${if pari != null then
       ''sed -e '2iexport PATH=$PATH:${pari}/bin' -i "$out/share/gap/build-dir/bin/gap.sh" ''
     else ""}
     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"
-  '' ["doMake" "minInit" "defEnsureDir"];
+  '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Computational discrete algebra system";
-    maintainers = with a.lib.maintainers;
+    maintainers = with maintainers;
     [
       raskin
     ];
-    platforms = with a.lib.platforms;
-      linux;
-    license = with a.lib.licenses;
-      gpl2;
-    homepage = "http://gap-system.org/";
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+    homepage = http://gap-system.org/;
     broken = true;
   };
-}) x
+}