[PATCH] Add qtbase-patched. (Fix QTBUG-81715)

  • Done
  • quality assurance status badge
Details
2 participants
  • John Soo
  • Marius Bakke
Owner
unassigned
Submitted by
John Soo
Severity
normal

Debbugs page

John Soo wrote 5 years ago
(address . guix-patches@gnu.org)
CAKf5CqV-R5atuN58O_R+Jt2WK0JwSbY9cYPc=39u2VG8iYfccQ@mail.gmail.com
Hi Guix,

There is a known issue in qtbase 5.12.7 where the cmake macros shipped
with qt do not work when paths include dots. This broke freecad and
maybe others.

I am not sure how to figure out other broken packages, if they need to
use the patched-qtbase.

Thanks,

John
From f4785d7f301d0e199e6a2f52c64fc570c2a43de3 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Fri, 21 Feb 2020 21:13:47 -0800
Subject: [PATCH 1/4] gnu: Add qtbase-QTBUG-81715.patch. Fixes [QTBUG-81715].

* gnu/packages/patches/qtbase-QTBUG-81715.patch: Add it.
---
gnu/packages/patches/qtbase-QTBUG-81715.patch | 40 +++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 gnu/packages/patches/qtbase-QTBUG-81715.patch

Toggle diff (48 lines)
diff --git a/gnu/packages/patches/qtbase-QTBUG-81715.patch b/gnu/packages/patches/qtbase-QTBUG-81715.patch
new file mode 100644
index 0000000000..70b83b97d2
--- /dev/null
+++ b/gnu/packages/patches/qtbase-QTBUG-81715.patch
@@ -0,0 +1,40 @@
+From 8a3fde00bf53d99e9e4853e8ab97b0e1bcf74915 Mon Sep 17 00:00:00 2001
+From: Joerg Bornemann <joerg.bornemann@qt.io>
+Date: Wed, 29 Jan 2020 11:06:35 +0100
+Subject: [PATCH] Fix qt5_make_output_file macro for paths containing dots
+
+Commit 89bd5a7e broke CMake projects that use dots in their build
+paths, because the used regular expression matches the directory part
+of the path as well.
+
+The regex wants to achieve the same as get_filename_component(...
+NAME_WLE) which is available since CMake 3.14. Re-implement the
+NAME_WLE functionality for older CMake versions by using multiple
+get_filename_component calls.
+
+Fixes: QTBUG-81715
+Task-number: QTBUG-80295
+Change-Id: I2ef053300948f6e1b2c0c5eafac35105f193d4e6
+Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
+---
+
+diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
+index 7735e51..b3da640 100644
+--- a/src/corelib/Qt5CoreMacros.cmake
++++ b/src/corelib/Qt5CoreMacros.cmake
+@@ -59,7 +59,14 @@
+ set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
+ string(REPLACE ".." "__" _outfile ${_outfile})
+ get_filename_component(outpath ${_outfile} PATH)
+- string(REGEX REPLACE "\\.[^.]*$" "" _outfile ${_outfile})
++ if(CMAKE_VERSION VERSION_LESS "3.14")
++ get_filename_component(_outfile_ext ${_outfile} EXT)
++ get_filename_component(_outfile_ext ${_outfile_ext} NAME_WE)
++ get_filename_component(_outfile ${_outfile} NAME_WE)
++ string(APPEND _outfile ${_outfile_ext})
++ else()
++ get_filename_component(_outfile ${_outfile} NAME_WLE)
++ endif()
+ file(MAKE_DIRECTORY ${outpath})
+ set(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
+ endmacro()
--
2.25.1
From 46804c5d85de979121c9fbf415aaaa816e5753b9 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Sun, 23 Feb 2020 09:33:12 -0800
Subject: [PATCH 2/4] gnu: Add qtbase-patched.

* gnu/packages/qt.scm (qtbase-patched): Add it.
---
gnu/packages/qt.scm | 11 +++++++++++
1 file changed, 11 insertions(+)

Toggle diff (24 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 466c6ba358..86c5526e3d 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -599,6 +599,17 @@ developers using C++ or QML, a CSS & JavaScript like language.")
(license (list license:lgpl2.1 license:lgpl3))))
+(define qtbase-patched
+ (let ((src (package-source qtbase)))
+ (package
+ (inherit qtbase)
+ (source
+ (origin
+ (inherit src)
+ (patches
+ (append (search-patches "qtbase-QTBUG-81715.patch")
+ (origin-patches src)))))) ))
+
;; qt used to refer to the monolithic Qt 5.x package
(define-deprecated qt qtbase)
--
2.25.1
From 92ba3b59a2ff1dd6b4078c649a468fa208b47a59 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Fri, 21 Feb 2020 21:14:57 -0800
Subject: [PATCH 3/4] gnu: freecad. Fix build failures.

* gnu/packages/engineering.scm (freecad): [supported-systems] Only support aarch64 and
x86_64-linux, [inputs] use qtbase-patched instead of qtbase.
---
gnu/packages/engineering.scm | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

