gnu: quilt: Update to 0.66.
[jackhill/guix/guix.git] / gnu / packages / patchutils.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2018 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2015, 2018 Leo Famulari <leo@famulari.name>
4 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
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 utils)
23 #:use-module (guix packages)
24 #:use-module (guix licenses)
25 #:use-module (guix download)
26 #:use-module (guix git-download)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system python)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages ed)
31 #:use-module (gnu packages base)
32 #:use-module (gnu packages bash)
33 #:use-module (gnu packages check)
34 #:use-module (gnu packages file)
35 #:use-module (gnu packages gawk)
36 #:use-module (gnu packages gettext)
37 #:use-module (gnu packages glib)
38 #:use-module (gnu packages gnome)
39 #:use-module (gnu packages gtk)
40 #:use-module (gnu packages less)
41 #:use-module (gnu packages mail)
42 #:use-module (gnu packages ncurses)
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages python-xyz)
46 #:use-module (gnu packages version-control)
47 #:use-module (gnu packages xml))
48
49 (define-public patchutils
50 (package
51 (name "patchutils")
52 (version "0.3.4")
53 (source
54 (origin
55 (method url-fetch)
56 (uri (string-append "http://cyberelk.net/tim/data/patchutils/stable/"
57 name "-" version ".tar.xz"))
58 (sha256
59 (base32
60 "0xp8mcfyi5nmb5a2zi5ibmyshxkb1zv1dgmnyn413m7ahgdx8mfg"))
61 (patches (search-patches "patchutils-test-perms.patch"))))
62 (build-system gnu-build-system)
63 (inputs `(("perl" ,perl)))
64 (arguments
65 '(#:parallel-tests? #f
66 #:phases
67 (modify-phases %standard-phases
68 (add-before 'check 'patch-test-scripts
69 (lambda _
70 (substitute* (find-files "tests" "^run-test$")
71 (("/bin/echo") (which "echo")))
72 #t))
73 (add-after 'install 'wrap-program
74 ;; Point installed scripts to the utilities they need.
75 (lambda* (#:key inputs outputs #:allow-other-keys)
76 (let* ((out (assoc-ref outputs "out"))
77 (diffutils (assoc-ref inputs "diffutils"))
78 (sed (assoc-ref inputs "sed"))
79 (gawk (assoc-ref inputs "gawk")))
80 (for-each
81 (lambda (prog)
82 (wrap-program (string-append out "/bin/" prog)
83 `("PATH" ":" prefix
84 ,(map (lambda (dir)
85 (string-append dir "/bin"))
86 (list diffutils sed gawk)))))
87 '("dehtmldiff" "editdiff" "espdiff")))
88 #t)))))
89 (home-page "http://cyberelk.net/tim/software/patchutils")
90 (synopsis "Collection of tools for manipulating patch files")
91 (description
92 "Patchutils is a collection of programs that can manipulate patch files
93 in useful ways such as interpolating between two pre-patches, combining two
94 incremental patches, fixing line numbers in hand-edited patches, and simply
95 listing the files modified by a patch.")
96 (license gpl2+)))
97
98 (define-public quilt
99 (package
100 (name "quilt")
101 (version "0.66")
102 (source
103 (origin
104 (method url-fetch)
105 (uri (string-append "mirror://savannah/quilt/"
106 "quilt-" version ".tar.gz"))
107 (sha256
108 (base32 "01vfvk4pqigahx82fhaaffg921ivd3k7rylz1yfvy4zbdyd32jri"))))
109 (build-system gnu-build-system)
110 (native-inputs
111 `(("gettext" ,gnu-gettext)))
112 (inputs `(("perl" ,perl)
113 ("less" ,less)
114 ("file" ,file)
115 ("ed" ,ed)
116 ("diffstat" ,diffstat)))
117 (arguments
118 '(#:parallel-tests? #f
119 #:phases
120 (modify-phases %standard-phases
121 (add-before 'check 'patch-tests
122 (lambda _
123 (substitute*
124 '("test/run"
125 "test/edit.test")
126 (("/bin/sh") (which "sh")))
127 #t))
128 (add-after 'install 'wrap-program
129 ;; quilt's configure checks for the absolute path to the utilities it
130 ;; needs, but uses only the name when invoking them, so we need to
131 ;; make sure the quilt script can find those utilities when run.
132 (lambda* (#:key inputs outputs #:allow-other-keys)
133 (let* ((out (assoc-ref outputs "out"))
134 (coreutils (assoc-ref inputs "coreutils"))
135 (diffutils (assoc-ref inputs "diffutils"))
136 (findutils (assoc-ref inputs "findutils"))
137 (diffstat (assoc-ref inputs "diffstat"))
138 (less (assoc-ref inputs "less"))
139 (file (assoc-ref inputs "file"))
140 (ed (assoc-ref inputs "ed"))
141 (sed (assoc-ref inputs "sed"))
142 (bash (assoc-ref inputs "bash"))
143 (grep (assoc-ref inputs "grep")))
144 (wrap-program (string-append out "/bin/quilt")
145 `("PATH" ":" prefix
146 ,(map (lambda (dir)
147 (string-append dir "/bin"))
148 (list coreutils diffutils findutils
149 less file ed sed bash grep
150 diffstat)))))
151 #t)))))
152 (home-page "https://savannah.nongnu.org/projects/quilt/")
153 (synopsis "Script for managing patches to software")
154 (description
155 "Quilt allows you to easily manage large numbers of patches by keeping
156 track of the changes each patch makes. Patches can be applied, un-applied,
157 refreshed, and more.")
158 (license gpl2)))
159
160 (define-public colordiff
161 (package
162 (name "colordiff")
163 (version "1.0.18")
164 (source
165 (origin
166 (method url-fetch)
167 (uri (list (string-append "https://www.colordiff.org/colordiff-"
168 version ".tar.gz")
169 (string-append "http://www.colordiff.org/archive/colordiff-"
170 version ".tar.gz")))
171 (sha256
172 (base32
173 "1q6n60n4b9fnzccxyxv04mxjsql4ddq17vl2c74ijvjdhpcfrkr9"))))
174 (build-system gnu-build-system)
175 (arguments
176 `(#:tests? #f ; no tests
177 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
178 "INSTALL_DIR=/bin" "MAN_DIR=/share/man/man1")
179 #:phases
180 (modify-phases %standard-phases
181 (delete 'configure) ; no configure script
182 (delete 'build)))) ; nothing to build
183 (inputs
184 `(("perl" ,perl)
185 ("xmlto" ,xmlto)))
186 (home-page "https://www.colordiff.org")
187 (synopsis "Display diff output with colors")
188 (description
189 "Colordiff is Perl script wrapper on top of diff command which provides
190 'syntax highlighting' for various patch formats.")
191 (license gpl2+)))
192
193 (define-public patches
194 (let ((commit "ef1b8a7d954b82ed4af3a08fd63d2085d19090ef"))
195 (package
196 (name "patches")
197 (home-page "https://github.com/stefanha/patches")
198 (version (string-append "0.0-1." (string-take commit 7)))
199 (source (origin
200 (method git-fetch)
201 (uri (git-reference
202 (url home-page)
203 (commit commit)))
204 (sha256
205 (base32
206 "11rdmhv0l1s8nqb20ywmw2zqizczch2p62qf9apyx5wqgxlnjshk"))
207 (file-name (string-append name "-"version "-checkout"))))
208 (build-system python-build-system)
209 (inputs `(("python-notmuch" ,python2-notmuch)))
210 (arguments
211 `(#:tests? #f ;no "test" target
212 #:python ,python-2)) ;not compatible with Python 3
213 (synopsis "Patch tracking tool")
214 (description
215 "@code{Patches} is a patch-tracking tool initially written for the QEMU
216 project. It provides commands that build a database of patches from a mailing
217 list, and commands that can search that database. It allows users to track
218 the status of a patch, apply patches, and search for patches---all that from
219 the command-line or from Emacs via its Notmuch integration.")
220 (license gpl2+))))
221
222 (define-public vbindiff
223 (package
224 (name "vbindiff")
225 (version "3.0_beta5")
226 (source (origin
227 (method url-fetch)
228 (uri (string-append "https://www.cjmweb.net/vbindiff/vbindiff-"
229 version ".tar.gz"))
230 (sha256
231 (base32
232 "1f1kj4jki08bnrwpzi663mjfkrx4wnfpzdfwd2qgijlkx5ysjkgh"))))
233 (build-system gnu-build-system)
234 (inputs
235 `(("ncurses" ,ncurses)))
236 (home-page "https://www.cjmweb.net/vbindiff/")
237 (synopsis "Console-based tool for comparing binary data")
238 (description "Visual Binary Diff (@command{vbindiff}) displays files in
239 hexadecimal and ASCII (or EBCDIC). It can also display two files at once, and
240 highlight the differences between them. It works well with large files (up to 4
241 GiB).")
242 (license gpl2+)))
243
244 (define-public meld
245 (package
246 (name "meld")
247 (version "3.20.1")
248 (source
249 (origin
250 (method url-fetch)
251 (uri (string-append "mirror://gnome/sources/meld/"
252 (version-major+minor version)
253 "/meld-" version ".tar.xz"))
254 (sha256
255 (base32 "0jdj7kd6vj1mdc16gvrj1kar88b2j5875ajq18fx7cbc9ny46j55"))))
256 (build-system python-build-system)
257 (native-inputs
258 `(("intltool" ,intltool)
259 ("xmllint" ,libxml2)
260 ("glib-compile-schemas" ,glib "bin")
261 ("python-pytest" ,python-pytest)))
262 (inputs
263 `(("python-cairo" ,python-pycairo)
264 ("python-gobject" ,python-pygobject)
265 ("gtksourceview" ,gtksourceview)))
266 (propagated-inputs
267 `(("dconf" ,dconf)))
268 (arguments
269 `(#:phases
270 (modify-phases %standard-phases
271 ;; This setup.py script does not support one of the Python build
272 ;; system's default flags, "--single-version-externally-managed".
273 (replace 'install
274 (lambda* (#:key outputs #:allow-other-keys)
275 (invoke "python" "setup.py"
276 ;; This setup.py runs gtk-update-icon-cache which we don't want.
277 "--no-update-icon-cache"
278 ;; "--no-compile-schemas"
279 "install"
280 (string-append "--prefix=" (assoc-ref outputs "out"))
281 "--root=/")))
282 ;; The tests need to be run after installation.
283 (delete 'check)
284 (add-after 'install 'check
285 (lambda* (#:key inputs outputs #:allow-other-keys)
286 ;; Tests look for installed package
287 (add-installed-pythonpath inputs outputs)
288 ;; The tests fail when HOME=/homeless-shelter.
289 (setenv "HOME" "/tmp")
290 (invoke "py.test" "-v" "-k"
291 ;; TODO: Those tests fail, why?
292 "not test_classify_change_actions"))))))
293 (home-page "https://meldmerge.org/")
294 (synopsis "Compare files, directories and working copies")
295 (description "Meld is a visual diff and merge tool targeted at
296 developers. Meld helps you compare files, directories, and version controlled
297 projects. It provides two- and three-way comparison of both files and
298 directories, and has support for many popular version control systems.
299
300 Meld helps you review code changes and understand patches. It might even help
301 you to figure out what is going on in that merge you keep avoiding.")
302 (license gpl2)))