SCons is a tool of constant reconfiguration. Almost each call means performing the configure tests, therefore it does not nicely fit into PTXDist stages. To get saner behaviour and save some time everything is done at install stage. Also note that SCons does not enforce any standard targets nor variable names, athough most projects seems to support DESTDIR environment variable and install target.
Signed-off-by: Ladislav Michl <[email protected]> --- CHANGES: -v{2,3}: None -v4: Moved all the work to install stage scripts/lib/ptxd_make_world_common.sh | 7 ++++++- scripts/lib/ptxd_make_world_compile.sh | 2 ++ scripts/lib/ptxd_make_world_install.sh | 11 +++++++++++ scripts/lib/ptxd_make_world_prepare.sh | 7 ++++++- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/scripts/lib/ptxd_make_world_common.sh b/scripts/lib/ptxd_make_world_common.sh index dc601cc05..c277304c7 100644 --- a/scripts/lib/ptxd_make_world_common.sh +++ b/scripts/lib/ptxd_make_world_common.sh @@ -319,6 +319,11 @@ ptxd_make_world_init() { pkg_make_env="${pkg_conf_env:-${!env_ptr}}" pkg_make_opt="${pkg_make_opt:-build}" ;; + scons) + local env_ptr="ptx_conf_env_${pkg_type}" + pkg_make_env="${pkg_conf_env:-${!env_ptr}}" + pkg_make_opt="${pkg_conf_opt}" + ;; meson) local conf_opt_ptr="ptx_conf_opt_${pkg_conf_tool}_${pkg_type}${conf_opt_ext}" local conf_env_ptr="ptx_conf_env_${pkg_conf_tool}_${pkg_type}" @@ -428,7 +433,7 @@ ptxd_make_world_init() { python*) pkg_install_opt="${pkg_install_opt} --root=${pkg_pkg_dir}" ;; - ninja) + ninja|scons) pkg_env="DESTDIR=\"${pkg_pkg_dir}\" ${pkg_env}" ;; *) diff --git a/scripts/lib/ptxd_make_world_compile.sh b/scripts/lib/ptxd_make_world_compile.sh index c7093250d..0c86878a2 100644 --- a/scripts/lib/ptxd_make_world_compile.sh +++ b/scripts/lib/ptxd_make_world_compile.sh @@ -37,6 +37,8 @@ ptxd_make_world_compile() { "${pkg_make_opt}" \ "${pkg_make_par}" ;; + scons) + ;; *) ptxd_eval \ "${pkg_path}" \ diff --git a/scripts/lib/ptxd_make_world_install.sh b/scripts/lib/ptxd_make_world_install.sh index ba8e2058e..a7ae6cd95 100644 --- a/scripts/lib/ptxd_make_world_install.sh +++ b/scripts/lib/ptxd_make_world_install.sh @@ -98,6 +98,17 @@ ptxd_make_world_install() { -j1 \ ) ;; + scons) + cmd=( \ + "${pkg_path}" \ + "${pkg_env}" \ + "${pkg_make_env}" \ + scons \ + -C "${pkg_build_dir}" \ + "${pkg_make_opt}" \ + "${pkg_install_opt}" \ + ) + ;; *) cmd=( \ "${pkg_path}" \ diff --git a/scripts/lib/ptxd_make_world_prepare.sh b/scripts/lib/ptxd_make_world_prepare.sh index e21a85b0e..38e7f1051 100644 --- a/scripts/lib/ptxd_make_world_prepare.sh +++ b/scripts/lib/ptxd_make_world_prepare.sh @@ -204,13 +204,18 @@ ptxd_make_world_prepare() { ptxd_bailout "'${pkg_label}' uses '${pkg_conf_tool}' but does not select any python" fi ;; + scons) + if ! [[ "${pkg_build_deps}" =~ "host-python-${pkg_conf_tool}" ]]; then + ptxd_bailout "'${pkg_label}' uses '${pkg_conf_tool}' but does not select 'host-python-${pkg_conf_tool}'" + fi + ;; esac case "${pkg_conf_tool}" in autoconf|cmake|qmake|kconfig|perl|meson) cd -- "${pkg_build_dir}" && ptxd_make_world_prepare_"${pkg_conf_tool}" ;; - python|python3) + python|python3|scons) : ;; # nothing to do "NO") echo "prepare stage disabled." ;; "") echo "No prepare tool found. Do nothing." ;; -- 2.24.0.rc1 _______________________________________________ ptxdist mailing list [email protected]
