diff options
author | Timo Kaufmann <timokau@zoho.com> | 2018-04-11 13:52:10 +0200 |
---|---|---|
committer | Timo Kaufmann <timokau@zoho.com> | 2018-04-11 17:00:20 +0200 |
commit | fa3d0cef6746769a8ef90cc10a248ef622a31171 (patch) | |
tree | 22adbdf95fc50117f64acbd677fa13bffa8ea41f /pkgs | |
parent | a63ee3c35672a694a06293e734fffade1b866a00 (diff) | |
download | nixpkgs-fa3d0cef6746769a8ef90cc10a248ef622a31171.tar nixpkgs-fa3d0cef6746769a8ef90cc10a248ef622a31171.tar.gz nixpkgs-fa3d0cef6746769a8ef90cc10a248ef622a31171.tar.bz2 nixpkgs-fa3d0cef6746769a8ef90cc10a248ef622a31171.tar.lz nixpkgs-fa3d0cef6746769a8ef90cc10a248ef622a31171.tar.xz nixpkgs-fa3d0cef6746769a8ef90cc10a248ef622a31171.tar.zst nixpkgs-fa3d0cef6746769a8ef90cc10a248ef622a31171.zip |
singular: 3.1.7 -> 4.1.1
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/applications/science/math/singular/default.nix | 73 | ||||
-rw-r--r-- | pkgs/development/libraries/flint/default.nix | 3 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 8 |
3 files changed, 57 insertions, 27 deletions
diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix index 8cd9355a0f6..882d481a7f9 100644 --- a/pkgs/applications/science/math/singular/default.nix +++ b/pkgs/applications/science/math/singular/default.nix @@ -1,23 +1,52 @@ { stdenv, fetchurl, gmp, bison, perl, autoconf, ncurses, readline, coreutils, pkgconfig -, asLibsingular ? false +, autoreconfHook +, flint +, ntl +, cddlib +, enableFactory ? true +, enableGfanlib ? true }: stdenv.mkDerivation rec { - name = "singular-${version}"; - version="3-1-7"; + name = "singular-${version}${patchVersion}"; + version = "4.1.1"; + patchVersion = "p1"; + urlVersion = builtins.replaceStrings [ "." ] [ "-" ] version; src = fetchurl { - url = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${version}/Singular-${version}.tar.gz"; - sha256 = "1j4mcpnwzdp3h4qspk6ww0m67rmx4s11cy17pvzbpf70lm0jzzh2"; + url = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${urlVersion}/singular-${version}${patchVersion}.tar.gz"; + sha256 = "0wvgz7l1b7zkpmim0r3mvv4fp8xnhlbz4c7hc90rn30snlansnf1"; }; - buildInputs = [ gmp perl ncurses readline ]; - nativeBuildInputs = [ autoconf bison pkgconfig ]; + configureFlags = stdenv.lib.optionals enableFactory [ + "--enable-factory" + ] ++ stdenv.lib.optionals enableGfanlib [ + "--enable-gfanlib" + ]; + + postUnpack = '' + patchShebangs . + ''; + + # For reference (last checked on commit 75f460d): + # https://github.com/Singular/Sources/blob/spielwiese/doc/Building-Singular-from-source.md + # https://github.com/Singular/Sources/blob/spielwiese/doc/external-packages-dynamic-modules.md + buildInputs = [ + # necessary + gmp + # by upstream recommended but optional + ncurses + readline + ntl + flint + ] ++ stdenv.lib.optionals enableGfanlib [ + cddlib + ]; + nativeBuildInputs = [ autoconf bison perl pkgconfig autoreconfHook ]; preConfigure = '' find . -type f -exec sed -e 's@/bin/rm@${coreutils}&@g' -i '{}' ';' find . -type f -exec sed -e 's@/bin/uname@${coreutils}&@g' -i '{}' ';' - ${stdenv.lib.optionalString asLibsingular ''NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DLIBSINGULAR"''} ''; hardeningDisable = stdenv.lib.optional stdenv.isi686 "stackprotector"; @@ -27,17 +56,21 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p "$out" - cp -r Singular/LIB "$out/LIB" - make install${stdenv.lib.optionalString asLibsingular "-libsingular"} - - binaries="$(find "$out"/* \( -type f -o -type l \) -perm -111 \! -name '*.so' -maxdepth 1)" - ln -s "$out"/*/{include,lib} "$out" - mkdir -p "$out/bin" - for b in $binaries; do - bbn="$(basename "$b")" - echo -e '#! ${stdenv.shell}\n"'"$b"'" "$@"' > "$out/bin/$bbn" - chmod a+x "$out/bin/$bbn" - done + cp -r Singular/LIB "$out/lib" + make install + + # Make sure patchelf picks up the right libraries + rm -rf libpolys factory resources omalloc Singular + ''; + + # simple test to make sure singular starts and finds its libraries + doInstallCheck = true; + installCheckPhase = '' + $out/bin/Singular -c 'LIB "freegb.lib"; exit;' + if [ $? -ne 0 ]; then + echo >&2 "Error loading the freegb library in Singular." + exit 1 + fi ''; enableParallelBuilding = true; @@ -47,7 +80,7 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ raskin ]; platforms = subtractLists platforms.i686 platforms.linux; license = licenses.gpl3; # Or GPLv2 at your option - but not GPLv4 - homepage = http://www.singular.uni-kl.de/index.php; + homepage = http://www.singular.uni-kl.de; downloadPage = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/"; }; } diff --git a/pkgs/development/libraries/flint/default.nix b/pkgs/development/libraries/flint/default.nix index 2977293fefa..67bf7503db9 100644 --- a/pkgs/development/libraries/flint/default.nix +++ b/pkgs/development/libraries/flint/default.nix @@ -26,6 +26,9 @@ stdenv.mkDerivation rec { ] ++ stdenv.lib.optionals withBlas [ openblas ]; + propagatedBuildInputs = [ + mpfr # flint.h includes mpfr.h + ]; configureFlags = [ "--with-gmp=${gmp}" "--with-mpir=${mpir}" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c9bbbbf396c..a4b92a161e5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20229,13 +20229,7 @@ with pkgs; inherit (gnome3) gtksourceview; }; - singular = callPackage ../applications/science/math/singular { - stdenv = overrideCC stdenv gcc5; - }; - libsingular = callPackage ../applications/science/math/singular { - asLibsingular = true; - stdenv = overrideCC stdenv gcc5; - }; + singular = callPackage ../applications/science/math/singular { }; scilab = callPackage ../applications/science/math/scilab { withXaw3d = false; |