[PATCH] gnu: Add goldendict.

  • Open
  • quality assurance status badge
Details
6 participants
  • Ludovic Courtès
  • Brendan Tildesley
  • Maxime Devos
  • P?ladhammika
  • Sergey Trofimov
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Sergey Trofimov
Severity
normal
S
S
Sergey Trofimov wrote on 7 Jun 2021 22:05
(address . guix-patches@gnu.org)(name . Sergey Trofimov)(address . sarg@sarg.org.ru)
20210607200532.27565-1-sarg@sarg.org.ru
---
gnu/packages/dictionaries.scm | 63 +++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)

Toggle diff (83 lines)
diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index 2b1f7f0ad1..74e15b884b 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -52,6 +52,12 @@
#:use-module (gnu packages texinfo)
#:use-module (gnu packages compression)
#:use-module (gnu packages tcl)
+ #:use-module (gnu packages xiph)
+ #:use-module (gnu packages libreoffice)
+ #:use-module (gnu packages xorg)
+ #:use-module (gnu packages image)
+ #:use-module (gnu packages qt)
+ #:use-module (gnu packages video)
#:use-module (gnu packages xml))
@@ -398,6 +404,63 @@ intelligible and easily correctable.")
(license (list license:gpl2 ; main license
license:expat)))) ; utf8/*
+(define-public goldendict
+ (package
+ (name "goldendict")
+ (version "2020-12-09")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/goldendict/goldendict.git")
+ (commit "261e45a5d79f9df2fbc050292410bed0f4ef3132")))
+
+ (sha256
+ (base32 "01pny06d4cmwf998hpqd7xx7mccbbasb8js1bv3rkdi1ljg01f7n"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (invoke "qmake" "goldendict.pro"
+ "CONFIG+=no_epwing_support"
+ (string-append "QMAKE_LRELEASE="
+ (assoc-ref inputs "qttools")
+ "/bin/lrelease")
+ (string-append "PREFIX="
+ (assoc-ref outputs "out"))))))))
+
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("libvorbis" ,libvorbis)
+ ("zlib" ,zlib)
+ ("hunspell" ,hunspell)
+ ("x11proto-record-x11" ,xproto)
+ ("libtiff" ,libtiff)
+ ("qtbase" ,qtbase)
+ ("qtmultimedia" ,qtmultimedia)
+ ("qtsvg" ,qtsvg)
+ ("qttools" ,qttools)
+ ("qtwebkit" ,qtwebkit)
+ ("qtwebview" ,qtwebview)
+ ("qtx11extras" ,qtx11extras)
+ ("libxtst" ,libxtst)
+ ("lzo" ,lzo)
+ ("bzip2" ,bzip2)
+ ("ao" ,ao)
+ ("ffmpeg" ,ffmpeg)))
+ (synopsis "A feature-rich dictionary lookup program")
+ (description
+ "GoldenDict is a feature-rich dictionary lookup program,
+supporting multiple dictionary formats (StarDict, Babylon, Lingvo, Dictd, AARD,
+MDict, SDict) and online dictionaries, featuring perfect article rendering with
+the complete markup, illustrations and other content retained, and allowing you
+to type in words without any accents or correct case.")
+ (home-page "http://goldendict.org/")
+ (license license:gpl3+)))
+
(define-public sdcv
(package
(name "sdcv")
--
2.31.1
B
B
Brendan Tildesley wrote on 8 Jun 2021 16:36
(name . 48909@debbugs.gnu.org)(address . 48909@debbugs.gnu.org)(name . Sergey Trofimov)(address . sarg@sarg.org.ru)
1051806061.54116.1623162973231@office.mailbox.org
The program phones home to check for updates at this url

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.

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.
S
S
Sergey Trofimov wrote on 8 Jun 2021 22:07
(address . 48909@debbugs.gnu.org)(address . mail@brendan.scot)
87tum8qfwo.fsf@sarg.org.ru
I've reused the patch from nixpkgs and added opencc dependency.
Brendan Tildesley <mail@brendan.scot> writes:

Toggle quote (3 lines)
> The program phones home to check for updates at this url
> Also consider adding opencc as an input and adding
> "CONFIG+=chinese_conversion_support"
L
L
Ludovic Courtès wrote on 13 Jun 2021 22:40
Re: bug#48909: [PATCH] gnu: Add goldendict.
(name . Sergey Trofimov)(address . sarg@sarg.org.ru)
87lf7dzeej.fsf_-_@gnu.org
Hi Sergey,

Sergey Trofimov <sarg@sarg.org.ru> skribis:

Toggle quote (13 lines)
> I've reused the patch from nixpkgs and added opencc dependency.
>
>>From e5c96b58f23f56da605b4ccdf3cef7d04ef379c9 Mon Sep 17 00:00:00 2001
> From: Sergey Trofimov <sarg@sarg.org.ru>
> Date: Mon, 7 Jun 2021 21:50:30 +0200
> Subject: [PATCH] gnu: Add goldendict.
>
> ---
> gnu/packages/dictionaries.scm | 65 +++++++++++++++++++
> .../goldendict-remove-check-for-update.patch | 49 ++++++++++++++
> 2 files changed, 114 insertions(+)
> create mode 100644 gnu/packages/patches/goldendict-remove-check-for-update.patch

Overall it LGTM, and it’s great that you addressed the issue Brendan
mentioned.

Minor issues:


[...]

Toggle quote (4 lines)
> +++ b/gnu/packages/patches/goldendict-remove-check-for-update.patch
> @@ -0,0 +1,49 @@
> +diff --git i/config.cc w/config.cc

Please add a line or two at the top explaining what the patch does.

Also add this file to ‘gnu/local.mk’.

Bonus points if you attempt a ChangeLog-style commit log. :-)

Could you send an updated patch?

Thank you!

Ludo’.
S
S
Sergey Trofimov wrote on 14 Jun 2021 08:26
[PATCH] gnu: Add goldendict.
(address . 48909@debbugs.gnu.org)(name . Sergey Trofimov)(address . sarg@sarg.org.ru)
20210614062656.4499-1-sarg@sarg.org.ru
* gnu/packages/dictionaries.scm (goldendict): New variable.
---
gnu/local.mk | 1 +
gnu/packages/dictionaries.scm | 70 +++++++++++++++++++
.../goldendict-remove-check-for-update.patch | 52 ++++++++++++++
3 files changed, 123 insertions(+)
create mode 100644 gnu/packages/patches/goldendict-remove-check-for-update.patch

Toggle diff (160 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 73556cc184..43765836b4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1161,6 +1161,7 @@ dist_patch_DATA = \
%D%/packages/patches/gobject-introspection-absolute-shlib-path.patch \
%D%/packages/patches/gobject-introspection-cc.patch \
%D%/packages/patches/gobject-introspection-girepository.patch \
+ %D%/packages/patches/goldendict-remove-check-for-update.patch \
%D%/packages/patches/go-skip-gc-test.patch \
%D%/packages/patches/gpm-glibc-2.26.patch \
%D%/packages/patches/gpodder-disable-updater.patch \
diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index 5ca9e128ff..79b10ed9ac 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -52,6 +52,13 @@
#:use-module (gnu packages texinfo)
#:use-module (gnu packages compression)
#:use-module (gnu packages tcl)
+ #:use-module (gnu packages xiph)
+ #:use-module (gnu packages libreoffice)
+ #:use-module (gnu packages xorg)
+ #:use-module (gnu packages image)
+ #:use-module (gnu packages textutils)
+ #:use-module (gnu packages qt)
+ #:use-module (gnu packages video)
#:use-module (gnu packages xml))
@@ -398,6 +405,69 @@ intelligible and easily correctable.")
(license (list license:gpl2 ; main license
license:expat)))) ; utf8/*
+(define-public goldendict
+ (package
+ (name "goldendict")
+ (version "2021-06-12")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/goldendict/goldendict.git")
+ (commit "57c4c33780d1fb20156ca2f819de62bfb974b867")))
+ (sha256
+ (base32 "0d4swrkqv9q1b1zp5z7c36yv9skdsfsbyfynv2nxclhg1ra87svp"))
+ (patches (search-patches "goldendict-remove-check-for-update.patch"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ (for-each delete-file-recursively
+ '("winlibs" "maclibs"))
+ #t))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (invoke "qmake" "goldendict.pro"
+ "CONFIG+=no_epwing_support"
+ "CONFIG+=chinese_conversion_support"
+ "QMAKE_LRELEASE=lrelease"
+ (string-append "PREFIX="
+ (assoc-ref outputs "out"))))))))
+
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("qttools" ,qttools)))
+ (inputs
+ `(("ao" ,ao)
+ ("bzip2" ,bzip2)
+ ("hunspell" ,hunspell)
+ ("ffmpeg" ,ffmpeg)
+ ("libtiff" ,libtiff)
+ ("libvorbis" ,libvorbis)
+ ("libxtst" ,libxtst)
+ ("opencc" ,opencc)
+ ("qtx11extras" ,qtx11extras)
+ ("qtbase" ,qtbase)
+ ("qtmultimedia" ,qtmultimedia)
+ ("qtsvg" ,qtsvg)
+ ("qttools" ,qttools)
+ ("qtwebkit" ,qtwebkit)
+ ("qtwebview" ,qtwebview)
+ ("lzo" ,lzo)
+ ("x11proto-record-x11" ,xproto)
+ ("zlib" ,zlib)))
+ (synopsis "Feature-rich dictionary lookup program")
+ (description
+ "GoldenDict is a feature-rich dictionary lookup program,
+supporting multiple dictionary formats (StarDict, Babylon, Lingvo, Dictd, AARD,
+MDict, SDict) and online dictionaries, featuring perfect article rendering with
+the complete markup, illustrations and other content retained, and allowing you
+to type in words without any accents or correct case.")
+ (home-page "http://goldendict.org/")
+ (license license:gpl3+)))
+
(define-public sdcv
(package
(name "sdcv")
diff --git a/gnu/packages/patches/goldendict-remove-check-for-update.patch b/gnu/packages/patches/goldendict-remove-check-for-update.patch
new file mode 100644
index 0000000000..84d9b1767e
--- /dev/null
+++ b/gnu/packages/patches/goldendict-remove-check-for-update.patch
@@ -0,0 +1,52 @@
+https://github.com/NixOS/nixpkgs/blob/217b221/pkgs/applications/misc/goldendict/0001-dont-check-for-updates.patch
+Disable calling home for updates.
+
+diff --git i/config.cc w/config.cc
+index 04b63f5..7a453d9 100644
+--- i/config.cc
++++ w/config.cc
+@@ -182,7 +182,7 @@ Preferences::Preferences():
+ pronounceOnLoadPopup( false ),
+ useInternalPlayer( InternalPlayerBackend::anyAvailable() ),
+ internalPlayerBackend( InternalPlayerBackend::defaultBackend() ),
+- checkForNewReleases( true ),
++ checkForNewReleases( false ),
+ disallowContentFromOtherSites( false ),
+ enableWebPlugins( false ),
+ hideGoldenDictHeader( false ),
+@@ -867,8 +867,8 @@ Class load() THROW_SPEC( exError )
+ c.preferences.proxyServer.systemProxyPassword = proxy.namedItem( "systemProxyPassword" ).toElement().text();
+ }
+
+- if ( !preferences.namedItem( "checkForNewReleases" ).isNull() )
+- c.preferences.checkForNewReleases = ( preferences.namedItem( "checkForNewReleases" ).toElement().text() == "1" );
++ //if ( !preferences.namedItem( "checkForNewReleases" ).isNull() )
++ // c.preferences.checkForNewReleases = ( preferences.namedItem( "checkForNewReleases" ).toElement().text() == "1" );
+
+ if ( !preferences.namedItem( "disallowContentFromOtherSites" ).isNull() )
+ c.preferences.disallowContentFromOtherSites = ( preferences.namedItem( "disallowContentFromOtherSites" ).toElement().text() == "1" );
+@@ -1819,9 +1819,9 @@ void save( Class const & c ) THROW_SPEC( exError )
+ proxy.appendChild( opt );
+ }
+
+- opt = dd.createElement( "checkForNewReleases" );
+- opt.appendChild( dd.createTextNode( c.preferences.checkForNewReleases ? "1" : "0" ) );
+- preferences.appendChild( opt );
++ //opt = dd.createElement( "checkForNewReleases" );
++ //opt.appendChild( dd.createTextNode( c.preferences.checkForNewReleases ? "1" : "0" ) );
++ //preferences.appendChild( opt );
+
+ opt = dd.createElement( "disallowContentFromOtherSites" );
+ opt.appendChild( dd.createTextNode( c.preferences.disallowContentFromOtherSites ? "1" : "0" ) );
+diff --git i/preferences.cc w/preferences.cc
+index 72c3147..7e48f00 100644
+--- i/preferences.cc
++++ w/preferences.cc
+@@ -314,6 +314,7 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ):
+ this, SLOT( customProxyToggled( bool ) ) );
+
+ ui.checkForNewReleases->setChecked( p.checkForNewReleases );
++ ui.checkForNewReleases->setEnabled( false );
+ ui.disallowContentFromOtherSites->setChecked( p.disallowContentFromOtherSites );
+ ui.enableWebPlugins->setChecked( p.enableWebPlugins );
+ ui.hideGoldenDictHeader->setChecked( p.hideGoldenDictHeader );
--
2.32.0
S
S
Sergey Trofimov wrote on 3 Jul 2021 16:13
(address . 48909@debbugs.gnu.org)(name . Sergey Trofimov)(address . sarg@sarg.org.ru)
20210703141333.31876-1-sarg@sarg.org.ru
* gnu/packages/dictionaries.scm (goldendict): New variable.
---
gnu/local.mk | 1 +
gnu/packages/dictionaries.scm | 72 +++++++++++++++++++
.../goldendict-remove-check-for-update.patch | 52 ++++++++++++++
3 files changed, 125 insertions(+)
create mode 100644 gnu/packages/patches/goldendict-remove-check-for-update.patch

Toggle diff (162 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 509970f044..bcac89c79c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1170,6 +1170,7 @@ dist_patch_DATA = \
%D%/packages/patches/gobject-introspection-absolute-shlib-path.patch \
%D%/packages/patches/gobject-introspection-cc.patch \
%D%/packages/patches/gobject-introspection-girepository.patch \
+ %D%/packages/patches/goldendict-remove-check-for-update.patch \
%D%/packages/patches/go-skip-gc-test.patch \
%D%/packages/patches/gpm-glibc-2.26.patch \
%D%/packages/patches/gpodder-disable-updater.patch \
diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index 5ca9e128ff..03cf1f3a5d 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -52,6 +52,13 @@
#:use-module (gnu packages texinfo)
#:use-module (gnu packages compression)
#:use-module (gnu packages tcl)
+ #:use-module (gnu packages xiph)
+ #:use-module (gnu packages libreoffice)
+ #:use-module (gnu packages xorg)
+ #:use-module (gnu packages image)
+ #:use-module (gnu packages textutils)
+ #:use-module (gnu packages qt)
+ #:use-module (gnu packages video)
#:use-module (gnu packages xml))
@@ -398,6 +405,71 @@ intelligible and easily correctable.")
(license (list license:gpl2 ; main license
license:expat)))) ; utf8/*
+(define-public goldendict
+ (let ((commit "baff02a14b3f70f0d0a55bef550dbb74dcbf0ce8")
+ (revision "0"))
+ (package
+ (name "goldendict")
+ (version (git-version "1.5.0-RC2" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/goldendict/goldendict")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1l5ymxl34pw01vfq721wfgzvq4zw4iwvb73nhsb94m3l2za5k5j2"))
+ (patches (search-patches "goldendict-remove-check-for-update.patch"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ (for-each delete-file-recursively
+ '("winlibs" "maclibs"))
+ #t))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (invoke "qmake" "goldendict.pro"
+ "CONFIG+=no_epwing_support"
+ "CONFIG+=chinese_conversion_support"
+ "QMAKE_LRELEASE=lrelease"
+ (string-append "PREFIX="
+ (assoc-ref outputs "out"))))))))
+
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("qttools" ,qttools)))
+ (inputs
+ `(("ao" ,ao)
+ ("bzip2" ,bzip2)
+ ("hunspell" ,hunspell)
+ ("ffmpeg" ,ffmpeg)
+ ("libtiff" ,libtiff)
+ ("libvorbis" ,libvorbis)
+ ("libxtst" ,libxtst)
+ ("opencc" ,opencc)
+ ("qtx11extras" ,qtx11extras)
+ ("qtbase" ,qtbase-5)
+ ("qtmultimedia" ,qtmultimedia)
+ ("qtsvg" ,qtsvg)
+ ("qtwebkit" ,qtwebkit)
+ ("qtwebview" ,qtwebview)
+ ("lzo" ,lzo)
+ ("x11proto-record-x11" ,xproto)
+ ("zlib" ,zlib)))
+ (synopsis "Feature-rich dictionary lookup program")
+ (description
+ "GoldenDict is a feature-rich dictionary lookup program,
+supporting multiple dictionary formats (StarDict, Babylon, Lingvo, Dictd, AARD,
+MDict, SDict) and online dictionaries, featuring perfect article rendering with
+the complete markup, illustrations and other content retained, and allowing you
+to type in words without any accents or correct case.")
+ (home-page "http://goldendict.org/")
+ (license license:gpl3+))))
+
(define-public sdcv
(package
(name "sdcv")
diff --git a/gnu/packages/patches/goldendict-remove-check-for-update.patch b/gnu/packages/patches/goldendict-remove-check-for-update.patch
new file mode 100644
index 0000000000..84d9b1767e
--- /dev/null
+++ b/gnu/packages/patches/goldendict-remove-check-for-update.patch
@@ -0,0 +1,52 @@
+https://github.com/NixOS/nixpkgs/blob/217b221/pkgs/applications/misc/goldendict/0001-dont-check-for-updates.patch
+Disable calling home for updates.
+
+diff --git i/config.cc w/config.cc
+index 04b63f5..7a453d9 100644
+--- i/config.cc
++++ w/config.cc
+@@ -182,7 +182,7 @@ Preferences::Preferences():
+ pronounceOnLoadPopup( false ),
+ useInternalPlayer( InternalPlayerBackend::anyAvailable() ),
+ internalPlayerBackend( InternalPlayerBackend::defaultBackend() ),
+- checkForNewReleases( true ),
++ checkForNewReleases( false ),
+ disallowContentFromOtherSites( false ),
+ enableWebPlugins( false ),
+ hideGoldenDictHeader( false ),
+@@ -867,8 +867,8 @@ Class load() THROW_SPEC( exError )
+ c.preferences.proxyServer.systemProxyPassword = proxy.namedItem( "systemProxyPassword" ).toElement().text();
+ }
+
+- if ( !preferences.namedItem( "checkForNewReleases" ).isNull() )
+- c.preferences.checkForNewReleases = ( preferences.namedItem( "checkForNewReleases" ).toElement().text() == "1" );
++ //if ( !preferences.namedItem( "checkForNewReleases" ).isNull() )
++ // c.preferences.checkForNewReleases = ( preferences.namedItem( "checkForNewReleases" ).toElement().text() == "1" );
+
+ if ( !preferences.namedItem( "disallowContentFromOtherSites" ).isNull() )
+ c.preferences.disallowContentFromOtherSites = ( preferences.namedItem( "disallowContentFromOtherSites" ).toElement().text() == "1" );
+@@ -1819,9 +1819,9 @@ void save( Class const & c ) THROW_SPEC( exError )
+ proxy.appendChild( opt );
+ }
+
+- opt = dd.createElement( "checkForNewReleases" );
+- opt.appendChild( dd.createTextNode( c.preferences.checkForNewReleases ? "1" : "0" ) );
+- preferences.appendChild( opt );
++ //opt = dd.createElement( "checkForNewReleases" );
++ //opt.appendChild( dd.createTextNode( c.preferences.checkForNewReleases ? "1" : "0" ) );
++ //preferences.appendChild( opt );
+
+ opt = dd.createElement( "disallowContentFromOtherSites" );
+ opt.appendChild( dd.createTextNode( c.preferences.disallowContentFromOtherSites ? "1" : "0" ) );
+diff --git i/preferences.cc w/preferences.cc
+index 72c3147..7e48f00 100644
+--- i/preferences.cc
++++ w/preferences.cc
+@@ -314,6 +314,7 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ):
+ this, SLOT( customProxyToggled( bool ) ) );
+
+ ui.checkForNewReleases->setChecked( p.checkForNewReleases );
++ ui.checkForNewReleases->setEnabled( false );
+ ui.disallowContentFromOtherSites->setChecked( p.disallowContentFromOtherSites );
+ ui.enableWebPlugins->setChecked( p.enableWebPlugins );
+ ui.hideGoldenDictHeader->setChecked( p.hideGoldenDictHeader );
--
2.32.0
S
S
Sergey Trofimov wrote on 3 Jul 2021 19:30
Rebased on the latest commit in master.
(address . 48909@debbugs.gnu.org)
20210703173018.6342-1-sarg@sarg.org.ru

S
S
Sergey Trofimov wrote on 3 Jul 2021 19:32
[PATCH] gnu: Add goldendict.
(address . 48909@debbugs.gnu.org)(name . Sergey Trofimov)(address . sarg@sarg.org.ru)
20210703173222.6441-1-sarg@sarg.org.ru
* gnu/packages/dictionaries.scm (goldendict): New variable.
---
gnu/local.mk | 1 +
gnu/packages/dictionaries.scm | 72 +++++++++++++++++++
.../goldendict-remove-check-for-update.patch | 52 ++++++++++++++
3 files changed, 125 insertions(+)
create mode 100644 gnu/packages/patches/goldendict-remove-check-for-update.patch

Toggle diff (162 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index b197ec55f9..e27af238c7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1169,6 +1169,7 @@ dist_patch_DATA = \
%D%/packages/patches/gobject-introspection-absolute-shlib-path.patch \
%D%/packages/patches/gobject-introspection-cc.patch \
%D%/packages/patches/gobject-introspection-girepository.patch \
+ %D%/packages/patches/goldendict-remove-check-for-update.patch \
%D%/packages/patches/go-fix-script-tests.patch \
%D%/packages/patches/go-skip-gc-test.patch \
%D%/packages/patches/gpm-glibc-2.26.patch \
diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index 5ca9e128ff..03cf1f3a5d 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -52,6 +52,13 @@
#:use-module (gnu packages texinfo)
#:use-module (gnu packages compression)
#:use-module (gnu packages tcl)
+ #:use-module (gnu packages xiph)
+ #:use-module (gnu packages libreoffice)
+ #:use-module (gnu packages xorg)
+ #:use-module (gnu packages image)
+ #:use-module (gnu packages textutils)
+ #:use-module (gnu packages qt)
+ #:use-module (gnu packages video)
#:use-module (gnu packages xml))
@@ -398,6 +405,71 @@ intelligible and easily correctable.")
(license (list license:gpl2 ; main license
license:expat)))) ; utf8/*
+(define-public goldendict
+ (let ((commit "baff02a14b3f70f0d0a55bef550dbb74dcbf0ce8")
+ (revision "0"))
+ (package
+ (name "goldendict")
+ (version (git-version "1.5.0-RC2" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/goldendict/goldendict")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1l5ymxl34pw01vfq721wfgzvq4zw4iwvb73nhsb94m3l2za5k5j2"))
+ (patches (search-patches "goldendict-remove-check-for-update.patch"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ (for-each delete-file-recursively
+ '("winlibs" "maclibs"))
+ #t))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (invoke "qmake" "goldendict.pro"
+ "CONFIG+=no_epwing_support"
+ "CONFIG+=chinese_conversion_support"
+ "QMAKE_LRELEASE=lrelease"
+ (string-append "PREFIX="
+ (assoc-ref outputs "out"))))))))
+
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("qttools" ,qttools)))
+ (inputs
+ `(("ao" ,ao)
+ ("bzip2" ,bzip2)
+ ("hunspell" ,hunspell)
+ ("ffmpeg" ,ffmpeg)
+ ("libtiff" ,libtiff)
+ ("libvorbis" ,libvorbis)
+ ("libxtst" ,libxtst)
+ ("opencc" ,opencc)
+ ("qtx11extras" ,qtx11extras)
+ ("qtbase" ,qtbase-5)
+ ("qtmultimedia" ,qtmultimedia)
+ ("qtsvg" ,qtsvg)
+ ("qtwebkit" ,qtwebkit)
+ ("qtwebview" ,qtwebview)
+ ("lzo" ,lzo)
+ ("x11proto-record-x11" ,xproto)
+ ("zlib" ,zlib)))
+ (synopsis "Feature-rich dictionary lookup program")
+ (description
+ "GoldenDict is a feature-rich dictionary lookup program,
+supporting multiple dictionary formats (StarDict, Babylon, Lingvo, Dictd, AARD,
+MDict, SDict) and online dictionaries, featuring perfect article rendering with
+the complete markup, illustrations and other content retained, and allowing you
+to type in words without any accents or correct case.")
+ (home-page "http://goldendict.org/")
+ (license license:gpl3+))))
+
(define-public sdcv
(package
(name "sdcv")
diff --git a/gnu/packages/patches/goldendict-remove-check-for-update.patch b/gnu/packages/patches/goldendict-remove-check-for-update.patch
new file mode 100644
index 0000000000..84d9b1767e
--- /dev/null
+++ b/gnu/packages/patches/goldendict-remove-check-for-update.patch
@@ -0,0 +1,52 @@
+https://github.com/NixOS/nixpkgs/blob/217b221/pkgs/applications/misc/goldendict/0001-dont-check-for-updates.patch
+Disable calling home for updates.
+
+diff --git i/config.cc w/config.cc
+index 04b63f5..7a453d9 100644
+--- i/config.cc
++++ w/config.cc
+@@ -182,7 +182,7 @@ Preferences::Preferences():
+ pronounceOnLoadPopup( false ),
+ useInternalPlayer( InternalPlayerBackend::anyAvailable() ),
+ internalPlayerBackend( InternalPlayerBackend::defaultBackend() ),
+- checkForNewReleases( true ),
++ checkForNewReleases( false ),
+ disallowContentFromOtherSites( false ),
+ enableWebPlugins( false ),
+ hideGoldenDictHeader( false ),
+@@ -867,8 +867,8 @@ Class load() THROW_SPEC( exError )
+ c.preferences.proxyServer.systemProxyPassword = proxy.namedItem( "systemProxyPassword" ).toElement().text();
+ }
+
+- if ( !preferences.namedItem( "checkForNewReleases" ).isNull() )
+- c.preferences.checkForNewReleases = ( preferences.namedItem( "checkForNewReleases" ).toElement().text() == "1" );
++ //if ( !preferences.namedItem( "checkForNewReleases" ).isNull() )
++ // c.preferences.checkForNewReleases = ( preferences.namedItem( "checkForNewReleases" ).toElement().text() == "1" );
+
+ if ( !preferences.namedItem( "disallowContentFromOtherSites" ).isNull() )
+ c.preferences.disallowContentFromOtherSites = ( preferences.namedItem( "disallowContentFromOtherSites" ).toElement().text() == "1" );
+@@ -1819,9 +1819,9 @@ void save( Class const & c ) THROW_SPEC( exError )
+ proxy.appendChild( opt );
+ }
+
+- opt = dd.createElement( "checkForNewReleases" );
+- opt.appendChild( dd.createTextNode( c.preferences.checkForNewReleases ? "1" : "0" ) );
+- preferences.appendChild( opt );
++ //opt = dd.createElement( "checkForNewReleases" );
++ //opt.appendChild( dd.createTextNode( c.preferences.checkForNewReleases ? "1" : "0" ) );
++ //preferences.appendChild( opt );
+
+ opt = dd.createElement( "disallowContentFromOtherSites" );
+ opt.appendChild( dd.createTextNode( c.preferences.disallowContentFromOtherSites ? "1" : "0" ) );
+diff --git i/preferences.cc w/preferences.cc
+index 72c3147..7e48f00 100644
+--- i/preferences.cc
++++ w/preferences.cc
+@@ -314,6 +314,7 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ):
+ this, SLOT( customProxyToggled( bool ) ) );
+
+ ui.checkForNewReleases->setChecked( p.checkForNewReleases );
++ ui.checkForNewReleases->setEnabled( false );
+ ui.disallowContentFromOtherSites->setChecked( p.disallowContentFromOtherSites );
+ ui.enableWebPlugins->setChecked( p.enableWebPlugins );
+ ui.hideGoldenDictHeader->setChecked( p.hideGoldenDictHeader );
--
2.32.0
P
P
P?ladhammika wrote on 22 Jan 2022 22:06
(name . 48909@debbugs.gnu.org)(address . 48909@debbugs.gnu.org)
gQD-w3Yuq8W0vPTdvPZFVJAITWVP-rpP5GLCqrU75I8QnFlAX_IU-m0xPPvcneDDCCJFtiF11ssR39mZf91umvPF7wXwAT1qbUMKsB6c65s=@protonmail.com
Whatever happened with this patch?

All the best,
P?ladhammika
M
M
Maxime Devos wrote on 27 Mar 2022 18:09
Re: [PATCH] gnu: Add goldendict
(address . 48909@debbugs.gnu.org)
b231907eace6824d3a76ebe81ed7b88d8fa7be74.camel@telenet.be
Hi,

Toggle quote (4 lines)
> + (let ((commit "baff02a14b3f70f0d0a55bef550dbb74dcbf0ce8")
> + (version (git-version "1.5.0-RC2" revision commit))
> + (commit commit)))

Is this an actual upstream version? If so, 'git-version' is not
necessary here. Also, do we want to package release candidates, or
only regular releases?

Toggle quote (2 lines)
> + #t))))

Not necessary anymore.

Toggle quote (3 lines)
> + (for-each delete-file-recursively
> + '("winlibs" "maclibs"))

What is the reason for removal? (bundling, nonfree, broken, ...?)

Toggle quote (2 lines)
> + "CONFIG+=no_epwing_support"

Why not support 'epwing', whatever that is?

Toggle quote (1 lines)
> +

This will do, but ideally upstream would just have some kind of
configuration flag that distributions could set.

Toggle quote (1 lines)
> + "Feature-rich dictionary lookup program")
+ (description
+ "GoldenDict is a feature-rich dictionary lookup program,
+supporting multiple dictionary formats (StarDict, Babylon, Lingvo,
Dictd, AARD,
+MDict, SDict) and online dictionaries, featuring perfect article
renderin

This is leaning a bit against the ‘no marketing phrases rule’ from
(guix)Synopses and Descriptions.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkCMNxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7lecAQDImpNDHt9m0YNUv7o7jk/2t1dy
TSX/RyW2HkHMQrwTHwD/aLl0ESz1Wec+/5lDQ7vkC11J6Hq0aiuSBzJUrPfROQ0=
=7l7j
-----END PGP SIGNATURE-----


S
S
Sergey Trofimov wrote on 28 Mar 2022 10:26
[PATCH] gnu: Add goldendict.
(address . 48909@debbugs.gnu.org)(name . Sergey Trofimov)(address . sarg@sarg.org.ru)
20220328082654.24539-1-sarg@sarg.org.ru
* gnu/packages/dictionaries.scm (goldendict): New variable.
---
gnu/local.mk | 1 +
gnu/packages/dictionaries.scm | 53 +++++++++++++++++++
.../goldendict-remove-check-for-update.patch | 52 ++++++++++++++++++
3 files changed, 106 insertions(+)
create mode 100644 gnu/packages/patches/goldendict-remove-check-for-update.patch

Toggle diff (150 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 4f60046a5e..c1fe54d514 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1204,6 +1204,7 @@ dist_patch_DATA = \
%D%/packages/patches/gobject-introspection-absolute-shlib-path.patch \
%D%/packages/patches/gobject-introspection-cc.patch \
%D%/packages/patches/gobject-introspection-girepository.patch \
+ %D%/packages/patches/goldendict-remove-check-for-update.patch \
%D%/packages/patches/go-fix-script-tests.patch \
%D%/packages/patches/go-github-com-golang-snappy-32bit-test.patch \
%D%/packages/patches/go-github-com-urfave-cli-fix-tests.patch \
diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index f9d6e57877..fd4172ebb6 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -38,6 +38,7 @@ (define-module (gnu packages dictionaries)
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
#:use-module (gnu packages curl)
+ #:use-module (gnu packages education)
#:use-module (gnu packages emacs)
#:use-module (gnu packages flex)
#:use-module (gnu packages fribidi)
@@ -52,6 +53,13 @@ (define-module (gnu packages dictionaries)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages compression)
#:use-module (gnu packages tcl)
+ #:use-module (gnu packages xiph)
+ #:use-module (gnu packages libreoffice)
+ #:use-module (gnu packages xorg)
+ #:use-module (gnu packages image)
+ #:use-module (gnu packages textutils)
+ #:use-module (gnu packages qt)
+ #:use-module (gnu packages video)
#:use-module (gnu packages xml))
@@ -389,6 +397,51 @@ (define-public apertium
(license (list license:gpl2 ; main license
license:expat)))) ; utf8/*
+(define-public goldendict
+ (let ((commit "8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05")
+ (revision "0"))
+ (package
+ (name "goldendict")
+ (version (git-version "1.5.0-RC2" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/goldendict/goldendict")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0lhpmrsglqmwz9d6hr29ncm163hvdqqnxmw9frhgyrblw977wzni"))
+ (patches (search-patches "goldendict-remove-check-for-update.patch"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ ;; Remove bundled libraries.
+ (for-each delete-file-recursively
+ '("winlibs" "maclibs"))))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (invoke "qmake" "goldendict.pro"
+ "CONFIG+=chinese_conversion_support"
+ "QMAKE_LRELEASE=lrelease"
+ (string-append "PREFIX="
+ (assoc-ref outputs "out"))))))))
+
+ (native-inputs (list pkg-config qttools))
+ (inputs (list ao bzip2 hunspell ffmpeg libeb libtiff libvorbis libxtst
+ opencc qtx11extras qtbase-5 qtmultimedia qtsvg qtwebkit
+ qtwebview lzo xorgproto zlib))
+ (synopsis "Feature-rich dictionary lookup program")
+ (description
+ "GoldenDict is a dictionary lookup program,
+supporting multiple dictionary formats (StarDict, Babylon, Lingvo, Dictd, AARD,
+MDict, SDict) and online dictionaries.")
+ (home-page "http://goldendict.org/")
+ (license license:gpl3+))))
+
(define-public sdcv
(package
(name "sdcv")
diff --git a/gnu/packages/patches/goldendict-remove-check-for-update.patch b/gnu/packages/patches/goldendict-remove-check-for-update.patch
new file mode 100644
index 0000000000..84d9b1767e
--- /dev/null
+++ b/gnu/packages/patches/goldendict-remove-check-for-update.patch
@@ -0,0 +1,52 @@
+https://github.com/NixOS/nixpkgs/blob/217b221/pkgs/applications/misc/goldendict/0001-dont-check-for-updates.patch
+Disable calling home for updates.
+
+diff --git i/config.cc w/config.cc
+index 04b63f5..7a453d9 100644
+--- i/config.cc
++++ w/config.cc
+@@ -182,7 +182,7 @@ Preferences::Preferences():
+ pronounceOnLoadPopup( false ),
+ useInternalPlayer( InternalPlayerBackend::anyAvailable() ),
+ internalPlayerBackend( InternalPlayerBackend::defaultBackend() ),
+- checkForNewReleases( true ),
++ checkForNewReleases( false ),
+ disallowContentFromOtherSites( false ),
+ enableWebPlugins( false ),
+ hideGoldenDictHeader( false ),
+@@ -867,8 +867,8 @@ Class load() THROW_SPEC( exError )
+ c.preferences.proxyServer.systemProxyPassword = proxy.namedItem( "systemProxyPassword" ).toElement().text();
+ }
+
+- if ( !preferences.namedItem( "checkForNewReleases" ).isNull() )
+- c.preferences.checkForNewReleases = ( preferences.namedItem( "checkForNewReleases" ).toElement().text() == "1" );
++ //if ( !preferences.namedItem( "checkForNewReleases" ).isNull() )
++ // c.preferences.checkForNewReleases = ( preferences.namedItem( "checkForNewReleases" ).toElement().text() == "1" );
+
+ if ( !preferences.namedItem( "disallowContentFromOtherSites" ).isNull() )
+ c.preferences.disallowContentFromOtherSites = ( preferences.namedItem( "disallowContentFromOtherSites" ).toElement().text() == "1" );
+@@ -1819,9 +1819,9 @@ void save( Class const & c ) THROW_SPEC( exError )
+ proxy.appendChild( opt );
+ }
+
+- opt = dd.createElement( "checkForNewReleases" );
+- opt.appendChild( dd.createTextNode( c.preferences.checkForNewReleases ? "1" : "0" ) );
+- preferences.appendChild( opt );
++ //opt = dd.createElement( "checkForNewReleases" );
++ //opt.appendChild( dd.createTextNode( c.preferences.checkForNewReleases ? "1" : "0" ) );
++ //preferences.appendChild( opt );
+
+ opt = dd.createElement( "disallowContentFromOtherSites" );
+ opt.appendChild( dd.createTextNode( c.preferences.disallowContentFromOtherSites ? "1" : "0" ) );
+diff --git i/preferences.cc w/preferences.cc
+index 72c3147..7e48f00 100644
+--- i/preferences.cc
++++ w/preferences.cc
+@@ -314,6 +314,7 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ):
+ this, SLOT( customProxyToggled( bool ) ) );
+
+ ui.checkForNewReleases->setChecked( p.checkForNewReleases );
++ ui.checkForNewReleases->setEnabled( false );
+ ui.disallowContentFromOtherSites->setChecked( p.disallowContentFromOtherSites );
+ ui.enableWebPlugins->setChecked( p.enableWebPlugins );
+ ui.hideGoldenDictHeader->setChecked( p.hideGoldenDictHeader );
--
2.34.0
S
S
Sergey Trofimov wrote on 28 Mar 2022 11:46
Package definition updated.
(address . 48909@debbugs.gnu.org)
CAE0nKzXFS9+ZM4CRkU1M61VVNxC=ce_edTesGsEAfbjB-JeC=A@mail.gmail.com
Dear guix maintainers,
I've updated the goldendict package according to the latest guidelines.

Regarding versioning - goldendict team neglects proper versioning for
a long time, not sure that would change any time soon. Here is a
discussion around that:
S
S
Sharlatan Hellseher wrote on 23 Jan 23:30 +0100
[PATCH] gnu: Add goldendict.
(address . 48909@debbugs.gnu.org)
87sf2nn0nr.fsf@gmail.com
Hi,

Porting to QtWebEngine is not initiated yet https://github.com/goldendict/goldendict/issues/1081.

Review in some time when there would be option to build the project
without QtWebKit.

Thanks,
Oleg
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmWwPegACgkQdtcnv/Ys
0rWN/w/9GPjSsKqbyr24JFEmbnXckBF6tHbNMzCyFQ44yEEpWz8v86L0rQNJg2FG
hWOR2QzWAuH+rI/xXxtEQ3wU+F+59x/8RGnvznA/TEB9ekIA3g8M0vf9RT9bdKs9
hSAQ+K+/ygZLaM172vUN6zGTCn/Lmb+zuBHePobv4mVWW0mfXAHWQf1xoueZGRNo
dacDJpqXrQdrxWeXX0bHamoJ7e3dAFtwJxTLQ9w5tWLDSyo7WntIv/D9X9KSn68E
87kBrChGGQHtLzxwaNgZe5EtoUiqNKY4kC+xhbEzifjTw+dSiG+vGG8UtHLp/oo3
mnISZcX0Niz6va6lgPeCZuQV3GhwGJyhTbstQUXvyI26M1aBrsu9ywYlYE6mTyQO
T1wlPKTCV2fIX42d8J+IOBY2clLWJFV7+gkmJKuTKfgOTC/ti0N7LSk1rLs4ZX+h
LlouiWVvUqARc4DzD7739yAH5aSqBxRux+sIu2N2LVp5E/0q/qstBybbKW0inEmo
MlJvOel/fjFNhl/a0Ht9Ra8GZmpbesbML3/UNTwUj/7O7fmGu55uUpjR86X7JHCg
DMfs/FWuXgPQ6XyEmj4uCRSpvtxIbTdBhycGAD2DKEu0/N2JTwY4jNhBxZ2AZfvh
v6UDvU6IepIF/8h3tNmIb+ZbQ1SCvWdgp5LbkLsaBeBz83A6YNQ=
=DmFV
-----END PGP SIGNATURE-----

?