(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 "https://xiaoyifang.github.io/goldendict-ng/") (license (list license:gpl3+ license:zlib))))