From f64885b9ca7d3cb048027184f6094f81e7812e28 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Mon, 4 Nov 2019 11:36:48 +0100 Subject: [PATCH] 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. --- .../science/math/sage/sage-env.nix | 25 ++++++++++++++----- 1 file 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 0b67b3cff12..00397239876 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@'