;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; 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. (cond-expand (chicken-4) (chicken-5 (import (srfi 1) (chicken format) (chicken posix) (chicken pathname)))) (define version "0.2.1") (define bin '("schematic-extract" "schematic-format" "schematic-markdown" "schematic-wiki")) (define lib '("read" "format" "process" "extract")) (define man (map (lambda (b) (make-pathname #f b "1")) bin)) (define flags '(-O3 -d0)) (define flags/r7rs '(-R r7rs -X r7rs)) (let ((cwd (current-directory))) (dynamic-wind (lambda () (current-directory "lib/foldling")) (lambda () (include "lib/foldling/command-line.setup")) (lambda () (current-directory cwd)))) (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/man/man1") m))) (filter file-exists? man))) `((version ,version))))