adjust the names of the dot/neato binaries to be platform-specific

original commit: 71595a55e67f4701eae93bd60d52d785d83cef6f
This commit is contained in:
Robby Findler 2012-01-17 12:41:44 -06:00
parent dc8edd7062
commit 92d21649fb

View File

@ -13,7 +13,7 @@
(define neato-ipsep-label "neato ipsep") (define neato-ipsep-label "neato ipsep")
;; these paths are explicitly checked (when find-executable-path ;; these paths are explicitly checked (when find-executable-path
;; fails) because starting drscheme from the finder (or the doc) ;; fails) because starting drracket from the finder (or the dock)
;; under mac os x generally does not get the path right. ;; under mac os x generally does not get the path right.
(define dot-paths (define dot-paths
'("/usr/bin" '("/usr/bin"
@ -21,17 +21,20 @@
"/usr/local/bin" "/usr/local/bin"
"/opt/local/bin/")) "/opt/local/bin/"))
(define dot.exe (if (eq? (system-type) 'windows) "dot.exe" "dot"))
(define neato.exe (if (eq? (system-type) 'windows) "neato.exe" "neato"))
(define (find-dot [neato? #f]) (define (find-dot [neato? #f])
(cond (cond
[(and (find-executable-path "dot") [(and (find-executable-path dot.exe)
(find-executable-path "neato")) (find-executable-path neato.exe))
(if neato? (if neato?
(find-executable-path "neato") (find-executable-path neato.exe)
(find-executable-path "dot"))] (find-executable-path dot.exe))]
[else [else
(ormap (λ (x) (and (file-exists? (build-path x "dot")) (ormap (λ (x) (and (file-exists? (build-path x dot.exe))
(file-exists? (build-path x "neato")) (file-exists? (build-path x neato.exe))
(build-path x (if neato? "neato" "dot")))) (build-path x (if neato? neato.exe dot.exe))))
dot-paths)])) dot-paths)]))
(define (dot-positioning pb option overlap?) (define (dot-positioning pb option overlap?)