- adopted to new install-lib
- using scsh-include from configure - respecting options build, non-shared-only, dest-dir
This commit is contained in:
parent
444f614553
commit
c67b9d6f27
74
pkg-def.scm
74
pkg-def.scm
|
@ -1,48 +1,50 @@
|
|||
(define-package "scx" (0 2 1)
|
||||
((optional-parts (xft "Compile with Xft support" #f))
|
||||
; we need something like one of these
|
||||
;(include-clib-options #t))
|
||||
;(extra-options (scsh-includes "where the scsh include files are"
|
||||
; ("scsh-includes") #t #f)))
|
||||
)
|
||||
((options (with-xft "Compile with Xft support" "<yes/no>" #t #t #f
|
||||
,parse-boolean ,show-boolean)))
|
||||
|
||||
;; compile and install c libs
|
||||
(let* ((scsh-includes "/afs/wsi/i386_fbsd46/scsh-0.6.5/include/")
|
||||
;(scsh-includes (get-extra-option 'scsh-includes))
|
||||
(prefix (get-directory 'lib #t))
|
||||
(xft? (with-optional-part? 'xft))
|
||||
(configure `("./configure" ,(string-append "--prefix=" prefix)
|
||||
(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)
|
||||
,(if xft? "--with-xft" "--without-xft")
|
||||
,(if scsh-includes (string-append "--with-scsh-includes="
|
||||
scsh-includes) "")))
|
||||
;; better use the real install-prefix as DESTDIR for make...
|
||||
(make '(make install)))
|
||||
(if (is-running-dry?)
|
||||
,(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))
|
||||
(if (not (and (zero? (run ,configure))
|
||||
(zero? (run ,make))))
|
||||
(exit))))
|
||||
;; create load.scm with sed
|
||||
(display "creating load.scm\n")
|
||||
(let ((schemedir (get-directory 'scheme #f))
|
||||
(libdir (get-directory 'lib #f))
|
||||
(load-xft-packages (if (with-optional-part? '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)
|
||||
;; this a bad hack, we would need dir 'lib-base
|
||||
-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 (is-running-dry?)
|
||||
(begin (display cmd) (display " > ") (display tgt) (newline))
|
||||
(run ,cmd (> ,tgt)))))
|
||||
(display "copying scheme code\n")
|
||||
|
||||
;; 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)))))))
|
||||
|
||||
(install-directory-contents "scheme" 'scheme)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue