all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#68948: highlight error, cannot open filetypes.conf: No such file or directory
@ 2024-02-06 11:01 chris
  2024-03-27 20:58 ` bug#68948: temp fix chris
  2024-03-28 11:51 ` bug#68948: highlight error, cannot open filetypes.conf: No such file or directory chris
  0 siblings, 2 replies; 3+ messages in thread
From: chris @ 2024-02-06 11:01 UTC (permalink / raw)
  To: 68948; +Cc: chris

There is an issue using "highlight"

https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/pretty-print.scm#n353
http://www.andre-simon.de/doku/highlight/en/highlight.php#ch3_8

This unexpected error is reproduced easily with the command below: "cannot open filetypes.conf"
```
$ echo "(highlight (package bug))" | highlight -O xterm256 --syntax lisp
cannot open filetypes.conf: No such file or directory
(highlight (package bug))
```

Creating `~/.highlight/filetypes.conf` did not resolve the error.
Setting "HIGHLIGHT_DATADIR=$HOME/.config/highlight/" did not resolve the error.

Any advice is welcome. Thank you :)

Chris




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

* bug#68948: temp fix
  2024-02-06 11:01 bug#68948: highlight error, cannot open filetypes.conf: No such file or directory chris
@ 2024-03-27 20:58 ` chris
  2024-03-28 11:51 ` bug#68948: highlight error, cannot open filetypes.conf: No such file or directory chris
  1 sibling, 0 replies; 3+ messages in thread
From: chris @ 2024-03-27 20:58 UTC (permalink / raw)
  To: 68948; +Cc: chris

The following workaround can be used,
```
HLDIRS=$(guix build highlight); # returns two directories
HLDIR="${HLDIRS##*[[:space:]]}"; # returns the second dir, after whitespace
DATADIR="$HLDIR/etc/highlight/";
echo "(highlight (package bug))" | highlight --data-dir=$DATADIR -O xterm256 --syntax lisp
```

Based on my understanding, the current package definition is correct. Possibly a patch like this could resolve the issue the current package definition seems correct.
```
diff --git a/gnu/packages/pretty-print.scm b/gnu/packages/pretty-print.scm
index b95f56729a..2a7cf74009 100644
--- a/gnu/packages/pretty-print.scm
+++ b/gnu/packages/pretty-print.scm
@@ -389,7 +389,7 @@ (define-public highlight
                           (lambda* (#:key inputs outputs #:allow-other-keys)
                             (let* ((out (assoc-ref outputs "out"))
                                    (data (string-append out
-                                                        "/share/highlight/"))
+                                                        "/etc/highlight/"))
                                    (conf (string-append out "/etc/highlight/"))
                                    (doc (string-append out
                                          "/share/doc/highlight/"))
```




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

* bug#68948: highlight error, cannot open filetypes.conf: No such file or directory
  2024-02-06 11:01 bug#68948: highlight error, cannot open filetypes.conf: No such file or directory chris
  2024-03-27 20:58 ` bug#68948: temp fix chris
@ 2024-03-28 11:51 ` chris
  1 sibling, 0 replies; 3+ messages in thread
From: chris @ 2024-03-28 11:51 UTC (permalink / raw)
  To: 68948; +Cc: chris

Below changes at the highlight package resolve the issue here but may adversely affect "highlight-gui" functionality. Will wait for https://issues.guix.gnu.org/70047 before trying to proceed,
```diff
-      #:make-flags #~(let ((confdir (string-append %output
-                                                   "/share/highlight/config/")))
-                       (list (string-append "PREFIX=" %output)
-                             (string-append "HL_CONFIG_DIR=" confdir)
-                             (string-append "conf_dir=" confdir)))
+      #:make-flags #~(list (string-append "PREFIX=" %output)
+                           (string-append "HL_CONFIG_DIR=" %output "/etc/")
+                           (string-append "conf_dir=" %output "/etc/"))
```




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

end of thread, other threads:[~2024-03-28 12:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-06 11:01 bug#68948: highlight error, cannot open filetypes.conf: No such file or directory chris
2024-03-27 20:58 ` bug#68948: temp fix chris
2024-03-28 11:51 ` bug#68948: highlight error, cannot open filetypes.conf: No such file or directory chris

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.