gnu: r-mlinterfaces: Update to 1.62.1.
[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 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.65")
102 (source
103 (origin
104 (method url-fetch)
105 (uri (string-append "mirror://savannah/quilt/"
106 name "-" version ".tar.gz"))
107 (sha256
108 (base32
109 "06b816m2gz9jfif7k9v2hrm7fz76zjg5pavf7hd3ifybwn4cgjzn"))
110 (patches (search-patches "quilt-test-fix-regex.patch"
111 "quilt-getopt-second-separator.patch"
112 "quilt-getopt-nondigit-param.patch"))))
113 (build-system gnu-build-system)
114 (native-inputs
115 `(("gettext" ,gnu-gettext)))
116 (inputs `(("perl" ,perl)
117 ("less" ,less)
118 ("file" ,file)
119 ("ed" ,ed)
120 ("diffstat" ,diffstat)))
121 (arguments
122 '(#:parallel-tests? #f
123 #:phases
124 (modify-phases %standard-phases
125 (add-before 'check 'patch-tests
126 (lambda _
127 (substitute*
128 '("test/run"
129 "test/edit.test")
130 (("/bin/sh") (which "sh")))
131 #t))
132 (add-after 'install 'wrap-program
133 ;; quilt's configure checks for the absolute path to the utilities it
134 ;; needs, but uses only the name when invoking them, so we need to
135 ;; make sure the quilt script can find those utilities when run.
136 (lambda* (#:key inputs outputs #:allow-other-keys)
137 (let* ((out (assoc-ref outputs "out"))
138 (coreutils (assoc-ref inputs "coreutils"))
139 (diffutils (assoc-ref inputs "diffutils"))
140 (findutils (assoc-ref inputs "findutils"))
141 (diffstat (assoc-ref inputs "diffstat"))
142 (less (assoc-ref inputs "less"))
143 (file (assoc-ref inputs "file"))
144 (ed (assoc-ref inputs "ed"))
145 (sed (assoc-ref inputs "sed"))
146 (bash (assoc-ref inputs "bash"))
147 (grep (assoc-ref inputs "grep")))
148 (wrap-program (string-append out "/bin/quilt")
149 `("PATH" ":" prefix
150 ,(map (lambda (dir)
151 (string-append dir "/bin"))
152 (list coreutils diffutils findutils
153 less file ed sed bash grep
154 diffstat)))))
155 #t)))))
156 (home-page "https://savannah.nongnu.org/projects/quilt/")
157 (synopsis "Script for managing patches to software")
158 (description
159 "Quilt allows you to easily manage large numbers of patches by keeping
160 track of the changes each patch makes. Patches can be applied, un-applied,
161 refreshed, and more.")
162 (license gpl2)))
163
164 (define-public colordiff
165 (package
166 (name "colordiff")
167 (version "1.0.18")
168 (source
169 (origin
170 (method url-fetch)
171 (uri (list (string-append "https://www.colordiff.org/colordiff-"
172 version ".tar.gz")
173 (string-append "http://www.colordiff.org/archive/colordiff-"
174 version ".tar.gz")))
175 (sha256
176 (base32
177 "1q6n60n4b9fnzccxyxv04mxjsql4ddq17vl2c74ijvjdhpcfrkr9"))))
178 (build-system gnu-build-system)
179 (arguments
180 `(#:tests? #f ; no tests
181 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
182 "INSTALL_DIR=/bin" "MAN_DIR=/share/man/man1")
183 #:phases
184 (modify-phases %standard-phases
185 (delete 'configure) ; no configure script
186 (delete 'build)))) ; nothing to build
187 (inputs
188 `(("perl" ,perl)
189 ("xmlto" ,xmlto)))
190 (home-page "https://www.colordiff.org")
191 (synopsis "Display diff output with colors")
192 (description
193 "Colordiff is Perl script wrapper on top of diff command which provides
194 'syntax highlighting' for various patch formats.")
195 (license gpl2+)))
196
197 (define-public patches
198 (let ((commit "ef1b8a7d954b82ed4af3a08fd63d2085d19090ef"))
199 (package
200 (name "patches")
201 (home-page "https://github.com/stefanha/patches")
202 (version (string-append "0.0-1." (string-take commit 7)))
203 (source (origin
204 (method git-fetch)
205 (uri (git-reference
206 (url home-page)
207 (commit commit)))
208 (sha256
209 (base32
210 "11rdmhv0l1s8nqb20ywmw2zqizczch2p62qf9apyx5wqgxlnjshk"))
211 (file-name (string-append name "-"version "-checkout"))))
212 (build-system python-build-system)
213 (inputs `(("python-notmuch" ,python2-notmuch)))
214 (arguments
215 `(#:tests? #f ;no "test" target
216 #:python ,python-2)) ;not compatible with Python 3
217 (synopsis "Patch tracking tool")
218 (description
219 "@code{Patches} is a patch-tracking tool initially written for the QEMU
220 project. It provides commands that build a database of patches from a mailing
221 list, and commands that can search that database. It allows users to track
222 the status of a patch, apply patches, and search for patches---all that from
223 the command-line or from Emacs via its Notmuch integration.")
224 (license gpl2+))))
225
226 (define-public vbindiff
227 (package
228 (name "vbindiff")
229 (version "3.0_beta5")
230 (source (origin
231 (method url-fetch)
232 (uri (string-append "https://www.cjmweb.net/vbindiff/vbindiff-"
233 version ".tar.gz"))
234 (sha256
235 (base32
236 "1f1kj4jki08bnrwpzi663mjfkrx4wnfpzdfwd2qgijlkx5ysjkgh"))))
237 (build-system gnu-build-system)
238 (inputs
239 `(("ncurses" ,ncurses)))
240 (home-page "https://www.cjmweb.net/vbindiff/")
241 (synopsis "Console-based tool for comparing binary data")
242 (description "Visual Binary Diff (@command{vbindiff}) displays files in
243 hexadecimal and ASCII (or EBCDIC). It can also display two files at once, and
244 highlight the differences between them. It works well with large files (up to 4
245 GiB).")
246 (license gpl2+)))
247
248 (define-public meld
249 (package
250 (name "meld")
251 (version "3.20.0")
252 (source
253 (origin
254 (method url-fetch)
255 (uri (string-append "mirror://gnome/sources/meld/"
256 (version-major+minor version)
257 "/meld-" version ".tar.xz"))
258 (sha256
259 (base32
260 "11khi1sg02k3b9qdag3r939cwi27cql4kjim7jhxf9ckfhpzwh6b"))))
261 (build-system python-build-system)
262 (native-inputs
263 `(("intltool" ,intltool)
264 ("xmllint" ,libxml2)
265 ("glib-compile-schemas" ,glib "bin")
266 ("python-pytest" ,python-pytest)))
267 (inputs
268 `(("python-cairo" ,python-pycairo)
269 ("python-gobject" ,python-pygobject)
270 ("gtksourceview" ,gtksourceview)))
271 (propagated-inputs
272 `(("dconf" ,dconf)))
273 (arguments
274 `(#:phases
275 (modify-phases %standard-phases
276 ;; This setup.py script does not support one of the Python build
277 ;; system's default flags, "--single-version-externally-managed".
278 (replace 'install
279 (lambda* (#:key outputs #:allow-other-keys)
280 (invoke "python" "setup.py"
281 ;; This setup.py runs gtk-update-icon-cache which we don't want.
282 "--no-update-icon-cache"
283 ;; "--no-compile-schemas"
284 "install"
285 (string-append "--prefix=" (assoc-ref outputs "out"))
286 "--root=/")))
287 ;; The tests need to be run after installation.
288 (delete 'check)
289 (add-after 'install 'check
290 (lambda* (#:key inputs outputs #:allow-other-keys)
291 ;; Tests look for installed package
292 (add-installed-pythonpath inputs outputs)
293 ;; The tests fail when HOME=/homeless-shelter.
294 (setenv "HOME" "/tmp")
295 (invoke "py.test" "-v" "-k"
296 ;; TODO: Those tests fail, why?
297 "not test_classify_change_actions"))))))
298 (home-page "https://meldmerge.org/")
299 (synopsis "Compare files, directories and working copies")
300 (description "Meld is a visual diff and merge tool targeted at
301 developers. Meld helps you compare files, directories, and version controlled
302 projects. It provides two- and three-way comparison of both files and
303 directories, and has support for many popular version control systems.
304
305 Meld helps you review code changes and understand patches. It might even help
306 you to figure out what is going on in that merge you keep avoiding.")
307 (license gpl2)))