| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 |
|
| 22 | (define-module (gnu packages patchutils)
|
| 23 | #:use-module (guix utils)
|
| 24 | #:use-module (guix packages)
|
| 25 | #:use-module (guix licenses)
|
| 26 | #:use-module (guix download)
|
| 27 | #:use-module (guix git-download)
|
| 28 | #:use-module (guix build-system gnu)
|
| 29 | #:use-module (guix build-system python)
|
| 30 | #:use-module (gnu packages)
|
| 31 | #:use-module (gnu packages ed)
|
| 32 | #:use-module (gnu packages base)
|
| 33 | #:use-module (gnu packages bash)
|
| 34 | #:use-module (gnu packages check)
|
| 35 | #:use-module (gnu packages databases)
|
| 36 | #:use-module (gnu packages django)
|
| 37 | #:use-module (gnu packages file)
|
| 38 | #:use-module (gnu packages gawk)
|
| 39 | #:use-module (gnu packages gettext)
|
| 40 | #:use-module (gnu packages glib)
|
| 41 | #:use-module (gnu packages gnome)
|
| 42 | #:use-module (gnu packages gtk)
|
| 43 | #:use-module (gnu packages less)
|
| 44 | #:use-module (gnu packages mail)
|
| 45 | #:use-module (gnu packages ncurses)
|
| 46 | #:use-module (gnu packages perl)
|
| 47 | #:use-module (gnu packages python)
|
| 48 | #:use-module (gnu packages python-xyz)
|
| 49 | #:use-module (gnu packages version-control)
|
| 50 | #:use-module (gnu packages xml))
|
| 51 |
|
| 52 | (define-public patchutils
|
| 53 | (package
|
| 54 | (name "patchutils")
|
| 55 | (version "0.3.4")
|
| 56 | (source
|
| 57 | (origin
|
| 58 | (method url-fetch)
|
| 59 | (uri (string-append "http://cyberelk.net/tim/data/patchutils/stable/"
|
| 60 | name "-" version ".tar.xz"))
|
| 61 | (sha256
|
| 62 | (base32
|
| 63 | "0xp8mcfyi5nmb5a2zi5ibmyshxkb1zv1dgmnyn413m7ahgdx8mfg"))
|
| 64 | (patches (search-patches "patchutils-test-perms.patch"))))
|
| 65 | (build-system gnu-build-system)
|
| 66 | (inputs `(("perl" ,perl)))
|
| 67 | (arguments
|
| 68 | '(#:parallel-tests? #f
|
| 69 | #:phases
|
| 70 | (modify-phases %standard-phases
|
| 71 | (add-before 'check 'patch-test-scripts
|
| 72 | (lambda _
|
| 73 | (substitute* (find-files "tests" "^run-test$")
|
| 74 | (("/bin/echo") (which "echo")))
|
| 75 | #t))
|
| 76 | (add-after 'install 'wrap-program
|
| 77 | |
| 78 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 79 | (let* ((out (assoc-ref outputs "out"))
|
| 80 | (diffutils (assoc-ref inputs "diffutils"))
|
| 81 | (sed (assoc-ref inputs "sed"))
|
| 82 | (gawk (assoc-ref inputs "gawk")))
|
| 83 | (for-each
|
| 84 | (lambda (prog)
|
| 85 | (wrap-program (string-append out "/bin/" prog)
|
| 86 | `("PATH" ":" prefix
|
| 87 | ,(map (lambda (dir)
|
| 88 | (string-append dir "/bin"))
|
| 89 | (list diffutils sed gawk)))))
|
| 90 | '("dehtmldiff" "editdiff" "espdiff")))
|
| 91 | #t)))))
|
| 92 | (home-page "http://cyberelk.net/tim/software/patchutils")
|
| 93 | (synopsis "Collection of tools for manipulating patch files")
|
| 94 | (description
|
| 95 | "Patchutils is a collection of programs that can manipulate patch files
|
| 96 | in useful ways such as interpolating between two pre-patches, combining two
|
| 97 | incremental patches, fixing line numbers in hand-edited patches, and simply
|
| 98 | listing the files modified by a patch.")
|
| 99 | (license gpl2+)))
|
| 100 |
|
| 101 | (define-public quilt
|
| 102 | (package
|
| 103 | (name "quilt")
|
| 104 | (version "0.66")
|
| 105 | (source
|
| 106 | (origin
|
| 107 | (method url-fetch)
|
| 108 | (uri (string-append "mirror://savannah/quilt/"
|
| 109 | "quilt-" version ".tar.gz"))
|
| 110 | (sha256
|
| 111 | (base32 "01vfvk4pqigahx82fhaaffg921ivd3k7rylz1yfvy4zbdyd32jri"))))
|
| 112 | (build-system gnu-build-system)
|
| 113 | (native-inputs
|
| 114 | `(("gettext" ,gettext-minimal)))
|
| 115 | (inputs `(("perl" ,perl)
|
| 116 | ("less" ,less)
|
| 117 | ("file" ,file)
|
| 118 | ("ed" ,ed)
|
| 119 | ("diffstat" ,diffstat)))
|
| 120 | (arguments
|
| 121 | '(#:parallel-tests? #f
|
| 122 | #:phases
|
| 123 | (modify-phases %standard-phases
|
| 124 | (add-before 'check 'patch-tests
|
| 125 | (lambda _
|
| 126 | (substitute*
|
| 127 | '("test/run"
|
| 128 | "test/edit.test")
|
| 129 | (("/bin/sh") (which "sh")))
|
| 130 | #t))
|
| 131 | (add-after 'install 'wrap-program
|
| 132 | |
| 133 | |
| 134 | |
| 135 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 136 | (let* ((out (assoc-ref outputs "out"))
|
| 137 | (coreutils (assoc-ref inputs "coreutils"))
|
| 138 | (diffutils (assoc-ref inputs "diffutils"))
|
| 139 | (findutils (assoc-ref inputs "findutils"))
|
| 140 | (diffstat (assoc-ref inputs "diffstat"))
|
| 141 | (less (assoc-ref inputs "less"))
|
| 142 | (file (assoc-ref inputs "file"))
|
| 143 | (ed (assoc-ref inputs "ed"))
|
| 144 | (sed (assoc-ref inputs "sed"))
|
| 145 | (bash (assoc-ref inputs "bash"))
|
| 146 | (grep (assoc-ref inputs "grep")))
|
| 147 | (wrap-program (string-append out "/bin/quilt")
|
| 148 | `("PATH" ":" prefix
|
| 149 | ,(map (lambda (dir)
|
| 150 | (string-append dir "/bin"))
|
| 151 | (list coreutils diffutils findutils
|
| 152 | less file ed sed bash grep
|
| 153 | diffstat)))))
|
| 154 | #t)))))
|
| 155 | (home-page "https://savannah.nongnu.org/projects/quilt/")
|
| 156 | (synopsis "Script for managing patches to software")
|
| 157 | (description
|
| 158 | "Quilt allows you to easily manage large numbers of patches by keeping
|
| 159 | track of the changes each patch makes. Patches can be applied, un-applied,
|
| 160 | refreshed, and more.")
|
| 161 | (license gpl2)))
|
| 162 |
|
| 163 | (define-public colordiff
|
| 164 | (package
|
| 165 | (name "colordiff")
|
| 166 | (version "1.0.19")
|
| 167 | (source
|
| 168 | (origin
|
| 169 | (method url-fetch)
|
| 170 | (uri (list (string-append "https://www.colordiff.org/colordiff-"
|
| 171 | version ".tar.gz")
|
| 172 | (string-append "http://www.colordiff.org/archive/colordiff-"
|
| 173 | version ".tar.gz")))
|
| 174 | (sha256
|
| 175 | (base32 "069vzzgs7b44bmfh3ks2psrdb26s1w19gp9w4xxbgi7nhx6w3s26"))))
|
| 176 | (build-system gnu-build-system)
|
| 177 | (arguments
|
| 178 | `(#:tests? #f |
| 179 | #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
|
| 180 | "INSTALL_DIR=/bin" "MAN_DIR=/share/man/man1")
|
| 181 | #:phases
|
| 182 | (modify-phases %standard-phases
|
| 183 | (delete 'configure) |
| 184 | (delete 'build)))) |
| 185 | (inputs
|
| 186 | `(("perl" ,perl)
|
| 187 | ("xmlto" ,xmlto)))
|
| 188 | (home-page "https://www.colordiff.org")
|
| 189 | (synopsis "Display diff output with colors")
|
| 190 | (description
|
| 191 | "Colordiff is Perl script wrapper on top of diff command which provides
|
| 192 | 'syntax highlighting' for various patch formats.")
|
| 193 | (license gpl2+)))
|
| 194 |
|
| 195 | (define-public patches
|
| 196 | (let ((commit "ef1b8a7d954b82ed4af3a08fd63d2085d19090ef"))
|
| 197 | (package
|
| 198 | (name "patches")
|
| 199 | (home-page "https://github.com/stefanha/patches")
|
| 200 | (version (string-append "0.0-1." (string-take commit 7)))
|
| 201 | (source (origin
|
| 202 | (method git-fetch)
|
| 203 | (uri (git-reference
|
| 204 | (url home-page)
|
| 205 | (commit commit)))
|
| 206 | (sha256
|
| 207 | (base32
|
| 208 | "11rdmhv0l1s8nqb20ywmw2zqizczch2p62qf9apyx5wqgxlnjshk"))
|
| 209 | (file-name (string-append name "-"version "-checkout"))))
|
| 210 | (build-system python-build-system)
|
| 211 | (inputs `(("python-notmuch" ,python2-notmuch)))
|
| 212 | (arguments
|
| 213 | `(#:tests? #f |
| 214 | #:python ,python-2)) |
| 215 | (synopsis "Patch tracking tool")
|
| 216 | (description
|
| 217 | "@code{Patches} is a patch-tracking tool initially written for the QEMU
|
| 218 | project. It provides commands that build a database of patches from a mailing
|
| 219 | list, and commands that can search that database. It allows users to track
|
| 220 | the status of a patch, apply patches, and search for patches---all that from
|
| 221 | the command-line or from Emacs via its Notmuch integration.")
|
| 222 | (license gpl2+))))
|
| 223 |
|
| 224 | (define-public vbindiff
|
| 225 | (package
|
| 226 | (name "vbindiff")
|
| 227 | (version "3.0_beta5")
|
| 228 | (source (origin
|
| 229 | (method url-fetch)
|
| 230 | (uri (string-append "https://www.cjmweb.net/vbindiff/vbindiff-"
|
| 231 | version ".tar.gz"))
|
| 232 | (sha256
|
| 233 | (base32
|
| 234 | "1f1kj4jki08bnrwpzi663mjfkrx4wnfpzdfwd2qgijlkx5ysjkgh"))))
|
| 235 | (build-system gnu-build-system)
|
| 236 | (inputs
|
| 237 | `(("ncurses" ,ncurses)))
|
| 238 | (home-page "https://www.cjmweb.net/vbindiff/")
|
| 239 | (synopsis "Console-based tool for comparing binary data")
|
| 240 | (description "Visual Binary Diff (@command{vbindiff}) displays files in
|
| 241 | hexadecimal and ASCII (or EBCDIC). It can also display two files at once, and
|
| 242 | highlight the differences between them. It works well with large files (up to 4
|
| 243 | GiB).")
|
| 244 | (license gpl2+)))
|
| 245 |
|
| 246 | (define-public meld
|
| 247 | (package
|
| 248 | (name "meld")
|
| 249 | (version "3.20.2")
|
| 250 | (source
|
| 251 | (origin
|
| 252 | (method url-fetch)
|
| 253 | (uri (string-append "mirror://gnome/sources/meld/"
|
| 254 | (version-major+minor version)
|
| 255 | "/meld-" version ".tar.xz"))
|
| 256 | (sha256
|
| 257 | (base32 "0a0x156zr3w2yg0rnhwy39giy3xnfm6sqcfa4xcw4i6ahvwqa2dc"))))
|
| 258 | (build-system python-build-system)
|
| 259 | (native-inputs
|
| 260 | `(("intltool" ,intltool)
|
| 261 | ("xmllint" ,libxml2)
|
| 262 | ("glib-compile-schemas" ,glib "bin")
|
| 263 | ("python-pytest" ,python-pytest)))
|
| 264 | (inputs
|
| 265 | `(("python-cairo" ,python-pycairo)
|
| 266 | ("python-gobject" ,python-pygobject)
|
| 267 | ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
|
| 268 | ("gtksourceview" ,gtksourceview-3)))
|
| 269 | (propagated-inputs
|
| 270 | `(("dconf" ,dconf)))
|
| 271 | (arguments
|
| 272 | `(#:imported-modules ((guix build glib-or-gtk-build-system)
|
| 273 | ,@%python-build-system-modules)
|
| 274 | #:modules ((guix build python-build-system)
|
| 275 | ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
|
| 276 | (guix build utils))
|
| 277 | #:phases
|
| 278 | (modify-phases %standard-phases
|
| 279 | |
| 280 | |
| 281 | (replace 'install
|
| 282 | (lambda* (#:key outputs #:allow-other-keys)
|
| 283 | (invoke "python" "setup.py"
|
| 284 | |
| 285 | "--no-update-icon-cache"
|
| 286 | |
| 287 | "install"
|
| 288 | (string-append "--prefix=" (assoc-ref outputs "out"))
|
| 289 | "--root=/")))
|
| 290 | |
| 291 | (delete 'check)
|
| 292 | (add-after 'install 'check
|
| 293 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 294 | |
| 295 | (add-installed-pythonpath inputs outputs)
|
| 296 | |
| 297 | (setenv "HOME" "/tmp")
|
| 298 | (invoke "py.test" "-v" "-k"
|
| 299 | |
| 300 | "not test_classify_change_actions")))
|
| 301 | (add-after 'wrap 'glib-or-gtk-wrap
|
| 302 | (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
|
| 303 | (add-after 'wrap 'wrap-typelib
|
| 304 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 305 | (let ((out (assoc-ref outputs "out")))
|
| 306 | (wrap-program (string-append out "/bin/meld")
|
| 307 | `("GI_TYPELIB_PATH" prefix
|
| 308 | ,(search-path-as-string->list (getenv "GI_TYPELIB_PATH"))))
|
| 309 | #t))))))
|
| 310 | (home-page "https://meldmerge.org/")
|
| 311 | (synopsis "Compare files, directories and working copies")
|
| 312 | (description "Meld is a visual diff and merge tool targeted at
|
| 313 | developers. Meld helps you compare files, directories, and version controlled
|
| 314 | projects. It provides two- and three-way comparison of both files and
|
| 315 | directories, and has support for many popular version control systems.
|
| 316 |
|
| 317 | Meld helps you review code changes and understand patches. It might even help
|
| 318 | you to figure out what is going on in that merge you keep avoiding.")
|
| 319 | (license gpl2)))
|
| 320 |
|
| 321 | (define-public patchwork
|
| 322 | (package
|
| 323 | (name "patchwork")
|
| 324 | (version "2.1.5")
|
| 325 | (source (origin
|
| 326 | (method git-fetch)
|
| 327 | (uri (git-reference
|
| 328 | (url "https://github.com/getpatchwork/patchwork")
|
| 329 | (commit (string-append "v" version))))
|
| 330 | (file-name (git-file-name name version))
|
| 331 | (sha256
|
| 332 | (base32
|
| 333 | "1n4hfwlgmw6mj5kp261zfx47mgb0l7g2yzl1rf0rnm8x69lr3as6"))))
|
| 334 | (build-system python-build-system)
|
| 335 | (arguments
|
| 336 | `( |
| 337 | #:tests? #f
|
| 338 | #:phases
|
| 339 | (modify-phases %standard-phases
|
| 340 | (delete 'configure)
|
| 341 | (delete 'build)
|
| 342 | (add-after 'unpack 'replace-wsgi.py
|
| 343 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 344 | (delete-file "patchwork/wsgi.py")
|
| 345 | (call-with-output-file "patchwork/wsgi.py"
|
| 346 | (lambda (port)
|
| 347 | |
| 348 | |
| 349 | |
| 350 | (define pythonpath
|
| 351 | (string-append (getenv "PYTHONPATH")
|
| 352 | ":"
|
| 353 | (site-packages inputs outputs)))
|
| 354 | (display
|
| 355 | (string-append "
|
| 356 | import os, sys
|
| 357 |
|
| 358 | sys.path.extend('" pythonpath "'.split(':'))
|
| 359 |
|
| 360 | from django.core.wsgi import get_wsgi_application
|
| 361 |
|
| 362 | # By default, assume that patchwork is running as a Guix service, which
|
| 363 | # provides the settings as the 'guix.patchwork.settings' Python module.
|
| 364 | #
|
| 365 | # When using httpd, it's hard to set environment variables, so rely on the
|
| 366 | # default set here.
|
| 367 | os.environ['DJANGO_SETTINGS_MODULE'] = os.getenv(
|
| 368 | 'DJANGO_SETTINGS_MODULE',
|
| 369 | 'guix.patchwork.settings' # default
|
| 370 | )
|
| 371 |
|
| 372 | application = get_wsgi_application()\n") port)))))
|
| 373 | (replace 'check
|
| 374 | (lambda* (#:key tests? #:allow-other-keys)
|
| 375 | (when tests?
|
| 376 | (setenv "DJANGO_SETTINGS_MODULE" "patchwork.settings.dev")
|
| 377 | (invoke "python" "-Wonce" "./manage.py" "test" "--noinput"))
|
| 378 | #t))
|
| 379 | (replace 'install
|
| 380 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 381 | (let ((out (assoc-ref outputs "out"))
|
| 382 | (out-site-packages (site-packages inputs outputs)))
|
| 383 | (for-each (lambda (directory)
|
| 384 | (copy-recursively
|
| 385 | directory
|
| 386 | (string-append out-site-packages directory)))
|
| 387 | '( |
| 388 | "patchwork"
|
| 389 | |
| 390 | "templates"))
|
| 391 | (delete-file-recursively
|
| 392 | (string-append out-site-packages "patchwork/tests"))
|
| 393 |
|
| 394 | |
| 395 | (for-each (lambda (file)
|
| 396 | (install-file file (string-append out "/bin")))
|
| 397 | (list
|
| 398 | (string-append out-site-packages
|
| 399 | "patchwork/bin/pwclient")
|
| 400 | (string-append out-site-packages
|
| 401 | "patchwork/bin/parsemail.sh")
|
| 402 | (string-append out-site-packages
|
| 403 | "patchwork/bin/parsemail-batch.sh")))
|
| 404 |
|
| 405 | |
| 406 | |
| 407 | |
| 408 | (let ((template-pwclient (string-append
|
| 409 | out-site-packages
|
| 410 | "patchwork/templates/patchwork/pwclient")))
|
| 411 | (delete-file template-pwclient)
|
| 412 | (copy-file (string-append out-site-packages
|
| 413 | "patchwork/bin/pwclient")
|
| 414 | template-pwclient))
|
| 415 |
|
| 416 | |
| 417 | |
| 418 | |
| 419 | |
| 420 | |
| 421 | |
| 422 | |
| 423 | |
| 424 | (let ((static-root
|
| 425 | (string-append out "/share/patchwork/htdocs")))
|
| 426 | (mkdir-p static-root)
|
| 427 | (copy-file "patchwork/settings/production.example.py"
|
| 428 | "patchwork/settings/assets.py")
|
| 429 | (setenv "DJANGO_SECRET_KEY" "dummyvalue")
|
| 430 | (setenv "DJANGO_SETTINGS_MODULE" "patchwork.settings.assets")
|
| 431 | (setenv "STATIC_ROOT" static-root)
|
| 432 | (invoke "./manage.py" "collectstatic" "--no-input"))
|
| 433 |
|
| 434 | |
| 435 | |
| 436 | (copy-recursively "lib"
|
| 437 | (string-append
|
| 438 | out "/share/doc/" ,name "-" ,version)))
|
| 439 | #t))
|
| 440 | |
| 441 | (add-after 'install 'install-hasher
|
| 442 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 443 | (let* ((out (assoc-ref outputs "out"))
|
| 444 | (out-site-packages (site-packages inputs outputs))
|
| 445 | (out-hasher.py (string-append out-site-packages
|
| 446 | "/patchwork/hasher.py")))
|
| 447 | (chmod out-hasher.py #o555)
|
| 448 | (symlink out-hasher.py (string-append out "/bin/hasher")))
|
| 449 | #t))
|
| 450 | |
| 451 | |
| 452 | (add-after 'install 'install-patchwork-admin
|
| 453 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 454 | (let* ((out (assoc-ref outputs "out")))
|
| 455 | (mkdir-p (string-append out "/bin"))
|
| 456 | (call-with-output-file (string-append out "/bin/patchwork-admin")
|
| 457 | (lambda (port)
|
| 458 | (simple-format port "#!~A
|
| 459 | import os, sys
|
| 460 |
|
| 461 | if __name__ == \"__main__\":
|
| 462 | from django.core.management import execute_from_command_line
|
| 463 |
|
| 464 | execute_from_command_line(sys.argv)" (which "python"))))
|
| 465 | (chmod (string-append out "/bin/patchwork-admin") #o555))
|
| 466 | #t)))))
|
| 467 | (inputs
|
| 468 | `(("python-wrapper" ,python-wrapper)))
|
| 469 | (propagated-inputs
|
| 470 | `(("python-django" ,python-django)
|
| 471 | |
| 472 | ("python-psycopg2" ,python-psycopg2)
|
| 473 | ("python-mysqlclient" ,python-mysqlclient)
|
| 474 | ("python-django-filter" ,python-django-filter)
|
| 475 | ("python-djangorestframework" ,python-djangorestframework)
|
| 476 | ("python-django-debug-toolbar" ,python-django-debug-toolbar)))
|
| 477 | (synopsis "Web based patch tracking system")
|
| 478 | (description
|
| 479 | "Patchwork is a patch tracking system. It takes in emails containing
|
| 480 | patches, and displays the patches along with comments and state information.
|
| 481 | Users can login allowing them to change the state of patches.")
|
| 482 | (home-page "http://jk.ozlabs.org/projects/patchwork/")
|
| 483 | (license gpl2+)))
|