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>
6 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
49 (define-public patchutils
56 (uri (string-append "http://cyberelk.net/tim/data/patchutils/stable/"
57 name "-" version ".tar.xz"))
60 "0xp8mcfyi5nmb5a2zi5ibmyshxkb1zv1dgmnyn413m7ahgdx8mfg"))
61 (patches (search-patches "patchutils-test-perms.patch"))))
62 (build-system gnu-build-system)
63 (inputs `(("perl" ,perl)))
65 '(#:parallel-tests? #f
67 (modify-phases %standard-phases
68 (add-before 'check 'patch-test-scripts
70 (substitute* (find-files "tests" "^run-test$")
71 (("/bin/echo") (which "echo")))
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")))
82 (wrap-program (string-append out "/bin/" prog)
85 (string-append dir "/bin"))
86 (list diffutils sed gawk)))))
87 '("dehtmldiff" "editdiff" "espdiff")))
89 (home-page "http://cyberelk.net/tim/software/patchutils")
90 (synopsis "Collection of tools for manipulating patch files")
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.")
105 (uri (string-append "mirror://savannah/quilt/"
106 "quilt-" version ".tar.gz"))
108 (base32 "01vfvk4pqigahx82fhaaffg921ivd3k7rylz1yfvy4zbdyd32jri"))))
109 (build-system gnu-build-system)
111 `(("gettext" ,gnu-gettext)))
112 (inputs `(("perl" ,perl)
116 ("diffstat" ,diffstat)))
118 '(#:parallel-tests? #f
120 (modify-phases %standard-phases
121 (add-before 'check 'patch-tests
126 (("/bin/sh") (which "sh")))
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")
147 (string-append dir "/bin"))
148 (list coreutils diffutils findutils
149 less file ed sed bash grep
152 (home-page "https://savannah.nongnu.org/projects/quilt/")
153 (synopsis "Script for managing patches to software")
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.")
160 (define-public colordiff
167 (uri (list (string-append "https://www.colordiff.org/colordiff-"
169 (string-append "http://www.colordiff.org/archive/colordiff-"
173 "1q6n60n4b9fnzccxyxv04mxjsql4ddq17vl2c74ijvjdhpcfrkr9"))))
174 (build-system gnu-build-system)
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")
180 (modify-phases %standard-phases
181 (delete 'configure) ; no configure script
182 (delete 'build)))) ; nothing to build
186 (home-page "https://www.colordiff.org")
187 (synopsis "Display diff output with colors")
189 "Colordiff is Perl script wrapper on top of diff command which provides
190 'syntax highlighting' for various patch formats.")
193 (define-public patches
194 (let ((commit "ef1b8a7d954b82ed4af3a08fd63d2085d19090ef"))
197 (home-page "https://github.com/stefanha/patches")
198 (version (string-append "0.0-1." (string-take commit 7)))
206 "11rdmhv0l1s8nqb20ywmw2zqizczch2p62qf9apyx5wqgxlnjshk"))
207 (file-name (string-append name "-"version "-checkout"))))
208 (build-system python-build-system)
209 (inputs `(("python-notmuch" ,python2-notmuch)))
211 `(#:tests? #f ;no "test" target
212 #:python ,python-2)) ;not compatible with Python 3
213 (synopsis "Patch tracking tool")
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.")
222 (define-public vbindiff
225 (version "3.0_beta5")
228 (uri (string-append "https://www.cjmweb.net/vbindiff/vbindiff-"
232 "1f1kj4jki08bnrwpzi663mjfkrx4wnfpzdfwd2qgijlkx5ysjkgh"))))
233 (build-system gnu-build-system)
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
251 (uri (string-append "mirror://gnome/sources/meld/"
252 (version-major+minor version)
253 "/meld-" version ".tar.xz"))
255 (base32 "0jdj7kd6vj1mdc16gvrj1kar88b2j5875ajq18fx7cbc9ny46j55"))))
256 (build-system python-build-system)
258 `(("intltool" ,intltool)
260 ("glib-compile-schemas" ,glib "bin")
261 ("python-pytest" ,python-pytest)))
263 `(("python-cairo" ,python-pycairo)
264 ("python-gobject" ,python-pygobject)
265 ("gtksourceview" ,gtksourceview)))
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".
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"
280 (string-append "--prefix=" (assoc-ref outputs "out"))
282 ;; The tests need to be run after installation.
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.
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.")