Toggle diff (41 lines)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 73fea26695..e84e7a87e9 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2242,6 +2242,17 @@ full programmatic control over your models.")
(home-page "https://www.openscad.org/")
(license license:gpl2+)))
+(define qtbase-patched
+ (let ((src (package-source qtbase)))
+ (package
+ (inherit qtbase)
+ (source
+ (origin
+ (inherit src)
+ (patches
+ (append (search-patches "qtbase-QTBUG-81715.patch")
+ (origin-patches src)))))) ))
+
(define-public freecad
(package
(name "freecad")
@@ -2282,7 +2293,7 @@ full programmatic control over your models.")
("python-pyside-2-tools" ,python-pyside-2-tools)
("python-shiboken-2" ,python-shiboken-2)
("python-wrapper" ,python-wrapper)
- ("qtbase" ,qtbase)
+ ("qtbase" ,qtbase-patched)
("qtsvg" ,qtsvg)
("qtx11extras" ,qtx11extras)
("qtxmlpatterns" ,qtxmlpatterns)
@@ -2314,6 +2325,7 @@ full programmatic control over your models.")
(list "PYTHONPATH"
'prefix (list (getenv "PYTHONPATH")))))
#t)))))
+ (supported-systems '("x86_64-linux" "aarch64-linux"))
(home-page "https://www.freecadweb.org/")
(synopsis "Your Own 3D Parametric Modeler")
(description
--
2.25.1
From c489352465aa93746f7a48e06c8481093894f1a3 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Fri, 21 Feb 2020 21:15:38 -0800
Subject: [PATCH 4/4] gnu: freecad. Use qt-build-system.

* gnu/packages/engineering.scm (freecad): [build-system] Use qt-build-system.
---
gnu/packages/engineering.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (23 lines)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index e84e7a87e9..c1078e2245 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -44,6 +44,7 @@
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
+ #:use-module (guix build-system qt)
#:use-module (gnu packages)
#:use-module (gnu packages algebra)
#:use-module (gnu packages autotools)
@@ -2267,7 +2268,7 @@ full programmatic control over your models.")
(sha256
(base32
"170hk1kgrvsddrwykp24wyj0cha78zzmzbf50gn98x7ngqqs395s"))))
- (build-system cmake-build-system)
+ (build-system qt-build-system)
(native-inputs
`(("doxygen" ,doxygen)
("graphviz" ,graphviz)
--
2.25.1
Marius Bakke wrote 5 years ago
(name . John Soo)(address . jsoo1@asu.edu)(address . 39758-done@debbugs.gnu.org)
87sgiz52jl.fsf@devup.no
John Soo <jsoo1@asu.edu> writes:

Toggle quote (6 lines)
> Hi Guix,
>
> There is a known issue in qtbase 5.12.7 where the cmake macros shipped
> with qt do not work when paths include dots. This broke freecad and
> maybe others.

Thanks! I've pushed the patches with a few modifications in
e2546bb472b6285a8856cacf686c5e0ce9bb62c5 and
3c60d85f313f910282ed884eead80061faf6ee78.

I will move the patch to the regular qtbase package on the 'staging'
branch later to avoid the custom variant.

Toggle quote (3 lines)
> I am not sure how to figure out other broken packages, if they need to
> use the patched-qtbase.

Typically you'd have to do 'guix refresh -l qtbase' and copy-paste the
package list to a 'guix build' invokation. IWBN to have a single
command for that.

[...]
Toggle quote (8 lines)
> From 92ba3b59a2ff1dd6b4078c649a468fa208b47a59 Mon Sep 17 00:00:00 2001
> From: John Soo <jsoo1@asu.edu>
> Date: Fri, 21 Feb 2020 21:14:57 -0800
> Subject: [PATCH 3/4] gnu: freecad. Fix build failures.
>
> * gnu/packages/engineering.scm (freecad): [supported-systems] Only support aarch64 and
> x86_64-linux, [inputs] use qtbase-patched instead of qtbase.

I dropped the [supported-systems] change as it seems unrelated to the
qtbase problem. Could you submit it as a separate patch, ideally with a
comment that explains why we do it (i.e. "upstream only supports
64-bit platforms")?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl5UBN4ACgkQoqBt8qM6
VPqGZQgAsaoJI1F/tcVoCaMsOldICyLvM33kc7PNZLALj2d9J2nF0R4pNK4KS38j
KgSzRwlSpX91gnnAQgNK3QwpfcyEaGUP84U+jphmPfFksSbeuGsLm/d3BbpzShuw
mYFxRjj0J9YL6mO2QuP3gmS6bIHat2tHKkBmD3XQSl2QkFJcpwA3WQfSxa5SIv+Z
B/oJbdxEJcpedm+5HJOwrzvZMR6Ui8t9JotWEA2G8px9dxQUHKc/nV3JlzuluC+P
04wGz6TON45R6Krtv0C1fRgnfWoxQrckkkwu8XFIyTsCOuvFzZO289pkNCkUmTcw
oEzO/qymiIJu3Jqy1V/PHRqCWbMNfg==
=PLEX
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 39758@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 39758
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help