aboutsummaryrefslogtreecommitdiff
path: root/guix/forge/git.scm
blob: cd6fedc5a16e8bc6d061ae14de02bcd145cc88c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
;;; guix-forge --- Guix software forge meta-service
;;; Copyright © 2024 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of guix-forge.
;;;
;;; guix-forge is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published
;;; by the Free Software Foundation, either version 3 of the License,
;;; or (at your option) any later version.
;;;
;;; guix-forge is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;;; General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with guix-forge.  If not, see
;;; <https://www.gnu.org/licenses/>.

(define-module (forge git)
  #:use-module ((gnu packages version-control) #:select (git-minimal))
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (guix utils))

;; We serve shared repositories. But, git's safe directory check does
;; not permit us to use shared repositories. Disable it.
(define-public git-without-safe-directory-check
  (package
    (inherit git-minimal)
    (name "git-without-safe-directory-check")
    (arguments
     (substitute-keyword-arguments (package-arguments git-minimal)
       ((#:phases phases #~%standard-phases)
        #~(modify-phases #$phases
            (add-after 'unpack 'disable-safe-directory-check
              (lambda _
                ;; Disable the safe directory check.
                (substitute* "setup.c"
                  (("return data\\.is_safe;")
                   "return 1;"))
                ;; Disable tests broken by this change.
                (setenv "GIT_SKIP_TESTS" "t0033 t0411 t9700")))))))))