gnu: mono: Make build reproducible.
[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 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))
42
43 (define-public patchutils
44 (package
45 (name "patchutils")
46 (version "0.3.3")
47 (source
48 (origin
49 (method url-fetch)
50 (uri (string-append "http://cyberelk.net/tim/data/patchutils/stable/"
51 name "-" version ".tar.xz"))
52 (sha256
53 (base32
54 "0g5df00cj4nczrmr4k791l7la0sq2wnf8rn981fsrz1f3d2yix4i"))
55 (patches (search-patches "patchutils-xfail-gendiff-tests.patch"))))
56 (build-system gnu-build-system)
57 (inputs `(("perl" ,perl)))
58 (arguments
59 '(#:parallel-tests? #f
60 #:phases
61 (modify-phases %standard-phases
62 (add-before 'check 'patch-test-scripts
63 (lambda _
64 (let ((echo (which "echo")))
65 (substitute*
66 (find-files "tests" "^run-test$")
67 (("/bin/echo") echo)))
68 #t))
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")))
76 (for-each
77 (lambda (prog)
78 (wrap-program (string-append out "/bin/" prog)
79 `("PATH" ":" prefix
80 ,(map (lambda (dir)
81 (string-append dir "/bin"))
82 (list diffutils sed gawk)))))
83 '("dehtmldiff" "editdiff" "espdiff")))
84 #t)))))
85 (home-page "http://cyberelk.net/tim/software/patchutils")
86 (synopsis "Collection of tools for manipulating patch files")
87 (description
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.")
92 (license gpl2+)))
93
94 (define-public quilt
95 (package
96 (name "quilt")
97 (version "0.65")
98 (source
99 (origin
100 (method url-fetch)
101 (uri (string-append "mirror://savannah/quilt/"
102 name "-" version ".tar.gz"))
103 (sha256
104 (base32
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)
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 "'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+)))