Based on: https://git.openembedded.org/meta-openembedded/plain/meta-python/recipes-devtools/python/python3-pandas/0001-BLD-add-option-to-specify-numpy-header-location.patch

diff --git a/meson.options b/meson.options
new file mode 100644
index 0000000..d1c455d
--- /dev/null
+++ b/meson.options
@@ -0,0 +1 @@
+option('numpy_inc_dir', type : 'string', description : 'The absolute path to the numpy headers')
diff --git a/pandas/meson.build b/pandas/meson.build
index 435103a..64f47b7 100644
--- a/pandas/meson.build
+++ b/pandas/meson.build
@@ -1,21 +1,7 @@
-incdir_numpy = run_command(py,
-  [
-    '-c',
-    '''
-import os
-import numpy as np
-try:
-    # Check if include directory is inside the pandas dir
-    # e.g. a venv created inside the pandas dir
-    # If so, convert it to a relative path
-    incdir = os.path.relpath(np.get_include())
-except Exception:
-    incdir = np.get_include()
-print(incdir)
-     '''
-  ],
-  check: true
-).stdout().strip()
+incdir_numpy = run_command(py, [
+  '-c',
+  'import os; print(os.getenv("NUMPY_INC_DIR"))'
+], env: {'NUMPY_INC_DIR': get_option('numpy_inc_dir')}, check: true).stdout().strip()
 
 inc_np = include_directories(incdir_numpy)
 inc_pd = include_directories('_libs/include')
-- 
2.25.1

