Without this change dynamic libraries in macOS are not loaded
properly. This has happened since 3.0.6.
scheme@(guile-user)> %host-type
$1 = "x86_64-apple-darwin20.5.0"
--------------------------------
scheme@(guile-user)> (use-modules (git))
While compiling expression:
In procedure git_libgit2_init: Function not implemented
--------------------------------
scheme@(guile-user)> (use-modules (system foreign))
scheme@(guile-user)> (dynamic-link "/usr/local/lib/libgit2")
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure load-foreign-library: file: "/usr/local/lib/libgit2",
message: "file not found"
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]>
--------------------------------
After this fix:
scheme@(guile-user)> (use-modules (system foreign))
scheme@(guile-user)> (dynamic-link "/usr/local/lib/libgit2")
$2 = #<<foreign-library> filename: "/usr/local/lib/libgit2" handle:
#<pointer 0x7ffed3104ac0>>
On Wed, Sep 1, 2021 at 10:28 PM Aleix Conchillo FlaquƩ
<
aconchillo@gmail.com> wrote:
* module/system/foreign-library.scm (system-library-extensions): fix
darwin host detection. darwin host types have "-darwin" but not
"-darwin-".
---
module/system/foreign-library.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/module/system/foreign-library.scm b/module/system/foreign-library.scm
index d53e293ef..dc426385f 100644
--- a/module/system/foreign-library.scm
+++ b/module/system/foreign-library.scm
@@ -48,7 +48,7 @@
(define system-library-extensions
(cond
- ((string-contains %host-type "-darwin-")
+ ((string-contains %host-type "-darwin")
'(".bundle" ".so" ".dylib"))
((or (string-contains %host-type "cygwin")
(string-contains %host-type "mingw")
--
2.33.0