From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iOc4h-0000L1-L8 for ptxdist@pengutronix.de; Sun, 27 Oct 2019 07:30:51 +0100 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1iOc4h-0007p1-Ca for ptxdist@pengutronix.de; Sun, 27 Oct 2019 07:30:51 +0100 Date: Sun, 27 Oct 2019 07:30:51 +0100 From: Michael Olbrich Message-ID: <20191027063051.ai6l5hq57j2czfk3@pengutronix.de> References: <20191025073326.GB26830@lenoch> <20191025073426.GC26830@lenoch> <20191025075559.GF30823@pengutronix.de> <20191025230928.GA30150@lenoch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191025230928.GA30150@lenoch> Subject: Re: [ptxdist] [PATCH 1/2] add scons conf tool List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de On Sat, Oct 26, 2019 at 01:09:28AM +0200, Ladislav Michl wrote: > On Fri, Oct 25, 2019 at 09:55:59AM +0200, Michael Olbrich wrote: > > > diff --git a/scripts/lib/ptxd_make_world_compile.sh b/scripts/lib/ptxd_make_world_compile.sh > > > index c7093250d..5da79cace 100644 > > > --- a/scripts/lib/ptxd_make_world_compile.sh > > > +++ b/scripts/lib/ptxd_make_world_compile.sh > > > @@ -37,6 +37,14 @@ ptxd_make_world_compile() { > > > "${pkg_make_opt}" \ > > > "${pkg_make_par}" > > > ;; > > > + scons) > > > + ptxd_eval \ > > > + "${pkg_path}" \ > > > + "${pkg_env}" \ > > > + "${pkg_conf_env}" \ > > > > No, don't use pkg_conf_env here. Take a look at what python is doing in > > ptxd_make_world_init() > > Otherwise, setting _MAKE_ENV in the package has no Effekt. > > See quick attempt bellow. Problem with SCons is that install stage > has to be called with exactly the same env as build stage, otherwise > package is rebuild. Alternatively we can leave everything to install > stage. This looks good. Or maybe just drop pkg_install_env. It's deprecated anyways do no need to use it for a new conf tool. _MAKE_ENV was introduced exactly to share the same environment for compile and install. Michael > From: Ladislav Michl > Subject: [PATCH 1/2] add scons conf tool > > SCons is a tool of constant reconfiguration. Almost each call > means performing the configure tests, therefore it does not fit > into PTXDist stages too well. Thus configuration and building > is done in compile stage, while install stage is using > --config=cache in hope it will not rebuild everything. > 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 > --- > scripts/lib/ptxd_make_world_common.sh | 7 ++++++- > scripts/lib/ptxd_make_world_compile.sh | 8 ++++++++ > scripts/lib/ptxd_make_world_install.sh | 11 +++++++++++ > scripts/lib/ptxd_make_world_prepare.sh | 7 ++++++- > 4 files changed, 31 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..f55786fb6 100644 > --- a/scripts/lib/ptxd_make_world_compile.sh > +++ b/scripts/lib/ptxd_make_world_compile.sh > @@ -37,6 +37,14 @@ ptxd_make_world_compile() { > "${pkg_make_opt}" \ > "${pkg_make_par}" > ;; > + scons) > + ptxd_eval \ > + "${pkg_path}" \ > + "${pkg_env}" \ > + "${pkg_make_env}" \ > + scons -C "${pkg_build_dir}" \ > + "${pkg_make_opt}" > + ;; > *) > ptxd_eval \ > "${pkg_path}" \ > diff --git a/scripts/lib/ptxd_make_world_install.sh b/scripts/lib/ptxd_make_world_install.sh > index ba8e2058e..1d9f08782 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}" \ > + "${pkg_install_env}" \ > + scons --config=cache \ > + -C "${pkg_build_dir}" \ > + "${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.rc0 > > > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de