diff options
| author | Eric Bavier <bavier@member.fsf.org> | 2014-04-07 11:15:48 -0500 |
|---|---|---|
| committer | Eric Bavier <bavier@member.fsf.org> | 2014-04-07 20:41:25 -0500 |
| commit | 8a9d928f57bd37bc2ff2742bee280962ffb9bc21 (patch) | |
| tree | 5f5b4e0e33beedb6d3903f4a6c77a9cf10a50afa /gnu/packages/patchutils.scm | |
| parent | ce0849cc25e7d0813f1fec82cd97fe3aadf9932b (diff) | |
gnu: Add patchutils and quilt
* gnu/packages/patchutils.scm: New file
* gnu/packages/patches/patchutils-xfail-gendiff-tests.patch: New patch
* gnu-system.am (GNU_SYSTEM_MODULES): Add patchutils.
(dist_patch_DATA): Add patch.
Diffstat (limited to 'gnu/packages/patchutils.scm')
| -rw-r--r-- | gnu/packages/patchutils.scm | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm new file mode 100644 index 00000000000..48f4d295848 --- /dev/null +++ b/gnu/packages/patchutils.scm | |||
| @@ -0,0 +1,142 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | ||
| 2 | ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> | ||
| 3 | ;;; | ||
| 4 | ;;; This file is part of GNU Guix. | ||
| 5 | ;;; | ||
| 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. | ||
| 10 | ;;; | ||
| 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. | ||
| 15 | ;;; | ||
| 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/>. | ||
| 18 | |||
| 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 | |||
| 33 | (define-public patchutils | ||
| 34 | (package | ||
| 35 | (name "patchutils") | ||
| 36 | (version "0.3.3") | ||
| 37 | (source | ||
| 38 | (origin | ||
| 39 | (method url-fetch) | ||
| 40 | (uri (string-append "http://cyberelk.net/tim/data/patchutils/stable/" | ||
| 41 | name "-" version ".tar.xz")) | ||
| 42 | (sha256 | ||
| 43 | (base32 | ||
| 44 | "0g5df00cj4nczrmr4k791l7la0sq2wnf8rn981fsrz1f3d2yix4i")) | ||
| 45 | (patches | ||
| 46 | (list (search-patch "patchutils-xfail-gendiff-tests.patch"))))) | ||
| 47 | (build-system gnu-build-system) | ||
| 48 | (inputs `(("perl" ,perl))) | ||
| 49 | (arguments | ||
| 50 | '(#:parallel-tests? #f | ||
| 51 | #:phases (alist-cons-before | ||
| 52 | 'check 'patch-test-scripts | ||
| 53 | (lambda _ | ||
| 54 | (let ((echo (which "echo"))) | ||
| 55 | (substitute* | ||
| 56 | (find-files "tests" "^run-test$") | ||
| 57 | (("/bin/echo") echo)))) | ||
| 58 | (alist-cons-after | ||
| 59 | 'install 'wrap-program | ||
| 60 | ;; Point installed scripts to the utilities they need. | ||
| 61 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 62 | (let* ((out (assoc-ref outputs "out")) | ||
| 63 | (diffutils (assoc-ref inputs "diffutils")) | ||
| 64 | (sed (assoc-ref inputs "sed")) | ||
| 65 | (gawk (assoc-ref inputs "gawk"))) | ||
| 66 | (for-each | ||
| 67 | (lambda (prog) | ||
| 68 | (wrap-program (string-append out "/bin/" prog) | ||
| 69 | `("PATH" ":" prefix | ||
| 70 | ,(map (lambda (dir) | ||
| 71 | (string-append dir "/bin")) | ||
| 72 | (list diffutils sed gawk))))) | ||
| 73 | '("dehtmldiff" "editdiff" "espdiff")))) | ||
| 74 | %standard-phases)))) | ||
| 75 | (home-page "http://cyberelk.net/tim/software/patchutils") | ||
| 76 | (synopsis "Collection of tools for manipulating patch files") | ||
| 77 | (description | ||
| 78 | "Patchutils is a collection of programs that can manipulate patch files | ||
| 79 | in useful ways such as interpolating between two pre-patches, combining two | ||
| 80 | incremental patches, fixing line numbers in hand-edited patches, and simply | ||
| 81 | listing the files modified by a patch.") | ||
| 82 | (license gpl2+))) | ||
| 83 | |||
| 84 | (define-public quilt | ||
| 85 | (package | ||
| 86 | (name "quilt") | ||
| 87 | (version "0.61") | ||
| 88 | (source | ||
| 89 | (origin | ||
| 90 | (method url-fetch) | ||
| 91 | (uri (string-append "mirror://savannah/quilt/" | ||
| 92 | name "-" version ".tar.gz")) | ||
| 93 | (sha256 | ||
| 94 | (base32 | ||
| 95 | "1hwz58djkq9cv46sjwxbp2v5m8yjr41kd0nm1zm1xm6418khmv0y")))) | ||
| 96 | (build-system gnu-build-system) | ||
| 97 | (inputs `(("perl" ,perl) | ||
| 98 | ("less" ,less) | ||
| 99 | ("file" ,file) | ||
| 100 | ("ed" ,ed))) | ||
| 101 | (arguments | ||
| 102 | '(#:parallel-tests? #f | ||
| 103 | #:phases | ||
| 104 | (alist-cons-before | ||
| 105 | 'check 'patch-tests | ||
| 106 | (lambda _ | ||
| 107 | (substitute* | ||
| 108 | '("test/run" | ||
| 109 | "test/edit.test") | ||
| 110 | (("/bin/sh") (which "sh"))) | ||
| 111 | ;; TODO: Run the mail tests once the mail feature can be supported. | ||
| 112 | (delete-file "test/mail.test")) | ||
| 113 | (alist-cons-after | ||
| 114 | 'install 'wrap-program | ||
| 115 | ;; quilt's configure checks for the absolute path to the utilities it | ||
| 116 | ;; needs, but uses only the name when invoking them, so we need to | ||
| 117 | ;; make sure the quilt script can find those utilities when run. | ||
| 118 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 119 | (let* ((out (assoc-ref outputs "out")) | ||
| 120 | (coreutils (assoc-ref inputs "coreutils")) | ||
| 121 | (diffutils (assoc-ref inputs "diffutils")) | ||
| 122 | (findutils (assoc-ref inputs "findutils")) | ||
| 123 | (less (assoc-ref inputs "less")) | ||
| 124 | (file (assoc-ref inputs "file")) | ||
| 125 | (ed (assoc-ref inputs "ed")) | ||
| 126 | (sed (assoc-ref inputs "sed")) | ||
| 127 | (bash (assoc-ref inputs "bash")) | ||
| 128 | (grep (assoc-ref inputs "grep"))) | ||
| 129 | (wrap-program (string-append out "/bin/quilt") | ||
| 130 | `("PATH" ":" prefix | ||
| 131 | ,(map (lambda (dir) | ||
| 132 | (string-append dir "/bin")) | ||
| 133 | (list coreutils diffutils findutils | ||
| 134 | less file ed sed bash grep)))))) | ||
| 135 | %standard-phases)))) | ||
| 136 | (home-page "https://savannah.nongnu.org/projects/quilt/") | ||
| 137 | (synopsis "Script for managing patches to software") | ||
| 138 | (description | ||
| 139 | "Quilt allows you to easily manage large numbers of patches by keeping | ||
| 140 | track of the changes each patch makes. Patches can be applied, un-applied, | ||
| 141 | refreshed, and more.") | ||
| 142 | (license gpl2))) | ||
