gitile.scm
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu> |
3 | ;;; |
4 | ;;; This file is part of GNU Guix. |
5 | ;;; |
6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
7 | ;;; under the terms of the GNU General Public License as published by |
8 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
9 | ;;; your option) any later version. |
10 | ;;; |
11 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | ;;; GNU General Public License for more details. |
15 | ;;; |
16 | ;;; You should have received a copy of the GNU General Public License |
17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
18 | ;;; |
19 | ;;; Some of the help text was taken from the default dovecot.conf files. |
20 | |
21 | (define-module (packages gitile) |
22 | #:use-module (gnu packages autotools) |
23 | #:use-module (gnu packages guile) |
24 | #:use-module (gnu packages guile-xyz) |
25 | #:use-module (gnu packages pkg-config) |
26 | #:use-module (gnu packages tls) |
27 | #:use-module (guix build-system gnu) |
28 | #:use-module (guix git-download) |
29 | #:use-module (guix packages) |
30 | #:use-module (guix licenses)) |
31 | |
32 | (define-public gitile |
33 | (package |
34 | (name "gitile") |
35 | (version "0.1") |
36 | (source (origin |
37 | (method git-fetch) |
38 | (uri (git-reference |
39 | (url "https://git.lepiller.eu/git/gitile") |
40 | (commit "e78303702bdc16fe49246a97e53b33dc47bb64de"))) |
41 | (file-name (git-file-name name (string-append version "-e783037"))) |
42 | (sha256 |
43 | (base32 |
44 | "10v5ffdlr2f1p4mf485r6p7f9vi3ypil4y70p8x1w87s5qa3dwxr")))) |
45 | (build-system gnu-build-system) |
46 | (arguments |
47 | `(#:modules ((guix build utils) |
48 | (guix build gnu-build-system) |
49 | (ice-9 rdelim) |
50 | (ice-9 popen)) |
51 | #:make-flags (list "GUILE_AUTO_COMPILE=0") |
52 | #:phases |
53 | (modify-phases %standard-phases |
54 | (add-after 'install 'install-bin |
55 | (lambda* (#:key outputs #:allow-other-keys) |
56 | (install-file "scripts/gitile" |
57 | (string-append (assoc-ref outputs "out") |
58 | "/bin")) |
59 | #t)) |
60 | (add-after 'install-bin 'wrap-program |
61 | (lambda* (#:key inputs outputs #:allow-other-keys) |
62 | ;; Wrap the 'cuirass' command to refer to the right modules. |
63 | (let* ((out (assoc-ref outputs "out")) |
64 | (git (assoc-ref inputs "guile-git")) |
65 | (bytes (assoc-ref inputs "guile-bytestructures")) |
66 | (fibers (assoc-ref inputs "guile-fibers")) |
67 | (deps (list out git bytes fibers)) |
68 | (guile (assoc-ref %build-inputs "guile")) |
69 | (effective (read-line |
70 | (open-pipe* OPEN_READ |
71 | (string-append guile "/bin/guile") |
72 | "-c" "(display (effective-version))"))) |
73 | (mods (string-drop-right ;drop trailing colon |
74 | (string-join deps |
75 | (string-append "/share/guile/site/" |
76 | effective ":") |
77 | 'suffix) |
78 | 1)) |
79 | (objs (string-drop-right |
80 | (string-join deps |
81 | (string-append "/lib/guile/" effective |
82 | "/site-ccache:") |
83 | 'suffix) |
84 | 1))) |
85 | (wrap-program (string-append out "/bin/gitile") |
86 | `("GUILE_LOAD_PATH" ":" prefix (,mods)) |
87 | `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs))) |
88 | #t)))))) |
89 | (native-inputs |
90 | `(("autoconf" ,autoconf) |
91 | ("automake" ,automake) |
92 | ("guile" ,guile-3.0) |
93 | ("pkg-config" ,pkg-config))) |
94 | (inputs |
95 | `(("guile" ,guile-3.0) |
96 | ("guile-fibers" ,guile-fibers) |
97 | ("guile-git" ,guile-git) |
98 | ("gnutls" ,gnutls))) |
99 | (home-page "") |
100 | (synopsis "") |
101 | (description "") |
102 | (license gpl3+))) |
103 | |
104 | gitile |
105 |