unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#39758] [PATCH] Add qtbase-patched. (Fix QTBUG-81715)
@ 2020-02-23 17:41 John Soo
  2020-02-24 17:16 ` bug#39758: " Marius Bakke
  0 siblings, 1 reply; 2+ messages in thread
From: John Soo @ 2020-02-23 17:41 UTC (permalink / raw)
  To: 39758

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

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

[-- Attachment #2: 0001-gnu-Add-qtbase-QTBUG-81715.patch.-Fixes-QTBUG-81715.patch --]
[-- Type: text/x-patch, Size: 2430 bytes --]

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

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


[-- Attachment #3: 0002-gnu-Add-qtbase-patched.patch --]
[-- Type: text/x-patch, Size: 987 bytes --]

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(+)

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


[-- Attachment #4: 0003-gnu-freecad.-Fix-build-failures.patch --]
[-- Type: text/x-patch, Size: 1879 bytes --]

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

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


[-- Attachment #5: 0004-gnu-freecad.-Use-qt-build-system.patch --]
[-- Type: text/x-patch, Size: 1175 bytes --]

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

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#39758: [PATCH] Add qtbase-patched. (Fix QTBUG-81715)
  2020-02-23 17:41 [bug#39758] [PATCH] Add qtbase-patched. (Fix QTBUG-81715) John Soo
@ 2020-02-24 17:16 ` Marius Bakke
  0 siblings, 0 replies; 2+ messages in thread
From: Marius Bakke @ 2020-02-24 17:16 UTC (permalink / raw)
  To: John Soo, 39758-done

[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]

John Soo <jsoo1@asu.edu> writes:

> 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.

> 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.

[...]
  
> 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")?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-24 17:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-23 17:41 [bug#39758] [PATCH] Add qtbase-patched. (Fix QTBUG-81715) John Soo
2020-02-24 17:16 ` bug#39758: " Marius Bakke

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