* [bug#47042] gnu: qtsolutions: Enable examples.
@ 2021-03-10 11:09 Raghav Gururajan via Guix-patches via
2021-03-10 12:58 ` Leo Prikler
0 siblings, 1 reply; 6+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2021-03-10 11:09 UTC (permalink / raw)
To: 47042; +Cc: Leo Prikler
[-- Attachment #1.1.1: Type: text/plain, Size: 394 bytes --]
Hi Leo!
Currently with this patch, we have following issues:
[1] When examples are enabled for QtSingleApplication, it doesn't get
linked to QtLockFile. (Try building without `;; Disable building of
examples for QtSingleApplication.` block)
[2] For installation of examples, the binaries get installed in sub-dirs
as `/bin/foo` instead of `/bin`.
Any ideas?
Regards,
RG.
[-- Attachment #1.1.2: 0001-gnu-qtsolutions-Enable-examples.patch --]
[-- Type: text/x-patch, Size: 5605 bytes --]
From a1507241c457b9ee3d1474b71849112637a3c6a2 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 10 Mar 2021 03:09:38 -0500
Subject: [PATCH] gnu: qtsolutions: Enable examples.
* gnu/packages/qt.scm (qtsolutions) [arguments]: Modify phases
'patch-source and 'install.
---
gnu/packages/qt.scm | 62 ++++++++++++++++++++++++++++++++-------------
1 file changed, 44 insertions(+), 18 deletions(-)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index d921aa87fe..8409fc1803 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -2497,18 +2497,18 @@ securely. It will not store any data unencrypted unless explicitly requested.")
(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")))
+ (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
@@ -2524,16 +2524,32 @@ securely. It will not store any data unencrypted unless explicitly requested.")
(modify-phases %standard-phases
(add-after 'unpack 'patch-source
(lambda* (#:key outputs #:allow-other-keys)
+ ;; Rename example to examples, in qtlockedfile,
+ ;; so that it gets picked up during install phase.
+ (with-directory-excursion "qtlockedfile"
+ (rename-file "example" "examples")
+ (rename-file "examples/example.pro" "examples/examples.pro")
+ (substitute* "qtlockedfile.pro"
+ (("SUBDIRS\\+=example") "SUBDIRS+=examples")))
(substitute* (find-files "." "common.pri")
+ ;; Patch run-path for binaries.
+ (("QMAKE_RPATHDIR \\+= \\$\\$?.*_LIBDIR")
+ (string-append "QMAKE_RPATHDIR += "
+ (assoc-ref outputs "out") "/lib"))
;; Remove unnecessary prefixes/suffixes in library names.
(("qt5") "qt")
(("-head") ""))
- ;; Disable building of examples.
- (substitute* (find-files "." "\\.pro$")
+ ;; Disable building of examples for QtSingleApplication.
+ (substitute* "qtsingleapplication/qtsingleapplication.pro"
(("SUBDIRS\\+=examples") ""))
- ;; Fix deprecated functions.
- (substitute* "qtsoap/src/qtsoap.cpp"
- (("toAscii") "toUtf8"))
+ (with-directory-excursion "qtsoap/src"
+ ;; Patch Qt imports for QtSoap.
+ (substitute* "qtsoap.pri"
+ (("QT \\+= xml network")
+ "QT += core gui widgets xml network"))
+ ;; Fix deprecated functions.
+ (substitute* "qtsoap.cpp"
+ (("toAscii") "toUtf8")))
#t))
(replace 'configure
(lambda _
@@ -2560,7 +2576,17 @@ securely. It will not store any data unencrypted unless explicitly requested.")
(assoc-ref copy:%standard-phases 'install)
#:install-plan
'(("src" "include" #:include-regexp ("\\.h$"))
- ("lib" "lib"))
+ ("lib" "lib")
+ ("examples" "bin"
+ #:include ("examples" "canvas_typed"
+ "canvas_variant" "decoration"
+ "demo" "extension"
+ "object_controller" "simple"
+ "controller" "interactive"
+ "httpservice" "console"
+ "loader" "trivial"
+ "easter" "google"
+ "population")))
args)))
'("qtlockedfile" "qtpropertybrowser" "qtservice"
"qtsingleapplication" "qtsoap")))))))
--
2.30.1
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [bug#47042] gnu: qtsolutions: Enable examples.
2021-03-10 11:09 [bug#47042] gnu: qtsolutions: Enable examples Raghav Gururajan via Guix-patches via
@ 2021-03-10 12:58 ` Leo Prikler
2021-03-10 14:49 ` Raghav Gururajan via Guix-patches via
0 siblings, 1 reply; 6+ messages in thread
From: Leo Prikler @ 2021-03-10 12:58 UTC (permalink / raw)
To: Raghav Gururajan, 47042
Am Mittwoch, den 10.03.2021, 06:09 -0500 schrieb Raghav Gururajan:
> Hi Leo!
>
> Currently with this patch, we have following issues:
>
> [1] When examples are enabled for QtSingleApplication, it doesn't
> get
> linked to QtLockFile. (Try building without `;; Disable building of
> examples for QtSingleApplication.` block)
Then I guess we have to rewrite that Makefile (or pseudo-Makefile) in
the snippet as well?
> [2] For installation of examples, the binaries get installed in sub-
> dirs
> as `/bin/foo` instead of `/bin`.
I don't think the compiled examples need to be installed at all –
rather their source code etc. should be installed to share/doc (in a
qtsolutions subfolder of course). The act of compiling them is merely
a check, that they (plus the code they are an example of) "work as
intended" or at least compile as intended.
If I read your patch correctly, I made an indentation mistake during
the review process, is that correct?
Regards,
Leo
^ permalink raw reply [flat|nested] 6+ messages in thread
* [bug#47042] gnu: qtsolutions: Enable examples.
2021-03-10 12:58 ` Leo Prikler
@ 2021-03-10 14:49 ` Raghav Gururajan via Guix-patches via
2021-03-10 15:00 ` Raghav Gururajan via Guix-patches via
0 siblings, 1 reply; 6+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2021-03-10 14:49 UTC (permalink / raw)
To: Leo Prikler, 47042
[-- Attachment #1.1: Type: text/plain, Size: 599 bytes --]
Hi Leo!
> Then I guess we have to rewrite that Makefile (or pseudo-Makefile) in
> the snippet as well?
>
> I don't think the compiled examples need to be installed at all –
> rather their source code etc. should be installed to share/doc (in a
> qtsolutions subfolder of course). The act of compiling them is merely
> a check, that they (plus the code they are an example of) "work as
> intended" or at least compile as intended.
Never mind this patch then. I started working on this, thinking that
example binaries might be useful. So I'll close this report.
Regards,
RG.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [bug#47042] gnu: qtsolutions: Enable examples.
2021-03-10 14:49 ` Raghav Gururajan via Guix-patches via
@ 2021-03-10 15:00 ` Raghav Gururajan via Guix-patches via
2021-03-10 15:15 ` Leo Prikler
0 siblings, 1 reply; 6+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2021-03-10 15:00 UTC (permalink / raw)
To: Leo Prikler, 47042
[-- Attachment #1.1.1: Type: text/plain, Size: 728 bytes --]
Hi Leo!
>> Then I guess we have to rewrite that Makefile (or pseudo-Makefile) in
>> the snippet as well?
>>
>> I don't think the compiled examples need to be installed at all –
>> rather their source code etc. should be installed to share/doc (in a
>> qtsolutions subfolder of course). The act of compiling them is merely
>> a check, that they (plus the code they are an example of) "work as
>> intended" or at least compile as intended.
>
> Never mind this patch then. I started working on this, thinking that
> example binaries might be useful. So I'll close this report.
FWIW, can you merge the attached patch please? It enables building of
examples, except for qtsingleapplication.
Regards,
RG.
[-- Attachment #1.1.2: 0001-gnu-qtsolutions-Enable-building-of-examples-except-f.patch --]
[-- Type: text/x-patch, Size: 3480 bytes --]
From c722c494d2a210b53bf869a874dbc7237bf64920 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 10 Mar 2021 03:09:38 -0500
Subject: [PATCH] gnu: qtsolutions: Enable building of examples, except for
qtsingleapplication.
* gnu/packages/qt.scm (qtsolutions) [arguments]: Modify phase 'patch-source.
---
gnu/packages/qt.scm | 39 ++++++++++++++++++++++-----------------
1 file changed, 22 insertions(+), 17 deletions(-)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index d921aa87fe..f3b2c5e8ed 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -2497,18 +2497,18 @@ securely. It will not store any data unencrypted unless explicitly requested.")
(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")))
+ (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
@@ -2528,12 +2528,17 @@ securely. It will not store any data unencrypted unless explicitly requested.")
;; Remove unnecessary prefixes/suffixes in library names.
(("qt5") "qt")
(("-head") ""))
- ;; Disable building of examples.
- (substitute* (find-files "." "\\.pro$")
+ ;; Disable building of examples for QtSingleApplication.
+ (substitute* "qtsingleapplication/qtsingleapplication.pro"
(("SUBDIRS\\+=examples") ""))
- ;; Fix deprecated functions.
- (substitute* "qtsoap/src/qtsoap.cpp"
- (("toAscii") "toUtf8"))
+ (with-directory-excursion "qtsoap/src"
+ ;; Patch Qt imports for QtSoap.
+ (substitute* "qtsoap.pri"
+ (("QT \\+= xml network")
+ "QT += core gui widgets xml network"))
+ ;; Fix deprecated functions.
+ (substitute* "qtsoap.cpp"
+ (("toAscii") "toUtf8")))
#t))
(replace 'configure
(lambda _
--
2.30.1
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [bug#47042] gnu: qtsolutions: Enable examples.
2021-03-10 15:00 ` Raghav Gururajan via Guix-patches via
@ 2021-03-10 15:15 ` Leo Prikler
2021-03-10 15:28 ` Raghav Gururajan via Guix-patches via
0 siblings, 1 reply; 6+ messages in thread
From: Leo Prikler @ 2021-03-10 15:15 UTC (permalink / raw)
To: Raghav Gururajan, 47042
Am Mittwoch, den 10.03.2021, 10:00 -0500 schrieb Raghav Gururajan:
> Hi Leo!
>
> > > Then I guess we have to rewrite that Makefile (or pseudo-
> > > Makefile) in
> > > the snippet as well?
> > >
> > > I don't think the compiled examples need to be installed at all –
> > > rather their source code etc. should be installed to share/doc
> > > (in a
> > > qtsolutions subfolder of course). The act of compiling them is
> > > merely
> > > a check, that they (plus the code they are an example of) "work
> > > as
> > > intended" or at least compile as intended.
> >
> > Never mind this patch then. I started working on this, thinking
> > that
> > example binaries might be useful. So I'll close this report.
>
> FWIW, can you merge the attached patch please? It enables building
> of
> examples, except for qtsingleapplication.
I don't think the problem with disabling examples is bad enough to
warrant this kind of "hot fix". I'd rather patch in all examples at
once if that's possible.
Regards,
Leo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-03-10 15:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-10 11:09 [bug#47042] gnu: qtsolutions: Enable examples Raghav Gururajan via Guix-patches via
2021-03-10 12:58 ` Leo Prikler
2021-03-10 14:49 ` Raghav Gururajan via Guix-patches via
2021-03-10 15:00 ` Raghav Gururajan via Guix-patches via
2021-03-10 15:15 ` Leo Prikler
2021-03-10 15:28 ` Raghav Gururajan via Guix-patches via
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).