Skip to content

Commit

Permalink
Load sonames first
Browse files Browse the repository at this point in the history
  • Loading branch information
fredizzimo authored and elinorbgr committed Jul 13, 2023
1 parent 90a9ad1 commit 54011b7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 30 deletions.
9 changes: 1 addition & 8 deletions wayland-sys/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,7 @@ external_library!(WaylandClient, "wayland-client",
#[cfg(all(feature = "client", feature = "dlopen"))]
pub fn wayland_client_option() -> Option<&'static WaylandClient> {
static WAYLAND_CLIENT_OPTION: Lazy<Option<WaylandClient>> = Lazy::new(||{
// This is a workaround for Ubuntu 17.04, which doesn't have a bare symlink
// for libwayland-client.so but does have it with the version numbers for
// whatever reason.
//
// We could do some trickery with str slices but that is more trouble
// than its worth
let versions = ["libwayland-client.so",
"libwayland-client.so.0"];
let versions = ["libwayland-client.so.0", "libwayland-client.so"];
for ver in &versions {
match unsafe { WaylandClient::open(ver) } {
Ok(h) => return Some(h),
Expand Down
8 changes: 1 addition & 7 deletions wayland-sys/src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,7 @@ external_library!(WaylandCursor, "wayland-cursor",
#[cfg(feature = "dlopen")]
pub fn wayland_cursor_option() -> Option<&'static WaylandCursor> {
static WAYLAND_CURSOR_OPTION: Lazy<Option<WaylandCursor>> = Lazy::new(|| {
// This is a workaround for Ubuntu 17.04, which doesn't have a bare symlink
// for libwayland-client.so but does have it with the version numbers for
// whatever reason.
//
// We could do some trickery with str slices but that is more trouble
// than its worth
let versions = ["libwayland-cursor.so", "libwayland-cursor.so.0"];
let versions = ["libwayland-cursor.so.0", "libwayland-cursor.so"];

for ver in &versions {
match unsafe { WaylandCursor::open(ver) } {
Expand Down
8 changes: 1 addition & 7 deletions wayland-sys/src/egl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@ external_library!(WaylandEgl, "wayland-egl",
#[cfg(feature = "dlopen")]
pub fn wayland_egl_option() -> Option<&'static WaylandEgl> {
static WAYLAND_EGL_OPTION: Lazy<Option<WaylandEgl>> = Lazy::new(|| {
// This is a workaround for Ubuntu 17.04, which doesn't have a bare symlink
// for libwayland-client.so but does have it with the version numbers for
// whatever reason.
//
// We could do some trickery with str slices but that is more trouble
// than its worth
let versions = ["libwayland-egl.so", "libwayland-egl.so.1"];
let versions = ["libwayland-egl.so.1", "libwayland-egl.so"];

for ver in &versions {
match unsafe { WaylandEgl::open(ver) } {
Expand Down
9 changes: 1 addition & 8 deletions wayland-sys/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,7 @@ external_library!(WaylandServer, "wayland-server",
#[cfg(all(feature = "server", feature = "dlopen"))]
pub fn wayland_server_option() -> Option<&'static WaylandServer> {
static WAYLAND_SERVER_OPTION: Lazy<Option<WaylandServer>> = Lazy::new(||{
// This is a workaround for Ubuntu 17.04, which doesn't have a bare symlink
// for libwayland-server.so but does have it with the version numbers for
// whatever reason.
//
// We could do some trickery with str slices but that is more trouble
// than its worth
let versions = ["libwayland-server.so",
"libwayland-server.so.0"];
let versions = ["libwayland-server.so.0", "libwayland-server.so"];
for ver in &versions {
match unsafe { WaylandServer::open(ver) } {
Ok(h) => return Some(h),
Expand Down

0 comments on commit 54011b7

Please sign in to comment.