diff --git a/melib/src/backends.rs b/melib/src/backends.rs index 9b86a24d..24a2d7f3 100644 --- a/melib/src/backends.rs +++ b/melib/src/backends.rs @@ -156,7 +156,11 @@ impl Backends { } #[cfg(feature = "notmuch_backend")] { - if libloading::Library::new("libnotmuch.so.5").is_ok() { + #[cfg(not(target_os = "macos"))] + let dlpath = "libnotmuch.so.5"; + #[cfg(target_os = "macos")] + let dlpath = "libnotmuch.5.dylib"; + if libloading::Library::new(dlpath).is_ok() { b.register( "notmuch".to_string(), Backend { diff --git a/melib/src/backends/notmuch.rs b/melib/src/backends/notmuch.rs index d2de9367..e131cef4 100644 --- a/melib/src/backends/notmuch.rs +++ b/melib/src/backends/notmuch.rs @@ -307,7 +307,11 @@ impl NotmuchDb { _is_subscribed: Box bool>, event_consumer: BackendEventConsumer, ) -> Result> { - let lib = Arc::new(libloading::Library::new("libnotmuch.so.5")?); + #[cfg(not(target_os = "macos"))] + let dlpath = "libnotmuch.so.5"; + #[cfg(target_os = "macos")] + let dlpath = "libnotmuch.5.dylib"; + let lib = Arc::new(libloading::Library::new(dlpath)?); let path = Path::new(s.root_mailbox.as_str()).expand(); if !path.exists() { return Err(MeliError::new(format!(