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/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 +} 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 +} 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 } 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/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 +} 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/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 +} 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 () { 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.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 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 +} 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 +} 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