gnu: Add wl-clipboard.
[jackhill/guix/guix.git] / gnu / packages / patchutils.scm
CommitLineData
8a9d928f 1;;; GNU Guix --- Functional package management for GNU
68faa20e 2;;; Copyright © 2014, 2018 Eric Bavier <bavier@member.fsf.org>
9e286eb1 3;;; Copyright © 2015, 2018 Leo Famulari <leo@famulari.name>
58e3603e 4;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
8a9d928f
EB
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)
3b6eddb2 25 #:use-module (guix git-download)
8a9d928f 26 #:use-module (guix build-system gnu)
3b6eddb2 27 #:use-module (guix build-system python)
8a9d928f
EB
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)
24a80064 34 #:use-module (gnu packages gettext)
8a9d928f 35 #:use-module (gnu packages less)
9e286eb1
LF
36 #:use-module (gnu packages mail)
37 #:use-module (gnu packages ncurses)
285d8f0d 38 #:use-module (gnu packages perl)
3b6eddb2 39 #:use-module (gnu packages python)
d7d1fc82 40 #:use-module (gnu packages version-control)
285d8f0d 41 #:use-module (gnu packages xml))
8a9d928f
EB
42
43(define-public patchutils
44 (package
45 (name "patchutils")
5f230fb2 46 (version "0.3.4")
8a9d928f
EB
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
5f230fb2
EB
54 "0xp8mcfyi5nmb5a2zi5ibmyshxkb1zv1dgmnyn413m7ahgdx8mfg"))
55 (patches (search-patches "patchutils-test-perms.patch"))))
8a9d928f
EB
56 (build-system gnu-build-system)
57 (inputs `(("perl" ,perl)))
58 (arguments
59 '(#:parallel-tests? #f
dc1d3cde
KK
60 #:phases
61 (modify-phases %standard-phases
62 (add-before 'check 'patch-test-scripts
63 (lambda _
5f230fb2
EB
64 (substitute* (find-files "tests" "^run-test$")
65 (("/bin/echo") (which "echo")))
dc1d3cde
KK
66 #t))
67 (add-after 'install 'wrap-program
68 ;; Point installed scripts to the utilities they need.
69 (lambda* (#:key inputs outputs #:allow-other-keys)
70 (let* ((out (assoc-ref outputs "out"))
71 (diffutils (assoc-ref inputs "diffutils"))
72 (sed (assoc-ref inputs "sed"))
73 (gawk (assoc-ref inputs "gawk")))
74 (for-each
75 (lambda (prog)
76 (wrap-program (string-append out "/bin/" prog)
77 `("PATH" ":" prefix
78 ,(map (lambda (dir)
79 (string-append dir "/bin"))
80 (list diffutils sed gawk)))))
81 '("dehtmldiff" "editdiff" "espdiff")))
82 #t)))))
8a9d928f
EB
83 (home-page "http://cyberelk.net/tim/software/patchutils")
84 (synopsis "Collection of tools for manipulating patch files")
85 (description
86 "Patchutils is a collection of programs that can manipulate patch files
87in useful ways such as interpolating between two pre-patches, combining two
88incremental patches, fixing line numbers in hand-edited patches, and simply
89listing the files modified by a patch.")
90 (license gpl2+)))
91
92(define-public quilt
93 (package
94 (name "quilt")
68faa20e 95 (version "0.65")
8a9d928f
EB
96 (source
97 (origin
98 (method url-fetch)
99 (uri (string-append "mirror://savannah/quilt/"
100 name "-" version ".tar.gz"))
101 (sha256
102 (base32
68faa20e 103 "06b816m2gz9jfif7k9v2hrm7fz76zjg5pavf7hd3ifybwn4cgjzn"))
43eb42ef 104 (patches (search-patches "quilt-test-fix-regex.patch"
c16c119d
LC
105 "quilt-getopt-second-separator.patch"
106 "quilt-getopt-nondigit-param.patch"))))
8a9d928f 107 (build-system gnu-build-system)
24a80064
EB
108 (native-inputs
109 `(("gettext" ,gnu-gettext)))
8a9d928f
EB
110 (inputs `(("perl" ,perl)
111 ("less" ,less)
0253ab39 112 ("file" ,file)
d7d1fc82
EB
113 ("ed" ,ed)
114 ("diffstat" ,diffstat)))
8a9d928f
EB
115 (arguments
116 '(#:parallel-tests? #f
dc1d3cde
KK
117 #:phases
118 (modify-phases %standard-phases
119 (add-before 'check 'patch-tests
120 (lambda _
121 (substitute*
122 '("test/run"
123 "test/edit.test")
124 (("/bin/sh") (which "sh")))
dc1d3cde
KK
125 #t))
126 (add-after 'install 'wrap-program
127 ;; quilt's configure checks for the absolute path to the utilities it
128 ;; needs, but uses only the name when invoking them, so we need to
129 ;; make sure the quilt script can find those utilities when run.
130 (lambda* (#:key inputs outputs #:allow-other-keys)
131 (let* ((out (assoc-ref outputs "out"))
132 (coreutils (assoc-ref inputs "coreutils"))
133 (diffutils (assoc-ref inputs "diffutils"))
134 (findutils (assoc-ref inputs "findutils"))
d7d1fc82 135 (diffstat (assoc-ref inputs "diffstat"))
dc1d3cde
KK
136 (less (assoc-ref inputs "less"))
137 (file (assoc-ref inputs "file"))
138 (ed (assoc-ref inputs "ed"))
139 (sed (assoc-ref inputs "sed"))
140 (bash (assoc-ref inputs "bash"))
141 (grep (assoc-ref inputs "grep")))
142 (wrap-program (string-append out "/bin/quilt")
143 `("PATH" ":" prefix
144 ,(map (lambda (dir)
145 (string-append dir "/bin"))
146 (list coreutils diffutils findutils
d7d1fc82
EB
147 less file ed sed bash grep
148 diffstat)))))
dc1d3cde 149 #t)))))
8a9d928f
EB
150 (home-page "https://savannah.nongnu.org/projects/quilt/")
151 (synopsis "Script for managing patches to software")
152 (description
153 "Quilt allows you to easily manage large numbers of patches by keeping
154track of the changes each patch makes. Patches can be applied, un-applied,
155refreshed, and more.")
156 (license gpl2)))
285d8f0d
157
158(define-public colordiff
159 (package
160 (name "colordiff")
58e3603e 161 (version "1.0.18")
285d8f0d 162 (source
8d479d27
LF
163 (origin
164 (method url-fetch)
58e3603e
TGR
165 (uri (list (string-append "https://www.colordiff.org/colordiff-"
166 version ".tar.gz")
167 (string-append "http://www.colordiff.org/archive/colordiff-"
8d479d27 168 version ".tar.gz")))
285d8f0d 169 (sha256
8d479d27 170 (base32
58e3603e 171 "1q6n60n4b9fnzccxyxv04mxjsql4ddq17vl2c74ijvjdhpcfrkr9"))))
285d8f0d
172 (build-system gnu-build-system)
173 (arguments
58e3603e 174 `(#:tests? #f ; no tests
285d8f0d
175 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
176 "INSTALL_DIR=/bin" "MAN_DIR=/share/man/man1")
177 #:phases
dc1d3cde 178 (modify-phases %standard-phases
58e3603e
TGR
179 (delete 'configure) ; no configure script
180 (delete 'build)))) ; nothing to build
285d8f0d
181 (inputs
182 `(("perl" ,perl)
183 ("xmlto" ,xmlto)))
8cccd09d 184 (home-page "https://www.colordiff.org")
285d8f0d
185 (synopsis "Display diff output with colors")
186 (description
187 "Colordiff is Perl script wrapper on top of diff command which provides
188'syntax highlighting' for various patch formats.")
189 (license gpl2+)))
3b6eddb2
LC
190
191(define-public patches
5ca54f41 192 (let ((commit "ef1b8a7d954b82ed4af3a08fd63d2085d19090ef"))
3b6eddb2
LC
193 (package
194 (name "patches")
5ca54f41
LC
195 (home-page "https://github.com/stefanha/patches")
196 (version (string-append "0.0-1." (string-take commit 7)))
3b6eddb2
LC
197 (source (origin
198 (method git-fetch)
199 (uri (git-reference
5ca54f41 200 (url home-page)
3b6eddb2
LC
201 (commit commit)))
202 (sha256
203 (base32
5ca54f41
LC
204 "11rdmhv0l1s8nqb20ywmw2zqizczch2p62qf9apyx5wqgxlnjshk"))
205 (file-name (string-append name "-"version "-checkout"))))
3b6eddb2
LC
206 (build-system python-build-system)
207 (inputs `(("python-notmuch" ,python2-notmuch)))
208 (arguments
209 `(#:tests? #f ;no "test" target
5ca54f41 210 #:python ,python-2)) ;not compatible with Python 3
3b6eddb2
LC
211 (synopsis "Patch tracking tool")
212 (description
213 "'Patches' is a patch-tracking tool initially written for the QEMU
214project. It provides commands that build a database of patches from a mailing
215list, and commands that can search that database. It allows users to track
216the status of a patch, apply patches, and search for patches---all that from
217the command-line or from Emacs via its Notmuch integration.")
218 (license gpl2+))))
9e286eb1
LF
219
220(define-public vbindiff
221 (package
222 (name "vbindiff")
223 (version "3.0_beta5")
224 (source (origin
225 (method url-fetch)
226 (uri (string-append "https://www.cjmweb.net/vbindiff/vbindiff-"
227 version ".tar.gz"))
228 (sha256
229 (base32
230 "1f1kj4jki08bnrwpzi663mjfkrx4wnfpzdfwd2qgijlkx5ysjkgh"))))
231 (build-system gnu-build-system)
232 (inputs
233 `(("ncurses" ,ncurses)))
234 (home-page "https://www.cjmweb.net/vbindiff/")
235 (synopsis "Console-based tool for comparing binary data")
236 (description "Visual Binary Diff (@command{vbindiff}) displays files in
237hexadecimal and ASCII (or EBCDIC). It can also display two files at once, and
238highlight the differences between them. It works well with large files (up to 4
239GiB).")
240 (license gpl2+)))