: 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 ;
! 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
<<
"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
>>
! 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
<<
<<
"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
>>
! 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
<<
"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
>>