imager: fix numpy header detection

With recent Numpy versions (> 2.0.0), the header files are located in
_core/include instead of core/include, and the configure script does not
detect them. Use the `numpy.get_include()` function for the detection
in that script.

+29
+26
pkgs/by-name/im/imager/numpy-header.patch
···
··· 1 + diff --git a/admin/gildas-env.sh b/admin/gildas-env.sh 2 + index acb06f9..b25ecd5 100644 3 + --- a/admin/gildas-env.sh 4 + +++ b/admin/gildas-env.sh 5 + @@ -441,7 +441,7 @@ EOF 6 + # Now search for Numpy 7 + if python -c "import numpy" > /dev/null 2>&1; then 8 + NUMPY_PRESENT=yes 9 + - NUMPY_INC_DIR=`python -c "import numpy; print(numpy.__path__[0] + '/core/include')"` 10 + + NUMPY_INC_DIR=`python -c "import numpy; print(numpy.get_include())"` 11 + if [ -e "$NUMPY_INC_DIR/numpy/arrayobject.h" ]; then 12 + NUMPY_INC_PRESENT=yes 13 + else 14 + diff --git a/utilities/etc/setup.py.src b/utilities/etc/setup.py.src 15 + index 9a4da86..110a0d1 100644 16 + --- a/utilities/etc/setup.py.src 17 + +++ b/utilities/etc/setup.py.src 18 + @@ -75,7 +75,7 @@ mod_extras = mod_extras.split() 19 + 20 + if (os.environ.get('NUMPY_PRESENT') == "yes"): 21 + import numpy 22 + - mod_inc_dirs.append(numpy.__path__[0] + '/core/include') 23 + + mod_inc_dirs.append(numpy.get_include()) 24 + else: 25 + raise Exception("Numpy python package should be present. Aborting.") 26 +
+3
pkgs/by-name/im/imager/package.nix
··· 59 ./clang.patch 60 # Replace hardcoded cpp with GAG_CPP (see below). 61 ./cpp-darwin.patch 62 ]; 63 64 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";
··· 59 ./clang.patch 60 # Replace hardcoded cpp with GAG_CPP (see below). 61 ./cpp-darwin.patch 62 + # Fix the numpy header detection with numpy > 2.0.0 63 + # Patch submitted upstream, it will be included in the next release. 64 + ./numpy-header.patch 65 ]; 66 67 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";