From 3a7c1ead3b1f3034e43857b0494a0c1a40d282ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Wed, 24 Jan 2018 13:17:54 +0100 Subject: [PATCH] alien.libraries.finder: find-library for gtk libs This should make the code find the correct .so's when compiling Factor yourself. --- basis/alien/libraries/finder/linux/linux.factor | 9 ++------- basis/gdk/gl/ffi/ffi.factor | 6 +++--- basis/gtk/ffi/ffi.factor | 7 +++---- basis/gtk/gl/ffi/ffi.factor | 6 +++--- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/basis/alien/libraries/finder/linux/linux.factor b/basis/alien/libraries/finder/linux/linux.factor index 055e7a8bc3..40aa053234 100644 --- a/basis/alien/libraries/finder/linux/linux.factor +++ b/basis/alien/libraries/finder/linux/linux.factor @@ -40,13 +40,8 @@ CONSTANT: mach-map { : ldconfig-matches? ( lib triple -- ? ) { [ name-matches? ] [ arch-matches? ] } 2&& ; -: ldconfig-find-soname ( lib -- seq ) - load-ldconfig-cache [ ldconfig-matches? ] with filter - [ third ] map ; - PRIVATE> M: linux find-library* - "lib" prepend ldconfig-find-soname [ - { [ exists? ] [ file-info regular-file? ] } 1&& - ] find nip ; + "lib" prepend load-ldconfig-cache + [ ldconfig-matches? ] with find nip ?first ; diff --git a/basis/gdk/gl/ffi/ffi.factor b/basis/gdk/gl/ffi/ffi.factor index a1ff666c2e..71fcb6264e 100644 --- a/basis/gdk/gl/ffi/ffi.factor +++ b/basis/gdk/gl/ffi/ffi.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2010 Anton Gorenko. ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.libraries alien.syntax combinators -gobject-introspection kernel system vocabs vocabs.loader ; +USING: alien alien.libraries alien.libraries.finder alien.syntax +combinators gobject-introspection kernel system vocabs ; IN: gdk.gl.ffi << @@ -14,7 +14,7 @@ LIBRARY: gdk.gl "gdk.gl" { { [ os windows? ] [ "libgdkglext-win32-1.0-0.dll" cdecl add-library ] } { [ os macosx? ] [ drop ] } - { [ os unix? ] [ "libgdkglext-x11-1.0.so" cdecl add-library ] } + { [ os unix? ] [ "gdkglext-x11-1.0" find-library cdecl add-library ] } } cond >> diff --git a/basis/gtk/ffi/ffi.factor b/basis/gtk/ffi/ffi.factor index 2187c02c05..c7560a5abf 100644 --- a/basis/gtk/ffi/ffi.factor +++ b/basis/gtk/ffi/ffi.factor @@ -1,9 +1,8 @@ ! Copyright (C) 2010 Anton Gorenko. ! See http://factorcode.org/license.txt for BSD license. USING: alien alien.c-types alien.destructors alien.libraries -alien.syntax combinators gobject-introspection -gobject-introspection.standard-types kernel pango.ffi system -vocabs ; +alien.libraries.finder alien.syntax combinators gobject-introspection +gobject-introspection.standard-types kernel pango.ffi system vocabs ; IN: gtk.ffi << @@ -16,7 +15,7 @@ LIBRARY: gtk << "gtk" { { [ os windows? ] [ "libgtk-win32-2.0-0.dll" cdecl add-library ] } - { [ os linux? ] [ "libgtk-x11-2.0.so" cdecl add-library ] } + { [ os linux? ] [ "gtk-x11-2.0" find-library cdecl add-library ] } [ drop ] } cond >> diff --git a/basis/gtk/gl/ffi/ffi.factor b/basis/gtk/gl/ffi/ffi.factor index 50d3936693..43ed900ccb 100644 --- a/basis/gtk/gl/ffi/ffi.factor +++ b/basis/gtk/gl/ffi/ffi.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2010 Anton Gorenko. ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.libraries alien.syntax combinators -gobject-introspection kernel system vocabs ; +USING: alien alien.libraries alien.libraries.finder alien.syntax +combinators gobject-introspection kernel system vocabs ; IN: gtk.gl.ffi << @@ -15,7 +15,7 @@ LIBRARY: gtk.gl "gtk.gl" { { [ os windows? ] [ drop ] } { [ os macosx? ] [ drop ] } - { [ os unix? ] [ "libgtkglext-x11-1.0.so" cdecl add-library ] } + { [ os unix? ] [ "gtkglext-x11-1.0" find-library cdecl add-library ] } } cond >>