2003-12-11 09:54:55 -05:00
|
|
|
(define-package "scx" (0 2 1)
|
2004-01-04 09:42:18 -05:00
|
|
|
((options (with-xft "Compile with Xft support" "<yes/no>" #t #t #f
|
|
|
|
,parse-boolean ,show-boolean)))
|
2003-12-11 09:54:55 -05:00
|
|
|
|
2003-12-16 11:46:26 -05:00
|
|
|
;; compile and install c libs
|
2004-01-04 09:42:18 -05:00
|
|
|
(display "configuring, compiling and installing the native code library\n")
|
|
|
|
(let* ((scsh-includes (include-dir))
|
|
|
|
(build-host (get-option-value 'build))
|
|
|
|
(prefix (string-append (get-directory 'lib #f) "/" build-host))
|
|
|
|
(xft? (get-option-value 'with-xft))
|
|
|
|
(configure `("./configure"
|
|
|
|
,(string-append "--prefix=" prefix)
|
2003-12-16 11:46:26 -05:00
|
|
|
,(if xft? "--with-xft" "--without-xft")
|
2004-01-04 09:42:18 -05:00
|
|
|
,(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)
|
2003-12-11 09:54:55 -05:00
|
|
|
(begin
|
|
|
|
(display configure) (newline)
|
|
|
|
(display make) (newline))
|
2003-12-16 11:46:26 -05:00
|
|
|
(if (not (and (zero? (run ,configure))
|
|
|
|
(zero? (run ,make))))
|
|
|
|
(exit))))
|
2004-01-04 09:42:18 -05:00
|
|
|
|
|
|
|
;; create load.scm with sed, this is platform-independent
|
|
|
|
(if (not (get-option-value 'non-shared-only))
|
|
|
|
(begin
|
|
|
|
(display "creating load.scm\n")
|
|
|
|
(let ((schemedir (get-directory 'scheme #f))
|
|
|
|
(libdir (get-directory 'lib #f))
|
|
|
|
(load-xft-packages (if (get-option-value 'with-xft) "yes" "no"))
|
|
|
|
(target-dir (get-directory 'base #t))
|
|
|
|
(sed-replace (lambda (from to)
|
|
|
|
(string-append "s|" from "|" to "|g"))))
|
|
|
|
(let ((cmd `(sed -e ,(sed-replace "@scxschemedir@" schemedir)
|
|
|
|
-e ,(sed-replace "@scxhost@" "(host)")
|
|
|
|
-e ,(sed-replace "@scxlibdir@" libdir)
|
|
|
|
-e ,(sed-replace "@scxload_xft_packages@"
|
|
|
|
load-xft-packages)
|
|
|
|
"load.scm.in"))
|
|
|
|
(tgt (string-append target-dir "/load.scm")))
|
|
|
|
(if (get-option-value 'dry-run)
|
|
|
|
(begin (display cmd) (display " > ") (display tgt) (newline))
|
|
|
|
(if (not (zero? (run ,cmd (> ,tgt))))
|
|
|
|
(exit)))))))
|
|
|
|
|
2003-12-16 11:46:26 -05:00
|
|
|
(install-directory-contents "scheme" 'scheme)
|
2003-12-11 09:54:55 -05:00
|
|
|
)
|