Add more autoload paths

This commit is contained in:
retropikzel 2024-05-09 09:34:28 +03:00
parent 670041401f
commit bd706a4239
1 changed files with 23 additions and 3 deletions

View File

@ -122,6 +122,23 @@
double double
pointer)) pointer))
(define string-split
(lambda (str mark)
(let* ((str-l (string->list str))
(res (list))
(last-index 0)
(index 0)
(splitter (lambda (c)
(cond ((char=? c mark)
(begin
(set! res (append res (list (string-copy str last-index index))))
(set! last-index (+ index 1))))
((equal? (length str-l) (+ index 1))
(set! res (append res (list (string-copy str last-index (+ index 1)))))))
(set! index (+ index 1)))))
(for-each splitter str-l)
res)))
(define auto-load-paths (define auto-load-paths
(append (append
(cond-expand (cond-expand
@ -137,11 +154,14 @@
(string-split (get-environment-variable "PATH") #\;))) (string-split (get-environment-variable "PATH") #\;)))
(else (else
(append (append
; Guix
(list (if (get-environment-variable "GUIX_ENVIRONMENT") (list (if (get-environment-variable "GUIX_ENVIRONMENT")
(string-append (get-environment-variable "GUIX_ENVIRONMENT") "/lib") (string-append (get-environment-variable "GUIX_ENVIRONMENT") "/lib")
"")) "")
(if (get-environment-variable "LD_LOAD_PATH") "/run/current-system/profile/lib")
(list) ;(string-split (get-environment-variable "LD_LOAD_PATH") #\:) ; Debian
(if (get-environment-variable "LD_LIBRARY_PATH")
(list (string-split (get-environment-variable "LD_LIBRARY_PATH") #\:))
(list)) (list))
(list "/lib/x86_64-linux-gnu" (list "/lib/x86_64-linux-gnu"
"/usr/lib/x86_64-linux-gnu" "/usr/lib/x86_64-linux-gnu"