summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-06-14 15:01:58 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-06-14 15:32:32 -0400
commit10186bc291580a5a3403739eb4623c2ba63c0190 (patch)
tree9c968e94260ccf04e471ccd52d8bd7b52044d6d8
parent1eac587fa631424707c3cf2aa31031e7c88c5557 (diff)
downloadguix-10186bc291580a5a3403739eb4623c2ba63c0190.tar.gz
gnu: Add lexilla.
* gnu/packages/text-editors.scm (lexilla): New variable.
-rw-r--r--gnu/packages/text-editors.scm61
1 files changed, 61 insertions, 0 deletions
diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 606d85584b..1781e75af2 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2022 Andy Tai <atai@atai.org>
 ;;; Copyright © 2023 Eidvilas Markevičius <markeviciuseidvilas@gmail.com>
+;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1044,6 +1045,66 @@ fonts, bold and italics, multiple foreground and background colours,
 and multiple fonts.")
     (license license:hpnd)))
 
+(define-public lexilla
+  (package
+    (name "lexilla")
+    (version "5.2.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://www.scintilla.org/lexilla"
+                           (string-delete #\. version) ".tgz"))
+       (sha256
+        (base32
+         "0sc3z6y82h1vq8aaydp119kymzvrv0p1xvy56r5j996jl6zxikk4"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list
+      #:make-flags #~(list (string-append "CXX=" #$(cxx-for-target))
+                           (string-append "SCINTILLA_INCLUDE="
+                                          #$(this-package-input "scintilla")
+                                          "/include"))
+      #:test-target "test"
+      #:phases
+      #~(modify-phases %standard-phases
+          (replace 'build
+            (lambda args
+              (with-directory-excursion "src"
+                (apply (assoc-ref %standard-phases 'build) args))))
+          (add-after 'build 'patch-more-shebangs
+            (lambda _
+              ;; Patch these bash shebangs to avoid them failing the tests.
+              (substitute* '("test/examples/bash/x.bsh.folded"
+                             "test/examples/bash/x.bsh.styled")
+                (("/usr/bin/env bash")
+                 (which "bash")))))
+          (replace 'check
+            (lambda args
+              (with-directory-excursion "test"
+                (apply (assoc-ref %standard-phases 'check) args))))
+          (add-after 'unpack 'fix-deps.mak
+            (lambda _
+              (substitute* "src/deps.mak"
+                (("../../scintilla")
+                 #$(this-package-input "scintilla")))))
+          (delete 'configure)           ;no configure script
+          (replace 'install
+            ;; Upstream provides no install script.
+            (lambda _
+              (let ((lib (string-append #$output "/lib"))
+                    (inc (string-append #$output "/include")))
+                (for-each (lambda (f) (install-file f lib))
+                          (find-files "bin/" "\\.so$"))
+                (for-each (lambda (f) (install-file f inc))
+                          (find-files "include/" "\\.h$"))))))))
+    (native-inputs (list python))
+    (inputs (list scintilla))
+    (home-page "https://www.scintilla.org/Lexilla.html")
+    (synopsis "Language lexers for Scintilla")
+    (description "Lexilla is a library of language lexers that can be
+used with the Scintilla editing component.")
+    (license license:hpnd)))
+
 (define-public geany
   (package
     (name "geany")