gnu: jemalloc: Build with gcc-4.8 on i686.
[jackhill/guix/guix.git] / gnu / packages / patchutils.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
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.
10 ;;;
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.
15 ;;;
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/>.
18
19 (define-module (gnu packages patchutils)
20 #:use-module (guix packages)
21 #:use-module (guix licenses)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages ed)
26 #:use-module (gnu packages base)
27 #:use-module (gnu packages bash)
28 #:use-module (gnu packages file)
29 #:use-module (gnu packages gawk)
30 #:use-module (gnu packages less)
31 #:use-module (gnu packages perl)
32 #:use-module (gnu packages xml))
33
34 (define-public patchutils
35 (package
36 (name "patchutils")
37 (version "0.3.3")
38 (source
39 (origin
40 (method url-fetch)
41 (uri (string-append "http://cyberelk.net/tim/data/patchutils/stable/"
42 name "-" version ".tar.xz"))
43 (sha256
44 (base32
45 "0g5df00cj4nczrmr4k791l7la0sq2wnf8rn981fsrz1f3d2yix4i"))
46 (patches
47 (list (search-patch "patchutils-xfail-gendiff-tests.patch")))))
48 (build-system gnu-build-system)
49 (inputs `(("perl" ,perl)))
50 (arguments
51 '(#:parallel-tests? #f
52 #:phases (alist-cons-before
53 'check 'patch-test-scripts
54 (lambda _
55 (let ((echo (which "echo")))
56 (substitute*
57 (find-files "tests" "^run-test$")
58 (("/bin/echo") echo))))
59 (alist-cons-after
60 'install 'wrap-program
61 ;; Point installed scripts to the utilities they need.
62 (lambda* (#:key inputs outputs #:allow-other-keys)
63 (let* ((out (assoc-ref outputs "out"))
64 (diffutils (assoc-ref inputs "diffutils"))
65 (sed (assoc-ref inputs "sed"))
66 (gawk (assoc-ref inputs "gawk")))
67 (for-each
68 (lambda (prog)
69 (wrap-program (string-append out "/bin/" prog)
70 `("PATH" ":" prefix
71 ,(map (lambda (dir)
72 (string-append dir "/bin"))
73 (list diffutils sed gawk)))))
74 '("dehtmldiff" "editdiff" "espdiff"))))
75 %standard-phases))))
76 (home-page "http://cyberelk.net/tim/software/patchutils")
77 (synopsis "Collection of tools for manipulating patch files")
78 (description
79 "Patchutils is a collection of programs that can manipulate patch files
80 in useful ways such as interpolating between two pre-patches, combining two
81 incremental patches, fixing line numbers in hand-edited patches, and simply
82 listing the files modified by a patch.")
83 (license gpl2+)))
84
85 (define-public quilt
86 (package
87 (name "quilt")
88 (version "0.61")
89 (source
90 (origin
91 (method url-fetch)
92 (uri (string-append "mirror://savannah/quilt/"
93 name "-" version ".tar.gz"))
94 (sha256
95 (base32
96 "1hwz58djkq9cv46sjwxbp2v5m8yjr41kd0nm1zm1xm6418khmv0y"))))
97 (build-system gnu-build-system)
98 (inputs `(("perl" ,perl)
99 ("less" ,less)
100 ("file" ,file)
101 ("ed" ,ed)))
102 (arguments
103 '(#:parallel-tests? #f
104 #:phases
105 (alist-cons-before
106 'check 'patch-tests
107 (lambda _
108 (substitute*
109 '("test/run"
110 "test/edit.test")
111 (("/bin/sh") (which "sh")))
112 ;; TODO: Run the mail tests once the mail feature can be supported.
113 (delete-file "test/mail.test"))
114 (alist-cons-after
115 'install 'wrap-program
116 ;; quilt's configure checks for the absolute path to the utilities it
117 ;; needs, but uses only the name when invoking them, so we need to
118 ;; make sure the quilt script can find those utilities when run.
119 (lambda* (#:key inputs outputs #:allow-other-keys)
120 (let* ((out (assoc-ref outputs "out"))
121 (coreutils (assoc-ref inputs "coreutils"))
122 (diffutils (assoc-ref inputs "diffutils"))
123 (findutils (assoc-ref inputs "findutils"))
124 (less (assoc-ref inputs "less"))
125 (file (assoc-ref inputs "file"))
126 (ed (assoc-ref inputs "ed"))
127 (sed (assoc-ref inputs "sed"))
128 (bash (assoc-ref inputs "bash"))
129 (grep (assoc-ref inputs "grep")))
130 (wrap-program (string-append out "/bin/quilt")
131 `("PATH" ":" prefix
132 ,(map (lambda (dir)
133 (string-append dir "/bin"))
134 (list coreutils diffutils findutils
135 less file ed sed bash grep))))))
136 %standard-phases))))
137 (home-page "https://savannah.nongnu.org/projects/quilt/")
138 (synopsis "Script for managing patches to software")
139 (description
140 "Quilt allows you to easily manage large numbers of patches by keeping
141 track of the changes each patch makes. Patches can be applied, un-applied,
142 refreshed, and more.")
143 (license gpl2)))
144
145 (define-public colordiff
146 (package
147 (name "colordiff")
148 (version "1.0.13")
149 (source
150 (origin
151 (method url-fetch)
152 (uri (string-append "http://www.colordiff.org/colordiff-"
153 version ".tar.gz"))
154 (sha256
155 (base32 "0akcz1p3klsjnhwcqdfq4grs6paljc5c0jzr3mqla5f862hhaa6f"))))
156 (build-system gnu-build-system)
157 (arguments
158 `(#:tests? #f
159 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
160 "INSTALL_DIR=/bin" "MAN_DIR=/share/man/man1")
161 #:phases
162 (alist-delete 'configure
163 (alist-delete 'build %standard-phases))))
164 (inputs
165 `(("perl" ,perl)
166 ("xmlto" ,xmlto)))
167 (home-page "http://www.colordiff.org")
168 (synopsis "Display diff output with colors")
169 (description
170 "Colordiff is Perl script wrapper on top of diff command which provides
171 'syntax highlighting' for various patch formats.")
172 (license gpl2+)))