2016-10-12 19:22:52 +01:00
|
|
|
{ stdenv, fetchurl, gmp, bison, perl, autoconf, ncurses, readline, coreutils, pkgconfig
|
|
|
|
, asLibsingular ? false
|
|
|
|
}:
|
2010-12-05 18:37:47 +00:00
|
|
|
|
2015-06-25 21:46:54 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "singular-${version}";
|
2016-10-12 16:34:29 +01:00
|
|
|
version="3-1-7";
|
2015-06-25 21:46:54 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-10-12 16:34:29 +01:00
|
|
|
url = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${version}/Singular-${version}.tar.gz";
|
|
|
|
sha256 = "1j4mcpnwzdp3h4qspk6ww0m67rmx4s11cy17pvzbpf70lm0jzzh2";
|
2010-12-05 18:37:47 +00:00
|
|
|
};
|
|
|
|
|
2016-10-12 19:22:52 +01:00
|
|
|
buildInputs = [ gmp perl ncurses readline ];
|
|
|
|
nativeBuildInputs = [ autoconf bison pkgconfig ];
|
2015-06-25 21:46:54 +01:00
|
|
|
|
|
|
|
preConfigure = ''
|
2017-09-23 09:14:20 +01:00
|
|
|
find . -type f -exec sed -e 's@/bin/rm@${coreutils}&@g' -i '{}' ';'
|
|
|
|
find . -type f -exec sed -e 's@/bin/uname@${coreutils}&@g' -i '{}' ';'
|
2016-10-12 19:22:52 +01:00
|
|
|
${stdenv.lib.optionalString asLibsingular ''NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DLIBSINGULAR"''}
|
2015-06-25 21:46:54 +01:00
|
|
|
'';
|
2010-12-05 18:37:47 +00:00
|
|
|
|
2016-04-03 13:25:05 +01:00
|
|
|
hardeningDisable = stdenv.lib.optional stdenv.isi686 "stackprotector";
|
|
|
|
|
2016-10-12 19:22:52 +01:00
|
|
|
# The Makefile actually defaults to `make install` anyway
|
|
|
|
buildPhase = "true;";
|
|
|
|
|
|
|
|
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"
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p "$out/bin"
|
2016-10-15 14:28:12 +01:00
|
|
|
for b in $binaries; do
|
|
|
|
bbn="$(basename "$b")"
|
|
|
|
echo -e '#! ${stdenv.shell}\n"'"$b"'" "$@"' > "$out/bin/$bbn"
|
|
|
|
chmod a+x "$out/bin/$bbn"
|
|
|
|
done
|
2015-06-25 21:46:54 +01:00
|
|
|
'';
|
2014-07-28 10:43:20 +01:00
|
|
|
|
2017-05-20 14:38:01 +01:00
|
|
|
enableParallelBuilding = true;
|
2016-10-12 19:22:52 +01:00
|
|
|
|
2015-06-25 21:46:54 +01:00
|
|
|
meta = with stdenv.lib; {
|
2010-12-05 18:37:47 +00:00
|
|
|
description = "A CAS for polynomial computations";
|
2017-03-30 14:04:17 +01:00
|
|
|
maintainers = with maintainers; [ raskin ];
|
|
|
|
platforms = subtractLists platforms.i686 platforms.linux;
|
2015-06-25 21:46:54 +01:00
|
|
|
license = licenses.gpl3; # Or GPLv2 at your option - but not GPLv4
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://www.singular.uni-kl.de/index.php;
|
2016-10-12 16:34:29 +01:00
|
|
|
downloadPage = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/";
|
2010-12-05 18:37:47 +00:00
|
|
|
};
|
2015-06-25 21:46:54 +01:00
|
|
|
}
|