quilt: Upgrade to 0.65.
[jackhill/guix/guix.git] / gnu / packages / patchutils.scm
CommitLineData
8a9d928f 1;;; GNU Guix --- Functional package management for GNU
68faa20e 2;;; Copyright © 2014, 2018 Eric Bavier <bavier@member.fsf.org>
9e286eb1 3;;; Copyright © 2015, 2018 Leo Famulari <leo@famulari.name>
58e3603e 4;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
8a9d928f
EB
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages patchutils)
22 #:use-module (guix packages)
23 #:use-module (guix licenses)
24 #:use-module (guix download)
3b6eddb2 25 #:use-module (guix git-download)
8a9d928f 26 #:use-module (guix build-system gnu)
3b6eddb2 27 #:use-module (guix build-system python)
8a9d928f
EB
28 #:use-module (gnu packages)
29 #:use-module (gnu packages ed)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages bash)
32 #:use-module (gnu packages file)
33 #:use-module (gnu packages gawk)
34 #:use-module (gnu packages less)
9e286eb1
LF
35 #:use-module (gnu packages mail)
36 #:use-module (gnu packages ncurses)
285d8f0d 37 #:use-module (gnu packages perl)
3b6eddb2 38 #:use-module (gnu packages python)
285d8f0d 39 #:use-module (gnu packages xml))
8a9d928f
EB
40
41(define-public patchutils
42 (package
43 (name "patchutils")
44 (version "0.3.3")
45 (source
46 (origin
47 (method url-fetch)
48 (uri (string-append "http://cyberelk.net/tim/data/patchutils/stable/"
49 name "-" version ".tar.xz"))
50 (sha256
51 (base32
52 "0g5df00cj4nczrmr4k791l7la0sq2wnf8rn981fsrz1f3d2yix4i"))
fc1adab1 53 (patches (search-patches "patchutils-xfail-gendiff-tests.patch"))))
8a9d928f
EB
54 (build-system gnu-build-system)
55 (inputs `(("perl" ,perl)))
56 (arguments
57 '(#:parallel-tests? #f
dc1d3cde
KK
58 #:phases
59 (modify-phases %standard-phases
60 (add-before 'check 'patch-test-scripts
61 (lambda _
62 (let ((echo (which "echo")))
63 (substitute*
64 (find-files "tests" "^run-test$")
65 (("/bin/echo") echo)))
66 #t))
67 (add-after 'install 'wrap-program
68 ;; Point installed scripts to the utilities they need.
69 (lambda* (#:key inputs outputs #:allow-other-keys)
70 (let* ((out (assoc-ref outputs "out"))
71 (diffutils (assoc-ref inputs "diffutils"))
72 (sed (assoc-ref inputs "sed"))
73 (gawk (assoc-ref inputs "gawk")))
74 (for-each
75 (lambda (prog)
76 (wrap-program (string-append out "/bin/" prog)
77 `("PATH" ":" prefix
78 ,(map (lambda (dir)
79 (string-append dir "/bin"))
80 (list diffutils sed gawk)))))
81 '("dehtmldiff" "editdiff" "espdiff")))
82 #t)))))
8a9d928f
EB
83 (home-page "http://cyberelk.net/tim/software/patchutils")
84 (synopsis "Collection of tools for manipulating patch files")
85 (description
86 "Patchutils is a collection of programs that can manipulate patch files
87in useful ways such as interpolating between two pre-patches, combining two
88incremental patches, fixing line numbers in hand-edited patches, and simply
89listing the files modified by a patch.")
90 (license gpl2+)))
91
92(define-public quilt
93 (package
94 (name "quilt")
68faa20e 95 (version "0.65")
8a9d928f
EB
96 (source
97 (origin
98 (method url-fetch)
99 (uri (string-append "mirror://savannah/quilt/"
100 name "-" version ".tar.gz"))
101 (sha256
102 (base32
68faa20e
EB
103 "06b816m2gz9jfif7k9v2hrm7fz76zjg5pavf7hd3ifybwn4cgjzn"))
104 (patches (search-patches "quilt-test-fix-regex.patch"))))
8a9d928f
EB
105 (build-system gnu-build-system)
106 (inputs `(("perl" ,perl)
107 ("less" ,less)
0253ab39 108 ("file" ,file)
8a9d928f
EB
109 ("ed" ,ed)))
110 (arguments
111 '(#:parallel-tests? #f
dc1d3cde
KK
112 #:phases
113 (modify-phases %standard-phases
114 (add-before 'check 'patch-tests
115 (lambda _
116 (substitute*
117 '("test/run"
118 "test/edit.test")
119 (("/bin/sh") (which "sh")))
68faa20e
EB
120 (substitute* "test/create-delete.test"
121 ;; We'd rather use quilt's compat/getopt than declare a
122 ;; dependency on util-linux, but this test fails because of
123 ;; compat/getopt's handling of "---" in this test, so remove it
124 ;; for now.
125 ((" ---") ""))
126 (substitute* '("test/empty-files.test" "test/faildiff.test")
127 ;; compat/getopt seems not to handle splitting of short opts
128 ;; from its arguments.
129 (("-pab") "-p ab"))
dc1d3cde
KK
130 #t))
131 (add-after 'install 'wrap-program
132 ;; quilt's configure checks for the absolute path to the utilities it
133 ;; needs, but uses only the name when invoking them, so we need to
134 ;; make sure the quilt script can find those utilities when run.
135 (lambda* (#:key inputs outputs #:allow-other-keys)
136 (let* ((out (assoc-ref outputs "out"))
137 (coreutils (assoc-ref inputs "coreutils"))
138 (diffutils (assoc-ref inputs "diffutils"))
139 (findutils (assoc-ref inputs "findutils"))
140 (less (assoc-ref inputs "less"))
141 (file (assoc-ref inputs "file"))
142 (ed (assoc-ref inputs "ed"))
143 (sed (assoc-ref inputs "sed"))
144 (bash (assoc-ref inputs "bash"))
145 (grep (assoc-ref inputs "grep")))
146 (wrap-program (string-append out "/bin/quilt")
147 `("PATH" ":" prefix
148 ,(map (lambda (dir)
149 (string-append dir "/bin"))
150 (list coreutils diffutils findutils
151 less file ed sed bash grep)))))
152 #t)))))
8a9d928f
EB
153 (home-page "https://savannah.nongnu.org/projects/quilt/")
154 (synopsis "Script for managing patches to software")
155 (description
156 "Quilt allows you to easily manage large numbers of patches by keeping
157track of the changes each patch makes. Patches can be applied, un-applied,
158refreshed, and more.")
159 (license gpl2)))
285d8f0d
160
161(define-public colordiff
162 (package
163 (name "colordiff")
58e3603e 164 (version "1.0.18")
285d8f0d 165 (source
8d479d27
LF
166 (origin
167 (method url-fetch)
58e3603e
TGR
168 (uri (list (string-append "https://www.colordiff.org/colordiff-"
169 version ".tar.gz")
170 (string-append "http://www.colordiff.org/archive/colordiff-"
8d479d27 171 version ".tar.gz")))
285d8f0d 172 (sha256
8d479d27 173 (base32
58e3603e 174 "1q6n60n4b9fnzccxyxv04mxjsql4ddq17vl2c74ijvjdhpcfrkr9"))))
285d8f0d
175 (build-system gnu-build-system)
176 (arguments
58e3603e 177 `(#:tests? #f ; no tests
285d8f0d
178 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
179 "INSTALL_DIR=/bin" "MAN_DIR=/share/man/man1")
180 #:phases
dc1d3cde 181 (modify-phases %standard-phases
58e3603e
TGR
182 (delete 'configure) ; no configure script
183 (delete 'build)))) ; nothing to build
285d8f0d
184 (inputs
185 `(("perl" ,perl)
186 ("xmlto" ,xmlto)))
8cccd09d 187 (home-page "https://www.colordiff.org")
285d8f0d
188 (synopsis "Display diff output with colors")
189 (description
190 "Colordiff is Perl script wrapper on top of diff command which provides
191'syntax highlighting' for various patch formats.")
192 (license gpl2+)))
3b6eddb2
LC
193
194(define-public patches
5ca54f41 195 (let ((commit "ef1b8a7d954b82ed4af3a08fd63d2085d19090ef"))
3b6eddb2
LC
196 (package
197 (name "patches")
5ca54f41
LC
198 (home-page "https://github.com/stefanha/patches")
199 (version (string-append "0.0-1." (string-take commit 7)))
3b6eddb2
LC
200 (source (origin
201 (method git-fetch)
202 (uri (git-reference
5ca54f41 203 (url home-page)
3b6eddb2
LC
204 (commit commit)))
205 (sha256
206 (base32
5ca54f41
LC
207 "11rdmhv0l1s8nqb20ywmw2zqizczch2p62qf9apyx5wqgxlnjshk"))
208 (file-name (string-append name "-"version "-checkout"))))
3b6eddb2
LC
209 (build-system python-build-system)
210 (inputs `(("python-notmuch" ,python2-notmuch)))
211 (arguments
212 `(#:tests? #f ;no "test" target
5ca54f41 213 #:python ,python-2)) ;not compatible with Python 3
3b6eddb2
LC
214 (synopsis "Patch tracking tool")
215 (description
216 "'Patches' is a patch-tracking tool initially written for the QEMU
217project. It provides commands that build a database of patches from a mailing
218list, and commands that can search that database. It allows users to track
219the status of a patch, apply patches, and search for patches---all that from
220the command-line or from Emacs via its Notmuch integration.")
221 (license gpl2+))))
9e286eb1
LF
222
223(define-public vbindiff
224 (package
225 (name "vbindiff")
226 (version "3.0_beta5")
227 (source (origin
228 (method url-fetch)
229 (uri (string-append "https://www.cjmweb.net/vbindiff/vbindiff-"
230 version ".tar.gz"))
231 (sha256
232 (base32
233 "1f1kj4jki08bnrwpzi663mjfkrx4wnfpzdfwd2qgijlkx5ysjkgh"))))
234 (build-system gnu-build-system)
235 (inputs
236 `(("ncurses" ,ncurses)))
237 (home-page "https://www.cjmweb.net/vbindiff/")
238 (synopsis "Console-based tool for comparing binary data")
239 (description "Visual Binary Diff (@command{vbindiff}) displays files in
240hexadecimal and ASCII (or EBCDIC). It can also display two files at once, and
241highlight the differences between them. It works well with large files (up to 4
242GiB).")
243 (license gpl2+)))