summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2021-05-09 14:38:36 +0200
committerMarius Bakke <marius@gnu.org>2021-05-09 23:43:32 +0200
commit1539af46d08e6cd05712c0368e6becdcebd32d9f (patch)
tree8619f7ccc9284de6790ed2187eac8ca33774f4d6 /gnu
parent9e729d9a2fa8f27157424f14b281ad31a1396a22 (diff)
downloadguix-1539af46d08e6cd05712c0368e6becdcebd32d9f.tar.gz
gnu: CMake: Update to 3.20.2.
* gnu/packages/cmake.scm (%common-disabled-tests): Don't disable BootstrapTest.
(cmake-bootstrap): Update to 3.20.2.
[source](modules, snippet): Move from here ...
(cmake-minimal)[source]: ... to here.
* gnu/packages/patches/mariadb-cmake-compat.patch: New file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/databases.scm (mariadb)[source](patches): Add it.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/cmake.scm89
-rw-r--r--gnu/packages/databases.scm3
-rw-r--r--gnu/packages/patches/mariadb-cmake-compat.patch17
4 files changed, 55 insertions, 55 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index cbaccb7f39..9cc5a02587 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1375,6 +1375,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/mailutils-fix-uninitialized-variable.patch	\
   %D%/packages/patches/make-impure-dirs.patch			\
   %D%/packages/patches/mariadb-CVE-2021-27928.patch		\
+  %D%/packages/patches/mariadb-cmake-compat.patch		\
   %D%/packages/patches/mars-install.patch			\
   %D%/packages/patches/mars-sfml-2.3.patch			\
   %D%/packages/patches/maxima-defsystem-mkdir.patch		\
diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 8d6a091507..68d215da93 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2017, 2018, 2020 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2017, 2018, 2020, 2021 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
@@ -123,9 +123,7 @@ using the CMake build system.")
     ;; This test requires 'ldconfig' which is not available in Guix.
     "RunCMake.install"
     ;; This test fails for unknown reason.
