From 583680270594522b0061d8c5a0f13067180de7a8 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Tue, 9 Mar 2021 02:14:56 -0500 Subject: [PATCH 2/3] gnu: Add qtsolutions. * gnu/packages/qt.scm (qtsolutions): New variable. --- gnu/packages/qt.scm | 120 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 11e69ff5db..4ff1e6a005 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -105,6 +105,126 @@ #:use-module (gnu packages xml) #:use-module (srfi srfi-1)) +(define-public qtsolutions + (let ((commit "9568abd142d581b67b86a5f63d823a34b0612702") + (revision "53")) + (package + (name "qtsolutions") + (version + (git-version "0" revision commit)) + (source + (origin + (method git-fetch) + (uri + (git-reference + (url "https://github.com/qtproject/qt-solutions") + (commit commit))) + (file-name + (git-file-name name version)) + (sha256 + (base32 "17fnmassflm3vxi0krpr6fff368jy38cby31a48rban4nqqmgx7n")) + (modules '((guix build utils) + (ice-9 ftw) + (srfi srfi-1))) + (snippet + ;; Unvendor QtLockFile from QtSingleApplication. + `(begin + (with-directory-excursion "qtsingleapplication/src" + (for-each delete-file + (find-files "." "qtlockedfile.*\\.(h|cpp)")) + (substitute* "qtsingleapplication.pri" + ;; Add include path of LockedFile. + (("INCLUDEPATH \\+=") + "INCLUDEPATH += ../../qtlockedfile/src") + ;; Link library of LockedFile. + (("LIBS \\+=") + "LIBS += -lQtSolutions_LockedFile")) + (substitute* '("qtlocalpeer.h" "qtlocalpeer.cpp") + ;; Remove references to deleted LockedFile sources. + (("#include \"qtlockedfile.cpp\"") + "") + (("#include \"qtlockedfile_win.cpp\"") + "") + (("#include \"qtlockedfile_unix.cpp\"") + "") + ;; Fix LockedFile API. + (("QtLP_Private::QtLockedFile") + "QtLockedFile"))) + #t)))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; No target + #:imported-modules + ((guix build copy-build-system) + ,@%gnu-build-system-modules) + #:modules + (((guix build copy-build-system) + #:prefix copy:) + (guix build gnu-build-system) + (guix build utils)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-source + (lambda* (#:key outputs #:allow-other-keys) + (substitute* (find-files "." "common.pri") + ;; Remove prefix in library names. + (("qt5") "qt") + ;; Remove suffix in library names. + (("-head") "")) + ;; Disable building of examples. + (substitute* (find-files "." "\\.pro$") + (("SUBDIRS\\+=examples") "")) + ;; Fix deprecated functions. + (substitute* "qtsoap/src/qtsoap.cpp" + (("toAscii") "toUtf8")) + #t)) + (replace 'configure + (lambda _ + (for-each (lambda (solution) + (with-directory-excursion solution + (invoke "./configure" "-library") + (invoke "qmake"))) + '("qtlockedfile" "qtpropertybrowser" "qtservice" + "qtsingleapplication" "qtsoap")) + #t)) + (replace 'build + (lambda _ + (for-each (lambda (solution) + (with-directory-excursion solution + (invoke "make"))) + '("qtlockedfile" "qtpropertybrowser" "qtservice" + "qtsingleapplication" "qtsoap")) + #t)) + (replace 'install + (lambda args + (for-each (lambda (solution) + (with-directory-excursion solution + (apply (assoc-ref copy:%standard-phases 'install) + #:install-plan + '(("src" "include" + #:include-regexp ("\\.h$")) + ("lib" "lib")) + args))) + '("qtlockedfile" "qtpropertybrowser" "qtservice" + "qtsingleapplication" "qtsoap"))))))) + (inputs + `(("qtbase" ,qtbase))) + (synopsis "Qt Solutions") + (description "QtSolutions are set of components that extends Qt. +@itemize +@item QtLockedFile: A class that extends QFile with advisory locking functions. +@item QtPropertyBrowser: A framework that enables the user to edit a set of +properties. +@item QtService: A component useful for developing Windows services and Unix +daemons. +@item QtSingleApplication: A component that provides support for applications +that can be only started once per user. +@item QtSoap: A component that provides basic web service support with version +1.1 of the SOAP protocol. +@end itemize\n") + (home-page "https://doc.qt.io/archives/qq/qq09-qt-solutions.html") + (license license:lgpl2.1+)))) + (define-public qt5ct (package (name "qt5ct") -- 2.30.1