1 USING: alien.libraries.finder arrays assocs
2 combinators.short-circuit io io.encodings.utf8 io.files
3 io.files.info io.launcher kernel sequences sets splitting system
5 IN: alien.libraries.finder.freebsd
8 : parse-ldconfig-lines ( string -- triple )
10 ":-" split1 [ drop ] dip
11 "=>" split1 [ [ unicode:blank? ] trim ] bi@
15 : load-ldconfig-cache ( -- seq )
16 "/sbin/ldconfig -r" utf8 [ read-lines ] with-process-reader
17 rest parse-ldconfig-lines ;
19 : name-matches? ( lib double -- ? )
20 first swap ?head [ ?first CHAR: . = ] [ drop f ] if ;
24 M: freebsd find-library*
25 "l" prepend load-ldconfig-cache
26 [ name-matches? ] with find nip ?first dup [ ".so" append ] when ;