scsh-yp/pkg-def.scm

47 lines
1.4 KiB
Scheme
Raw Normal View History

(define-package "yp" (0 2 0) ()
(display "configuring, compiling and installing c-stubs")
(newline)
(let* ((scsh-includes (include-dir))
(build-host (get-option-value 'build))
(prefix (string-append (get-directory 'lib #f) "/" build-host))
(configure `("./configure"
,(string-append "--prefix=" prefix)
,(string-append "--with-scsh-includes=" scsh-includes)
,(string-append "--build=" build-host)))
(make `(make install
,(string-append "DESTDIR=" (get-option-value 'dest-dir)))))
(if (get-option-value 'dry-run)
(begin
(display configure)
(newline)
(display make)
(newline))
(and (zero? (run ,configure)) (zero? (run ,make)) (exit))))
(if (not (get-option-value 'non-shared-only))
(begin
(display "creating load.scm")
(newline)
(let ((schemedir (get-directory 'scheme #f))
(libdir (get-directory 'lib #f))
(target-dir (get-directory 'base #t))
(sed-replace (lambda (from to)
(string-append "s|" from "|" to "|g"))))
(let ((cmd `(sed -e ,(sed-replace "@ypschemedir@" schemedir)
-e ,(sed-replace "@yphost@" "(host)")
-e ,(sed-replace "@yplibdir@" libdir)
"load.scm.in"))
(tgt (string-append target-dir "/load.scm")))
(if (get-option-value 'dry-run)
(begin
(display cmd) (display " > ") (display tgt)
(newline))
(or (zero? (run ,cmd (> ,tgt))) (exit)))))))
(install-directory-contents "scheme" 'scheme)
)