From d6014986ac4b815ff2b4ba0f93ff410b12044c77 Mon Sep 17 00:00:00 2001 From: Luis Guilherme Coelho Date: Sun, 4 Feb 2024 16:08:53 -0300 Subject: [PATCH] packages: dictionaries: Add goldendict-ng --- ajatt/packages/dictionaries.scm | 124 ++++++++++++++++++++++++++++++++ ajatt/packages/qt.scm | 43 +++++++++++ 2 files changed, 167 insertions(+) create mode 100644 ajatt/packages/dictionaries.scm create mode 100644 ajatt/packages/qt.scm diff --git a/ajatt/packages/dictionaries.scm b/ajatt/packages/dictionaries.scm new file mode 100644 index 0000000..d78e12c --- /dev/null +++ b/ajatt/packages/dictionaries.scm @@ -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" + (("") + (qtbase-file + "/include/qt6/QtPrintSupport/QPrinter")) + (("") + (qtbase-file + "/include/qt6/QtPrintSupport/QPageSetupDialog")) + (("") + (qtbase-file + "/include/qt6/QtPrintSupport/QPrintPreviewDialog")) + (("") + (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)))) diff --git a/ajatt/packages/qt.scm b/ajatt/packages/qt.scm new file mode 100644 index 0000000..921aeb2 --- /dev/null +++ b/ajatt/packages/qt.scm @@ -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.")))