summaryrefslogtreecommitdiff
path: root/lang/python/python3/files
diff options
context:
space:
mode:
authorchamptar <champetier.etienne@gmail.com>2017-07-19 11:46:21 -0700
committerGitHub <noreply@github.com>2017-07-19 11:46:21 -0700
commitbd8ccf184f66b8f866eac8808ba8c12be86f60c7 (patch)
tree1195a4450c9012c52c1dd22659a15ea030f0aa9e /lang/python/python3/files
parentc188fcfb7c4fdd9f715db872f038f4ff3bf00404 (diff)
parent612c53fc6c3d9ba2a57f7329baf055f1d59a9246 (diff)
Merge pull request #4598 from commodo/fix-python-builds
python,python3: try to stabilize host builds
Diffstat (limited to 'lang/python/python3/files')
-rw-r--r--lang/python/python3/files/python3-host.mk20
-rw-r--r--lang/python/python3/files/python3-package-install.sh21
-rw-r--r--lang/python/python3/files/python3-package.mk3
3 files changed, 33 insertions, 11 deletions
diff --git a/lang/python/python3/files/python3-host.mk b/lang/python/python3/files/python3-host.mk
index 3abf6aa5f..96bbc19cc 100644
--- a/lang/python/python3/files/python3-host.mk
+++ b/lang/python/python3/files/python3-host.mk
@@ -60,6 +60,19 @@ define Build/Compile/HostPy3RunHost
)
endef
+# Note: I shamelessly copied this from Yousong's logic (from python-packages);
+HOST_PYTHON3_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON3_VERSION)
+define host_python3_pip_install
+ $(HOST_PYTHON3_PIP) install \
+ --root=$(1) \
+ --prefix=$(2) \
+ --ignore-installed \
+ $(3)
+endef
+
+define host_python3_pip_install_host
+$(call host_python3_pip_install,$(STAGING_DIR_HOSTPKG),"",$(1))
+endef
# $(1) => build subdir
# $(2) => additional arguments to setup.py
@@ -71,11 +84,4 @@ define Build/Compile/HostPy3Mod
$(3))
endef
-define HostPy3/Compile/Default
- $(call Build/Compile/HostPy3Mod,,\
- install --root="$(STAGING_DIR_HOSTPKG)" --prefix="" \
- --single-version-externally-managed \
- )
-endef
-
endif # __python3_host_mk_inc
diff --git a/lang/python/python3/files/python3-package-install.sh b/lang/python/python3/files/python3-package-install.sh
index ae5e17280..cbb84ab1c 100644
--- a/lang/python/python3/files/python3-package-install.sh
+++ b/lang/python/python3/files/python3-package-install.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+set -e
process_filespec() {
local src_dir="$1"
@@ -50,10 +51,13 @@ find "$dst_dir" -name "*.egg-info" | xargs rm -rf
if [ "$mode" == "sources" ] ; then
# Copy only python source files
- find $dst_dir -not -name "*\.py" | xargs rm -f
+ find $dst_dir -type f -not -name "*\.py" | xargs rm -f
+
# Delete empty folders (if the case)
- find $dst_dir/usr -type d | xargs rmdir &> /dev/null
- rmdir $dst_dir/usr &> /dev/null
+ if [ -d "$dst_dir/usr" ] ; then
+ find $dst_dir/usr -type d | xargs rmdir --ignore-fail-on-non-empty
+ rmdir --ignore-fail-on-non-empty $dst_dir/usr
+ fi
exit 0
fi
@@ -67,6 +71,15 @@ $python -m compileall -b -d '/' $dst_dir || {
echo "python -m compileall err-ed"
exit 1
}
+
# Delete source files and pyc [ un-optimized bytecode files ]
# We may want to make this optimization thing configurable later, but not sure atm
-find $dst_dir -name "*\.py" | xargs rm -f
+find $dst_dir -type f -name "*\.py" | xargs rm -f
+
+# Delete empty folders (if the case)
+if [ -d "$dst_dir/usr" ] ; then
+ find $dst_dir/usr -type d | xargs rmdir --ignore-fail-on-non-empty
+ rmdir --ignore-fail-on-non-empty $dst_dir/usr
+fi
+
+exit 0
diff --git a/lang/python/python3/files/python3-package.mk b/lang/python/python3/files/python3-package.mk
index 22ee527a1..93b14fac2 100644
--- a/lang/python/python3/files/python3-package.mk
+++ b/lang/python/python3/files/python3-package.mk
@@ -126,6 +126,9 @@ define Build/Compile/Py3Mod
endef
define Py3Build/Compile/Default
+ $(foreach pkg,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS),
+ $(call host_python3_pip_install_host,$(pkg))
+ )
$(call Build/Compile/Py3Mod,, \
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
--single-version-externally-managed \