]> gitweb.factorcode.org Git - factor.git/commitdiff
alien.libraries.finder: use dyld_shared_cache on Big Sur.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 14 Mar 2021 19:08:15 +0000 (12:08 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 14 Mar 2021 19:08:15 +0000 (12:08 -0700)
basis/alien/libraries/finder/macosx/macosx.factor

index 867c5b1afb44ac0840a1b65c2427bbf00773f412..1f438dab170f36fe2fa5aff7f302c329851bf4af 100644 (file)
@@ -1,10 +1,10 @@
 ! Copyright (C) 2013 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 
-USING: accessors alien.libraries.finder arrays assocs
-combinators.short-circuit environment io.files io.files.info
-io.pathnames kernel locals make namespaces sequences splitting
-system ;
+USING: accessors alien.c-types alien.libraries.finder
+alien.syntax arrays assocs combinators.short-circuit environment
+io.files io.files.info io.pathnames kernel locals make
+math.order namespaces sequences splitting system system-info ;
 
 IN: alien.libraries.finder.macosx
 
@@ -112,12 +112,17 @@ SYMBOL: dyld-executable-path
     [ dyld-default-search ] tri 3append
     dyld-image-suffix-search ;
 
+FUNCTION: bool _dyld_shared_cache_contains_path ( c-string name )
+
 PRIVATE>
 
 : dyld-find ( name -- path/f )
     dyld-search-paths
-    [ { [ exists? ] [ file-info regular-file? ] } 1&& ] find
-    [ nip ] when* ;
+    os-version { 11 0 0 } after=? [
+        [ _dyld_shared_cache_contains_path ] find
+    ] [
+        [ { [ exists? ] [ file-info regular-file? ] } 1&& ] find
+    ] if [ nip ] when* ;
 
 : framework-find ( name -- path )
     dup dyld-find [ nip ] [