Archived
1
0
Fork 0

gnu: qtpass: Switch to qt-build-system and new package style.

* gnu/packages/password-utils.scm (qtpass): Use qt-build-system.
[arguments]: Drop 'wrap-qt and 'check-setup phases. Drop the unnecessary
'reset-resource-timestamps phase. Use new package style for remaining phases.
[inputs]: Drop qtbase-5.

Change-Id: I23a0b8dfd1fdfeca343704d3df084c522b319d30
Signed-off-by: Christopher Baines <mail@cbaines.net>
This commit is contained in:
Timotej Lazar 2024-02-07 22:23:34 +01:00 committed by Christopher Baines
parent 4f9ea64b5f
commit 608b9a1c86
No known key found for this signature in database
GPG key ID: 5E28A33B0B84F577

View file

@ -862,63 +862,36 @@ key URIs using the standard otpauth:// scheme.")
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 "10ixahm4ap0l1rrz4cyswblm22ns9z1baf5lv3dn23wprfdcp8m0")))) (base32 "10ixahm4ap0l1rrz4cyswblm22ns9z1baf5lv3dn23wprfdcp8m0"))))
(build-system gnu-build-system) (build-system qt-build-system)
(arguments (arguments
`(#:modules ((guix build gnu-build-system) (list
(guix build qt-utils) #:test-target "check"
(guix build utils)) #:phases
#:imported-modules (,@%gnu-build-system-modules #~(modify-phases %standard-phases
(guix build qt-utils)) (replace 'configure
#:phases (lambda _
(modify-phases %standard-phases (invoke "qmake"
(replace 'configure "QMAKE_LRELEASE=lrelease"
(lambda* (#:key inputs outputs #:allow-other-keys) "QMAKE_LUPDATE=lupdate"
(let ((out (assoc-ref outputs "out"))) (string-append "PREFIX=" #$output))))
;; lupdate/lrelease need to find qmake. (add-before 'check 'pre-check
(setenv "QMAKE" "qmake") ;; Fontconfig needs a writable cache.
;; qmake needs to find lrelease/lupdate. (lambda _ (setenv "HOME" "/tmp")))
(invoke "qmake" (add-after 'install 'install-auxilliary
"QMAKE_LRELEASE=lrelease" ;; Install man-page, icon and .desktop file.
"QMAKE_LUPDATE=lupdate" (lambda _
(string-append "PREFIX=" out))))) (let ((applications (string-append #$output "/share/applications"))
(add-after 'configure 'reset-resource-timestamps (icons (string-append #$output "/share/icons/hicolor/scalable/apps"))
;; Reset timestamps on localization files for a reproducible build. (man (string-append #$output "/share/man/man1")))
(lambda _ (install-file "qtpass.desktop" applications)
(with-directory-excursion "localization" (install-file "artwork/icon.svg" icons)
(for-each (lambda (file) (rename-file (string-append icons "/icon.svg")
(let* ((base (basename file ".qm")) (string-append icons "/qtpass-icon.svg"))
(src (string-append base ".ts")) (install-file "qtpass.1" man)))))))
(st (stat src)))
(set-file-time file st)))
(find-files "." ".*\\.qm")))
#t))
(add-after 'install 'install-auxilliary
;; Install man-page, icon and .desktop file.
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(applications (string-append out "/share/applications"))
(icons (string-append out "/share/icons/hicolor/scalable/apps"))
(man (string-append out "/share/man/man1")))
(install-file "qtpass.desktop" applications)
(install-file "artwork/icon.svg" icons)
(rename-file (string-append icons "/icon.svg")
(string-append icons "/qtpass-icon.svg"))
(install-file "qtpass.1" man)
#t)))
(add-after 'install 'wrap-qt
(lambda* (#:key outputs inputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(wrap-qt-program "qtpass" #:output out #:inputs inputs))
#t))
(add-before 'check 'check-setup
;; Make Qt render "offscreen", required for tests.
(lambda _
(setenv "QT_QPA_PLATFORM" "offscreen")
#t)))))
(native-inputs (native-inputs
(list qttools-5)) (list qttools-5))
(inputs (inputs
(list qtbase-5 qtsvg-5)) (list qtsvg-5))
(home-page "https://qtpass.org") (home-page "https://qtpass.org")
(synopsis "GUI for password manager password-store") (synopsis "GUI for password manager password-store")
(description (description