[Mod] First commit

This commit is contained in:
2022-10-31 22:18:58 +08:00
commit 1c8a3d9709
13090 changed files with 526733 additions and 0 deletions

View File

@ -0,0 +1,32 @@
config BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
bool
# Numpy has some CPU specific code
default y if BR2_arc
default y if BR2_aarch64
default y if BR2_arm
default y if BR2_armeb
default y if BR2_i386
default y if BR2_mips
default y if BR2_mipsel
default y if BR2_powerpc
default y if BR2_powerpc64
default y if BR2_sh
default y if BR2_x86_64
config BR2_PACKAGE_PYTHON_NUMPY
bool "python-numpy"
depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
# python-numpy needs fenv.h which is not provided by uclibc
depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL
help
NumPy is the fundamental package for scientific computing
with Python.
Note that NumPy needs fenv.h fully supported by the
C library.
http://www.numpy.org/
comment "python-numpy needs glibc or musl"
depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
depends on !(BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL)

View File

@ -0,0 +1,8 @@
# Copied from https://github.com/numpy/numpy/releases/tag/v1.21.2
sha256 76af194fbc117934ec5bbe2ff15177adbd05aeed23f18ee209ed88edcd777e05 numpy-1.21.2.tar.gz
# License files, locally calculated
sha256 bc1b0af15cdc9415ea26c5f1df352c226ac86425ec0fb9ab38d111018bf1c6f2 LICENSE.txt
sha256 2be6947e0432ecf7950ee8fe38681316749dd06d1de17c9ec4de6d2f55adb3a1 numpy/core/src/multiarray/dragon4.c
sha256 fbc539f47d0cf83bc61378080fb873d5c14630126cacbfe754035c3926daa5ec numpy/core/include/numpy/libdivide/LICENSE.txt
sha256 a14cc25e10d40a3aa705b7de2fb764a6535d8ee9b2db4e1724900585457dfd55 numpy/linalg/lapack_lite/LICENSE.txt
sha256 badf51c7e3e7de9c7630bd069780f5c197b846ef7660b342a1e58d5553592d8e tools/npy_tempita/license.txt

View File

@ -0,0 +1,59 @@
################################################################################
#
# python-numpy
#
################################################################################
PYTHON_NUMPY_VERSION = 1.21.2
PYTHON_NUMPY_SOURCE = numpy-$(PYTHON_NUMPY_VERSION).tar.gz
PYTHON_NUMPY_SITE = https://github.com/numpy/numpy/releases/download/v$(PYTHON_NUMPY_VERSION)
PYTHON_NUMPY_LICENSE = BSD-3-Clause, MIT, Zlib
PYTHON_NUMPY_LICENSE_FILES = \
LICENSE.txt \
numpy/core/src/multiarray/dragon4.c \
numpy/core/include/numpy/libdivide/LICENSE.txt \
numpy/linalg/lapack_lite/LICENSE.txt \
tools/npy_tempita/license.txt
PYTHON_NUMPY_SETUP_TYPE = setuptools
PYTHON_NUMPY_DEPENDENCIES = host-python-cython
HOST_PYTHON_NUMPY_DEPENDENCIES = host-python-cython
ifeq ($(BR2_PACKAGE_LAPACK),y)
PYTHON_NUMPY_DEPENDENCIES += lapack
else
PYTHON_NUMPY_ENV += BLAS=None LAPACK=None
endif
ifeq ($(BR2_TOOLCHAIN_HAS_FORTRAN),y)
PYTHON_NUMPY_BUILD_OPTS = --fcompiler=gnu95
PYTHON_NUMPY_ENV += F90=$(TARGET_FC)
else
PYTHON_NUMPY_BUILD_OPTS = --fcompiler=None
endif
define PYTHON_NUMPY_CONFIGURE_CMDS
-rm -f $(@D)/site.cfg
echo "[DEFAULT]" >> $(@D)/site.cfg
echo "library_dirs = $(STAGING_DIR)/usr/lib" >> $(@D)/site.cfg
echo "include_dirs = $(STAGING_DIR)/usr/include" >> $(@D)/site.cfg
endef
# Fixup the npymath.ini prefix path with actual target staging area where
# numpy core was built. Without this, target builds using numpy distutils
# extensions like python-scipy, python-numba cannot find -lnpymath since
# it uses host libraries (like libnpymath.a).
# So, the numpy distutils extension packages would explicitly link this
# config path for their package environment.
define PYTHON_NUMPY_FIXUP_NPY_PKG_CONFIG_FILES
$(SED) '/^pkgdir=/d;/^prefix=/i pkgdir=$(PYTHON3_PATH)/site-packages/numpy/core' \
$(PYTHON3_PATH)/site-packages/numpy/core/lib/npy-pkg-config/npymath.ini
endef
PYTHON_NUMPY_POST_INSTALL_STAGING_HOOKS += PYTHON_NUMPY_FIXUP_NPY_PKG_CONFIG_FILES
# Some package may include few headers from NumPy, so let's install it
# in the staging area.
PYTHON_NUMPY_INSTALL_STAGING = YES
$(eval $(python-package))
$(eval $(host-python-package))