rust: move versioned files into .inc
This way we can bump the versions without big diffs.
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
SUMMARY = "Rust compiler run-time"
|
||||||
|
HOMEPAGE = "http://www.rust-lang.org"
|
||||||
|
SECTION = "devel"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
LIC_FILES_CHKSUM = "file://src/compiler-rt/LICENSE.TXT;md5=bf24bca27049b52e9738451aa55771d4"
|
||||||
|
|
||||||
|
require rust.inc
|
||||||
|
ALLOW_EMPTY_${PN} = "1"
|
||||||
|
|
||||||
|
DEPENDS += "rust-llvm-native (=${PV})"
|
||||||
|
# dev and staticdev should NOT depend on the binary package
|
||||||
|
RDEPENDS_${PN}-dev = ""
|
||||||
|
INSANE_SKIP_${PN}-dev = "staticdev"
|
||||||
|
|
||||||
|
S = "${WORKDIR}/rustc-${PV}"
|
||||||
|
|
||||||
|
DISABLE_STATIC = ""
|
||||||
|
INHIBIT_DEFAULT_RUST_DEPS = "1"
|
||||||
|
|
||||||
|
do_compile () {
|
||||||
|
oe_runmake ${TARGET_SYS}/rt/libcompiler-rt.a
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install () {
|
||||||
|
mkdir -p ${D}${libdir}
|
||||||
|
cp ${TARGET_SYS}/rt/libcompiler-rt.a ${D}${libdir}/libcompiler-rt.a
|
||||||
|
}
|
||||||
|
|
||||||
|
FILES_${PN}-dev = ""
|
||||||
|
FILES_${PN}-staticdev = "${libdir}/*.a"
|
||||||
@@ -1,31 +1,2 @@
|
|||||||
SUMMARY = "Rust compiler run-time"
|
require compiler-rt.inc
|
||||||
HOMEPAGE = "http://www.rust-lang.org"
|
|
||||||
SECTION = "devel"
|
|
||||||
LICENSE = "MIT"
|
|
||||||
LIC_FILES_CHKSUM = "file://src/compiler-rt/LICENSE.TXT;md5=bf24bca27049b52e9738451aa55771d4"
|
|
||||||
|
|
||||||
require rust.inc
|
|
||||||
require rust-source-${PV}.inc
|
require rust-source-${PV}.inc
|
||||||
ALLOW_EMPTY_${PN} = "1"
|
|
||||||
|
|
||||||
DEPENDS += "rust-llvm-native (=${PV})"
|
|
||||||
# dev and staticdev should NOT depend on the binary package
|
|
||||||
RDEPENDS_${PN}-dev = ""
|
|
||||||
INSANE_SKIP_${PN}-dev = "staticdev"
|
|
||||||
|
|
||||||
S = "${WORKDIR}/rustc-${PV}"
|
|
||||||
|
|
||||||
DISABLE_STATIC = ""
|
|
||||||
INHIBIT_DEFAULT_RUST_DEPS = "1"
|
|
||||||
|
|
||||||
do_compile () {
|
|
||||||
oe_runmake ${TARGET_SYS}/rt/libcompiler-rt.a
|
|
||||||
}
|
|
||||||
|
|
||||||
do_install () {
|
|
||||||
mkdir -p ${D}${libdir}
|
|
||||||
cp ${TARGET_SYS}/rt/libcompiler-rt.a ${D}${libdir}/libcompiler-rt.a
|
|
||||||
}
|
|
||||||
|
|
||||||
FILES_${PN}-dev = ""
|
|
||||||
FILES_${PN}-staticdev = "${libdir}/*.a"
|
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
SUMMARY = "Rust standard libaries"
|
||||||
|
HOMEPAGE = "http://www.rust-lang.org"
|
||||||
|
SECTION = "devel"
|
||||||
|
LICENSE = "MIT | Apache-2.0"
|
||||||
|
LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=43e1f1fb9c0ee3af66693d8c4fecafa8"
|
||||||
|
|
||||||
|
S = "${WORKDIR}/rustc-${PV}"
|
||||||
|
|
||||||
|
SRC_URI += "\
|
||||||
|
crate://crates.io/gcc/0.3.27 \
|
||||||
|
"
|
||||||
|
|
||||||
|
DEPENDS += "compiler-rt (=${PV})"
|
||||||
|
|
||||||
|
RUSTLIB_DEP = ""
|
||||||
|
inherit cargo
|
||||||
|
|
||||||
|
# Needed so cargo can find libbacktrace
|
||||||
|
RUSTFLAGS += "-L ${STAGING_LIBDIR}"
|
||||||
|
|
||||||
|
S = "${WORKDIR}/rustc-${PV}"
|
||||||
|
|
||||||
|
do_compile_prepend () {
|
||||||
|
cd ${S}/src/rustc/std_shim
|
||||||
|
export CARGO_TARGET_DIR="${B}"
|
||||||
|
export RUSTC_BOOTSTRAP_KEY="${RS_KEY}"
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install () {
|
||||||
|
mkdir -p ${D}${rustlibdir}
|
||||||
|
cp ${B}/${TARGET_SYS}/release/deps/* ${D}${rustlibdir}
|
||||||
|
}
|
||||||
@@ -1,34 +1,2 @@
|
|||||||
SUMMARY = "Rust standard libaries"
|
require libstd-rs.inc
|
||||||
HOMEPAGE = "http://www.rust-lang.org"
|
|
||||||
SECTION = "devel"
|
|
||||||
LICENSE = "MIT | Apache-2.0"
|
|
||||||
LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=43e1f1fb9c0ee3af66693d8c4fecafa8"
|
|
||||||
|
|
||||||
require rust-source-${PV}.inc
|
require rust-source-${PV}.inc
|
||||||
|
|
||||||
S = "${WORKDIR}/rustc-${PV}"
|
|
||||||
|
|
||||||
SRC_URI += "\
|
|
||||||
crate://crates.io/gcc/0.3.27 \
|
|
||||||
"
|
|
||||||
|
|
||||||
DEPENDS += "compiler-rt (=${PV})"
|
|
||||||
|
|
||||||
RUSTLIB_DEP = ""
|
|
||||||
inherit cargo
|
|
||||||
|
|
||||||
# Needed so cargo can find libbacktrace
|
|
||||||
RUSTFLAGS += "-L ${STAGING_LIBDIR}"
|
|
||||||
|
|
||||||
S = "${WORKDIR}/rustc-${PV}"
|
|
||||||
|
|
||||||
do_compile_prepend () {
|
|
||||||
cd ${S}/src/rustc/std_shim
|
|
||||||
export CARGO_TARGET_DIR="${B}"
|
|
||||||
export RUSTC_BOOTSTRAP_KEY="${RS_KEY}"
|
|
||||||
}
|
|
||||||
|
|
||||||
do_install () {
|
|
||||||
mkdir -p ${D}${rustlibdir}
|
|
||||||
cp ${B}/${TARGET_SYS}/release/deps/* ${D}${rustlibdir}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
require rust.inc
|
||||||
|
inherit cross
|
||||||
|
|
||||||
|
# Otherwise we'll depend on what we provide
|
||||||
|
INHIBIT_DEFAULT_RUST_DEPS = "1"
|
||||||
|
|
||||||
|
# Unlike native (which nicely maps it's DEPENDS) cross wipes them out completely.
|
||||||
|
# Generally, we (and cross in general) need the same things that native needs,
|
||||||
|
# so it might make sense to take it's mapping. For now, though, we just mention
|
||||||
|
# the bits we need explicitly.
|
||||||
|
DEPENDS += "rust-llvm-native"
|
||||||
|
DEPENDS += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc"
|
||||||
|
DEPENDS += "rust-native"
|
||||||
|
|
||||||
|
PROVIDES = "virtual/${TARGET_PREFIX}rust"
|
||||||
|
PN = "rust-cross-${TARGET_ARCH}"
|
||||||
|
|
||||||
|
# In the cross compilation case, rustc doesn't seem to get the rpath quite
|
||||||
|
# right. It manages to include '../../lib/${TARGET_PREFIX}', but doesn't
|
||||||
|
# include the '../../lib' (ie: relative path from cross_bindir to normal
|
||||||
|
# libdir. As a result, we end up not being able to properly reference files in normal ${libdir}.
|
||||||
|
# Most of the time this happens to work fine as the systems libraries are
|
||||||
|
# subsituted, but sometimes a host system will lack a library, or the right
|
||||||
|
# version of a library (libtinfo was how I noticed this).
|
||||||
|
#
|
||||||
|
# FIXME: this should really be fixed in rust itself.
|
||||||
|
# FIXME: using hard-coded relative paths is wrong, we should ask bitbake for
|
||||||
|
# the relative path between 2 of it's vars.
|
||||||
|
HOST_POST_LINK_ARGS_append = " -Wl,-rpath=../../lib"
|
||||||
|
BUILD_POST_LINK_ARGS_append = " -Wl,-rpath=../../lib"
|
||||||
|
|
||||||
|
# We need the same thing for the calls to the compiler when building the runtime crap
|
||||||
|
TARGET_CC_ARCH_append = " --sysroot=${STAGING_DIR_TARGET}"
|
||||||
|
|
||||||
|
do_configure () {
|
||||||
|
}
|
||||||
|
|
||||||
|
do_compile () {
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install () {
|
||||||
|
mkdir -p ${D}${prefix}/${base_libdir_native}/rustlib
|
||||||
|
cp ${WORKDIR}/targets/${TARGET_SYS}.json ${D}${prefix}/${base_libdir_native}/rustlib
|
||||||
|
}
|
||||||
|
|
||||||
|
rust_cross_sysroot_preprocess() {
|
||||||
|
sysroot_stage_dir ${D}${prefix}/${base_libdir_native}/rustlib ${SYSROOT_DESTDIR}${prefix}/${base_libdir_native}/rustlib
|
||||||
|
}
|
||||||
|
SYSROOT_PREPROCESS_FUNCS += "rust_cross_sysroot_preprocess"
|
||||||
@@ -1,50 +1,2 @@
|
|||||||
require rust.inc
|
require rust-cross.inc
|
||||||
inherit cross
|
|
||||||
require rust-source-${PV}.inc
|
require rust-source-${PV}.inc
|
||||||
|
|
||||||
# Otherwise we'll depend on what we provide
|
|
||||||
INHIBIT_DEFAULT_RUST_DEPS = "1"
|
|
||||||
|
|
||||||
# Unlike native (which nicely maps it's DEPENDS) cross wipes them out completely.
|
|
||||||
# Generally, we (and cross in general) need the same things that native needs,
|
|
||||||
# so it might make sense to take it's mapping. For now, though, we just mention
|
|
||||||
# the bits we need explicitly.
|
|
||||||
DEPENDS += "rust-llvm-native"
|
|
||||||
DEPENDS += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc"
|
|
||||||
DEPENDS += "rust-native"
|
|
||||||
|
|
||||||
PROVIDES = "virtual/${TARGET_PREFIX}rust"
|
|
||||||
PN = "rust-cross-${TARGET_ARCH}"
|
|
||||||
|
|
||||||
# In the cross compilation case, rustc doesn't seem to get the rpath quite
|
|
||||||
# right. It manages to include '../../lib/${TARGET_PREFIX}', but doesn't
|
|
||||||
# include the '../../lib' (ie: relative path from cross_bindir to normal
|
|
||||||
# libdir. As a result, we end up not being able to properly reference files in normal ${libdir}.
|
|
||||||
# Most of the time this happens to work fine as the systems libraries are
|
|
||||||
# subsituted, but sometimes a host system will lack a library, or the right
|
|
||||||
# version of a library (libtinfo was how I noticed this).
|
|
||||||
#
|
|
||||||
# FIXME: this should really be fixed in rust itself.
|
|
||||||
# FIXME: using hard-coded relative paths is wrong, we should ask bitbake for
|
|
||||||
# the relative path between 2 of it's vars.
|
|
||||||
HOST_POST_LINK_ARGS_append = " -Wl,-rpath=../../lib"
|
|
||||||
BUILD_POST_LINK_ARGS_append = " -Wl,-rpath=../../lib"
|
|
||||||
|
|
||||||
# We need the same thing for the calls to the compiler when building the runtime crap
|
|
||||||
TARGET_CC_ARCH_append = " --sysroot=${STAGING_DIR_TARGET}"
|
|
||||||
|
|
||||||
do_configure () {
|
|
||||||
}
|
|
||||||
|
|
||||||
do_compile () {
|
|
||||||
}
|
|
||||||
|
|
||||||
do_install () {
|
|
||||||
mkdir -p ${D}${prefix}/${base_libdir_native}/rustlib
|
|
||||||
cp ${WORKDIR}/targets/${TARGET_SYS}.json ${D}${prefix}/${base_libdir_native}/rustlib
|
|
||||||
}
|
|
||||||
|
|
||||||
rust_cross_sysroot_preprocess() {
|
|
||||||
sysroot_stage_dir ${D}${prefix}/${base_libdir_native}/rustlib ${SYSROOT_DESTDIR}${prefix}/${base_libdir_native}/rustlib
|
|
||||||
}
|
|
||||||
SYSROOT_PREPROCESS_FUNCS += "rust_cross_sysroot_preprocess"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user