John Soo wrote 5 years ago
(address . guix-patches@gnu.org)
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