name "-" version ".tar.gz"))
(sha256
(base32
- "0bax748j4srsyhw5cs5jvwigndh0zwmf4r2cjvhja31ckx8jqccl"))))
+ "0j2mdpyvj41vkq2rwrzky88b7170hzz6gy2vb2bc1447s2gp3q67"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; Delete bundled snappy and xz.
+ (delete-file-recursively "storage/tokudb/PerconaFT/third_party")
+
+ ;; Preserve CMakeLists.txt for these.
+ (for-each (lambda (file)
+ (unless (string-suffix? "CMakeLists.txt" file)
+ (delete-file file)))
+ (append (find-files "extra/yassl")
+ (find-files "pcre") (find-files "zlib")))
+ #t))))
(build-system cmake-build-system)
(arguments
- '(#:configure-flags
+ `(#:configure-flags
'("-DBUILD_CONFIG=mysql_release"
;; Linking with libarchive fails, like this:
"-DINSTALL_SUPPORTFILESDIR=share/mysql/support-files"
"-DINSTALL_MYSQLSHAREDIR=share/mysql"
"-DINSTALL_DOCDIR=share/mysql/docs"
- "-DINSTALL_SHAREDIR=share/mysql")
+ "-DINSTALL_SHAREDIR=share")
#:phases
(modify-phases %standard-phases
-
+ ;; Apply this patch that's only needed on ARM.
+ ,@(if (and (not (%current-target-system))
+ (string=? "armhf-linux" (%current-system)))
+ `((add-after 'unpack 'apply-patch
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((patch (assoc-ref inputs "gcc-ice-patch")))
+ (invoke "patch" "-p1" "--force"
+ "--input" patch)
+ #t))))
+ '())
+
- (add-before
- 'configure 'pre-configure
- (lambda _
- (setenv "CONFIG_SHELL" (which "sh"))
- #t))
+ (add-after 'unpack 'unbundle
+ (lambda _
+ ;; The bundled PCRE in MariaDB has a patch that was upstreamed
+ ;; in version 8.34. Unfortunately the upstream patch behaves
+ ;; slightly differently and the build system fails to detect it.
+ ;; See <https://bugs.exim.org/show_bug.cgi?id=2173>.
+ ;; XXX: Consider patching PCRE instead.
+ (substitute* "cmake/pcre.cmake"
+ ((" OR NOT PCRE_STACK_SIZE_OK") ""))
+
+ (substitute* "storage/tokudb/PerconaFT/ft/CMakeLists.txt"
+ ;; Remove dependency on these CMake targets.
+ ((" build_lzma build_snappy") ""))
+
+ (substitute* "storage/tokudb/PerconaFT/CMakeLists.txt"
+ ;; This file checks that the bundled sources are present and
+ ;; declares build procedures for them. We don't need that.
+ (("^include\\(TokuThirdParty\\)") ""))
+
+ #t))
+ (add-after 'unpack 'adjust-tests
+ (lambda _
+ (let ((disabled-tests
+ '(;; These fail because root@hostname == root@localhost in
+ ;; the build environment, causing a user count mismatch.
+ ;; See <https://jira.mariadb.org/browse/MDEV-7761>.
+ "main.join_cache"
+ "main.explain_non_select"
+ "roles.acl_statistics"))
+
+ ;; This file contains a list of known-flaky tests for this
+ ;; release. Append our own items.
+ (unstable-tests (open-file "mysql-test/unstable-tests" "a")))
+ (for-each (lambda (test)
+ (format unstable-tests "~a : ~a\n"
+ test "Disabled in Guix"))
+ disabled-tests)
+ (close-port unstable-tests)
+
+ (substitute* "mysql-test/mysql-test-run.pl"
+ (("/bin/ls") (which "ls"))
+ (("/bin/sh") (which "sh")))
+ #t)))
+ (add-before 'configure 'disable-plugins
+ (lambda _
+ (let ((disable-plugin (lambda (name)
+ (call-with-output-file
+ (string-append "plugin/" name
+ "/CMakeLists.txt")
+ (lambda (port)
+ (format port "\n")))))
+ (disabled-plugins '(;; FIXME: On armhf-linux, this plugin
+ ;; triggers a GCC ICE. Disable for now.
+ "semisync"
+ ;; XXX: Causes a test failure.
+ "disks")))
+ (for-each disable-plugin disabled-plugins)
+ #t)))
+ (replace 'check
+ (lambda* (#:key (tests? #t) #:allow-other-keys)
+ (if tests?
+ (with-directory-excursion "mysql-test"
+ (invoke "./mtr" "--verbose"
+ "--parallel" (number->string (parallel-job-count))
+ "--skip-test-list=unstable-tests"))
+ (format #t "test suite not run~%"))
+ #t))
(add-after
'install 'post-install
(lambda* (#:key outputs #:allow-other-keys)