guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

08/15: gnu: qtbase: Add variant that fixes file name handling in CMake m


From: guix-commits
Subject: 08/15: gnu: qtbase: Add variant that fixes file name handling in CMake macros.
Date: Mon, 24 Feb 2020 12:09:57 -0500 (EST)

mbakke pushed a commit to branch master
in repository guix.

commit e2546bb472b6285a8856cacf686c5e0ce9bb62c5
Author: John Soo <address@hidden>
AuthorDate: Fri Feb 21 21:13:47 2020 -0800

    gnu: qtbase: Add variant that fixes file name handling in CMake macros.
    
    * gnu/packages/patches/qtbase-QTBUG-81715.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Adjust accordingly.
    * gnu/packages/qt.scm (qtbase-patched): New public variable.
    
    Signed-off-by: Marius Bakke <address@hidden>
---
 gnu/local.mk                                  |  1 +
 gnu/packages/patches/qtbase-QTBUG-81715.patch | 40 +++++++++++++++++++++++++++
 gnu/packages/qt.scm                           | 13 +++++++++
 3 files changed, 54 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index 412bcb0..b85c289 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1355,6 +1355,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/qrcodegen-cpp-make-install.patch                \
   %D%/packages/patches/qt4-ldflags.patch                       \
   %D%/packages/patches/qtbase-use-TZDIR.patch                  \
+  %D%/packages/patches/qtbase-QTBUG-81715.patch                        \
   %D%/packages/patches/qtscript-disable-tests.patch            \
   %D%/packages/patches/quagga-reproducible-build.patch          \
   %D%/packages/patches/quickswitch-fix-dmenu-check.patch       \
diff --git a/gnu/packages/patches/qtbase-QTBUG-81715.patch 
b/gnu/packages/patches/qtbase-QTBUG-81715.patch
new file mode 100644
index 0000000..70b83b9
--- /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 <address@hidden>
+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 <address@hidden>
+---
+
+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()
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 466c6ba..7aa9d0f 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -598,6 +598,19 @@ developers using C++ or QML, a CSS & JavaScript like 
language.")
 developers using C++ or QML, a CSS & JavaScript like language.")
     (license (list license:lgpl2.1 license:lgpl3))))
 
+;; This variant fixes a problem with the CMake macros shipped by qtbase.  See
+;; discussion at 
<https://lists.gnu.org/archive/html/guix-devel/2020-02/msg00308.html>.
+(define-public qtbase-patched
+  (let ((src (package-source qtbase)))
+    (hidden-package
+     (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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]