From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 04 Aug 2021 12:17:00 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mBDxM-0002Nq-DY for lore@lore.pengutronix.de; Wed, 04 Aug 2021 12:17:00 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mBDxM-0003uk-4q; Wed, 04 Aug 2021 12:17:00 +0200 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mBDx3-0003ua-8M; Wed, 04 Aug 2021 12:16:41 +0200 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1mBDx2-0002k7-UU; Wed, 04 Aug 2021 12:16:40 +0200 Date: Wed, 4 Aug 2021 12:16:40 +0200 From: Michael Olbrich To: Guillermo Rodriguez Garcia Message-ID: <20210804101640.GR13108@pengutronix.de> Mail-Followup-To: Guillermo Rodriguez Garcia , ptxdist@pengutronix.de, Alejandro Vazquez References: <20210730174156.187572-1-avazquez.dev@gmail.com> <20210804074115.GC2534932@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 12:09:41 up 167 days, 13:33, 91 users, load average: 0.06, 0.16, 0.15 User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [ptxdist] [PATCH] rust: new package X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Alejandro Vazquez , ptxdist@pengutronix.de Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false On Wed, Aug 04, 2021 at 11:52:49AM +0200, Guillermo Rodriguez Garcia wrote: > El mi=E9, 4 ago 2021 a las 9:41, Michael Olbrich () > escribi=F3: > = > > On Fri, Jul 30, 2021 at 07:41:56PM +0200, avazquez.dev@gmail.com wrote: > > > From: Alejandro Vazquez > > > > > > - host-rust: This package provides a pre-built version of rustc, > > > cargo and standard library for the host. > > > - host-rust-std-target: A pre-built version of the standard library f= or > > > the target. > > > > No. The compiler should be built not just downloaded. > > > > Please take a look at the latest OSELAS.Toolchain. It contains a rust > > compiler and std libraries for the target. I've done very little testing > > with that so far and I would be interested in some feedback. Especially= if > > something isn't working. > > > = > I think it would be useful to have rules that support building rust > packages without the need to update the toolchain. Why would you not want to update the toolchain? > > Also, I'm pretty sure that there are some hidden downloads in there for > > cargo and maybe the host std library. So if you keep those rules locall= y, > > you should add that to the downloads. > = > = > Is it possible to specify more than one download in a single .make file? Yes, that's what I do in the rustc package[1] in the toolchain. Or take a look at rules/shaderc.make in PTXdist itself if you need to extract all archives. Michael [1] https://git.pengutronix.de/cgit/OSELAS.Toolchain/tree/rules/cross-rustc= .make > > This way, they will be cached with > > the rest of the source. Take a look at what I did for the toolchain. > > > > Michael > > > > > Signed-off-by: Alejandro Vazquez > > > --- > > > rules/host-rust-std-target.in | 18 ++++++++ > > > rules/host-rust-std-target.make | 81 +++++++++++++++++++++++++++++++= ++ > > > rules/host-rust.in | 8 ++++ > > > rules/host-rust.make | 80 ++++++++++++++++++++++++++++++++ > > > 4 files changed, 187 insertions(+) > > > create mode 100644 rules/host-rust-std-target.in > > > create mode 100644 rules/host-rust-std-target.make > > > create mode 100644 rules/host-rust.in > > > create mode 100644 rules/host-rust.make > > > > > > diff --git a/rules/host-rust-std-target.in b/rules/ > > host-rust-std-target.in > > > new file mode 100644 > > > index 000000000..ed47f8c89 > > > --- /dev/null > > > +++ b/rules/host-rust-std-target.in > > > @@ -0,0 +1,18 @@ > > > +## SECTION=3Dhosttools > > > + > > > +menuconfig HOST_RUST_STD_TARGET > > > + bool > > > + select HOST_RUST > > > + prompt "host-rust-std-target (pre-built)" > > > + help > > > + This package will install pre-built versions of > > > + the Rust standard library for the target. > > > + > > > +if HOST_RUST_STD_TARGET > > > + > > > +config HOST_RUST_STD_TARGET_ARCH > > > + string > > > + default "armv7-unknown-linux-gnueabihf" > > > + prompt "Target Architecture" > > > + > > > +endif > > > diff --git a/rules/host-rust-std-target.make > > b/rules/host-rust-std-target.make > > > new file mode 100644 > > > index 000000000..f41c2caa1 > > > --- /dev/null > > > +++ b/rules/host-rust-std-target.make > > > @@ -0,0 +1,81 @@ > > > +# -*-makefile-*- > > > +# > > > +# Copyright (C) 2021 by Alejandro Vazquez > > > +# > > > +# For further information about the PTXdist project and license > > conditions > > > +# see the README file. > > > +# > > > + > > > +# > > > +# We provide this package > > > +# > > > +PACKAGES-$(PTXCONF_HOST_RUST_STD_TARGET) +=3D host-rust-std-target > > > + > > > +# > > > +# Paths and names > > > +# > > > +HOST_RUST_STD_TARGET_VERSION :=3D 1.53.0 > > > +HOST_RUST_STD_TARGET_MD5 :=3D 6eeb959f5a9294adc8220e7950= 2b00df > > > +HOST_RUST_STD_TARGET_SUFFIX :=3D tar.xz > > > +HOST_RUST_STD_TARGET_SPEC :=3D $(call remove_quotes, > > $(PTXCONF_HOST_RUST_STD_TARGET_ARCH)) > > > +HOST_RUST_STD_TARGET :=3D > > rust-std-$(HOST_RUST_STD_TARGET_VERSION) > > > +HOST_RUST_STD_TARGET_NAME :=3D > > $(HOST_RUST_STD_TARGET)-$(HOST_RUST_STD_TARGET_SPEC) > > > +HOST_RUST_STD_TARGET_URL :=3D > > https://static.rust-lang.org/dist/$(HOST_RUST_STD_TARGET_NAME).$(HOST_R= UST_STD_TARGET_SUFFIX) > > > +HOST_RUST_STD_TARGET_DIR :=3D > > $(HOST_BUILDDIR)/$(HOST_RUST_STD_TARGET) > > > +HOST_RUST_STD_TARGET_SOURCE :=3D > > $(SRCDIR)/$(HOST_RUST_STD_TARGET_NAME).$(HOST_RUST_STD_TARGET_SUFFIX) > > > +HOST_RUST_STD_TARGET_LICENSE :=3D Apache-2.0 AND MIT > > > +HOST_RUST_STD_TARGET_LICENSE_FILES :=3D \ > > > + file://COPYRIGHT;md5=3D93a95682d51b4cb0a633a97046940ef0 \ > > > + file://LICENSE-APACHE;md5=3D22a53954e4e0ec258dfce4391e905dac \ > > > + file://LICENSE-MIT;md5=3Db377b220f43d747efdec40d69fcaa69d > > > + > > > +# > > -----------------------------------------------------------------------= ----- > > > +# Prepare > > > +# > > -----------------------------------------------------------------------= ----- > > > + > > > +HOST_RUST_STD_TARGET_DEVPKG :=3D NO > > > +HOST_RUST_STD_TARGET_CONF_TOOL :=3D NO > > > + > > > +HOST_RUST_STD_TARGET_INSTALL_COMPONENTS =3D > > --components=3Drust-std-$(HOST_RUST_STD_TARGET_SPEC) > > > + > > > +HOST_RUST_STD_TARGET_INSTALL_OPTS =3D \ > > > + --prefix=3D$(PTXDIST_SYSROOT_HOST) \ > > > + --without=3Drust-docs \ > > > + --disable-ldconfig \ > > > + $(HOST_RUST_STD_TARGET_INSTALL_COMPONENTS) > > > + > > > +# > > -----------------------------------------------------------------------= ----- > > > +# Compile > > > +# > > -----------------------------------------------------------------------= ----- > > > + > > > +$(STATEDIR)/host-rust-std-target.compile: > > > + @$(call targetinfo) > > > + @$(call touch) > > > + > > > +# > > -----------------------------------------------------------------------= ----- > > > +# Install > > > +# > > -----------------------------------------------------------------------= ----- > > > + > > > +$(STATEDIR)/host-rust-std-target.install.post: > > > + @$(call targetinfo) > > > + > > > + @cd "$(HOST_RUST_STD_TARGET_DIR)" && sh install.sh > > $(HOST_RUST_STD_TARGET_INSTALL_OPTS) > > > + @cd "$(PTXDIST_SYSROOT_HOST)/lib/rustlib/" && mv uninstall.sh > > uninstall-target.sh > > > + > > > + @$(call world/install, HOST_RUST_STD_TARGET) > > > + @$(call touch) > > > + > > > +# > > -----------------------------------------------------------------------= ----- > > > +# Clean > > > +# > > -----------------------------------------------------------------------= ----- > > > + > > > +$(STATEDIR)/host-rust-std-target.clean: > > > + @$(call targetinfo) > > > + > > > + sh $(PTXDIST_SYSROOT_HOST)/lib/rustlib/uninstall-host.sh \ > > > + --uninstall \ > > > + --prefix=3D$(PTXDIST_SYSROOT_HOST) \ > > > + $(HOST_RUST_STD_TARGET_INSTALL_COMPONENTS) > > > + @$(call clean_pkg, HOST_RUST_STD_TARGET) > > > + > > > +# vim: syntax=3Dmake > > > diff --git a/rules/host-rust.in b/rules/host-rust.in > > > new file mode 100644 > > > index 000000000..4f73dae6c > > > --- /dev/null > > > +++ b/rules/host-rust.in > > > @@ -0,0 +1,8 @@ > > > +## SECTION=3Dhosttools > > > + > > > +config HOST_RUST > > > + tristate > > > + prompt "host-rust (pre-built)" > > > + help > > > + This package will install pre-built versions of the compiler > > > + and the Rust standard library for the host. > > > diff --git a/rules/host-rust.make b/rules/host-rust.make > > > new file mode 100644 > > > index 000000000..e750a1352 > > > --- /dev/null > > > +++ b/rules/host-rust.make > > > @@ -0,0 +1,80 @@ > > > +# -*-makefile-*- > > > +# > > > +# Copyright (C) 2021 by Alejandro Vazquez > > > +# > > > +# For further information about the PTXdist project and license > > conditions > > > +# see the README file. > > > +# > > > + > > > +# > > > +# We provide this package > > > +# > > > +PACKAGES-$(PTXCONF_HOST_RUST) +=3D host-rust > > > + > > > +# > > > +# Paths and names > > > +# > > > +HOST_RUST_VERSION :=3D 1.53.0 > > > +HOST_RUST_MD5 :=3D 3f2ea3d908dac317d6006a117463f18e > > > +HOST_RUST :=3D rust-$(HOST_RUST_VERSION) > > > +HOST_RUST_SUFFIX :=3D tar.xz > > > +HOST_RUST_NAME :=3D $(HOST_RUST)-$(subst > > host,unknown,$(GNU_HOST)) > > > +HOST_RUST_URL :=3D > > https://static.rust-lang.org/dist/$(HOST_RUST_NAME).$(HOST_RUST_SUFFIX) > > > +HOST_RUST_DIR :=3D $(HOST_BUILDDIR)/$(HOST_RUST_NAME) > > > +HOST_RUST_SOURCE :=3D $(SRCDIR)/$(HOST_RUST_NAME).$(HOST_RUST_SU= FFIX) > > > +HOST_RUST_LICENSE :=3D Apache-2.0 AND MIT > > > +HOST_RUST_LICENSE_FILES :=3D \ > > > + file://COPYRIGHT;md5=3D93a95682d51b4cb0a633a97046940ef0 \ > > > + file://LICENSE-APACHE;md5=3D22a53954e4e0ec258dfce4391e905dac \ > > > + file://LICENSE-MIT;md5=3Db377b220f43d747efdec40d69fcaa69d > > > + > > > +# > > -----------------------------------------------------------------------= ----- > > > +# Prepare > > > +# > > -----------------------------------------------------------------------= ----- > > > + > > > +HOST_RUST_DEVPKG :=3D NO > > > +HOST_RUST_CONF_TOOL :=3D NO > > > + > > > +HOST_RUST_INSTALL_COMPONENTS =3D > > --components=3Drustc,cargo,rust-std-$(subst host,unknown,$(GNU_HOST)) > > > + > > > +HOST_RUST_INSTALL_OPTS =3D \ > > > + --prefix=3D$(PTXDIST_SYSROOT_HOST) \ > > > + --without=3Drust-docs \ > > > + --disable-ldconfig \ > > > + $(HOST_RUST_INSTALL_COMPONENTS) > > > + > > > +# > > -----------------------------------------------------------------------= ----- > > > +# Compile > > > +# > > -----------------------------------------------------------------------= ----- > > > + > > > +$(STATEDIR)/host-rust.compile: > > > + @$(call targetinfo) > > > + @$(call touch) > > > + > > > +# > > -----------------------------------------------------------------------= ----- > > > +# Install > > > +# > > -----------------------------------------------------------------------= ----- > > > + > > > +$(STATEDIR)/host-rust.install.post: > > > + @$(call targetinfo) > > > + > > > + @cd "$(HOST_RUST_DIR)" && sh install.sh $(HOST_RUST_INSTALL_OPT= S) > > > + @cd "$(PTXDIST_SYSROOT_HOST)/lib/rustlib/" && mv uninstall.sh > > uninstall-host.sh > > > + > > > + @$(call touch) > > > + > > > +# > > -----------------------------------------------------------------------= ----- > > > +# Clean > > > +# > > -----------------------------------------------------------------------= ----- > > > + > > > +$(STATEDIR)/host-rust.clean: > > > + @$(call targetinfo) > > > + > > > + sh $(PTXDIST_SYSROOT_HOST)/lib/rustlib/uninstall-host.sh \ > > > + --uninstall \ > > > + --prefix=3D$(PTXDIST_SYSROOT_HOST) \ > > > + $(HOST_RUST_INSTALL_COMPONENTS) > > > + > > > + @$(call clean_pkg, HOST_RUST) > > > + > > > +# vim: syntax=3Dmake > > > -- > > > 2.25.1 > > > > > > > > > _______________________________________________ > > > ptxdist mailing list > > > ptxdist@pengutronix.de > > > To unsubscribe, send a mail with subject "unsubscribe" to > > ptxdist-request@pengutronix.de > > > > > > > -- > > Pengutronix e.K. | = | > > Steuerwalder Str. 21 | http://www.pengutronix.de/= | > > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 = | > > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-555= 5 | > > > > _______________________________________________ > > ptxdist mailing list > > ptxdist@pengutronix.de > > To unsubscribe, send a mail with subject "unsubscribe" to > > ptxdist-request@pengutronix.de > > > = > = > -- = > Guillermo Rodriguez Garcia > guille.rodriguez@gmail.com > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request= @pengutronix.de -- = Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@p= engutronix.de