gnu: Add qtsolutions.

* gnu/packages/qt.scm (qtsolutions): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
This commit is contained in:
Raghav Gururajan 2021-03-09 02:14:56 -05:00 committed by Leo Prikler
parent afd83de087
commit 92a432c1f8
No known key found for this signature in database
GPG key ID: 442A84B8C70E2F87

View file

@ -2473,6 +2473,117 @@ (define-public qtkeychain
securely. It will not store any data unencrypted unless explicitly requested.") securely. It will not store any data unencrypted unless explicitly requested.")
(license license:bsd-3))) (license license:bsd-3)))
(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")
(("#include \"qtlockedfile.*\\.cpp\"") "")
;; Unwrap namespace added in the vendoring process.
(("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 unnecessary prefixes/suffixes in library names.
(("qt5") "qt")
(("-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 "Collection of Qt extensions")
(description "QtSolutions is a set of components extending 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 helper for writing services such as 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 (list license:bsd-3
;; QScriptParser and QScriptGrammar specifically allow
;; redistribution under GPL3 or LGPL2.1
license:gpl3 license:lgpl2.1)))))
(define-public qwt (define-public qwt
(package (package
(name "qwt") (name "qwt")