#1077268 hunspell LIBDIR, USEROOODIR and OOO are either obsolete or wrong

Package:
hunspell
Source:
hunspell
Description:
spell checker and morphological analyzer (program)
Submitter:
Jiri Belka
Date:
2026-05-13 02:45:02 UTC
Severity:
normal
Tags:
#1077268#5
Date:
2024-07-27 15:52:55 UTC
From:
To:
Dear Maintainer,

`hunspell -D' shows either MacOS, obsolete or incorrect paths:
---%>---
$ hunspell -D
SEARCH PATH:
.::/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/home/jiri/.openoffice.org/3/user/wordbook:/home/jiri/.openoffice.org2/user/wordbook:/home/jiri/.openoffice.org2.0/user/wordbook:/home/jiri/Library/Spelling:/opt/openoffice.org/basis3.0/share/dict/ooo:/usr/lib/openoffice.org/basis3.0/share/dict/ooo:/opt/openoffice.org2.4/share/dict/ooo:/usr/lib/openoffice.org2.4/share/dict/ooo:/opt/openoffice.org2.3/share/dict/ooo:/usr/lib/openoffice.org2.3/share/dict/ooo:/opt/openoffice.org2.2/share/dict/ooo:/usr/lib/openoffice.org2.2/share/dict/ooo:/opt/openoffice.org2.1/share/dict/ooo:/usr/lib/openoffice.org2.1/share/dict/ooo:/opt/openoffice.org2.0/share/dict/ooo:/usr/lib/openoffice.org2.0/share/dict/ooo
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
/usr/share/hunspell/en_US
/usr/share/hunspell/cs_CZ
/usr/share/hunspell/cs
/usr/share/hunspell/it_IT
/usr/share/hunspell/it_CH
/usr/share/myspell/dicts/cs
/usr/share/myspell/dicts/cs_CZ
LOADED DICTIONARY:
/usr/share/hunspell/en_US.aff
/usr/share/hunspell/en_US.dic
---%<---

For example, hunspell in OpenBSD ports patches that in the following way:

+++ src/tools/hunspell.cxx
@@ -116,28 +116,14 @@
 #include "../parsers/odfparser.hxx"

 #define LIBDIR                \
-  "/usr/share/hunspell:"      \
-  "/usr/share/myspell:"       \
-  "/usr/share/myspell/dicts:" \
-  "/Library/Spelling"
+  "${PREFIX}/share/hunspell:" \
+  "${LOCALBASE}/share/myspell:" \
+  "${LOCALBASE}/share/myspell/dicts:" \
+  "${LOCALBASE}/share/mozilla-dicts"
 #define USEROOODIR {                  \
-  ".openoffice.org/3/user/wordbook", \
-  ".openoffice.org2/user/wordbook",  \
-  ".openoffice.org2.0/user/wordbook",\
-  "Library/Spelling" }
+  ".config/libreoffice/4/user/wordbook" }
 #define OOODIR                                       \
-  "/opt/openoffice.org/basis3.0/share/dict/ooo:"     \
-  "/usr/lib/openoffice.org/basis3.0/share/dict/ooo:" \
-  "/opt/openoffice.org2.4/share/dict/ooo:"           \
-  "/usr/lib/openoffice.org2.4/share/dict/ooo:"       \
-  "/opt/openoffice.org2.3/share/dict/ooo:"           \
-  "/usr/lib/openoffice.org2.3/share/dict/ooo:"       \
-  "/opt/openoffice.org2.2/share/dict/ooo:"           \
-  "/usr/lib/openoffice.org2.2/share/dict/ooo:"       \
-  "/opt/openoffice.org2.1/share/dict/ooo:"           \
-  "/usr/lib/openoffice.org2.1/share/dict/ooo:"       \
-  "/opt/openoffice.org2.0/share/dict/ooo:"           \
-  "/usr/lib/openoffice.org2.0/share/dict/ooo"
+  "${LOCALBASE}/lib/libreoffice/share/wordbook"
 #define HOME getenv("HOME")
 #define DICBASENAME ".hunspell_"
 #define LOGFILE "/tmp/hunspell.log"
---%<---

Cf.
https://raw.githubusercontent.com/openbsd/ports/master/textproc/hunspell/patches/patch-
src_tools_hunspell_cxx .
---%>---
$ hunspell -D 2>&1 | awk 'function cmd(path) { system(sprintf("ls -ld \"%s\"",
path)) } /SEARCH PATH:/ { getline; split($0, paths, ":"); for (i in paths)
paths[i] ? cmd(paths[i]) : true }'
drwx--x---+ 80 jiri jiri 8192 Jul 27 17:07 .
drwxr-xr-x. 2 root root 170 Jul  9 12:46 /usr/share/hunspell
drwxr-xr-x. 3 root root 19 Jan  5  2024 /usr/share/myspell
drwxr-xr-x. 2 root root 68 Jan  5  2024 /usr/share/myspell/dicts
ls: cannot access '/Library/Spelling': No such file or directory
ls: cannot access '/home/jiri/.openoffice.org/3/user/wordbook': No such file or
directory
ls: cannot access '/home/jiri/.openoffice.org2/user/wordbook': No such file or
directory
ls: cannot access '/home/jiri/.openoffice.org2.0/user/wordbook': No such file
or directory
ls: cannot access '/home/jiri/Library/Spelling': No such file or directory
ls: cannot access '/opt/openoffice.org/basis3.0/share/dict/ooo': No such file
or directory
ls: cannot access '/usr/lib/openoffice.org/basis3.0/share/dict/ooo': No such
file or directory
ls: cannot access '/opt/openoffice.org2.4/share/dict/ooo': No such file or
directory
ls: cannot access '/usr/lib/openoffice.org2.4/share/dict/ooo': No such file or
directory
ls: cannot access '/opt/openoffice.org2.3/share/dict/ooo': No such file or
directory
ls: cannot access '/usr/lib/openoffice.org2.3/share/dict/ooo': No such file or
directory
ls: cannot access '/opt/openoffice.org2.2/share/dict/ooo': No such file or
directory
ls: cannot access '/usr/lib/openoffice.org2.2/share/dict/ooo': No such file or
directory
ls: cannot access '/opt/openoffice.org2.1/share/dict/ooo': No such file or
directory
ls: cannot access '/usr/lib/openoffice.org2.1/share/dict/ooo': No such file or
directory
ls: cannot access '/opt/openoffice.org2.0/share/dict/ooo': No such file or
directory
ls: cannot access '/usr/lib/openoffice.org2.0/share/dict/ooo': No such file or
directory

$ ls -l ~/.config/libreoffice/4/user/wordbook
total 4
-rw-r--r--. 1 jiri jiri 3917 Jul 20 22:04 standard.dic
---%<---

* What led up to the situation?

I was checking how hunspell might work with LO dictionaries.

* What exactly did you do (or not do) that was effective (or ineffective)?

Next, I checked if `hunspell' is able to read my LO dict, but it wasn't.

