]> gitweb.factorcode.org Git - factor.git/commitdiff
tools.deploy.libraries: remove in favor of alien.libraries.finder.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 15 Mar 2021 18:29:24 +0000 (11:29 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 15 Mar 2021 18:29:24 +0000 (11:29 -0700)
Keep the find-library-file behavior in M\ windows find-library*.

basis/alien/libraries/finder/windows/windows.factor
basis/tools/deploy/libraries/libraries.factor [deleted file]
basis/tools/deploy/libraries/unix/platforms.txt [deleted file]
basis/tools/deploy/libraries/unix/unix.factor [deleted file]
basis/tools/deploy/libraries/windows/platforms.txt [deleted file]
basis/tools/deploy/libraries/windows/windows.factor [deleted file]

index 3ea834930d7335cbf7c89cc636a27b4c6765caa1..e9a5202ce230bf6d32d99de0b393a48caf507d3c 100644 (file)
@@ -1,9 +1,13 @@
 ! Copyright (C) 2013 Björn Lindqvist, John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 
-USING: alien.libraries.finder arrays combinators.short-circuit
-environment io.backend io.files io.files.info io.pathnames kernel
-sequences splitting system system-info.windows ;
+USING: alien.data alien.libraries.finder alien.strings arrays
+byte-arrays combinators.short-circuit environment io.backend
+io.files io.files.info io.pathnames kernel sequences
+specialized-arrays splitting system system-info.windows
+windows.kernel32 windows.types ;
+FROM: alien.c-types => ushort ;
+SPECIALIZED-ARRAY: ushort
 
 IN: alien.libraries.finder.windows
 
@@ -26,9 +30,20 @@ IN: alien.libraries.finder.windows
         ] with map concat
     ] if ;
 
-PRIVATE>
-
-M: windows find-library*
+: find-library-paths ( name -- path/f )
     candidate-paths [
         { [ exists? ] [ file-info regular-file? ] } 1&&
     ] find nip ;
+
+: find-library-file ( name -- path/f )
+    f DONT_RESOLVE_DLL_REFERENCES LoadLibraryEx [
+        [
+            32768 ushort (c-array) [ 32768 GetModuleFileName drop ] keep
+            alien>native-string
+        ] [ FreeLibrary drop ] bi
+    ] [ f ] if* ;
+
+PRIVATE>
+
+M: windows find-library*
+    { [ find-library-paths ] [ find-library-file ] } 1|| ;
diff --git a/basis/tools/deploy/libraries/libraries.factor b/basis/tools/deploy/libraries/libraries.factor
deleted file mode 100644 (file)
index f7b6cfe..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-! Copyright (C) 2010 Joe Groff.
-! See http://factorcode.org/license.txt for BSD license.
-USING: alien.libraries io.pathnames io.pathnames.private kernel
-system vocabs ;
-IN: tools.deploy.libraries
-
-HOOK: find-library-file os ( file -- path )
-
-os windows?
-"tools.deploy.libraries.windows"
-"tools.deploy.libraries.unix" ? require
diff --git a/basis/tools/deploy/libraries/unix/platforms.txt b/basis/tools/deploy/libraries/unix/platforms.txt
deleted file mode 100644 (file)
index 509143d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unix
diff --git a/basis/tools/deploy/libraries/unix/unix.factor b/basis/tools/deploy/libraries/unix/unix.factor
deleted file mode 100644 (file)
index ca9c999..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-! Copyright (C) 2010 Joe Groff.
-! See http://factorcode.org/license.txt for BSD license.
-USING: io.files io.pathnames io.pathnames.private kernel
-sequences system tools.deploy.libraries ;
-IN: tools.deploy.libraries.unix
-
-! stupid hack. better ways to find the library name would be open the library,
-! note a symbol address found in the library, then call dladdr (or use
-
-<PRIVATE
-
-: ?exists ( path -- path/f )
-    dup exists? [ drop f ] unless ; inline
-
-PRIVATE>
-
-M: unix find-library-file
-    dup absolute-path? [ ?exists ] [
-        { "/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" "resource:" }
-        [ prepend-path ?exists ] with map-find drop
-    ] if ;
diff --git a/basis/tools/deploy/libraries/windows/platforms.txt b/basis/tools/deploy/libraries/windows/platforms.txt
deleted file mode 100644 (file)
index 8e1a559..0000000
+++ /dev/null
@@ -1 +0,0 @@
-windows
diff --git a/basis/tools/deploy/libraries/windows/windows.factor b/basis/tools/deploy/libraries/windows/windows.factor
deleted file mode 100644 (file)
index 08db925..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-! Copyright (C) 2010 Joe Groff.
-! See http://factorcode.org/license.txt for BSD license.
-USING: alien.data alien.strings byte-arrays
-kernel specialized-arrays system tools.deploy.libraries
-windows.kernel32 windows.types ;
-FROM: alien.c-types => ushort ;
-SPECIALIZED-ARRAY: ushort
-IN: tools.deploy.libraries.windows
-
-M: windows find-library-file
-    f DONT_RESOLVE_DLL_REFERENCES LoadLibraryEx [
-        [
-            32768 ushort (c-array) [ 32768 GetModuleFileName drop ] keep
-            alien>native-string
-        ] [ FreeLibrary drop ] bi
-    ] [ f ] if* ;