1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
4 ;;; This file is part of GNU Guix.
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.
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.
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/>.
19 (define-module (guix build perl-build-system)
20 #:use-module ((guix build gnu-build-system)
21 #:renamer (symbol-prefix-proc 'gnu:))
22 #:use-module (guix build utils)
23 #:use-module (ice-9 match)
24 #:export (%standard-phases
29 ;; Builder-side code of the standard Perl package build procedure.
33 (define* (configure #:key outputs (make-maker-flags '())
35 "Configure the given Perl package."
36 (let ((out (assoc-ref outputs "out")))
37 (if (file-exists? "Makefile.PL")
38 (let ((args `("Makefile.PL" ,(string-append "PREFIX=" out)
39 "INSTALLDIRS=site" ,@make-maker-flags)))
40 (format #t "running `perl' with arguments ~s~%" args)
41 (zero? (apply system* "perl" args)))
42 (error "no Makefile.PL found"))))
44 (define %standard-phases
45 ;; Everything is as with the GNU Build System except for the `configure'
47 (alist-replace 'configure configure
48 gnu:%standard-phases))
50 (define* (perl-build #:key inputs (phases %standard-phases)
51 #:allow-other-keys #:rest args)
52 "Build the given Perl package, applying all of PHASES in order."
54 #:inputs inputs #:phases phases
57 ;;; perl-build-system.scm ends here