* What was the outcome of this action?

hunspell returns "bad (rejected) work - with '&', that is, with suggestion -
for a work
which is correct and present in my dictionary; an example:
---%>--- $ hunspell -d cs_CZ <<< "autobusáků" Hunspell 1.7.2 & autobusáků 1 0: autobusů ---%<--- * What outcome did you expect instead? I expected the previous command would return '*' as the word is present it my LO user dict:
---%>--- $ grep -n 'autobusáků' ~/.config/libreoffice/4/user/wordbook/standard.dic 114:autobusáků ---%<--- The workaround is to use `-p ~/.config/libreoffice/4/user/wordbook/standard.dic', but I would expect `hunspell' would use such a path automatically - see OpenBSD hunspell diff.
---%>--- hunspell -d cs_CZ -p ~/.config/libreoffice/4/user/wordbook/standard.dic <<< "autobusáků" error - iconv: ISO8859-2 -> UTF-8 Hunspell 1.7.2 * ---%<---
#1077268#10
Date:
2024-07-27 17:01:29 UTC
From:
To:
Hi,

Am 27.07.24 um 17:52 schrieb Jiri Belka:
Mac OS and obsolete ones, yes.
That is where the (system) dicts are

As seen here.

Why except solely for cosmetic?
LO dictionaries *ARE* hunspell directories. LO looks in /usr/share/hunspell
It does.  What exactly doesn't work? Still assuming system dicts. (If you mean user dicts like below, you need  to state that from the beginning.)

Ah, you are talking about user dicts..


That might make sense, and then also the OpenBSD patch would make sensein part (one could just add the libreoffice dir)...


Regards,


Rene

#1077268#15
Date:
2024-07-27 17:01:29 UTC
From:
To:
Hi,

Am 27.07.24 um 17:52 schrieb Jiri Belka:
Mac OS and obsolete ones, yes.
That is where the (system) dicts are

As seen here.

Why except solely for cosmetic?
LO dictionaries *ARE* hunspell directories. LO looks in /usr/share/hunspell
It does.  What exactly doesn't work? Still assuming system dicts. (If you mean user dicts like below, you need  to state that from the beginning.)

Ah, you are talking about user dicts..


That might make sense, and then also the OpenBSD patch would make sensein part (one could just add the libreoffice dir)...


Regards,


Rene

#1077268#20
Date:
2024-07-27 17:21:24 UTC
From:
To:
Just a note that I reported this in the past in Void Linux, they also used
the fix from OpenBSD hunspell port. See:

https://github.com/void-linux/void-packages/pull/18064

j.