mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
[yabridgectl] Check for the versioned libdbus
Just like in yabridge itself.
This commit is contained in:
@@ -38,6 +38,9 @@ use crate::files::{LibArchitecture, NativeFile};
|
|||||||
/// moment without causing issues.
|
/// moment without causing issues.
|
||||||
const YABRIDGE_HOST_EXPECTED_OUTPUT_PREFIX: &str = "Usage: yabridge-";
|
const YABRIDGE_HOST_EXPECTED_OUTPUT_PREFIX: &str = "Usage: yabridge-";
|
||||||
|
|
||||||
|
const LIBDBUS_NAME: &str = "libdbus-1.so.3";
|
||||||
|
const LIBDBUS_FALLBACK_NAME: &str = "libdbus-1.so";
|
||||||
|
|
||||||
/// Wrapper around [`reflink::reflink_or_copy()`](reflink::reflink_or_copy) with a human readable
|
/// Wrapper around [`reflink::reflink_or_copy()`](reflink::reflink_or_copy) with a human readable
|
||||||
/// error message.
|
/// error message.
|
||||||
pub fn copy_or_reflink<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> Result<Option<u64>> {
|
pub fn copy_or_reflink<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> Result<Option<u64>> {
|
||||||
@@ -467,8 +470,9 @@ pub fn verify_wine_setup(config: &mut Config) -> Result<()> {
|
|||||||
/// Check whether yabridge's (optional) external dependencies are installed. Right now this only
|
/// Check whether yabridge's (optional) external dependencies are installed. Right now this only
|
||||||
/// checks for libdbus, as this is used to relay important information when something's very wrong.
|
/// checks for libdbus, as this is used to relay important information when something's very wrong.
|
||||||
pub fn verify_external_dependencies() -> Result<()> {
|
pub fn verify_external_dependencies() -> Result<()> {
|
||||||
let libdbus_name = libloading::library_filename("dbus-1");
|
let libdbus_available = unsafe { libloading::Library::new(&LIBDBUS_NAME) }
|
||||||
let libdbus_available = unsafe { libloading::Library::new(&libdbus_name) }.is_ok();
|
.or_else(|_| unsafe { libloading::Library::new(&LIBDBUS_FALLBACK_NAME) })
|
||||||
|
.is_ok();
|
||||||
if !libdbus_available {
|
if !libdbus_available {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"\n{}",
|
"\n{}",
|
||||||
@@ -477,7 +481,7 @@ pub fn verify_external_dependencies() -> Result<()> {
|
|||||||
you will also not receive any notifcations when something is wrong. D-Bus should \
|
you will also not receive any notifcations when something is wrong. D-Bus should \
|
||||||
already be installed on the system, so if you're seeing this warning then \
|
already be installed on the system, so if you're seeing this warning then \
|
||||||
something is probably very wrong.",
|
something is probably very wrong.",
|
||||||
libdbus_name.to_str().unwrap().bright_white(),
|
LIBDBUS_NAME.bright_white(),
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user