1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages patchutils)
20 #:use-module (guix packages)
21 #:use-module (guix licenses)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages ed)
26 #:use-module (gnu packages base)
27 #:use-module (gnu packages bash)
28 #:use-module (gnu packages file)
29 #:use-module (gnu packages gawk)
30 #:use-module (gnu packages less)
31 #:use-module (gnu packages perl)
32 #:use-module (gnu packages xml))
34 (define-public patchutils
41 (uri (string-append "http://cyberelk.net/tim/data/patchutils/stable/"
42 name "-" version ".tar.xz"))
45 "0g5df00cj4nczrmr4k791l7la0sq2wnf8rn981fsrz1f3d2yix4i"))
47 (list (search-patch "patchutils-xfail-gendiff-tests.patch")))))
48 (build-system gnu-build-system)
49 (inputs `(("perl" ,perl)))
51 '(#:parallel-tests? #f
52 #:phases (alist-cons-before
53 'check 'patch-test-scripts
55 (let ((echo (which "echo")))
57 (find-files "tests" "^run-test$")
58 (("/bin/echo") echo))))
60 'install 'wrap-program
61 ;; Point installed scripts to the utilities they need.
62 (lambda* (#:key inputs outputs #:allow-other-keys)
63 (let* ((out (assoc-ref outputs "out"))
64 (diffutils (assoc-ref inputs "diffutils"))
65 (sed (assoc-ref inputs "sed"))
66 (gawk (assoc-ref inputs "gawk")))
69 (wrap-program (string-append out "/bin/" prog)
72 (string-append dir "/bin"))
73 (list diffutils sed gawk)))))
74 '("dehtmldiff" "editdiff" "espdiff"))))
76 (home-page "http://cyberelk.net/tim/software/patchutils")
77 (synopsis "Collection of tools for manipulating patch files")
79 "Patchutils is a collection of programs that can manipulate patch files
80 in useful ways such as interpolating between two pre-patches, combining two
81 incremental patches, fixing line numbers in hand-edited patches, and simply
82 listing the files modified by a patch.")
92 (uri (string-append "mirror://savannah/quilt/"
93 name "-" version ".tar.gz"))
96 "1hwz58djkq9cv46sjwxbp2v5m8yjr41kd0nm1zm1xm6418khmv0y"))))
97 (build-system gnu-build-system)
98 (inputs `(("perl" ,perl)
103 '(#:parallel-tests? #f
111 (("/bin/sh") (which "sh")))
112 ;; TODO: Run the mail tests once the mail feature can be supported.
113 (delete-file "test/mail.test"))
115 'install 'wrap-program
116 ;; quilt's configure checks for the absolute path to the utilities it
117 ;; needs, but uses only the name when invoking them, so we need to
118 ;; make sure the quilt script can find those utilities when run.
119 (lambda* (#:key inputs outputs #:allow-other-keys)
120 (let* ((out (assoc-ref outputs "out"))
121 (coreutils (assoc-ref inputs "coreutils"))
122 (diffutils (assoc-ref inputs "diffutils"))
123 (findutils (assoc-ref inputs "findutils"))
124 (less (assoc-ref inputs "less"))
125 (file (assoc-ref inputs "file"))
126 (ed (assoc-ref inputs "ed"))
127 (sed (assoc-ref inputs "sed"))
128 (bash (assoc-ref inputs "bash"))
129 (grep (assoc-ref inputs "grep")))
130 (wrap-program (string-append out "/bin/quilt")
133 (string-append dir "/bin"))
134 (list coreutils diffutils findutils
135 less file ed sed bash grep))))))
137 (home-page "https://savannah.nongnu.org/projects/quilt/")
138 (synopsis "Script for managing patches to software")
140 "Quilt allows you to easily manage large numbers of patches by keeping
141 track of the changes each patch makes. Patches can be applied, un-applied,
142 refreshed, and more.")
145 (define-public colordiff
152 (uri (string-append "http://www.colordiff.org/colordiff-"
155 (base32 "0akcz1p3klsjnhwcqdfq4grs6paljc5c0jzr3mqla5f862hhaa6f"))))
156 (build-system gnu-build-system)
159 #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
160 "INSTALL_DIR=/bin" "MAN_DIR=/share/man/man1")
162 (alist-delete 'configure
163 (alist-delete 'build %standard-phases))))
167 (home-page "http://www.colordiff.org")
168 (synopsis "Display diff output with colors")
170 "Colordiff is Perl script wrapper on top of diff command which provides
171 'syntax highlighting' for various patch formats.")