about summary refs log tree commit diff
path: root/pkgs/applications/science/math/sage
diff options
context:
space:
mode:
authorTimo Kaufmann <timokau@zoho.com>2019-11-04 11:36:48 +0100
committerTimo Kaufmann <timokau@zoho.com>2019-11-06 14:40:13 +0100
commitf64885b9ca7d3cb048027184f6094f81e7812e28 (patch)
tree7e23c79c364dc482dabdc8324276df6f7ffaea0b /pkgs/applications/science/math/sage
parentda7ec1c1397fd50803962e0bcf74e1fe97a228d5 (diff)
downloadnixlib-f64885b9ca7d3cb048027184f6094f81e7812e28.tar
nixlib-f64885b9ca7d3cb048027184f6094f81e7812e28.tar.gz
nixlib-f64885b9ca7d3cb048027184f6094f81e7812e28.tar.bz2
nixlib-f64885b9ca7d3cb048027184f6094f81e7812e28.tar.lz
nixlib-f64885b9ca7d3cb048027184f6094f81e7812e28.tar.xz
nixlib-f64885b9ca7d3cb048027184f6094f81e7812e28.tar.zst
nixlib-f64885b9ca7d3cb048027184f6094f81e7812e28.zip
sage: fix pkgconfig errors in tests
python.pkgs.pkgconfig raises an exception on missing packages since
version 1.5.0. Previously those errors were just silently ignored. That
worked fine, since the packages are only missing at runtime (when they
are not really needed) but present at buildtime.

Since this fails the tests now, we just add the packages to
PKG_CONFIG_PATH at runtime. This does not add additional runtime
dependencies. Still, it would be nicer if the sage testssuite would not
test the buildsystem at runtime in the first place.

The breakage was originally caused by the pkgconfig update in
1efa71616fadd5c7f852173445b2db824534b99b.
Diffstat (limited to 'pkgs/applications/science/math/sage')
-rw-r--r--pkgs/applications/science/math/sage/sage-env.nix25
1 files changed, 19 insertions, 6 deletions
diff --git a/pkgs/applications/science/math/sage/sage-env.nix b/pkgs/applications/science/math/sage/sage-env.nix
index 0b67b3cff12b..00397239876b 100644
--- a/pkgs/applications/science/math/sage/sage-env.nix
+++ b/pkgs/applications/science/math/sage/sage-env.nix
@@ -18,6 +18,12 @@
 , ecl
 , maxima-ecl
 , singular
+, fflas-ffpack
+, givaro
+, gd
+, libpng
+, linbox
+, m4ri
 , giac
 , palp
 , rWrapper
@@ -101,14 +107,21 @@ writeTextFile rec {
   name = "sage-env";
   destination = "/${name}";
   text = ''
-    export PKG_CONFIG_PATH='${lib.concatStringsSep ":" (map (pkg: "${pkg}/lib/pkgconfig") [
-        # This is only needed in the src/sage/misc/cython.py test and I'm not
-        # sure if there's really a usecase for it outside of the tests. However
-        # since singular and openblas are runtime dependencies anyways, it doesn't
-        # really hurt to include.
+    export PKG_CONFIG_PATH='${lib.makeSearchPathOutput "dev" "lib/pkgconfig" [
+        # This should only be needed during build. However, since the  doctests
+        # also test the cython build (for example in src/sage/misc/cython.py),
+        # it is also needed for the testsuite to pass. We could fix the
+        # testsuite instead, but since all the packages are also runtime
+        # dependencies it doesn't really hurt to include them here.
         singular
         openblasCompat
-      ])
+        fflas-ffpack givaro
+        gd
+        libpng zlib
+        gsl
+        linbox
+        m4ri
+      ]
     }'
     export SAGE_ROOT='${sagelib.src}'
     export SAGE_LOCAL='@sage-local@'