git.iko.soy/typeable/nixpkgs
on master help sign in
singular: add an option to install as libsingular
commit2bed05d8e1902595b35049f0fd9bd4322c77bf54 authorMichael Raskin <7c6f434c@mail.ru> dateWed 12 Oct 2016, 20:22 (10 years ago) parent8e9ad9b
2 files changed+22−7
pkgs/applications/science/math/singular/default.nix+19−7 pkgs/top-level/all-packages.nix+3
pkgs/applications/science/math/singular/default.nix+19−7
@@ -1,4 +1,6 @@
1−{ stdenv, fetchurl, gmp, bison, perl, autoconf, ncurses, readline, coreutils }:
1+{ stdenv, fetchurl, gmp, bison, perl, autoconf, ncurses, readline, coreutils, pkgconfig
2+, asLibsingular ? false
3+}:
24
35stdenv.mkDerivation rec {
46 name = "singular-${version}";
@@ -9,23 +11,33 @@ stdenv.mkDerivation rec {
911 sha256 = "1j4mcpnwzdp3h4qspk6ww0m67rmx4s11cy17pvzbpf70lm0jzzh2";
1012 };
1113
12− buildInputs = [ gmp bison perl autoconf ncurses readline coreutils ];
14+ buildInputs = [ gmp perl ncurses readline ];
15+ nativeBuildInputs = [ autoconf bison pkgconfig ];
1316
1417 preConfigure = ''
1518 find . -exec sed -e 's@/bin/rm@${coreutils}&@g' -i '{}' ';'
1619 find . -exec sed -e 's@/bin/uname@${coreutils}&@g' -i '{}' ';'
20+ ${stdenv.lib.optionalString asLibsingular ''NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DLIBSINGULAR"''}
1721 '';
1822
1923 hardeningDisable = stdenv.lib.optional stdenv.isi686 "stackprotector";
2024
21− postInstall = ''
22− rm -rf "$out/LIB"
23− cp -Tr Singular/LIB "$out/lib"
24− ln -s "$out"/*/include "$out"
25+ # The Makefile actually defaults to `make install` anyway
26+ buildPhase = "true;";
27+
28+ installPhase = ''
29+ mkdir -p "$out"
30+ cp -r Singular/LIB "$out/LIB"
31+ make install${stdenv.lib.optionalString asLibsingular "-libsingular"}
32+
33+ binaries="$(find "$out"/* \( -type f -o -type l \) -perm -111 \! -name '*.so' -maxdepth 1)"
34+ ln -s "$out"/*/{include,lib} "$out"
2535 mkdir -p "$out/bin"
26− ln -s "$out/"*/Singular "$out/bin"
36+ ln -s $binaries "$out/bin"
2737 '';
2838
39+ enableParallelBuild = true;
40+
2941 meta = with stdenv.lib; {
3042 description = "A CAS for polynomial computations";
3143 maintainers = with maintainers;
pkgs/top-level/all-packages.nix+3
@@ -16712,6 +16712,9 @@ in
1671216712 };
1671316713
1671416714 singular = callPackage ../applications/science/math/singular {};
16715+ libsingular = callPackage ../applications/science/math/singular {
16716+ asLibsingular = true;
16717+ };
1671516718
1671616719 scilab = callPackage ../applications/science/math/scilab {
1671716720 withXaw3d = false;