summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorAlexandru Ardelean <ardeleanalex@gmail.com>2017-10-02 15:43:52 +0300
committerAlexandru Ardelean <ardeleanalex@gmail.com>2017-10-03 10:40:26 +0300
commit074d2863be48c1a9093fffcda91f7a328bc7d0cb (patch)
treec963c25702bdcee40c82195765b2ecfb8fbd76c7 /lang
parent64db240f13b58d214cb0619f0131acd7c2372276 (diff)
python,python3: add option to keep egg-info dirs for python packages
That way some python packages can choose to keep their egg-info dirs, if they want to, or they're needed. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Diffstat (limited to 'lang')
-rw-r--r--lang/python/python/Makefile4
-rw-r--r--lang/python/python/files/python-package-install.sh3
-rw-r--r--lang/python/python/files/python-package.mk4
-rw-r--r--lang/python/python3/Makefile2
-rw-r--r--lang/python/python3/files/python3-package-install.sh3
-rw-r--r--lang/python/python3/files/python3-package.mk4
6 files changed, 16 insertions, 4 deletions
diff --git a/lang/python/python/Makefile b/lang/python/python/Makefile
index 96aac08b1..03cda5ce9 100644
--- a/lang/python/python/Makefile
+++ b/lang/python/python/Makefile
@@ -12,7 +12,9 @@ include ./files/python-version.mk
PKG_NAME:=python
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
-PKG_RELEASE:=1
+# XXX: reset PKG_RELEASE to 1 only if Python's pip & setuptools versions have also bumped;
+# otherwise, keep bumping PKG_RELEASE
+PKG_RELEASE:=2
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
diff --git a/lang/python/python/files/python-package-install.sh b/lang/python/python/files/python-package-install.sh
index 94becf2c9..cefbce376 100644
--- a/lang/python/python/files/python-package-install.sh
+++ b/lang/python/python/files/python-package-install.sh
@@ -47,7 +47,8 @@ process_filespec "$src_dir" "$dst_dir" "$filespec" || {
}
# delete egg-info directories
-find "$dst_dir" -name "*.egg-info" | xargs rm -rf
+[ "$PYTHON_KEEP_EGGINFO" == "1" ] || \
+ find "$dst_dir" -name "*.egg-info" | xargs rm -rf
if [ "$mode" == "sources" ] ; then
# Copy only python source files
diff --git a/lang/python/python/files/python-package.mk b/lang/python/python/files/python-package.mk
index 9c231f6ec..7e3cb2ce8 100644
--- a/lang/python/python/files/python-package.mk
+++ b/lang/python/python/files/python-package.mk
@@ -32,6 +32,8 @@ ifdef CONFIG_USE_MIPS16
TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
endif
+PYTHON_KEEP_EGGINFO ?= 0
+
define PyPackage
define Package/$(1)-src
@@ -68,11 +70,13 @@ define PyPackage
$(call PyPackage/$(1)/install,$$(1))
find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
if [ -e files/python-package-install.sh ] ; then \
+ PYTHON_KEEP_EGGINFO="$(PYTHON_KEEP_EGGINFO)" \
$(SHELL) files/python-package-install.sh \
"$(PKG_INSTALL_DIR)" "$$(1)" \
"$(HOST_PYTHON_BIN)" "$$(2)" \
"$$$$$$$$$$(call shvar,PyPackage/$(1)/filespec)" ; \
elif [ -e $(STAGING_DIR)/mk/python-package-install.sh ] ; then \
+ PYTHON_KEEP_EGGINFO="$(PYTHON_KEEP_EGGINFO)" \
$(SHELL) $(STAGING_DIR)/mk/python-package-install.sh \
"$(PKG_INSTALL_DIR)" "$$(1)" \
"$(HOST_PYTHON_BIN)" "$$(2)" \
diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile
index 7fdcb92fa..4b5311ecc 100644
--- a/lang/python/python3/Makefile
+++ b/lang/python/python3/Makefile
@@ -16,7 +16,7 @@ PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
PKG_NAME:=python3
# XXX: reset PKG_RELEASE to 1 only if Python's pip & setuptools versions have also bumped;
# otherwise, keep bumping PKG_RELEASE
-PKG_RELEASE:=6
+PKG_RELEASE:=7
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
diff --git a/lang/python/python3/files/python3-package-install.sh b/lang/python/python3/files/python3-package-install.sh
index dd1e708fc..0b68dd245 100644
--- a/lang/python/python3/files/python3-package-install.sh
+++ b/lang/python/python3/files/python3-package-install.sh
@@ -47,7 +47,8 @@ process_filespec "$src_dir" "$dst_dir" "$filespec" || {
}
# delete egg-info directories
-find "$dst_dir" -name "*.egg-info" | xargs rm -rf
+[ "$PYTHON3_KEEP_EGGINFO" == "1" ] || \
+ find "$dst_dir" -name "*.egg-info" | xargs rm -rf
if [ "$mode" == "sources" ] ; then
# Copy only python source files
diff --git a/lang/python/python3/files/python3-package.mk b/lang/python/python3/files/python3-package.mk
index 93b14fac2..1d42b6dc3 100644
--- a/lang/python/python3/files/python3-package.mk
+++ b/lang/python/python3/files/python3-package.mk
@@ -32,6 +32,8 @@ ifdef CONFIG_USE_MIPS16
TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
endif
+PYTHON3_KEEP_EGGINFO ?= 0
+
define Py3Package
define Package/$(1)-src
@@ -68,11 +70,13 @@ define Py3Package
$(call Py3Package/$(1)/install,$$(1))
find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
if [ -e files/python3-package-install.sh ] ; then \
+ PYTHON3_KEEP_EGGINFO="$(PYTHON3_KEEP_EGGINFO)" \
$(SHELL) files/python3-package-install.sh \
"$(PKG_INSTALL_DIR)" "$$(1)" \
"$(HOST_PYTHON3_BIN)" "$$(2)" \
"$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)" ; \
elif [ -e $(STAGING_DIR)/mk/python3-package-install.sh ] ; then \
+ PYTHON3_KEEP_EGGINFO="$(PYTHON3_KEEP_EGGINFO)" \
$(SHELL) $(STAGING_DIR)/mk/python3-package-install.sh \
"$(PKG_INSTALL_DIR)" "$$(1)" \
"$(HOST_PYTHON3_BIN)" "$$(2)" \