gnu: extra-cmake-modules: Update to 5.91.0.

* gnu/packages/kde-frameworks.scm (extra-cmake-modules): Update to 5.91.0.
Fix the indentation.
[native-inputs]: Use label-less input style.
[arguments]: Use G-expresssions.
<phases>: In phase 'fix-lib-path', use QT_MAJOR_VERSION to determine the
installation path, Fix the compatibility with different Qt version.
Add phase 'fix-test' to workaround with the broken KDEFetchTranslations test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Zhu Zihao 2022-05-02 22:25:01 +08:00 committed by Ludovic Courtès
parent 666b29e729
commit 6c777feb3e
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -87,7 +87,7 @@
(define-public extra-cmake-modules (define-public extra-cmake-modules
(package (package
(name "extra-cmake-modules") (name "extra-cmake-modules")
(version "5.70.0") (version "5.91.0")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append (uri (string-append
@ -96,7 +96,7 @@
name "-" version ".tar.xz")) name "-" version ".tar.xz"))
(sha256 (sha256
(base32 (base32
"10c5xs5shk0dcshpdxg564ay5y8hgmvfvmlhmhjf0dy79kcah3c3")))) "0k65rvxh926ya6qahzk2ns7g1fya1429648mlx7iipxa61g8h5wp"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(native-inputs (native-inputs
;; Add test dependency, except on armhf where building it is too ;; Add test dependency, except on armhf where building it is too
@ -104,39 +104,55 @@
(if (and (not (%current-target-system)) (if (and (not (%current-target-system))
(string=? (%current-system) "armhf-linux")) (string=? (%current-system) "armhf-linux"))
'() '()
`(("qtbase" ,qtbase-5)))) ;for tests (needs qmake) (list qtbase-5))) ;for tests (needs qmake)
(arguments (arguments
`(#:tests? ,(and (not (%current-target-system)) (list
(not (null? (package-native-inputs this-package)))) #:tests? (and (not (%current-target-system))
#:phases (not (null? (package-native-inputs this-package))))
(modify-phases %standard-phases #:phases
(add-after 'unpack 'fix-lib-path #~(modify-phases %standard-phases
(lambda _ (add-after 'unpack 'fix-lib-path
;; Always install into /lib and not into /lib64. (lambda _
(substitute* "kde-modules/KDEInstallDirs.cmake" ;; Always install into /lib and not into /lib64.
(("\"lib64\"") "\"lib\"") (substitute* "kde-modules/KDEInstallDirsCommon.cmake"
;; TODO: Base the following on values taken from Qt (("\"lib64\"") "\"lib\""))
;; Install plugins into lib/qt5/plugins
;; TODO: Check if this is okay for Android, too ;; Determine the install path by the major version of Qt.
;; (see comment in KDEInstallDirs.cmake) ;; TODO: Base the following on values taken from Qt
(("_define_relative\\(QTPLUGINDIR \"\\$\\{_pluginsDirParent}\" \"plugins\"") ;; Install plugins into lib/qt5/plugins
"_define_relative(QTPLUGINDIR \"${_pluginsDirParent}\" \"qt5/plugins\"") ;; TODO: Check if this is okay for Android, too
;; Install imports into lib/qt5/imports ;; (see comment in KDEInstallDirs.cmake)
(("_define_relative\\(QTQUICKIMPORTSDIR QTPLUGINDIR \"imports\"") (substitute* '("kde-modules/KDEInstallDirs5.cmake"
"_define_relative(QTQUICKIMPORTSDIR LIBDIR \"qt5/imports\"") "kde-modules/KDEInstallDirs6.cmake")
;; Install qml-files into lib/qt5/qml ;; Fix the installation path of Qt plugins.
(("_define_relative\\(QMLDIR LIBDIR \"qml\"") (("_define_relative\\(QTPLUGINDIR \"\\$\\{_pluginsDirParent}\" \"plugins\"")
"_define_relative(QMLDIR LIBDIR \"qt5/qml\"")) "_define_relative(QTPLUGINDIR \"${_pluginsDirParent}\" \"qt${QT_MAJOR_VERSION}/plugins\"")
(substitute* "modules/ECMGeneratePriFile.cmake" ;; Fix the installation path of QML files.
;; Install pri-files into lib/qt5/mkspecs (("_define_relative\\(QMLDIR LIBDIR \"qml\"")
(("set\\(ECM_MKSPECS_INSTALL_DIR mkspecs/modules") "_define_relative(QMLDIR LIBDIR \"qt${QT_MAJOR_VERSION}/qml\""))
"set(ECM_MKSPECS_INSTALL_DIR lib/qt5/mkspecs/modules"))
#t)) ;; Qt Quick Control 1 is no longer available in Qt 6.
;; install and check phase are swapped to prevent install from failing (substitute* '("kde-modules/KDEInstallDirs5.cmake")
;; after testsuire has run (("_define_relative\\(QTQUICKIMPORTSDIR QTPLUGINDIR \"imports\"")
(add-after 'install 'check-post-install "_define_relative(QTQUICKIMPORTSDIR LIBDIR \"qt5/imports\""))
(assoc-ref %standard-phases 'check))
(delete 'check)))) (substitute* "modules/ECMGeneratePriFile.cmake"
;; Install pri-files into lib/qt${QT_MAJOR_VERSION}/mkspecs
(("set\\(ECM_MKSPECS_INSTALL_DIR mkspecs/modules")
"set(ECM_MKSPECS_INSTALL_DIR lib/qt${QT_MAJOR_VERSION}/mkspecs/modules"))))
;; Work around for the failed test KDEFetchTranslations.
;; It complains that the cmake project name is not
;; "frameworks/extra-cmake-modules".
;; TODO: Fix it upstream.
(add-after 'unpack 'fix-test
(lambda _
(substitute* "tests/KDEFetchTranslations/CMakeLists.txt"
(("frameworks/extra-cmake-modules") "extra-cmake-modules"))))
;; install and check phase are swapped to prevent install from failing
;; after testsuire has run
(add-after 'install 'check-post-install
(assoc-ref %standard-phases 'check))
(delete 'check))))
;; optional dependencies - to save space, we do not add these inputs. ;; optional dependencies - to save space, we do not add these inputs.
;; Sphinx > 1.2: ;; Sphinx > 1.2:
;; Required to build Extra CMake Modules documentation in Qt Help format. ;; Required to build Extra CMake Modules documentation in Qt Help format.