From 024c23503cc5144dc94f6d75f0b4343c07fad3fd Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Fri, 20 Jul 2018 17:01:23 +0200 Subject: [PATCH] singular: 4.1.1p1 -> 4.1.1p2 --- .../science/math/singular/default.nix | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix index 8be302f41e5e..98b75cd22d05 100644 --- a/pkgs/applications/science/math/singular/default.nix +++ b/pkgs/applications/science/math/singular/default.nix @@ -1,4 +1,5 @@ { stdenv, fetchurl, gmp, bison, perl, ncurses, readline, coreutils, pkgconfig +, lib , autoreconfHook , file , flint @@ -9,21 +10,25 @@ }: stdenv.mkDerivation rec { - name = "singular-${version}${patchVersion}"; - version = "4.1.1"; - patchVersion = "p1"; + name = "singular-${version}"; + version = "4.1.1p2"; - urlVersion = builtins.replaceStrings [ "." ] [ "-" ] version; - src = fetchurl { - url = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${urlVersion}/singular-${version}${patchVersion}.tar.gz"; - sha256 = "0wvgz7l1b7zkpmim0r3mvv4fp8xnhlbz4c7hc90rn30snlansnf1"; + src = let + # singular sorts its tarballs in directories by base release (without patch version) + # for example 4.1.1p1 will be in the directory 4-1-1 + baseVersion = builtins.head (lib.splitString "p" version); + urlVersion = builtins.replaceStrings [ "." ] [ "-" ] baseVersion; + in + fetchurl { + url = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${urlVersion}/singular-${version}.tar.gz"; + sha256 = "07x9kri8vl4galik7lr6pscq3c51n8570pyw64i7gbj0m706f7wf"; }; configureFlags = [ "--with-ntl=${ntl}" - ] ++stdenv.lib.optionals enableFactory [ + ] ++ lib.optionals enableFactory [ "--enable-factory" - ] ++ stdenv.lib.optionals enableGfanlib [ + ] ++ lib.optionals enableGfanlib [ "--enable-gfanlib" ]; @@ -42,7 +47,7 @@ stdenv.mkDerivation rec { readline ntl flint - ] ++ stdenv.lib.optionals enableGfanlib [ + ] ++ lib.optionals enableGfanlib [ cddlib ]; nativeBuildInputs = [ @@ -60,10 +65,12 @@ stdenv.mkDerivation rec { -i '{}' ';' ''; - hardeningDisable = stdenv.lib.optional stdenv.isi686 "stackprotector"; + hardeningDisable = lib.optional stdenv.isi686 "stackprotector"; # The Makefile actually defaults to `make install` anyway - buildPhase = "true;"; + buildPhase = '' + # do nothing + ''; installPhase = '' mkdir -p "$out" @@ -77,7 +84,7 @@ stdenv.mkDerivation rec { # simple test to make sure singular starts and finds its libraries doInstallCheck = true; installCheckPhase = '' - $out/bin/Singular -c 'LIB "freegb.lib"; exit;' + "$out/bin/Singular" -c 'LIB "freegb.lib"; exit;' if [ $? -ne 0 ]; then echo >&2 "Error loading the freegb library in Singular." exit 1 @@ -86,9 +93,10 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - meta = with stdenv.lib; { + meta = with lib; { description = "A CAS for polynomial computations"; - maintainers = with maintainers; [ raskin ]; + maintainers = with maintainers; [ raskin timokau ]; + # 32 bit x86 fails with some link error: `undefined reference to `__divmoddi4@GCC_7.0.0'` platforms = subtractLists platforms.i686 platforms.linux; license = licenses.gpl3; # Or GPLv2 at your option - but not GPLv4 homepage = http://www.singular.uni-kl.de;