- adopted to new install-lib

- using scsh-include from configure
- respecting options build, non-shared-only, dest-dir
This commit is contained in:
frese 2004-01-04 14:42:18 +00:00
parent 444f614553
commit c67b9d6f27
1 changed files with 38 additions and 36 deletions

View File

@ -1,48 +1,50 @@
(define-package "scx" (0 2 1) (define-package "scx" (0 2 1)
((optional-parts (xft "Compile with Xft support" #f)) ((options (with-xft "Compile with Xft support" "<yes/no>" #t #t #f
; we need something like one of these ,parse-boolean ,show-boolean)))
;(include-clib-options #t))
;(extra-options (scsh-includes "where the scsh include files are"
; ("scsh-includes") #t #f)))
)
;; compile and install c libs ;; compile and install c libs
(let* ((scsh-includes "/afs/wsi/i386_fbsd46/scsh-0.6.5/include/") (display "configuring, compiling and installing the native code library\n")
;(scsh-includes (get-extra-option 'scsh-includes)) (let* ((scsh-includes (include-dir))
(prefix (get-directory 'lib #t)) (build-host (get-option-value 'build))
(xft? (with-optional-part? 'xft)) (prefix (string-append (get-directory 'lib #f) "/" build-host))
(configure `("./configure" ,(string-append "--prefix=" prefix) (xft? (get-option-value 'with-xft))
(configure `("./configure"
,(string-append "--prefix=" prefix)
,(if xft? "--with-xft" "--without-xft") ,(if xft? "--with-xft" "--without-xft")
,(if scsh-includes (string-append "--with-scsh-includes=" ,(string-append "--with-scsh-includes=" scsh-includes)
scsh-includes) ""))) ,(string-append "--build=" build-host)))
;; better use the real install-prefix as DESTDIR for make...
(make '(make install))) (make `(make install
(if (is-running-dry?) ,(string-append "DESTDIR=" (get-option-value 'dest-dir)))))
(if (get-option-value 'dry-run)
(begin (begin
(display configure) (newline) (display configure) (newline)
(display make) (newline)) (display make) (newline))
(if (not (and (zero? (run ,configure)) (if (not (and (zero? (run ,configure))
(zero? (run ,make)))) (zero? (run ,make))))
(exit)))) (exit))))
;; create load.scm with sed
(display "creating load.scm\n") ;; create load.scm with sed, this is platform-independent
(let ((schemedir (get-directory 'scheme #f)) (if (not (get-option-value 'non-shared-only))
(libdir (get-directory 'lib #f)) (begin
(load-xft-packages (if (with-optional-part? 'xft) "yes" "no")) (display "creating load.scm\n")
(target-dir (get-directory 'base #t)) (let ((schemedir (get-directory 'scheme #f))
(sed-replace (lambda (from to) (libdir (get-directory 'lib #f))
(string-append "s|" from "|" to "|g")))) (load-xft-packages (if (get-option-value 'with-xft) "yes" "no"))
(let ((cmd `(sed -e ,(sed-replace "@scxschemedir@" schemedir) (target-dir (get-directory 'base #t))
;; this a bad hack, we would need dir 'lib-base (sed-replace (lambda (from to)
-e ,(sed-replace "@scxhost@" "\"../\" (host)") (string-append "s|" from "|" to "|g"))))
-e ,(sed-replace "@scxlibdir@" libdir) (let ((cmd `(sed -e ,(sed-replace "@scxschemedir@" schemedir)
-e ,(sed-replace "@scxload_xft_packages@" -e ,(sed-replace "@scxhost@" "(host)")
load-xft-packages) -e ,(sed-replace "@scxlibdir@" libdir)
"load.scm.in")) -e ,(sed-replace "@scxload_xft_packages@"
(tgt (string-append target-dir "/load.scm"))) load-xft-packages)
(if (is-running-dry?) "load.scm.in"))
(begin (display cmd) (display " > ") (display tgt) (newline)) (tgt (string-append target-dir "/load.scm")))
(run ,cmd (> ,tgt))))) (if (get-option-value 'dry-run)
(display "copying scheme code\n") (begin (display cmd) (display " > ") (display tgt) (newline))
(if (not (zero? (run ,cmd (> ,tgt))))
(exit)))))))
(install-directory-contents "scheme" 'scheme) (install-directory-contents "scheme" 'scheme)
) )