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>
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 packages)
23 #:use-module (guix licenses)
24 #:use-module (guix download)
25 #:use-module (guix git-download)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system python)
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 gettext)
35 #:use-module (gnu packages less)
36 #:use-module (gnu packages mail)
37 #:use-module (gnu packages ncurses)
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages python)
40 #:use-module (gnu packages version-control)
41 #:use-module (gnu packages xml))
43 (define-public patchutils
50 (uri (string-append "http://cyberelk.net/tim/data/patchutils/stable/"
51 name "-" version ".tar.xz"))
54 "0g5df00cj4nczrmr4k791l7la0sq2wnf8rn981fsrz1f3d2yix4i"))
55 (patches (search-patches "patchutils-xfail-gendiff-tests.patch"))))
56 (build-system gnu-build-system)
57 (inputs `(("perl" ,perl)))
59 '(#:parallel-tests? #f
61 (modify-phases %standard-phases
62 (add-before 'check 'patch-test-scripts
64 (let ((echo (which "echo")))
66 (find-files "tests" "^run-test$")
67 (("/bin/echo") echo)))
69 (add-after 'install 'wrap-program
70 ;; Point installed scripts to the utilities they need.
71 (lambda* (#:key inputs outputs #:allow-other-keys)
72 (let* ((out (assoc-ref outputs "out"))
73 (diffutils (assoc-ref inputs "diffutils"))
74 (sed (assoc-ref inputs "sed"))
75 (gawk (assoc-ref inputs "gawk")))
78 (wrap-program (string-append out "/bin/" prog)
81 (string-append dir "/bin"))
82 (list diffutils sed gawk)))))
83 '("dehtmldiff" "editdiff" "espdiff")))
85 (home-page "http://cyberelk.net/tim/software/patchutils")
86 (synopsis "Collection of tools for manipulating patch files")
88 "Patchutils is a collection of programs that can manipulate patch files
89 in useful ways such as interpolating between two pre-patches, combining two
90 incremental patches, fixing line numbers in hand-edited patches, and simply
91 listing the files modified by a patch.")
101 (uri (string-append "mirror://savannah/quilt/"
102 name "-" version ".tar.gz"))
105 "06b816m2gz9jfif7k9v2hrm7fz76zjg5pavf7hd3ifybwn4cgjzn"))
106 (patches (search-patches "quilt-test-fix-regex.patch"
107 "quilt-compat-getopt-fix-second-separator.patch"
108 "quilt-compat-getopt-fix-option-with-nondigit-param.patch"))))
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 "'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