| 1 | extern crate pkg_configrust-analyzer cargo libdbus-sys 0.2.7 pkg_config/; |
| 2 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std error/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#; |
| 3 | |
| 4 | #[cfg(feature = "vendored")] |
| 5 | mod build_vendored; |
| 6 | |
| 7 | fn mainrust-analyzer cargo libdbus-sys 0.2.7 main().() -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#>> { |
| 8 | // Invalidate the built crate whenever these files change |
| 9 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("cargo:rerun-if-changed=build.rs"); |
| 10 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("cargo:rerun-if-changed=build_vendored.rs"); |
| 11 | |
| 12 | // See https://github.com/joshtriplett/metadeps/issues/9 for why we don't use |
| 13 | // metadeps here, but instead keep this manually in sync with Cargo.toml. |
| 14 | #[cfg(not(feature = "vendored"))] |
| 15 | if let Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e) = pkg_configrust-analyzer cargo pkg-config 0.3.25 crate/::Configrust-analyzer cargo pkg-config 0.3.25 Config#::newrust-analyzer cargo pkg-config 0.3.25 impl#[Config]new().().atleast_versionrust-analyzer cargo pkg-config 0.3.25 impl#[Config]atleast_version().("1.6").proberust-analyzer cargo pkg-config 0.3.25 impl#[Config]probe().("dbus-1") { |
| 16 | eprintlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/eprintln!!("pkg_config failed: {}", e); |
| 17 | eprintlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/eprintln!!( |
| 18 | "One possible solution is to check whether packages\n\ |
| 19 | 'libdbus-1-dev' and 'pkg-config' are installed:\n\ |
| 20 | On Ubuntu:\n\ |
| 21 | sudo apt install libdbus-1-dev pkg-config\n\ |
| 22 | On Fedora:\n\ |
| 23 | sudo dnf install dbus-devel pkgconf-pkg-config\n" |
| 24 | ); |
| 25 | panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!(); |
| 26 | } |
| 27 | |
| 28 | #[cfg(feature = "vendored")] |
| 29 | build_vendored::build_libdbus()?; |
| 30 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 31 | } |