Skip to content

Commit 3ea46fc

Browse files
authored
Merge pull request #31 from tani/master
feat: darwin support
2 parents 725da0a + d423891 commit 3ea46fc

1 file changed

Lines changed: 20 additions & 11 deletions

File tree

src/async-process.lisp

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,30 @@
2121
(pushnew (asdf:system-relative-pathname
2222
:async-process
2323
(format nil "../static/~A/"
24-
(cond ((uiop/os:featurep '(:and :windows :x86-64))
25-
"x86_64/windows")
26-
((uiop/os:featurep :windows) "x86/windows")
27-
((uiop/os:featurep :unix)
28-
(format nil "~A/~A"
29-
(system "uname -m")
30-
(let ((os (system "uname")))
31-
(cond ((and (equal os "Linux")
32-
(muslp))
33-
"Linux-musl")
34-
(t os))))))))
24+
(cond
25+
;; Windows
26+
((uiop/os:featurep '(:and :windows :x86-64))
27+
"x86_64/windows")
28+
((uiop/os:featurep :windows)
29+
"x86/windows")
30+
;; macOS (Darwin)
31+
((uiop/os:featurep :os-macosx)
32+
(format nil "~A/darwin"
33+
(uiop:run-program '("uname" "-m") :output '(:string :stripped t))))
34+
;; Linux / Generic Unix
35+
((uiop/os:featurep :unix)
36+
(format nil "~A/~A"
37+
(uiop:run-program '("uname" "-m") :output '(:string :stripped t))
38+
(let ((os (uiop:run-program '("uname") :output '(:string :stripped t))))
39+
(cond ((and (equal os "Linux")
40+
(ignore-errors (funcall (read-from-string "muslp"))))
41+
"Linux-musl")
42+
(t os))))))))
3543
cffi:*foreign-library-directories*
3644
:test #'uiop:pathname-equal)
3745

3846
(cffi:define-foreign-library async-process
47+
(:darwin "libasyncprocess.dylib")
3948
(:unix "libasyncprocess.so")
4049
(:windows "libasyncprocess.dll"))
4150

0 commit comments

Comments
 (0)