Files
ports/math/py-numpy1/files/patch-numpy___configtool.py
2026-10-04 04:07:15 +00:00

43 lines
1.1 KiB
Python

--- numpy/_configtool.py.orig 2026-04-04 01:24:53 UTC
+++ numpy/_configtool.py
@@ -0,0 +1,39 @@
+import argparse
+from pathlib import Path
+import sys
+
+from .version import __version__
+from .lib.utils import get_include
+
+
+def main() -> None:
+ parser = argparse.ArgumentParser()
+ parser.add_argument(
+ "--version",
+ action="version",
+ version=__version__,
+ help="Print the version and exit.",
+ )
+ parser.add_argument(
+ "--cflags",
+ action="store_true",
+ help="Compile flag needed when using the NumPy headers.",
+ )
+ parser.add_argument(
+ "--pkgconfigdir",
+ action="store_true",
+ help=("Print the pkgconfig directory in which `numpy.pc` is stored "
+ "(useful for setting $PKG_CONFIG_PATH)."),
+ )
+ args = parser.parse_args()
+ if not sys.argv[1:]:
+ parser.print_help()
+ if args.cflags:
+ print("-I" + get_include())
+ if args.pkgconfigdir:
+ _path = Path(get_include()) / '..' / 'lib' / 'pkgconfig'
+ print(_path.resolve())
+
+
+if __name__ == "__main__":
+ main()