chicken-install-only (HACK!) pasted by mario-goulart on Sun Feb 24 23:17:25 2013
(use (except setup-api install-extension install-program install-script compile) files posix extras) (define destdir (make-parameter #f)) (define-syntax compile (syntax-rules () ((_ . args) (void)))) (define (install-extension id files . rest) (for-each (lambda (file) (copy-file file (destdir))) files)) (define install-program install-extension) (define install-script install-extension) (define (usage #!optional exit-code) (let ((this (pathname-strip-directory (program-name))) (port (if (and exit-code (not (zero? exit-code))) (current-error-port) (current-output-port)))) (fprintf port #<#EOF #this [ -h | --help ] #this <.setup file> <dest dir> EOF )) (when exit-code (exit exit-code))) (let ((args (command-line-arguments))) (when (or (null? args) (null? (cdr args))) (usage 1)) (let ((setup-file (car args)) (dest (cadr args))) (destdir (if (absolute-pathname? dest) dest (normalize-pathname (make-pathname (current-directory) dest)))) (create-directory (destdir) 'with-parents) (load setup-file)))
-install-only for chicken install (MORE HACKS!) added by mario-goulart on Mon Feb 25 00:05:10 2013
diff --git a/chicken-install.scm b/chicken-install.scm index 714cf74..5b16015 100644 --- a/chicken-install.scm +++ b/chicken-install.scm @@ -548,6 +548,7 @@ (sprintf " -e \"(extra-nonfeatures '~s)\"" *csc-nonfeatures*) "") (if *deploy* " -e \"(deployment-mode #t)\"" "") + (if (install-only) " -e \"(install-only #t)\"" "") #\space (shellpath (make-pathname (cadr e+d+v) (car e+d+v) "setup"))) ) @@ -770,6 +771,7 @@ usage: chicken-install [OPTION | EXTENSION[:VERSION]] ... -s -sudo use sudo(1) for filesystem operations -r -retrieve only retrieve egg into current directory, don't install -n -no-install do not install, just build (implies `-keep') + -install-only do not compile, just install files -p -prefix PREFIX change installation prefix to PREFIX -list list extensions available over selected transport and location -host when cross-compiling, compile extension only for host @@ -915,6 +917,9 @@ EOF (set! *keep* #t) (set! *no-install* #t) (loop (cdr args) eggs)) + ((or (string=? arg "-install-only")) + (install-only #t) + (loop (cdr args) eggs)) ((string=? arg "-version") (print (chicken-version)) (exit 0)) diff --git a/setup-api.scm b/setup-api.scm index 9309ca8..874be80 100644 --- a/setup-api.scm +++ b/setup-api.scm @@ -54,6 +54,7 @@ extra-features extra-nonfeatures copy-file move-file sudo-install keep-intermediates + install-only version>=? extension-name-and-version extension-name @@ -111,6 +112,7 @@ (define deployment-mode (make-parameter #f)) (define program-path (make-parameter *chicken-bin-path*)) (define keep-intermediates (make-parameter #f)) +(define install-only (make-parameter #f)) (define extra-features (let ((xfs '())) @@ -277,7 +279,9 @@ (define-syntax compile (syntax-rules () ((_ exp ...) - (run (csc exp ...))))) + (if (install-only) + (void) + (run (csc exp ...)))))) ;;; Processing setup scripts