Simplify kawa-installer

This commit is contained in:
retropikzel 2025-06-27 16:37:48 +03:00
parent d7ca98299b
commit bd3d05541b

View file

@ -1949,45 +1949,23 @@
impl cfg (make-path dir source-scm-file)))))))) impl cfg (make-path dir source-scm-file))))))))
(define (kawa-installer impl cfg library dir) (define (kawa-installer impl cfg library dir)
(let* ((source-scm-file (get-library-file cfg library)) (let* ((source-class-file
(source-class-file (string-append (string-append dir
(library->path cfg library) ".class")) "/"
(dest-scm-file (path-strip-extension (get-library-file cfg library))
(string-append (library->path cfg library) ".scm")) ".class"))
(dest-class-file
(string-append (library->path cfg library) ".class"))
(include-files
(library-include-files impl cfg (make-path dir source-scm-file)))
(install-dir (get-install-source-dir impl cfg)) (install-dir (get-install-source-dir impl cfg))
(install-lib-dir (get-install-library-dir impl cfg))) (dest-class-file
(let ((scm-path (make-path install-dir dest-scm-file)) (string-append install-dir
(class-path (make-path install-lib-dir dest-class-file))) "/"
(install-directory cfg (path-directory scm-path)) (library->path cfg library) ".class"))
(install-directory cfg (path-directory class-path)) (path (make-path install-dir dest-class-file))
(install-file cfg (make-path dir source-scm-file) scm-path) (include-filename (string-append
(install-file cfg (make-path dir source-class-file) class-path) (path-strip-directory
;; install any includes (path-strip-extension path))
(cons ".sld")))
scm-path (default-installer impl cfg library dir)
(append (install-file cfg source-class-file dest-class-file)))
(map
(lambda (x)
(let ((dest-file (make-path install-dir (path-relative x dir))))
(install-directory cfg (path-directory dest-file))
(install-file cfg x dest-file)
dest-file))
include-files)
(map
(lambda (x)
(let* ((so-file (string-append x (cond-expand (macosx ".dylib")
(else ".so"))))
(dest-file (make-path install-lib-dir
(path-relative so-file dir))))
(install-directory cfg (path-directory dest-file))
(install-file cfg so-file dest-file)
dest-file))
(library-shared-include-files
impl cfg (make-path dir source-scm-file))))))))
;; installers should return the list of installed files ;; installers should return the list of installed files
(define (lookup-installer installer) (define (lookup-installer installer)