2013-03-04 00:41:46 +01:00
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2015-02-26 23:00:21 +01:00
|
|
|
;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
|
2013-03-04 00:41:46 +01:00
|
|
|
;;;
|
|
|
|
;;; 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
(define-module (guix build perl-build-system)
|
Use #:prefix instead of #:renamer with 'symbol-prefix-proc'.
* gnu/packages/abiword.scm, gnu/packages/admin.scm, gnu/packages/aidc.scm,
gnu/packages/backup.scm, gnu/packages/bittorrent.scm,
gnu/packages/boost.scm, gnu/packages/compression.scm,
gnu/packages/cryptsetup.scm, gnu/packages/curl.scm,
gnu/packages/cyrus-sasl.scm, gnu/packages/dc.scm, gnu/packages/emacs.scm,
gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/geeqie.scm,
gnu/packages/ghostscript.scm, gnu/packages/gimp.scm,
gnu/packages/gkrellm.scm, gnu/packages/gl.scm, gnu/packages/glib.scm,
gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm,
gnu/packages/gnutls.scm, gnu/packages/gnuzilla.scm, gnu/packages/gsasl.scm,
gnu/packages/gtk.scm, gnu/packages/gv.scm, gnu/packages/image.scm,
gnu/packages/indent.scm, gnu/packages/inkscape.scm,
gnu/packages/lesstif.scm, gnu/packages/links.scm, gnu/packages/lisp.scm,
gnu/packages/lsh.scm, gnu/packages/lsof.scm, gnu/packages/maths.scm,
gnu/packages/mp3.scm, gnu/packages/openssl.scm, gnu/packages/ots.scm,
gnu/packages/pciutils.scm, gnu/packages/pcre.scm, gnu/packages/pdf.scm,
gnu/packages/pulseaudio.scm, gnu/packages/python.scm, gnu/packages/slim.scm,
gnu/packages/ssh.scm, gnu/packages/texlive.scm, gnu/packages/vim.scm,
gnu/packages/vpn.scm, gnu/packages/web.scm, gnu/packages/wv.scm,
gnu/packages/xiph.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm,
gnu/packages/yasm.scm, gnu/packages/zip.scm,
guix/build/cmake-build-system.scm, guix/build/perl-build-system.scm,
guix/build/python-build-system.scm, guix/download.scm: Replaces uses of
#:renamer and 'symbol-prefix-proc' with #:prefix.
2014-09-23 22:44:22 +02:00
|
|
|
#:use-module ((guix build gnu-build-system) #:prefix gnu:)
|
2013-03-04 00:41:46 +01:00
|
|
|
#:use-module (guix build utils)
|
|
|
|
#:use-module (ice-9 match)
|
|
|
|
#:export (%standard-phases
|
|
|
|
perl-build))
|
|
|
|
|
|
|
|
;; Commentary:
|
|
|
|
;;
|
|
|
|
;; Builder-side code of the standard Perl package build procedure.
|
|
|
|
;;
|
|
|
|
;; Code:
|
|
|
|
|
2015-01-23 06:18:57 +01:00
|
|
|
(define* (configure #:key outputs make-maker?
|
|
|
|
(make-maker-flags '()) (module-build-flags '())
|
2013-03-04 00:41:46 +01:00
|
|
|
#:allow-other-keys)
|
|
|
|
"Configure the given Perl package."
|
2015-01-23 06:18:57 +01:00
|
|
|
(let* ((out (assoc-ref outputs "out"))
|
|
|
|
(args (cond
|
|
|
|
;; Prefer to use Module::Build unless otherwise told
|
|
|
|
((and (file-exists? "Build.PL")
|
|
|
|
(not make-maker?))
|
|
|
|
`("Build.PL" ,(string-append "--prefix=" out)
|
|
|
|
"--installdirs=site" ,@module-build-flags))
|
|
|
|
((file-exists? "Makefile.PL")
|
|
|
|
`("Makefile.PL" ,(string-append "PREFIX=" out)
|
2016-11-23 18:40:53 +01:00
|
|
|
;; Prevent installation of 'perllocal.pod' files for
|
|
|
|
;; determinism. These are typically used to build a
|
|
|
|
;; catalogue of installed packages, but does not provide
|
|
|
|
;; any useful information when installed with a module.
|
|
|
|
"INSTALLDIRS=site" "NO_PERLLOCAL=1" ,@make-maker-flags))
|
2015-01-23 06:18:57 +01:00
|
|
|
(else (error "no Build.PL or Makefile.PL found")))))
|
|
|
|
(format #t "running `perl' with arguments ~s~%" args)
|
|
|
|
(zero? (apply system* "perl" args))))
|
|
|
|
|
|
|
|
(define-syntax-rule (define-w/gnu-fallback* (name args ...) body ...)
|
|
|
|
(define* (name args ... #:rest rest)
|
|
|
|
(if (access? "Build" X_OK)
|
|
|
|
(begin body ...)
|
|
|
|
(apply (assoc-ref gnu:%standard-phases 'name) rest))))
|
|
|
|
|
|
|
|
(define-w/gnu-fallback* (build)
|
|
|
|
(zero? (system* "./Build")))
|
|
|
|
|
|
|
|
(define-w/gnu-fallback* (check #:key target
|
|
|
|
(tests? (not target)) (test-flags '())
|
|
|
|
#:allow-other-keys)
|
|
|
|
(if tests?
|
|
|
|
(zero? (apply system* "./Build" "test" test-flags))
|
|
|
|
(begin
|
|
|
|
(format #t "test suite not run~%")
|
|
|
|
#t)))
|
|
|
|
|
|
|
|
(define-w/gnu-fallback* (install)
|
|
|
|
(zero? (system* "./Build" "install")))
|
2013-03-04 00:41:46 +01:00
|
|
|
|
|
|
|
(define %standard-phases
|
2015-01-23 06:18:57 +01:00
|
|
|
;; Everything is as with the GNU Build System except for the `configure',
|
|
|
|
;; `build', `check', and `install' phases.
|
2015-02-26 23:00:21 +01:00
|
|
|
(modify-phases gnu:%standard-phases
|
utils: 'modify-phases' no longer introduces quotes.
Suggested by Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>.
* guix/build/utils.scm (%modify-phases): Remove quotes.
* guix/build/cmake-build-system.scm (%standard-phases): Adjust
accordingly.
* guix/build/glib-or-gtk-build-system.scm (%standard-phases): Likewise.
* guix/build/gnu-dist.scm (%dist-phases): Likewise.
* guix/build/perl-build-system.scm (%standard-phases): Likewise.
* guix/build/python-build-system.scm (%standard-phases): Likewise.
* guix/build/ruby-build-system.scm (%standard-phases): Likewise.
* guix/build/waf-build-system.scm (%standard-phases): Likewise.
* gnu/packages/bash.scm, gnu/packages/code.scm, gnu/packages/gl.scm,
gnu/packages/gnome.scm, gnu/packages/graphics.scm,
gnu/packages/image.scm, gnu/packages/key-mon.scm,
gnu/packages/ocr.scm, gnu/packages/plotutils.scm,
gnu/packages/search.scm, gnu/packages/video.scm: Likewise.
2015-03-31 22:43:01 +02:00
|
|
|
(replace 'install install)
|
|
|
|
(replace 'check check)
|
|
|
|
(replace 'build build)
|
|
|
|
(replace 'configure configure)))
|
2013-03-04 00:41:46 +01:00
|
|
|
|
|
|
|
(define* (perl-build #:key inputs (phases %standard-phases)
|
|
|
|
#:allow-other-keys #:rest args)
|
|
|
|
"Build the given Perl package, applying all of PHASES in order."
|
|
|
|
(apply gnu:gnu-build
|
|
|
|
#:inputs inputs #:phases phases
|
|
|
|
args))
|
|
|
|
|
|
|
|
;;; perl-build-system.scm ends here
|