gnu: python-pandas: Fix build on 32-bit.
[jackhill/guix/guix.git] / gnu / packages / dejagnu.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flasher.co.il>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages dejagnu)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module (guix licenses)
25 #:use-module (gnu packages tcl))
26
27 (define-public dejagnu
28 (package
29 (name "dejagnu")
30 (version "1.6")
31 (source
32 (origin
33 (method url-fetch)
34 (uri (string-append "mirror://gnu/dejagnu/dejagnu-"
35 version ".tar.gz"))
36 (sha256
37 (base32
38 "0qypaakd2065jgpcv84zcsibl8gph3p334gb2qdmhsrbirhlmdh0"))))
39 (build-system gnu-build-system)
40 (inputs `(("expect" ,expect)))
41 (arguments
42 '(#:phases
43 (modify-phases %standard-phases
44 (replace 'check
45 (lambda _
46 ;; Note: The test-suite *requires* /dev/pts among the
47 ;; `build-chroot-dirs' of the build daemon when
48 ;; building in a chroot. See
49 ;; <http://thread.gmane.org/gmane.linux.distributions.nixos/1036>
50 ;; for details.
51 (if (and (directory-exists? "/dev/pts")
52 (directory-exists? "/proc"))
53 (begin
54 ;; Provide `runtest' with a log name, otherwise it
55 ;; tries to run `whoami', which fails when in a chroot.
56 (setenv "LOGNAME" "guix-builder")
57
58 ;; The test-suite needs to have a non-empty stdin:
59 ;; <http://lists.gnu.org/archive/html/bug-dejagnu/2003-06/msg00002.html>.
60 (zero?
61 (system "make check < /dev/zero")))
62 (begin
63 (display "test suite cannot be run, skipping\n")
64 #t))))
65 (add-after 'install 'post-install
66 (lambda* (#:key inputs outputs #:allow-other-keys)
67 ;; Use the right `expect' binary.
68 (let ((out (assoc-ref outputs "out"))
69 (expect (assoc-ref inputs "expect")))
70 (substitute* (string-append out "/bin/runtest")
71 (("^mypath.*$" all)
72 (string-append all
73 "export PATH="
74 expect "/bin:$PATH\n")))))))))
75 (home-page
76 "https://www.gnu.org/software/dejagnu/")
77 (synopsis "GNU software testing framework")
78 (description
79 "DejaGnu is a framework for testing software. In effect, it serves as
80 a front-end for all tests written for a program. Thus, each program can have
81 multiple test suites, which are then all managed by a single harness.")
82 (license gpl3+)))