Archived
1
0
Fork 0

gnu: qtbase: Update to 6.3.1.

* gnu/packages/qt.scm (qtbase): Update to 6.3.1.
[cmake]: Delete commented out argument.
[configure-flags]: Add -DFEATURE_system_xcb_xinput=ON.
[phases]: Use gexps.
{patch-more-paths}: Use search-input-file.  Patch /bin/ls.
{patch-mkspecs}: Use search-input-directory and search-input-file.
[native-inputs]: Rewrite with modify-inputs.  Replace gtk+ with gtk.  Remove
xorg-server-for-tests.
[inputs]: Override field to extend with bash-minimal, libxcb and md4c.
replace gtk+ with gtk.  Use latest postgresql.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
Maxim Cournoyer 2022-07-17 00:35:59 -04:00
parent f6904c0b19
commit 8d7fdbe261
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -19,7 +19,7 @@
;;; Copyright © 2020 TomZ <tomz@freedommail.ch> ;;; Copyright © 2020 TomZ <tomz@freedommail.ch>
;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de> ;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de> ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot> ;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net> ;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2021 Nicolò Balzarotti <nicolo@nixo.xyz> ;;; Copyright © 2021 Nicolò Balzarotti <nicolo@nixo.xyz>
@ -55,6 +55,7 @@
#:use-module (guix deprecation) #:use-module (guix deprecation)
#:use-module (guix utils) #:use-module (guix utils)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages bash)
#:use-module (gnu packages base) #:use-module (gnu packages base)
#:use-module (gnu packages bison) #:use-module (gnu packages bison)
#:use-module (gnu packages cmake) #:use-module (gnu packages cmake)
@ -84,6 +85,7 @@
#:use-module (gnu packages linux) #:use-module (gnu packages linux)
#:use-module (gnu packages llvm) #:use-module (gnu packages llvm)
#:use-module (gnu packages maths) #:use-module (gnu packages maths)
#:use-module (gnu packages markup)
#:use-module (gnu packages networking) #:use-module (gnu packages networking)
#:use-module (gnu packages ninja) #:use-module (gnu packages ninja)
#:use-module (gnu packages nss) #:use-module (gnu packages nss)
@ -548,13 +550,13 @@ developers using C++ or QML, a CSS & JavaScript like language.")
(define-public qtbase (define-public qtbase
(package/inherit qtbase-5 (package/inherit qtbase-5
(name "qtbase") (name "qtbase")
(version "6.1.1") (version "6.3.1")
(source (origin (source (origin
(inherit (package-source qtbase-5)) (inherit (package-source qtbase-5))
(uri (qt5-urls name version)) (uri (qt5-urls name version))
(sha256 (sha256
(base32 (base32
"1wizrfiw6h8bk99brbdpdli40vsk6yqchs66f1r083hp0ygsma11")) "00sfya41ihqb0zwg6wf1kiy02iymj6mk584hhk2c4s94khfl4r0a"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
;; corelib uses bundled harfbuzz, md4, md5, sha3 ;; corelib uses bundled harfbuzz, md4, md5, sha3
@ -573,8 +575,6 @@ developers using C++ or QML, a CSS & JavaScript like language.")
;; enough) or a functional network. It's also quite expensive to ;; enough) or a functional network. It's also quite expensive to
;; build and run. ;; build and run.
((#:tests? _ #f) #f) ((#:tests? _ #f) #f)
;; ((#:cmake _)
;; cmake) ;requires a CMake >= 3.18.4
((#:configure-flags _ ''()) ((#:configure-flags _ ''())
`(let ((out (assoc-ref %outputs "out"))) `(let ((out (assoc-ref %outputs "out")))
(list "-GNinja" ;the build fails otherwise (list "-GNinja" ;the build fails otherwise
@ -600,6 +600,7 @@ developers using C++ or QML, a CSS & JavaScript like language.")
;; cases such as for those below. ;; cases such as for those below.
"-DFEATURE_system_pcre2=ON" "-DFEATURE_system_pcre2=ON"
"-DFEATURE_system_sqlite=ON" "-DFEATURE_system_sqlite=ON"
"-DFEATURE_system_xcb_xinput=ON"
;; Don't use the precompiled headers. ;; Don't use the precompiled headers.
"-DBUILD_WITH_PCH=OFF" "-DBUILD_WITH_PCH=OFF"
;; Drop special machine instructions that do not have runtime ;; Drop special machine instructions that do not have runtime
@ -616,67 +617,79 @@ developers using C++ or QML, a CSS & JavaScript like language.")
"-DFEATURE_mips_dsp=OFF" "-DFEATURE_mips_dsp=OFF"
"-DFEATURE_mips_dspr2=OFF"))) "-DFEATURE_mips_dspr2=OFF")))
((#:phases phases) ((#:phases phases)
`(modify-phases ,phases #~(modify-phases #$phases
(delete 'patch-bin-sh) (delete 'patch-bin-sh)
(delete 'patch-xdg-open) (delete 'patch-xdg-open)
(add-after 'patch-paths 'patch-more-paths (add-after 'patch-paths 'patch-more-paths
(lambda _ (lambda* (#:key inputs #:allow-other-keys)
(substitute* "src/gui/platform/unix/qgenericunixservices.cpp" (substitute* "src/gui/platform/unix/qgenericunixservices.cpp"
(("\"xdg-open\"") (("\"xdg-open\"")
(format #f "~s" (which "xdg-open")))) (format #f "~s" (search-input-file inputs "bin/xdg-open"))))
(substitute* '("mkspecs/features/qt_functions.prf" (substitute* '("mkspecs/features/qt_functions.prf"
"qmake/library/qmakebuiltins.cpp") "qmake/library/qmakebuiltins.cpp")
(("/bin/sh") (("/bin/sh")
(which "sh"))))) (search-input-file inputs "bin/bash")))
(replace 'configure (substitute* "src/corelib/CMakeLists.txt"
(assoc-ref %standard-phases 'configure)) (("/bin/ls")
(replace 'build (search-input-file inputs "bin/ls")))))
(lambda* (#:key parallel-build? #:allow-other-keys) (replace 'configure
(apply invoke "cmake" "--build" "." (assoc-ref %standard-phases 'configure))
(if parallel-build? (replace 'build
`("--parallel" ,(number->string (parallel-job-count))) (lambda* (#:key parallel-build? #:allow-other-keys)
'())))) (apply invoke "cmake" "--build" "."
(replace 'install (if parallel-build?
(lambda _ `("--parallel" ,(number->string (parallel-job-count)))
(invoke "cmake" "--install" "."))) '()))))
(replace 'patch-mkspecs (replace 'install
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let* ((out (assoc-ref outputs "out")) (invoke "cmake" "--install" ".")))
(archdata (string-append out "/lib/qt6")) (replace 'patch-mkspecs
(mkspecs (string-append archdata "/mkspecs")) (lambda* (#:key outputs #:allow-other-keys)
(qt_config.prf (string-append (let* ((archdata (search-input-directory outputs "lib/qt6"))
mkspecs "/features/qt_config.prf"))) (mkspecs (search-input-directory outputs
;; For each Qt module, let `qmake' uses search paths in the "lib/qt6/mkspecs"))
;; module directory instead of all in QT_INSTALL_PREFIX. (qt_config.prf
(substitute* qt_config.prf (search-input-file
(("\\$\\$\\[QT_INSTALL_HEADERS\\]") outputs "lib/qt6/mkspecs/features/qt_config.prf"))
"$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt6))") (qt_functions.prf
(("\\$\\$\\[QT_INSTALL_LIBS\\]") (search-input-file
"$$clean_path($$replace(dir, mkspecs/modules, ../../lib))") outputs "lib/qt6/mkspecs/features/qt_functions.prf")))
(("\\$\\$\\[QT_HOST_LIBS\\]") ;; For each Qt module, let `qmake' uses search paths in the
"$$clean_path($$replace(dir, mkspecs/modules, ../../lib))") ;; module directory instead of all in QT_INSTALL_PREFIX.
(("\\$\\$\\[QT_INSTALL_BINS\\]") (substitute* qt_config.prf
"$$clean_path($$replace(dir, mkspecs/modules, ../../bin))")) (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
"$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt6))")
(("\\$\\$\\[QT_INSTALL_LIBS\\]")
"$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
(("\\$\\$\\[QT_HOST_LIBS\\]")
"$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
(("\\$\\$\\[QT_INSTALL_BINS\\]")
"$$clean_path($$replace(dir, mkspecs/modules, ../../bin))"))
;; Searches Qt tools in the current PATH instead of QT_HOST_BINS. ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS.
(substitute* (string-append mkspecs "/features/qt_functions.prf") (substitute* qt_functions.prf
(("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2") (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2")
"cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})")) "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})"))
;; Resolve qmake spec files within qtbase by absolute paths. ;; Resolve qmake spec files within qtbase by absolute paths.
(substitute* (substitute*
(map (lambda (file) (map (lambda (file)
(string-append mkspecs "/features/" file)) (search-input-file
'("device_config.prf" "moc.prf" "qt_build_config.prf" outputs
"qt_config.prf")) (string-append "lib/qt6/mkspecs/features/" file)))
(("\\$\\$\\[QT_HOST_DATA/get\\]") archdata) '("device_config.prf" "moc.prf" "qt_build_config.prf"
(("\\$\\$\\[QT_HOST_DATA/src\\]") archdata))))))))) "qt_config.prf"))
(("\\$\\$\\[QT_HOST_DATA/get\\]") archdata)
(("\\$\\$\\[QT_HOST_DATA/src\\]") archdata)))))))))
(native-inputs (native-inputs
`(("gtk+" ,gtk+) ;for GTK theme support (modify-inputs (package-native-inputs qtbase-5)
("ninja" ,ninja) (prepend gtk ;for GTK theme support
("wayland-protocols" ,wayland-protocols) ninja wayland-protocols)))
("xorg-server" ,xorg-server-for-tests) (inputs
,@(package-native-inputs qtbase-5))) (modify-inputs (package-inputs qtbase-5)
(prepend bash-minimal libxcb md4c)
(replace "gtk+" gtk) ;use latest gtk
(replace "postgresql" postgresql))) ;use latest postgresql
(native-search-paths (native-search-paths
(list (search-path-specification (list (search-path-specification
(variable "QMAKEPATH") (variable "QMAKEPATH")