-    "RunCMake.file-GET_RUNTIME_DEPENDENCIES"
-    ;; This test requires the bundled libuv.
-    "BootstrapTest"))
+    "RunCMake.file-GET_RUNTIME_DEPENDENCIES"))
 
 (define %preserved-third-party-files
   '(;; 'Source/cm_getdate.c' includes archive_getdate.c wholesale, so it must
@@ -140,7 +138,7 @@ using the CMake build system.")
 (define-public cmake-bootstrap
   (package
     (name "cmake-bootstrap")
-    (version "3.19.2")
+    (version "3.20.2")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://cmake.org/files/v"
@@ -148,49 +146,7 @@ using the CMake build system.")
                                   "/cmake-" version ".tar.gz"))
               (sha256
                (base32
-                "1w67w0ak6vf37501dlz9yhnzlvvpw1w10n2nm3hi7yxp4cxzvq73"))
-              (modules '((guix build utils)
-                         (ice-9 ftw)))
-              (snippet
-               `(begin
-                  ;; CMake bundles its dependencies in the "Utilities" directory.
-                  ;; Delete those to ensure the system libraries are used.
-                  (define preserved-files
-                    '(,@%preserved-third-party-files
-                      ;; Use the bundled JsonCpp during bootstrap to work around
-                      ;; a circular dependency.  TODO: JsonCpp can be built with
-                      ;; Meson instead of CMake, but meson-build-system currently
-                      ;; does not support cross-compilation.
-                      "Utilities/cmjsoncpp"
-                      ;; LibUV is required to bootstrap the initial build system.
-                      "Utilities/cmlibuv"))
-
-                  (file-system-fold (lambda (dir stat result)         ;enter?
-                                      (or (string=? "Utilities" dir)  ;init
-                                          ;; The bundled dependencies are
-                                          ;; distinguished by having a "cm"
-                                          ;; prefix to their upstream names.
-                                          (and (string-prefix? "Utilities/cm" dir)
-                                               (not (member dir preserved-files)))))
-                                    (lambda (file stat result)        ;leaf
-                                      (unless (or (member file preserved-files)
-                                                  ;; Preserve top-level files.
-                                                  (string=? "Utilities"
-                                                            (dirname file)))
-                                        (delete-file file)))
-                                    (const #t)                        ;down
-                                    (lambda (dir stat result)         ;up
-                                      (when (equal? (scandir dir) '("." ".."))
-                                        (rmdir dir)))
-                                    (const #t)                        ;skip
-                                    (lambda (file stat errno result)
-                                      (format (current-error-port)
-                                              "warning: failed to delete ~a: ~a~%"
-                                              file (strerror errno)))
-                                    #t
-                                    "Utilities"
-                                    lstat)
-                  #t))
+                "0kjlb7sxbwg8z4027c3jjcmyjh9d36p0r9d4nqxynyaijz5nxkxf"))
               (patches (search-patches "cmake-curl-certificates.patch"))))
     (build-system gnu-build-system)
     (arguments
@@ -290,13 +246,38 @@ and workspaces that can be used in the compiler environment of your choice.")
     (name "cmake-minimal")
     (source (origin
               (inherit (package-source cmake-bootstrap))
+              ;; Purge CMakes bundled dependencies as they are no longer needed.
+              (modules '((ice-9 ftw)))
               (snippet
-               (match (origin-snippet (package-source cmake-bootstrap))
-                 ((_ _ exp ...)
-                  ;; Now we can delete the remaining software bundles.
-                  (append `(begin
-                             (define preserved-files ',%preserved-third-party-files))
-                          exp))))))
+               `(begin
+                  (define preserved-files ',%preserved-third-party-files)
+
+                  (file-system-fold (lambda (dir stat result)         ;enter?
+                                      (or (string=? "Utilities" dir)  ;init
+                                          ;; The bundled dependencies are
+                                          ;; distinguished by having a "cm"
+                                          ;; prefix to their upstream names.
+                                          (and (string-prefix? "Utilities/cm" dir)
+                                               (not (member dir preserved-files)))))
+                                    (lambda (file stat result)        ;leaf
+                                      (unless (or (member file preserved-files)
+                                                  ;; Preserve top-level files.
+                                                  (string=? "Utilities"
+                                                            (dirname file)))
+                                        (delete-file file)))
+                                    (const #t)                        ;down
+                                    (lambda (dir stat result)         ;up
+                                      (when (equal? (scandir dir) '("." ".."))
+                                        (rmdir dir)))
+                                    (const #t)                        ;skip
+                                    (lambda (file stat errno result)
+                                      (format (current-error-port)
+                                              "warning: failed to delete ~a: ~a~%"
+                                              file (strerror errno)))
+                                    #t
+                                    "Utilities"
+                                    lstat)
+                  #t))))
     (inputs
      `(("jsoncpp" ,jsoncpp)
        ,@(package-inputs cmake-bootstrap)))
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index c1cd31fc73..b41a68e4fb 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -716,7 +716,8 @@ Language.")
               (sha256
                (base32
                 "1s3vfm73911cddjhgpcbkya6nz7ag2zygg56qqzwscn5ybv28j7b"))
-              (patches (search-patches "mariadb-CVE-2021-27928.patch"))
+              (patches (search-patches "mariadb-CVE-2021-27928.patch"
+                                       "mariadb-cmake-compat.patch"))
               (modules '((guix build utils)))
               (snippet
                '(begin
diff --git a/gnu/packages/patches/mariadb-cmake-compat.patch b/gnu/packages/patches/mariadb-cmake-compat.patch
new file mode 100644
index 0000000000..44b0daa186
--- /dev/null
+++ b/gnu/packages/patches/mariadb-cmake-compat.patch
@@ -0,0 +1,17 @@
+Fix if statement that triggers syntax error in CMake 3.20 and later.
+
+Taken from upstream:
+https://github.com/mariadb-corporation/mariadb-connector-c/commit/242cab8c
+
+diff --git a/libmariadb/cmake/ConnectorName.cmake b/libmariadb/cmake/ConnectorName.cmake
+--- a/libmariadb/cmake/ConnectorName.cmake
++++ b/libmariadb/cmake/ConnectorName.cmake
+@@ -22,7 +22,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
+     SET(MACHINE_NAME "x64")
+   ELSE()
+     SET(MACHINE_NAME "32")
+-  END()
++  ENDIF()
+ ENDIF()
+ 
+ SET(product_name "mysql-connector-c-${CPACK_PACKAGE_VERSION}-${PLATFORM_NAME}${CONCAT_SIGN}${MACHINE_NAME}")
\ No newline at end of file