packages: dictionaries: Set PKG_CONFIG_PATH env var instead of patching headers in goldendict-ng package definition

This commit is contained in:
Luis Guilherme Coelho 2024-07-31 22:20:33 -03:00
parent 78d4627b8d
commit 45990d1fe5
Signed by: anemofilia
GPG key ID: 1F2E76ACE3F531C8

View file

@ -63,41 +63,26 @@
(base32 "0li7zvxivgyffjm4gjlaw8syyqiaczn3778q1rl2ncp9l8008gxp")))) (base32 "0li7zvxivgyffjm4gjlaw8syyqiaczn3778q1rl2ncp9l8008gxp"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
(list (list #:tests? #f
#:make-flags #~(list "-j" "7") #:cmake cmake
#:cmake cmake #:make-flags
#:tests? #f #~(list "-j" "7")
#:configure-flags #:configure-flags
#~(list "-DCMAKE_BUILD_TYPE=Release") #~(list "-DCMAKE_BUILD_TYPE=Release"
#:phases (string-append "PKG_CONFIG_PATH="
#~(modify-phases %standard-phases #$(this-package-input "qtbase")
(add-after 'unpack 'absolutize-qt-headers "/include/qt6/QtPrintSupport"))
(lambda _ #:phases
(let ((qtbase-file #~(modify-phases %standard-phases
(lambda (path) (add-after 'wrap 'wrap-qt-process-path
(string-append "\"" #$qtbase path "\"")))) (lambda* (#:key inputs outputs #:allow-other-keys)
(substitute* "src/ui/mainwindow.cc" (wrap-program (search-input-file outputs "bin/goldendict")
(("<QPrinter>") `("QTWEBENGINE_RESOURCES_PATH" =
(qtbase-file (,(search-input-directory
"/include/qt6/QtPrintSupport/QPrinter")) inputs "/share/qt6/resources")))
(("<QPageSetupDialog>") `("QTWEBENGINEPROCESS_PATH" =
(qtbase-file (,(search-input-file
"/include/qt6/QtPrintSupport/QPageSetupDialog")) inputs "/lib/qt6/libexec/QtWebEngineProcess")))))))))
(("<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 (native-inputs
(list hunspell (list hunspell
icu4c icu4c