! Copyright (C) 2013 Björn Lindqvist, Doug Coleman.
! See http://factorcode.org/license.txt for BSD license
-USING: alien.libraries alien.libraries.finder arrays assocs
+USING: alien.libraries.finder arrays assocs
combinators.short-circuit io io.encodings.utf8 io.files
io.files.info io.launcher kernel sequences sets splitting system
unicode.categories ;
: parse-ldconfig-lines ( string -- triple )
[
"=>" split1 [ [ blank? ] trim ] bi@
- [ " " split1 [ "()" in? ] trim "," split ] dip 3array
+ [
+ " " split1 [ "()" in? ] trim "," split
+ [ [ blank? ] trim ] map
+ [ "OS ABI:" head? ] reject
+ ] dip 3array
] map ;
: load-ldconfig-cache ( -- seq )
first swap ?head [ ?first CHAR: . = ] [ drop f ] if ;
: arch-matches? ( lib triple -- ? )
- nip second ldconfig-arch subset? ;
+ [ drop ldconfig-arch ] [ second swap subset? ] bi* ;
: ldconfig-matches? ( lib triple -- ? )
{ [ name-matches? ] [ arch-matches? ] } 2&& ;