From b5058823f220ecdf5cb1b0b1e73a9d12b306b3fe Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Fri, 29 Jan 2016 14:58:26 +0000 Subject: [PATCH 01/10] rust.inc: add missing dependency on file-native --- recipes/rust/rust.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index 2e2efc7..288e2f5 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -8,6 +8,7 @@ LICENSE = "MIT | Apache-2.0" B = "${WORKDIR}/build" +DEPENDS += "file-native" DEPENDS += "rust-llvm" # Avoid having the default bitbake.conf disable sub-make parallelization From 9c571225f2632ec8c284caa9b4589749d93c21d4 Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Fri, 29 Jan 2016 15:09:00 +0000 Subject: [PATCH 02/10] libudev: add recipes for latest releases of libudev-{rs,sys} --- recipes-core/udev/libudev-rs_0.1.2.bb | 22 ++++++++++++++++++++++ recipes-core/udev/libudev-sys-rs_0.1.3.bb | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 recipes-core/udev/libudev-rs_0.1.2.bb create mode 100644 recipes-core/udev/libudev-sys-rs_0.1.3.bb diff --git a/recipes-core/udev/libudev-rs_0.1.2.bb b/recipes-core/udev/libudev-rs_0.1.2.bb new file mode 100644 index 0000000..c59346e --- /dev/null +++ b/recipes-core/udev/libudev-rs_0.1.2.bb @@ -0,0 +1,22 @@ +DESCRIPTION = "FFI bindings to libudev" +HOMEPAGE = "https://github.com/dcuddeback/libudev-sys" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=bbd2acd29c4ba5d4591b03e2757c04a3" + +DEPENDS += "libudev-sys-rs" +DEPENDS += "libc-rs" + +inherit rust-bin + +SRC_URI = "git://github.com/dcuddeback/libudev-rs.git;protocol=https" +SRCREV = "3da791245f206d0cf5a856531c574b8646b0f059" + +S = "${WORKDIR}/git" + +do_compile () { + oe_compile_rust_lib +} + +do_install () { + oe_install_rust_lib +} diff --git a/recipes-core/udev/libudev-sys-rs_0.1.3.bb b/recipes-core/udev/libudev-sys-rs_0.1.3.bb new file mode 100644 index 0000000..d61fd82 --- /dev/null +++ b/recipes-core/udev/libudev-sys-rs_0.1.3.bb @@ -0,0 +1,22 @@ +DESCRIPTION = "FFI bindings to libudev" +HOMEPAGE = "https://github.com/dcuddeback/libudev-sys" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=bbd2acd29c4ba5d4591b03e2757c04a3" +DEPENDS = "libc-rs udev" + +inherit rust-bin + +SRC_URI = "git://github.com/dcuddeback/libudev-sys.git;protocol=https" +SRCREV = "c49163f87d4d109ec21bcf8f8c51db560ed31b22" + +S = "${WORKDIR}/git" + +RUSTC_FLAGS += "-ludev" + +do_compile () { + oe_compile_rust_lib +} + +do_install () { + oe_install_rust_lib +} From 1c1819971e3b0c6ca21852611e7b3b8cde87e21b Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Mon, 27 Jul 2015 15:49:49 -0400 Subject: [PATCH 03/10] Add rustc-serialize crate --- .../rustc-serialize-rs_0.3.15.bb | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 recipes-core/rustc-serialize/rustc-serialize-rs_0.3.15.bb diff --git a/recipes-core/rustc-serialize/rustc-serialize-rs_0.3.15.bb b/recipes-core/rustc-serialize/rustc-serialize-rs_0.3.15.bb new file mode 100644 index 0000000..87835dc --- /dev/null +++ b/recipes-core/rustc-serialize/rustc-serialize-rs_0.3.15.bb @@ -0,0 +1,22 @@ +DESCRIPTION = "Generic serialization/deserialization support" +HOMEPAGE = "https://github.com/rust-lang/rustc-serialize" +LICENSE = "MIT | Apache-2.0" +LIC_FILES_CHKSUM = "\ + file://LICENSE-MIT;md5=362255802eb5aa87810d12ddf3cfedb4 \ + file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \ +" + +inherit rust-bin + +SRC_URI = "git://github.com/rust-lang/rustc-serialize.git;protocol=https" +SRCREV = "376f43a4b94dbe411bd9534ab83f02fbcb5a3b04" + +S = "${WORKDIR}/git" + +do_compile () { + oe_compile_rust_lib +} + +do_install () { + oe_install_rust_lib +} From fa0d333237be1ebfbc7257f5c588800b3cc450b1 Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Mon, 27 Jul 2015 15:58:20 -0400 Subject: [PATCH 04/10] Add debug-builders crate --- .../debug-builders/debug-builders-rs_0.1.0.bb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 recipes-core/debug-builders/debug-builders-rs_0.1.0.bb diff --git a/recipes-core/debug-builders/debug-builders-rs_0.1.0.bb b/recipes-core/debug-builders/debug-builders-rs_0.1.0.bb new file mode 100644 index 0000000..7c82bc5 --- /dev/null +++ b/recipes-core/debug-builders/debug-builders-rs_0.1.0.bb @@ -0,0 +1,19 @@ +DESCRIPTION = "A copy of libstd's debug builders for use before they stabilize" +HOMEPAGE = "https://github.com/sfackler/rust-debug-builders" +LICENSE = "MIT | Apache-2.0" +LIC_FILES_CHKSUM = "file://Cargo.toml;md5=97a131dc4ae910d242387f2c9d1a2ce8" + +inherit rust-bin + +SRC_URI = "git://github.com/sfackler/rust-debug-builders.git;protocol=https" +SRCREV = "c6943b72c7808ddaa151d08b824525cc7420cb9b" + +S = "${WORKDIR}/git" + +do_compile () { + oe_compile_rust_lib +} + +do_install () { + oe_install_rust_lib +} From b516012a462b9c3b371ecf0f5c89c333367fe3c7 Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Mon, 27 Jul 2015 15:59:44 -0400 Subject: [PATCH 05/10] Add unix-socket crate --- .../unix-socket/unix-socket-rs_0.4.3.bb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 recipes-core/unix-socket/unix-socket-rs_0.4.3.bb diff --git a/recipes-core/unix-socket/unix-socket-rs_0.4.3.bb b/recipes-core/unix-socket/unix-socket-rs_0.4.3.bb new file mode 100644 index 0000000..3485c3f --- /dev/null +++ b/recipes-core/unix-socket/unix-socket-rs_0.4.3.bb @@ -0,0 +1,20 @@ +DESCRIPTION = "Unix domain socket bindings for Rust" +HOMEPAGE = "https://github.com/sfackler/rust-unix-socket" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=bde86283c1fd74e84ebc3cf6dd7011d0" +DEPENDS = "libc-rs debug-builders-rs" + +inherit rust-bin + +SRC_URI = "git://github.com/sfackler/rust-unix-socket.git;protocol=https" +SRCREV = "d0f47ae888267a718072c3be5eed42ba1f637097" + +S = "${WORKDIR}/git" + +do_compile () { + oe_compile_rust_lib +} + +do_install () { + oe_install_rust_lib +} From 232d100c091596828c4edb2da1f4568e4189bb2b Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Mon, 27 Jul 2015 16:44:02 -0400 Subject: [PATCH 06/10] Add rand crate --- classes/rust-bin.bbclass | 1 + recipes-core/rand/rand-rs_0.3.8.bb | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 recipes-core/rand/rand-rs_0.3.8.bb diff --git a/classes/rust-bin.bbclass b/classes/rust-bin.bbclass index a9195bf..c663100 100644 --- a/classes/rust-bin.bbclass +++ b/classes/rust-bin.bbclass @@ -19,6 +19,7 @@ OVERLAP_LIBS = "\ libc \ log \ getopts \ + rand \ " def get_overlap_deps(d): deps = d.getVar("DEPENDS").split() diff --git a/recipes-core/rand/rand-rs_0.3.8.bb b/recipes-core/rand/rand-rs_0.3.8.bb new file mode 100644 index 0000000..566cac9 --- /dev/null +++ b/recipes-core/rand/rand-rs_0.3.8.bb @@ -0,0 +1,23 @@ +DESCRIPTION = "Random number generators and other randomness functionality." +HOMEPAGE = "https://github.com/rust-lang/rand" +LICENSE = "MIT | Apache-2.0" +LIC_FILES_CHKSUM = "\ + file://LICENSE-MIT;md5=362255802eb5aa87810d12ddf3cfedb4 \ + file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \ +" +DEPENDS = "libc-rs" + +inherit rust-bin + +SRC_URI = "git://github.com/rust-lang/rand.git;protocol=https" +SRCREV = "164659b01e6fdb4d9a8e52b7a7451e8174e91821" + +S = "${WORKDIR}/git" + +do_compile () { + oe_compile_rust_lib +} + +do_install () { + oe_install_rust_lib +} From 9fac435f1c0cc5f920799f4f3c01af9547daf539 Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Mon, 27 Jul 2015 16:44:56 -0400 Subject: [PATCH 07/10] Add crypto crate --- recipes-core/crypto/crypto-rs_0.2.31.bb | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 recipes-core/crypto/crypto-rs_0.2.31.bb diff --git a/recipes-core/crypto/crypto-rs_0.2.31.bb b/recipes-core/crypto/crypto-rs_0.2.31.bb new file mode 100644 index 0000000..76c7a6d --- /dev/null +++ b/recipes-core/crypto/crypto-rs_0.2.31.bb @@ -0,0 +1,28 @@ +DESCRIPTION = "A (mostly) pure-Rust implementation of various common cryptographic algorithms." +HOMEPAGE = "https://github.com/DaGenix/rust-crypto/" +LICENSE = "MIT | Apache-2.0" +LIC_FILES_CHKSUM = "\ + file://LICENSE-MIT;md5=4311034aa04489226c1fc3f816dbfb5a \ + file://LICENSE-APACHE;md5=a02fef6dccf840318474c108a8281b77 \ +" +DEPENDS = "\ + libc-rs \ + time-rs \ + rand-rs \ + rustc-serialize-rs \ +" + +inherit rust-bin + +SRC_URI = "git://github.com/DaGenix/rust-crypto.git;protocol=https" +SRCREV = "5571cb41690b9cee12025192393ea7df0eddc21b" + +S = "${WORKDIR}/git" + +do_compile () { + oe_compile_rust_lib +} + +do_install () { + oe_install_rust_lib +} From fc0e2f74b348080afb4169be4bdb061f04eaf5ed Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Mon, 27 Jul 2015 18:48:28 -0400 Subject: [PATCH 08/10] libc: use common build functions and create dylib Working around "error: cannot satisfy dependencies so `libc` only shows up once." --- recipes-core/libc/libc-rs_0.1.8.bb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes-core/libc/libc-rs_0.1.8.bb b/recipes-core/libc/libc-rs_0.1.8.bb index b9c808f..a1ee5b5 100644 --- a/recipes-core/libc/libc-rs_0.1.8.bb +++ b/recipes-core/libc/libc-rs_0.1.8.bb @@ -15,10 +15,12 @@ SRCREV = "8b7c17db2235a2a3f2c71242b11fc429a8d05a90" S = "${WORKDIR}/git" +LIB_SRC = "${S}/src/liblibc/lib.rs" + do_compile () { - oe_runrustc ${S}/src/liblibc/lib.rs --cfg feature='"cargo-build"' + oe_compile_rust_lib --cfg feature='"cargo-build"' } do_install () { - install -D -m 644 liblibc.rlib ${D}/${rustlibdir}/liblibc.rlib + oe_install_rust_lib } From 84bacaaf21efc6bd681a401feb6206e4c6b7fbbf Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Thu, 25 Jun 2015 17:59:21 -0400 Subject: [PATCH 09/10] time-rs: compile native helper C code --- recipes-core/time/time-rs_0.1.26.bb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes-core/time/time-rs_0.1.26.bb b/recipes-core/time/time-rs_0.1.26.bb index 40c9a64..76ca2f5 100644 --- a/recipes-core/time/time-rs_0.1.26.bb +++ b/recipes-core/time/time-rs_0.1.26.bb @@ -15,7 +15,10 @@ SRCREV = "32b212b877b836dbfdc97af5674d91672e70ecbd" S = "${WORKDIR}/git" do_compile () { - oe_compile_rust_lib + rm -rf time_helpers.o libtimehelpers.a + ${CC} ${S}/src/time_helpers.c -fPIC -c -o time_helpers.o + ${AR} rcs libtime_helpers.a time_helpers.o + oe_compile_rust_lib -L native=$PWD -l static=time_helpers } do_install () { From 34c36492db6f29429d5ded3c5001de611f6e65ef Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Fri, 7 Aug 2015 13:39:49 -0400 Subject: [PATCH 10/10] Don't build any rlibs I've seen this error from the compiler: found possibly newer version of crate `regex_syntax` which `env_logger` depends on This is probably because the rlib hashes are not deterministic, but I can't reproduce non-deterministic hashes locally. There have been lots of other types of errors caused by mixing rlibs and dylibs in the same dependency chain, so let's try using only dylibs until that's stable. --- recipes-core/memchr/memchr-rs_0.1.3.bb | 3 --- recipes-core/regex/regex-syntax-rs.bb | 2 -- recipes-core/udev/libudev-sys-rs_0.1.1.bb | 1 - 3 files changed, 6 deletions(-) diff --git a/recipes-core/memchr/memchr-rs_0.1.3.bb b/recipes-core/memchr/memchr-rs_0.1.3.bb index e0e61f0..b216cfd 100644 --- a/recipes-core/memchr/memchr-rs_0.1.3.bb +++ b/recipes-core/memchr/memchr-rs_0.1.3.bb @@ -11,9 +11,6 @@ SRCREV = "a91e63378bf6f4bba5c7d88f4fe98efdcb432c99" S = "${WORKDIR}/git" -# This module is tiny. One wrapper function only. -CRATE_TYPE = "rlib" - do_compile () { oe_compile_rust_lib } diff --git a/recipes-core/regex/regex-syntax-rs.bb b/recipes-core/regex/regex-syntax-rs.bb index 56ed2a3..9d440ba 100644 --- a/recipes-core/regex/regex-syntax-rs.bb +++ b/recipes-core/regex/regex-syntax-rs.bb @@ -2,6 +2,4 @@ DESCRIPTION = "A regular expression parser" require regex.inc -# Should only be used directly by regex -CRATE_TYPE = "rlib" LIB_SRC = "${S}/regex-syntax/src/lib.rs" diff --git a/recipes-core/udev/libudev-sys-rs_0.1.1.bb b/recipes-core/udev/libudev-sys-rs_0.1.1.bb index b2e0faa..e87a219 100644 --- a/recipes-core/udev/libudev-sys-rs_0.1.1.bb +++ b/recipes-core/udev/libudev-sys-rs_0.1.1.bb @@ -12,7 +12,6 @@ SRCREV = "14c24afc61e3315dffddab2c7f36999a16a002d8" S = "${WORKDIR}/git" RUSTC_FLAGS += "-ludev" -CRATE_TYPE = "rlib" do_compile () { oe_compile_rust_lib