Use default guile-git again.

Julien LepillerSat Jun 26 23:55:27+0200 2021

c77ae79

Use default guile-git again. The required code was merged upstream in guile-git. This removes the additional code from (gitile git) that was merged, and updates guix.scm to use the default package again.

Makefile.am

88
SOURCES= \
99
    gitile/code.scm \
1010
    gitile/config.scm \
11-
    gitile/git.scm \
1211
    gitile/handler.scm \
1312
    gitile/pages.scm \
1413
    gitile/repo.scm \

gitile/git.scm unknown status 2

1-
;;;; Copyright (C) 2020 Julien Lepiller <julien@lepiller.eu>
2-
;;;;
3-
;;;; SPDX-License-Identifier: AGPL-3.0-or-later
4-
;;;;
5-
;;;; This program is free software: you can redistribute it and/or modify
6-
;;;; it under the terms of the GNU Affero General Public License as published by
7-
;;;; the Free Software Foundation, either version 3 of the License, or
8-
;;;; (at your option) any later version.
9-
;;;;
10-
;;;; This program is distributed in the hope that it will be useful,
11-
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13-
;;;; GNU Affero General Public License for more details.
14-
;;;;
15-
;;;; You should have received a copy of the GNU Affero General Public License
16-
;;;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
17-
;;;;
18-
19-
(define-module (gitile git)
20-
  #:use-module (bytestructures guile)
21-
  #:use-module (git)
22-
  #:use-module (git types)
23-
  #:use-module (srfi srfi-9)
24-
  #:use-module ((system foreign) #:select (make-pointer
25-
                                           pointer->string
26-
                                           procedure->pointer
27-
                                           set-pointer-finalizer!
28-
                                           %null-pointer))
29-
  #:use-module ((system foreign) #:prefix foreign:)
30-
  #:export (config-entry-name config-entry-value config-entry-include-depth
31-
            config-entry-level
32-
            config-foreach))
33-
34-
(define pointer->bytestructure (@@ (git structs) pointer->bytestructure))
35-
(define bytestructure->pointer (@@ (git structs) bytestructure->pointer))
36-
37-
(define tree-entry-type
38-
  (let ((proc (libgit2->procedure int "git_tree_entry_type" '(*))))
39-
    (lambda (entry)
40-
      (proc (tree-entry->pointer entry)))))
41-
42-
(define %config-entry (bs:struct `((name ,(bs:pointer uint8)) ; char *
43-
                                   (value ,(bs:pointer uint8)) ; char *
44-
                                   (include-depth ,uint64)
45-
                                   (level ,int) ; git_config_level_t
46-
                                   (free ,(bs:pointer int))
47-
                                   (payload ,(bs:pointer int)))))
48-
(define-record-type <config-entry>
49-
  (%make-config-entry bytestructure)
50-
  config-entry?
51-
  (bytestructure config-entry-bytestructure))
52-
53-
(define (pointer->config-entry pointer)
54-
  (%make-config-entry (pointer->bytestructure pointer %config-entry)))
55-
56-
(define (config-entry->pointer entry)
57-
  (bytestructure->pointer (config-entry-bytestructure entry)))
58-
59-
(define (config-entry-name entry)
60-
  (pointer->string (make-pointer (bytestructure-ref (config-entry-bytestructure entry) 'name))))
61-
62-
(define (config-entry-value entry)
63-
  (pointer->string (make-pointer (bytestructure-ref (config-entry-bytestructure entry) 'value))))
64-
65-
(define (config-entry-include-depth entry)
66-
  (bytestructure-ref (config-entry-bytestructure entry) 'include-depth))
67-
68-
(define (config-entry-level entry)
69-
  (bytestructure-ref (config-entry-bytestructure entry) 'level))
70-
71-
(define %config-entry-free (libgit2->pointer "git_config_entry_free"))
72-
73-
(define (pointer->config-entry! pointer)
74-
    (set-pointer-finalizer! pointer %config-entry-free)
75-
      (pointer->config-entry pointer))
76-
77-
(define config-foreach
78-
  (let ((proc (libgit2->procedure* "git_config_foreach" '(* * *))))
79-
    (lambda (config callback)
80-
      (let ((callback* (procedure->pointer foreign:int
81-
                                           (lambda (entry _)
82-
                                             (callback (pointer->config-entry entry)))
83-
                                           (list '* '*))))
84-
        (proc (config->pointer config) callback* %null-pointer)))))

gitile/repo.scm

1919
(define-module (gitile repo)
2020
  #:use-module (git)
2121
  #:use-module (git types)
22-
  #:use-module (gitile git)
2322
  #:use-module (srfi srfi-9)
2423
  #:use-module (system foreign)
2524
  #:export (get-branches

guix.scm

2828
             (gnu packages texinfo)
2929
             (gnu packages tls))
3030
31-
(define my-guile-git
32-
  (package
33-
    (inherit guile-git)
34-
    (source (origin
35-
              (method git-fetch)
36-
              (uri (git-reference
37-
                     (url "https://gitlab.com/roptat/guile-git")
38-
                     (commit "c39ab944d8004d3ab751a9e27336469afec081eb")))
39-
              (file-name (git-file-name "guile-git" "0.4.0.c39ab94"))
40-
              (sha256
41-
               (base32
42-
                "0hknsv9r7pjahmxkvd7zpz93saki5kymh88xs6pb4h9d0ssp4fmp"))))
43-
    (native-inputs
44-
     `(("autoconf" ,autoconf)
45-
       ("automake" ,automake)
46-
       ("texinfo" ,texinfo)
47-
       ,@(package-native-inputs guile-git)))))
48-
4931
(define my-guile-syntax-highlight
5032
  (package
5133
    (inherit guile-syntax-highlight)

7153
  (build-system gnu-build-system)
7254
  (propagated-inputs
7355
   `(("guile-commonmark" ,guile-commonmark)
74-
     ("guile-git" ,my-guile-git)
56+
     ("guile-git" ,guile-git)
7557
     ("guile-gcrypt" ,guile-gcrypt)
7658
     ("guile-syntax-highlight" ,my-guile-syntax-highlight)
7759
     ("gnutls" ,gnutls)