git.iko.soy/typeable/nixpkgs
on master help sign in
singular: 3.1.7 -> 4.1.1
fa3d0ceTimo Kaufmann
pkgs/applications/science/math/singular/default.nix+53−20
@@ -1,23 +1,52 @@
1{ stdenv, fetchurl, gmp, bison, perl, autoconf, ncurses, readline, coreutils, pkgconfig
1{ stdenv, fetchurl, gmp, bison, perl, autoconf, ncurses, readline, coreutils, pkgconfig
2−, asLibsingular ? false
2+, autoreconfHook
3+, flint
4+, ntl
5+, cddlib
6+, enableFactory ? true
7+, enableGfanlib ? true
3}:
8}:
4
9
5stdenv.mkDerivation rec {
10stdenv.mkDerivation rec {
6− name = "singular-${version}";
11+ name = "singular-${version}${patchVersion}";
7− version="3-1-7";
12+ version = "4.1.1";
13+ patchVersion = "p1";
8
14
15+ urlVersion = builtins.replaceStrings [ "." ] [ "-" ] version;
9 src = fetchurl {
16 src = fetchurl {
10− url = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${version}/Singular-${version}.tar.gz";
17+ url = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${urlVersion}/singular-${version}${patchVersion}.tar.gz";
11− sha256 = "1j4mcpnwzdp3h4qspk6ww0m67rmx4s11cy17pvzbpf70lm0jzzh2";
18+ sha256 = "0wvgz7l1b7zkpmim0r3mvv4fp8xnhlbz4c7hc90rn30snlansnf1";
12 };
19 };
13
20
21+ configureFlags = stdenv.lib.optionals enableFactory [
22+ "--enable-factory"
23+ ] ++ stdenv.lib.optionals enableGfanlib [
24+ "--enable-gfanlib"
25+ ];
26+
27+ postUnpack = ''
28+ patchShebangs .
29+ '';
30+
31+ # For reference (last checked on commit 75f460d):
32+ # https://github.com/Singular/Sources/blob/spielwiese/doc/Building-Singular-from-source.md
33+ # https://github.com/Singular/Sources/blob/spielwiese/doc/external-packages-dynamic-modules.md
14− buildInputs = [ gmp perl ncurses readline ];
34+ buildInputs = [
35+ # necessary
36+ gmp
37+ # by upstream recommended but optional
38+ ncurses
39+ readline
40+ ntl
41+ flint
42+ ] ++ stdenv.lib.optionals enableGfanlib [
43+ cddlib
44+ ];
15− nativeBuildInputs = [ autoconf bison pkgconfig ];
45+ nativeBuildInputs = [ autoconf bison perl pkgconfig autoreconfHook ];
16
46
17 preConfigure = ''
47 preConfigure = ''
18 find . -type f -exec sed -e 's@/bin/rm@${coreutils}&@g' -i '{}' ';'
48 find . -type f -exec sed -e 's@/bin/rm@${coreutils}&@g' -i '{}' ';'
19 find . -type f -exec sed -e 's@/bin/uname@${coreutils}&@g' -i '{}' ';'
49 find . -type f -exec sed -e 's@/bin/uname@${coreutils}&@g' -i '{}' ';'
20− ${stdenv.lib.optionalString asLibsingular ''NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DLIBSINGULAR"''}
21 '';
50 '';
22
51
23 hardeningDisable = stdenv.lib.optional stdenv.isi686 "stackprotector";
52 hardeningDisable = stdenv.lib.optional stdenv.isi686 "stackprotector";
@@ -27,17 +56,21 @@ stdenv.mkDerivation rec {
27
56
28 installPhase = ''
57 installPhase = ''
29 mkdir -p "$out"
58 mkdir -p "$out"
30− cp -r Singular/LIB "$out/LIB"
59+ cp -r Singular/LIB "$out/lib"
31− make install${stdenv.lib.optionalString asLibsingular "-libsingular"}
60+ make install
32−
61+
33− binaries="$(find "$out"/* \( -type f -o -type l \) -perm -111 \! -name '*.so' -maxdepth 1)"
62+ # Make sure patchelf picks up the right libraries
34− ln -s "$out"/*/{include,lib} "$out"
63+ rm -rf libpolys factory resources omalloc Singular
35− mkdir -p "$out/bin"
64+ '';
36− for b in $binaries; do
65+
37− bbn="$(basename "$b")"
66+ # simple test to make sure singular starts and finds its libraries
38− echo -e '#! ${stdenv.shell}\n"'"$b"'" "$@"' > "$out/bin/$bbn"
67+ doInstallCheck = true;
39− chmod a+x "$out/bin/$bbn"
68+ installCheckPhase = ''
40− done
69+ $out/bin/Singular -c 'LIB "freegb.lib"; exit;'
70+ if [ $? -ne 0 ]; then
71+ echo >&2 "Error loading the freegb library in Singular."
72+ exit 1
73+ fi
41 '';
74 '';
42
75
43 enableParallelBuilding = true;
76 enableParallelBuilding = true;
@@ -47,7 +80,7 @@ stdenv.mkDerivation rec {
47 maintainers = with maintainers; [ raskin ];
80 maintainers = with maintainers; [ raskin ];
48 platforms = subtractLists platforms.i686 platforms.linux;
81 platforms = subtractLists platforms.i686 platforms.linux;
49 license = licenses.gpl3; # Or GPLv2 at your option - but not GPLv4
82 license = licenses.gpl3; # Or GPLv2 at your option - but not GPLv4
50− homepage = http://www.singular.uni-kl.de/index.php;
83+ homepage = http://www.singular.uni-kl.de;
51 downloadPage = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/";
84 downloadPage = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/";
52 };
85 };
53}
86}
pkgs/development/libraries/flint/default.nix+3
@@ -26,6 +26,9 @@ stdenv.mkDerivation rec {
26 ] ++ stdenv.lib.optionals withBlas [
26 ] ++ stdenv.lib.optionals withBlas [
27 openblas
27 openblas
28 ];
28 ];
29+ propagatedBuildInputs = [
30+ mpfr # flint.h includes mpfr.h
31+ ];
29 configureFlags = [
32 configureFlags = [
30 "--with-gmp=${gmp}"
33 "--with-gmp=${gmp}"
31 "--with-mpir=${mpir}"
34 "--with-mpir=${mpir}"
pkgs/top-level/all-packages.nix+1−7
@@ -20229,13 +20229,7 @@ with pkgs;
20229 inherit (gnome3) gtksourceview;
20229 inherit (gnome3) gtksourceview;
20230 };
20230 };
20231
20231
20232− singular = callPackage ../applications/science/math/singular {
20232+ singular = callPackage ../applications/science/math/singular { };
20233− stdenv = overrideCC stdenv gcc5;
20234− };
20235− libsingular = callPackage ../applications/science/math/singular {
20236− asLibsingular = true;
20237− stdenv = overrideCC stdenv gcc5;
20238− };
20239
20233
20240 scilab = callPackage ../applications/science/math/scilab {
20234 scilab = callPackage ../applications/science/math/scilab {
20241 withXaw3d = false;
20235 withXaw3d = false;