You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.3 KiB

  1. #
  2. # Copyright (C) 2019 Jakub Piotr Cłapa <jpc@loee.pl>
  3. # Copyright (C) 2020 Alexandru Ardelean <ardeleanalex@gmail.com>
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=numpy
  7. PKG_VERSION:=1.21.5
  8. PKG_RELEASE:=$(AUTORELEASE)
  9. PYPI_NAME:=$(PKG_NAME)
  10. PKG_HASH:=6a5928bc6241264dce5ed509e66f33676fc97f464e7a919edc672fb5532221ee
  11. PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
  12. PKG_LICENSE:=BSD-3-Clause
  13. PKG_LICENSE_FILES:=LICENSE.txt
  14. PKG_CPE_ID:=cpe:/a:numpy:numpy
  15. PKG_CONFIG_DEPENDS:= \
  16. CONFIG_NUMPY_OPENBLAS_SUPPORT
  17. # yes, zip... sigh
  18. PYPI_SOURCE_EXT:=zip
  19. HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=Cython
  20. include ../pypi.mk
  21. include $(INCLUDE_DIR)/package.mk
  22. include ../python3-package.mk
  23. define Package/python3-numpy
  24. SUBMENU:=Python
  25. SECTION:=lang
  26. CATEGORY:=Languages
  27. TITLE:=The fundamental package for scientific computing with Python
  28. URL:=https://www.numpy.org/
  29. DEPENDS:=@!SOFT_FLOAT +INSTALL_GFORTRAN:libgfortran +python3 \
  30. +NUMPY_OPENBLAS_SUPPORT:openblas
  31. endef
  32. # We need to duplicate the omitted arhitectures same as openblas
  33. define Package/python3-numpy/config
  34. menu "Configuration"
  35. depends on !powerpc
  36. depends on !arc
  37. config NUMPY_OPENBLAS_SUPPORT
  38. bool "Enable OpenBLAS support"
  39. default n
  40. endmenu
  41. endef
  42. ifdef CONFIG_NUMPY_OPENBLAS_SUPPORT
  43. define Build/Prepare/numpy-sitecfg
  44. echo "[DEFAULT]" > $(PKG_BUILD_DIR)/site.cfg
  45. echo "library_dirs = $(STAGING_DIR)/usr/lib" >> $(PKG_BUILD_DIR)/site.cfg
  46. echo "include_dirs = $(STAGING_DIR)/usr/include" >> $(PKG_BUILD_DIR)/site.cfg
  47. echo >> $(PKG_BUILD_DIR)/site.cfg
  48. echo "[openblas]" >> $(PKG_BUILD_DIR)/site.cfg
  49. echo "libraries = openblas" >> $(PKG_BUILD_DIR)/site.cfg
  50. echo "runtime_library_dirs = /usr/lib" >> $(PKG_BUILD_DIR)/site.cfg
  51. endef
  52. endif
  53. define Build/Prepare
  54. $(call Build/Prepare/Default)
  55. $(call Build/Prepare/numpy-sitecfg)
  56. endef
  57. define Package/python3-numpy/description
  58. NumPy is the fundamental package for array computing with Python.
  59. By default, this package is built without some modules.
  60. For some modules to be available, the INSTALL_GFORTRAN symbol needs
  61. to be enabled in the OpenWrt core/toolchain.
  62. endef
  63. $(eval $(call Py3Package,python3-numpy))
  64. $(eval $(call BuildPackage,python3-numpy))
  65. $(eval $(call BuildPackage,python3-numpy-src))