Simplify guix recipe

Evgeny PisemskyWed Aug 21 09:45:36+0300 2024

ba54628

Simplify guix recipe

README.md

1313
1414
* guile-git (for accessing git repositories)
1515
* guile-commonmark (for markdown highlighting)
16-
* guile-syntax-highlight (for other syntax highlighting.  Use commit
17-
  `51727cbb7fc05ef743aab2d7b16314ea1ed790e4`, it is more recent than the
18-
  latest release)
16+
* guile-syntax-highlight (for other syntax highlighting)
1917
* guile-fibers (for running a multithreaded web server)
2018
* guile-gcrypt (for a hash computation)
2119

guix.scm

11
;;;; Copyright (C) 2020, 2021 Julien Lepiller <julien@lepiller.eu>
2+
;;;; Copyright (C) 2024 Evgeny Pisemsky <mail@pisemsky.site>
23
;;;;
34
;;;; SPDX-License-Identifier: AGPL-3.0-or-later
45
;;;;

1718
;;;;
1819
1920
(use-modules (guix packages)
20-
             (guix licenses)
21-
             (guix build-system gnu)
22-
             (guix git-download)
2321
             (guix git)
24-
             (gnu packages autotools)
25-
             (gnu packages gnupg)
26-
             (gnu packages guile)
27-
             (gnu packages guile-xyz)
28-
             (gnu packages pkg-config)
29-
             (gnu packages texinfo)
30-
             (gnu packages tls))
31-
32-
(define my-guile-syntax-highlight
33-
  (package
34-
    (inherit guile-syntax-highlight)
35-
    (source (origin
36-
              (method git-fetch)
37-
              (uri (git-reference
38-
                     (url "https://git.dthompson.us/guile-syntax-highlight.git")
39-
                     (commit "897fa5156ff41588e0d281eb00e4e94de63ccd8a")))
40-
              (file-name (git-file-name "guile-syntax-highlight" "0.1.897fa51"))
41-
              (sha256
42-
               (base32
43-
                "18zlg4mkgd3swgv2ggfz91ivnnzc0zhvc9ybgrxg1y762va9hyvj"))))
44-
    (native-inputs
45-
     `(("autoconf" ,autoconf)
46-
       ("automake" ,automake)
47-
       ("texinfo" ,texinfo)
48-
       ,@(package-native-inputs guile-syntax-highlight)))))
22+
             ((gnu packages version-control) #:prefix guix:))
4923
5024
(package
51-
  (name "gitile")
52-
  (version "0.1")
53-
  (source (git-checkout (url (dirname (current-filename)))))
54-
  (build-system gnu-build-system)
55-
  (arguments
56-
   `(#:modules ((guix build utils)
57-
                (guix build gnu-build-system)
58-
                (ice-9 rdelim)
59-
                (ice-9 popen))
60-
     #:make-flags (list "GUILE_AUTO_COMPILE=0")
61-
     #:phases
62-
     (modify-phases %standard-phases
63-
       (add-after 'install-bin 'wrap-program
64-
         (lambda* (#:key inputs outputs #:allow-other-keys)
65-
           ;; Wrap the 'gitile' command to refer to the right modules.
66-
           (let* ((out    (assoc-ref outputs "out"))
67-
                  (commonmark (assoc-ref inputs "guile-commonmark"))
68-
                  (git    (assoc-ref inputs "guile-git"))
69-
                  (bytes  (assoc-ref inputs "guile-bytestructures"))
70-
                  (fibers (assoc-ref inputs "guile-fibers"))
71-
                  (gcrypt (assoc-ref inputs "guile-gcrypt"))
72-
                  (syntax-highlight (assoc-ref inputs "guile-syntax-highlight"))
73-
                  (deps   (list out commonmark git bytes fibers gcrypt
74-
                                syntax-highlight))
75-
                  (guile  (assoc-ref %build-inputs "guile"))
76-
                  (effective (read-line
77-
                              (open-pipe* OPEN_READ
78-
                                          (string-append guile "/bin/guile")
79-
                                          "-c" "(display (effective-version))")))
80-
                  (mods   (string-drop-right  ;drop trailing colon
81-
                           (string-join deps
82-
                                        (string-append "/share/guile/site/"
83-
                                                       effective ":")
84-
                                        'suffix)
85-
                           1))
86-
                  (objs   (string-drop-right
87-
                           (string-join deps
88-
                                        (string-append "/lib/guile/" effective
89-
                                                       "/site-ccache:")
90-
                                        'suffix)
91-
                           1)))
92-
             (wrap-program (string-append out "/bin/gitile")
93-
               `("GUILE_LOAD_PATH" ":" prefix (,mods))
94-
               `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs)))))))))
95-
  (propagated-inputs
96-
   `(("guile-commonmark" ,guile-commonmark)
97-
     ("guile-git" ,guile-git)
98-
     ("guile-gcrypt" ,guile-gcrypt)
99-
     ("guile-syntax-highlight" ,my-guile-syntax-highlight)
100-
     ("gnutls" ,gnutls)
101-
     ("guile-fibers" ,guile-fibers)))
102-
  (native-inputs
103-
   `(("autoconf" ,autoconf)
104-
     ("automake" ,automake)
105-
     ("libtool" ,libtool)
106-
     ("pkg-config" ,pkg-config)
107-
     ("guile" ,guile-3.0)))
108-
  (home-page "https://git.lepiller.eu")
109-
  (synopsis "")
110-
  (description "")
111-
  (license gpl3+))
25+
  (inherit guix:gitile)
26+
  (source (git-checkout (url (dirname (current-filename))))))