summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rules/host-python.make4
-rw-r--r--rules/host-python3.make4
-rw-r--r--rules/post/ptxd_make_world_common.make8
-rw-r--r--rules/pre/Rules.make3
-rw-r--r--rules/python3.make2
-rw-r--r--scripts/lib/ptxd_make_world_common.sh19
-rw-r--r--scripts/lib/ptxd_make_world_compile.sh31
-rw-r--r--scripts/lib/ptxd_make_world_install.sh36
-rw-r--r--scripts/lib/ptxd_make_world_prepare.sh2
9 files changed, 88 insertions, 21 deletions
diff --git a/rules/host-python.make b/rules/host-python.make
index fc89b90eb..1d678b22a 100644
--- a/rules/host-python.make
+++ b/rules/host-python.make
@@ -16,7 +16,9 @@ HOST_PACKAGES-$(PTXCONF_HOST_PYTHON) += host-python
#
# Paths and names
#
-HOST_PYTHON_DIR = $(HOST_BUILDDIR)/$(PYTHON)
+HOST_PYTHON_DIR = $(HOST_BUILDDIR)/$(PYTHON)
+
+HOSTPYTHON = $(PTXCONF_SYSROOT_HOST)/bin/python$(PYTHON_MAJORMINOR)
# ----------------------------------------------------------------------------
# Prepare
diff --git a/rules/host-python3.make b/rules/host-python3.make
index f00e956d4..a20a2613c 100644
--- a/rules/host-python3.make
+++ b/rules/host-python3.make
@@ -17,7 +17,9 @@ HOST_PACKAGES-$(PTXCONF_HOST_PYTHON3) += host-python3
#
# Paths and names
#
-HOST_PYTHON3_DIR = $(HOST_BUILDDIR)/$(PYTHON3)
+HOST_PYTHON3_DIR = $(HOST_BUILDDIR)/$(PYTHON3)
+
+HOSTPYTHON3 = $(PTXCONF_SYSROOT_HOST)/bin/python$(PYTHON3_MAJORMINOR)
# ----------------------------------------------------------------------------
# Prepare
diff --git a/rules/post/ptxd_make_world_common.make b/rules/post/ptxd_make_world_common.make
index ed2c840cc..68950645d 100644
--- a/rules/post/ptxd_make_world_common.make
+++ b/rules/post/ptxd_make_world_common.make
@@ -46,6 +46,14 @@ ptx/env = \
ptx_conf_opt_autoconf_cross="$(call ptx/escape,$(HOST_CROSS_AUTOCONF))" \
ptx_conf_opt_autoconf_cross_sysroot="$(call ptx/escape,$(HOST_CROSS_AUTOCONF_SYSROOT))"\
\
+ ptx_python_target="$(call ptx/escape,$(CROSS_PYTHON))" \
+ ptx_python3_target="$(call ptx/escape,$(CROSS_PYTHON3))" \
+ ptx_install_opt_python_target="$(call ptx/escape,$(CROSS_PYTHON_INSTALL))"\
+ \
+ ptx_python_host="$(call ptx/escape,$(HOSTPYTHON))" \
+ ptx_python3_host="$(call ptx/escape,$(HOSTPYTHON3))" \
+ ptx_install_opt_python_host="$(call ptx/escape,$(HOST_PYTHON_INSTALL))" \
+ \
ptx_ipkg_extra_args=$(PTXCONF_IMAGE_IPKG_EXTRA_ARGS) \
ptx_opkg_extra_args=$(PTXCONF_IMAGE_OPKG_EXTRA_ARGS) \
ptx_xpkg_type=$(PTXCONF_HOST_PACKAGE_MANAGEMENT)
diff --git a/rules/pre/Rules.make b/rules/pre/Rules.make
index 9e770d5f9..69dbb4289 100644
--- a/rules/pre/Rules.make
+++ b/rules/pre/Rules.make
@@ -254,6 +254,9 @@ CROSS_QMAKE_OPT := \
-recursive \
$(if $(filter 0,$(PTXDIST_VERBOSE)),CONFIG+=silent)
+CROSS_PYTHON_INSTALL := install --prefix=/usr
+HOST_PYTHON_INSTALL := install --prefix=
+
ifdef PTXCONF_GLOBAL_IPV6
GLOBAL_IPV6_OPTION := --enable-ipv6
else
diff --git a/rules/python3.make b/rules/python3.make
index df2837043..10eb9b47a 100644
--- a/rules/python3.make
+++ b/rules/python3.make
@@ -30,6 +30,8 @@ PYTHON3_URL := \
http://python.org/ftp/python/$(PYTHON3_VERSION)/$(PYTHON3).$(PYTHON3_SUFFIX) \
http://python.org/ftp/python/$(PYTHON3_MAJORMINOR)/$(PYTHON3).$(PYTHON3_SUFFIX)
+CROSS_PYTHON3 := $(PTXCONF_SYSROOT_CROSS)/bin/python$(PYTHON3_MAJORMINOR)
+
# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------
diff --git a/scripts/lib/ptxd_make_world_common.sh b/scripts/lib/ptxd_make_world_common.sh
index 4c3c78f9d..d32a166af 100644
--- a/scripts/lib/ptxd_make_world_common.sh
+++ b/scripts/lib/ptxd_make_world_common.sh
@@ -112,6 +112,10 @@ ptxd_make_world_init_compat() {
# install_opt
+ if [[ -z "${pkg_install_opt}" && "${pkg_conf_tool}" =~ "python" ]]; then
+ local install_opt_ptr="ptx_install_opt_python_${pkg_type}"
+ pkg_install_opt="${!install_opt_ptr}"
+ fi
if [ -z "${pkg_install_opt}" ]; then
pkg_install_opt="install"
@@ -127,7 +131,11 @@ ptxd_make_world_init_compat() {
fi
# DESTDIR
- pkg_install_opt="DESTDIR=\"${pkg_pkg_dir}\" INSTALL_ROOT=\"${pkg_pkg_dir}\" ${pkg_install_opt}"
+ if [[ "${pkg_conf_tool}" =~ "python" ]]; then
+ pkg_install_opt="${pkg_install_opt} --root=${pkg_pkg_dir}"
+ else
+ pkg_install_opt="DESTDIR=\"${pkg_pkg_dir}\" INSTALL_ROOT=\"${pkg_pkg_dir}\" ${pkg_install_opt}"
+ fi
#
# pkg_binconfig_glob
@@ -304,6 +312,15 @@ ptxd_make_world_init() {
unset conf_opt_ptr conf_env_ptr
;;
+ python|python3)
+ local build_python_ptr="ptx_${pkg_conf_tool}_${pkg_type}"
+ local env_ptr="ptx_conf_env_${pkg_type}"
+
+ ptx_build_python="${!build_python_ptr}"
+ pkg_make_env="${pkg_conf_env:-${!env_ptr}}"
+ pkg_make_opt="${pkg_make_opt:-build}"
+ pkg_install_env="${pkg_conf_env:-${!env_ptr}}"
+ ;;
*) ;;
esac
diff --git a/scripts/lib/ptxd_make_world_compile.sh b/scripts/lib/ptxd_make_world_compile.sh
index c859f1099..5e115bdbc 100644
--- a/scripts/lib/ptxd_make_world_compile.sh
+++ b/scripts/lib/ptxd_make_world_compile.sh
@@ -17,13 +17,28 @@ ptxd_make_world_compile() {
# no build dir -> assume the package has nothing to build.
return
fi &&
-
- ptxd_eval \
- "${pkg_path}" \
- "${pkg_env}" \
- "${pkg_make_env}" \
- "${MAKE}" -C "${pkg_build_dir}" \
- "${pkg_make_opt}" \
- "${pkg_make_par}"
+ case "${pkg_conf_tool}" in
+ python*)
+ (
+ ptxd_eval \
+ cd "${pkg_build_dir}" '&&' \
+ "${pkg_path}" \
+ "${pkg_env}" \
+ "${pkg_make_env}" \
+ "${ptx_build_python}" \
+ setup.py \
+ "${pkg_make_opt}"
+ )
+ ;;
+ *)
+ ptxd_eval \
+ "${pkg_path}" \
+ "${pkg_env}" \
+ "${pkg_make_env}" \
+ "${MAKE}" -C "${pkg_build_dir}" \
+ "${pkg_make_opt}" \
+ "${pkg_make_par}"
+ ;;
+ esac
}
export -f ptxd_make_world_compile
diff --git a/scripts/lib/ptxd_make_world_install.sh b/scripts/lib/ptxd_make_world_install.sh
index b4f4647f3..9431c160f 100644
--- a/scripts/lib/ptxd_make_world_install.sh
+++ b/scripts/lib/ptxd_make_world_install.sh
@@ -48,16 +48,32 @@ ptxd_make_world_install() {
ptxd_make_world_install_prepare &&
- cmd=( \
- "${pkg_path}" \
- "${pkg_env}" \
- "${pkg_make_env}" \
- "${pkg_install_env}" \
- "${MAKE}" \
- -C "${pkg_build_dir}" \
- "${pkg_install_opt}" \
- -j1 \
- ) &&
+ case "${pkg_conf_tool}" in
+ python*)
+ cmd=( \
+ cd "${pkg_build_dir}" '&&' \
+ "${pkg_path}" \
+ "${pkg_env}" \
+ "${pkg_make_env}" \
+ "${pkg_install_env}" \
+ "${ptx_build_python}" \
+ setup.py \
+ "${pkg_install_opt}" \
+ )
+ ;;
+ *)
+ cmd=( \
+ "${pkg_path}" \
+ "${pkg_env}" \
+ "${pkg_make_env}" \
+ "${pkg_install_env}" \
+ "${MAKE}" \
+ -C "${pkg_build_dir}" \
+ "${pkg_install_opt}" \
+ -j1 \
+ )
+ ;;
+ esac &&
ptxd_verbose "executing:" "${cmd[@]}" &&
diff --git a/scripts/lib/ptxd_make_world_prepare.sh b/scripts/lib/ptxd_make_world_prepare.sh
index 57e3a54d0..1664cc551 100644
--- a/scripts/lib/ptxd_make_world_prepare.sh
+++ b/scripts/lib/ptxd_make_world_prepare.sh
@@ -136,6 +136,8 @@ ptxd_make_world_prepare() {
autoconf|cmake|qmake|kconfig|perl)
cd -- "${pkg_build_dir}" &&
ptxd_make_world_prepare_"${pkg_conf_tool}" ;;
+ python|python3)
+ : ;; # nothing to do
"NO") echo "prepare stage disabled." ;;
"") echo "No prepare tool found. Do nothing." ;;
*) ptxd_bailout "automatic prepare tool selection failed. Set <PKG>_CONF_TOOL";;