Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;; GNU Guix --- Functional package management for GNU
- ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
- ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
- ;;; Copyright © 2013, 2017 Cyril Roelandt <tipecaml@gmail.com>
- ;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
- ;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
- ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
- ;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
- ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
- ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
- ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
- ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
- ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
- ;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
- ;;; Copyright © 2016, 2017, 2018 Roel Janssen <roel@gnu.org>
- ;;; Copyright © 2016 David Craven <david@craven.ch>
- ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
- ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
- ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
- ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
- ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
- ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
- ;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
- ;;; Copyright © 2017 Adriano Peluso <catonano@gmail.com>
- ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
- ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
- ;;; Copyright © 2017, 2018 Alex Vong <alexvong1995@gmail.com>
- ;;; Copyright © 2017, 2018 Ben Woodcroft <donttrustben@gmail.com>
- ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
- ;;; Copyright © 2017, 2018 Pierre Langlois <pierre.langlois@gmx.com>
- ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
- ;;; Copyright © 2017 Kristofer Buffington <kristoferbuffington@gmail.com>
- ;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
- ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
- ;;;
- ;;; This file is part of GNU Guix.
- ;;;
- ;;; GNU Guix is free software; you can redistribute it and/or modify it
- ;;; under the terms of the GNU General Public License as published by
- ;;; the Free Software Foundation; either version 3 of the License, or (at
- ;;; your option) any later version.
- ;;;
- ;;; GNU Guix is distributed in the hope that it will be useful, but
- ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
- ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ;;; GNU General Public License for more details.
- ;;;
- ;;; You should have received a copy of the GNU General Public License
- ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
- (define-module (gnu packages databases)
- #:use-module (gnu packages)
- #:use-module (gnu packages admin)
- #:use-module (gnu packages algebra)
- #:use-module (gnu packages autotools)
- #:use-module (gnu packages avahi)
- #:use-module (gnu packages base)
- #:use-module (gnu packages bash)
- #:use-module (gnu packages bison)
- #:use-module (gnu packages boost)
- #:use-module (gnu packages check)
- #:use-module (gnu packages cmake)
- #:use-module (gnu packages compression)
- #:use-module (gnu packages crypto)
- #:use-module (gnu packages curl)
- #:use-module (gnu packages cyrus-sasl)
- #:use-module (gnu packages dbm)
- #:use-module (gnu packages emacs)
- #:use-module (gnu packages gettext)
- #:use-module (gnu packages glib)
- #:use-module (gnu packages gnupg)
- #:use-module (gnu packages guile)
- #:use-module (gnu packages time)
- #:use-module (gnu packages golang)
- #:use-module (gnu packages jemalloc)
- #:use-module (gnu packages language)
- #:use-module (gnu packages libevent)
- #:use-module (gnu packages linux)
- #:use-module (gnu packages man)
- #:use-module (gnu packages ncurses)
- #:use-module (gnu packages parallel)
- #:use-module (gnu packages pcre)
- #:use-module (gnu packages perl)
- #:use-module (gnu packages perl-check)
- #:use-module (gnu packages pkg-config)
- #:use-module (gnu packages popt)
- #:use-module (gnu packages python)
- #:use-module (gnu packages python-crypto)
- #:use-module (gnu packages python-xyz)
- #:use-module (gnu packages rdf)
- #:use-module (gnu packages readline)
- #:use-module (gnu packages ruby)
- #:use-module (gnu packages serialization)
- #:use-module (gnu packages sqlite)
- #:use-module (gnu packages tcl)
- #:use-module (gnu packages terminals)
- #:use-module (gnu packages textutils)
- #:use-module (gnu packages tls)
- #:use-module (gnu packages valgrind)
- #:use-module (gnu packages web)
- #:use-module (gnu packages xml)
- #:use-module ((guix licenses) #:prefix license:)
- #:use-module (guix packages)
- #:use-module (guix download)
- #:use-module (guix git-download)
- #:use-module (guix build-system gnu)
- #:use-module (guix build-system go)
- #:use-module (guix build-system perl)
- #:use-module (guix build-system python)
- #:use-module (guix build-system ruby)
- #:use-module (guix build-system cmake)
- #:use-module (guix build-system scons)
- #:use-module ((guix build utils) #:hide (which))
- #:use-module (guix utils)
- #:use-module (srfi srfi-1)
- #:use-module (srfi srfi-26)
- #:use-module (ice-9 match))
- (define-public mariadb
- (package
- (name "mariadb")
- (version "10.1.37")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://downloads.mariadb.org/f/"
- name "-" version "/source/"
- name "-" version ".tar.gz"))
- (sha256
- (base32
- "0ijdmdn9mcciwv361zfmja6b1h6qpbdqgrnnq6kkdapplyq1dmcc"))
- (patches (search-patches "mariadb-client-test-32bit.patch"))
- (modules '((guix build utils)))
- (snippet
- '(begin
- ;; Delete bundled snappy and xz.
- (delete-file-recursively "storage/tokudb/PerconaFT/third_party")
- (substitute* "storage/tokudb/PerconaFT/CMakeLists.txt"
- ;; This file checks that the bundled sources are present and
- ;; declares build procedures for them.
- (("^include\\(TokuThirdParty\\)") ""))
- (substitute* "storage/tokudb/PerconaFT/ft/CMakeLists.txt"
- ;; Don't attempt to use the procedures we just removed.
- ((" build_lzma build_snappy") ""))
- ;; 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
- '("-DBUILD_CONFIG=mysql_release"
- ;; Linking with libarchive fails, like this:
- ;; ld: /gnu/store/...-libarchive-3.2.2/lib/libarchive.a(archive_entry.o):
- ;; relocation R_X86_64_32 against `.bss' can not be used when
- ;; making a shared object; recompile with -fPIC
- ;; 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"
- "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
- "-DINSTALL_INFODIR=share/mysql/docs"
- "-DINSTALL_MANDIR=share/man"
- "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
- "-DINSTALL_SCRIPTDIR=bin"
- "-DINSTALL_INCLUDEDIR=include/mysql"
- "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
- "-DINSTALL_SUPPORTFILESDIR=share/mysql/support-files"
- "-DINSTALL_MYSQLSHAREDIR=share/mysql"
- "-DINSTALL_DOCDIR=share/mysql/docs"
- "-DINSTALL_SHAREDIR=share")
- #:phases
- (modify-phases %standard-phases
- (add-after 'unpack 'fix-pcre-detection
- (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") ""))
- #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"
- "main.stat_tables_innodb"
- "roles.acl_statistics"
- "main.mysqldump"
- ;; FIXME: This test fails on i686:
- ;; -myisampack: Can't create/write to file (Errcode: 17 "File exists")
- ;; +myisampack: Can't create/write to file (Errcode: 17 "File exists)
- ;; When running "myisampack --join=foo/t3 foo/t1 foo/t2"
- ;; (all three tables must exist and be identical)
- ;; in a loop it produces the same error around 1/240 times.
- ;; montywi on #maria suggested removing the real_end check in
- ;; "strings/my_vsnprintf.c" on line 503, yet it still does not
- ;; reach the ending quote occasionally. Disable it for now.
- "main.myisampack"
- ;; FIXME: This test fails on armhf-linux:
- "mroonga/storage.index_read_multiple_double"))
- ;; 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 '(;; 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"
- "--retry=3"
- "--testcase-timeout=40"
- "--suite-timeout=600"
- "--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)
- (let* ((out (assoc-ref outputs "out"))
- (test (assoc-ref outputs "test")))
- (substitute* (string-append out "/bin/mysql_install_db")
- (("basedir=\"\"")
- (string-append "basedir=\"" out "\"")))
- ;; Remove unneeded files for testing.
- (with-directory-excursion out
- (for-each delete-file-recursively
- '("data" "mysql-test" "sql-bench"
- "share/man/man1/mysql-test-run.pl.1"))
- ;; Delete huge and unnecessary executables.
- (for-each delete-file (find-files "bin" "(test|embedded)"))
- ;; And static libraries.
- (for-each delete-file (find-files "lib" "\\.a$")))
- #t))))))
- (native-inputs
- `(("bison" ,bison)
- ("perl" ,perl)))
- (inputs
- `(("jemalloc" ,jemalloc)
- ("libaio" ,libaio)
- ("libxml2" ,libxml2)
- ("ncurses" ,ncurses)
- ("pcre" ,pcre)
- ("snappy" ,snappy)
- ("xz" ,xz)
- ("zlib" ,zlib)))
- (propagated-inputs
- ;; mariadb.pc says -lssl -lcrypto, so propagate it.
- `(("openssl" ,openssl)))
- ;; 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.
- (properties '((timeout . 64800))) ;18 hours
- (home-page "https://mariadb.org/")
- (synopsis "SQL database server")
- (description
- "MariaDB is a multi-user and multi-threaded SQL database server, designed
- as a drop-in replacement of MySQL.")
- (license license:gpl2)))
- mariadb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement