summary refs log tree commit diff
path: root/pkgs/applications/science/math/singular/default.nix
diff options
context:
space:
mode:
authorJoachim Fasting <joachifm@fastmail.fm>2015-06-25 22:46:54 +0200
committerJoachim Fasting <joachifm@fastmail.fm>2015-11-24 14:45:15 +0100
commit022bbe1c0ce6abafda8b4f193284ddb4505fb37c (patch)
tree11e91405804714924e46901a1e6a93b74f0d6a98 /pkgs/applications/science/math/singular/default.nix
parent42fc03411f4710984eae7dcbd6ec7108d0b8ee72 (diff)
downloadnixpkgs-022bbe1c0ce6abafda8b4f193284ddb4505fb37c.tar
nixpkgs-022bbe1c0ce6abafda8b4f193284ddb4505fb37c.tar.gz
nixpkgs-022bbe1c0ce6abafda8b4f193284ddb4505fb37c.tar.bz2
nixpkgs-022bbe1c0ce6abafda8b4f193284ddb4505fb37c.tar.lz
nixpkgs-022bbe1c0ce6abafda8b4f193284ddb4505fb37c.tar.xz
nixpkgs-022bbe1c0ce6abafda8b4f193284ddb4505fb37c.tar.zst
nixpkgs-022bbe1c0ce6abafda8b4f193284ddb4505fb37c.zip
singular: reimplement using mkDerivation
Diffstat (limited to 'pkgs/applications/science/math/singular/default.nix')
-rw-r--r--pkgs/applications/science/math/singular/default.nix65
1 files changed, 22 insertions, 43 deletions
diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix
index 1afb510e994..8bae1d6206d 100644
--- a/pkgs/applications/science/math/singular/default.nix
+++ b/pkgs/applications/science/math/singular/default.nix
@@ -1,55 +1,34 @@
-x@{builderDefsPackage
-  , gmp, bison, perl, autoconf, ncurses, readline
-  , coreutils
-  , ...}:
-builderDefsPackage
-(a :
-let
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
-    [];
+{ stdenv, fetchurl, gmp, bison, perl, autoconf, ncurses, readline, coreutils }:
 
-  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;
+stdenv.mkDerivation rec {
+  name = "singular-${version}";
+  version="3-1-2";
+
+  src = fetchurl {
+    url = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${version}/${name}.tar.gz";
+    sha256 = "04f9i1xar0r7qrrbfki1h9rrmx5y2xg4w7rrvlbx05v2dy6s8djv";
   };
 
-  inherit (sourceInfo) name version;
-  inherit buildInputs;
+  buildInputs = [ gmp bison perl autoconf ncurses readline coreutils ];
+
+  preConfigure = ''
+    find . -exec sed -e 's@/bin/rm@${coreutils}&@g' -i '{}' ';'
+    find . -exec sed -e 's@/bin/uname@${coreutils}&@g' -i '{}' ';'
+  '';
 
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["doFixPaths" "doConfigure" "doMakeInstall" "fixInstall"];
-  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"];
-  fixInstall = a.fullDepEntry (''
+  postInstall = ''
     rm -rf "$out/LIB"
     cp -r Singular/LIB "$out"
     mkdir -p "$out/bin"
     ln -s "$out/"*/Singular "$out/bin"
-  '') ["minInit" "defEnsureDir"];
+  '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "A CAS for polynomial computations";
-    maintainers = with a.lib.maintainers;
-    [
-      raskin
-    ];
-    platforms = with a.lib.platforms;
-      linux;
-    license = a.stdenv.lib.licenses.gpl3; # Or GPLv2 at your option - but not GPLv4
+    maintainers = with maintainers;
+      [ raskin ];
+    platforms = platforms.linux;
+    license = licenses.gpl3; # Or GPLv2 at your option - but not GPLv4
     homepage = "http://www.singular.uni-kl.de/index.php";
   };
   passthru = {
@@ -57,4 +36,4 @@ rec {
       downloadPage = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/";
     };
   };
-}) x
+}