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"
|
2004-02-12 04:11:32 -05:00
|
|
|
"--enable-static=no"
|
2004-01-04 09:42:18 -05:00
|
|
|
,(string-append "--prefix=" prefix)
|
2004-02-11 17:03:12 -05:00
|
|
|
,(if xft? "--with-xft=yes" "--with-xft=no")
|
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
|
|
|
|
2004-02-01 18:12:26 -05:00
|
|
|
;; create load.scm
|
|
|
|
(let ((schemedir (get-directory 'scheme #f))
|
|
|
|
(libdir (get-directory 'lib #f))
|
|
|
|
(load-xft-packages (get-option-value 'with-xft)))
|
|
|
|
(write-to-load-script
|
2004-02-12 11:32:01 -05:00
|
|
|
`((new-package)
|
2004-02-01 18:12:26 -05:00
|
|
|
(load-package 'dynamic-externals)
|
2004-02-12 11:32:01 -05:00
|
|
|
(load-package 'reinitializers)
|
|
|
|
(open 'scheme-with-scsh)
|
|
|
|
(open 'srfi-13)
|
2004-02-01 18:12:26 -05:00
|
|
|
(open 'dynamic-externals)
|
|
|
|
(open 'external-calls)
|
|
|
|
(open 'configure)
|
|
|
|
(open 'signals)
|
2004-02-12 11:32:01 -05:00
|
|
|
(open 'reinitializers)
|
2004-02-01 18:12:26 -05:00
|
|
|
,@(map (lambda (x) `(run ',x)) tmpl-libtool-la-reader)
|
2004-02-12 11:32:01 -05:00
|
|
|
(run '(define (init-scx)
|
|
|
|
(let* ((lib-dir (string-append ,libdir "/" (host)))
|
2004-02-01 18:12:26 -05:00
|
|
|
(la-file-name (string-append lib-dir "/libscx.la"))
|
|
|
|
(initializer-name "scx_init_xlib"))
|
|
|
|
(let ((la-alist (read-libtool-la la-file-name)))
|
|
|
|
(cond
|
|
|
|
((assoc 'dlname la-alist)
|
|
|
|
=> (lambda (p)
|
|
|
|
(let ((module-file (string-append lib-dir "/" (cdr p))))
|
|
|
|
(dynamic-load module-file)
|
2004-02-12 11:32:01 -05:00
|
|
|
(lookup-all-externals) ;;; important when resuming images
|
2004-02-01 18:12:26 -05:00
|
|
|
(call-external (get-external initializer-name))
|
2004-02-12 11:32:01 -05:00
|
|
|
,@(if load-xft-packages
|
|
|
|
'((begin
|
|
|
|
(call-external (get-external "scx_xft_init"))
|
|
|
|
(call-external (get-external "scx_xrender_init"))))
|
|
|
|
'()))))
|
2004-02-01 18:12:26 -05:00
|
|
|
(else
|
2004-02-12 11:32:01 -05:00
|
|
|
(error "Could not figure out libscx's name" la-file-name)))))))
|
|
|
|
(run '(define scx-reinitializer (make-reinitializer init-scx)))
|
|
|
|
(run '(init-scx))
|
2004-02-01 18:12:26 -05:00
|
|
|
(config)
|
|
|
|
(load ,(string-append schemedir "/xlib/xlib-interfaces.scm"))
|
|
|
|
(load ,(string-append schemedir "/xlib/xlib-packages.scm"))
|
|
|
|
(load ,(string-append schemedir "/libs/libs-interfaces.scm"))
|
|
|
|
(load ,(string-append schemedir "/libs/libs-packages.scm"))
|
|
|
|
(user))))
|
2004-01-04 09:42:18 -05:00
|
|
|
|
2003-12-16 11:46:26 -05:00
|
|
|
(install-directory-contents "scheme" 'scheme)
|
2003-12-11 09:54:55 -05:00
|
|
|
)
|