hydra-to-cuirass.scm 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. ;;;
  19. ;;; This file defines the conversion of Hydra build jobs to Cuirass build
  20. ;;; jobs. It is meant to be included in other files.
  21. ;;;
  22. (use-modules ((guix licenses)
  23. #:select (license? license-name license-uri license-comment)))
  24. (define (cuirass-jobs store arguments)
  25. "Return Cuirass jobs."
  26. (map hydra-job->cuirass-job (hydra-jobs store arguments)))
  27. (define (hydra-job->cuirass-job hydra-job)
  28. (let ((name (car hydra-job))
  29. (job ((cdr hydra-job))))
  30. (lambda _ (acons #:job-name (symbol->string name)
  31. (map symbol-alist-entry->keyword-alist-entry job)))))
  32. (define (symbol-alist-entry->keyword-alist-entry entry)
  33. (cons (symbol->keyword (car entry)) (entry->sexp-entry (cdr entry))))
  34. (define (entry->sexp-entry o)
  35. (match o
  36. ((? license?) `((name . (license-name o))
  37. (uri . ,(license-uri o))
  38. (comment . ,(license-comment o))))
  39. ((lst ...)
  40. (map entry->sexp-entry lst))
  41. (_ o)))