Skip to content

Commit 7ae44a4

Browse files
committed
package/python-numpy: Strip test files
1 parent d820fc5 commit 7ae44a4

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

package/python-numpy/Config.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ config BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
1515
default y if BR2_sh
1616
default y if BR2_x86_64
1717

18+
config BR2_PACKAGE_PYTHON_NUMPY_TESTS
19+
bool "numpy.tests"
20+
help
21+
Include test files.
22+
Selecting this option adds about 2.5 MB to the target file
23+
system.
24+
1825
config BR2_PACKAGE_PYTHON_NUMPY
1926
bool "python-numpy"
2027
depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS

package/python-numpy/python-numpy.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,13 @@ endef
3232
# in the staging area.
3333
PYTHON_NUMPY_INSTALL_STAGING = YES
3434

35+
ifneq ($(BR2_PACKAGE_PYTHON_NUMPY_TESTS),y)
36+
define PYTHON_NUMPY_REMOVE_TESTS
37+
find $(TARGET_DIR)/usr/lib/python*/site-packages/numpy/ \
38+
-name tests -prune -exec rm -rf {} \;
39+
endef
40+
PYTHON_NUMPY_POST_INSTALL_TARGET_HOOKS += PYTHON_NUMPY_REMOVE_TESTS
41+
endif
42+
3543
$(eval $(python-package))
3644
$(eval $(host-python-package))

0 commit comments

Comments
 (0)