unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Raghav Gururajan <rg@raghavgururajan.name>
To: help-guix@gnu.org
Subject: Help with copy-build-system
Date: Wed, 10 Mar 2021 06:23:19 -0500	[thread overview]
Message-ID: <63c41e90-0fbb-08fa-b22a-9d5046b04aa9@raghavgururajan.name> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 260 bytes --]

Hello Guix!

With the attached patch (top be applied on top-off current master), how 
to make copy-build-system to install files as `/bin/foofile` instead of 
`/bin/foodir/foofile`? (The foofiles are selected via #:include)

Thank you!

Regards,
RG.

[-- Attachment #1.1.2: qtsol.diff --]
[-- Type: text/x-patch, Size: 5149 bytes --]

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")))))))

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

             reply	other threads:[~2021-03-10 11:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 11:23 Raghav Gururajan [this message]
2021-03-26  9:20 ` Help with copy-build-system Pierre Neidhardt
2021-03-26  9:55   ` Raghav Gururajan
2021-03-26 11:11     ` Pierre Neidhardt
2021-03-26 11:53       ` Raghav Gururajan
2021-03-26 12:12         ` Pierre Neidhardt
2021-03-26 12:28           ` Raghav Gururajan
  -- strict thread matches above, loose matches on Subject: below --
2020-12-24  2:30 Cameron
2020-12-23 23:23 help " Cameron
2020-12-24 12:07 ` Julien Lepiller
2020-12-24 18:00   ` Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63c41e90-0fbb-08fa-b22a-9d5046b04aa9@raghavgururajan.name \
    --to=rg@raghavgururajan.name \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).