]> gitweb.factorcode.org Git - factor.git/commitdiff
alien.libraries.finder: find-library for gtk libs
authorBjörn Lindqvist <bjourne@gmail.com>
Wed, 24 Jan 2018 12:17:54 +0000 (13:17 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Wed, 24 Jan 2018 12:17:54 +0000 (13:17 +0100)
This should make the code find the correct .so's when compiling Factor
yourself.

basis/alien/libraries/finder/linux/linux.factor
basis/gdk/gl/ffi/ffi.factor
basis/gtk/ffi/ffi.factor
basis/gtk/gl/ffi/ffi.factor

index 055e7a8bc3f03789c316a46a1feb55eddee06226..40aa0532349477886097d7c8ac32eeefc54b048a 100644 (file)
@@ -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 ;
index a1ff666c2e46474ab2880672edde7d8b8e8dca88..71fcb6264ed027b93e3d173f158825eb3a4a5349 100644 (file)
@@ -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
 >>
 
index 2187c02c05588b7fb35ab3a10fa08162848fd390..c7560a5abf131091ba0d046c1904f86e6c250932 100644 (file)
@@ -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
 >>
index 50d39366930edc04da5a8acde20dce9de055e249..43ed900ccb585bb9417f37234a721fa347c4bbd1 100644 (file)
@@ -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
 >>