manateelazycat / sdcv

Emacs interface for sdcv (Stardict console version)
73 stars 14 forks source link

Why does this package need both stardict and sdcv? #22

Closed hongyi-zhao closed 3 years ago

hongyi-zhao commented 3 years ago

I'm on Ubuntu 20.04, and stardict has been removed from its apt repo:

$ sudo apt-get install -y stardict
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package stardict is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'stardict' has no installation candidate

But I noticed the following note in the document of this package:

sudo aptitude install stardict sdcv -y

I'm very confused on this guidance, considering that sdcv in itself can work perfectly, why do we must install stardict at the same time?

Regards, HY

manateelazycat commented 3 years ago

If you don't use stardict, /usr/share/stardict/dict directory is not exist.

sdcv search dictionary in /usr/share/stardict/dict directory.

hongyi-zhao commented 3 years ago
$ man sdcv
[...]
FILES
       /usr/share/stardict/dic

       $(XDG_DATA_HOME)/stardict/dic

              Place where sdcv  expects  to  find  dictionaries.   Instead  of
              /usr/share/stardict/dic you can use any directory you want, just
              set the STARDICT_DATA_DIR environment variable.  For example, if
              you have dictionaries in /mnt/data/stardict-dicts/dic, set STAR‐
              DICT_DATA_DIR to /mnt/data/stardict-dicts.

Base on my testing, if /usr/share/stardict/dict doesn't exist, the ~/.stardict/dic can be picked up by sdcv by default:

werner@X10DAi:~$ ls /usr/share/stardict/dict
ls: cannot access '/usr/share/stardict/dict': No such file or directory
werner@X10DAi:~$ ls ~/.stardict/dic/
stardict-lazyworm-ec-2.4.2  stardict-Webster_s_Unabridged_3-2.4.2
werner@X10DAi:~$ sdcv -l
Dictionary's name   Word count
懒虫简明英汉词典    452185
Webster's Third New International Dictionary, Unabridged (En-En)    296190
werner@X10DAi:~$ man sdcv