2013-08-24 11:17:06 -04:00
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2020-06-17 09:18:34 -04:00
|
|
|
;;; Copyright © 2013, 2015, 2020 Ludovic Courtès <ludo@gnu.org>
|
2018-03-16 03:16:11 -04:00
|
|
|
;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
|
2013-08-24 11:17:06 -04: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 gnu-dist)
|
|
|
|
#:use-module (guix build utils)
|
|
|
|
#:use-module (guix build gnu-build-system)
|
|
|
|
#:use-module (srfi srfi-1)
|
|
|
|
#:export (%dist-phases))
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
;;;
|
|
|
|
;;; Build phases to build a source tarball with the GNU build system, as with
|
|
|
|
;;; "make distcheck".
|
|
|
|
;;;
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(define* (build #:key build-before-dist? make-flags (dist-target "distcheck")
|
|
|
|
#:allow-other-keys
|
|
|
|
#:rest args)
|
2018-03-16 03:16:11 -04:00
|
|
|
(when build-before-dist?
|
|
|
|
(let ((build (assq-ref %standard-phases 'build)))
|
|
|
|
(apply build args)))
|
|
|
|
(format #t "building target `~a'~%" dist-target)
|
|
|
|
(apply invoke "make" dist-target make-flags))
|
2013-08-24 11:17:06 -04:00
|
|
|
|
|
|
|
(define* (install-dist #:key outputs #:allow-other-keys)
|
|
|
|
(let* ((out (assoc-ref outputs "out"))
|
|
|
|
(meta (string-append out "/nix-support")) ; Hydra meta-data
|
|
|
|
(tarballs (find-files "." "\\.tar\\.")))
|
|
|
|
(mkdir out)
|
|
|
|
(for-each (lambda (tarball)
|
|
|
|
(copy-file tarball (string-append out "/" tarball)))
|
|
|
|
out)
|
|
|
|
#t))
|
|
|
|
|
|
|
|
(define %dist-phases
|
|
|
|
;; Phases for building a source tarball.
|
2015-02-26 17:00:21 -05:00
|
|
|
(modify-phases %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 16:43:01 -04:00
|
|
|
(delete 'strip)
|
|
|
|
(replace 'install install-dist)
|
2020-06-17 09:23:32 -04:00
|
|
|
(replace 'build build)))
|
2013-08-24 11:17:06 -04:00
|
|
|
|
|
|
|
;;; gnu-dist.scm ends here
|