summaryrefslogtreecommitdiff
path: root/gnu/packages/databases.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-07-16 21:31:42 +0200
committerMarius Bakke <mbakke@fastmail.com>2018-07-26 14:38:03 +0200
commit2001d2dac45f658acc7abf367dafda49012e2b79 (patch)
treea832d9ee6cbb60df50ff4ec2ca57ec27ae9b4416 /gnu/packages/databases.scm
parent03aed90b86549e7f9197ea11c360c5efd08327bd (diff)
downloadpatches-2001d2dac45f658acc7abf367dafda49012e2b79.tar
patches-2001d2dac45f658acc7abf367dafda49012e2b79.tar.gz
gnu: mariadb: Remove some bundled libraries.
* gnu/packages/databases.scm (mariadb)[source](snippet, modules): New fields. [arguments]: Add explicit #:configure-flags for system libraries. Add 'unbundle' phase. Remove 'pre-configure' phase. [inputs]: Add SNAPPY and XZ.
Diffstat (limited to 'gnu/packages/databases.scm')
-rw-r--r--gnu/packages/databases.scm48
1 files changed, 42 insertions, 6 deletions
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 78e514ae7f..752b400866 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -635,7 +635,20 @@ Language.")
name "-" version ".tar.gz"))
(sha256
(base32
- "0j2mdpyvj41vkq2rwrzky88b7170hzz6gy2vb2bc1447s2gp3q67"))))
+ "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
@@ -649,6 +662,12 @@ Language.")
;; For now, disable the features that that use libarchive (xtrabackup).
"-DWITH_LIBARCHIVE=OFF"
+ ;; Ensure the system libraries are used.
+ "-DWITH_JEMALLOC=yes"
+ "-DWITH_PCRE=system"
+ "-DWITH_SSL=system"
+ "-DWITH_ZLIB=system"
+
"-DDEFAULT_CHARSET=utf8"
"-DDEFAULT_COLLATION=utf8_general_ci"
"-DMYSQL_DATADIR=/var/lib/mysql"
@@ -665,6 +684,26 @@ Language.")
"-DINSTALL_SHAREDIR=share")
#:phases
(modify-phases %standard-phases
+ (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
@@ -703,11 +742,6 @@ Language.")
"disks")))
(for-each disable-plugin disabled-plugins)
#t)))
- (add-before
- 'configure 'pre-configure
- (lambda _
- (setenv "CONFIG_SHELL" (which "sh"))
- #t))
(replace 'check
(lambda* (#:key (tests? #t) #:allow-other-keys)
(if tests?
@@ -741,6 +775,8 @@ Language.")
("ncurses" ,ncurses)
("openssl" ,openssl)
("pcre" ,pcre)
+ ("snappy" ,snappy)
+ ("xz" ,xz)
("zlib" ,zlib)))
;; The test suite is very resource intensive and can take more than three
;; hours on a x86_64 system. Give slow and busy machines some leeway.