singular: add an option to install as libsingular
This commit is contained in:
parent
8e9ad9bfdc
commit
2bed05d8e1
@ -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 {
|
stdenv.mkDerivation rec {
|
||||||
name = "singular-${version}";
|
name = "singular-${version}";
|
||||||
@ -9,23 +11,33 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "1j4mcpnwzdp3h4qspk6ww0m67rmx4s11cy17pvzbpf70lm0jzzh2";
|
sha256 = "1j4mcpnwzdp3h4qspk6ww0m67rmx4s11cy17pvzbpf70lm0jzzh2";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ gmp bison perl autoconf ncurses readline coreutils ];
|
buildInputs = [ gmp perl ncurses readline ];
|
||||||
|
nativeBuildInputs = [ autoconf bison pkgconfig ];
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
find . -exec sed -e 's@/bin/rm@${coreutils}&@g' -i '{}' ';'
|
find . -exec sed -e 's@/bin/rm@${coreutils}&@g' -i '{}' ';'
|
||||||
find . -exec sed -e 's@/bin/uname@${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";
|
hardeningDisable = stdenv.lib.optional stdenv.isi686 "stackprotector";
|
||||||
|
|
||||||
postInstall = ''
|
# The Makefile actually defaults to `make install` anyway
|
||||||
rm -rf "$out/LIB"
|
buildPhase = "true;";
|
||||||
cp -Tr Singular/LIB "$out/lib"
|
|
||||||
ln -s "$out"/*/include "$out"
|
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"
|
mkdir -p "$out/bin"
|
||||||
ln -s "$out/"*/Singular "$out/bin"
|
ln -s $binaries "$out/bin"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
enableParallelBuild = true;
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "A CAS for polynomial computations";
|
description = "A CAS for polynomial computations";
|
||||||
maintainers = with maintainers;
|
maintainers = with maintainers;
|
||||||
|
@ -16712,6 +16712,9 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
singular = callPackage ../applications/science/math/singular {};
|
singular = callPackage ../applications/science/math/singular {};
|
||||||
|
libsingular = callPackage ../applications/science/math/singular {
|
||||||
|
asLibsingular = true;
|
||||||
|
};
|
||||||
|
|
||||||
scilab = callPackage ../applications/science/math/scilab {
|
scilab = callPackage ../applications/science/math/scilab {
|
||||||
withXaw3d = false;
|
withXaw3d = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user