diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2016-10-12 20:22:52 +0200 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2016-10-26 11:06:40 +0200 |
commit | 2bed05d8e1902595b35049f0fd9bd4322c77bf54 (patch) | |
tree | 72457c7282ed8017d9184a33793804952a84be34 /pkgs/applications/science/math/singular/default.nix | |
parent | 8e9ad9bfdc4cc4698d80d3ad8fe509ce5629f789 (diff) |
singular: add an option to install as libsingular
Diffstat (limited to 'pkgs/applications/science/math/singular/default.nix')
-rw-r--r-- | pkgs/applications/science/math/singular/default.nix | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix index 8e9e66e26fbbe..73c0d7ca5108f 100644 --- a/pkgs/applications/science/math/singular/default.nix +++ b/pkgs/applications/science/math/singular/default.nix @@ -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; |