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 90% rename from classes/rust-triples.bbclass rename to classes/rust-common.bbclass index 0975c2b..1788153 100644 --- a/classes/rust-triples.bbclass +++ b/classes/rust-common.bbclass @@ -1,4 +1,14 @@ -# Responseible for taking Yocto triples and converting it to Rust triples +# 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" + +# Responsible for taking Yocto triples and converting it to Rust triples def rust_base_triple(d, thing): ''' 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/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 e954825..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" @@ -38,8 +37,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/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: diff --git a/recipes-devtools/cargo/cargo.inc b/recipes-devtools/cargo/cargo.inc index 7347766..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" @@ -54,7 +53,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 ="\ diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index 549066c..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 @@ -403,6 +406,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