Fix loading native libraries on macOS (arm64) using homebrew installed gtk+3

brew used to install libraries under `/usr/local/` and GtkSharp still
expect this location.

7995f132e1/Source/Libs/Shared/GLibrary.cs (L55)

This fix will lookup the new library location `/opt/homebrew/lib/` if the
default ones (OS) or the `/usr/local/lib` could not load the libraries.

Reference: https://github.com/unoplatform/uno/issues/8296#issuecomment-1100435406

Fixes https://github.com/GtkSharp/GtkSharp/issues/249
This commit is contained in:
Sebastien Pouliot 2022-04-17 13:47:39 -04:00
parent e48e6e0380
commit 411252bdf7

View file

@ -73,6 +73,9 @@ class GLibrary
if (ret == IntPtr.Zero) { if (ret == IntPtr.Zero) {
ret = FuncLoader.LoadLibrary("/usr/local/lib/" + _libraryDefinitions[library][2]); ret = FuncLoader.LoadLibrary("/usr/local/lib/" + _libraryDefinitions[library][2]);
if (ret == IntPtr.Zero) {
ret = FuncLoader.LoadLibrary("/opt/homebrew/lib/" + _libraryDefinitions[library][2]);
}
} }
} else } else
ret = FuncLoader.LoadLibrary(_libraryDefinitions[library][1]); ret = FuncLoader.LoadLibrary(_libraryDefinitions[library][1]);