diff -Nru rust-libdbus-sys-0.2.0/Cargo.toml rust-libdbus-sys-0.2.1/Cargo.toml --- rust-libdbus-sys-0.2.0/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 +++ rust-libdbus-sys-0.2.1/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 @@ -12,7 +12,7 @@ [package] name = "libdbus-sys" -version = "0.2.0" +version = "0.2.1" authors = ["David Henningsson "] build = "build.rs" links = "dbus" @@ -26,3 +26,11 @@ dbus-1 = "1.6" [build-dependencies.pkg-config] version = "0.3" +[badges.is-it-maintained-issue-resolution] +repository = "diwic/dbus-rs" + +[badges.is-it-maintained-open-issues] +repository = "diwic/dbus-rs" + +[badges.travis-ci] +repository = "diwic/dbus-rs" diff -Nru rust-libdbus-sys-0.2.0/Cargo.toml.orig rust-libdbus-sys-0.2.1/Cargo.toml.orig --- rust-libdbus-sys-0.2.0/Cargo.toml.orig 2019-01-20 17:48:49.000000000 +0000 +++ rust-libdbus-sys-0.2.1/Cargo.toml.orig 2019-09-01 10:09:19.000000000 +0000 @@ -1,7 +1,7 @@ [package] name = "libdbus-sys" -version = "0.2.0" +version = "0.2.1" authors = ["David Henningsson "] description = "FFI bindings to libdbus." @@ -18,3 +18,8 @@ [package.metadata.pkg-config] dbus-1 = "1.6" + +[badges] +is-it-maintained-open-issues = { repository = "diwic/dbus-rs" } +is-it-maintained-issue-resolution = { repository = "diwic/dbus-rs" } +travis-ci = { repository = "diwic/dbus-rs" } diff -Nru rust-libdbus-sys-0.2.0/.cargo_vcs_info.json rust-libdbus-sys-0.2.1/.cargo_vcs_info.json --- rust-libdbus-sys-0.2.0/.cargo_vcs_info.json 1970-01-01 00:00:00.000000000 +0000 +++ rust-libdbus-sys-0.2.1/.cargo_vcs_info.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +1,5 @@ { "git": { - "sha1": "15a8afc7a562bac34069b58535c15e4645c11fb4" + "sha1": "f9d46ac8445032d5e6468ed49ddc4d531cd81f15" } } diff -Nru rust-libdbus-sys-0.2.0/cross_compile.md rust-libdbus-sys-0.2.1/cross_compile.md --- rust-libdbus-sys-0.2.0/cross_compile.md 2019-05-16 16:13:44.000000000 +0000 +++ rust-libdbus-sys-0.2.1/cross_compile.md 2019-08-14 18:50:05.000000000 +0000 @@ -1,9 +1,9 @@ Cross compiling dbus ==================== -Disclaimer: I'm writing this because people ask me how to do it, not because I'm a subject matter expert. I hope that someone more knowledgable will submit a PR which fills in some of the blanks here as I haven't fully succeeded myself yet. +The examples below all assume you're trying to compile for Raspberry Pi 2 or 3 running Raspbian. Adjust target triples accordingly if your target is something else. -(The examples below all assume you're trying to compile for Raspberry Pi 2 or 3 running Raspbian. Adjust target triples accordingly if your target is something else.) +Before you start: there is an alternative guide at [issue 184](https://github.com/diwic/dbus-rs/issues/184#issuecomment-520228758), which also contains a [powershell script](https://github.com/diwic/dbus-rs/issues/184#issuecomment-520791888) that set things up for you. Feel free to use either this guide or the alternative one as you see fit. A cross linker -------------- @@ -32,25 +32,28 @@ Target dbus libraries --------------------- -**Installing the library** +**Installing the libraries** Now to the more challenging part. Since we link to a C library `libdbus-1.so`, we also need the target version of that library. However, `libdbus-1.so` in itself links to a systemd library (at least it does so here) which in turn links to other libraries etc, so we need target versions of those libraries too. -Getting an entire rootfs/image is probably the easiest option. The rootfs needs to have `libdbus-1-dev` installed. +Getting an entire rootfs/image is probably the easiest option. The rootfs needs to have `libdbus-1-dev` installed. I e: -[//]: # (Ugly hack: sudo mount -o loop,offset=50331648 2019-04-08-raspbian-stretch-lite.img /tmp/mnt ) -[//]: # (cd /tmp/mnt/usr/lib/arm-linux-gnueabihf && ln -s ../../../lib/arm-linux-gnueabihf/libdbus-1.so.3 libdbus-1.so ) + * Boot your target (i e, a raspberry), install `libdbus-1-dev` on it, turn it off and put the SD card into your computer's SD card reader. Mount the partition. + * If the above is not an option, you could download an image, mount it at the right offset, like this (ugly hack!) `sudo mount -o loop,offset=50331648 2019-04-08-raspbian-stretch-lite.img /tmp/mnt` and then, to manually make the symlink that `libdbus-1-dev` does for you: `cd /tmp/mnt/usr/lib/arm-linux-gnueabihf && ln -s ../../../lib/arm-linux-gnueabihf/libdbus-1.so.3 libdbus-1.so`. + * Or you can use the alternative guide's approach to download, extract and post-process the relevant `.deb` files manually. This might be a preferrable option if an entire image/rootfs would be too large. -**Finding the library** +**Finding the libraries** When not cross compiling, finding the right library is done by a `build.rs` script which calls `pkg-config`. This will not work when cross compiling because it will point to the `libdbus-1.so` on the host, not the `libdbus-1.so` of the target. Maybe it is possible to teach `pkg-config` how to return the target library instead, but I have not tried this approach. Instead we can override build script altogether and provide the same info manually. This is possible because `libdbus-sys` has a `links = dbus` line. -For the example below we assume that we have mounted a Raspbian rootfs on `/tmp/mnt`. +For the example below we assume that we have mounted a Raspbian rootfs on `/tmp/mnt`, and that the cross linker came with some basic libraries (libc, libpthread etc) that are installed on `/usr/arm-linux-gnueabihf/lib`. Unfortunately, we can't use the basic libraries that are present on the image, because they might contain absolute paths. + +And so we add the following to [.cargo/config](https://doc.rust-lang.org/cargo/reference/config.html): ``` [target.armv7-unknown-linux-gnueabihf.dbus] -rustc-link-search = ["/tmp/mnt/usr/lib/arm-linux-gnueabihf"] +rustc-link-search = ["/usr/arm-linux-gnueabihf/lib", "/tmp/mnt/usr/lib/arm-linux-gnueabihf"] rustc-link-lib = ["dbus-1"] ``` @@ -62,12 +65,4 @@ `cargo build --target=armv7-unknown-linux-gnueabihf` -...but when I tried this, I got the following error: - -``` -cannot find /lib/arm-linux-gnueabihf/libpthread.so.0 -cannot find /usr/lib/arm-linux-gnueabihf/libpthread_nonshared.a -``` - -...which I, so far, have not been able to resolve. Let me know if you have any ideas! diff -Nru rust-libdbus-sys-0.2.0/debian/cargo-checksum.json rust-libdbus-sys-0.2.1/debian/cargo-checksum.json --- rust-libdbus-sys-0.2.0/debian/cargo-checksum.json 2019-07-22 16:34:13.000000000 +0000 +++ rust-libdbus-sys-0.2.1/debian/cargo-checksum.json 2019-11-16 09:56:52.000000000 +0000 @@ -1 +1 @@ -{"package":"69382cb3be797cfe62ba89ac5e594a0e3022914ff44867ffbcfc03daa24eebd7","files":{}} +{"package":"dc12a3bc971424edbbf7edaf6e5740483444db63aa8e23d3751ff12a30f306f0","files":{}} diff -Nru rust-libdbus-sys-0.2.0/debian/changelog rust-libdbus-sys-0.2.1/debian/changelog --- rust-libdbus-sys-0.2.0/debian/changelog 2019-07-22 16:34:13.000000000 +0000 +++ rust-libdbus-sys-0.2.1/debian/changelog 2019-11-16 09:56:52.000000000 +0000 @@ -1,3 +1,9 @@ +rust-libdbus-sys (0.2.1-1) unstable; urgency=medium + + * Package libdbus-sys 0.2.1 from crates.io using debcargo 2.4.0 + + -- Wolfgang Silbermayr Sat, 16 Nov 2019 10:56:52 +0100 + rust-libdbus-sys (0.2.0-1) unstable; urgency=medium * Package libdbus-sys 0.2.0 from crates.io using debcargo 2.4.0 diff -Nru rust-libdbus-sys-0.2.0/debian/control rust-libdbus-sys-0.2.1/debian/control --- rust-libdbus-sys-0.2.0/debian/control 2019-07-22 16:34:13.000000000 +0000 +++ rust-libdbus-sys-0.2.1/debian/control 2019-11-16 09:56:52.000000000 +0000 @@ -28,8 +28,8 @@ librust-libdbus-sys-0+default-dev (= ${binary:Version}), librust-libdbus-sys-0.2-dev (= ${binary:Version}), librust-libdbus-sys-0.2+default-dev (= ${binary:Version}), - librust-libdbus-sys-0.2.0-dev (= ${binary:Version}), - librust-libdbus-sys-0.2.0+default-dev (= ${binary:Version}) + librust-libdbus-sys-0.2.1-dev (= ${binary:Version}), + librust-libdbus-sys-0.2.1+default-dev (= ${binary:Version}) Description: FFI bindings to libdbus - Rust source code This package contains the source for the Rust libdbus-sys crate, packaged by debcargo for use with cargo and dh-cargo. diff -Nru rust-libdbus-sys-0.2.0/debian/tests/control rust-libdbus-sys-0.2.1/debian/tests/control --- rust-libdbus-sys-0.2.0/debian/tests/control 2019-07-22 16:34:13.000000000 +0000 +++ rust-libdbus-sys-0.2.1/debian/tests/control 2019-11-16 09:56:52.000000000 +0000 @@ -1,7 +1,7 @@ -Test-Command: /usr/share/cargo/bin/cargo-auto-test libdbus-sys 0.2.0 --all-targets --all-features +Test-Command: /usr/share/cargo/bin/cargo-auto-test libdbus-sys 0.2.1 --all-targets --all-features Depends: dh-cargo (>= 18), @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test libdbus-sys 0.2.0 --all-targets --no-default-features +Test-Command: /usr/share/cargo/bin/cargo-auto-test libdbus-sys 0.2.1 --all-targets --no-default-features Depends: dh-cargo (>= 18), librust-libdbus-sys-dev Restrictions: allow-stderr, skip-not-installable diff -Nru rust-libdbus-sys-0.2.0/src/lib.rs rust-libdbus-sys-0.2.1/src/lib.rs --- rust-libdbus-sys-0.2.0/src/lib.rs 2019-07-18 04:05:11.000000000 +0000 +++ rust-libdbus-sys-0.2.1/src/lib.rs 2019-08-02 16:47:49.000000000 +0000 @@ -8,6 +8,7 @@ #[repr(C)] #[derive(Debug, PartialEq, Copy, Clone)] +/// System or Session bus pub enum DBusBusType { Session = 0, System = 1, @@ -72,11 +73,17 @@ #[repr(C)] #[derive(Debug, PartialEq, Copy, Clone)] +/// One of the four different D-Bus message types. pub enum DBusMessageType { + /// This is not a valid message type (rarely used) Invalid = 0, + /// This is a method call D-Bus message MethodCall = 1, + /// This is a method return Ok D-Bus message, used when the method call message was successfully processed MethodReturn = 2, + /// This is a method return with error D-Bus message, used when the method call message could not be handled Error = 3, + /// This is a signal, usually sent to whoever wants to listen Signal = 4, } @@ -301,5 +308,6 @@ pub fn dbus_connection_get_outgoing_unix_fds(conn: *mut DBusConnection) -> c_long; pub fn dbus_connection_has_messages_to_send(conn: *mut DBusConnection) -> u32; - pub fn dbus_try_get_local_machine_id (error: *mut DBusError) -> *mut c_char; + pub fn dbus_try_get_local_machine_id(error: *mut DBusError) -> *mut c_char; + pub fn dbus_get_local_machine_id() -> *mut c_char; }