From 03496f658f2e6fc5fa2d3ab5926ed3438e44332d Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Wed, 9 Nov 2016 22:10:32 -0600 Subject: [PATCH 1/6] cargo: use install targets to avoid rust-installer This install target is used by Gentoo to avoid needing rust-installer. --- recipes-devtools/cargo/cargo.inc | 2 +- recipes-devtools/cargo/cargo_0.11.0.bb | 3 --- recipes-devtools/cargo/cargo_0.13.0.bb | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/recipes-devtools/cargo/cargo.inc b/recipes-devtools/cargo/cargo.inc index 7347766..e9462d8 100644 --- a/recipes-devtools/cargo/cargo.inc +++ b/recipes-devtools/cargo/cargo.inc @@ -54,7 +54,7 @@ do_compile () { } do_install () { - oe_runmake DESTDIR="${D}" install + oe_runmake prepare-image-${TARGET_SYS} IMGDIR_${TARGET_SYS}="${D}${prefix}" } BBCLASSEXTEND = "native" diff --git a/recipes-devtools/cargo/cargo_0.11.0.bb b/recipes-devtools/cargo/cargo_0.11.0.bb index 08e0de3..df198d8 100644 --- a/recipes-devtools/cargo/cargo_0.11.0.bb +++ b/recipes-devtools/cargo/cargo_0.11.0.bb @@ -5,7 +5,6 @@ SRC_URI += " \ git://github.com/rust-lang/cargo.git;protocol=https;name=cargo \ file://0001-disable-cargo-snapshot-fetch.patch \ file://0001-Never-update-the-registry-index.patch \ - git://github.com/rust-lang/rust-installer.git;protocol=https;name=rust-installer;destsuffix=${S}/src/rust-installer \ crate://crates.io/advapi32-sys/0.1.2 \ crate://crates.io/bufstream/0.1.1 \ crate://crates.io/crossbeam/0.2.8 \ @@ -60,8 +59,6 @@ SRC_URI += " \ # https://static.rust-lang.org/dist/channel-rust-1.10.0.toml SRCREV_cargo = "259324cd8f9bb6e1068a3a2b77685e90fda3e3b6" -SRCREV_rust-installer = "c37d3747da75c280237dc2d6b925078e69555499" - S = "${WORKDIR}/git" LIC_FILES_CHKSUM ="\ diff --git a/recipes-devtools/cargo/cargo_0.13.0.bb b/recipes-devtools/cargo/cargo_0.13.0.bb index e7d0984..eb6c1ae 100644 --- a/recipes-devtools/cargo/cargo_0.13.0.bb +++ b/recipes-devtools/cargo/cargo_0.13.0.bb @@ -3,7 +3,6 @@ require cargo.inc SRC_URI += " \ git://github.com/rust-lang/cargo.git;protocol=https;name=cargo \ - git://github.com/rust-lang/rust-installer.git;protocol=https;name=rust-installer;destsuffix=${S}/src/rust-installer \ crate://crates.io/advapi32-sys/0.2.0 \ crate://crates.io/aho-corasick/0.5.2 \ crate://crates.io/bitflags/0.1.1 \ @@ -78,8 +77,6 @@ SRC_URI += " \ # https://static.rust-lang.org/dist/channel-rust-1.12.1.toml SRCREV_cargo = "109cb7c33d426044d141457049bd0fffaca1327c" -SRCREV_rust-installer = "c37d3747da75c280237dc2d6b925078e69555499" - S = "${WORKDIR}/git" LIC_FILES_CHKSUM ="\ From 6083dff0b669f95990655f28d712c637a13c5e7d Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Thu, 21 Jan 2016 15:06:06 -0600 Subject: [PATCH 2/6] drop rust-installer.bbclass This is only necessary for installations of rust so move the actual functional bits into the do_install() phase of rust. --- classes/rust-installer.bbclass | 15 --------------- recipes-devtools/cargo/cargo.inc | 1 - recipes-devtools/rust/rust.inc | 6 ++++++ recipes-devtools/rust/rust_1.10.0.bb | 1 - recipes-devtools/rust/rust_1.12.1.bb | 1 - 5 files changed, 6 insertions(+), 18 deletions(-) delete mode 100644 classes/rust-installer.bbclass diff --git a/classes/rust-installer.bbclass b/classes/rust-installer.bbclass deleted file mode 100644 index 395101d..0000000 --- a/classes/rust-installer.bbclass +++ /dev/null @@ -1,15 +0,0 @@ -# Rust installer isn't very nice and drops a bunch of junk in our filesystem, -# clean it up after the install. - -rust_installer_do_install () { - rm ${D}/${libdir}/rustlib/install.log - rm ${D}/${libdir}/rustlib/rust-installer-version - rm ${D}/${libdir}/rustlib/uninstall.sh - rm ${D}/${libdir}/rustlib/components -} - -do_install_append () { - rust_installer_do_install -} - -EXPORT_FUNCTIONS rust_installer_do_install diff --git a/recipes-devtools/cargo/cargo.inc b/recipes-devtools/cargo/cargo.inc index e9462d8..71f96e0 100644 --- a/recipes-devtools/cargo/cargo.inc +++ b/recipes-devtools/cargo/cargo.inc @@ -1,6 +1,5 @@ inherit cargo inherit patch -inherit rust-installer SUMMARY = "Cargo downloads your Rust project's dependencies and builds your project" HOMEPAGE = "http://crates.io" diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index 549066c..a608c94 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -403,6 +403,12 @@ rust_do_install () { # Remove any files directly installed into libdir to avoid # conflicts between cross and native rm -f ${D}${libdir}/lib*.so + + # cleanup after rust-installer since we don't need these bits + rm ${D}/${libdir}/rustlib/install.log + rm ${D}/${libdir}/rustlib/rust-installer-version + rm ${D}/${libdir}/rustlib/uninstall.sh + rm ${D}/${libdir}/rustlib/components } do_install () { diff --git a/recipes-devtools/rust/rust_1.10.0.bb b/recipes-devtools/rust/rust_1.10.0.bb index 6c5fbeb..621c60b 100644 --- a/recipes-devtools/rust/rust_1.10.0.bb +++ b/recipes-devtools/rust/rust_1.10.0.bb @@ -1,4 +1,3 @@ -inherit rust-installer require rust.inc require rust-source-${PV}.inc diff --git a/recipes-devtools/rust/rust_1.12.1.bb b/recipes-devtools/rust/rust_1.12.1.bb index d6269b1..78b9185 100644 --- a/recipes-devtools/rust/rust_1.12.1.bb +++ b/recipes-devtools/rust/rust_1.12.1.bb @@ -1,4 +1,3 @@ -inherit rust-installer require rust.inc require rust-source-${PV}.inc From 487e670b9b855cf774903eb74dcd4a5fcfd4c8fa Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Sun, 4 Dec 2016 16:33:47 -0600 Subject: [PATCH 3/6] crate.py: use BPN instead of PN If we don't use BPN then native packages will not extract correct since PN will be something-native and we won't extract the something crate to ${S}. --- lib/crate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/crate.py b/lib/crate.py index 178e7f4..f26b272 100644 --- a/lib/crate.py +++ b/lib/crate.py @@ -180,7 +180,7 @@ class Crate(Wget): save_cwd = os.getcwd() os.chdir(rootdir) - pn = d.getVar('PN', True) + pn = d.getVar('BPN', True) if pn == ud.parm.get('name'): cmd = "tar -xz --no-same-owner -f %s" % thefile else: From 43c139f131d22ce30caf05c812c58e1f18604fa8 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Sun, 4 Dec 2016 23:27:34 -0600 Subject: [PATCH 4/6] rust: remove --disable-static only for rust Only remove --disable-static from OECONF for things built from the rust source and not things inheriting rust. --- classes/rust.bbclass | 2 -- recipes-devtools/rust/rust.inc | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/rust.bbclass b/classes/rust.bbclass index e954825..0790a95 100644 --- a/classes/rust.bbclass +++ b/classes/rust.bbclass @@ -38,8 +38,6 @@ HOST_CFLAGS ?= "${CFLAGS}" HOST_CXXFLAGS ?= "${CXXFLAGS}" HOST_CPPFLAGS ?= "${CPPFLAGS}" -EXTRA_OECONF_remove = "--disable-static" - rustlib_suffix="${TUNE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/rustlib/${HOST_SYS}/lib" # Native sysroot standard library path rustlib_src="${prefix}/lib/${rustlib_suffix}" diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index a608c94..e4ef114 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -341,6 +341,9 @@ do_rust_arch_fixup[dirs] += "${S}/mk/cfg" # prevent the rust-installer scripts from calling ldconfig export CFG_DISABLE_LDCONFIG="notempty" +# rust's configure doesn't recognize --disable-static, so remove it. +DISABLE_STATIC = "" + do_configure () { # FIXME: target_prefix vs prefix, see cross.bbclass From d364837120da50ab26c499d1fee97e1d73f4124e Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Sun, 4 Dec 2016 23:38:45 -0600 Subject: [PATCH 5/6] merge rust-vars and rust-triples to rust-common Merge two bbclasses that were included in the same places so merge it into one common file. --- classes/cargo.bbclass | 3 +-- classes/{rust-triples.bbclass => rust-common.bbclass} | 10 ++++++++++ classes/rust-vars.bbclass | 8 -------- classes/rust.bbclass | 3 +-- 4 files changed, 12 insertions(+), 12 deletions(-) rename classes/{rust-triples.bbclass => rust-common.bbclass} (91%) delete mode 100644 classes/rust-vars.bbclass diff --git a/classes/cargo.bbclass b/classes/cargo.bbclass index 2be039e..045dfc1 100644 --- a/classes/cargo.bbclass +++ b/classes/cargo.bbclass @@ -1,7 +1,6 @@ -inherit rust-vars # add crate fetch support inherit crate-fetch -inherit rust-triples +inherit rust-common # the binary we will use CARGO = "cargo" diff --git a/classes/rust-triples.bbclass b/classes/rust-common.bbclass similarity index 91% rename from classes/rust-triples.bbclass rename to classes/rust-common.bbclass index 0975c2b..5d425c7 100644 --- a/classes/rust-triples.bbclass +++ b/classes/rust-common.bbclass @@ -1,3 +1,13 @@ +# Common variables used by all Rust builds +export rustlibdir = "${libdir}/rust" +FILES_${PN} += "${rustlibdir}/*.so" +FILES_${PN}-dev += "${rustlibdir}/*.rlib" +FILES_${PN}-dbg += "${rustlibdir}/.debug" + +RUSTLIB = "-L ${STAGING_LIBDIR}/rust" +RUSTFLAGS += "-C rpath -C crate_hash=${BB_TASKHASH} ${RUSTLIB}" +RUSTLIB_DEP ?= "libstd-rs" + # Responseible for taking Yocto triples and converting it to Rust triples def rust_base_triple(d, thing): diff --git a/classes/rust-vars.bbclass b/classes/rust-vars.bbclass deleted file mode 100644 index a3acc44..0000000 --- a/classes/rust-vars.bbclass +++ /dev/null @@ -1,8 +0,0 @@ -export rustlibdir = "${libdir}/rust" -FILES_${PN} += "${rustlibdir}/*.so" -FILES_${PN}-dev += "${rustlibdir}/*.rlib" -FILES_${PN}-dbg += "${rustlibdir}/.debug" - -RUSTLIB = "-L ${STAGING_LIBDIR}/rust" -RUSTFLAGS += "-C rpath -C crate_hash=${BB_TASKHASH} ${RUSTLIB}" -RUSTLIB_DEP ?= "libstd-rs" diff --git a/classes/rust.bbclass b/classes/rust.bbclass index 0790a95..f9a34e2 100644 --- a/classes/rust.bbclass +++ b/classes/rust.bbclass @@ -1,5 +1,4 @@ -inherit rust-vars -inherit rust-triples +inherit rust-common RUSTC = "rustc" From 0340c31a427884fb3796d566bde88e21a0780d6a Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Mon, 5 Dec 2016 10:55:00 -0600 Subject: [PATCH 6/6] fix bad engrish --- classes/rust-common.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/rust-common.bbclass b/classes/rust-common.bbclass index 5d425c7..1788153 100644 --- a/classes/rust-common.bbclass +++ b/classes/rust-common.bbclass @@ -8,7 +8,7 @@ RUSTLIB = "-L ${STAGING_LIBDIR}/rust" RUSTFLAGS += "-C rpath -C crate_hash=${BB_TASKHASH} ${RUSTLIB}" RUSTLIB_DEP ?= "libstd-rs" -# Responseible for taking Yocto triples and converting it to Rust triples +# Responsible for taking Yocto triples and converting it to Rust triples def rust_base_triple(d, thing): '''