~whereiseveryone/guixrus

guixrus/guixrus/packages/vis.scm -rw-r--r-- 4.8 KiB
beb74e80(unmatched-parenthesis [urgent fix] turns out patch location doesn't work out of the box in non-`guix` channels... 8 days ago
                                                                                
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
;;; GNU Guix --- Functional package management for GNU
;;;
;;; Copyright © 2021 jgart <jgart@dismail.de>
;;;
;;; This file is not part of GNU Guix.
;;;
;;; GNU Guix 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.
;;;
;;; GNU Guix 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 GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (guixrus packages vis)
  #:use-module (guix build utils)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system copy)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages lua)
  #:use-module (gnu packages text-editors)
  #:export (vis-static))

(define vis-lspc
  (let ((commit "47b7b1e47bb10183f5b4ee84d90b4e3eefabe75c")
        (revision 1))
    (origin
      (method git-fetch)
      (uri
       (git-reference
        (url "https://gitlab.com/muhq/vis-lspc")
        (commit commit)))
      (file-name (git-file-name "vis-lspc" commit))
      (sha256
       (base32 "0kc1gsrybvim3pvvsq6mjw14jasp5idxd9ng2p8299pwxhm414k8")))))

(define-public vis-lsp
  (let ((commit "6635d0d2430aa2c74614e28f58c10318e798a839")
        (revision "0"))
    (package
      (inherit vis)
      (name "vis-lsp")
      (version (git-version "20210512" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri
          (git-reference
           (url "https://github.com/fischerling/vis")
           (commit commit)))
         (sha256
          (base32 "1nccij2kyd8nllxmvdfvyprgwvv6gy28g36zy3x27xjr4j7s8894"))
         (file-name (git-file-name name version))))
      (build-system gnu-build-system)
      (inputs
       `(,@(package-inputs vis)
         ("vis-lspc" ,vis-lspc)))
      (arguments
       `(#:tests? #f                    ; TODO
         ,@(package-arguments vis)
         #:phases
         (modify-phases %standard-phases
           (add-after 'install 'wrap-binary
             (lambda* (#:key inputs outputs #:allow-other-keys)
               (let* ((out (assoc-ref outputs "out"))
                      (lpeg (assoc-ref inputs "lua-lpeg"))
                      (lua-version ,(version-major+minor (package-version lua)))
                      (LUA_PATH (string-append lpeg "/share/lua/"
                                               lua-version "/?.lua"))
                      (LUA_CPATH (string-append lpeg "/lib/lua/"
                                                lua-version "/?.so")))
                 (wrap-program (string-append out "/bin/vis")
                   `("LUA_PATH" ":" prefix (,LUA_PATH))
                   `("LUA_CPATH" ":" prefix (,LUA_CPATH))))))
           (add-after 'install 'bundle-vis-lspc
             (lambda* (#:key inputs outputs #:allow-other-keys)
               (let ((vis-lspc (string-append (assoc-ref outputs "out") 
                                              "/share/vis/plugins/vis-lspc")))
                 (mkdir-p vis-lspc)
                 (copy-recursively (assoc-ref inputs "vis-lspc") 
                                   vis-lspc)))))))
      (home-page "https://github.com/martanne/vis/pull/675")
      (synopsis "Vis with Language Server Protocol support")
      (description "@command{vis-lsp} provides vis with the communication API
patches applied.  Additionally, @code{vis-lspc} is bundled for convenience."))))

(define-public static-vis
  (let ((vis (static-package vis)))
    (package (inherit vis)
      (name "vis-static"))))

(define-public vis-guava
  (let ((commit "4293e57e43b68c3611d0766be1f96f38629ed775")
          (revision "0"))
    (package
      (name "vis-guava")
      (version "0.1")
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://git.sr.ht/~whereiseveryone/vis-guava")
               (commit commit)))
         (file-name (string-append name "-" commit))
         (sha256
          (base32
           "1gphmccyzk76payqd9gg91fz759hy5fwag7nk18f2wdba3c9ls3k"))))
      (build-system copy-build-system)
      (arguments
       '(#:install-plan
         '(("guava.lua" "share/vis/themes/"))))
      (synopsis "Guava-flavoured theme for the vis text editor")
      (description
"@code{vis-guava} is a guava-flavoured theme for the vis text editor.")
      (home-page "https://git.sr.ht/~whereiseveryone/vis-guava")
      (license license:gpl3+))))