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