projects/guix·blob f723f59a · refs

5469 lines · 228.2 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Nikita Karetnikov <[email protected]>
3;;; Copyright © 2013 Cyril Roelandt <[email protected]>
4;;; Copyright © 2013-2022, 2024-2026 Ludovic Courtès <[email protected]>
5;;; Copyright © 2013, 2014 Andreas Enge <[email protected]>
6;;; Copyright © 2015, 2016 Mathieu Lirzin <[email protected]>
7;;; Copyright © 2014, 2015, 2016 Mark H Weaver <[email protected]>
8;;; Copyright © 2014, 2016, 2019, 2021 Eric Bavier <[email protected]>
9;;; Copyright © 2015-2026 Flashner <[email protected]>
10;;; Copyright © 2015, 2018, 2020, 2021, 2022 Kyle Meyer <[email protected]>
11;;; Copyright © 2015, 2017, 2018, 2020 Ricardo Wurmus <[email protected]>
12;;; Copyright © 2016, 2017 Leo Famulari <[email protected]>
13;;; Copyright © 2016, 2017, 2018 Nikita <[email protected]>
14;;; Copyright © 2017–2022 Tobias Geerinckx-Rice <[email protected]>
15;;; Copyright © 2017 Vasile Dumitrascu <[email protected]>
16;;; Copyright © 2017 Clément Lassieur <[email protected]>
17;;; Copyright © 2017, 2020 EuAndreh <[email protected]>
18;;; Copyright © 2017, 2018, 2020, 2022 Marius Bakke <[email protected]>
19;;; Copyright © 2017 Stefan Reichör <[email protected]>
20;;; Copyright © 2017, 2020, 2024 Oleg Pykhalov <[email protected]>
21;;; Copyright © 2018 Sou Bunnbu <[email protected]>
22;;; Copyright © 2018 Christopher Baines <[email protected]>
23;;; Copyright © 2018 Timothy Sample <[email protected]>
24;;; Copyright © 2018, 2025 Arun Isaac <[email protected]>
25;;; Copyright © 2019 Jovany Leandro G.C <[email protected]>
26;;; Copyright © 2019 Kei Kebreau <[email protected]>
27;;; Copyright © 2019, 2020 Alex Griffin <[email protected]>
28;;; Copyright © 2020 Roel Janssen <[email protected]>
29;;; Copyright © 2020, 2021 Brice Waegeneire <[email protected]>
30;;; Copyright © 2020 John D. Boy <[email protected]>
31;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <[email protected]>
32;;; Copyright © 2020, 2021, 2022, 2023 Vinicius Monego <[email protected]>
33;;; Copyright © 2020 Tanguy Le Carrour <[email protected]>
34;;; Copyright © 2020, 2021, 2022 Michael Rohleder <[email protected]>
35;;; Copyright © 2021 Greg Hogan <[email protected]>
36;;; Copyright © 2021-2024, 2026 Maxim Cournoyer <[email protected]>
37;;; Copyright © 2021 Chris Marusich <[email protected]>
38;;; Copyright © 2021 Léo Le Bouter <[email protected]>
39;;; Copyright © 2021 LibreMiami <[email protected]>
40;;; Copyright © 2021 Xinglu Chen <[email protected]>
41;;; Copyright © 2021 François J. <[email protected]>
42;;; Copyright © 2021 Julien Lepiller <[email protected]>
43;;; Copyright © 2021 Guillaume Le Vaillant <[email protected]>
44;;; Copyright © 2021, 2024 jgart <[email protected]>
45;;; Copyright © 2021 Foo Chuan Wei <[email protected]>
46;;; Copyright © 2022 Jai Vetrivelan <[email protected]>
47;;; Copyright © 2022 Maxime Devos <[email protected]>
48;;; Copyright © 2022 Dhruvin Gandhi <[email protected]>
49;;; Copyright © 2015, 2022 David Thompson <[email protected]>
50;;; Copyright © 2023, 2025 Nicolas Graves <[email protected]>
51;;; Copyright © 2023 Bruno Victal <[email protected]>
52;;; Copyright © 2023 Kjartan Oli Agustsson <[email protected]>
53;;; Copyright © 2023 Steve George <[email protected]>
54;;; Copyright © 2023 Josselin Poiret <[email protected]>
55;;; Copyright © 2024 Hilton Chain <[email protected]>
56;;; Copyright © 2023, 2024, 2026 Zheng Junjie <[email protected]>
57;;; Copyright © 2023 Ryan Desfosses <[email protected]>
58;;; Copyright © 2024 Suhail Singh <[email protected]>
59;;; Copyright © 2024 Simon Tournier <[email protected]>
60;;; Copyright © 2024 Javier Olaechea <[email protected]>
61;;; Copyright © 2024-2026 Ashish SHUKLA <[email protected]>
62;;; Copyright © 2024 Wilko Meyer <[email protected]>
63;;; Copyright © 2024 Herman Rimm <[email protected]>
64;;; Copyright © 2024, 2026 Sharlatan Hellseher <[email protected]>
65;;; Copyright © 2025 Artyom V. Poptsov <[email protected]>
66;;; Copyright © 2025 Dariqq <[email protected]>
67;;; Copyright © 2025 Tomas Volf <[email protected]>
68;;; Copyright © 2025 Matthew Elwin <[email protected]>
69;;; Copyright © 2025 Roman Scherer <[email protected]>
70;;; Copyright © 2026 Ingar <[email protected]>
71;;; Copyright © 2026 Nguyễn Gia Phong <[email protected]>
72;;; Copyright © 2026 Luca Kredel <[email protected]>
73;;;
74;;; This file is part of GNU Guix.
75;;;
76;;; GNU Guix is free software; you can redistribute it and/or modify it
77;;; under the terms of the GNU General Public License as published by
78;;; the Free Software Foundation; either version 3 of the License, or (at
79;;; your option) any later version.
80;;;
81;;; GNU Guix is distributed in the hope that it will be useful, but
82;;; WITHOUT ANY WARRANTY; without even the implied warranty of
83;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
84;;; GNU General Public License for more details.
85;;;
86;;; You should have received a copy of the GNU General Public License
87;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
88
89(define-module (gnu packages version-control)
90 #:use-module ((guix licenses) #:prefix license:)
91 #:use-module (guix utils)
92 #:use-module (guix packages)
93 #:use-module (guix deprecation)
94 #:use-module (guix gexp)
95 #:use-module (guix download)
96 #:use-module (guix fossil-download)
97 #:use-module (guix git-download)
98 #:use-module (guix hg-download)
99 #:use-module (guix build-system cargo)
100 #:use-module (guix build-system cmake)
101 #:use-module (guix build-system copy)
102 #:use-module (guix build-system emacs)
103 #:use-module (guix build-system gnu)
104 #:use-module (guix build-system go)
105 #:use-module (guix build-system perl)
106 #:use-module (guix build-system pyproject)
107 #:use-module (guix build-system qt)
108 #:use-module (guix build-system trivial)
109 #:use-module (gnu packages apr)
110 #:use-module (gnu packages autotools)
111 #:use-module (gnu packages documentation)
112 #:use-module (gnu packages base)
113 #:use-module (gnu packages bash)
114 #:use-module (gnu packages bison)
115 #:use-module (gnu packages boost)
116 #:use-module (gnu packages bootloaders)
117 #:use-module (gnu packages build-tools)
118 #:use-module (gnu packages check)
119 #:use-module (gnu packages crypto)
120 #:use-module (gnu packages curl)
121 #:use-module (gnu packages databases)
122 #:use-module (gnu packages docbook)
123 #:use-module (gnu packages file)
124 #:use-module (gnu packages compiler-tools)
125 #:use-module (gnu packages freedesktop)
126 #:use-module (gnu packages gawk)
127 #:use-module (gnu packages gettext)
128 #:use-module (gnu packages gcc)
129 #:use-module (gnu packages gl)
130 #:use-module (gnu packages glib)
131 #:use-module (gnu packages gnome)
132 #:use-module (gnu packages gnupg)
133 #:use-module (gnu packages golang)
134 #:use-module (gnu packages golang-build)
135 #:use-module (gnu packages golang-check)
136 #:use-module (gnu packages golang-compression)
137 #:use-module (gnu packages golang-crypto)
138 #:use-module (gnu packages golang-vcs)
139 #:use-module (gnu packages golang-web)
140 #:use-module (gnu packages golang-xyz)
141 #:use-module (gnu packages groff)
142 #:use-module (gnu packages guile)
143 #:use-module (gnu packages guile-xyz)
144 #:use-module (gnu packages image)
145 #:use-module (gnu packages imagemagick)
146 #:use-module (gnu packages less)
147 #:use-module (gnu packages libbsd)
148 #:use-module (gnu packages libevent)
149 #:use-module (gnu packages linux)
150 #:use-module (gnu packages mail)
151 #:use-module (gnu packages man)
152 #:use-module (gnu packages maths)
153 #:use-module (gnu packages ncurses)
154 #:use-module (gnu packages ssh)
155 #:use-module (gnu packages web)
156 #:use-module (gnu packages patchutils)
157 #:use-module (gnu packages pcre)
158 #:use-module (gnu packages perl)
159 #:use-module (gnu packages perl-check)
160 #:use-module (gnu packages php)
161 #:use-module (gnu packages pkg-config)
162 #:use-module (gnu packages prometheus)
163 #:use-module (gnu packages python)
164 #:use-module (gnu packages python-build)
165 #:use-module (gnu packages python-check)
166 #:use-module (gnu packages python-crypto)
167 #:use-module (gnu packages python-web)
168 #:use-module (gnu packages python-xyz)
169 #:use-module (gnu packages readline)
170 #:use-module (gnu packages rsync)
171 #:use-module (gnu packages ruby-xyz)
172 #:use-module (gnu packages sqlite)
173 #:use-module (gnu packages texinfo)
174 #:use-module (gnu packages text-editors)
175 #:use-module (gnu packages admin)
176 #:use-module (gnu packages xml)
177 #:use-module (gnu packages emacs)
178 #:use-module (gnu packages compression)
179 #:use-module (gnu packages qt)
180 #:use-module (gnu packages rust)
181 #:use-module (gnu packages sdl)
182 #:use-module (gnu packages ssh)
183 #:use-module (gnu packages swig)
184 #:use-module (gnu packages sync)
185 #:use-module (gnu packages tcl)
186 #:use-module (gnu packages textutils)
187 #:use-module (gnu packages time)
188 #:use-module (gnu packages tls)
189 #:use-module (gnu packages tor)
190 #:use-module (gnu packages)
191 #:use-module (ice-9 match)
192 #:use-module (srfi srfi-1)
193 #:export (make-gitolite))
194
195(define-public breezy
196 (package
197 (name "breezy")
198 (version "3.3.22")
199 (source
200 (origin
201 (method git-fetch)
202 (uri (git-reference
203 (url "https://github.com/breezy-team/breezy")
204 (commit (string-append "brz-" version))))
205 (file-name (git-file-name name version))
206 (sha256
207 (base32 "05xrwn8i8djrd2n9bwcas0y3sy51im8klw1w8ykvg3qhcnl4qlcg"))))
208 (build-system pyproject-build-system)
209 (arguments
210 (list
211 #:modules
212 '(((guix build cargo-build-system) #:prefix cargo:)
213 (guix build pyproject-build-system)
214 (guix build utils))
215 #:imported-modules
216 `(,@%cargo-build-system-modules
217 ,@%pyproject-build-system-modules)
218 #:phases
219 #~(modify-phases %standard-phases
220 (add-after 'unpack 'prepare-cargo-build-system
221 (lambda args
222 (for-each
223 (lambda (phase)
224 (format #t "Running cargo phase: ~a~%" phase)
225 (apply (assoc-ref cargo:%standard-phases phase)
226 #:cargo-target #$(cargo-triplet)
227 args))
228 '(unpack-rust-crates
229 configure
230 check-for-pregenerated-files
231 patch-cargo-checksums))))
232 (add-after 'unpack 'patch-test-shebangs
233 (lambda _
234 (substitute* (append (find-files "breezy/bzr/tests")
235 (find-files "breezy/tests"))
236 (("#!/bin/sh")
237 (format #f "#!~a" (which "sh"))))))
238 (add-after 'build 'build-man
239 (lambda _
240 (invoke "python3" "tools/generate_docs.py" "man")))
241 (add-after 'install 'install-man
242 (lambda _
243 (let ((man1 (string-append #$output "/share/man/man1")))
244 (install-file "brz.1" man1)
245 (install-file "breezy/git/git-remote-bzr.1" man1))))
246 (add-after 'install 'install-completion
247 (lambda* (#:key outputs #:allow-other-keys)
248 (let* ((bash (string-append #$output
249 "/share/bash-completion/completions")))
250 (install-file "contrib/bash/brz" bash))))
251 (add-after 'install-man 'bzr-compat
252 (lambda _
253 (let ((bin (string-append #$output "/bin"))
254 (man1 (string-append #$output "/share/man/man1")))
255 (symlink (in-vicinity bin "brz")
256 (in-vicinity bin "bzr"))
257 (call-with-output-file (string-append man1 "/bzr.1")
258 (lambda (port)
259 (format port ".so man1/brz.1"))))))
260 ;; tests: passed 33237 tests, 4393 tests skipped
261 (replace 'check
262 (lambda* (#:key tests? #:allow-other-keys)
263 (when tests?
264 (setenv "BZR_EDITOR" "nano")
265 (invoke "brz" "selftest" "--verbose" "--parallel=fork"
266 ;; This test hangs
267 "-x" "breezy.tests.blackbox.test_serve"
268 ;; No GnuPG key results for pattern: [email protected]
269 "-x" "breezy.tests.test_gpg"
270 ;; compgen: command not found
271 "-x" "bash_completion"
272 ;; No such file or directory: '/etc/mtab'
273 "-x" "breezy.tests.blackbox.test_diff.TestExternalDiff.test_external_diff"
274 ;; Value "/etc/ssl/certs/ca-certificates.crt" is not valid for "ssl.ca_certs"
275 "-x" "breezy.tests.test_https_urllib.CaCertsConfigTests.test_default_exists"
276 ;; Unknown Failure
277 "-x" "breezy.tests.test_plugins.TestLoadPluginAt.test_compiled_loaded"
278 "-x" "breezy.tests.test_plugins.TestPlugins.test_plugin_get_path_pyc_only"
279 "-x" "breezy.tests.test_selftest.TestActuallyStartBzrSubprocess.test_start_and_stop_bzr_subprocess_send_signal"
280 ;; AttributeError: module 'paramiko' has no attribute 'DSSKey'
281 "-x" "breezy.tests.test_transport.TestSSHConnections.test_bzr_connect_to_bzr_ssh"
282 ;; Network access is required
283 "-x" "breezy.git.tests.test_server.TestPlainFetch.test_fetch_from_native_git"
284 "-x" "breezy.git.tests.test_server.TestPlainFetch.test_fetch_from_non_git"
285 "-x" "breezy.git.tests.test_server.TestPlainFetch.test_fetch_nothin")))))))
286 (native-inputs
287 (append
288 (list gettext-minimal
289 python-cython
290 python-setuptools
291 python-setuptools-gettext
292 python-setuptools-rust
293 python-tomli
294 rust
295 `(,rust "cargo")
296 ;; tests
297 nano
298 python-testtools
299 python-packaging
300 python-subunit)
301 (or (and=> (%current-target-system)
302 (compose list make-rust-sysroot))
303 '())))
304 (inputs (cons* python-catalogus
305 python-configobj
306 python-dulwich
307 python-fastbencode
308 python-merge3
309 python-patiencediff
310 python-pyyaml
311 python-urllib3
312 python-vcsgraph
313 ;; [optional]
314 python-fastimport
315 python-gpg
316 python-launchpadlib
317 python-paramiko
318 python-pygithub
319 python-subunit
320
321 (cargo-inputs 'breezy)))
322 (home-page "https://www.breezy-vcs.org/")
323 (synopsis "Decentralized revision control system")
324 (description
325 "Breezy (@command{brz}) is a decentralized revision control system. By
326default, Breezy provides support for both the
327@uref{https://bazaar.canonical.com/, Bazaar} and @uref{https://www.git-scm.com,
328Git} file formats. Breezy is backwards compatible with Bazaar's disk format
329and protocols. One of the key differences with Bazaar is that Breezy runs on
330Python 3.3 and later, rather than on Python 2.")
331 (license license:gpl2+)))
332
333(define-public python-vcsgraph
334 (package
335 (name "python-vcsgraph")
336 (version "0.3.2")
337 (source
338 (origin
339 (method git-fetch)
340 (uri (git-reference
341 (url "https://github.com/breezy-team/vcsgraph")
342 (commit (string-append "v" version))))
343 (file-name (git-file-name name version))
344 (sha256
345 (base32 "15hxlvvz2s21rpgk6nvlhzv9lb8glicjfsgx5vvcaqrh2y0qdr05"))))
346 (build-system pyproject-build-system)
347 (arguments
348 (list
349 #:imported-modules (append %cargo-build-system-modules
350 %pyproject-build-system-modules)
351 #:modules '(((guix build cargo-build-system) #:prefix cargo:)
352 (guix build pyproject-build-system)
353 (guix build utils))
354 #:test-flags #~(list "--pyargs" "vcsgraph")
355 #:phases
356 #~(modify-phases %standard-phases
357 (add-after 'unpack 'prepare-cargo-build-system
358 (lambda args
359 (for-each (lambda (phase)
360 (format #t "Running cargo phase: ~a~%" phase)
361 (apply (assoc-ref cargo:%standard-phases phase)
362 #:cargo-target #$(cargo-triplet)
363 args))
364 '(prepare-rust-crates
365 unpack-rust-crates
366 configure
367 check-for-pregenerated-files
368 patch-cargo-checksums))))
369 (add-before 'check 'remove-local-source
370 (lambda _
371 (delete-file-recursively "vcsgraph"))))))
372 (native-inputs
373 (append (list python-pytest
374 python-setuptools
375 python-setuptools-rust
376 rust
377 (list rust "cargo"))
378 (or (and=> (%current-target-system)
379 (compose list make-rust-sysroot))
380 '())))
381 (inputs (cargo-inputs 'python-vcsgraph))
382 (home-page "https://github.com/breezy-team/vcsgraph")
383 (synopsis "Graph algorithms for version control systems")
384 (description
385 "This package provides a Python library providing graph algorithms
386optimized for version control systems.")
387 (license license:gpl2+)))
388
389(define git-cross-configure-flags
390 #~(list "ac_cv_fread_reads_directories=yes"
391 "ac_cv_snprintf_returns_bogus=no"
392 "ac_cv_iconv_omits_bom=no"))
393
394;; The size of the closure of 'git-minimal' is two thirds that of 'git'.
395;; Its test suite runs slightly faster and most importantly it doesn't
396;; depend on packages that are expensive to build such as Subversion.
397(define-public git-minimal/pinned
398 (package
399 (name "git-minimal")
400 (version "2.55.0")
401 (source (origin
402 (method url-fetch)
403 (uri (string-append "mirror://kernel.org/software/scm/git/git-"
404 version ".tar.xz"))
405 (sha256
406 (base32
407 "0mska0bwrshipx02l3wj4w3nhvrfj7k9b1k8sh3y0a47vh2dnzs5"))))
408 (build-system gnu-build-system)
409 (arguments
410 (list
411 #:modules `((srfi srfi-1)
412 (srfi srfi-26)
413 (ice-9 format)
414 (ice-9 textual-ports)
415 ((guix build gnu-build-system) #:prefix gnu:)
416 ,@%default-gnu-modules)
417 ;; Make sure the full bash does not end up in the final closure.
418 #:disallowed-references (list (this-package-native-input "bash")
419 (this-package-native-input "perl"))
420 #:test-target "test"
421 #:configure-flags
422 #~(cons "--with-gitconfig=/etc/gitconfig"
423 #$(if (%current-target-system) git-cross-configure-flags #~(list)))
424 #:make-flags
425 #~(list "V=1" ;more verbose compilation
426 "NO_RUST=1" ;enabled by default since 2.55
427 (string-append "SHELL_PATH="
428 #+(this-package-native-input "bash-minimal")
429 "/bin/sh")
430
431 ;; Tests require a bash with completion support.
432 (string-append "TEST_SHELL_PATH="
433 #+(this-package-native-input "bash")
434 "/bin/bash")
435
436 ;; By default 'make install' creates hard links for
437 ;; things in 'libexec/git-core', which leads to huge
438 ;; nars; see <https://bugs.gnu.org/21949>.
439 "NO_INSTALL_HARDLINKS=indeed")
440 #:phases
441 #~(modify-phases %standard-phases
442 #$@(if (%current-target-system)
443 ;; The git build system assumes build == host
444 #~((add-after 'unpack 'use-host-uname_S
445 (lambda _
446 (substitute* "config.mak.uname"
447 (("uname_S := .*" all)
448 (if #$(target-hurd?)
449 "uname_S := GNU\n"
450 all))))))
451 ;; We do not have a full bash when cross-compiling.
452 #~((add-after 'unpack 'modify-PATH
453 (lambda* (#:key inputs #:allow-other-keys)
454 (let ((path (string-split (getenv "PATH") #\:))
455 (bash-full #$(this-package-native-input "bash")))
456 ;; Drop the test bash from PATH so that (which "sh")
457 ;; and similar does the right thing.
458 (setenv "PATH"
459 (string-join
460 (remove (cut string-prefix? bash-full <>)
461 path)
462 ":")))))))
463 #$@(if (system-hurd?)
464 #~((add-after 'unpack 'delete-tests/hurd
465 (lambda _
466 (delete-file "t/t0052-simple-ipc.sh")
467 (delete-file "t/t5562-http-backend-content-length.sh")
468 (delete-file "t/t9902-completion.sh"))))
469 #~())
470 ;; Add cross curl-config script to PATH when cross-compiling.
471 #$@(if (%current-target-system)
472 #~((add-before 'configure 'add-cross-curl-config
473 (lambda* (#:key inputs #:allow-other-keys)
474 (setenv "PATH"
475 (string-append
476 (dirname (search-input-file
477 inputs "bin/curl-config"))
478 ":" (getenv "PATH"))))))
479 #~())
480 (add-after 'unpack 'patch-commands
481 (lambda* (#:key inputs #:allow-other-keys)
482 (define (prepend-string-to-file text file)
483 "Prepend TEXT to FILE."
484 (let ((content (call-with-input-file file
485 (cut get-string-all <>))))
486 (call-with-output-file file
487 (lambda (port)
488 (display text port)
489 (display content port)))))
490
491 (define PATH-variable-definition
492 (format #f "PATH=~{~a~^:~}${PATH:+:}$PATH~%~%"
493 (map (compose dirname (cut search-input-file inputs <>))
494 '("bin/basename"
495 "bin/sed"))))
496
497 ;; Ensure that coreutils (for basename) and sed are on PATH
498 ;; for any script that sources the 'git-sh-setup.sh' file.
499 (prepend-string-to-file PATH-variable-definition
500 "git-sh-setup.sh")
501
502 ;; Avoid depending on util-linux; it's only used to detect
503 ;; whether the system is MinGW, which we can detect at build
504 ;; time.
505 (substitute* "git-sh-setup.sh"
506 (("\\$\\(uname -s)")
507 (if #$(target-mingw?)
508 "MINGW"
509 "GNU"))) ;matched against '*'
510
511 ;; git-submodule sources 'git-sh-setup.sh', but not before
512 ;; invoking the basename and sed commands... patch them to their
513 ;; absolute location.
514 (substitute* "git-submodule.sh"
515 (("\\$\\(basename")
516 (string-append "$(" (search-input-file inputs "bin/basename")))
517 (("sed -e")
518 (string-append (search-input-file inputs "bin/sed") " -e")))
519
520 ;; git-send-email invokes the editor via 'sh'; patch it.
521 (substitute* "git-send-email.perl"
522 (("'sh'")
523 (format #f "'~a'" (search-input-file inputs "bin/sh"))))))
524 (add-after 'configure 'patch-makefiles
525 (lambda _
526 (substitute* "Makefile"
527 (("/usr/bin/perl") (which "perl")))))
528 (add-after 'configure 'add-PM.stamp
529 (lambda _
530 ;; Add the "PM.stamp" to avoid "no rule to make target".
531 (call-with-output-file "perl/PM.stamp" (const #t))))
532 (add-before 'check 'patch-tests
533 (lambda _
534 (let ((store-directory (%store-directory)))
535 ;; These files contain some funny bytes that Guile is unable
536 ;; to decode for shebang patching. Just delete them.
537 (for-each delete-file '("t/t4201-shortlog.sh"
538 "t/t7813-grep-icase-iso.sh"))
539 ;; Many tests contain inline shell scripts (hooks etc).
540 (substitute* (find-files "t" "\\.sh$")
541 (("#!/bin/sh") (string-append "#!" (which "sh"))))
542 ;; Un-do shebang patching here to prevent checksum mismatch.
543 (substitute* '("t/t4034/perl/pre" "t/t4034/perl/post")
544 (("^#!.*/bin/perl") "#!/usr/bin/perl"))
545 (substitute* "t/t5003-archive-zip.sh"
546 (("cp /bin/sh") (string-append "cp " (which "sh"))))
547 (substitute* "t/t6030-bisect-porcelain.sh"
548 (("\"/bin/sh\"") (string-append "\"" (which "sh") "\"")))
549 ;; FIXME: This test runs `git commit` with a bogus EDITOR
550 ;; and empty commit message, but does not fail the way it's
551 ;; expected to. The test passes when invoked interactively.
552 (substitute* "t/t7508-status.sh"
553 (("\tcommit_template_commented") "\ttrue"))
554 ;; More checksum mismatches due to odd shebangs.
555 (substitute* "t/t9100-git-svn-basic.sh"
556 (((string-append "\"#!" store-directory ".*/bin/sh"))
557 "\"#!/bin/sh") )
558 (substitute* "t/t9300-fast-import.sh"
559 (((string-append "\t#!" store-directory ".*/bin/sh"))
560 "\t#!/bin/sh")
561 (((string-append "'#!" store-directory ".*/bin/sh"))
562 "'#!/bin/sh"))
563 ;; FIXME: Some hooks fail with "basename: command not found".
564 ;; See 't/trash directory.t9164.../svn-hook.log'.
565 (delete-file "t/t9164-git-svn-dcommit-concurrent.sh")
566
567 ;; XXX: These tests fail intermittently for unknown reasons:
568 ;; <https://bugs.gnu.org/29546>.
569 (for-each delete-file
570 '("t/t9128-git-svn-cmd-branch.sh"
571 "t/t9167-git-svn-cmd-branch-subproject.sh"
572 "t/t9141-git-svn-multiple-branches.sh"))
573
574 #$@(if (version>=? (package-version this-package)
575 "2.48.0")
576 ;; Purge the purged tests in meson.build
577 #~((substitute
578 "t/meson.build"
579 (list (cons "^(.+')(t[^']+[.]sh)('.*)$"
580 (lambda (line matches)
581 (let* ((match-offset (vector-ref (car matches) 3))
582 (test-file (string-append "t/"
583 (substring line
584 (car match-offset)
585 (cdr match-offset)))))
586 (if (file-exists? test-file)
587 line
588 "")))))))
589 #~()))))
590 (add-after 'install 'install-shell-completion
591 (lambda _
592 (let ((bash (string-append #$output "/etc/bash_completion.d")))
593 ;; TODO: Install the tcsh completions in the right place.
594 (for-each mkdir-p (list bash))
595 (copy-file "contrib/completion/git-completion.bash"
596 (string-append bash "/git"))
597 (copy-file "contrib/completion/git-prompt.sh"
598 (string-append #$output "/bin/git-prompt")))))
599 (add-after 'install 'remove-unusable-perl-commands
600 (lambda _
601 (let ((bin (string-append #$output "/bin"))
602 (libexec (string-append #$output "/libexec")))
603 (for-each (lambda (file)
604 (delete-file (string-append libexec
605 "/git-core/" file)))
606 '("git-svn" "git-cvsimport" "git-archimport"
607 "git-cvsserver" "git-request-pull"
608
609 ;; git-add--interactive was removed in Git 2.40 but
610 ;; this phase is inherited by older versions.
611 #$@(if (version>=? (package-version this-package)
612 "2.40.1")
613 #~()
614 #~("git-add--interactive"))
615
616 "git-cvsexportcommit"
617 "git-instaweb" "git-send-email"))
618 (delete-file (string-append bin "/git-cvsserver"))
619
620 ;; These templates typically depend on Perl. Remove them.
621 (delete-file-recursively
622 (string-append #$output "/share/git-core/templates/hooks"))
623
624 ;; Gitweb depends on Perl as well.
625 (delete-file-recursively
626 (string-append #$output "/share/gitweb")))))
627 (add-after 'install 'restore-sample-hooks-shebang
628 (lambda _
629 (let* ((dir (string-append #$output
630 "/share/git-core/templates/hooks")))
631 (for-each (lambda (file)
632 (format #t "restoring shebang on `~a'~%" file)
633 (substitute* file
634 (("^#!.*/bin/sh") "#!/bin/sh")))
635 (find-files dir ".*"))))))))
636 (native-inputs
637 ;; Add bash-minimal explicitly to ensure it comes before bash-for-tests,
638 ;; see <https://bugs.gnu.org/39513>.
639 (list bash-minimal
640 bash
641 gettext-minimal
642 perl))
643 (inputs
644 (list bash-minimal
645 coreutils-minimal
646 curl ;for HTTP(S) access
647 expat ;for 'git push' over HTTP(S)
648 openssl
649 perl
650 sed
651 zlib))
652 (native-search-paths
653 ;; For HTTPS access, Git needs a single-file certificate bundle, specified
654 ;; with $GIT_SSL_CAINFO.
655 (list (search-path-specification
656 (variable "GIT_SSL_CAINFO")
657 (file-type 'regular)
658 (separator #f) ;single entry
659 (files '("etc/ssl/certs/ca-certificates.crt")))
660 (search-path-specification
661 (variable "GIT_EXEC_PATH")
662 (separator #f) ;single entry
663 (files '("libexec/git-core")))))
664 (synopsis "Distributed version control system")
665 (description
666 "Git is a free distributed version control system designed to handle
667everything from small to very large projects with speed and efficiency.")
668 (properties '((hidden? . #t) ;pinned variant for Graphene/GTK+
669 (lint-hidden-cpe-vendors . ("jenkins"))
670 (upstream-name . "git")))
671 (license license:gpl2)
672 (home-page "https://git-scm.com/")))
673
674(define-public git-minimal
675 (package
676 (inherit git-minimal/pinned)
677 (properties (alist-delete 'hidden?
678 (package-properties git-minimal/pinned)))))
679
680(define-public git
681 (package/inherit git-minimal
682 (name "git")
683 (outputs '("out" ;the core
684 "send-email" ;for git-send-email
685 "svn" ;git-svn
686 "credential-netrc" ;git-credential-netrc
687 "credential-libsecret" ;git-credential-libsecret
688 "subtree" ;git-subtree
689 "gui")) ;gitk, git gui
690 (arguments
691 (substitute-keyword-arguments arguments
692 ((#:disallowed-references disallowed-refs ''())
693 (list (this-package-native-input "bash")))
694 ((#:make-flags flags #~'())
695 #~(cons "USE_LIBPCRE2=yes" #$flags))
696 ((#:configure-flags flags #~'())
697 ;; The explicit --with-tcltk forces the build system to hardcode the
698 ;; absolute file name to 'wish'.
699 #~(cons (string-append "--with-tcltk="
700 (search-input-file %build-inputs
701 "bin/wish8.6"))
702 #$flags))
703 ((#:phases phases '%standard-phases)
704 #~(modify-phases #$phases
705 (delete 'remove-unusable-perl-commands)
706 (replace 'patch-makefiles
707 (lambda _
708 (substitute* (find-files "." "Makefile")
709 (("/bin/sh") (which "sh"))
710 (("/usr/bin/perl") (which "perl"))
711 (("/usr/bin/python") (which "python3")))))
712 (add-after 'build 'build-subtree
713 (lambda* (#:key native-inputs inputs #:allow-other-keys)
714 (invoke "make" "-C" "Documentation" "asciidoc.conf")
715 (with-directory-excursion "contrib/subtree"
716 (invoke "make")
717 (invoke "make" "install")
718 (invoke "make" "install-doc")
719 (substitute* "git-subtree"
720 (("/bin/sh") (which "sh"))))))
721 (add-after 'install 'install-doc
722 (lambda* (#:key parallel-build? #:allow-other-keys)
723 (define job-count (if parallel-build?
724 (number->string (parallel-job-count))
725 "1"))
726 (invoke "make" "-C" "Documentation"
727 "install-info" "install-man"
728 "-j" job-count
729 ;; The Makefile refer to 'docbook2x-texi', but our
730 ;; binary is named 'docbook2texi'.
731 "DOCBOOK2X_TEXI=docbook2texi" "PERL_PATH=perl")))
732 (add-after 'install 'install-credential-netrc
733 (lambda _
734 (install-file
735 "contrib/credential/netrc/git-credential-netrc.perl"
736 (string-append #$output:credential-netrc "/bin"))
737 (rename-file (string-append #$output:credential-netrc
738 "/bin/git-credential-netrc.perl")
739 (string-append #$output:credential-netrc
740 "/bin/git-credential-netrc"))
741 ;; Previously, Git.pm was automatically found by netrc.
742 ;; Perl 5.26 changed how it locates modules so that @INC no
743 ;; longer includes the current working directory (the Perl
744 ;; community calls this "dotless @INC").
745 (wrap-program (string-append #$output:credential-netrc
746 "/bin/git-credential-netrc")
747 `("PERL5LIB" ":" prefix
748 (,(string-append #$output "/share/perl5"))))))
749 (add-after 'install 'install-credential-libsecret
750 (lambda _
751 (with-directory-excursion "contrib/credential/libsecret"
752 ((assoc-ref gnu:%standard-phases 'build))
753 (install-file "git-credential-libsecret"
754 (string-append #$output:credential-libsecret
755 "/bin")))))
756 (add-after 'install 'install-subtree
757 (lambda _
758 (install-file "contrib/subtree/git-subtree"
759 (string-append #$output:subtree "/bin"))
760 (install-file "contrib/subtree/git-subtree.1"
761 (string-append #$output:subtree
762 "/share/man/man1"))))
763 (add-after 'install 'split
764 (lambda* (#:key inputs #:allow-other-keys)
765 ;; Split the binaries to the various outputs.
766 (let* ((out #$output)
767 (se #$output:send-email)
768 (svn #$output:svn)
769 (gui #$output:gui)
770 (gitk (string-append out "/bin/gitk"))
771 (gitk* (string-append gui "/bin/gitk"))
772 (git-gui (string-append
773 out "/libexec/git-core/git-gui"))
774 (git-gui* (string-append
775 gui "/libexec/git-core/git-gui"))
776 (git-cit (string-append
777 out "/libexec/git-core/git-citool"))
778 (git-cit* (string-append
779 gui "/libexec/git-core/git-citool"))
780 (git-se (string-append
781 out "/libexec/git-core/git-send-email"))
782 (git-se* (string-append
783 se "/libexec/git-core/git-send-email"))
784 (git-svn (string-append
785 out "/libexec/git-core/git-svn"))
786 (git-svn* (string-append
787 svn "/libexec/git-core/git-svn"))
788 (git-sm (string-append
789 out "/libexec/git-core/git-submodule")))
790 (mkdir-p (string-append gui "/bin"))
791 (mkdir-p (string-append gui "/libexec/git-core"))
792 (mkdir-p (string-append se "/libexec/git-core"))
793 (mkdir-p (string-append svn "/libexec/git-core"))
794
795 (for-each (lambda (old new)
796 (copy-file old new)
797 (delete-file old)
798 (chmod new #o555))
799 (list gitk git-gui git-cit git-se git-svn)
800 (list gitk* git-gui* git-cit* git-se* git-svn*))
801
802 ;; Tell 'git-svn' where Subversion and perl-term-readkey are.
803
804 ;; FIXME: Old school 'assoc-ref' is used to retrieve
805 ;; subversion here, as #$(this-package-input "subversion")
806 ;; causes a dependency cycle for unknown reasons.
807 (wrap-program git-svn*
808 `("PATH" ":" prefix
809 (,(dirname (search-input-file inputs "bin/perl"))))
810 `("PERL5LIB" ":" prefix
811 ,(search-path-as-list
812 '("lib/perl5/site_perl")
813 (list (assoc-ref inputs "subversion")
814 #$(this-package-input "perl-term-readkey"))))
815
816 ;; XXX: The .so for SVN/Core.pm lacks a RUNPATH, so
817 ;; help it find 'libsvn_client-1.so'.
818 `("LD_LIBRARY_PATH" ":" prefix
819 (,(string-append (assoc-ref inputs "subversion")
820 "/lib"))))
821
822 ;; Tell 'git-send-email' where perl modules are.
823 (wrap-program git-se*
824 `("PERL5LIB" ":" prefix
825 ,(search-path-as-list
826 '("lib/perl5/site_perl")
827 '#$(delete-duplicates
828 (let ((perl-inputs
829 (list (this-package-input "perl-authen-sasl")
830 (this-package-input "perl-net-smtp-ssl")
831 (this-package-input "perl-io-socket-ssl"))))
832 (append perl-inputs
833 (map last
834 (append-map
835 package-transitive-propagated-inputs
836 perl-inputs))))))))
837
838 ;; Tell 'gitweb.cgi' where perl modules are.
839 (wrap-program (string-append out "/share/gitweb/gitweb.cgi")
840 `("PERL5LIB" ":" prefix
841 ,(search-path-as-list
842 '("lib/perl5/site_perl")
843 '#$(delete-duplicates
844 (let ((perl-inputs (list (this-package-input
845 "perl-cgi"))))
846 (append perl-inputs
847 (map last
848 (append-map
849 package-transitive-propagated-inputs
850 perl-inputs)))))))))))))))
851 (native-inputs
852 (modify-inputs native-inputs
853 ;; For documentation.
854 (append asciidoc
855 docbook2x
856 docbook-xml-4.5
857 docbook-xsl
858 libxslt
859 pkg-config
860 texinfo
861 xmlto)))
862 (inputs
863 (modify-inputs inputs
864 (append bash-minimal ;for wrap-program
865 python ;for git-p4
866
867 ;; For PCRE support in git grep (USE_LIBPCRE2).
868 pcre2
869
870 ;; For 'gitweb.cgi'.
871 perl-cgi
872
873 ;; For 'git-svn'.
874 subversion
875 perl-term-readkey
876
877 ;; For 'git-send-email'.
878 perl-authen-sasl
879 perl-net-smtp-ssl
880 perl-io-socket-ssl
881
882 ;; For 'git gui', 'gitk', and 'git citool'.
883 tcl
884 tk
885
886 ;; For 'git-credential-libsecret'
887 glib
888 libsecret)))))
889
890;;; The symbol git-minimal/fixed should be used when git-minimal needs fixes
891;;; (security or else) and this deprecation could be removed.
892(define-deprecated/public-alias git-minimal/fixed git-minimal/pinned)
893
894(define-public mergiraf
895 (package
896 (name "mergiraf")
897 (version "0.16.3")
898 (source
899 (origin
900 (method url-fetch)
901 (uri (crate-uri "mergiraf" version))
902 (file-name (string-append name "-" version ".tar.gz"))
903 (sha256
904 (base32 "0b5rsdz1s68kc37rqvjwpgwj2651arigbzgcf7chdspzjc9fkllk"))))
905 (build-system cargo-build-system)
906 (arguments
907 (list #:install-source? #f))
908 ;; for tests
909 (native-inputs (list git-minimal/pinned))
910 (inputs (cargo-inputs 'mergiraf))
911 (home-page "https://mergiraf.org/")
912 (synopsis "Syntax-aware merge driver for Git")
913 (description "This package provides a syntax-aware merge driver for Git.")
914 (license license:gpl3)))
915
916(define-public python-klaus
917 (package
918 (name "python-klaus")
919 (version "3.0.1")
920 (source (origin
921 (method url-fetch)
922 (uri (pypi-uri "klaus" version))
923 (sha256
924 (base32
925 "1w6sl15llnkcg7kmnpn64awdiis061q2gijnhdx0ng7z4p1glapl"))
926 (patches
927 (search-patches "python-klaus-support-python-3.12.patch"))))
928 (build-system pyproject-build-system)
929 (arguments
930 (list
931 #:tests? #f ; TODO: https://github.com/jonashaag/klaus/issues/322
932 #:phases
933 #~(modify-phases %standard-phases
934 (add-after 'unpack 'configure-git
935 (lambda* (#:key inputs #:allow-other-keys)
936 (for-each (lambda (file)
937 (substitute* file
938 (("\"git\"")
939 (string-append "\""
940 (search-input-file inputs "/bin/git") "\""))))
941 (list "klaus/ctagsutils.py"
942 "klaus/repo.py"
943 "klaus/utils.py"
944 "tests/test_contrib.py"
945 "tests/test_make_app.py")))))))
946 (inputs (list git-minimal))
947 (native-inputs
948 (list python-pytest python-setuptools python-wheel))
949 (propagated-inputs
950 (list python-dulwich python-flask python-httpauth
951 python-humanize python-pygments python-werkzeug))
952 (home-page "https://github.com/jonashaag/klaus")
953 (synopsis "Simple git web viewer")
954 (description
955"@code{klaus} is a simple, easy-to-set-up git web viewer. It features
956@itemize
957@item Super easy to set up -- no configuration required
958@item Syntax highlighting
959@item Markdown + RestructuredText rendering support
960@item Pull + push support (Git Smart HTTP)
961@item Code navigation using Exuberant ctags
962@end itemize")
963 (license license:isc)))
964
965(define-public git2cl
966 (let ((commit "1d74d4c0d933fc69ed5cec838c73502584dead05"))
967 (package
968 (name "git2cl")
969 (version (string-append "20120919." (string-take commit 7)))
970 (source (origin
971 (method git-fetch)
972 (uri (git-reference
973 (url "https://git.savannah.nongnu.org/git/git2cl.git")
974 (commit commit)))
975 (file-name (git-file-name name version))
976 (sha256
977 (base32
978 "0wnnbm2sjvfj0qrksj89jlnl69miwl0vk3wrrvgvpclgys3na2g1"))))
979 (build-system copy-build-system)
980 (inputs
981 (list perl))
982 (arguments
983 `(#:install-plan '(("git2cl" "bin/git2cl"))))
984 (home-page "https://savannah.nongnu.org/projects/git2cl")
985 (synopsis "Convert Git logs to GNU ChangeLog format")
986 (description "@code{git2cl} is a command line tool for converting Git
987logs to GNU ChangeLog format.")
988 (license license:gpl2+))))
989
990(define-public git-cal
991 (package
992 (name "git-cal")
993 (version "0.9.1")
994 (source (origin
995 (method git-fetch)
996 (uri (git-reference
997 (url "https://github.com/k4rthik/git-cal")
998 (commit (string-append "v" version))))
999 (file-name (git-file-name name version))
1000 (sha256
1001 (base32
1002 "08s9sif3qlk5n2dqpzq5yjczggnqlnxldljspjdqgpfydb2dqg3z"))))
1003 (build-system perl-build-system)
1004 (home-page "https://github.com/k4rthik/git-cal/")
1005 (synopsis "GitHub like contributions calendar for terminal")
1006 (description "@code{git-cal} is a script to view commits calendar similar
1007to GitHub contributions calendar.")
1008 (license license:expat)))
1009
1010(define-public git-cliff
1011 (package
1012 (name "git-cliff")
1013 (version "2.12.0")
1014 (source
1015 (origin
1016 (method url-fetch)
1017 (uri (crate-uri "git-cliff" version))
1018 (file-name (string-append name "-" version ".tar.gz"))
1019 (sha256
1020 (base32 "1vz1qix1yi6j5lb95q39pdxn4b6nrq8m235kjjh605m2mf0r8wyd"))))
1021 (build-system cargo-build-system)
1022 (arguments
1023 (list
1024 #:install-source? #f
1025 #:imported-modules (append %copy-build-system-modules
1026 %cargo-build-system-modules)
1027 #:modules '((guix build cargo-build-system)
1028 ((guix build copy-build-system) #:prefix copy:)
1029 (guix build utils))
1030 #:phases
1031 #~(modify-phases %standard-phases
1032 (add-after 'install 'install-extras
1033 (lambda args
1034 (mkdir "assets")
1035 (setenv "OUT_DIR" "assets")
1036 (let ((git-cliff-mangen
1037 (if #$(%current-target-system)
1038 (search-input-file native-inputs
1039 "bin/git-cliff-mangen")
1040 (in-vicinity #$output "bin/git-cliff-mangen")))
1041 (git-cliff-completions
1042 (if #$(%current-target-system)
1043 (search-input-file native-inputs
1044 "bin/git-cliff-completions")
1045 (in-vicinity #$output "bin/git-cliff-completions"))))
1046 (invoke git-cliff-mangen)
1047 (invoke git-cliff-completions))
1048 ;; Then delete the extra binaries.
1049 (delete-file (string-append #$output "/bin/git-cliff-mangen"))
1050 (delete-file (string-append #$output "/bin/git-cliff-completions"))
1051 (apply (assoc-ref copy:%standard-phases 'install)
1052 #:install-plan
1053 '(("assets/git-cliff.bash"
1054 "share/bash-completion/completions/git-cliff")
1055 ("assets/git-cliff.elv"
1056 "share//elvish/lib/git-cliff")
1057 ("assets/git-cliff.fish"
1058 "share/fish/vendor_completions.d/")
1059 ("assets/_git-cliff" "share/zsh/site-functions/")
1060 ("assets/git-cliff.1" "share/man/man1/"))
1061 args))))))
1062 (native-inputs
1063 (append (if (%current-target-system)
1064 (list this-package)
1065 '())
1066 (list pkg-config)))
1067 (inputs (cons* libgit2-1.9
1068 zlib
1069 `(,zstd "lib")
1070 (cargo-inputs 'git-cliff)))
1071 (home-page "https://github.com/orhun/git-cliff")
1072 (synopsis "Highly customizable changelog generator")
1073 (description "@command{git-cliff} can generate
1074@url{https://en.wikipedia.org/wiki/Changelog, changelog} files from the
1075@url{https://git-scm.com/, Git} history by utilizing
1076@url{https://git-cliff.org/docs/configuration/git#conventional_commits,
1077conventional commits} as well as regex-powered
1078@url{https://git-cliff.org/docs/configuration/git#commit_parsers,
1079custom parsers}. The @url{https://git-cliff.org/docs/category/templating,
1080changelog template} can be customized with a
1081@url{https://git-cliff.org/docs/configuration, configuration file} to match the
1082desired format.")
1083 (license (list license:expat license:asl2.0))))
1084
1085(define-public git-pages
1086 (package
1087 (name "git-pages")
1088 (version "0.9.1")
1089 (source
1090 (origin
1091 (method git-fetch)
1092 (uri (git-reference
1093 (url "https://codeberg.org/git-pages/git-pages.git")
1094 (commit (string-append "v" version))))
1095 (file-name (git-file-name name version))
1096 (sha256
1097 (base32 "029zas5pfky6qkbw4j9whrlyxd1pa4jfhj9jm8dg6fav292kf973"))))
1098 (build-system go-build-system)
1099 (arguments
1100 (list
1101 #:build-flags
1102 #~(list (string-append "-ldflags=-X main.versionOverride=" #$version))
1103 #:embed-files #~(list "children" "nodes" "text")
1104 #:import-path "codeberg.org/git-pages/git-pages"
1105 #:install-source? #f))
1106 (native-inputs
1107 (list go-codeberg-org-git-pages-go-headers
1108 go-codeberg-org-git-pages-go-slog-syslog
1109 go-github-com-bits-and-blooms-bloom-v3
1110 go-github-com-burntsushi-toml
1111 go-github-com-c2h5oh-datasize
1112 go-github-com-creasty-defaults
1113 go-github-com-fatih-color
1114 go-github-com-go-git-go-billy-v6
1115 go-github-com-go-git-go-git-v6
1116 go-github-com-jpillora-backoff
1117 go-github-com-kankanreno-go-snowflake
1118 go-github-com-kimmachinegun-automemlimit
1119 go-github-com-klauspost-compress
1120 go-github-com-maypok86-otter-v2
1121 go-github-com-minio-minio-go-v7
1122 go-github-com-pquerna-cachecontrol
1123 go-github-com-prometheus-client-golang
1124 go-github-com-samber-slog-multi
1125 go-github-com-stretchr-testify
1126 go-github-com-tj-go-redirects
1127 go-github-com-valyala-fasttemplate
1128 go-golang-org-x-net
1129 go-google-golang-org-protobuf))
1130 (home-page "https://codeberg.org/git-pages/git-pages")
1131 (synopsis "Scalable static site server for Git forges")
1132 (description
1133 "@command{git-pages} is a static site server for use with Git
1134forges (i.e. a @code{GitHub} Pages replacement). It is written with
1135efficiency in mind, scaling horizontally to any number of machines and serving
1136sites up to multiple gigabytes in size, while being equally suitable for small
1137single-user deployments.")
1138 (license license:bsd-0)))
1139
1140(define-public git-pages-cli
1141 (package
1142 (name "git-pages-cli")
1143 (version "1.9.0")
1144 (source
1145 (origin
1146 (method git-fetch)
1147 (uri (git-reference
1148 (url "https://codeberg.org/git-pages/git-pages-cli")
1149 (commit (string-append "v" version))))
1150 (file-name (git-file-name name version))
1151 (sha256
1152 (base32 "1ijkbc9d4jh5hn9lmcb39v0x03nbrf4zgzm0mb0c1p132py8p2mn"))))
1153 (build-system go-build-system)
1154 (arguments
1155 (list
1156 #:install-source? #f
1157 #:import-path "codeberg.org/git-pages/git-pages-cli"))
1158 (native-inputs
1159 (list go-github-com-google-uuid
1160 go-github-com-klauspost-compress
1161 go-github-com-spf13-pflag))
1162 (home-page "https://codeberg.org/git-pages/git-pages-cli")
1163 (synopsis "Command-line tool for publishing a site to a git-pages server")
1164 (description
1165 "@command{git-pages-cli} is a command-line application for publishing
1166sites to @url{https://codeberg.org/git-pages/git-pages, git-pages}.")
1167 (license license:bsd-0)))
1168
1169(define-public git-tools
1170 (package
1171 (name "git-tools")
1172 (version "2025.08")
1173 (source
1174 (origin
1175 (method git-fetch)
1176 (uri (git-reference
1177 (url "https://github.com/MestreLion/git-tools")
1178 (commit (string-append "v" version))))
1179 (file-name (git-file-name name version))
1180 (sha256
1181 (base32 "1djc40yzyrh4xhj1c717j7sqyhgwapz9mvsn9ja4yph3jxx6zs0f"))))
1182 (build-system copy-build-system)
1183 (arguments
1184 `(#:install-plan '(("git-branches-rename" "bin/git-branches-rename")
1185 ("git-clone-subset" "bin/git-clone-subset")
1186 ("git-find-uncommitted-repos"
1187 "bin/git-find-uncommitted-repos")
1188 ("git-rebase-theirs" "bin/git-rebase-theirs")
1189 ("git-restore-mtime" "bin/git-restore-mtime")
1190 ("git-strip-merge" "bin/git-strip-merge")
1191 ("./man1/" "share/man/man1"
1192 #:include-regexp (".*\\.1$")))))
1193 (inputs (list bash-minimal git-minimal python-minimal))
1194 (home-page "https://github.com/MestreLion/git-tools")
1195 (synopsis "Assorted git-related scripts and tools")
1196 (description
1197 "@code{git-tools} is a collection of bash and python scripts.
1198Specifically, it includes the following tools:
1199
1200@itemize
1201@item @code{git-branches-rename}: Batch rename branches with a matching prefix
1202to another prefix
1203@item @code{git-clone-subset}: Clone a subset of a git repository
1204@item @code{git-find-uncommitted-repos}: Recursively list repositories in the
1205given directory(ies) that have uncommitted changes
1206@item @code{git-rebase-theirs}: Resolve rebase conflicts and failed
1207cherry-picks by favoring \"theirs\" version
1208@item @code{git-restore-mtime}: Restore modification time of files based on
1209the date of the most recent commit that modified them
1210@item @code{git-strip-merge}: A git-merge wrapper that deletes files on a
1211\"foreign\" branch before merging
1212@end itemize")
1213 (license license:gpl3+)))
1214
1215(define-public git-spice
1216 (package
1217 (name "git-spice")
1218 (version "0.23.0")
1219 (source
1220 (origin
1221 (method git-fetch)
1222 (uri (git-reference
1223 (url "https://github.com/abhinav/git-spice")
1224 (commit (string-append "v" version))))
1225 (file-name (git-file-name name version))
1226 (sha256
1227 (base32 "1za4rr1jxjhlbbx0gw8wlsfa9dhw4zrpm43fz8scxlbh126wlid7"))))
1228 (build-system go-build-system)
1229 (arguments
1230 (list
1231 #:import-path "go.abhg.dev/gs"
1232 #:install-source? #f
1233 #:build-flags
1234 #~(list (string-append "-ldflags=-X main._version=" #$version))
1235 #:test-flags
1236 #~(list "-skip"
1237 (string-join
1238 ;; XXX: Tests failing with various reasons: requiring
1239 ;; networking config or write access, or outbound access, check
1240 ;; if some of them may be fixed.
1241 (list "TestAuthenticationFlow_PAT"
1242 "TestBuildRESTHandler_GETRequest"
1243 "TestBuildRESTHandler_GenericError"
1244 "TestBuildRESTHandler_HTTPError"
1245 "TestBuildRESTHandler_IntegerPath"
1246 "TestBuildRESTHandler_InvalidIntegerPath"
1247 "TestBuildRESTHandler_PathParameters"
1248 "TestDeviceFlowAuthenticator"
1249 "TestDeviceFlowAuthenticator"
1250 "TestForkWorkflow"
1251 "TestSelectAuthenticator")
1252 "|"))
1253 #:phases
1254 #~(modify-phases %standard-phases
1255 (add-after 'install 'install-shell-completion
1256 (lambda _
1257 (let* ((out #$output)
1258 (share (string-append out "/share"))
1259 (gs (string-append out "/bin/gs"))
1260 (bash-completions-dir
1261 (string-append out "/etc/bash_completion.d/"))
1262 (fish-completions-dir
1263 (string-append share "/fish/vendor_completions.d"))
1264 (zsh-completions-dir
1265 (string-append share "/zsh/site-functions")))
1266 (for-each mkdir-p
1267 (list bash-completions-dir
1268 fish-completions-dir
1269 zsh-completions-dir))
1270 (with-output-to-file
1271 (string-append bash-completions-dir "/gs")
1272 (lambda _ (invoke gs "shell" "completion" "bash")))
1273 (with-output-to-file
1274 (string-append fish-completions-dir "/gs.fish")
1275 (lambda _ (invoke gs "shell" "completion" "fish")))
1276 (with-output-to-file
1277 (string-append zsh-completions-dir "/_gs")
1278 (lambda _ (invoke gs "shell" "completion" "zsh")))))))))
1279 (native-inputs
1280 (list git-minimal/pinned ; for tests in testdata/scripts
1281 go-github-com-alecthomas-kong
1282 go-github-com-buildkite-shellwords
1283 go-github-com-charmbracelet-bubbles
1284 go-github-com-charmbracelet-bubbletea
1285 go-github-com-charmbracelet-lipgloss
1286 go-github-com-cli-browser
1287 go-github-com-creack-pty
1288 go-github-com-dustin-go-humanize
1289 go-github-com-hexops-autogold-v2
1290 go-github-com-mattn-go-isatty
1291 go-github-com-rogpeppe-go-internal-1.14
1292 go-github-com-sahilm-fuzzy
1293 go-github-com-shurcool-githubv4
1294 go-github-com-stretchr-testify
1295 go-github-com-tidwall-gjson
1296 go-github-com-vito-midterm
1297 go-github-com-zalando-go-keyring
1298 go-gitlab-com-gitlab-org-api-client-go
1299 go-go-abhg-dev-container-ring
1300 go-go-abhg-dev-io-ioutil
1301 go-go-abhg-dev-komplete
1302 go-go-abhg-dev-log-silog
1303 go-go-abhg-dev-testing-stub
1304 go-go-uber-org-mock
1305 go-golang-org-x-oauth2
1306 go-gopkg-in-dnaeon-go-vcr-v4
1307 go-gopkg-in-yaml-v3
1308 go-pgregory-net-rapid))
1309 (home-page "https://go.abhg.dev/gs")
1310 (synopsis "Manage stacks of Git branches")
1311 (description
1312 "git-spice (@code{gs}) is a command line tool for stacking Git branches,
1313a collection of branches expecting the trunk has a base branch. It manages
1314and navigates stacks of branches, conveniently modifies and rebases them also
1315provides an integration with GitHub and GitLab.")
1316 (license license:gpl3)))
1317
1318(define-public got
1319 (package
1320 (name "got")
1321 (version "0.128")
1322 (source (origin
1323 (method url-fetch)
1324 (uri
1325 (string-append
1326 "https://gameoftrees.org/releases/portable/got-portable-"
1327 version ".tar.gz"))
1328 (sha256
1329 (base32
1330 "0wjqc6l0vhyzdqiz7jbc6cagv77gm6kf3qglnshxsld1ksrbczjx"))))
1331 (inputs
1332 (list libevent
1333 `(,util-linux "lib")
1334 zlib
1335 libressl
1336 libmd
1337 libbsd
1338 ncurses))
1339 (native-inputs
1340 (list pkg-config perl))
1341 (arguments
1342 `(;; disable runpath validation, courtesy: libbsd's special
1343 ;; treatment of libmd, as it embeds path to libmd.so
1344 #:validate-runpath? #f
1345 ;; default values of GOT_*_PATH_* point to /usr/bin
1346 #:make-flags
1347 '("CFLAGS+=-DGOT_DIAL_PATH_SSH=\\\"ssh\\\""
1348 "CFLAGS+=-DGOT_TAG_PATH_SSH_KEYGEN=\\\"ssh-keygen\\\""
1349 "CFLAGS+=-DGOT_TAG_PATH_SIGNIFY=\\\"signify\\\"")
1350 #:phases ,#~(modify-phases %standard-phases
1351 (add-after 'unpack 'patch-execv-to-execvp
1352 (lambda _
1353 ;; got sources has paths hardcoded to /usr/bin
1354 (substitute* "lib/dial.c"
1355 (("execv\\(GOT_DIAL_") "execvp(GOT_DIAL_")
1356 (("execv %s\", GOT_DIAL") "execvp %s\", GOT_DIAL"))
1357 (substitute* "lib/sigs.c"
1358 (("execv\\(GOT_TAG") "execvp(GOT_TAG")
1359 (("execv %s\", GOT_TAG") "execvp %s\", GOT_TAG")))))))
1360 (build-system gnu-build-system)
1361 (synopsis "Distributed version control system")
1362 (description
1363 "Game of Trees (Got) is a version control system which prioritizes ease of use
1364and simplicity over flexibility.")
1365 (license license:isc)
1366 (home-page "https://gameoftrees.org/")
1367 (properties
1368 ;; Can lint for updates, but not update in place.
1369 '((release-monitoring-url . "https://gameoftrees.org/releases/")
1370 (lint-hidden-cpe-vendors . ("got_project"))))))
1371
1372(define-public xdiff
1373 (let ((revision "0")
1374 (commit "a137bc7ee6c76618ed1737c257548eaa10ac0089"))
1375 (package
1376 (name "xdiff")
1377 ;; The base version is taken from the CMakeLists.txt file.
1378 (version (git-version "0.1" revision commit))
1379 (source (origin
1380 (method git-fetch)
1381 (uri (git-reference
1382 (url "https://github.com/libgit2/xdiff")
1383 (commit commit)))
1384 (file-name (git-file-name name version))
1385 (sha256
1386 (base32
1387 "1rxzpag2pih64qlgq40xg1z6mz0bzvps4baxw7bmykyhjhc2gx75"))))
1388 (build-system cmake-build-system)
1389 (arguments
1390 (list
1391 #:modules '((guix build cmake-build-system)
1392 (guix build utils)
1393 (srfi srfi-26))
1394 #:tests? #f ;no test suite
1395 #:phases
1396 #~(modify-phases %standard-phases
1397 (add-after 'unpack 'create-shared-library
1398 (lambda _
1399 (substitute* "CMakeLists.txt"
1400 (("add_library\\(xdiff STATIC")
1401 "add_library(xdiff SHARED"))))
1402 (replace 'install ;no install target
1403 (lambda _
1404 (with-directory-excursion "../source"
1405 (for-each (cute install-file <>
1406 (string-append #$output "/include"))
1407 (list "xdiff.h"
1408 "git-xdiff.h"))) ;included by xdiff.h
1409 (install-file "libxdiff.so"
1410 (string-append #$output "/lib")))))))
1411 (home-page "https://github.com/libgit2/xdiff")
1412 (synopsis "File differential library used by git")
1413 (description "@code{xdiff} is the file differential library used by git,
1414which has been extracted into a standalone library for compatibility with
1415other git-like projects such as @code{libgit2}.")
1416 (license license:lgpl2.1+))))
1417
1418(define-public libgit2-1.9
1419 (package
1420 (name "libgit2")
1421 (version "1.9.7")
1422 (source (origin
1423 (method git-fetch)
1424 (uri (git-reference
1425 (url "https://github.com/libgit2/libgit2")
1426 (commit (string-append "v" version))))
1427 (file-name (git-file-name "libgit2" version))
1428 (sha256
1429 (base32 "0jhm723bc9v18yanlqvmwn9kpmnvbcavnlhd4jcw0n082d7jl54h"))
1430 (patches
1431 (search-patches "libgit2-proxy-reconnection.patch"
1432 "libgit2-path-max.patch"))
1433 (modules '((guix build utils)))
1434 (snippet
1435 #~(begin
1436 (for-each delete-file-recursively
1437 '("deps/chromium-zlib"
1438 "deps/llhttp"
1439 "deps/ntlmclient"
1440 "deps/pcre2"
1441 "deps/winhttp"
1442 "deps/zlib"))))))
1443 (build-system cmake-build-system)
1444 (outputs '("out" "debug"))
1445 (arguments
1446 (list #:configure-flags
1447 #~(list "-DUSE_NTLMCLIENT=OFF" ;TODO: package this
1448 "-DREGEX_BACKEND=pcre2"
1449 "-DUSE_HTTP_PARSER=http-parser"
1450 "-DUSE_SSH=ON" ; cmake fails to find libssh if this is missing
1451
1452 ;; Use the SHA1 implementation from OpenSSL rather than the
1453 ;; builtin one. This halves the CPU time spent in the
1454 ;; "indexing objects" phase when cloning the Guix repo.
1455 "-DUSE_SHA1=HTTPS"
1456
1457 ;; See https://github.com/libgit2/libgit2/issues/7169
1458 #$@(if (target-32bit?)
1459 '("-DCMAKE_C_FLAGS=-D_FILE_OFFSET_BITS=64")
1460 '()))
1461 #:phases
1462 #~(modify-phases %standard-phases
1463 ;; Run checks more verbosely, unless we are cross-compiling.
1464 (replace 'check
1465 (lambda* (#:key (tests? #t) #:allow-other-keys)
1466 (if tests?
1467 (invoke "./libgit2_tests" "-v" "-Q")
1468 ;; Tests may be disabled if cross-compiling.
1469 (format #t "Test suite not run.~%")))))))
1470 (inputs
1471 (list http-parser))
1472 (native-inputs
1473 (list pkg-config python))
1474 (propagated-inputs
1475 ;; These libraries are in 'Requires.private' in libgit2.pc.
1476 (list openssl libssh2 pcre2 zlib))
1477 (home-page "https://libgit2.org/")
1478 (synopsis "Library providing Git core methods")
1479 (description
1480 "Libgit2 is a portable, pure C implementation of the Git core methods
1481provided as a re-entrant linkable library with a solid API, allowing you to
1482write native speed custom Git applications in any language with bindings.")
1483 ;; GPLv2 with linking exception
1484 (license license:gpl2)))
1485
1486(define-public libgit2-1.8
1487 (package
1488 (inherit libgit2-1.9)
1489 (version "1.8.7")
1490 (source (origin
1491 (method git-fetch)
1492 (uri (git-reference
1493 (url "https://github.com/libgit2/libgit2")
1494 (commit (string-append "v" version))))
1495 (file-name (git-file-name "libgit2" version))
1496 (sha256
1497 (base32
1498 "1lhvrfms0p4n817c2lc9cqpgx1v82szr1p6v60jp4rpm6gfrpg6d"))
1499 (patches
1500 (search-patches "libgit2-uninitialized-proxy-settings.patch"))
1501 (modules '((guix build utils)))
1502 (snippet
1503 '(begin
1504 (for-each delete-file-recursively
1505 '("deps/chromium-zlib"
1506 "deps/llhttp"
1507 "deps/ntlmclient"
1508 "deps/pcre2"
1509 "deps/winhttp"
1510 "deps/zlib"))))))
1511 (inputs
1512 (list libssh2 http-parser))
1513 (propagated-inputs
1514 ;; These libraries are in 'Requires.private' in libgit2.pc.
1515 (list openssl pcre2 zlib))))
1516
1517(define-public libgit2-1.7
1518 (package
1519 (inherit libgit2-1.8)
1520 (version "1.7.2")
1521 (source (origin
1522 (method git-fetch)
1523 (uri (git-reference
1524 (url "https://github.com/libgit2/libgit2")
1525 (commit (string-append "v" version))))
1526 (file-name (git-file-name "libgit2" version))
1527 (sha256
1528 (base32
1529 "0i95jwrwx4svh5l4dpa5r4a99f813hlm7nzzkbqzmnw4pkyxhlvx"))
1530 ;; We need to use the bundled xdiff until an option is given
1531 ;; to use the one from git.
1532 (modules '((guix build utils)))
1533 (snippet
1534 '(begin
1535 (for-each delete-file-recursively
1536 '("deps/chromium-zlib"
1537 "deps/http-parser"
1538 "deps/ntlmclient"
1539 "deps/pcre"
1540 "deps/winhttp"
1541 "deps/zlib"))))))
1542 (arguments
1543 (substitute-keyword-arguments (package-arguments libgit2-1.8)
1544 ((#:configure-flags _ #~(list))
1545 `(list "-DUSE_NTLMCLIENT=OFF" ;TODO: package this
1546 "-DREGEX_BACKEND=pcre2"
1547 "-DUSE_HTTP_PARSER=system"
1548 "-DUSE_SSH=ON")))))) ; cmake fails to find libssh if this is missing
1549
1550(define-public libgit2-1.6
1551 (package
1552 (inherit libgit2-1.7)
1553 (version "1.6.5")
1554 (source (origin
1555 (method git-fetch)
1556 (uri (git-reference
1557 (url "https://github.com/libgit2/libgit2")
1558 (commit (string-append "v" version))))
1559 (file-name (git-file-name "libgit2" version))
1560 (sha256
1561 (base32
1562 "1v8sndvknsknf0i967qidmz73q9jx928iq7fqqgx3rbwn2g1gn6s"))
1563 (modules '((guix build utils)))
1564 (snippet
1565 '(begin
1566 (delete-file-recursively "deps")))))))
1567
1568(define-public libgit2-1.5
1569 (package
1570 (inherit libgit2-1.7)
1571 (version "1.5.2")
1572 (source (origin
1573 (method git-fetch)
1574 (uri (git-reference
1575 (url "https://github.com/libgit2/libgit2")
1576 (commit (string-append "v" version))))
1577 (file-name (git-file-name "libgit2" version))
1578 (sha256
1579 (base32
1580 "0v9jdaxmqrzbs9v5vhh2xf5xv9h29q8qqn8vmns279ljx1zav5yd"))
1581 (modules '((guix build utils)))
1582 (snippet
1583 '(begin
1584 (delete-file-recursively "deps")))))))
1585
1586(define-public libgit2
1587 ;; Default version of libgit2.
1588 libgit2-1.9)
1589
1590(define-public libgit2-1.3
1591 (package
1592 (inherit libgit2-1.5)
1593 (version "1.3.2")
1594 (source (origin
1595 (inherit (package-source libgit2-1.5))
1596 (method git-fetch)
1597 (uri (git-reference
1598 (url "https://github.com/libgit2/libgit2")
1599 (commit (string-append "v" version))))
1600 (file-name (git-file-name "libgit2" version))
1601 (sha256
1602 (base32
1603 "1dngga8jq419z6ps65wpmh2jihcf70k6r98pb1m1yiwj7qqh9792"))))
1604 (arguments
1605 (substitute-keyword-arguments (package-arguments libgit2-1.5)
1606 ((#:configure-flags _ #~'())
1607 ;; XXX: Drop '-DUSE_SHA1=HTTPS' to avoid a major rebuild.
1608 #~(list "-DUSE_NTLMCLIENT=OFF"
1609 "-DREGEX_BACKEND=pcre2"
1610 "-DUSE_HTTP_PARSER=system"
1611 "-DUSE_SSH=ON" ; cmake fails to find libssh if this is missing
1612 ;; See https://github.com/libgit2/libgit2/issues/7169
1613 #$@(if (target-32bit?)
1614 '("-DCMAKE_C_FLAGS=-D_FILE_OFFSET_BITS=64")
1615 '())))
1616 ((#:phases _ '%standard-phases)
1617 `(modify-phases %standard-phases
1618 ;; Run checks more verbosely, unless we are cross-compiling.
1619 (replace 'check
1620 (lambda* (#:key (tests? #t) #:allow-other-keys)
1621 (if tests?
1622 (invoke "./libgit2_clar" "-v" "-Q")
1623 ;; Tests may be disabled if cross-compiling.
1624 (format #t "Test suite not run.~%"))))))))))
1625
1626(define-public git-issue
1627 (let ((commit "d056998566d30235072b97982756ff607e9ecce9")
1628 (revision "0"))
1629 (package
1630 (name "git-issue")
1631 (version (git-version "0" revision commit))
1632 (source (origin
1633 (method git-fetch)
1634 (uri (git-reference
1635 (url "https://github.com/dspinellis/git-issue")
1636 (commit commit)))
1637 (sha256
1638 (base32
1639 "0002bjzv6rgpxbbsjiswg73prl7iq217qvafbxhsjp2wjj00i0sm"))))
1640 (build-system gnu-build-system)
1641 (arguments
1642 (list #:make-flags #~(list (string-append "PREFIX=" #$output))
1643 #:test-target "test"
1644 #:phases
1645 #~(modify-phases %standard-phases
1646 (delete 'configure) ;no configure script
1647 (add-before 'build 'generate-docs
1648 (lambda _
1649 (invoke "make" "sync-docs")))
1650 (add-before 'check 'fix-tests
1651 (lambda _
1652 (substitute* "test.sh"
1653 ;; Skip 3 failing tests.
1654 (("fail \"Uncommitted files sync-docs.*")
1655 "ok \"ignored\"\n")
1656 (("try_grep '\\^Tags:\\.\\*cloned'")
1657 "ok \"ignored\"")
1658 (("try \"\\$gi\" tag \"\\$issue\" cloned")
1659 "ok \"ignored\"")
1660 ;; Fix a test.
1661 (("#!/bin/sh") (string-append "#!" (which "sh")))))))))
1662 (native-inputs (list git-minimal/pinned util-linux))
1663 (inputs (list jq curl))
1664 (synopsis "Git-based decentralized issue management")
1665 (description
1666 "This is a minimalist decentralized issue management system based on
1667Git, offering (optional) bidirectional integration with GitHub and GitLab
1668issue management.")
1669 (home-page "https://github.com/dspinellis/git-issue")
1670 (license license:gpl3+))))
1671
1672(define-public git-credential-oauth
1673 (package
1674 (name "git-credential-oauth")
1675 (version "0.15.1")
1676 (source
1677 (origin
1678 (method git-fetch)
1679 (uri (git-reference
1680 (url "https://github.com/hickford/git-credential-oauth")
1681 (commit (string-append "v" version))))
1682 (file-name (git-file-name name version))
1683 (sha256
1684 (base32 "1fid6dl82val6miq61dm203y7k2kzccpmra43fngnqrr1p4hh2pl"))))
1685 (build-system go-build-system)
1686 (arguments
1687 (list
1688 #:install-source? #f
1689 #:build-flags #~(list (string-append "-ldflags=-X main.version="
1690 #$version))
1691 #:import-path "github.com/hickford/git-credential-oauth"
1692 #:phases
1693 #~(modify-phases %standard-phases
1694 (add-after 'install 'install-manpages
1695 (lambda* (#:key import-path #:allow-other-keys)
1696 (let ((man (string-append "src/" import-path
1697 "/git-credential-oauth.1")))
1698 (install-file man (string-append #$output "/share/man/man1"))))))))
1699 (native-inputs
1700 (list go-golang-org-x-oauth2))
1701 (home-page "https://github.com/hickford/git-credential-oauth")
1702 (synopsis "Git credential helper that securely authenticates using OAuth")
1703 (description
1704 "git-credential-oauth is a Git credential helper that securely
1705authenticates to GitHub, GitLab, BitBucket, Gerrit, Gitea, and Forgejo using
1706OAuth. The first time you authenticate, the helper opens a browser window to
1707the host. Subsequent authentication within storage lifetime is
1708non-interactive.")
1709 (license license:asl2.0)))
1710
1711(define-public git-crypt
1712 (package
1713 (name "git-crypt")
1714 (version "0.8.0")
1715 (source
1716 (origin
1717 (method git-fetch)
1718 (uri (git-reference
1719 (url "https://github.com/AGWA/git-crypt")
1720 (commit version)))
1721 (file-name (git-file-name name version))
1722 (sha256
1723 (base32 "0kr3z095vg08mbq9j9sl4lchnq1q9rz4a1nik1pqxh6hdn5kfcpj"))))
1724 (build-system gnu-build-system)
1725 (inputs
1726 (list git openssl))
1727 (native-inputs
1728 (list docbook-xml-4.2 docbook-xsl libxslt))
1729 (arguments
1730 (list
1731 #:tests? #f ; No tests.
1732 #:make-flags
1733 #~(list
1734 "ENABLE_MAN=yes"
1735 ;; Add flag to work around OpenSSL 3 incompatibility.
1736 ;; See <https://github.com/AGWA/git-crypt/issues/232>.
1737 "CXXFLAGS+=-DOPENSSL_API_COMPAT=0x30000000L"
1738 (string-append "PREFIX=" #$output))
1739 #:phases
1740 #~(modify-phases %standard-phases
1741 (delete 'configure))))
1742 (home-page "https://www.agwa.name/projects/git-crypt/")
1743 (synopsis "Transparent encryption of files in a git repository")
1744 (description "git-crypt enables transparent encryption and decryption of
1745files in a git repository. Files which you choose to protect are encrypted when
1746committed, and decrypted when checked out. git-crypt lets you freely share a
1747repository containing a mix of public and private content. git-crypt gracefully
1748degrades, so developers without the secret key can still clone and commit to a
1749repository with encrypted files. This lets you store your secret material (such
1750as keys or passwords) in the same repository as your code, without requiring you
1751to lock down your entire repository.")
1752 (license license:gpl3+)))
1753
1754(define-public git-remote-gcrypt
1755 (package
1756 (name "git-remote-gcrypt")
1757 (version "1.5")
1758 (source (origin
1759 (method git-fetch)
1760 (uri (git-reference
1761 (url "https://git.spwhitton.name/git-remote-gcrypt")
1762 (commit version)))
1763 (file-name (git-file-name name version))
1764 (sha256
1765 (base32
1766 "1m1wlbqpqyhh2z0ka3gjs5yabd32nnkzw5hak6czcqrhhkfsqbmv"))))
1767 (build-system trivial-build-system)
1768 (arguments
1769 `(#:modules ((guix build utils))
1770 #:builder (begin
1771 (use-modules (guix build utils))
1772 (let* ((source (assoc-ref %build-inputs "source"))
1773 (output (assoc-ref %outputs "out"))
1774 (bindir (string-append output "/bin")))
1775 (install-file (string-append source "/git-remote-gcrypt")
1776 bindir)))))
1777 (home-page "https://spwhitton.name/tech/code/git-remote-gcrypt/")
1778 (synopsis "Whole remote repository encryption")
1779 (description "git-remote-gcrypt is a Git remote helper to push and pull from
1780repositories encrypted with GnuPG. It works with the standard Git transports,
1781including repository hosting services like GitLab.
1782
1783Remote helper programs are invoked by Git to handle network transport. This
1784helper handles @code{gcrypt:} URLs that access a remote repository encrypted
1785with GPG, using our custom format.
1786
1787Supported locations are local, @code{rsync://} and @code{sftp://}, where the
1788repository is stored as a set of files, or instead any Git URL where gcrypt
1789will store the same representation in a Git repository, bridged over arbitrary
1790Git transport.
1791
1792The aim is to provide confidential, authenticated Git storage and
1793collaboration using typical untrusted file hosts or services.")
1794 (license license:gpl3+)))
1795
1796(define-public git-remote-tor
1797 (package
1798 (name "git-remote-tor")
1799 (version "0.1.4")
1800 (source
1801 (origin
1802 (method url-fetch)
1803 (uri (crate-uri "git-remote-tor" version))
1804 (file-name (string-append name "-" version ".tar.gz"))
1805 (sha256
1806 (base32 "146nyd5ww073iim48r71knfwnldq635xv732h3kl4ycsh2ki3ycx"))))
1807 (build-system cargo-build-system)
1808 (arguments
1809 (list
1810 #:install-source? #f
1811 #:phases
1812 #~(modify-phases %standard-phases
1813 (add-after 'unpack 'adjust-torify
1814 (lambda* (#:key inputs #:allow-other-keys)
1815 (let ((torsocks (search-input-file inputs "/bin/torsocks")))
1816 (substitute* '("src/main.rs" "git-remote-tor.sh")
1817 (("Command::new\\(\"torsocks\"\\)")
1818 (string-append "Command::new(\"" torsocks "\")"))
1819 (("exec torsocks")
1820 (string-append "exec " torsocks))
1821 ((" and torsocks installed")
1822 ""))))))))
1823 (inputs (cons torsocks
1824 (cargo-inputs 'git-remote-tor)))
1825 (home-page "https://agentofuser.com/git-remote-tor/")
1826 (synopsis "Seamless .onion and tor-ified git remotes")
1827 (description
1828 "This package provides Seamless .onion and tor-ified git remotes.")
1829 (license (list license:expat license:asl2.0))))
1830
1831(define-public git-repo-go
1832 (package
1833 (name "git-repo-go")
1834 (version "1.0.0")
1835 (source (origin
1836 (method git-fetch)
1837 (uri (git-reference
1838 (url "https://github.com/Apteryks/git-repo-go")
1839 (commit (string-append "v" version))))
1840 (file-name (git-file-name name version))
1841 (sha256
1842 (base32
1843 "1y310dmpiaii6d84d9pvdv4wz4mx7snbpm7v9n400q0j8qnjal32"))))
1844 (build-system go-build-system)
1845 (arguments
1846 (list
1847 #:import-path "github.com/Apteryks/git-repo-go"
1848 #:build-flags
1849 #~(list "-ldflags" (string-append
1850 "-s -w " ;default ldflags
1851 "-X github.com/Apteryks/git-repo-go/version.Version="
1852 #$version))
1853 #:install-source? #f
1854 #:phases
1855 #~(modify-phases %standard-phases
1856 (add-after 'unpack 'patch-commands
1857 (lambda* (#:key inputs #:allow-other-keys)
1858 (with-directory-excursion "src/github.com/Apteryks/git-repo-go"
1859 (substitute* "config/hooks.go"
1860 ;; The commit-msg hook script is executed by Git during the
1861 ;; tests, so must have a fully referenced /bin/sh shebang.
1862 (("#!/bin/sh")
1863 (format #f "#!~a"
1864 (search-input-file inputs "bin/sh"))))
1865 (substitute* "test/t1302-helper-remote-unknown.sh"
1866 ;; This test creates some helper scripts.
1867 (("#!/bin/sh")
1868 (format #f "#!~a" (which "sh")))))))
1869 (add-before 'check 'make-HOME-writable
1870 (lambda _
1871 (setenv "HOME" "/tmp")))
1872 (add-after 'install 'functional-check
1873 (lambda* (#:key tests? #:allow-other-keys)
1874 (when tests?
1875 (setenv "PATH" (string-append #$output "/bin:"
1876 (getenv "PATH")))
1877 ;; Run the integration test suite. Parallelism
1878 ;; doesn't currently work (see:
1879 ;; https://github.com/Apteryks/git-repo-go/issues/1)
1880 (setenv "GIT_TEST_OPTS" "--verbose")
1881 (invoke "make" "-C"
1882 "src/github.com/Apteryks/git-repo-go/test")))))))
1883 (native-inputs
1884 (list git-minimal/pinned
1885 go-github-com-go-git-go-git-v5
1886 go-github-com-h2non-gock
1887 go-github-com-jiangxin-goconfig
1888 go-github-com-jiangxin-multi-log
1889 go-github-com-jiu2015-gotestspace
1890 go-github-com-mattn-go-isatty
1891 go-github-com-mattn-go-shellwords
1892 go-github-com-mitchellh-go-homedir
1893 go-github-com-spf13-cobra
1894 go-github-com-spf13-pflag
1895 go-github-com-spf13-viper
1896 go-github-com-stretchr-testify
1897 go-golang-org-x-crypto
1898 go-gopkg-in-yaml-v2
1899 perl
1900 python-minimal))
1901 (inputs
1902 (list bash-minimal))
1903 (home-page "https://git-repo.info/en/docs/")
1904 (synopsis "Git extensions for AGit-Flow and Gerrit servers")
1905 (description
1906 "@command{git-repo} provides Git extensions for interacting conveniently
1907with AGit-Flow or Gerrit servers. It makes it possible to create, update or
1908fetch @acronym{PR, pull requests}, and more. It is based on the
1909@command{repo} tool that was developed for the Gerrit project, but also
1910supports AGit-Flow and lifts the requirement to use a manifest file.")
1911 (license license:asl2.0)))
1912
1913(define-public github-cli
1914 (package
1915 (name "github-cli")
1916 (version "2.83.2")
1917 (source
1918 (origin
1919 (method git-fetch)
1920 (uri (git-reference
1921 (url "https://github.com/cli/cli")
1922 (commit (string-append "v" version))))
1923 (file-name (git-file-name name version))
1924 (sha256
1925 (base32 "04kpcy15r7px92mf13jf4w0v07sjnfqc09m1vfvr5pmw7xsg35k2"))))
1926 (build-system go-build-system)
1927 (arguments
1928 (list
1929 #:install-source? #f
1930 #:import-path "github.com/cli/cli/v2/cmd/gh"
1931 #:unpack-path "github.com/cli/cli/v2"
1932 #:embed-files
1933 #~(list ".*\\.xml" ".*\\.tmpl"
1934 ;; sigstore-go TUF repository files (root.json, staging_root.json)
1935 ".*_?root\\.json" "trusted_root\\.json"
1936 ;; go-openapi/spec schema files
1937 "jsonschema-draft-04\\.json" "schema\\.json")
1938 #:modules
1939 '((guix build go-build-system)
1940 (guix build utils)
1941 (ice-9 match))
1942 #:phases
1943 #~(modify-phases %standard-phases
1944 (add-after 'install 'install-extras
1945 (lambda* (#:key unpack-path native-inputs #:allow-other-keys)
1946 (for-each
1947 (match-lambda
1948 ((shell . path)
1949 (mkdir-p (in-vicinity #$output (dirname path)))
1950 (let ((binary
1951 (if #$(%current-target-system)
1952 (search-input-file native-inputs "bin/gh")
1953 (in-vicinity #$output "bin/gh"))))
1954 (with-output-to-file (in-vicinity #$output path)
1955 (lambda _
1956 (invoke binary "completion" "--shell" shell))))))
1957 '(("bash" . "share/bash-completion/completions/gh")
1958 ("fish" . "share/fish/vendor_completions.d/gh.fish")
1959 ("zsh" . "share/zsh/site-functions/_gh")))
1960 ;; Also install the manpages
1961 ;; taken from script/build.go
1962 (mkdir-p (in-vicinity #$output "share/man/man1"))
1963 (with-directory-excursion (string-append "src/" unpack-path)
1964 (invoke "go" "run" "./cmd/gen-docs"
1965 "--man-page" "--doc-path"
1966 (in-vicinity #$output "share/man/man1"))))))))
1967 (native-inputs
1968 (append
1969 (if (%current-target-system)
1970 (list this-package)
1971 '())
1972 (list go-github-com-atotto-clipboard
1973 go-github-com-briandowns-spinner
1974 go-github-com-cenkalti-backoff-v4
1975 go-github-com-cenkalti-backoff-v5
1976 go-github-com-charmbracelet-glamour
1977 go-github-com-charmbracelet-huh
1978 go-github-com-charmbracelet-lipgloss
1979 go-github-com-cli-go-gh-v2
1980 go-github-com-cli-oauth
1981 go-github-com-cli-safeexec
1982 go-github-com-digitorus-timestamp
1983 go-github-com-distribution-reference
1984 go-github-com-gabriel-vasile-mimetype
1985 go-github-com-gdamore-tcell-v2
1986 go-github-com-gorilla-websocket
1987 go-github-com-hashicorp-go-multierror
1988 go-github-com-hashicorp-go-version
1989 go-github-com-itchyny-timefmt-go
1990 go-github-com-joho-godotenv
1991 go-github-com-makenowjust-heredoc
1992 go-github-com-masterminds-sprig-v3
1993 go-github-com-microsoft-dev-tunnels
1994 go-github-com-muhammadmuzzammil1998-jsonc
1995 go-github-com-opentracing-opentracing-go
1996 go-github-com-rivo-tview
1997 go-github-com-shurcool-githubv4
1998 go-github-com-sigstore-sigstore-go
1999 go-github-com-spf13-cobra
2000 go-github-com-spf13-pflag
2001 go-github-com-stretchr-testify
2002 go-github-com-vmihailenco-msgpack-v5
2003 go-github-com-zalando-go-keyring
2004 go-golang-org-x-sys
2005 go-golang-org-x-term
2006 go-golang-org-x-text
2007 go-google-golang-org-grpc
2008 go-gopkg-in-yaml-v3)))
2009 (home-page "https://cli.github.com/")
2010 (synopsis "GitHub's official command-line tool")
2011 (description
2012 "@command{gh} is GitHub on the command line. It brings pull requests,
2013issues, and other GitHub concepts to the terminal next to where you are
2014already working with git and your code. It works with GitHub.com, GitHub
2015Enterprise Cloud, and GitHub Enterprise Server 2.20+.")
2016 (license license:expat)))
2017
2018(define-public cgit
2019 (package
2020 (name "cgit")
2021 ;; Update the ‘git-source’ input as well.
2022 (version "1.3")
2023 (source (origin
2024 (method git-fetch)
2025 (uri (git-reference
2026 (url "https://git.zx2c4.com/cgit")
2027 (commit (string-append "v" version))))
2028 (sha256
2029 (base32
2030 "1miwjvh4maxx6b5345wjnndzw58907lh9vif5ajqwwda6sicsnmj"))
2031 (file-name (git-file-name name version))))
2032 (build-system gnu-build-system)
2033 (arguments
2034 (list
2035 #:tests? #f ; XXX: fail to build the in-source git.
2036 #:test-target "test"
2037 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
2038 "SHELL_PATH=sh")
2039 #:phases
2040 #~(modify-phases %standard-phases
2041 (add-after 'unpack 'unpack-git
2042 (lambda* (#:key inputs #:allow-other-keys)
2043 ;; Unpack the source of git into the 'git' directory.
2044 (invoke "tar" "--strip-components=1" "-C" "git" "-xf"
2045 #$(this-package-input "git-source.tar.xz"))))
2046 (add-after 'unpack 'patch-absolute-file-names
2047 (lambda* (#:key inputs outputs #:allow-other-keys)
2048 (define (quoted-file-name input path)
2049 (string-append "\"" input path "\""))
2050 (substitute* "ui-snapshot.c"
2051 (("\"gzip\"")
2052 (quoted-file-name (assoc-ref inputs "gzip") "/bin/gzip"))
2053 (("\"bzip2\"")
2054 (quoted-file-name (assoc-ref inputs "bzip2") "/bin/bzip2"))
2055 (("\"xz\"")
2056 (quoted-file-name (assoc-ref inputs "xz") "/bin/xz")))
2057
2058 (substitute* "filters/about-formatting.sh"
2059 (("\\$\\(dirname \\$0\\)") (string-append (assoc-ref outputs "out")
2060 "/lib/cgit/filters"))
2061 (("\\| tr") (string-append "| " (which "tr"))))
2062
2063 (substitute* "filters/html-converters/txt2html"
2064 (("sed") (which "sed")))
2065
2066 (substitute* "filters/html-converters/man2html"
2067 (("groff") (which "groff")))
2068
2069 (substitute* "filters/html-converters/rst2html"
2070 (("rst2html\\.py") (which "rst2html.py")))))
2071 (delete 'configure) ; no configure script
2072 (add-after 'build 'build-man
2073 (lambda* (#:key make-flags #:allow-other-keys)
2074 (apply invoke "make" "doc-man" make-flags)))
2075 (replace 'install
2076 (lambda* (#:key make-flags outputs #:allow-other-keys)
2077 (let ((out (assoc-ref outputs "out")))
2078 (apply invoke
2079 "make" "install" "install-man"
2080 (string-append "prefix=" out)
2081 (string-append "CGIT_SCRIPT_PATH=" out "/share/cgit")
2082 make-flags)
2083 ;; Move the platform-dependent 'cgit.cgi' into lib to get it
2084 ;; stripped.
2085 (rename-file (string-append out "/share/cgit/cgit.cgi")
2086 (string-append out "/lib/cgit/cgit.cgi")))))
2087 (add-after 'install 'wrap-python-scripts
2088 (lambda* (#:key outputs #:allow-other-keys)
2089 (for-each
2090 (lambda (file)
2091 (wrap-program (string-append (assoc-ref outputs "out")
2092 "/lib/cgit/filters/" file)
2093 `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH")))))
2094 '("syntax-highlighting.py"
2095 "html-converters/md2html")))))))
2096 (native-inputs
2097 ;; For building manpage.
2098 (list asciidoc))
2099 (inputs
2100 (list (origin
2101 (method url-fetch)
2102 ;; Building cgit requires a Git source tree.
2103 ;; cgit is tightly bound to git. Use GIT_VER from the Makefile,
2104 ;; which may not match the current (package-version git).
2105 (uri "mirror://kernel.org/software/scm/git/git-2.53.0.tar.xz")
2106 (sha256
2107 (base32
2108 "0ly6335f4qd5qkzk3xwib6h1i26w17b37968zsyvnqdhh1yvs62q"))
2109 (file-name "git-source.tar.xz"))
2110 bash-minimal
2111 openssl
2112 python
2113 python-docutils-0.19
2114 python-markdown
2115 python-pygments
2116 zlib
2117 ;; bzip2, groff, gzip and xz are inputs (not native inputs)
2118 ;; since they are actually substituted into cgit source and
2119 ;; referenced by the built package output.
2120 bzip2
2121 groff
2122 gzip
2123 xz))
2124 (home-page "https://git.zx2c4.com/cgit/")
2125 (synopsis "Web frontend for git repositories")
2126 (description
2127 "CGit is an attempt to create a fast web interface for the Git SCM, using
2128a built-in cache to decrease server I/O pressure.")
2129 (license license:gpl2)))
2130
2131(define-public cgit-pink
2132 (package
2133 (inherit cgit)
2134 (name "cgit-pink")
2135 (version "1.4.1")
2136 (source (origin
2137 (method git-fetch)
2138 (uri (git-reference
2139 (url "https://git.causal.agency/cgit-pink")
2140 (commit version)))
2141 (file-name (git-file-name name version))
2142 (sha256
2143 (base32
2144 "0yp6rm60pz8pj8wrm1aglix51hhy00al86mm94ag2bifc92q23ar"))))
2145 (arguments
2146 (substitute-keyword-arguments arguments
2147 ((#:tests? _ #f)
2148 (not (%current-target-system)))
2149 ((#:make-flags _ '())
2150 #~(list (string-append "CC=" #$(cc-for-target))
2151 (string-append "PERL_PATH="
2152 (search-input-file %build-inputs "/bin/perl"))
2153 ;; It is important to set an absolute path in SHELL_PATH
2154 ;; because it is used as the shebang of generated scripts that
2155 ;; are invoked during the test phase.
2156 (string-append "SHELL_PATH="
2157 (search-input-file %build-inputs "/bin/sh"))))
2158 ((#:phases phases #~%standard-phases)
2159 #~(modify-phases #$phases
2160 (replace 'unpack-git
2161 (lambda _
2162 ;; Unpack the source of git into the 'git' directory.
2163 (invoke "tar" "--strip-components=1" "-C" "git" "-xf"
2164 #$(this-package-input "git-source.tar.xz"))))))))
2165 (inputs
2166 (modify-inputs inputs
2167 (replace "git-source.tar.xz"
2168 ;; cgit-pink is tightly bound to git. Use GIT_VER from the Makefile,
2169 ;; which may not match the current (package-version git).
2170 (origin
2171 (method url-fetch)
2172 (uri "mirror://kernel.org/software/scm/git/git-2.36.1.tar.xz")
2173 (sha256
2174 (base32
2175 "0w43a35mhc2qf2gjkxjlnkf2lq8g0snf34iy5gqx2678yq7llpa0"))))))
2176 (native-inputs
2177 (modify-inputs native-inputs
2178 (append gnu-gettext perl)))
2179 (home-page "https://git.causal.agency/cgit-pink/about/")
2180 (description "cgit-pink is a fast web interface for the Git SCM, using a
2181built-in cache to decrease server I/O pressure. cgit-pink is a fork of
2182cgit.")))
2183
2184(define-public python-git-multimail
2185 (let ((commit "747fad49038b1f0eea12ab4ad453fb404111fe11")
2186 (revision "0"))
2187 (package
2188 (name "python-git-multimail")
2189 (version (git-version "1.6.0" revision commit))
2190 (source
2191 (origin
2192 (method git-fetch)
2193 (uri (git-reference
2194 (url "https://github.com/git-multimail/git-multimail")
2195 (commit commit)))
2196 (file-name (git-file-name name version))
2197 (sha256
2198 (base32 "101lm3sxdi844bj91x1sqnjw1lmqv1ir1m2dr2nfv9gap94pvaiw"))))
2199 (build-system pyproject-build-system)
2200 (arguments
2201 (list
2202 ;; Some tests are failing, but the test suite is not configurable.
2203 #:tests? #f
2204 #:phases
2205 #~(modify-phases %standard-phases
2206 (add-after 'unpack 'patch
2207 (lambda* (#:key inputs #:allow-other-keys)
2208 (substitute* "setup.py"
2209 (("'git-multimail', 'README.rst'")
2210 "'README.rst'"))
2211 (substitute* "git-multimail/git_multimail.py"
2212 (("GIT_EXECUTABLE = 'git'")
2213 (format #f "GIT_EXECUTABLE = '~a'"
2214 (search-input-file inputs "bin/git")))
2215 (("/usr/sbin/sendmail")
2216 (search-input-file inputs "/sbin/sendmail")))))
2217 (replace 'check
2218 (lambda* (#:key tests? #:allow-other-keys)
2219 (when tests?
2220 (with-directory-excursion "t"
2221 (invoke "make" "test"))))))))
2222 (native-inputs (list python-setuptools))
2223 (inputs (list git sendmail))
2224 (home-page "https://github.com/git-multimail/git-multimail")
2225 (synopsis "Send notification emails for Git pushes")
2226 (description
2227 "This hook sends emails describing changes introduced by pushes to a Git
2228repository. For each reference that was changed, it emits one ReferenceChange
2229email summarizing how the reference was changed, followed by one Revision
2230email for each new commit that was introduced by the reference change.
2231
2232This script is designed to be used as a post-receive hook in a Git
2233repository")
2234 (license license:gpl2))))
2235
2236(define-public python-ghp-import
2237 (package
2238 (name "python-ghp-import")
2239 (version "2.1.0")
2240 (source
2241 (origin
2242 (method git-fetch)
2243 (uri (git-reference
2244 (url "https://github.com/c-w/ghp-import")
2245 (commit version)))
2246 (file-name (git-file-name name version))
2247 (sha256
2248 (base32 "1v6kay6yr8sz0601ib8lrvbgpxslhll20b28i04bdwj1f1cjygy4"))))
2249 (build-system pyproject-build-system)
2250 (arguments
2251 (list
2252 #:tests? #f ;no tests, also not in Git
2253 #:phases
2254 #~(modify-phases %standard-phases
2255 (add-after 'install 'install-documentation
2256 (lambda* (#:key outputs #:allow-other-keys)
2257 (let* ((out (assoc-ref outputs "out"))
2258 (doc (string-append out "/share/doc"))
2259 (licenses (string-append out "/share/licenses")))
2260 (install-file "README.md" doc)
2261 (install-file "LICENSE" licenses)))))))
2262 (native-inputs
2263 (list python-setuptools))
2264 (propagated-inputs (list python-dateutil))
2265 (home-page "https://github.com/c-w/ghp-import")
2266 (synopsis "Copy directory to the gh-pages branch")
2267 (description "Script that copies a directory to the gh-pages branch (by
2268default) of the repository.")
2269
2270 ;; See <https://bugs.gnu.org/27913>.
2271 (license (license:non-copyleft
2272 "https://raw.githubusercontent.com/davisp/ghp-import/master/LICENSE"
2273 "Tumbolia Public License"))))
2274
2275(define-public python-gitdb
2276 (package
2277 (name "python-gitdb")
2278 (version "4.0.12")
2279 (source (origin
2280 (method url-fetch)
2281 (uri (pypi-uri "gitdb" version))
2282 (sha256
2283 (base32
2284 "0wdmzngk870944nc6q5sphzv29jzhgddbh7vzhk366hrbn2izxsy"))))
2285 (build-system pyproject-build-system)
2286 (arguments
2287 ;; One test fails, probably due to low ulimit: ValueError: Expected to
2288 ;; write 1000 objects into pack, but received only 0 from iterators.
2289 `(#:test-flags '("-k" "not test_pack_writing"
2290 "--ignore-glob=gitdb/test/performance/*.py")
2291 #:phases (modify-phases %standard-phases
2292 (add-before 'check 'create-test-repository
2293 (lambda _
2294 (mkdir "/tmp/testrepo")
2295 ;; Some tests require a git repository, so create one.
2296 (with-directory-excursion "/tmp/testrepo"
2297 (do ((filecount 1 (1+ filecount)))
2298 ((> filecount 1000))
2299 (call-with-output-file (string-append
2300 "file" (number->string filecount))
2301 (lambda (port)
2302 (format port "~a" filecount))))
2303 (begin
2304 (invoke "git" "init")
2305 (invoke "git" "config" "user.name" "Total Git")
2306 (invoke "git" "config" "user.email" "git@localhost")
2307 (invoke "git" "add" "-A")
2308 (invoke "git" "commit" "-q" "-m" "dummy commit")))
2309
2310 ;; The repository checkout must be a "bare" clone.
2311 (invoke "git" "clone" "--bare" "/tmp/testrepo"
2312 "/tmp/testrepo.git")))
2313 (add-before 'check 'pre-check
2314 (lambda _
2315 (setenv "GITDB_TEST_GIT_REPO_BASE" "/tmp/testrepo.git")
2316 ;; Skip tests that must be run from the gitdb repository.
2317 (setenv "TRAVIS" "1"))))))
2318 (propagated-inputs
2319 (list python-smmap))
2320 (native-inputs
2321 (list git-minimal/pinned python-pytest python-setuptools python-wheel))
2322 (home-page "https://github.com/gitpython-developers/gitdb")
2323 (synopsis "Python implementation of the Git object database")
2324 (description
2325 "GitDB allows you to access @dfn{bare} Git repositories for reading and
2326writing. It aims at allowing full access to loose objects as well as packs
2327with performance and scalability in mind. It operates exclusively on streams,
2328allowing to handle large objects with a small memory footprint.")
2329 (license license:bsd-3)))
2330
2331(define-public python-gitpython
2332 (package
2333 (name "python-gitpython")
2334 (version "3.1.44")
2335 (source (origin
2336 (method url-fetch)
2337 (uri (pypi-uri "gitpython" version))
2338 (sha256
2339 (base32
2340 "0scj4hqk6msyzqvq70wk6583qzwn33w601hvn0c59gskcar30zn8"))))
2341 (build-system pyproject-build-system)
2342 (arguments
2343 (list #:tests? #f ;XXX: tests can only be run within the GitPython repository
2344 #:phases
2345 #~(modify-phases %standard-phases
2346 (add-after 'unpack 'embed-git-reference
2347 (lambda* (#:key inputs #:allow-other-keys)
2348 (substitute* "git/cmd.py"
2349 (("git_exec_name = \"git\"")
2350 (string-append "git_exec_name = \""
2351 (search-input-file inputs "/bin/git")
2352 "\""))))))))
2353 (inputs
2354 (list git-minimal/pinned))
2355 (propagated-inputs
2356 (list python-gitdb))
2357 (native-inputs
2358 (list python-setuptools))
2359 (home-page "https://github.com/gitpython-developers/GitPython")
2360 (synopsis "Python library for interacting with Git repositories")
2361 (description
2362 "GitPython is a python library used to interact with Git repositories,
2363high-level like git-porcelain, or low-level like git-plumbing.
2364
2365It provides abstractions of Git objects for easy access of repository data,
2366and additionally allows you to access the Git repository more directly using
2367either a pure Python implementation, or the faster, but more resource intensive
2368 @command{git} command implementation.")
2369 (license license:bsd-3)))
2370
2371(define-public savane
2372 (package
2373 (name "savane")
2374 (version "3.12")
2375 (source (origin
2376 (method git-fetch)
2377 (uri (git-reference
2378 (url "https://git.savannah.gnu.org/git/administration/savane")
2379 (commit (string-append "release-" version))))
2380 (file-name (git-file-name name version))
2381 (sha256
2382 (base32
2383 "05w12rc1qx10zg3i78v6q6sdhg19pml2jghfmlnnsxwjv0nrdv7n"))))
2384 (build-system gnu-build-system)
2385 (native-inputs
2386 (list autoconf
2387 automake
2388 gettext-minimal
2389 imagemagick))
2390 (inputs
2391 (list exim
2392 gnupg
2393 httpd
2394 mariadb
2395 php))
2396 (propagated-inputs
2397 (list perl
2398 perl-dbd-mysql
2399 perl-dbi
2400 perl-date-calc
2401 perl-digest-md5
2402 perl-mailtools
2403 perl-file-find-rule
2404 perl-xml-writer))
2405 (synopsis "Web-based software hosting system")
2406 (description
2407 "Savane is a Web-based software hosting system. It includes issue
2408tracking (bugs, tasks, support, news and documentation), project member
2409management by roles and individual account maintenance.")
2410 (home-page "https://savannah.nongnu.org/p/administration")
2411 (license license:agpl3+)))
2412
2413 (define-public shflags
2414 (package
2415 (name "shflags")
2416 (version "1.3.0")
2417 (source (origin
2418 (method git-fetch)
2419 (uri (git-reference
2420 (url "https://github.com/kward/shflags")
2421 (commit (string-append "v" version))))
2422 (file-name (git-file-name name version))
2423 (sha256
2424 (base32
2425 "0jj0zkly8yg42b8jvih2cmmafv95vm8mv80n3dyalvr5i14lzqd8"))))
2426 (build-system gnu-build-system)
2427 (arguments
2428 `(#:tests? #f ; no tests
2429 #:phases
2430 (modify-phases %standard-phases
2431 (delete 'configure) ; nothing to configure
2432 (delete 'build) ; nothing to build
2433 (replace 'install
2434 (lambda* (#:key outputs #:allow-other-keys)
2435 (let* ((out (assoc-ref outputs "out"))
2436 (src (string-append out "/src")))
2437 (install-file "shflags" src)
2438 #t))))))
2439 (home-page "https://github.com/kward/shflags")
2440 (synopsis "Command-line flags library for shell scripts")
2441 (description
2442 "Shell Flags (shFlags) is a library written to greatly simplify the
2443handling of command-line flags in Bourne based Unix shell scripts (bash, dash,
2444ksh, sh, zsh). Most shell scripts use getopt for flags processing, but the
2445different versions of getopt on various OSes make writing portable shell
2446scripts difficult. shFlags instead provides an API that doesn't change across
2447shell and OS versions so the script writer can be confident that the script
2448will work.")
2449 (license license:lgpl2.1)))
2450
2451(define-public trac
2452 (package
2453 (name "trac")
2454 (version "1.6")
2455 (source
2456 (origin
2457 (method url-fetch)
2458 (uri (pypi-uri "Trac" version))
2459 (sha256
2460 (base32 "013kqa93kd1giswir9qsasm5080x5x5x4ab86ky8zmkhyrhkrmv1"))))
2461 (build-system pyproject-build-system)
2462 (arguments
2463 (list #:test-flags #~(list "-k"
2464 ;; XXX: these two tests fail, check why.
2465 (string-append
2466 "not test_remove_composite_keys"
2467 " and not test_remove_simple_keys"))))
2468 (native-inputs
2469 (list python-psycopg2
2470 python-pymysql
2471 python-pytest
2472 python-setuptools))
2473 (propagated-inputs
2474 (list python-jinja2
2475 python-multipart
2476 python-standard-smtpd))
2477 (home-page "https://trac.edgewall.org")
2478 (synopsis "Integrated SCM, wiki, issue tracker and project environment")
2479 (description "Trac is a minimalistic web-based software project management
2480and bug/issue tracking system. It provides an interface to the Git and
2481Subversion revision control systems, an integrated wiki, flexible issue
2482tracking and convenient report facilities.")
2483 (license license:bsd-3)))
2484
2485(define-public git-flow
2486 (package
2487 (name "git-flow")
2488 ;; This version has not be officially released yet, so we build it
2489 ;; directly from the git repository.
2490 (version "1.12.3")
2491 (source (origin
2492 (method git-fetch)
2493 (uri (git-reference
2494 (url "https://github.com/petervanderdoes/gitflow-avh/")
2495 (commit version)))
2496 (file-name (git-file-name name version))
2497 (sha256
2498 (base32
2499 "13q4mnrxr03wz2dkhzy73j384g299m4d545cnhxcaznvdwfany4h"))))
2500 (build-system gnu-build-system)
2501 (inputs (list shflags))
2502 (arguments
2503 '(#:tests? #f ; no tests
2504 #:make-flags (list (string-append "prefix="
2505 (assoc-ref %outputs "out")))
2506 #:phases
2507 (modify-phases %standard-phases
2508 (add-after 'unpack 'reset-shFlags-link
2509 (lambda* (#:key inputs #:allow-other-keys)
2510 ;; The link points to a file in the shFlags submodule.
2511 ;; Redirect it to point to our system shFlags.
2512 (let ((shflags (assoc-ref inputs "shflags")))
2513 (begin
2514 (delete-file "gitflow-shFlags")
2515 (symlink (string-append shflags "/src/shflags")
2516 "gitflow-shFlags")))))
2517 (delete 'configure)
2518 (delete 'build))))
2519 (home-page "https://nvie.com/posts/a-successful-git-branching-model/")
2520 (synopsis "Git extensions for Vincent Driessen's branching model")
2521 (description
2522 "Vincent Driessen's branching model is a git branching and release
2523management strategy that helps developers keep track of features, hotfixes,
2524and releases in bigger software projects. The git-flow library of git
2525subcommands helps automate some parts of the flow to make working with it a
2526lot easier.")
2527 (license license:bsd-2)))
2528
2529(define-public stgit
2530 (package
2531 (name "stgit")
2532 (version "2.5.3")
2533 (source
2534 (origin
2535 (method git-fetch)
2536 (uri (git-reference
2537 (url "https://github.com/stacked-git/stgit")
2538 (commit (string-append "v" version))))
2539 (file-name (git-file-name name version))
2540 (sha256
2541 (base32 "0pxhl7fnycs4bx46x9m8v33lsf5hwp0fhqyihlr4sf7ms4b7adsc"))))
2542 (build-system cargo-build-system)
2543 (arguments
2544 `(#:install-source? #f
2545 #:phases
2546 (modify-phases %standard-phases
2547 (add-after 'build 'build-extras
2548 (lambda _
2549 (substitute* "Documentation/Makefile"
2550 (("docbook2x-texi") "docbook2texi"))
2551 (setenv "PERL_PATH" "perl")
2552 (invoke "make" "-C" "Documentation" "info")
2553 (invoke "make" "-C" "completion" "stgit.bash")
2554 (invoke "make" "-C" "completion" "stg.fish")))
2555 (add-after 'install 'install-extras
2556 (lambda* (#:key outputs #:allow-other-keys)
2557 (let ((out (assoc-ref outputs "out")))
2558 (invoke "make" "-C" "Documentation" "install-info"
2559 (string-append "prefix=" out))
2560 (invoke "make" "-C" "completion" "install"
2561 (string-append "prefix=" out)
2562 (string-append "bashdir=" out "/etc/bash_completion.d/"))))))))
2563 (native-inputs
2564 (list pkg-config
2565 ;; For the documentation
2566 asciidoc
2567 docbook2x
2568 libxslt
2569 perl
2570 texinfo
2571 xmlto))
2572 (inputs (cons* openssl zlib curl (cargo-inputs 'stgit-2)))
2573 (home-page "https://stacked-git.github.io/")
2574 (synopsis "Stacked Git (StGit) manages Git commits as a stack of patches")
2575 (description "StGit uses a patch stack workflow. Each individual patch
2576focuses on a single concern, while a stack of patches forms a series of commits.
2577Patches are stored as normal git commits, allowing easy merging of StGit
2578patches into other repositories using standard Git.
2579
2580Features include:
2581@itemize
2582@item Import and export patches from Git with @command{stg commit} and
2583@command{stg uncommit}
2584@item Create new patches and add them to the stack with @command{stg new}
2585@item Update a patch from the working tree with @command{stg refresh} and
2586@command{stg edit}
2587@item See information about the stack or patch with @command{stg series} and
2588@command{stg show}
2589@item Export and send a series of patches by email using @command{stg email}
2590@end itemize")
2591 (license license:gpl2)))
2592
2593(define-public emacs-stgit
2594 (package
2595 (inherit stgit)
2596 (name "emacs-stgit")
2597 (version "0.17.1") ;from stgit.el
2598 (build-system emacs-build-system)
2599 (arguments
2600 (list
2601 #:tests? #f ; no tests
2602 #:lisp-directory "contrib"
2603 #:phases
2604 #~(modify-phases %standard-phases
2605 (add-after 'unpack 'patch-version-executables
2606 (lambda* (#:key inputs #:allow-other-keys)
2607 (emacs-substitute-variables "stgit.el"
2608 ("stgit-stg-program" (search-input-file inputs "/bin/stg")))
2609 (emacs-substitute-variables "stgit.el"
2610 ("stgit-git-program" (search-input-file inputs "/bin/git")))))
2611 (add-before 'install-license-files 'leave-lisp-directory
2612 (lambda _
2613 (chdir ".."))))))
2614 (inputs (list stgit git))
2615 (synopsis "Emacs major mode for StGit interaction")
2616 (description "This package a interactive tool to interact with git
2617branches using StGit.")
2618 (license license:gpl2+)))
2619
2620(define-public vcsh
2621 (package
2622 (name "vcsh")
2623 (version "2.0.5")
2624 (source
2625 (origin
2626 (method git-fetch)
2627 (uri (git-reference
2628 (url "https://github.com/RichiH/vcsh")
2629 (commit (string-append "v" version))))
2630 (file-name (git-file-name name version))
2631 (sha256
2632 (base32 "15lb09c2q261p1pp5r7j9k8389ybrd2q19xhnp1nnha6gs78i4wq"))))
2633 (build-system gnu-build-system)
2634 (native-inputs
2635 (list autoconf
2636 automake
2637 ;; for man page
2638 ronn-ng
2639 ;; for tests
2640 perl
2641 perl-test-harness
2642 perl-shell-command
2643 perl-test-most
2644 ;; for bash-completion
2645 pkg-config))
2646 (inputs
2647 (list git))
2648 (arguments
2649 '(#:phases
2650 (modify-phases %standard-phases
2651 (add-before 'bootstrap 'fix-version-gen
2652 (lambda _
2653 (call-with-output-file ".tarball-version"
2654 (lambda (port)
2655 (display version port))))))
2656 #:make-flags (list (string-append "PREFIX="
2657 (assoc-ref %outputs "out")))
2658 #:test-target "test"))
2659 (home-page "https://github.com/RichiH/vcsh")
2660 (synopsis "Version control system for @code{$HOME}")
2661 (description
2662 "vcsh version-controls configuration files in several Git repositories,
2663all in one single directory. They all maintain their working trees without
2664clobbering each other or interfering otherwise. By default, all Git
2665repositories maintained via vcsh store the actual files in @code{$HOME},
2666though this can be overridden.")
2667 (license license:gpl2+)))
2668
2669(define-public vcstool
2670 (package
2671 (name "vcstool")
2672 (version "0.3.0")
2673 (source
2674 (origin
2675 (method url-fetch)
2676 (uri (pypi-uri "vcstool" version))
2677 (sha256
2678 (base32 "0b7f68q25x9nxqa3xcg32js3qgp4jg99anwy2c7nd1jkw5iskcq4"))))
2679 (build-system pyproject-build-system)
2680 (arguments
2681 (list
2682 #:tests? #f ; network access is required
2683 #:phases
2684 #~(modify-phases %standard-phases
2685 (add-after 'wrap 'wrap-script
2686 (lambda _
2687 (wrap-program (string-append #$output "/bin/vcs")
2688 `("PATH" ":" prefix
2689 ,(list (string-append #$git "/bin")
2690 (string-append #$breezy "/bin")
2691 (string-append #$subversion "/bin")))))))))
2692 (native-inputs
2693 (list python-pyyaml
2694 python-setuptools
2695 python-wheel))
2696 (inputs
2697 (list bash-minimal
2698 breezy
2699 git
2700 subversion))
2701 (home-page "https://github.com/dirk-thomas/vcstool")
2702 (synopsis "Multiple VCS repository managing tool")
2703 (description
2704 "This package enables manipulating multiple version control repositories
2705with one command.")
2706 (license license:asl2.0)))
2707
2708(define-public git-test-sequence
2709 (let ((commit "48e5a2f5a13a5f30452647237e23362b459b9c76"))
2710 (package
2711 (name "git-test-sequence")
2712 (version (string-append "20140312." (string-take commit 7)))
2713 (source (origin
2714 (method git-fetch)
2715 (uri (git-reference
2716 ;; There are many other scripts in this directory; we
2717 ;; are interested in just one for this package.
2718 (url "https://github.com/dustin/bindir")
2719 (commit commit)))
2720 (file-name (git-file-name name version))
2721 (sha256
2722 (base32
2723 "1dcq0y16yznbv4k9h8gg90kv1gkn8r8dbvl4m2rpfd7q5nqhn617"))))
2724 (build-system trivial-build-system)
2725 (arguments
2726 `(#:modules ((guix build utils))
2727 #:builder (begin
2728 (use-modules (guix build utils))
2729 (let* ((source (assoc-ref %build-inputs "source"))
2730 (output (assoc-ref %outputs "out"))
2731 (bindir (string-append output "/bin"))
2732 (script "git-test-sequence"))
2733 (install-file (string-append source "/" script)
2734 bindir)
2735 #t))))
2736 (home-page "https://dustin.sallings.org/2010/03/28/git-test-sequence.html")
2737 (synopsis "Run a command over a sequence of commits")
2738 (description
2739 "git-test-sequence is similar to an automated git bisect except it’s
2740linear. It will test every change between two points in the DAG. It will
2741also walk each side of a merge and test those changes individually.")
2742 (license (license:x11-style "file://LICENSE")))))
2743
2744(define* (make-gitolite #:optional (extra-inputs '()))
2745 "Make a gitolite package object with EXTRA-INPUTS added to the binary
2746wrappers, to be used for optional gitolite extensions."
2747 (package
2748 (name "gitolite")
2749 (version "3.6.14")
2750 (source
2751 (origin
2752 (method git-fetch)
2753 (uri (git-reference
2754 (url "https://github.com/sitaramc/gitolite")
2755 (commit (string-append "v" version))))
2756 (file-name (git-file-name name version))
2757 (sha256
2758 (base32 "0qfl9qjs9nvgvl244rvidap8s202bq2gsmnxaylqrkj77az6l2h7"))))
2759 (build-system gnu-build-system)
2760 (arguments
2761 (list #:tests? #f ; no tests
2762 #:phases
2763 #~(modify-phases %standard-phases
2764 (delete 'configure)
2765 (delete 'build)
2766 (add-before 'install 'patch-scripts
2767 (lambda* (#:key inputs #:allow-other-keys)
2768 ;; This seems to take care of every shell script that
2769 ;; invokes Perl.
2770 (substitute* (find-files ".")
2771 ((" perl -")
2772 (string-append
2773 " " (search-input-file inputs "bin/perl") " -")))
2774
2775 (substitute* (find-files "src/triggers" ".*")
2776 ((" sed ")
2777 (string-append
2778 " " (search-input-file inputs "bin/sed") " ")))
2779
2780 (substitute*
2781 '("src/triggers/post-compile/update-gitweb-access-list"
2782 "src/triggers/post-compile/ssh-authkeys-split"
2783 "src/triggers/upstream")
2784 ((" grep ")
2785 (string-append
2786 " " (search-input-file inputs "bin/grep") " ")))
2787
2788 (substitute* "src/triggers/post-compile/ssh-authkeys"
2789 (("\\$glshell \\$user")
2790 (string-append
2791 #$output "/bin/gitolite-shell $user")))))
2792 (add-before 'install 'patch-source
2793 (lambda* (#:key inputs #:allow-other-keys)
2794 ;; Gitolite uses cat to test the readability of the
2795 ;; pubkey
2796 (substitute* "src/lib/Gitolite/Setup.pm"
2797 (("\"cat ")
2798 (string-append
2799 "\"" (search-input-file inputs "bin/cat") " "))
2800 (("\"ssh-keygen")
2801 (string-append
2802 "\"" (search-input-file inputs "bin/ssh-keygen"))))
2803
2804 (substitute* '("src/lib/Gitolite/Hooks/PostUpdate.pm"
2805 "src/lib/Gitolite/Hooks/Update.pm")
2806 (("/usr/bin/perl")
2807 (search-input-file inputs "bin/perl")))
2808
2809 (substitute* "src/lib/Gitolite/Common.pm"
2810 (("\"ssh-keygen")
2811 (string-append
2812 "\"" (search-input-file inputs "bin/ssh-keygen")))
2813 (("\"logger\"")
2814 (string-append
2815 "\"" (search-input-file inputs "bin/logger") "\"")))
2816
2817 (substitute* "src/lib/Gitolite/Cache.pm"
2818 (("/usr/sbin/redis-server") "redis-server"))
2819
2820 (substitute* "src/commands/svnserve"
2821 (("/usr/bin/svnserve") "svnserve"))))
2822 (replace 'install
2823 (lambda* _
2824 (let* ((sharedir (string-append #$output "/share/gitolite"))
2825 (bindir (string-append #$output "/bin")))
2826 (mkdir-p sharedir)
2827 (mkdir-p bindir)
2828 (invoke "./install" "-to" sharedir)
2829 ;; Create symlinks for executable scripts in /bin.
2830 (for-each (lambda (script)
2831 (symlink (string-append sharedir "/" script)
2832 (string-append bindir "/" script)))
2833 '("gitolite" "gitolite-shell")))))
2834 (add-after 'install 'wrap-scripts
2835 (lambda* (#:key inputs #:allow-other-keys)
2836 (for-each (lambda (file-name)
2837 (wrap-program (string-append #$output file-name)
2838 `("PATH" ":" prefix
2839 ,(append
2840 (map (lambda (command)
2841 (dirname
2842 (search-input-file
2843 inputs
2844 (string-append "bin/" command))))
2845 '("chmod" ;coreutils
2846 "find"
2847 "git"))
2848 (map (lambda (dir)
2849 (string-append dir "/bin"))
2850 (list #$output
2851 #$@extra-inputs))))))
2852 '("/bin/gitolite" "/bin/gitolite-shell")))))))
2853 (inputs
2854 (append (list bash-minimal coreutils findutils git inetutils openssh perl)
2855 extra-inputs))
2856 (home-page "https://gitolite.com")
2857 (synopsis "Git access control layer")
2858 (description
2859 "Gitolite is an access control layer on top of Git, providing fine access
2860control to Git repositories.")
2861 (license license:gpl2)))
2862
2863(define-public gitolite (make-gitolite))
2864
2865(define-public gitile
2866 ;; Use an unreleased version to fix the gitile system test.
2867 (let ((commit "1feb300c0d3069b1180e62c5e989ac0ed353a248"))
2868 (package
2869 (name "gitile")
2870 (version (string-append "0.1.4-" (string-take commit 7)))
2871 (source
2872 (origin
2873 (method git-fetch)
2874 (uri (git-reference
2875 (url "https://git.lepiller.eu/git/gitile")
2876 (commit commit)))
2877 (file-name (git-file-name name version))
2878 (sha256
2879 (base32 "1yhqn54hx7p7sc3vc85vsx7315bxs313bv3i9lzx8q0zpzc0x7xh"))))
2880 (build-system gnu-build-system)
2881 (arguments
2882 `(#:imported-modules ((guix build guile-build-system)
2883 ,@%default-gnu-imported-modules)
2884 #:make-flags (list "GUILE_AUTO_COMPILE=0")
2885 #:phases
2886 (modify-phases %standard-phases
2887 (replace 'bootstrap
2888 (lambda _
2889 ;; The 'bootstrap' script lacks a shebang, leading to "Exec
2890 ;; format error" with glibc 2.35.
2891 (invoke "autoreconf" "-vfi")))
2892 (add-after 'install 'wrap-program
2893 (lambda* (#:key inputs outputs #:allow-other-keys)
2894 (use-modules (guix build guile-build-system))
2895 ;; Wrap the 'gitile' command to refer to the right modules.
2896 (let* ((out (assoc-ref outputs "out"))
2897 (commonmark (assoc-ref inputs "guile-commonmark"))
2898 (git (assoc-ref inputs "guile-git"))
2899 (bytes (assoc-ref inputs "guile-bytestructures"))
2900 (fibers (assoc-ref inputs "guile-fibers"))
2901 (gcrypt (assoc-ref inputs "guile-gcrypt"))
2902 (syntax-highlight (assoc-ref inputs "guile-syntax-highlight"))
2903 (deps (list out commonmark git bytes fibers gcrypt
2904 syntax-highlight))
2905 (guile (assoc-ref inputs "guile"))
2906 (effective (target-guile-effective-version))
2907 (mods (string-drop-right ;drop trailing colon
2908 (string-join deps
2909 (string-append "/share/guile/site/"
2910 effective ":")
2911 'suffix)
2912 1))
2913 (objs (string-drop-right
2914 (string-join deps
2915 (string-append "/lib/guile/" effective
2916 "/site-ccache:")
2917 'suffix)
2918 1)))
2919 (wrap-program (string-append out "/bin/gitile")
2920 `("GUILE_LOAD_PATH" ":" prefix (,mods))
2921 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs)))))))))
2922 (native-inputs
2923 (list autoconf automake guile-3.0 pkg-config))
2924 (inputs
2925 (list bash-minimal ;for wrap-program
2926 guile-3.0
2927 guile-commonmark
2928 guile-fibers
2929 guile-gcrypt
2930 guile-git
2931 guile-syntax-highlight
2932 guile-gnutls))
2933 (home-page "https://git.lepiller.eu/gitile")
2934 (synopsis "Simple Git forge written in Guile")
2935 (description "Gitile is a Git forge written in Guile that lets you
2936visualize your public Git repositories on a web interface.")
2937 (license license:agpl3+))))
2938
2939(define-public pre-commit
2940 (package
2941 (name "pre-commit") ;formerly known as python-pre-commit
2942 (version "4.6.2")
2943 (source
2944 (origin
2945 (method git-fetch) ; no tests in PyPI release
2946 (uri (git-reference
2947 (url "https://github.com/pre-commit/pre-commit")
2948 (commit (string-append "v" version))))
2949 (file-name (git-file-name name version))
2950 (sha256
2951 (base32 "1ia6v1xjqzpanhn5p6fwrr4f6gankpp57fqcv90pkzvkspshs8b8"))
2952 (modules '((guix build utils)))
2953 (snippet '(substitute* "setup.cfg"
2954 (("virtualenv>=20.10.0") ;our virtualenv (20.3.1) is fine
2955 "virtualenv>=20.0.8")))))
2956 (build-system pyproject-build-system)
2957 (arguments
2958 (list
2959 #:test-flags
2960 #~(append
2961 ;; Skip language-specific tests because they depend on language tools.
2962 (list "--ignore=tests/languages")
2963 ;; These tests rely on a hook that tries to install packages from pip.
2964 (map (lambda (test)
2965 (string-append "--deselect=tests/repository_test.py::"
2966 test))
2967 (list "test_additional_dependencies_roll_forward"
2968 "test_control_c_control_c_on_install"
2969 "test_invalidated_virtualenv"
2970 "test_local_python_repo"
2971 "test_repository_state_compatibility"
2972 "test_reinstall"
2973 "test_really_long_file_paths"))
2974 ;; XXX: These fail with AssertionError, unclear why.
2975 (map (lambda (test)
2976 (string-append "--deselect=tests/commands/"
2977 "install_uninstall_test.py::" test))
2978 (list "test_install_existing_hooks_no_overwrite"
2979 "test_uninstall_restores_legacy_hooks"
2980 "test_installed_from_venv")))
2981 #:phases
2982 #~(modify-phases %standard-phases
2983 (add-before 'check 'prepare-check-env
2984 (lambda _
2985 ;; Change from /homeless-shelter to /tmp for write permission.
2986 (setenv "HOME" "/tmp")
2987 ;; Environment variables used in the tests.
2988 (setenv "GIT_AUTHOR_NAME" "Your Name")
2989 (setenv "GIT_COMMITTER_NAME" "Your Name")
2990 (setenv "GIT_AUTHOR_EMAIL" "[email protected]")
2991 (setenv "GIT_COMMITTER_EMAIL" "[email protected]")
2992 ;; Some tests still fail with PermissionError. Make the source
2993 ;; tree writable.
2994 ;; (for-each make-file-writable (find-files "."))
2995 ;; Some tests will need a working git repository.
2996 (invoke "git" "init")
2997 (invoke "git" "config" "--global" "user.name" "Your Name")
2998 (invoke "git" "config" "--global" "user.email" "[email protected]"))))))
2999 (native-inputs
3000 (list git-minimal/pinned
3001 python-distlib
3002 python-pytest
3003 python-pytest-env
3004 python-re-assert
3005 python-setuptools
3006 python-wheel
3007 which))
3008 ;; Propagate because pre-commit is also used as a module.
3009 (propagated-inputs
3010 (list python-cfgv
3011 python-identify
3012 python-nodeenv
3013 python-pyyaml
3014 python-virtualenv))
3015 (home-page "https://pre-commit.com/")
3016 (synopsis "Framework for managing and maintaining pre-commit hooks")
3017 (description
3018 "Pre-commit is a multi-language package manager for pre-commit hooks. You
3019specify a list of hooks you want and pre-commit manages the installation and
3020execution of any hook written in any language before every commit.")
3021 (license license:expat)))
3022
3023(define-public mercurial
3024 (package
3025 (name "mercurial")
3026 (version "7.1")
3027 (source
3028 (origin
3029 (method url-fetch)
3030 (uri (string-append "https://www.mercurial-scm.org/"
3031 "release/mercurial-" version ".tar.gz"))
3032 (patches (search-patches "mercurial-hg-extension-path.patch"))
3033 (sha256
3034 (base32 "1jz54akdnsp5frlbsr2xg71kbp2919v61gkkx7c7bi1q7k421ng8"))))
3035 (build-system gnu-build-system)
3036 (arguments
3037 (list
3038 #:imported-modules %pyproject-build-system-modules
3039 #:modules '((guix build gnu-build-system)
3040 ((guix build pyproject-build-system) #:prefix py:)
3041 (guix build utils))
3042 #:make-flags #~(list (string-append "PREFIX=" #$output))
3043 #:phases
3044 #~(modify-phases %standard-phases
3045 (delete 'configure)
3046 (add-after 'unpack 'patch-tests
3047 (lambda* (#:key inputs #:allow-other-keys)
3048 (substitute* (find-files "tests" "\\.(t|py)$")
3049 (("/bin/sh")
3050 (search-input-file inputs "bin/sh"))
3051 (("/usr/bin/env")
3052 (search-input-file inputs "bin/env")))))
3053 (add-before 'check 'configure-check
3054 (lambda* (#:key tests? #:allow-other-keys)
3055 (with-directory-excursion "tests"
3056 (substitute* "run-tests.py"
3057 ;; XXX: Adapt pip call to build daemon chroot.
3058 (("b\"install\", b\"\\.\"")
3059 "b\"install\", b\"--no-build-isolation\", b\".\"")
3060 ;; XXX: Log the actual PYTHONPATH.
3061 (("\"PYTHONPATH\"")
3062 "\"GUIX_PYTHONPATH\"")))))
3063 (add-before 'configure-check 'add-install-to-pythonpath
3064 (assoc-ref py:%standard-phases 'add-install-to-pythonpath))
3065 (add-after 'install 'wrap
3066 (assoc-ref py:%standard-phases 'wrap))
3067 (delete 'check)
3068 (add-after 'wrap 'check
3069 (lambda* (#:key tests? #:allow-other-keys)
3070 (with-directory-excursion "tests"
3071 ;; The following tests are known to fail.
3072 (for-each delete-file
3073 '(;; XXX: This test calls 'run-tests.py --with-hg=
3074 ;; `which hg`' and fails because there is no hg on
3075 ;; PATH from before (that's why we are building it!)?
3076 "test-hghave.t"
3077
3078 ;; This test is missing a debug line
3079 ;; mmapping $TESTTMP/a/.hg/store/00changelog.i (no-pure !)
3080 ;; but the relevant output is correct.
3081 "test-revlog-mmapindex.t"
3082
3083 ;; This test creates a shebang spanning multiple
3084 ;; lines which is difficult to substitute. It
3085 ;; only tests the test runner itself, which gets
3086 ;; thoroughly tested during the check phase anyway.
3087 "test-run-tests.t"
3088
3089 ;; These tests fail because the program is not
3090 ;; connected to a TTY in the build container.
3091 "test-nointerrupt.t"
3092 "test-transaction-rollback-on-sigpipe.t"
3093
3094 ;; FIXME: This gets killed but does not receive an interrupt.
3095 "test-commandserver.t"
3096
3097 ;; These tests get unexpected warnings about using
3098 ;; deprecated functionality in Python, but otherwise
3099 ;; succeed; try enabling for later Mercurial versions.
3100 "test-demandimport.py"
3101 "test-patchbomb-tls.t"
3102 ;; Similarly, this gets a more informative error
3103 ;; message from Python 3.10 than it expects.
3104 "test-http-bad-server.t"
3105
3106 ;; Only works when run in a hg-repo, not in an
3107 ;; extracted tarball
3108 "test-doctest.py"
3109
3110 ;; TODO: the fqaddr() call fails in the build
3111 ;; container, causing these server tests to fail.
3112 "test-hgwebdir.t"
3113 "test-http-branchmap.t"
3114 "test-pull-bundle.t"
3115 "test-push-http.t"
3116 "test-serve.t"
3117 "test-subrepo-deep-nested-change.t"
3118 "test-subrepo-recursion.t"
3119 ;; FIXME: Investigate why it failed.
3120 "test-convert-darcs.t"))
3121 (when tests?
3122 (invoke "./run-tests.py"
3123 ;; ‘make check’ does not respect ‘-j’.
3124 (string-append "-j" (number->string
3125 (parallel-job-count)))
3126 ;; The default time-outs are too low for many systems.
3127 ;; Raise them generously: Guix enforces its own.
3128 "--timeout" "86400"
3129 "--slowtimeout" "86400"
3130 ;; The test suite takes a long time and produces little
3131 ;; output by default. Prevent timeouts due to silence.
3132 "-v")))))
3133 (add-after 'check 'python-sanity-check
3134 (lambda* (#:key inputs outputs #:allow-other-keys)
3135 ((assoc-ref py:%standard-phases 'sanity-check)
3136 #:inputs `(("sanity-check.py" . ,#$(default-sanity-check.py))
3137 ,@inputs)
3138 #:outputs outputs))))))
3139 (native-inputs
3140 (list python-docutils
3141 ;; The following inputs are only needed to run the tests.
3142 python-setuptools
3143 python-setuptools-scm
3144 unzip
3145 which))
3146 (inputs
3147 (list python-wrapper
3148 python-roman))
3149 ;; Find third-party extensions.
3150 (native-search-paths
3151 (list (search-path-specification
3152 (variable "HGEXTENSIONPATH")
3153 (files (list
3154 ;; Cannot use the line below due to circular imports.
3155 ;;(version-major+minor (package-version python))
3156 "lib/python3.12/site-packages/hgext3rd")))))
3157 (home-page "https://www.mercurial-scm.org/")
3158 (synopsis "Decentralized version control system")
3159 (description
3160 "Mercurial is a free, distributed source control management tool. It
3161efficiently handles projects of any size and offers an easy and intuitive
3162interface.")
3163 (license license:gpl2+)))
3164
3165(define-public python-hg-evolve
3166 (package
3167 (name "python-hg-evolve")
3168 (version "11.1.3")
3169 (source
3170 (origin
3171 (method hg-fetch)
3172 (uri (hg-reference
3173 (url "https://www.mercurial-scm.org/repo/evolve")
3174 (changeset version)))
3175 (file-name (hg-file-name name version))
3176 (sha256
3177 (base32
3178 "09rq3hgbb6qjws0kymnh8lbglsc5yjby3b2bc0savs2agf88j83z"))))
3179 (build-system pyproject-build-system)
3180 (arguments
3181 ;; Tests need mercurial source code.
3182 (list #:tests? #f))
3183 (native-inputs (list python-setuptools))
3184 (propagated-inputs (list mercurial))
3185 (home-page "https://www.mercurial-scm.org/doc/evolution/")
3186 (synopsis "Flexible evolution of Mercurial history")
3187 (description "Evolve is a Mercurial extension for faster and safer mutable
3188history. It implements the changeset evolution concept for Mercurial.")
3189 (license license:gpl2)))
3190
3191(define-public hg-commitsigs
3192 ;; Latest tag is 11 years old.
3193 (let ((changeset "b53eb6862bff")
3194 (revision "0"))
3195 (package
3196 (name "hg-commitsigs")
3197 (version (git-version "0.1.0" revision changeset))
3198 (source (origin
3199 (method hg-fetch)
3200 (uri (hg-reference
3201 (url "https://foss.heptapod.net/mercurial/commitsigs")
3202 (changeset changeset)))
3203 (file-name (git-file-name name version))
3204 (sha256
3205 (base32
3206 "059gm66q06m6ayl4brsc517zkw3ahmz249b6xm1m32ac5y24wb9x"))))
3207 (build-system copy-build-system)
3208 (arguments
3209 (list
3210 #:imported-modules (append %pyproject-build-system-modules
3211 %copy-build-system-modules)
3212 #:modules `((guix build pyproject-build-system)
3213 (guix build copy-build-system)
3214 (guix build utils))
3215 #:install-plan
3216 #~`(("commitsigs.py"
3217 ,(string-append "lib/python"
3218 (python-version
3219 #$(this-package-native-input "python"))
3220 "/site-packages/hgext3rd/commitsigs.py")))
3221 #:phases
3222 #~(modify-phases %standard-phases
3223 (add-after 'unpack 'patch-paths
3224 (lambda _
3225 (substitute* "commitsigs.py"
3226 (("b'(gpg|openssl)'," _ bin)
3227 (format #f "b'~a'," (which bin)))))))))
3228 (native-inputs
3229 (list python))
3230 (inputs
3231 (list gnupg openssl))
3232 (home-page "https://foss.heptapod.net/mercurial/commitsigs")
3233 (synopsis "Automatic signing of changeset hashes")
3234 (description "This package provides a Mercurial extension for signing
3235the changeset hash of commits. The signure is embedded directly in the
3236changeset itself; there won't be any extra commits. Either GnuPG or OpenSSL
3237can be used for signing.")
3238 (license license:gpl2)))) ;per commitsigs.py
3239
3240;; XXX: Not maintained since 2019.
3241(define-public heatwave
3242 (package
3243 (name "heatwave")
3244 (version "1.2.1")
3245 (source
3246 (origin
3247 (method url-fetch)
3248 (uri (pypi-uri "heatwave" version))
3249 (sha256
3250 (base32 "1zzwmb9hvbyswzjgap02rrq8p44hb6xlzk1wd8w01mh2vva0xlx7"))))
3251 (build-system pyproject-build-system)
3252 (arguments
3253 (list #:tests? #f)) ;no tests in PyPI
3254 (native-inputs
3255 (list python-setuptools))
3256 (propagated-inputs
3257 (list python-click
3258 python-gitpython
3259 python-monthdelta))
3260 (home-page "https://github.com/james-stoup/heatwave")
3261 (synopsis "Heat map visualization of a git repository")
3262 (description
3263 "This package provides a way of visualizing a heat map of a git repo.")
3264 (license license:gpl3)))
3265
3266(define-public neon
3267 (package
3268 (name "neon")
3269 (version "0.32.2")
3270 (source (origin
3271 (method url-fetch)
3272 (uri (string-append "https://notroj.github.io/neon/neon-"
3273 version ".tar.gz"))
3274 (sha256
3275 (base32
3276 "11mj5zpp317dmds874wfwcpgij9i3scaahdi1xfzr5b2ii36crcq"))))
3277 (build-system gnu-build-system)
3278 (native-inputs
3279 (list perl pkg-config))
3280 (inputs
3281 (list libxml2 openssl zlib))
3282 (arguments
3283 `(;; FIXME: Add tests once reverse address lookup is fixed in glibc, see
3284 ;; https://sourceware.org/bugzilla/show_bug.cgi?id=16475
3285 #:tests? #f
3286 #:configure-flags '("--enable-shared"
3287 "--disable-static"
3288 ;; requires libgnutils-config, deprecated
3289 ;; in gnutls 2.8.
3290 ; "--with-ssl=gnutls")))
3291 "--with-ssl=openssl")))
3292 (home-page "https://notroj.github.io/neon/")
3293 (synopsis "HTTP and WebDAV client library")
3294 (description
3295 "Neon is an HTTP and WebDAV client library, with a C interface and the
3296following features:
3297@enumerate
3298@item High-level wrappers for common HTTP and WebDAV operations (GET, MOVE,
3299 DELETE, etc.);
3300@item low-level interface to the HTTP request/response engine, allowing the use
3301 of arbitrary HTTP methods, headers, etc.;
3302@item authentication support including Basic and Digest support, along with
3303 GSSAPI-based Negotiate on Unix, and SSPI-based Negotiate/NTLM on Win32;
3304@item SSL/TLS support using OpenSSL or GnuTLS, exposing an abstraction layer for
3305 verifying server certificates, handling client certificates, and examining
3306 certificate properties, smartcard-based client certificates are also
3307 supported via a PKCS#11 wrapper interface;
3308@item abstract interface to parsing XML using libxml2 or expat, and wrappers for
3309 simplifying handling XML HTTP response bodies;
3310@item WebDAV metadata support, wrappers for PROPFIND and PROPPATCH to simplify
3311 property manipulation.
3312@end enumerate\n")
3313 (license license:gpl2+))) ; for documentation and tests; source under lgpl2.0+
3314
3315(define-public subversion
3316 (package
3317 (name "subversion")
3318 (version "1.14.5")
3319 (source (origin
3320 (method url-fetch)
3321 (uri (string-append "mirror://apache/subversion/"
3322 "subversion-" version ".tar.bz2"))
3323 (sha256
3324 (base32
3325 "18a4avism0a7b1siikkm6v2snhanlmqqzl4p8hspp2vbfvkjk2p7"))))
3326 (build-system gnu-build-system)
3327 (arguments
3328 (list
3329 ;; Running the tests in parallel causes test failures on i686-linux.
3330 ;; The issue was reported to [email protected], as suggested
3331 ;; at https://subversion.apache.org/reporting-issues.
3332 #:parallel-tests? #f
3333 #:configure-flags #~(list "--enable-static=no")
3334 #:phases
3335 #~(modify-phases %standard-phases
3336 (add-after 'configure 'patch-libtool-wrapper-ls
3337 (lambda* (#:key inputs #:allow-other-keys)
3338 ;; This substitution allows tests svnauthz_tests and svnlook_tests
3339 ;; to pass. These tests execute svnauthz and svnlook through
3340 ;; their libtool wrapper scripts from svn hooks, whose empty
3341 ;; environments cause "ls: command not found" errors. It would be
3342 ;; nice if this fix ultimately made its way into libtool.
3343 (substitute* "libtool"
3344 (("\\\\`ls")
3345 (string-append "\\`" (search-input-file inputs "bin/ls"))))))
3346 (add-before 'build 'patch-test-sh
3347 (lambda _
3348 (substitute* "subversion/tests/libsvn_repos/repos-test.c"
3349 (("#!/bin/sh") (string-append "#!" (which "sh"))))))
3350 (add-before 'check 'set-PARALLEL
3351 (lambda* (#:key parallel-tests? #:allow-other-keys)
3352 (if parallel-tests?
3353 (setenv "PARALLEL" (number->string (parallel-job-count)))
3354 (simple-format #t "parallel-tests? are disabled\n"))))
3355 (add-after 'install 'install-perl-bindings
3356 (lambda _
3357 ;; Follow the instructions from 'subversion/bindings/swig/INSTALL'.
3358 (invoke "make" "swig-pl-lib")
3359 ;; FIXME: Test failures.
3360 ;; (invoke "make" "check-swig-pl")
3361 (invoke "make" "install-swig-pl-lib")
3362
3363 ;; Set the right installation prefix.
3364 (with-directory-excursion "subversion/bindings/swig/perl/native"
3365 (invoke "perl" "Makefile.PL" "NO_PERLLOCAL=1"
3366 (string-append "PREFIX=" #$output))
3367 (invoke "make" "install"
3368 (string-append "OTHERLDFLAGS=-Wl,-rpath="
3369 #$output "/lib"))))))))
3370 (native-inputs
3371 (list pkg-config
3372 ;; For the Perl bindings.
3373 swig-4.0))
3374 (inputs
3375 (list apr
3376 apr-util
3377 lz4
3378 perl
3379 python-wrapper
3380 serf
3381 sqlite
3382 utf8proc
3383 zlib))
3384 (home-page "https://subversion.apache.org/")
3385 (synopsis "Revision control system")
3386 (description
3387 "@dfn{Subversion} (svn) exists to be recognized and adopted as a
3388centralized version control system characterized by its
3389reliability as a safe haven for valuable data; the simplicity of its model and
3390usage; and its ability to support the needs of a wide variety of users and
3391projects, from individuals to large-scale enterprise operations.")
3392 (license license:asl2.0)))
3393
3394(define-public rcs
3395 (package
3396 (name "rcs")
3397 (version "5.10.1")
3398 (source (origin
3399 (method url-fetch)
3400 (uri (string-append "mirror://gnu/rcs/rcs-"
3401 version ".tar.lz"))
3402 (sha256
3403 (base32
3404 "1iac4d1dhsfy5zb0n3p605pihdq702v06r4g8vi8b2saf88gxpa3"))))
3405 (build-system gnu-build-system)
3406 (arguments `(#:phases
3407 (modify-phases %standard-phases
3408 (add-after 'install 'install-rcsfreeze
3409 (lambda* (#:key outputs #:allow-other-keys)
3410 (let* ((out (assoc-ref outputs "out"))
3411 (bin (string-append out "/bin"))
3412 (man1 (string-append out "/share/man/man1")))
3413 (chmod "src/rcsfreeze" #o755)
3414 (install-file "src/rcsfreeze" bin)
3415 (install-file "man/rcsfreeze.1" man1)))))))
3416 (native-inputs (list ed lzip))
3417 (home-page "https://www.gnu.org/software/rcs/")
3418 (synopsis "Per-file local revision control system")
3419 (description
3420 "RCS is the original Revision Control System. It works on a
3421file-by-file basis, in contrast to subsequent version control systems such as
3422CVS, Subversion, and Git. This can make it suitable for system
3423administration files, for example, which are often inherently local to one
3424machine.")
3425 (license license:gpl3+)))
3426
3427(define-public rcs-blame
3428 (package
3429 (name "rcs-blame")
3430 (version "1.3.1-20210207")
3431 (source (origin
3432 (method url-fetch)
3433 (uri (string-append
3434 "https://invisible-mirror.net/archives/rcs-blame/blame-"
3435 version ".tgz"))
3436 (sha256
3437 (base32
3438 "1j0brsvdx3hlbwchddafh8r2xmxv5vg4ahpd68v4bb9xhcq6pcih"))))
3439 (build-system gnu-build-system)
3440 (home-page "https://invisible-island.net/rcs-blame/rcs-blame.html")
3441 (synopsis "Display the last modification for each line in an RCS file")
3442 (description
3443 "@code{blame} outputs an annotated revision from each RCS file. An
3444annotated RCS file describes the revision and date in which each line was
3445added to the file, and the author of each line.")
3446 (license license:gpl2+)))
3447
3448(define-public rcshist
3449 (package
3450 (name "rcshist")
3451 (version "1.04-20190106")
3452 (source (origin
3453 (method url-fetch)
3454 (uri (string-append
3455 "https://invisible-mirror.net/archives/rcshist/rcshist-"
3456 version ".tgz"))
3457 (sha256
3458 (base32
3459 "01ab3xwgm934lxr8bm758am3vxwx4hxx7cc9prbgqj5nh30vdg1n"))))
3460 (build-system gnu-build-system)
3461 (home-page "https://invisible-island.net/rcshist/rcshist.html")
3462 (synopsis "Display RCS change history")
3463 (description
3464 "The @code{rcshist} utility displays the complete revision history of a
3465set of RCS files including log messages and patches. It can also display the
3466patch associated with a particular revision of an RCS file.")
3467 (license (list license:bsd-2
3468 license:bsd-3)))) ; bsd_queue.h
3469
3470(define-public cvs
3471 (package
3472 (name "cvs")
3473 (version "1.12.13")
3474 (source (origin
3475 (method url-fetch)
3476 (uri (string-append
3477 "https://ftp.gnu.org/non-gnu/cvs/source/feature/"
3478 version "/cvs-" version ".tar.bz2"))
3479 (patches (search-patches "cvs-CVE-2017-12836.patch"))
3480 (sha256
3481 (base32
3482 "0pjir8cwn0087mxszzbsi1gyfc6373vif96cw4q3m1x6p49kd1bq"))))
3483 (build-system gnu-build-system)
3484 (arguments
3485 ;; XXX: The test suite looks flawed, and the package is obsolete anyway.
3486 (list
3487 #:tests? #f
3488 #:configure-flags
3489 #~(list
3490 "--with-external-zlib"
3491 "CFLAGS=-g -O2 -Wno-error=implicit-function-declaration"
3492 #$@(if (%current-target-system)
3493 '("cvs_cv_func_printf_ptr=yes"
3494 (string-append "EDITOR="
3495 (search-input-file %build-inputs
3496 "bin/nano")))
3497 '()))
3498 #:phases
3499 #~(modify-phases %standard-phases
3500 (add-after 'unpack 'fix-include
3501 (lambda _
3502 (substitute* "lib/sighandle.c"
3503 (("#ifdef STDC_HEADERS" all)
3504 (string-append "#define STDC_HEADERS 1\n" all))))))))
3505 (inputs (list zlib nano)) ; the default editor
3506 (home-page "https://cvs.nongnu.org")
3507 (synopsis "Historical centralized version control system")
3508 (description
3509 "CVS is a version control system, an important component of Source
3510Configuration Management (SCM). Using it, you can record the history of
3511sources files, and documents. It fills a similar role to the free software
3512RCS, PRCS, and Aegis packages.")
3513 (properties '((lint-hidden-cpe-vendors . ("jenkins"))))
3514 (license license:gpl1+)))
3515
3516(define-public cvs-fast-export
3517 (package
3518 (name "cvs-fast-export")
3519 (version "1.68")
3520 (source
3521 (origin
3522 (method git-fetch)
3523 (uri (git-reference
3524 (url "https://gitlab.com/esr/cvs-fast-export")
3525 (commit version)))
3526 (sha256
3527 (base32
3528 "17225lamdw8rf2yk76rhx8zxhzqjhv88ig3ng21qgvxbhl52wnzm"))))
3529 (build-system gnu-build-system)
3530 (arguments
3531 (list
3532 ;; Tests require a lot of dependencies and are glacially slow.
3533 #:tests? #f
3534 #:phases
3535 #~(modify-phases %standard-phases
3536 (delete 'configure))
3537 #:make-flags
3538 #~(list (string-append "CC=" #$(cc-for-target))
3539 (string-append "CFLAGS+=-Wno-error=calloc-transposed-args")
3540 (string-append "prefix?=" #$output))))
3541 (inputs
3542 (list git python-wrapper))
3543 (native-inputs
3544 (list ruby-asciidoctor/minimal
3545 bison
3546 flex))
3547 (home-page "http://www.catb.org/esr/cvs-fast-export/")
3548 (synopsis "Export an RCS or CVS history as a fast-import stream")
3549 (description
3550 "This program analyzes a collection of RCS files in a CVS repository (or
3551outside of one) and, when possible, emits an equivalent history in the form of
3552a fast-import stream. Not all possible histories can be rendered this way;
3553the program tries to emit useful warnings when it can't.
3554
3555The program can also produce a visualization of the resulting commit
3556@acronym{DAG, directed acyclic graph} in the input format of
3557@uref{http://www.graphviz.org, Graphviz}. The package also includes
3558@command{cvssync}, a tool for mirroring masters from remote CVS hosts.")
3559 (license license:gpl2+)))
3560
3561(define-public vc-dwim
3562 (package
3563 (name "vc-dwim")
3564 (version "1.10")
3565 (source (origin
3566 (method url-fetch)
3567 (uri (string-append "mirror://gnu/vc-dwim/vc-dwim-"
3568 version ".tar.xz"))
3569 (sha256
3570 (base32
3571 "0am6axxdvkm2vwgg0gjrd930yv4dlsdbf0rdv0zh5bhy1ir64rph"))))
3572 (build-system gnu-build-system)
3573 (inputs (list perl))
3574 (native-inputs
3575 (list emacs-minimal ; for `ctags'
3576 inetutils)) ; for `hostname', used in the tests
3577 (home-page "https://www.gnu.org/software/vc-dwim/")
3578 (synopsis "Version-control-agnostic ChangeLog diff and commit tool")
3579 (description
3580 "The vc-dwim package contains two tools, \"vc-dwim\" and \"vc-chlog\".
3581vc-dwim is a tool that simplifies the task of maintaining a ChangeLog and
3582using version control at the same time, for example by printing a reminder
3583when a file change has been described in the ChangeLog but the file has not
3584been added to the VC. vc-chlog scans changed files and generates
3585standards-compliant ChangeLog entries based on the changes that it detects.")
3586 (license license:gpl3+)))
3587
3588(define-public diffstat
3589 (package
3590 (name "diffstat")
3591 (version "1.65")
3592 (source (origin
3593 (method url-fetch)
3594 (uri
3595 (list
3596 (string-append "ftp://invisible-island.net/diffstat/"
3597 "diffstat-" version ".tgz")
3598 (string-append "http://invisible-mirror.net/archives/diffstat/"
3599 "diffstat-" version ".tgz")))
3600 (sha256
3601 (base32
3602 "12m2aysq6syw83bn4gqhpm284a2ran8w6m8pja2wvsvdj8j79wlc"))))
3603 (build-system gnu-build-system)
3604 (home-page "https://invisible-island.net/diffstat/")
3605 (synopsis "Make histograms from the output of @command{diff}")
3606 (description
3607 "Diffstat reads the output of @command{diff} and displays a histogram of
3608the insertions, deletions, and modifications per file. It is useful for
3609reviewing large, complex patch files.")
3610 (license (license:x11-style "file://COPYING"))))
3611
3612(define-public cssc
3613 (package
3614 (name "cssc")
3615 (version "1.4.1")
3616 (source (origin
3617 (method url-fetch)
3618 (uri (string-append "mirror://gnu/" name "/CSSC-"
3619 version ".tar.gz"))
3620 (sha256
3621 (base32
3622 "1vsisqq573xjr2qpn19iwmpqgl3mq03m790akpa4rvj60b4d1gni"))))
3623 (build-system gnu-build-system)
3624 (arguments
3625 `(#:phases
3626 (modify-phases %standard-phases
3627 (add-before 'check 'precheck
3628 (lambda _
3629 (begin
3630 (substitute* "tests/common/test-common"
3631 (("/bin/pwd") (which "pwd")))
3632
3633 (substitute* "tests/prt/all-512.sh"
3634 (("/bin/sh") (which "sh")))
3635
3636 (for-each
3637 (lambda (file)
3638 (substitute* file (("egrep") "grep -E")))
3639 '("tests/common/test-common"
3640 "tests/admin/comment.sh"
3641 "tests/cdc/2comment.sh"
3642 "tests/cdc/4order.sh"
3643 "tests/get/subst.sh"))
3644
3645 ;; XXX: This test has no hope of passing until there is a "nogroup"
3646 ;; entry (or at least some group to which the guix builder does
3647 ;; not belong) in the /etc/group file of the build environment.
3648 ;; Currently we do not have such a group. Disable this test for now.
3649 (substitute* "tests/Makefile"
3650 (("test-delta ") ""))))))))
3651 ;; These are needed for the tests
3652 (native-inputs (list git cvs))
3653 (home-page "https://www.gnu.org/software/cssc/")
3654 (synopsis "File-based version control like SCCS")
3655 (description "GNU CSSC provides a replacement for the legacy Unix source
3656code control system SCCS. This allows old code still under that system to be
3657accessed and migrated on modern systems.")
3658 (license license:gpl3+)))
3659
3660(define-public tig
3661 (package
3662 (name "tig")
3663 (version "2.6.1")
3664 (source
3665 (origin
3666 (method git-fetch)
3667 (uri (git-reference
3668 (url "https://github.com/jonas/tig")
3669 (commit (string-append "tig-" version))))
3670 (file-name (git-file-name name version))
3671 (sha256
3672 (base32 "1ixhi5jx1acg6hdq66q4zjm6zyy62w5jrddci4qrn7v7pbdavyb5"))))
3673 (build-system gnu-build-system)
3674 (arguments
3675 (list
3676 #:phases
3677 #~(modify-phases %standard-phases
3678 (add-after 'install 'install-doc
3679 (lambda _
3680 (invoke "make" "install-doc")))
3681 (add-after 'install 'install-completions
3682 (lambda _
3683 (let ((share (string-append #$output "/share")))
3684 (mkdir-p (string-append share "/bash-completion/completions"))
3685 (mkdir-p (string-append share "/zsh/site-functions"))
3686 (copy-file "contrib/tig-completion.bash"
3687 (string-append share "/bash-completion/completions/tig"))
3688 (copy-file "contrib/tig-completion.zsh"
3689 (string-append share "/zsh/site-functions/_tig"))))))
3690 #:test-target "test"
3691 #:tests? #f)) ; tests require access to /dev/tty
3692 (native-inputs
3693 (list asciidoc autoconf automake docbook-xsl libxml2 pkg-config xmlto))
3694 (inputs
3695 (list ncurses readline))
3696 (home-page "https://jonas.github.io/tig/")
3697 (synopsis "Ncurses-based text user interface for Git")
3698 (description
3699 "Tig is an ncurses text user interface for Git, primarily intended as
3700a history browser. It can also stage hunks for commit, or colorize the
3701output of the @code{git} command.")
3702 (license license:gpl2+)))
3703
3704(define-public findnewest
3705 (package
3706 (name "findnewest")
3707 (version "0.3")
3708 (source
3709 (origin
3710 (method git-fetch)
3711 (uri (git-reference
3712 (url "https://github.com/0-wiz-0/findnewest")
3713 (commit (string-append "findnewest-" version))))
3714 (file-name (git-file-name name version))
3715 (sha256
3716 (base32 "1x1cbn2b27h5r0ah5xc06fkalfdci2ngrgd4wibxjw0h88h0nvgq"))))
3717 (build-system gnu-build-system)
3718 (native-inputs (list autoconf automake))
3719 (home-page "https://github.com/0-wiz-0/findnewest/releases")
3720 (synopsis "Print the modification time of the latest file")
3721 (description
3722 "Recursively find the newest file in a file tree and print its
3723modification time.")
3724 (license license:bsd-2)))
3725
3726(define-public libfossil
3727 (package
3728 (name "libfossil")
3729 (version "0.6.1")
3730 (source
3731 (origin
3732 (method fossil-fetch)
3733 (uri (fossil-reference
3734 (uri "https://fossil.wanderinghorse.net/r/libfossil")
3735 (check-in version)))
3736 (sha256
3737 (base32 "16zrha8vb4dwfmyq86iaz2xz4k91dh018bk94xkxgqbyrr33nm7y"))
3738 (modules '((guix build utils)))
3739 (snippet
3740 #~(begin
3741 (delete-all-but "autosetup" "proj.tcl" "wh-common.tcl")
3742 (delete-file-recursively "extsrc")))))
3743 (build-system gnu-build-system)
3744 (arguments
3745 (list #:configure-flags
3746 #~(list "--no-debug" "--no-fnc" ;TODO: C++ and Tcl binding?
3747 (string-append "--with-sqlite="
3748 #$(this-package-input "sqlite"))
3749 (string-append "--soname=libfossil.so"))
3750 #:phases
3751 #~(modify-phases %standard-phases
3752 (replace 'configure
3753 (lambda* (#:key configure-flags #:allow-other-keys)
3754 (apply invoke "autosetup"
3755 (string-append "--prefix=" #$output)
3756 configure-flags)))
3757 (replace 'check
3758 (lambda* (#:key tests? #:allow-other-keys)
3759 (when tests?
3760 (substitute* "sanity-checks.sh"
3761 ;; FIXME: these tests requires a Fossil checkout.
3762 (("\\./f-sanity.*") "")
3763 (("\\./f-parseparty.*") ""))
3764 (setenv "LD_LIBRARY_PATH" (getcwd))
3765 (invoke "./sanity-checks.sh")))))))
3766 (native-inputs (list autosetup))
3767 (inputs (list sqlite-next zlib))
3768 (home-page "https://fossil.wanderinghorse.net/r/libfossil")
3769 (synopsis "Unofficial Fossil SCM Library API")
3770 (description
3771 "@code{libfossil} is an alternative interface into Fossil repositories,
3772as opposed to a replacement for the core fossil application,
3773intended for new ways to access and manipulate fossil repositories.")
3774 (license license:bsd-2)))
3775
3776(define-public fnc
3777 (let ((check-in
3778 "c158d7ac2175078b4b783157be92de38aa627dc1a237febab9ec92093420cedb")
3779 (revision "0"))
3780 (package
3781 (name "fnc")
3782 (version (fossil-version "0.19" revision check-in))
3783 (source
3784 (origin
3785 (method fossil-fetch)
3786 (uri (fossil-reference
3787 (uri "https://fnc.sh")
3788 (check-in check-in)))
3789 (file-name (fossil-file-name name version))
3790 (sha256
3791 (base32 "00n3qrd34nccxdwwbvs9zikhz6wps6qgbvk4mfww46mshvg7mxdn"))
3792 (modules '((guix build utils)))
3793 (snippet #~(begin
3794 (delete-file-recursively "lib")
3795 (substitute* (find-files "." "\\.c$")
3796 (("^#include \"libfossil.h\"")
3797 "#include <fossil-scm/libfossil.h>"))
3798 (substitute* "fnc.bld.mk"
3799 ((" \\$\\{SQLITE_OBJS\\} \\$\\{FOSSIL_OBJS\\}") "")
3800 (("-lm -lutil -lz ") "")
3801 ;; Fix cross-compiling.
3802 (("install -s") "install"))))))
3803 (build-system gnu-build-system)
3804 (arguments
3805 (list
3806 #:phases #~(modify-phases %standard-phases
3807 (delete 'configure))
3808 #:tests? #f ;no tests
3809 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
3810 "LDFLAGS=-lfossil -lsqlite3"
3811 (string-append "PREFIX=" #$output))))
3812 (inputs (list libfossil ncurses sqlite-next))
3813 (home-page "https://fnc.sh")
3814 (synopsis "Interactive text-based user interface for Fossil")
3815 (description "fnc uses ncurses and libfossil to create a fossil user
3816interface in the terminal. It can view local changes at the hunk level to
3817prepare atomic commits.")
3818 (license license:isc))))
3819
3820(define-public myrepos
3821 (package
3822 (name "myrepos")
3823 (version "1.20180726")
3824 (source
3825 (origin
3826 (method git-fetch)
3827 (uri (git-reference
3828 (url "git://myrepos.branchable.com/myrepos")
3829 (commit version)))
3830 (file-name (string-append name "-" version "-checkout"))
3831 (sha256
3832 (base32 "0jphw61plm8cgklja6hs639xhdvxgvjwbr6jpvjwpp7hc5gmhms5"))))
3833 (build-system gnu-build-system)
3834 (arguments
3835 '(#:test-target "test"
3836 #:make-flags (list (string-append "PREFIX=" %output))
3837 #:phases
3838 (modify-phases %standard-phases
3839 (delete 'configure)
3840 (add-after 'install 'wrap-webcheckout
3841 (lambda* (#:key inputs outputs #:allow-other-keys)
3842 (let ((out (assoc-ref outputs "out")))
3843 (wrap-program (string-append out "/bin/webcheckout")
3844 `("PERL5LIB" ":" prefix
3845 ,(map (lambda (i) (string-append (assoc-ref inputs i)
3846 "/lib/perl5/site_perl"))
3847 '("perl-encode-locale" "perl-http-date"
3848 "perl-http-message" "perl-html-parser" "perl-libwww"
3849 "perl-uri" "perl-try-tiny"))))))))))
3850 (inputs
3851 (list bash-minimal ;for wrap-program
3852 perl
3853 perl-encode-locale
3854 perl-html-parser
3855 perl-http-date
3856 perl-http-message
3857 perl-libwww
3858 perl-try-tiny
3859 perl-uri))
3860 (home-page "https://myrepos.branchable.com/")
3861 (synopsis "Multiple repository management tool")
3862 (description
3863 "Myrepos provides the @code{mr} command, which maps an operation (e.g.,
3864fetching updates) over a collection of version control repositories. It
3865supports a large number of version control systems: Git, Subversion,
3866Mercurial, Bazaar, Darcs, CVS, Fossil, and Veracity.")
3867 (license license:gpl2+)))
3868
3869(define-public grokmirror
3870 (package
3871 (name "grokmirror")
3872 (version "2.0.12")
3873 (source
3874 (origin
3875 (method git-fetch)
3876 (uri (git-reference
3877 (url (string-append "https://git.kernel.org/pub/scm/"
3878 "utils/grokmirror/grokmirror.git"))
3879 (commit (string-append "v" version))))
3880 (file-name (git-file-name name version))
3881 (sha256
3882 (base32 "0plmd753pjqficvqk4jn8rjp43j775c4rjq6ja04jqa89rq1ak71"))))
3883 (build-system pyproject-build-system)
3884 (arguments
3885 (list
3886 #:tests? #f ;no test suite
3887 #:phases
3888 #~(modify-phases %standard-phases
3889 (add-after 'install 'install-manpages
3890 (lambda _
3891 (let* ((man (string-append #$output "/man/man1/")))
3892 (for-each (lambda (file)
3893 (install-file file man))
3894 (find-files "." "\\.1$"))))))))
3895 (native-inputs (list python-setuptools))
3896 (propagated-inputs (list python-packaging python-requests))
3897 (home-page
3898 "https://git.kernel.org/pub/scm/utils/grokmirror/grokmirror.git")
3899 (synopsis "Framework to smartly mirror git repositories")
3900 (description "Grokmirror enables replicating large git repository
3901collections efficiently. Mirrors decide to clone and update repositories
3902based on a manifest file published by servers.")
3903 (license license:gpl3+)))
3904
3905(define-public patatt
3906 (package
3907 (name "patatt")
3908 (version "0.6.3")
3909 (source
3910 (origin
3911 (method git-fetch)
3912 (uri (git-reference
3913 (url "https://git.kernel.org/pub/scm/utils/patatt/patatt.git")
3914 (commit (string-append "v" version))))
3915 (file-name (git-file-name name version))
3916 (sha256
3917 (base32 "1brak6kwnwbz8739aaxxks4nyaxrlldscfmzxdcqxi24afiw3h8z"))))
3918 (build-system pyproject-build-system)
3919 (arguments
3920 ;; XXX: No tests in this release, but they are there on master.
3921 (list #:tests? #f))
3922 (native-inputs (list python-setuptools))
3923 (propagated-inputs (list python-pynacl))
3924 (home-page "https://git.kernel.org/pub/scm/utils/patatt/patatt.git")
3925 (synopsis "Tool for cryptographic patch attestation")
3926 (description "This utility provides end-to-end cryptographic attestation
3927of patches sent via mail. It does so by adapting the DKIM email signature
3928standard to include cryptographic signatures via the X-Developer-Signature
3929email header.")
3930 (license license:expat-0)))
3931
3932(define-public python-patatt
3933 (package
3934 (name "python-patatt")
3935 (version "0.8.0")
3936 (source (origin
3937 (method git-fetch)
3938 (uri (git-reference
3939 (url "https://git.kernel.org/pub/scm/utils/patatt/patatt.git")
3940 (commit (string-append "v" version))))
3941 (file-name (git-file-name name version))
3942 (sha256
3943 (base32
3944 "0p1ncw7v8m9l5hfjxl06wyfbsrjy98wicw49jl0y3yi2k1lk1pxq"))))
3945 (build-system pyproject-build-system)
3946 ;; The tests currently fail due to missing sample filessuch as
3947 ;; "samples/openssh-signed.txt".
3948 (arguments
3949 (list
3950 #:phases
3951 #~(modify-phases %standard-phases
3952 (add-after 'unpack 'patch-commands
3953 (lambda* (#:key inputs #:allow-other-keys)
3954 (substitute* "src/patatt/__init__.py"
3955 (("'git'")
3956 (format #f "'~a'" (search-input-file inputs "bin/git")))
3957 (("GPGBIN = 'gpg'")
3958 (format #f "GPGBIN = '~a'"
3959 (search-input-file inputs "bin/gpg")))
3960 (("SSHKBIN = 'ssh-keygen'")
3961 (format #f "SSHKBIN = '~a'"
3962 (search-input-file inputs "bin/ssh-keygen")))))))))
3963 (inputs (list git gnupg openssh))
3964 (propagated-inputs (list python-pynacl))
3965 (native-inputs (list python-pytest python-setuptools))
3966 (home-page "https://git.kernel.org/pub/scm/utils/patatt/patatt.git/about/")
3967 (synopsis "Python library and CLI for cryptographic patch attestation")
3968 (description "Patatt is a Python library and @acronym{CLI, command-line
3969interface} for adding end-to-end cryptographic attestation to patches sent via
3970email. It adapts the DKIM email signature standard to include cryptographic
3971signatures via the X-Developer-Signature header.")
3972 (license license:expat-0)))
3973
3974(define-public patman
3975 (package
3976 (name "patman")
3977 (version "0.3.0")
3978 (source
3979 (origin
3980 (method git-fetch)
3981 (uri (git-reference
3982 (url "https://github.com/nxtboot/patman")
3983 (commit (string-append "v" version))))
3984 (file-name (git-file-name name version))
3985 ;; XXX: Since 0.3.0, u-boot-pylib is bundled with some modifications.
3986 (sha256
3987 (base32 "1f0dsgvi1g7k6hbvvaaqy99cd93ldn4l5zplf5bh4i5916mxc2nx"))))
3988 (build-system pyproject-build-system)
3989 (arguments
3990 (list
3991 #:phases
3992 #~(modify-phases %standard-phases
3993 (add-after 'unpack 'skip-problematic-tests
3994 (lambda _
3995 (substitute* "patman/func_test.py"
3996 (("([[:blank:]]*)def test_custom_get_maintainer_script\\(.*"
3997 all indent)
3998 ;; FIXME: This test fails only in the container with:
3999 ;; CommandExc: Error running
4000 ;; '/tmp/guix-build-patman-0.3.0.drv-0/patman.j2zlgyhe/dummy-script.sh
4001 ;; 0001-new-commit.patch': [Errno 2] No such file or
4002 ;; directory.
4003 (string-append indent
4004 "@unittest.skip('fails in build container')\n"
4005 all)))
4006 (substitute* "patman/test_cseries.py"
4007 (("([[:blank:]]*)def test_series_send\\(.*" all indent)
4008 ;; This test always fail, whether in the build container or
4009 ;; outside of it (see:
4010 ;; <https://github.com/nxtboot/patman/issues/46>).
4011 (string-append indent
4012 "@unittest.skip('always fails')\n"
4013 all)))))
4014 (replace 'wrap
4015 (lambda* (#:key inputs #:allow-other-keys)
4016 (wrap-script (string-append #$output "/bin/patman")
4017 (let* ((python (assoc-ref inputs "python"))
4018 (version (python-version python))
4019 (site-suffix (string-append "/lib/python" version
4020 "/site-packages")))
4021 `("GUIX_PYTHONPATH" prefix
4022 ,(cons (string-append #$output site-suffix)
4023 (map (lambda (x)
4024 (string-append (assoc-ref inputs x)
4025 site-suffix))
4026 (list "python-aiohttp"
4027 "python-patatt"
4028 "python-pygit2")))))
4029 `("PATH" prefix
4030 ,(map (lambda (command)
4031 (dirname (search-input-file inputs command)))
4032 (list "bin/git" "bin/less")))
4033 `("GIT_EXEC_PATH" prefix
4034 (,(dirname (search-input-file
4035 inputs "libexec/git-core/git-commit"))
4036 ,(dirname (search-input-file
4037 inputs
4038 "libexec/git-core/git-send-email")))))))
4039 (add-before 'check 'prepare-for-tests
4040 (lambda _
4041 (substitute* "patman/func_test.py"
4042 (("/usr/bin/env python3")
4043 (which "python3")))
4044 (setenv "HOME" (getcwd))
4045 (setenv "USER" "guixbuilder")
4046 (invoke "git" "config" "--global" "user.email" "[email protected]")
4047 (invoke "git" "config" "--global" "user.name" "Your Name")))
4048 (replace 'check
4049 (lambda* (#:key tests? #:allow-other-keys)
4050 (when tests?
4051 (invoke "patman" "test")))))))
4052 (native-inputs
4053 (list perl
4054 python-concurrencytest
4055 python-setuptools))
4056 (inputs
4057 (list git
4058 `(,git "send-email")
4059 guile-3.0/pinned ;for wrap-script
4060 less
4061 python-aiohttp
4062 python-patatt
4063 python-pygit2))
4064 (home-page "https://github.com/nxtboot/patman")
4065 (synopsis "Patch automation tool")
4066 (description "Patman is a patch automation script which:
4067@itemize
4068@item Creates patches directly from your branch
4069@item Cleans them up by removing unwanted tags
4070@item Inserts a cover letter with change lists
4071@item Runs the patches through automated checks
4072@item Optionally emails them out to selected people.
4073@end itemize")
4074 (license license:gpl2+)))
4075
4076(define-public b4
4077 (package
4078 (name "b4")
4079 (version "0.15.2")
4080 (source
4081 (origin
4082 (method git-fetch)
4083 (uri (git-reference
4084 (url "https://git.kernel.org/pub/scm/utils/b4/b4.git")
4085 (commit (string-append "v" version))))
4086 (file-name (git-file-name name version))
4087 (sha256
4088 (base32
4089 "00h27hcdj13gq8lg408mjr6cpjzxlmy6sanzagj319lh2bfhndin"))))
4090 (build-system pyproject-build-system)
4091 (arguments
4092 (list
4093 #:tests? (not (%current-target-system)) ; git path is hardcoded.
4094 #:phases
4095 #~(modify-phases %standard-phases
4096 ;; This ensures git is present when called.
4097 (add-after 'unpack 'hardcode-git-bin
4098 (lambda* (#:key inputs #:allow-other-keys)
4099 (substitute* (find-files "src/b4" "\\.py$")
4100 (("\\['git'")
4101 (string-append
4102 "['" (search-input-file inputs "bin/git") "'"))))))))
4103 (inputs
4104 (list git-filter-repo
4105 git-minimal
4106 patatt
4107 python-dkimpy
4108 python-dnspython
4109 python-requests))
4110 (native-inputs
4111 (list python-anyio
4112 python-pytest
4113 python-pytest-asyncio
4114 python-setuptools
4115 python-textual))
4116 (home-page "https://b4.docs.kernel.org/en/latest/")
4117 (synopsis "Tool for working with patches in public-inbox archives")
4118 (description
4119 "The @code{b4} command is designed to make it easier to participate in
4120patch-based workflows for projects that have public-inbox archives.
4121
4122Features include:
4123@itemize
4124@item downloading a thread's mbox given a message ID
4125@item processing an mbox so that is ready to be fed to @code{git-am}
4126@item creating templated replies for processed patches and pull requests
4127@item submitting cryptographic attestation for patches.
4128@end itemize")
4129 (license license:gpl2+)))
4130
4131(define-public git-annex-remote-rclone
4132 (package
4133 (name "git-annex-remote-rclone")
4134 (version "0.8")
4135 (source
4136 (origin
4137 (method git-fetch)
4138 (uri (git-reference
4139 (url "https://github.com/DanielDent/git-annex-remote-rclone")
4140 (commit (string-append "v" version))))
4141 (file-name (git-file-name name version))
4142 (sha256
4143 (base32
4144 "03m95620fp891ki6rsqw5nkydwx84nag5nhyvzfi3q64fpnpmb07"))))
4145 (build-system trivial-build-system)
4146 (arguments
4147 `(#:modules ((guix build utils))
4148 #:builder
4149 (begin
4150 (use-modules (guix build utils))
4151 (let ((bash (search-input-file %build-inputs "/bin/bash"))
4152 (rclone (search-input-file %build-inputs "/bin/rclone")))
4153 (copy-file (string-append (assoc-ref %build-inputs "source")
4154 "/git-annex-remote-rclone")
4155 "git-annex-remote-rclone")
4156 (substitute* "git-annex-remote-rclone"
4157 (("/bin/bash") bash)
4158 (("runcmd rclone") (string-append "runcmd " rclone)))
4159 (install-file "git-annex-remote-rclone"
4160 (string-append %output "/bin"))
4161 #t))))
4162 (inputs
4163 (list bash rclone))
4164 (home-page "https://github.com/DanielDent/git-annex-remote-rclone")
4165 (synopsis "Use rclone-supported cloud storage providers with git-annex")
4166 (description "This wrapper around rclone makes any destination supported
4167by rclone usable with git-annex.")
4168 (license license:gpl3+)))
4169
4170(define-public fossil
4171 (package
4172 (name "fossil")
4173 (version "2.28")
4174 (source
4175 (origin
4176 (method url-fetch)
4177 (uri (string-append
4178 "https://fossil-scm.org/home/tarball/version-" version
4179 "/fossil-" version ".tar.gz"))
4180 (sha256
4181 (base32 "1lw3ridv2id4hf5ksrpjwf7fv65wzs81wli4ksc0qr4h3xfyi66b"))))
4182 (build-system gnu-build-system)
4183 (native-inputs
4184 (list tcl ;for configuration only
4185 which ;for tests only
4186 ed)) ;ditto
4187 (inputs
4188 ;; Need sqlite >= 3.43.0.
4189 (list openssl zlib sqlite-next))
4190 (arguments
4191 `(#:configure-flags (list "--with-openssl=auto"
4192 "--enable-json"
4193 "--disable-internal-sqlite")
4194 #:test-target "test"
4195 #:phases (modify-phases %standard-phases
4196 (add-after 'patch-source-shebangs 'patch-sh
4197 (lambda _
4198 (substitute* '("auto.def")
4199 (("/bin/sh") (which "sh")))))
4200 (replace 'configure
4201 (lambda* (#:key outputs (configure-flags '())
4202 #:allow-other-keys)
4203 ;; The 'configure' script is not an autoconf script and
4204 ;; chokes on unrecognized options.
4205 (apply invoke
4206 "./configure"
4207 (string-append "--prefix="
4208 (assoc-ref outputs "out"))
4209 configure-flags)))
4210 (add-before 'check 'test-setup
4211 (lambda _
4212 (setenv "USER" "guix")
4213 (setenv "TZ" "UTC"))))))
4214 (home-page "https://fossil-scm.org")
4215 (synopsis "Software configuration management system")
4216 (description
4217 "Fossil is a distributed source control management system which supports
4218access and administration over HTTP CGI or via a built-in HTTP server. It has
4219a built-in wiki, built-in file browsing, built-in tickets system, etc.")
4220 (properties
4221 '((release-monitoring-url
4222 . "https://fossil-scm.org/home/uv/latest-release.md")))
4223 (license (list license:public-domain ;src/miniz.c, src/shell.c
4224 license:bsd-2))))
4225
4226(define-public pijul
4227 (package
4228 (name "pijul")
4229 (version "1.0.0-beta.24")
4230 (source
4231 (origin
4232 (method url-fetch)
4233 (uri (crate-uri "pijul" version))
4234 (file-name (string-append name "-" version ".tar.gz"))
4235 (sha256
4236 (base32 "0cjm4rm6f505sq3q8b086zpvq7fb36psgbm2mr1djgvi37r05gvz"))))
4237 (build-system cargo-build-system)
4238 (arguments
4239 (list
4240 #:install-source? #f
4241 #:phases
4242 #~(modify-phases %standard-phases
4243 (add-after 'install 'install-extras
4244 (lambda* (#:key native-inputs outputs #:allow-other-keys)
4245 (let* ((out (assoc-ref outputs "out"))
4246 (share (string-append out "/share"))
4247 (bash-completions-dir
4248 (string-append out "/etc/bash_completion.d/"))
4249 (zsh-completions-dir
4250 (string-append share "/zsh/site-functions"))
4251 (fish-completions-dir
4252 (string-append share "/fish/vendor_completions.d"))
4253 (elvish-completions-dir
4254 (string-append share "/elvish/lib"))
4255 (pijul (if #$(%current-target-system)
4256 (search-input-file native-inputs "/bin/pijul")
4257 (string-append out "/bin/pijul"))))
4258 (mkdir-p bash-completions-dir)
4259 (with-output-to-file
4260 (string-append bash-completions-dir "/pijul")
4261 (lambda _ (invoke pijul "completion" "bash")))
4262 (mkdir-p zsh-completions-dir)
4263 (with-output-to-file
4264 (string-append zsh-completions-dir "/_pijul")
4265 (lambda _ (invoke pijul "completion" "zsh")))
4266 (mkdir-p fish-completions-dir)
4267 (with-output-to-file
4268 (string-append fish-completions-dir "/pijul.fish")
4269 (lambda _ (invoke pijul "completion" "fish")))
4270 (mkdir-p elvish-completions-dir)
4271 (with-output-to-file
4272 (string-append elvish-completions-dir "/pijul")
4273 (lambda _ (invoke pijul "completion" "elvish")))))))))
4274 (native-inputs
4275 (append (if (%current-target-system)
4276 (list this-package)
4277 '())
4278 (list pkg-config)))
4279 (inputs (cons* libgit2-1.9 libsodium openssl (cargo-inputs 'pijul)))
4280 (home-page "https://nest.pijul.com/pijul/pijul")
4281 (synopsis "Distributed version control system")
4282 (description "This package provides pijul, a sound and fast distributed
4283version control system based on a mathematical theory of asynchronous work.")
4284 (license license:gpl2+)))
4285
4286(define-public stagit
4287 (package
4288 (name "stagit")
4289 (version "1.2")
4290 (source (origin
4291 (method git-fetch)
4292 (uri (git-reference
4293 ;; NOTE: It can only be cloned using the git protocol
4294 (url "git://git.codemadness.org/stagit")
4295 (commit version)))
4296 (file-name (git-file-name name version))
4297 (sha256
4298 (base32
4299 "17yggk3fbm731z98warvix332487s0k6knhxnf9zc6f667qi2mlr"))))
4300 (build-system gnu-build-system)
4301 (arguments
4302 (list #:tests? #f ; No tests
4303 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
4304 (string-append "PREFIX=" #$output))
4305 #:phases
4306 #~(modify-phases %standard-phases
4307 (delete 'configure)))) ; No configure script
4308 (inputs
4309 (list libgit2))
4310 (home-page "https://git.codemadness.org/stagit/")
4311 (synopsis "Static git page generator")
4312 (description "Stagit creates static pages for git repositories, the results can
4313be served with a HTTP file server of your choice.")
4314 (license license:expat)))
4315
4316(define-public gource
4317 (package
4318 (name "gource")
4319 (version "0.55")
4320 (source (origin
4321 (method url-fetch)
4322 (uri (string-append
4323 "https://github.com/acaudwell/Gource/releases/download"
4324 "/gource-" version "/gource-" version ".tar.gz"))
4325 (sha256
4326 (base32
4327 "0hh17h0pf4b7yq23xsr5zhl1cs02d2bijxj7ks6m01wbs89948y8"))))
4328 (build-system gnu-build-system)
4329 (arguments
4330 `(#:configure-flags
4331 (list (string-append "--with-boost-libdir="
4332 (assoc-ref %build-inputs "boost")
4333 "/lib")
4334 "--with-tinyxml")
4335 #:disallowed-references ,(list (this-package-native-input "tzdata"))
4336 #:phases (modify-phases %standard-phases
4337 (add-after 'unpack 'unbundle
4338 (lambda _
4339 (delete-file-recursively "src/tinyxml")))
4340 (add-before 'check 'check-setup
4341 (lambda* (#:key inputs #:allow-other-keys)
4342 (setenv "TZDIR" ; for src/test/datetime_tests.cpp
4343 (search-input-directory inputs
4344 "share/zoneinfo")))))))
4345 (native-inputs
4346 (list pkg-config tzdata-for-tests))
4347 (inputs
4348 (list boost-1.83
4349 ftgl
4350 glew
4351 glm
4352 glu
4353 libpng
4354 mesa
4355 pcre2
4356 (sdl-union (list sdl2 sdl2-image))
4357 tinyxml))
4358 (home-page "https://gource.io/")
4359 (synopsis "3D visualisation tool for source control repositories")
4360 (description "@code{gource} provides a software version control
4361visualization. The repository is displayed as a tree where the root of the
4362repository is the centre, directories are branches and files are leaves.
4363Contributors to the source code appear and disappear as they contribute to
4364specific files and directories.")
4365 (license license:gpl3+)))
4366
4367(define-public src
4368 (package
4369 (name "src")
4370 (version "1.32")
4371 (source
4372 (origin
4373 (method git-fetch)
4374 (uri (git-reference
4375 (url "https://gitlab.com/esr/src.git/")
4376 (commit version)))
4377 (file-name (git-file-name name version))
4378 (sha256
4379 (base32 "0kxbmpjr98kfacjidizxcghl541fwnf8yzfvwfq5f9zbv42p8l41"))))
4380 (build-system gnu-build-system)
4381 (arguments
4382 (list
4383 #:make-flags
4384 #~(list (string-append "prefix=" #$output))
4385 #:phases
4386 #~(modify-phases %standard-phases
4387 (delete 'configure) ; no 'configure' script
4388 (add-after 'install 'wrap-program
4389 (lambda* (#:key inputs #:allow-other-keys)
4390 (let* ((prog (string-append #$output "/bin/src"))
4391 (rcs (search-input-file inputs "bin/rcs")))
4392 (wrap-program prog
4393 `("PATH" ":" prefix (,(dirname rcs)))))))
4394 (replace 'check
4395 (lambda* (#:key tests? #:allow-other-keys)
4396 (when tests?
4397 (setenv "HOME" (getenv "TMPDIR"))
4398 (invoke "git" "config" "--global" "user.name" "guix")
4399 (invoke "git" "config" "--global" "user.email" "guix")
4400 (invoke "./srctest")))))))
4401 (native-inputs
4402 (list asciidoc
4403 ;; For testing.
4404 git
4405 perl))
4406 (inputs
4407 (list bash-minimal
4408 cssc
4409 python-wrapper
4410 rcs))
4411 (synopsis "Simple revision control")
4412 (home-page "http://www.catb.org/~esr/src/")
4413 (description
4414 "SRC (or src) is simple revision control, a version-control system for
4415single-file projects by solo developers and authors. It modernizes the
4416venerable RCS, hence the anagrammatic acronym. The design is tuned for use
4417cases like all those little scripts in your @file{~/bin} directory, or a
4418directory full of HOWTOs.")
4419 (license license:bsd-2)))
4420
4421(define-public git-when-merged
4422 ;; Use an unreleased version to get a PY3 compatibility fix.
4423 (let ((commit "ab6af7865a0ba55ba364a6c507e0be6f84f31c6d"))
4424 (package
4425 (name "git-when-merged")
4426 (version (string-append "1.2.0-" (string-take commit 7)))
4427 (source (origin
4428 (method git-fetch)
4429 (uri (git-reference
4430 (url "https://github.com/mhagger/git-when-merged/")
4431 (commit commit)))
4432 (file-name (git-file-name name version))
4433 (sha256
4434 (base32
4435 "0iyk2psf97bc9h43m89p3xjmm79fsx99i7px29g4lcnmdy5kmz0p"))))
4436 (build-system gnu-build-system)
4437 (arguments
4438 `(#:tests? #f ; there are no tests
4439 #:phases
4440 (modify-phases %standard-phases
4441 (delete 'configure)
4442 (delete 'build)
4443 (replace 'install
4444 (lambda* (#:key outputs #:allow-other-keys)
4445 (install-file "bin/git-when-merged"
4446 (string-append (assoc-ref outputs "out")
4447 "/bin"))))
4448 (add-before 'install 'patch-git
4449 (lambda* (#:key inputs #:allow-other-keys)
4450 (let ((git (search-input-file inputs "/bin/git")))
4451 (substitute* "bin/git-when-merged"
4452 (("'git'") (string-append "'" git "'"))))))
4453 (add-after 'install 'wrap-script
4454 (lambda* (#:key outputs #:allow-other-keys)
4455 (wrap-program (string-append (assoc-ref outputs "out")
4456 "/bin/git-when-merged")
4457 `("GUIX_PYTHONPATH" ":" prefix
4458 (,(getenv "GUIX_PYTHONPATH")))))))))
4459 (inputs (list bash-minimal git python-wrapper))
4460 (home-page "https://github.com/mhagger/git-when-merged")
4461 (synopsis "Determine when a commit was merged into a Git branch")
4462 (description "This Git extension defines a subcommand,
4463@code{when-merged}, whose core operation is to find the merge that brought a
4464given commit into the specified ref(s). It has various options that control
4465how information about the merge is displayed.")
4466 (license license:gpl2+))))
4467
4468(define-public git-imerge
4469 (package
4470 (name "git-imerge")
4471 (version "1.1.0")
4472 (source
4473 (origin
4474 (method git-fetch)
4475 (uri (git-reference
4476 (url "https://github.com/mhagger/git-imerge")
4477 (commit (string-append "v" version))))
4478 (file-name (git-file-name name version))
4479 (sha256
4480 (base32 "0vi1w3f0yk4gqhxj2hzqafqq28rihyhyfnp8x7xzib96j2si14a4"))))
4481 (build-system gnu-build-system)
4482 (arguments
4483 `(#:tests? #f ; only manual test scripts
4484 #:make-flags (list (string-append "DESTDIR=" %output)
4485 "PREFIX=")
4486 #:phases
4487 (modify-phases %standard-phases
4488 (delete 'configure)
4489 (add-before 'install 'patch-git
4490 (lambda* (#:key inputs #:allow-other-keys)
4491 (let ((git (search-input-file inputs "/bin/git")))
4492 (substitute* "git-imerge"
4493 (("'git'") (string-append "'" git "'"))))))
4494 (add-after 'install 'wrap-script
4495 (lambda* (#:key outputs #:allow-other-keys)
4496 (wrap-program (string-append (assoc-ref outputs "out")
4497 "/bin/git-imerge")
4498 `("GUIX_PYTHONPATH" ":" prefix
4499 (,(getenv "GUIX_PYTHONPATH")))))))))
4500 (inputs (list bash-minimal git python-wrapper))
4501 (home-page "https://github.com/mhagger/git-imerge")
4502 (synopsis "Incremental merge for Git")
4503 (description "This Git extension defines a subcommand, @code{imerge},
4504which performs an incremental merge between two branches. Its two primary
4505design goals are to reduce the pain of resolving merge conflicts by finding
4506the smallest possible conflicts and to allow a merge to be saved, tested,
4507interrupted, published, and collaborated on while in progress.")
4508 (license license:gpl2+)))
4509
4510(define-public go-github-com-git-lfs-wildmatch-v2
4511 (package
4512 (name "go-github-com-git-lfs-wildmatch-v2")
4513 (version "2.0.1")
4514 (source (origin
4515 (method git-fetch)
4516 (uri (git-reference
4517 (url "https://github.com/git-lfs/wildmatch")
4518 (commit (string-append "v" version))))
4519 (file-name (git-file-name name version))
4520 (sha256
4521 (base32
4522 "0yg6d77d5l6v7cd8vr00y68z9aqb8qs4lidv0hkqh4fvz0ggvpln"))))
4523 (build-system go-build-system)
4524 (arguments
4525 '(#:import-path "github.com/git-lfs/wildmatch/v2"))
4526 (home-page "https://github.com/git-lfs/wildmatch")
4527 (synopsis "Go implementation of Git's wildmatch")
4528 (description
4529 "This package is an implementation of Git's wildmatch.c-style pattern
4530matching.")
4531 (license license:expat)))
4532
4533(define-public git-lfs
4534 (package
4535 (name "git-lfs")
4536 (version "3.7.1")
4537 (source
4538 (origin
4539 (method git-fetch)
4540 (uri (git-reference
4541 (url "https://github.com/git-lfs/git-lfs")
4542 (commit (string-append "v" version))))
4543 (file-name (git-file-name name version))
4544 (sha256
4545 (base32 "0zvawzaqk528rsnrkqif04b806348p4argmpcsg6ppl0gi7295rp"))))
4546 (build-system go-build-system)
4547 (arguments
4548 (list
4549 #:embed-files #~(list "children" "nodes" "text")
4550 #:import-path "github.com/git-lfs/git-lfs/v3"
4551 #:install-source? #f
4552 #:test-flags #~(list "-skip" "TestHistoryRewriterUpdatesRefs")
4553 #:phases
4554 #~(modify-phases %standard-phases
4555 ;; Only build the man pages if ruby-asciidoctor is available.
4556 #$@(if (this-package-native-input "ruby-asciidoctor")
4557 #~((add-before 'build 'man-gen
4558 ;; Without this, the binary generated in 'build
4559 ;; phase won't have any embedded usage-text.
4560 (lambda _
4561 (with-directory-excursion "src/github.com/git-lfs/git-lfs/v3"
4562 (invoke "make" "mangen"))))
4563 (add-after 'build 'build-man-pages
4564 (lambda _
4565 (with-directory-excursion "src/github.com/git-lfs/git-lfs/v3"
4566 (invoke "make" "man"))))
4567 (add-after 'install 'install-man-pages
4568 (lambda* (#:key outputs #:allow-other-keys)
4569 (with-directory-excursion "src/github.com/git-lfs/git-lfs/v3/man"
4570 (for-each
4571 (lambda (manpage)
4572 (install-file manpage
4573 (string-append #$output "/share/man/man1")))
4574 (find-files "." "^git-lfs.*\\.1$"))))))
4575 #~())
4576 (add-after 'install 'rename-binary
4577 (lambda _
4578 (with-directory-excursion (string-append #$output "/bin")
4579 (rename-file "v3" "git-lfs")))))))
4580 (native-inputs
4581 (append (list git-minimal/pinned
4582 go-github-com-avast-retry-go
4583 go-github-com-dpotapov-go-spnego
4584 go-github-com-git-lfs-gitobj-v2
4585 go-github-com-git-lfs-go-netrc
4586 go-github-com-git-lfs-pktline
4587 go-github-com-git-lfs-wildmatch-v2
4588 go-github-com-golang-groupcache
4589 go-github-com-jmhodges-clock
4590 go-github-com-leonelquinteros-gotext
4591 go-github-com-mattn-go-isatty
4592 go-github-com-olekukonko-ts
4593 go-github-com-pkg-errors
4594 go-github-com-rubyist-tracerx
4595 go-github-com-spf13-cobra
4596 go-github-com-ssgelm-cookiejarparser
4597 go-github-com-stretchr-testify
4598 go-github-com-xeipuuv-gojsonschema
4599 go-golang-org-x-net
4600 go-golang-org-x-sync
4601 go-golang-org-x-sys)
4602 ;; make `ronn` available during build for man page generation
4603 (if (supported-package? ruby-asciidoctor/minimal)
4604 (list ronn-ng ruby-asciidoctor/minimal)
4605 '())))
4606 (home-page "https://git-lfs.com/")
4607 (synopsis "Git extension for versioning large files")
4608 (description
4609 "Git Large File Storage (LFS) replaces large files such as audio samples,
4610videos, datasets, and graphics with text pointers inside Git, while storing the
4611file contents on a remote server.")
4612 (license license:expat)))
4613
4614(define-public lfs-s3
4615 (package
4616 (name "lfs-s3")
4617 (version "0.2.1")
4618 (source
4619 (origin
4620 (method git-fetch)
4621 (uri (git-reference
4622 (url "https://github.com/nicolas-graves/lfs-s3")
4623 (commit version)))
4624 (file-name (git-file-name name version))
4625 (sha256
4626 (base32 "1d2jwpqfbcd1hb213i6fjln0sqyg8ldjfrkzf312mivp2b1bxjl3"))))
4627 (build-system go-build-system)
4628 (arguments
4629 (list
4630 #:import-path "github.com/nicolas-graves/lfs-s3"))
4631 (inputs (list git-lfs))
4632 (propagated-inputs
4633 (list go-github-com-aws-aws-sdk-go-v2
4634 go-github-com-aws-aws-sdk-go-v2-config
4635 go-github-com-aws-aws-sdk-go-v2-feature-s3-manager
4636 go-github-com-aws-aws-sdk-go-v2-service-s3
4637 go-github-com-klauspost-compress))
4638 (home-page "https://git.sr.ht/~ngraves/lfs-s3/")
4639 (synopsis "Git extension for versioning large files in S3")
4640 (description
4641 "This package provides a custom transfer agent for Git LFS, allowing
4642plain S3 bucket usage as remote storage for media files. This package uses a
4643standalone agent instead of a server.")
4644 (license license:expat)))
4645
4646(define-public git-open
4647 (package
4648 (name "git-open")
4649 (version "2.1.0")
4650 (source
4651 (origin
4652 (method git-fetch)
4653 (uri (git-reference
4654 (url "https://github.com/paulirish/git-open")
4655 (commit (string-append "v" version))))
4656 (file-name (git-file-name name version))
4657 (sha256
4658 (base32 "11n46bngvca5wbdbfcxzjhjbfdbad7sgf7h9gf956cb1q8swsdm0"))))
4659 (build-system copy-build-system)
4660 (inputs
4661 (list bash-minimal xdg-utils))
4662 (arguments
4663 `(#:phases
4664 (modify-phases %standard-phases
4665 (add-after 'install 'wrap-program
4666 (lambda* (#:key outputs inputs #:allow-other-keys)
4667 (let ((out (assoc-ref outputs "out"))
4668 (xdg-utils (assoc-ref inputs "xdg-utils")))
4669 (wrap-program (string-append out "/bin/git-open")
4670 `("PATH" ":" prefix (,(string-append xdg-utils "/bin"))))))))
4671 #:install-plan
4672 '(("git-open" "bin/git-open"))))
4673 (home-page "https://github.com/paulirish/git-open")
4674 (synopsis "Open a Git repository's homepage from the command-line")
4675 (description
4676 "@code{git open} opens the repository's website from the command-line,
4677guessing the URL pattern from the @code{origin} remote.")
4678 (license license:expat)))
4679
4680(define-public tla
4681 (package
4682 (name "gnu-arch")
4683 (version "1.3.5")
4684 (source (origin
4685 (method url-fetch)
4686 (uri (string-append "https://ftp.gnu.org/old-gnu/gnu-arch/"
4687 "tla-" version ".tar.gz"))
4688 (sha256
4689 (base32
4690 "01mfzj1i6p4s8191cgd5850hds1zls88hkf9rb6qx1vqjv585aj0"))
4691 (modules '((guix build utils)))
4692 (snippet
4693 '(begin
4694 ;; In tar 1.32, '--preserve' is ambiguous and leads to an
4695 ;; error, so address that.
4696 (substitute* "src/tla/libarch/archive.c"
4697 (("\"--preserve\"")
4698 "\"--preserve-permissions\""))))))
4699 (build-system gnu-build-system)
4700 (arguments
4701 (list #:phases #~(modify-phases %standard-phases
4702 (replace 'configure
4703 (lambda _
4704 (chdir "src")
4705
4706 (mkdir "=build")
4707 (chdir "=build")
4708
4709 ;; For libneon's 'configure' script.
4710 ;; XXX: There's a bundled copy of neon.
4711 (setenv "CONFIG_SHELL" (which "sh"))
4712
4713 (invoke "../configure" "--prefix" #$output
4714 "--config-shell" (which "sh")
4715 "--with-posix-shell" (which "sh")
4716 "--with-cc" "gcc"))))
4717
4718 ;; There are build failures when building in parallel.
4719 #:parallel-build? #f
4720 #:parallel-tests? #f
4721
4722 #:test-target "test"))
4723 (native-inputs
4724 (list gcc-10 which))
4725 (synopsis "Historical distributed version-control system")
4726 (description
4727 "GNU Arch, aka. @code{tla}, was one of the first free distributed
4728version-control systems (DVCS). It saw its last release in 2006. This
4729package is provided for users who need to recover @code{tla} repositories and
4730for historians.")
4731 (home-page "https://www.gnu.org/software/gnu-arch/")
4732 (license license:gpl2))) ;version 2 only
4733
4734(define-public diff-so-fancy
4735 (package
4736 (name "diff-so-fancy")
4737 (version "1.4.4")
4738 (source (origin
4739 (method git-fetch)
4740 (uri (git-reference
4741 (url "https://github.com/so-fancy/diff-so-fancy")
4742 (commit (string-append "v" version))))
4743 (file-name (git-file-name name version))
4744 (sha256
4745 (base32
4746 "0ck9v9dc9zm3wr1vdq96zwvv9szsbimyxvnd76q5l4vcb4iqnpy8"))))
4747 (inputs
4748 (list bash-minimal perl ncurses))
4749 (build-system copy-build-system)
4750 (arguments
4751 '(#:phases
4752 (modify-phases %standard-phases
4753 (add-after 'unpack 'patch-lib-path
4754 (lambda* (#:key outputs #:allow-other-keys)
4755 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
4756 (substitute* "diff-so-fancy"
4757 (("use lib.*$")
4758 (string-append "use lib '" lib "';\n"))))))
4759 (add-after 'install 'symlink-executable
4760 (lambda* (#:key outputs inputs #:allow-other-keys)
4761 (let ((out (assoc-ref outputs "out"))
4762 (ncurses (assoc-ref inputs "ncurses"))
4763 (perl (assoc-ref inputs "perl")))
4764 (wrap-program (string-append out "/bin/diff-so-fancy")
4765 `("PATH" ":" prefix (,(string-append ncurses "/bin")
4766 ,(string-append perl "/bin"))))))))
4767 #:install-plan
4768 '(("lib" "lib")
4769 ("diff-so-fancy" "bin/"))))
4770 (home-page "https://github.com/so-fancy/diff-so-fancy")
4771 (synopsis "Makes diffs more human friendly and readable")
4772 (description
4773 "@code{diff-so-fancy} strives to make your diffs human readable instead
4774of machine readable. This helps improve code quality and helps you spot
4775defects faster.")
4776 (license license:expat)))
4777
4778(define-public gita
4779 (package
4780 (name "gita")
4781 (version "0.16.7.2")
4782 (source
4783 (origin
4784 (method git-fetch)
4785 (uri (git-reference
4786 (url "https://github.com/nosarthur/gita")
4787 (commit (string-append "v" version))))
4788 (file-name (git-file-name name version))
4789 (sha256
4790 (base32 "118dzmjgml0c32yllr2178ash2hvgn201i463bv4y0qbywajm9ax"))))
4791 (build-system pyproject-build-system)
4792 (arguments
4793 (list
4794 #:test-flags #~(list "--ignore" "tests/test_main.py")
4795 #:phases
4796 #~(modify-phases %standard-phases
4797 (add-before 'check 'pre-check
4798 (lambda _
4799 (invoke (string-append
4800 #$(this-package-native-input "git-minimal") "/bin/git")
4801 "init")))
4802 (add-after 'install 'install-shell-completions
4803 (lambda _
4804 (let* ((out #$output)
4805 (bash-completion (string-append out "/etc/bash_completion.d"))
4806 (zsh-completion (string-append out "/etc/zsh/site-functions")))
4807 (mkdir-p bash-completion)
4808 (copy-file "auto-completion/bash/.gita-completion.bash"
4809 (string-append bash-completion "/gita"))
4810 (mkdir-p zsh-completion)
4811 (copy-file "auto-completion/zsh/.gita-completion.zsh"
4812 (string-append zsh-completion "/_gita"))))))))
4813 (native-inputs
4814 (list git-minimal/pinned ;for tests
4815 python-pytest
4816 python-setuptools
4817 python-wheel))
4818 (propagated-inputs
4819 (list python-argcomplete))
4820 (home-page "https://github.com/nosarthur/gita")
4821 (synopsis "Command-line tool to manage multiple Git repos")
4822 (description "This package provides a command-line tool to manage
4823multiple Git repos.
4824
4825This tool does two things:
4826@itemize
4827@item display the status of multiple Git repos such as branch, modification,
4828commit message side by side
4829@item (batch) delegate Git commands/aliases from any working directory
4830@end itemize
4831
4832If several repos are related, it helps to see their status together.")
4833 (license license:expat)))
4834
4835(define-public ghq
4836 (package
4837 (name "ghq")
4838 (version "1.7.1")
4839 (home-page "https://github.com/x-motemen/ghq")
4840 (source (origin
4841 (method git-fetch)
4842 (uri (git-reference
4843 (url home-page)
4844 (commit (string-append "v" version))))
4845 (file-name (git-file-name name version))
4846 (sha256
4847 (base32
4848 "0ai3klp3fm5r0idnml5pm55wcvkav3w0s11snlmr0ab1ki8m9sg5"))))
4849 (build-system go-build-system)
4850 (arguments
4851 (list
4852 #:install-source? #f
4853 #:import-path "github.com/x-motemen/ghq"
4854 #:phases
4855 #~(modify-phases %standard-phases
4856 (add-after 'install 'install-completions
4857 (lambda* (#:key outputs import-path #:allow-other-keys)
4858 (let* ((out #$output)
4859 (bash-completion (string-append out "/etc/bash_completion.d"))
4860 (zsh-completion (string-append out "/share/zsh/site-functions")))
4861 (with-directory-excursion (string-append "src/" import-path)
4862 (mkdir-p bash-completion)
4863 (copy-file "misc/bash/_ghq"
4864 (string-append bash-completion "/ghq"))
4865 (mkdir-p zsh-completion)
4866 (copy-file "misc/zsh/_ghq"
4867 (string-append zsh-completion "/_ghq")))))))))
4868 (native-inputs
4869 (list git-minimal/pinned))
4870 (inputs
4871 (list go-github-com-mattn-go-isatty
4872 go-github-com-motemen-go-colorine
4873 go-github-com-saracen-walker
4874 go-github-com-songmu-gitconfig
4875 go-github-com-urfave-cli-v2
4876 go-golang-org-x-net
4877 go-golang-org-x-sync
4878 go-golang-org-x-text))
4879 (synopsis "Manage remote repository clones")
4880 (description
4881 "@code{ghq} provides a way to organize remote repository clones, like
4882@code{go get} does. When you clone a remote repository by @code{ghq get}, ghq
4883makes a directory under a specific root directory (by default @file{~/ghq})
4884using the remote repository URL's host and path.")
4885 (license license:expat)))
4886
4887(define-public tkrev
4888 (package
4889 (name "tkrev")
4890 (version "9.4.1")
4891 (source
4892 (origin
4893 (method url-fetch)
4894 (uri (string-append
4895 "mirror://sourceforge/tkcvs/tkrev_" version ".tar.gz"))
4896 (sha256
4897 (base32 "0bpfbhkngzmwy476mfc69mkd94l0m2wxznrn0qzd81s450yxjw2q"))))
4898 (build-system gnu-build-system)
4899 (arguments
4900 `(#:phases
4901 (modify-phases %standard-phases
4902 (delete 'configure)
4903 (delete 'build)
4904 (replace 'install
4905 (lambda* (#:key outputs #:allow-other-keys)
4906 (let* ((out (assoc-ref outputs "out"))
4907 (bin (string-append out "/bin")))
4908 (invoke "wish" "doinstall.tcl" "-nox" out)
4909 (install-file "contrib/tkdirdiff" bin))))
4910 (add-after 'install 'wrap-programs
4911 (lambda* (#:key outputs #:allow-other-keys)
4912 (for-each
4913 (lambda (file)
4914 (wrap-program (string-append (assoc-ref outputs "out")
4915 "/bin/" file)
4916 `("PATH" ":" prefix (,(dirname (which "wish"))))))
4917 '("tkdiff"
4918 "tkdirdiff"
4919 "tkrev")))))
4920 #:tests? #f))
4921 (inputs
4922 (list bash-minimal tk))
4923 (home-page "https://tkcvs.sourceforge.io")
4924 (synopsis "Graphical interface to CVS, Subversion, Git, and RCS")
4925 (description
4926 "TkRev (formerly TkCVS) is a Tcl/Tk-based graphical interface to the CVS,
4927Subversion and Git configuration management systems. It will also help with
4928RCS. It shows the status of the files in the current working directory, and
4929has tools for tagging, merging, checking in/out, and other user operations.
4930TkDiff is included for browsing and merging your changes.")
4931 (license license:gpl2+)))
4932
4933(define-public qgit
4934 (package
4935 (name "qgit")
4936 (version "2.13")
4937 (source (origin
4938 (method git-fetch)
4939 (uri (git-reference
4940 (url "https://github.com/tibirna/qgit")
4941 (commit (string-append "qgit-" version))))
4942 (file-name (git-file-name name version))
4943 (sha256
4944 (base32
4945 "0di205cy97qdfgwnmzscw0ar7i734gmqjxz1lyfdrfhwhwapmv44"))))
4946 (build-system qt-build-system)
4947 (arguments
4948 (list #:qtbase qtbase
4949 #:tests? #f)) ;no tests
4950 (propagated-inputs
4951 (list git))
4952 (inputs
4953 (list qt5compat
4954 qtwayland))
4955 (home-page "https://github.com/tibirna/qgit")
4956 (synopsis "Graphical front-end for git")
4957 (description
4958 "Qgit is a graphical front-end for git, with features to:
4959@itemize
4960@item view revisions, diffs, files history, files annotation and archive tree,
4961@item commit changes visually cherry picking modified files,
4962@item apply or save patch series from selected commits, drag and drop commits,
4963@item associate commands sequences, scripts and anything else executable to a
4964 custom action,
4965@item push/pop commits,
4966@item apply/save/create patches
4967@item and cherry pick single modified files.
4968@end itemize")
4969 (license license:gpl3+)))
4970
4971(define-public git-filter-repo
4972 (package
4973 (name "git-filter-repo")
4974 (version "2.47.0")
4975 (source
4976 (origin
4977 (method git-fetch)
4978 (uri (git-reference
4979 (url "https://github.com/newren/git-filter-repo")
4980 (commit (string-append "v" version))))
4981 (file-name (git-file-name name version))
4982 (sha256
4983 (base32
4984 "15gwl1gax7rxwjd7q4az25xc1wmmxd1f5q63wkv4n9dab6i4ighx"))
4985 ;; Modified from <https://github.com/newren/git-filter-repo/pull/477>.
4986 ;; Used with 'unpack-git-source phase.
4987 (patches
4988 (search-patches "git-filter-repo-2.38.0-generate-doc.patch"
4989 "git-filter-repo-2.47.0-dont-crash-on-multiline-stuff.patch"))))
4990 (build-system pyproject-build-system)
4991 (arguments
4992 (list
4993 #:modules
4994 '(((guix build gnu-build-system) #:prefix gnu:)
4995 (guix build pyproject-build-system)
4996 (guix build utils)
4997 (srfi srfi-26))
4998 #:phases
4999 #~(modify-phases %standard-phases
5000 (delete 'configure)
5001 (add-after 'unpack 'unpack-git-source
5002 (lambda _
5003 (let* ((old-path (getcwd))
5004 (doc-source (string-append old-path "/Documentation")))
5005 (mkdir-p "git-source")
5006 (chdir "git-source")
5007 ((assoc-ref %standard-phases 'unpack)
5008 #:source
5009 #+(package-source (this-package-native-input "git-minimal")))
5010 (for-each
5011 (cut install-file <> doc-source)
5012 (find-files "." "asciidoc\\.conf\\.in$|manpage.*\\.xsl$"))
5013 ;; These attributes are probably not needed.
5014 (with-directory-excursion doc-source
5015 (substitute* "asciidoc.conf.in"
5016 (("@GIT_(VERSION|DATE)@") ""))
5017 (rename-file "asciidoc.conf.in" "asciidoc.conf"))
5018 (chdir old-path)
5019 (delete-file-recursively "git-source"))))
5020 (add-after 'unpack-git-source 'fix-t9391
5021 (lambda* (#:key inputs native-inputs #:allow-other-keys)
5022 (substitute* "t/t9391-filter-repo-lib-usage.sh"
5023 (("/bin/bash")
5024 (search-input-file (or native-inputs inputs) "/bin/bash")))))
5025 (add-before 'build 'set-pythondir
5026 (lambda* (#:key inputs outputs #:allow-other-keys)
5027 (substitute* "Makefile"
5028 (("(pythondir = ).*" _ pre)
5029 (string-append pre (site-packages inputs outputs))))))
5030 (add-after 'build 'build-doc
5031 (lambda _
5032 (invoke "make" "doc"
5033 (string-append "prefix=" #$output)
5034 (string-append "VERSION=" #$version))))
5035 (add-after 'install 'install-doc
5036 (lambda _
5037 (let ((man1 (string-append #$output "/share/man/man1")))
5038 (copy-recursively "Documentation/man1" man1))))
5039 (add-after 'install-doc 'compress-documentation
5040 (assoc-ref gnu:%standard-phases 'compress-documentation))
5041 (replace 'check
5042 (lambda* (#:key tests? #:allow-other-keys)
5043 (when tests?
5044 (invoke "t/run_tests")))))))
5045 (native-inputs
5046 (list asciidoc
5047 docbook-xsl
5048 git-minimal/pinned
5049 libxml2 ;for XML_CATALOG_FILES
5050 xmlto
5051 perl
5052 python-setuptools
5053 python-setuptools-scm
5054 rsync))
5055 (inputs (list python)) ;for the shebang
5056 (home-page "https://github.com/newren/git-filter-repo")
5057 (synopsis "Quickly rewrite Git repository history")
5058 (description
5059 "@command{git filter-repo} is a versatile tool for rewriting history,
5060which roughly falls into the same space of tool like git filter-branch but
5061with more capabilities. @command{git filter-repo} is now recommended by the
5062Git project instead of @command{git filter-branch}.")
5063 (license (list license:expat ;; Main license.
5064 license:gpl2)))) ;; For test harness.
5065
5066(define-public gitlint
5067 (package
5068 (name "gitlint")
5069 (version "0.19.1")
5070 (source (origin
5071 (method url-fetch)
5072 ;; the gitlint-core pypi package contains the actual gitlint
5073 ;; code; the gitlint package only pulls in gitlint-core with
5074 ;; stricter dependency versioning
5075 (uri (pypi-uri "gitlint_core" version))
5076 (sha256
5077 (base32
5078 "14lrlbdbnm1biczd54iymbgi5k02hnxmxxh3kr5650gm7yq7gybv"))))
5079 (build-system pyproject-build-system)
5080 (arguments
5081 (list
5082 #:tests? #f ;not included in PyPI, see pyproejct.toml
5083 #:phases
5084 #~(modify-phases %standard-phases
5085 (add-before 'build 'loosen-requirements
5086 (lambda* (#:key inputs #:allow-other-keys)
5087 (substitute* "gitlint/shell.py"
5088 (("'git'") (string-append
5089 "'"
5090 (search-input-file inputs "bin/git")
5091 "'"))
5092 ;; force using subprocess instead of sh so git does not need
5093 ;; to be a propagated input
5094 (("if USE_SH_LIB") "if False")))))))
5095 (native-inputs
5096 (list python-hatch-vcs
5097 python-hatchling))
5098 (inputs
5099 (list git python-arrow python-click python-sh))
5100 (home-page "https://jorisroovers.com/gitlint/")
5101 (synopsis "Linting Git commit messages")
5102 (description
5103 "Gitlint is a Git commit message linter written in Python: it checks your
5104commit messages for style.")
5105 (license license:expat)))
5106
5107(define-public git-extras
5108 (package
5109 (name "git-extras")
5110 (version "7.5.0")
5111 (source
5112 (origin
5113 (method git-fetch)
5114 (uri (git-reference
5115 (url "https://github.com/tj/git-extras")
5116 (commit version)))
5117 (file-name (git-file-name name version))
5118 (sha256
5119 (base32 "1yrnzhf7z21rrirw55vm9rwaliy4hib3qsibf0y8gs4gsv0lnr06"))))
5120 (build-system gnu-build-system)
5121 (arguments
5122 (list
5123 ;; XXX: Tests require additional setup with Pytest, see
5124 ;; <.github/workflows/ci.yml>.
5125 #:tests? #f
5126 #:make-flags
5127 #~(list (string-append "PREFIX=" #$output))
5128 #:phases
5129 #~(modify-phases %standard-phases
5130 ;; No configure script, build process, or tests.
5131 (delete 'bootstrap)
5132 (delete 'configure)
5133 (delete 'build)
5134 (delete 'check)
5135 (add-after 'unpack 'hardcode-dependency-paths
5136 (lambda* (#:key inputs #:allow-other-keys)
5137 ;; Write to and copy from temporary file to prevent
5138 ;; "make: bash: Argument list too long" errors.
5139 (let* ((temp-file (mkstemp! "temp-file.XXXXXX"))
5140 (temp-filename (port-filename temp-file)))
5141 (map (lambda (name)
5142 (format temp-file "export PATH=$PATH:~a/bin~%"
5143 (assoc-ref inputs name)))
5144 (list "coreutils-minimal"
5145 "curl"
5146 "findutils"
5147 "gawk"
5148 "less"
5149 "ncurses"
5150 "procps"
5151 "rsync"
5152 "sed"
5153 "util-linux"))
5154 ;; The Makefile injects helper scripts and functions into each
5155 ;; script. This substitution injects a PATH appending the bin
5156 ;; directory of each non-propagated input in order to minimize
5157 ;; the number of packages propagated to the profile.
5158 (substitute* "Makefile"
5159 (("head -1 bin/\\$\\(COMMAND\\) > \\$\\(TEMPFILE\\); \\\\" line)
5160 (string-append
5161 line "\n"
5162 "cat " temp-filename " >> $(TEMPFILE); \\")))))))))
5163 (propagated-inputs (list git))
5164 (inputs
5165 (list coreutils-minimal
5166 curl
5167 findutils
5168 gawk
5169 less
5170 ncurses
5171 procps
5172 rsync
5173 sed
5174 util-linux))
5175 (home-page "https://github.com/tj/git-extras")
5176 (synopsis "Additional Git utilities")
5177 (description "The git-extras package provides a collection of additional
5178git commands for repository metrics and summarization, commit and log editing,
5179developer workflow, and project and release management.")
5180 (license license:expat)))
5181
5182(define-public ngit-cli
5183 (package
5184 (name "ngit-cli")
5185 (version "2.5.0")
5186 (source (origin
5187 (method git-fetch)
5188 (uri (git-reference
5189 (url "https://ngit.dev/ngit.git")
5190 (commit (string-append "v" version))))
5191 (file-name (git-file-name name version))
5192 (patches
5193 (search-patches "ngit-cli-tests-libgit2-version.patch"))
5194 (sha256
5195 (base32
5196 "1k3h0rkm9zfpyzwvfp0aix3b8lphz1y5pb431jl2jg8wrarpf4bz"))))
5197 (build-system cargo-build-system)
5198 (arguments
5199 (list
5200 #:install-source? #f
5201 ;; Integration tests drive loopback network services, including an
5202 ;; external ngit-grasp binary; run only self-contained unit tests.
5203 #:cargo-test-flags ''("--lib" "--bins" "--benches" "--examples")
5204 ;; cargo-build-system checks packages[0] from `cargo metadata` when
5205 ;; deciding whether to run `cargo install`. This workspace lists the
5206 ;; library-only test_harness package first, so force installing the root
5207 ;; package that provides the ngit and git-remote-nostr binaries.
5208 #:cargo-install-paths ''(".")
5209 #:phases
5210 #~(modify-phases %standard-phases
5211 ;; Replace the bare "git" command names (and the self-referential
5212 ;; "ngit" one) with absolute store references so that ngit never
5213 ;; resolves these executables through the ambient $PATH.
5214 (add-after 'unpack 'hardcode-executable-paths
5215 (lambda* (#:key inputs outputs #:allow-other-keys)
5216 (let ((git (search-input-file inputs "bin/git"))
5217 (ngit (string-append (assoc-ref outputs "out")
5218 "/bin/ngit")))
5219 (substitute* '("src/bin/ngit/sub_commands/apply.rs"
5220 "src/bin/ngit/sub_commands/list.rs"
5221 "src/bin/ngit/sub_commands/pr_merge.rs")
5222 (("Command::new\\(\"git\"\\)")
5223 (string-append "Command::new(\"" git "\")")))
5224 (substitute* "src/bin/ngit/sub_commands/init.rs"
5225 (("let command = \"git\";")
5226 (string-append "let command = \"" git "\";"))
5227 (("let command = \"ngit\";")
5228 (string-append "let command = \"" ngit "\";"))))))
5229 ;; The invocation sites above use absolute store paths, but two
5230 ;; lookups still go by name:
5231 ;; - git finds the `git-remote-nostr' remote helper on $PATH;
5232 ;; - the credentials callback that ngit's shared library
5233 ;; installs (src/lib/fetch.rs, push.rs, list.rs) makes git2
5234 ;; run `sh -c "git credential-<name> get"'. That command is
5235 ;; built in the git2 crate, not in ngit, so the substitution
5236 ;; above cannot reach it.
5237 ;; Prepend the directories that provide those programs.
5238 (add-after 'install 'wrap-programs
5239 (lambda* (#:key inputs outputs #:allow-other-keys)
5240 (let* ((out (assoc-ref outputs "out"))
5241 (bin (string-append out "/bin"))
5242 (git (dirname (search-input-file inputs "bin/git")))
5243 (bash (dirname (search-input-file inputs "bin/bash"))))
5244 ;; ngit-cli's bin provides git-remote-nostr, git's bin
5245 ;; provides `git', and bash's bin provides `sh'. Prepend
5246 ;; (not replace) so the caller's PATH stays: git invokes
5247 ;; user-configured programs by name (credential helpers,
5248 ;; askpass, hooks, editors, filters)--which replacing PATH
5249 ;; would break.
5250 (wrap-program (string-append bin "/ngit")
5251 `("PATH" ":" prefix (,bin ,git ,bash)))
5252 ;; git-remote-nostr gets no entry for ngit-cli's bin: git
5253 ;; already found it, and it never looks up itself or a
5254 ;; sibling. git's and bash's bins are here for the `git'
5255 ;; and `sh' that the credential invocation needs.
5256 (wrap-program (string-append bin "/git-remote-nostr")
5257 `("PATH" ":" prefix (,git ,bash)))))))))
5258 (inputs
5259 (cons* bash-minimal git-minimal libgit2-1.9 libsecp256k1 libssh2
5260 openssl zlib
5261 (cargo-inputs 'ngit-cli)))
5262 (native-inputs
5263 (list pkg-config))
5264 (synopsis "Put Git and collaboration metadata on Nostr")
5265 (description
5266 "This package provides a way to store git metadata on Nostr
5267(including collaboration stuff like PRs, issues, statuses, ...).")
5268 (home-page "https://gitworkshop.dev/danconwaydev.com/ngit")
5269 (license license:expat)))
5270
5271(define-public git-quick-stats
5272 (package
5273 (name "git-quick-stats")
5274 (version "2.11.0")
5275 (source
5276 (origin
5277 (method git-fetch)
5278 (uri (git-reference
5279 (url "https://github.com/git-quick-stats/git-quick-stats")
5280 (commit version)))
5281 (file-name (git-file-name name version))
5282 (sha256
5283 (base32 "1sx6idfl0s88xx5wd39cg1540hzkh7p6yad0l56qnf9v2i38hra1"))))
5284 (build-system gnu-build-system)
5285 (arguments
5286 (list
5287 #:test-target "test"
5288 #:tests? #f ;Tests require interactive terminal
5289 #:make-flags #~(list (string-append "PREFIX=" #$output))
5290 #:phases
5291 #~(modify-phases %standard-phases
5292 (delete 'configure)
5293 (add-after 'install 'wrap-program
5294 (lambda _
5295 (wrap-program (string-append #$output "/bin/git-quick-stats")
5296 '("PATH" ":" prefix
5297 #$(map (lambda (x)
5298 (file-append (cadr x) "/bin"))
5299 (package-inputs this-package)))))))))
5300 (native-inputs (list which))
5301 (inputs (list bash-minimal
5302 coreutils-minimal
5303 gawk
5304 git-minimal/pinned
5305 grep
5306 ncurses
5307 util-linux))
5308 (home-page "https://git-quick-stats.sh")
5309 (synopsis "Access various statistics in git repositories")
5310 (description
5311 "Any git repository may contain tons of information about commits,
5312contributors, and files. Extracting this information is not always trivial,
5313mostly because there are a gazillion options to a gazillion git commands.
5314This package provides a cleaner interface to access this information.")
5315 (license license:expat)))
5316
5317(define-public hut
5318 (package
5319 (name "hut")
5320 (version "0.8.0")
5321 (source
5322 (origin
5323 (method git-fetch)
5324 (uri (git-reference
5325 (url "https://git.sr.ht/~xenrox/hut")
5326 (commit (string-append "v" version))))
5327 (file-name (git-file-name name version))
5328 (sha256
5329 (base32 "0q8g43szgj16jhhzj1y362a85cxmrf6kmy0czrgjhlp5xirnmcbm"))))
5330 (build-system go-build-system)
5331 (arguments
5332 (list
5333 #:import-path "git.sr.ht/~xenrox/hut"
5334 #:phases
5335 #~(modify-phases %standard-phases
5336 (replace 'build
5337 (lambda* (#:key import-path #:allow-other-keys)
5338 (with-directory-excursion (string-append "src/" import-path)
5339 ;; The flags are copied from (guix build go-build-system).
5340 (setenv "CGO_LDFLAGS" "-s -w")
5341 (invoke "make" "all" "GOFLAGS=-v -x"))))
5342 (replace 'install
5343 (lambda* (#:key import-path #:allow-other-keys)
5344 (with-directory-excursion (string-append "src/" import-path)
5345 (invoke "make" "install"
5346 (string-append "PREFIX=" #$output))))))
5347 #:test-flags #~(list "-vet=off")))
5348 (native-inputs
5349 (list scdoc))
5350 (inputs
5351 (list go-codeberg-org-emersion-go-scfg
5352 go-git-sr-ht-emersion-gqlclient
5353 go-github-com-dustin-go-humanize
5354 go-github-com-google-shlex
5355 go-github-com-juju-ansiterm
5356 go-github-com-spf13-cobra
5357 go-golang-org-x-term))
5358 (home-page "https://git.sr.ht/~xenrox/hut")
5359 (synopsis "CLI tool for sr.ht")
5360 (description "@command{hut} is a CLI tool for
5361@uref{https://sr.ht/~sircmpwn/sourcehut/, sr.ht}. It helps you interact with
5362sr.ht's public services:
5363@table @asis
5364@item builds
5365submit and manage build jobs
5366@item git
5367create, and manage git repositories and artifacts
5368@item hg
5369list Mercurial repositories
5370@item lists
5371manage mailing lists and patches
5372@item meta
5373manage PGP, and SSH keys
5374@item pages
5375publish and manage hosted websites
5376@item paste
5377create and manage pastes
5378@item todo
5379create and manage trackers, tickets
5380@item graphql
5381interact with GraphQL APIs directly
5382@end table")
5383 (license license:agpl3)))
5384
5385(define-public commit-patch
5386 (package
5387 (name "commit-patch")
5388 (version "2.6.2")
5389 (source (origin
5390 (method url-fetch)
5391 (uri (string-append
5392 "https://github.com/caldwell/commit-patch/releases/download/"
5393 version "/commit-patch-" version ".tar.gz"))
5394 (sha256
5395 (base32
5396 "0v11vjyisk243zi0ym90bnqb229j7iaqx1lwqdkszxzn1yxwq4ck"))))
5397 (build-system copy-build-system)
5398 (arguments
5399 (list #:phases #~(modify-phases %standard-phases
5400 (add-after 'unpack 'fix-paths
5401 (lambda* (#:key inputs #:allow-other-keys)
5402 (patch-shebang "commit-patch"))))
5403 #:install-plan ''(("commit-patch" "bin/")
5404 ("commit-patch-buffer.el"
5405 "share/emacs/site-lisp/"))))
5406 (inputs (list perl))
5407 (propagated-inputs (list patchutils))
5408 (synopsis "Commit parts of changes to VCS repositories")
5409 (description
5410 "commit-patch is a utility that lets you check in select portions of a
5411file into Darcs, Git, Mercurial, Bazaar, Subversion, or CVS repositories. It
5412comes as a command line app and also an Emacs interface.")
5413 (home-page "https://porkrind.org/commit-patch/")
5414 (license license:gpl2+)))
5415
5416(define-public git-sizer
5417 (package
5418 (name "git-sizer")
5419 (version "1.5.0")
5420 (source
5421 (origin
5422 (method git-fetch)
5423 (uri (git-reference
5424 (url "https://github.com/github/git-sizer")
5425 (commit (string-append "v" version))))
5426 (file-name (git-file-name name version))
5427 (sha256
5428 (base32 "1b4sl4djnfaxwph41y4bh9yal4bpd1nz4403ryp7nzna7h2x0zis"))))
5429 (build-system go-build-system)
5430 (arguments
5431 (list
5432 #:install-source? #f
5433 #:import-path "github.com/github/git-sizer"
5434 #:test-flags
5435 ;; TestExec and TestSubmodule require a copy of the Git repository.
5436 #~(list "-skip" "TestExec|TestSubmodule")
5437 #:phases
5438 #~(modify-phases %standard-phases
5439 (add-after 'unpack 'fix-paths
5440 (lambda* (#:key inputs #:allow-other-keys)
5441 (substitute* '("src/github.com/github/git-sizer/git/git.go")
5442 (("gitBin, err := findGitBin\\(\\)")
5443 (string-append "gitBin := \""
5444 (search-input-file inputs "bin/git")
5445 "\"\n\tvar err error")))
5446 (substitute* '("src/github.com/github/git-sizer/git_sizer_test.go")
5447 (("bin/git-sizer")
5448 (string-append #$output "/bin/git-sizer"))))))))
5449 (inputs
5450 (list git-minimal))
5451 (native-inputs
5452 (list go-github-com-cli-safeexec
5453 go-github-com-pmezard-go-difflib
5454 go-github-com-spf13-pflag
5455 go-github-com-stretchr-testify
5456 go-go-uber-org-goleak
5457 go-golang-org-x-sync
5458 go-gopkg-in-yaml-v3))
5459 (home-page "https://github.com/github/git-sizer")
5460 (synopsis "Analyze size of a Git repo")
5461 (description "Compute various size metrics for a Git repository, flagging
5462those that might cause problems or inconvenience.")
5463 (license license:expat)))
5464
5465;;;
5466;;; Avoid adding new packages to the end of this file. To reduce the chances
5467;;; of a merge conflict, place them above by existing packages with similar
5468;;; functionality or similar names.
5469;;;