mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
python3Packages.numpy: make numpy.pc more visible
This change also enables scipy to find numpy via pkg-config, and not
only via `scipy.passthru.buildConfig.properties.numpy-include-dir`, and
thus enables free threading via f2py. See:
7fd20c742b (diff-b39b7bda5a)
Arguably, this makes the `numpy.passthru.coreIncludeDir` definition
redundant, but we will keep it for backwards compatibility.
This commit is contained in:
parent
e388eff357
commit
95d2a3227b
1 changed files with 13 additions and 1 deletions
|
|
@ -113,6 +113,14 @@ buildPythonPackage (finalAttrs: {
|
|||
typing-extensions
|
||||
];
|
||||
|
||||
# Enables any dependent package to easily find numpy.pc via standard
|
||||
# pkg-config call. The `$out/include` symlink matches what's written in the
|
||||
# numpy.pc file.
|
||||
postInstall = ''
|
||||
ln -s $out/${python.sitePackages}/numpy/_core/lib/pkgconfig $out/lib/pkgconfig
|
||||
ln -s ${placeholder "out"}/${finalAttrs.passthru.coreIncludeInnerDir} $out/include
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
pushd $out
|
||||
# For numpy-config executable to be available during tests
|
||||
|
|
@ -192,7 +200,11 @@ buildPythonPackage (finalAttrs: {
|
|||
name = "site.cfg";
|
||||
text = lib.generators.toINI { } finalAttrs.finalPackage.buildConfig;
|
||||
};
|
||||
coreIncludeDir = "${finalAttrs.finalPackage}/${python.sitePackages}/numpy/_core/include";
|
||||
# Need to be defined with two variables for postInstall to use `placeholder
|
||||
# "out"` where here we have to use `${finalAttrs.finalPackage}`, that would
|
||||
# cause infinite recursion if used in postInstall too.
|
||||
coreIncludeInnerDir = "${python.sitePackages}/numpy/_core/include";
|
||||
coreIncludeDir = "${finalAttrs.finalPackage}/${finalAttrs.finalPackage.passthru.coreIncludeInnerDir}";
|
||||
tests = {
|
||||
inherit sage;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue