gnu: gitolite: Switch to G-expressions.

* gnu/packages/version-control.scm (gitolite)[arguments]: Use G-expressions.
[inputs]: Add grep and sed.
This commit is contained in:
David Thompson 2022-09-09 12:03:37 -04:00
parent e069c6df5e
commit a503d0ba8c
No known key found for this signature in database
GPG key ID: 8328C7470FF1D807

View file

@ -1497,57 +1497,55 @@ (define-public gitolite
(base32 "05xw1pmagvkrbzga5pgl3xk9qyc6b5x73f842454f3w9ijspa8zy")))) (base32 "05xw1pmagvkrbzga5pgl3xk9qyc6b5x73f842454f3w9ijspa8zy"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
'(#:tests? #f ; no tests (list #:tests? #f ; no tests
#:phases (modify-phases %standard-phases #:phases
#~(modify-phases %standard-phases
(delete 'configure) (delete 'configure)
(delete 'build) (delete 'build)
(add-before 'install 'patch-scripts (add-before 'install 'patch-scripts
(lambda* (#:key inputs #:allow-other-keys) (lambda* _
(let ((perl (search-input-file inputs "/bin/perl")))
;; This seems to take care of every shell script that ;; This seems to take care of every shell script that
;; invokes Perl. ;; invokes Perl.
(substitute* (find-files ".") (substitute* (find-files ".")
((" perl -") ((" perl -")
(string-append " " perl " -"))) (string-append " " #$perl "/bin/perl" " -")))
(substitute* (find-files "src/triggers" ".*") (substitute* (find-files "src/triggers" ".*")
((" sed ") ((" sed ")
(string-append " " (which "sed") " "))) (string-append " " #$sed "/bin/sed" " ")))
(substitute* (substitute*
'("src/triggers/post-compile/update-gitweb-access-list" '("src/triggers/post-compile/update-gitweb-access-list"
"src/triggers/post-compile/ssh-authkeys-split" "src/triggers/post-compile/ssh-authkeys-split"
"src/triggers/upstream") "src/triggers/upstream")
((" grep ") ((" grep ")
(string-append " " (which "grep") " "))) (string-append " " #$grep "/bin/grep" " ")))
;; Avoid references to the store in authorized_keys. ;; Avoid references to the store in authorized_keys.
;; This works because gitolite-shell is in the PATH. ;; This works because gitolite-shell is in the PATH.
(substitute* "src/triggers/post-compile/ssh-authkeys" (substitute* "src/triggers/post-compile/ssh-authkeys"
(("\\$glshell \\$user") (("\\$glshell \\$user")
"gitolite-shell $user"))))) "gitolite-shell $user"))))
(add-before 'install 'patch-source (add-before 'install 'patch-source
(lambda* (#:key inputs #:allow-other-keys) (lambda* _
;; Gitolite uses cat to test the readability of the ;; Gitolite uses cat to test the readability of the
;; pubkey ;; pubkey
(substitute* "src/lib/Gitolite/Setup.pm" (substitute* "src/lib/Gitolite/Setup.pm"
(("\"cat ") (("\"cat ")
(string-append "\"" (which "cat") " ")) (string-append "\"" #$coreutils "/bin/cat" " "))
(("\"ssh-keygen") (("\"ssh-keygen")
(string-append "\"" (which "ssh-keygen")))) (string-append "\"" #$openssh "/bin/ssh-keygen")))
(substitute* '("src/lib/Gitolite/Hooks/PostUpdate.pm" (substitute* '("src/lib/Gitolite/Hooks/PostUpdate.pm"
"src/lib/Gitolite/Hooks/Update.pm") "src/lib/Gitolite/Hooks/Update.pm")
(("/usr/bin/perl") (("/usr/bin/perl")
(search-input-file inputs "/bin/perl"))) (string-append #$perl "/bin/perl")))
(substitute* "src/lib/Gitolite/Common.pm" (substitute* "src/lib/Gitolite/Common.pm"
(("\"ssh-keygen") (("\"ssh-keygen")
(string-append "\"" (which "ssh-keygen"))) (string-append "\"" #$openssh "/bin/ssh-keygen"))
(("\"logger\"") (("\"logger\"")
(string-append "\"" (string-append "\"" #$inetutils "/bin/logger\"")))
(assoc-ref inputs "inetutils")
"/bin/logger\"")))
(substitute* "src/lib/Gitolite/Cache.pm" (substitute* "src/lib/Gitolite/Cache.pm"
(("/usr/sbin/redis-server") "redis-server")) (("/usr/sbin/redis-server") "redis-server"))
@ -1555,10 +1553,9 @@ (define-public gitolite
(substitute* "src/commands/svnserve" (substitute* "src/commands/svnserve"
(("/usr/bin/svnserve") "svnserve")))) (("/usr/bin/svnserve") "svnserve"))))
(replace 'install (replace 'install
(lambda* (#:key outputs #:allow-other-keys) (lambda* _
(let* ((output (assoc-ref outputs "out")) (let* ((sharedir (string-append #$output "/share/gitolite"))
(sharedir (string-append output "/share/gitolite")) (bindir (string-append #$output "/bin")))
(bindir (string-append output "/bin")))
(mkdir-p sharedir) (mkdir-p sharedir)
(mkdir-p bindir) (mkdir-p bindir)
(invoke "./install" "-to" sharedir) (invoke "./install" "-to" sharedir)
@ -1568,18 +1565,17 @@ (define-public gitolite
(string-append bindir "/" script))) (string-append bindir "/" script)))
'("gitolite" "gitolite-shell"))))) '("gitolite" "gitolite-shell")))))
(add-after 'install 'wrap-scripts (add-after 'install 'wrap-scripts
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* _
(let ((out (assoc-ref outputs "out"))
(coreutils (assoc-ref inputs "coreutils"))
(findutils (assoc-ref inputs "findutils"))
(git (assoc-ref inputs "git")))
(for-each (lambda (file-name) (for-each (lambda (file-name)
(wrap-program (string-append out file-name) (wrap-program (string-append #$output file-name)
`("PATH" ":" prefix `("PATH" ":" prefix
,(map (lambda (dir) ,(map (lambda (dir)
(string-append dir "/bin")) (string-append dir "/bin"))
(list out coreutils findutils git))))) (list #$output
'("/bin/gitolite" "/bin/gitolite-shell")))))))) #$coreutils
#$findutils
#$git)))))
'("/bin/gitolite" "/bin/gitolite-shell")))))))
(inputs (inputs
(list bash-minimal coreutils findutils git inetutils openssh perl)) (list bash-minimal coreutils findutils git inetutils openssh perl))
(home-page "https://gitolite.com") (home-page "https://gitolite.com")