diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cuirass/job.scm | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/cuirass/job.scm b/src/cuirass/job.scm index 19e83c2..48c49b4 100644 --- a/src/cuirass/job.scm +++ b/src/cuirass/job.scm @@ -18,6 +18,7 @@ ;;; along with Cuirass. If not, see <http://www.gnu.org/licenses/>. (define-module (cuirass job) + #:use-module (cuirass base) #:use-module (srfi srfi-9) #:export (<job> make-job @@ -28,9 +29,13 @@ <job-spec> make-job-spec + job-spec? job-spec-name + job-spec-url + job-spec-branch + job-spec-file job-spec-proc - job-spec-metadata)) + job-spec-arguments)) (define-record-type <job> (%make-job name derivation metadata) @@ -39,15 +44,26 @@ (derivation job-derivation) ;string (metadata job-metadata)) ;alist -(define* (make-job name drv #:optional (metadata '())) - (%make-job name drv metadata)) +(define-syntax make-job + (syntax-rules () + ;; XXX: Different orders for keyword/argument pairs should be allowed. + ((make-job #:name name #:derivation filename #:metadata metadata) + (begin + (format (current-error-port) "evaluating '~a'... " name) + (force-output (current-error-port)) + (%make-job name + (call-with-time-display (λ () filename)) + metadata))))) (define-record-type <job-spec> - (%make-job-spec name proc metadata) + (%make-job-spec name url branch file proc arguments) job-spec? - (name job-spec-name) ;string - (proc job-spec-proc) ;thunk - (metadata job-spec-metadata)) ;alist + (name job-spec-name) ;string + (url job-spec-url) ;string + (branch job-spec-branch) ;string + (file job-spec-file) ;string + (proc job-spec-proc) ;symbol + (arguments job-spec-arguments)) ;alist -(define* (make-job-spec #:key name procedure metadata) - (%make-job-spec name procedure metadata)) +(define* (make-job-spec #:key name url branch file proc arguments) + (%make-job-spec name url branch file proc arguments)) |