;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020 Bonface Munyoki Kilyungi ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (guix build racket-build-system) #:use-module ((guix build gnu-build-system) #:prefix gnu:) #:use-module (guix build union) #:use-module (guix build utils) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (%standard-phases racket-build)) ;; Commentary: ;; ;; Builder-side code of the racket package build procedure. ;; ;; Code: (define (racket-package? name) (string-prefix? "racket-" name)) ;; Currently not working (define* (check #:key tests? #:allow-other-keys) "Run tests for the racket package" (if tests? (invoke "raco" "test") (format #t "test suite not run~%")) #t) (define (call-raco-pkg command params) (apply invoke "raco" "pkg" command params)) ;; TODO: Find a work around to make this work without modifying where racket ;; store (define* (install #:key outputs #:allow-other-keys) "Install the racket pkg" (let ((out (assoc-ref outputs "out"))) (call-raco-pkg "install" `("--no-cache" "--no-setup" "--ignore-checksums" "--clone" ,(getcwd))))) (define %standard-phases (modify-phases gnu:%standard-phases (delete 'bootstrap) (delete 'configure) (delete 'patch-generated-file-shebangs) (delete 'build) (replace 'install install))) (define* (racket-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) "Build the given racket package, applying all of PHASES in order." (apply gnu:gnu-build #:inputs inputs #:phases phases args))