Subject: [bug#48909] [PATCH] gnu: Add goldendict.

From: Brendan Tildesley <[email-masked]>
Date: Tue, 8 Jun 2021 16:36:13 +0200 (CEST)

The program phones home to check for updates at this url 
http://goldendict.org/latest_release.php?current=1.5.0-RC2+git&platform=x11

Setting checkForNewReleases( false ),
in config.cc should fix it... Actually Nix has a patch to disable updates
that edits some other lines for some reason. 
Theres also a substitute fixing the hardcoded hunspell-1.6.1. Not sure if that
is needed. 

Also consider adding opencc as an input and adding
"CONFIG+=chinese_conversion_support"

I tried packaging this years ago but I got stuck figuring out how Goldendict
is supposed to find system installed dictionaries.
Ludo suggested a patch but I can't code in C/C++ so I was unable to do it.
https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00238.html

You can see that Goldendict looks in these places for dictionaries:

    #ifdef Q_OS_LINUX
    if ( QDir( "/usr/share/stardict/dic" ).exists() )
      c.paths.push_back( Path( "/usr/share/stardict/dic", true ) );

    if ( QDir( "/usr/share/dictd" ).exists() )
      c.paths.push_back( Path( "/usr/share/dictd", true ) );

    if ( QDir( "/usr/share/opendict/dictionaries" ).exists() )
      c.paths.push_back( Path( "/usr/share/opendict/dictionaries", true ) );

    if ( QDir( "/usr/share/goldendict-wordnet" ).exists() )
      c.paths.push_back( Path( "/usr/share/goldendict-wordnet", true ) );

    if ( QDir( "/usr/share/WyabdcRealPeopleTTS" ).exists() )
      c.soundDirs.push_back( SoundDir( "/usr/share/WyabdcRealPeopleTTS", "WyabdcRealPeopleTTS" ) );

    if ( QDir( "/usr/share/myspell/dicts" ).exists() )
      c.hunspell.dictionariesPath = "/usr/share/myspell/dicts";

I think Guix/Nix support should be added directly upstream, so it can look in
/run/current-system/profile/share
and $GUIX_PROFILE/share
for dictionaries.
However it would still be good to add goldendict and work on that later.