unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#50162] [PATCH] gnu: global: Add ctags support.
@ 2021-08-22  8:04 Efraim Flashner
  2021-08-30 19:57 ` Maxim Cournoyer
  0 siblings, 1 reply; 4+ messages in thread
From: Efraim Flashner @ 2021-08-22  8:04 UTC (permalink / raw)
  To: 50162

[-- Attachment #1: Type: text/plain, Size: 3598 bytes --]

* gnu/packages/code.scm (global)[inputs]: Add bash-minimal,
universal-ctags, python-pygments.
[arguments]: Add configure-flags to find ctags. Add phases to install
plugins and to wrap python script with PYTHONPATH.
---

I've been using this variant of global for a couple of weeks now to get
global to work with Guix.

---

 gnu/packages/code.scm | 34 +++++++++++++++++++++++++++++-----
 1 file changed, 29 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm
index a414cde3de..04b354b71e 100644
--- a/gnu/packages/code.scm
+++ b/gnu/packages/code.scm
@@ -64,6 +64,7 @@
   #:use-module (gnu packages perl-compression)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages texinfo)
@@ -137,17 +138,26 @@ highlighting your own code that seemed comprehensible when you wrote it.")
               (base32
                "0g4aslm2zajq605py11s4rs1wdnzcqhkh7bc2xl5az42adzzg839"))))
     (build-system gnu-build-system)
-    (inputs `(("coreutils" ,coreutils)
-              ("ncurses" ,ncurses)
-              ("libltdl" ,libltdl)
-              ("sqlite" ,sqlite)
-              ("python-wrapper" ,python-wrapper)))
+    (inputs
+      `(("bash" ,bash-minimal)                    ; for wrap-program
+        ("coreutils" ,coreutils)
+        ("ctags" ,universal-ctags)
+        ("libltdl" ,libltdl)
+        ("ncurses" ,ncurses)
+        ("python-pygments" ,python-pygments)
+        ("python-wrapper" ,python-wrapper)
+        ("sqlite" ,sqlite)))
     (arguments
      `(#:configure-flags
        (list (string-append "--with-ncurses="
                             (assoc-ref %build-inputs "ncurses"))
              (string-append "--with-sqlite3="
                             (assoc-ref %build-inputs "sqlite"))
+             (string-append "--with-universal-ctags="
+                            (assoc-ref %build-inputs "ctags") "/bin/ctags")
+             (string-append "--sysconfdir="
+                            (assoc-ref %outputs "out") "/share/gtags")
+             "--localstatedir=/var"         ; This needs to be a writable location.
              "--disable-static")
 
        #:phases
@@ -158,6 +168,20 @@ highlighting your own code that seemed comprehensible when you wrote it.")
                            (assoc-ref inputs "coreutils") "/bin/echo")))
                (substitute* "globash/globash.in"
                  (("/bin/echo") echo)))))
+         (add-after 'post-install 'install-plugins
+           (lambda _
+             (with-directory-excursion "plugin-factory"
+               (invoke "make" "install"))))
+         (add-before 'install 'dont-install-to-/var
+           (lambda _
+             (substitute* "gozilla/Makefile"
+               (("DESTDIR\\)\\$\\{localstatedir\\}") "TMPDIR)"))))
+         (add-after 'install-plugins 'wrap-program
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (wrap-program
+               (string-append (assoc-ref outputs "out")
+                              "/share/gtags/script/pygments_parser.py")
+               `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))))
         (add-after 'install 'post-install
           (lambda* (#:key outputs #:allow-other-keys)
             ;; Install the plugin files in the right place.

base-commit: 9e3b68203cba2b1bd96e524d3ae9dfc3336a72f7
-- 
2.33.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-31 14:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-22  8:04 [bug#50162] [PATCH] gnu: global: Add ctags support Efraim Flashner
2021-08-30 19:57 ` Maxim Cournoyer
2021-08-31 10:11   ` bug#50162: " Efraim Flashner
2021-08-31 14:31     ` [bug#50162] " Maxim Cournoyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).