;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; CHICKEN install script for Schematic. ;;; ;;; See this project's README for more information. ;;; ;;; Copyright (c) 2014-2016, Evan Hanson ;;; See LICENSE for details. ;;; ;; XXX tests/run.scm expects a specific order of definitions. (require-extension with-current-directory) (define version "0.2.0") (define bin '("schematic-extract" "schematic-format" "schematic-markdown" "schematic-wiki")) (define lib '("read" "format" "process" "extract")) (define aux '("schematic.css")) (define man (map (lambda (b) (make-pathname #f b "1")) bin)) (define flags '(-O3 -d0)) (define flags/r7rs '(-R r7rs -X r7rs)) (define chicken-install (make-pathname (pathname-directory (program-name)) "chicken-install")) (unless (feature? #:no-libs) (for-each (lambda (dir) (with-current-directory dir (lambda () (let-values (((_ _ status) (process-wait (process-run chicken-install)))) (unless (zero? status) (exit status)))))) (map (lambda (d) (make-pathname "lib" d)) (directory "lib")))) (for-each (lambda (l) (compile ,@flags ,@flags/r7rs -J -I src/schematic -o ,(format "schematic.~a.so" l) -s ,(format "src/schematic/~a.sld" l)) (compile ,@flags -o ,(format "schematic.~a.import.so" l) -s ,(format "schematic.~a.import.scm" l))) lib) (for-each (lambda (b) (compile ,@flags ,@flags/r7rs -block ,(format "~a.scm" b))) bin) (let ((prefix (installation-prefix))) (install-extension 'schematic (append (map (lambda (l) (format "schematic.~a.so" l)) lib) (map (lambda (l) (format "schematic.~a.import.so" l)) lib) (map (lambda (b) (cons b (make-pathname (list prefix "bin") b))) bin) (map (lambda (m) (cons m (make-pathname (list prefix "share/schematic") m))) (filter file-exists? aux)) (map (lambda (m) (cons m (make-pathname (list prefix "share/man/man1") m))) (filter file-exists? man))) `((version ,version))))