packages: dictionaries: Add goldendict-ng

keyring
Luis Guilherme Coelho 2024-02-04 16:08:53 -03:00
parent ff8a0d4099
commit d6014986ac
No known key found for this signature in database
GPG Key ID: 1F2E76ACE3F531C8
2 changed files with 167 additions and 0 deletions

View File

@ -0,0 +1,124 @@
(define-module (ajatt packages dictionaries)
#:use-module (gnu packages cmake)
#:use-module (gnu packages compression)
#:use-module (gnu packages dictionaries)
#:use-module (gnu packages education)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages gstreamer)
#:use-module (gnu packages hunspell)
#:use-module (gnu packages icu4c)
#:use-module (gnu packages image)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages qt)
#:use-module (gnu packages search)
#:use-module (gnu packages textutils)
#:use-module (gnu packages version-control)
#:use-module (gnu packages video)
#:use-module (gnu packages vulkan)
#:use-module (gnu packages web)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xiph)
#:use-module (gnu packages xorg)
#:use-module (guix build-system cmake)
#:use-module (guix gexp)
#:use-module (guix utils)
#:use-module (guix git-download)
#:use-module (guix packages)
#:use-module (ajatt packages qt)
#:use-module ((guix licenses) #:prefix license:))
(define-public goldendict-ng
(package
(name "goldendict-ng")
(version "24.01.27")
(source
(origin
(method git-fetch)
(uri
(git-reference
(url "https://github.com/xiaoyifang/goldendict-ng.git")
(commit "92ad684d52526dc3f84a32dac5d14e60973aa663")))
(sha256
(base32 "0r8hl5p4r369024dhf58md0k1776sbxg6yxqzhws6x257wc91bkh"))))
(build-system cmake-build-system)
(arguments
(list #:cmake cmake
#:tests? #f
#:configure-flags
#~(list "-DCMAKE_BUILD_TYPE=Release"
"-DMULTITHREADED_BUILD=8") ;; To avoid freezing the build
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'absolutize-qt-headers
(lambda _
(let ((qtbase-file
(lambda (path)
(string-append "\"" #$qtbase path "\""))))
(substitute* "src/ui/mainwindow.cc"
(("<QPrinter>")
(qtbase-file
"/include/qt6/QtPrintSupport/QPrinter"))
(("<QPageSetupDialog>")
(qtbase-file
"/include/qt6/QtPrintSupport/QPageSetupDialog"))
(("<QPrintPreviewDialog>")
(qtbase-file
"/include/qt6/QtPrintSupport/QPrintPreviewDialog"))
(("<QPrintDialog>")
(qtbase-file
"/include/qt6/QtPrintSupport/QPrintDialog"))))))
(add-after 'wrap 'wrap-qt-process-path
(lambda* (#:key inputs outputs #:allow-other-keys)
(wrap-program (search-input-file outputs "bin/goldendict")
`("QTWEBENGINE_RESOURCES_PATH" =
(,(search-input-directory
inputs "/share/qt6/resources")))
`("QTWEBENGINEPROCESS_PATH" =
(,(search-input-file
inputs "/lib/qt6/libexec/QtWebEngineProcess")))))))))
(native-inputs
(list hunspell
icu4c
libeb
libtiff
libvorbis
libxkbcommon
libxkbfile
libxtst
libzim
lzo
opencc
pkg-config
qt5compat
gstreamer
qtspeech
qtsvg
qttools
qtwebview
qtx11extras
vulkan-headers
(list xz "static")
zlib
(list zstd "lib")))
(inputs
(list ao
bzip2
ffmpeg
xapian
qtmultimedia
qtwebengine
gstreamer
qtbase
xproto))
(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
(list license:gpl3+
license:zlib))))

43
ajatt/packages/qt.scm Normal file
View File

@ -0,0 +1,43 @@
(define-module (ajatt packages qt)
#:use-module (gnu packages perl)
#:use-module (gnu packages qt)
#:use-module (guix build-system qt)
#:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (guix search-paths)
#:use-module ((guix licenses) #:prefix license:))
(define qt-url
(@@ (gnu packages qt) qt-url))
(define-public qtspeech
(package
(inherit qtsvg)
(name "qtspeech")
(version "6.5.2")
(source (origin
(method url-fetch)
(uri (qt-url name version))
(sha256
(base32
"1cnlc9x0wswzl7j2imi4kvs9zavs4z1mhzzfpwr6d9zlfql9rzw8"))))
(arguments
(list
#:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
#:phases
#~(modify-phases %standard-phases
(add-before 'check 'set-display
(lambda _
;; Make Qt render "offscreen", required for tests.
(setenv "QT_QPA_PLATFORM" "offscreen"))))))
(inputs (list qtbase))
(native-inputs (list perl qtdeclarative qtmultimedia qtxmlpatterns))
(synopsis "Qt Speech module")
(description "The Qt Speech module enables a Qt application to support
accessibility features such as text-to-speech, which is useful for end-users
who are visually challenged or cannot access the application for whatever
reason. The most common use case where text-to-speech comes in handy is when
the end-user is driving and cannot attend the incoming messages on the phone.
In such a scenario, the messaging application can read out the incoming
message.")))