summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2015-06-04 21:45:52 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2015-06-09 11:20:35 +0200
commit048b4aefcea1d9f51d5543f13d8dd1e386b8e52c (patch)
treedf84db2469351c59f24d30fec332c12b8d585f83 /scripts/lib
parenteed3ed9d9bab6ef81a822708b8e49710efa482f3 (diff)
downloadptxdist-048b4aefcea1d9f51d5543f13d8dd1e386b8e52c.tar.gz
ptxdist-048b4aefcea1d9f51d5543f13d8dd1e386b8e52c.tar.xz
add helper to build python packages
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib')
-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
4 files changed, 69 insertions, 19 deletions
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";;