;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Jack Hill ;;; ;;; 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 janet-build-system) #:use-module ((guix build gnu-build-system) #:prefix gnu:) #:use-module (guix build utils) #:use-module (guix utils) #:export (%standard-phases janet-build)) ;; Commentary: ;; ;; Builder-side code of the standard Janet package build procedure. ;; ;; Code: (define* (build #:rest arguments) "Build a Janet package with jpm" (invoke "jpm" "--verbose" (string-append "--compiler=" (cc-for-target)) (string-append "--cpp-compiler=" (cxx-for-target)) "build")) (define* (check #:key tests? #:allow-other-keys) "Test a janet package with jpm. Skip the tests if TESTS? is #f." (if tests? (invoke "jpm" "--verbose" "test"))) (define* (install #:key outputs #:allow-other-keys) "Install a Janet package with jpm" (let ((out (assoc-ref outputs "out"))) (invoke "jpm" "--verbose" (string-append "--modpath=" out "/lib/janet") (string-append "--binpath=" out "/bin") "install"))) (define %standard-phases (modify-phases gnu:%standard-phases (delete 'bootstrap) (delete 'configure) (replace 'build build) (replace 'check check) (replace 'install install))) (define* (janet-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) (apply gnu:gnu-build #:inputs inputs #:phases phases args))