support building with chicken-install too

Change-Id: I47510ca9d5892f1def55ab14f610ba796a6a6964
This commit is contained in:
puck 2025-11-18 14:04:39 +00:00
parent 933b942a62
commit 56b114ef2c
8 changed files with 55 additions and 10 deletions

View file

@ -36,6 +36,12 @@
(set! counter (+ counter 1))
(string-append "1980-01-01 00:00:" (number->string counter)))
; Workaround to deal with the non-scheme component dependencies.
(define (is-source-file hdr)
(unless (string? hdr) (set! hdr (symbol->string hdr)))
(define len (string-length hdr))
(string=? (string-copy hdr (- len 2)) ".h"))
(define (process-component component)
(define name (symbol->string (cadr component)))
(define source #f)
@ -49,6 +55,10 @@
((csc-options) (set! csc-options (append csc-options (cdr v))))))
(cddr component))
(define new-deps '())
(for-each (lambda (d) (unless (is-source-file d) (set! new-deps (cons d new-deps)))) deps)
(set! deps new-deps)
(define flagobj (list (cons 'unit name)))
(define flagstr "")
(unless (eq? csc-options shared-flags)
@ -128,7 +138,7 @@ rule install
(for-each (lambda (l) (write-string (string-append " " (make-escaped-string l)))) link-flags)
(write-string "\n"))) (cdr val)))
(when (eq? (car val) 'components)
(for-each process-component (cdr val))))
(for-each (lambda (p) (when (eq? 'extension (car p)) (process-component p))) (cdr val))))
egg)
(emit-build (list (string-append outdir "/" egg-name ".egg-info")) '() "install" (list (string-append egg-name ".egg-info")) '() '())
(set! installed-files (cons (string-append outdir "/" egg-name ".egg-info") installed-files))