|
|
|
@ -1,4 +1,6 @@ |
|
|
|
|
{ stdenv, fetchurl, gmp, bison, perl, autoconf, ncurses, readline, coreutils }: |
|
|
|
|
{ stdenv, fetchurl, gmp, bison, perl, autoconf, ncurses, readline, coreutils, pkgconfig |
|
|
|
|
, asLibsingular ? false |
|
|
|
|
}: |
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec { |
|
|
|
|
name = "singular-${version}"; |
|
|
|
@ -9,23 +11,33 @@ stdenv.mkDerivation rec { |
|
|
|
|
sha256 = "1j4mcpnwzdp3h4qspk6ww0m67rmx4s11cy17pvzbpf70lm0jzzh2"; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
buildInputs = [ gmp bison perl autoconf ncurses readline coreutils ]; |
|
|
|
|
buildInputs = [ gmp perl ncurses readline ]; |
|
|
|
|
nativeBuildInputs = [ autoconf bison pkgconfig ]; |
|
|
|
|
|
|
|
|
|
preConfigure = '' |
|
|
|
|
find . -exec sed -e 's@/bin/rm@${coreutils}&@g' -i '{}' ';' |
|
|
|
|
find . -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"; |
|
|
|
|
|
|
|
|
|
postInstall = '' |
|
|
|
|
rm -rf "$out/LIB" |
|
|
|
|
cp -Tr Singular/LIB "$out/lib" |
|
|
|
|
ln -s "$out"/*/include "$out" |
|
|
|
|
# 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" |
|
|
|
|
mkdir -p "$out/bin" |
|
|
|
|
ln -s "$out/"*/Singular "$out/bin" |
|
|
|
|
ln -s $binaries "$out/bin" |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
enableParallelBuild = true; |
|
|
|
|
|
|
|
|
|
meta = with stdenv.lib; { |
|
|
|
|
description = "A CAS for polynomial computations"; |
|
|
|
|
maintainers = with maintainers; |
|
|
|
|