~whereiseveryone/guixrus

guixrus/guixrus/packages/scintilla.scm -rw-r--r-- 6.0 KiB
3711a437jgart add emacs-flycheck-cython 56 minutes 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
;;; GNU Guix --- Functional package management for GNU
;;;
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;;
;;; 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 scintilla)
  #:use-module (guix build-system gnu)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (gnu packages)
  #:use-module (gnu packages base)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages lua)
  #:use-module (gnu packages ncurses)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python)
  #:use-module (gnu packages text-editors))

(define-public lexilla
  (package
    (name "lexilla")
    (version "5.1.1")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://github.com/ScintillaOrg/lexilla")
         (commit (string-append "rel-5-1-1"))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "07jmamrflm628f47r76z7dvmk79mw1w753g6g75jl0qa8g5v9c22"))))
    (build-system gnu-build-system)
    (arguments
     `(#:imported-modules
       ((guix build copy-build-system)
        ,@%gnu-build-system-modules)
       #:modules
       (((guix build copy-build-system)
         #:prefix copy:)
        (guix build gnu-build-system)
        (guix build utils))
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'patch
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* (find-files "." ".*mak.*")
               (("\\.\\./\\.\\./scintilla/include")
                (string-append (assoc-ref inputs "scintilla")
                               "/include")))))
         (delete 'configure)
         (replace 'build
           (lambda _
             (with-directory-excursion "src"
               (invoke "make" "all"))))
         (replace 'check
           (lambda* (#:key tests? #:allow-other-keys)
             (when tests?
               (with-directory-excursion "test"
                 (invoke "make" "test")))))
         (replace 'install
           (lambda args
             (apply (assoc-ref copy:%standard-phases 'install)
                    #:install-plan
                    '(("bin" "lib"
                       #:include-regexp ("\\.so$"))
                      ("include" "include/lexilla"
                       #:include-regexp ("\\.h$"))
                      ("access" "include/lexilla/access"
                       #:include-regexp ("\\.h$"))
                      ("lexlib" "include/lexilla/lexlib"
                       #:include-regexp ("\\.h$"))
                      ("doc" "share/doc/lexilla"
                       #:include-regexp ("\\.(html|png)$")))
                    args))))))
    (native-inputs
     (list
      gcc-9
      pkg-config
      python))
    (inputs
     (list
      scintilla))
    (home-page "https://www.scintilla.org/Lexilla.html")
    (synopsis "Library of language lexers for use with Scintilla")
    (description "Lexilla is a free library of language lexers that can be used
with the Scintilla editing component.")
    (license license:hpnd)))

(define-public scinterm
  (package
    (name "scinterm")
    (version "3.1")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://github.com/orbitalquark/scinterm")
         (commit (string-append "scinterm_" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1a59fqrb6gjwy67v6jbfcjh9bzmndcbz13l8sh4pjy77ncja45kl"))))
    (build-system gnu-build-system)
    (arguments
     `(#:tests? #f                      ;no test-suite
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'copy-inputs
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((dest (string-append (getenv "TMP") "/source"))
                   (src (assoc-ref inputs "scintilla")))
               (invoke "tar" "zxvf" src "-C" dest))
             (copy-recursively "scintilla" "../")))
         (add-after 'copy-inputs 'patch
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* "Makefile"
               (("scintilla.a") "scinterm.a"))))
         (delete 'configure)
         (replace 'build
           (lambda _
             (invoke "make" "patch")
             (invoke "make" "all")))
         (replace 'install
           (lambda* (#:key outputs #:allow-other-keys)
             (install-file
              "../bin/scinterm.a"
              (string-append (assoc-ref outputs "out") "/lib"))
             (install-file
              "ScintillaCurses.h"
              (string-append (assoc-ref outputs "out") "/include/scinterm")))))))
    (native-inputs
     `(("lua" ,lua)
       ("pkg-config" ,pkg-config)
       ("python" ,python-wrapper)
       ("scintilla"
        ,(origin
           (method url-fetch)
           (uri "https://www.scintilla.org/scintilla511.tgz")
           (sha256
            (base32 "1d0yjx2wlx4fj5bccxdgfmrr7nzazkw4m08i6h4c0a54sb484yif"))))))
    (inputs
     (list
      ncurses))
    (home-page "https://orbitalquark.github.io/scinterm/")
    (synopsis "Curses platform for Scintilla")
    (description "Scinterm is a curses platform for Scintilla that supports ncurses,
PDCurses, and X/Open Curses.")
    (license license:expat)))