Advertisement
Guest User

Untitled

a guest
Jan 20th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 13.90 KB | None | 0 0
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
  4. ;;; Copyright © 2013, 2017 Cyril Roelandt <tipecaml@gmail.com>
  5. ;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
  6. ;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
  7. ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
  8. ;;; Copyright © 2015, 2016 Sou Bunnbu <iyzsong@gmail.com>
  9. ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
  10. ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
  11. ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
  12. ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
  13. ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
  14. ;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
  15. ;;; Copyright © 2016, 2017, 2018 Roel Janssen <roel@gnu.org>
  16. ;;; Copyright © 2016 David Craven <david@craven.ch>
  17. ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
  18. ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
  19. ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
  20. ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
  21. ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
  22. ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
  23. ;;; Copyright © 2017 Jelle Licht <jlicht@fsfe.org>
  24. ;;; Copyright © 2017 Adriano Peluso <catonano@gmail.com>
  25. ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
  26. ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  27. ;;; Copyright © 2017, 2018 Alex Vong <alexvong1995@gmail.com>
  28. ;;; Copyright © 2017, 2018 Ben Woodcroft <donttrustben@gmail.com>
  29. ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
  30. ;;; Copyright © 2017, 2018 Pierre Langlois <pierre.langlois@gmx.com>
  31. ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
  32. ;;; Copyright © 2017 Kristofer Buffington <kristoferbuffington@gmail.com>
  33. ;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
  34. ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
  35. ;;;
  36. ;;; This file is part of GNU Guix.
  37. ;;;
  38. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  39. ;;; under the terms of the GNU General Public License as published by
  40. ;;; the Free Software Foundation; either version 3 of the License, or (at
  41. ;;; your option) any later version.
  42. ;;;
  43. ;;; GNU Guix is distributed in the hope that it will be useful, but
  44. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  45. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  46. ;;; GNU General Public License for more details.
  47. ;;;
  48. ;;; You should have received a copy of the GNU General Public License
  49. ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
  50.  
  51. (define-module (gnu packages databases)
  52.   #:use-module (gnu packages)
  53.   #:use-module (gnu packages admin)
  54.   #:use-module (gnu packages algebra)
  55.   #:use-module (gnu packages autotools)
  56.   #:use-module (gnu packages avahi)
  57.   #:use-module (gnu packages base)
  58.   #:use-module (gnu packages bash)
  59.   #:use-module (gnu packages bison)
  60.   #:use-module (gnu packages boost)
  61.   #:use-module (gnu packages check)
  62.   #:use-module (gnu packages cmake)
  63.   #:use-module (gnu packages compression)
  64.   #:use-module (gnu packages crypto)
  65.   #:use-module (gnu packages curl)
  66.   #:use-module (gnu packages cyrus-sasl)
  67.   #:use-module (gnu packages dbm)
  68.   #:use-module (gnu packages emacs)
  69.   #:use-module (gnu packages gettext)
  70.   #:use-module (gnu packages glib)
  71.   #:use-module (gnu packages gnupg)
  72.   #:use-module (gnu packages guile)
  73.   #:use-module (gnu packages time)
  74.   #:use-module (gnu packages golang)
  75.   #:use-module (gnu packages jemalloc)
  76.   #:use-module (gnu packages language)
  77.   #:use-module (gnu packages libevent)
  78.   #:use-module (gnu packages linux)
  79.   #:use-module (gnu packages man)
  80.   #:use-module (gnu packages ncurses)
  81.   #:use-module (gnu packages parallel)
  82.   #:use-module (gnu packages pcre)
  83.   #:use-module (gnu packages perl)
  84.   #:use-module (gnu packages perl-check)
  85.   #:use-module (gnu packages pkg-config)
  86.   #:use-module (gnu packages popt)
  87.   #:use-module (gnu packages python)
  88.   #:use-module (gnu packages python-crypto)
  89.   #:use-module (gnu packages python-xyz)
  90.   #:use-module (gnu packages rdf)
  91.   #:use-module (gnu packages readline)
  92.   #:use-module (gnu packages ruby)
  93.   #:use-module (gnu packages serialization)
  94.   #:use-module (gnu packages sqlite)
  95.   #:use-module (gnu packages tcl)
  96.   #:use-module (gnu packages terminals)
  97.   #:use-module (gnu packages textutils)
  98.   #:use-module (gnu packages tls)
  99.   #:use-module (gnu packages valgrind)
  100.   #:use-module (gnu packages web)
  101.   #:use-module (gnu packages xml)
  102.   #:use-module ((guix licenses) #:prefix license:)
  103.   #:use-module (guix packages)
  104.   #:use-module (guix download)
  105.   #:use-module (guix git-download)
  106.   #:use-module (guix build-system gnu)
  107.   #:use-module (guix build-system go)
  108.   #:use-module (guix build-system perl)
  109.   #:use-module (guix build-system python)
  110.   #:use-module (guix build-system ruby)
  111.   #:use-module (guix build-system cmake)
  112.   #:use-module (guix build-system scons)
  113.   #:use-module ((guix build utils) #:hide (which))
  114.   #:use-module (guix utils)
  115.   #:use-module (srfi srfi-1)
  116.   #:use-module (srfi srfi-26)
  117.   #:use-module (ice-9 match))
  118.  
  119. (define-public mariadb
  120.   (package
  121.     (name "mariadb")
  122.     (version "10.1.37")
  123.     (source (origin
  124.               (method url-fetch)
  125.               (uri (string-append "https://downloads.mariadb.org/f/"
  126.                                   name "-" version "/source/"
  127.                                   name "-" version ".tar.gz"))
  128.               (sha256
  129.                (base32
  130.                 "0ijdmdn9mcciwv361zfmja6b1h6qpbdqgrnnq6kkdapplyq1dmcc"))
  131.               (patches (search-patches "mariadb-client-test-32bit.patch"))
  132.               (modules '((guix build utils)))
  133.               (snippet
  134.                '(begin
  135.                   ;; Delete bundled snappy and xz.
  136.                   (delete-file-recursively "storage/tokudb/PerconaFT/third_party")
  137.                   (substitute* "storage/tokudb/PerconaFT/CMakeLists.txt"
  138.                     ;; This file checks that the bundled sources are present and
  139.                     ;; declares build procedures for them.
  140.                     (("^include\\(TokuThirdParty\\)") ""))
  141.                   (substitute* "storage/tokudb/PerconaFT/ft/CMakeLists.txt"
  142.                     ;; Don't attempt to use the procedures we just removed.
  143.                     ((" build_lzma build_snappy") ""))
  144.  
  145.                   ;; Preserve CMakeLists.txt for these.
  146.                   (for-each (lambda (file)
  147.                               (unless (string-suffix? "CMakeLists.txt" file)
  148.                                 (delete-file file)))
  149.                             (append (find-files "extra/yassl")
  150.                                     (find-files "pcre") (find-files "zlib")))
  151.                   #t))))
  152.     (build-system cmake-build-system)
  153.     (arguments
  154.      `(#:configure-flags
  155.        '("-DBUILD_CONFIG=mysql_release"
  156.          ;; Linking with libarchive fails, like this:
  157.  
  158.          ;; ld: /gnu/store/...-libarchive-3.2.2/lib/libarchive.a(archive_entry.o):
  159.          ;; relocation R_X86_64_32 against `.bss' can not be used when
  160.          ;; making a shared object; recompile with -fPIC
  161.  
  162.          ;; For now, disable the features that that use libarchive (xtrabackup).
  163.          "-DWITH_LIBARCHIVE=OFF"
  164.  
  165.          ;; Ensure the system libraries are used.
  166.          "-DWITH_JEMALLOC=yes"
  167.          "-DWITH_PCRE=system"
  168.          "-DWITH_SSL=system"
  169.          "-DWITH_ZLIB=system"
  170.  
  171.          "-DDEFAULT_CHARSET=utf8"
  172.          "-DDEFAULT_COLLATION=utf8_general_ci"
  173.          "-DMYSQL_DATADIR=/var/lib/mysql"
  174.          "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
  175.          "-DINSTALL_INFODIR=share/mysql/docs"
  176.          "-DINSTALL_MANDIR=share/man"
  177.          "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
  178.          "-DINSTALL_SCRIPTDIR=bin"
  179.          "-DINSTALL_INCLUDEDIR=include/mysql"
  180.          "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
  181.          "-DINSTALL_SUPPORTFILESDIR=share/mysql/support-files"
  182.          "-DINSTALL_MYSQLSHAREDIR=share/mysql"
  183.          "-DINSTALL_DOCDIR=share/mysql/docs"
  184.          "-DINSTALL_SHAREDIR=share")
  185.        #:phases
  186.        (modify-phases %standard-phases
  187.          (add-after 'unpack 'fix-pcre-detection
  188.            (lambda _
  189.              ;; The bundled PCRE in MariaDB has a patch that was upstreamed
  190.              ;; in version 8.34.  Unfortunately the upstream patch behaves
  191.              ;; slightly differently and the build system fails to detect it.
  192.              ;; See <https://bugs.exim.org/show_bug.cgi?id=2173>.
  193.              ;; XXX: Consider patching PCRE instead.
  194.              (substitute* "cmake/pcre.cmake"
  195.                ((" OR NOT PCRE_STACK_SIZE_OK") ""))
  196.              #t))
  197.          (add-after 'unpack 'adjust-tests
  198.            (lambda _
  199.              (let ((disabled-tests
  200.                     '(;; These fail because root@hostname == root@localhost in
  201.                       ;; the build environment, causing a user count mismatch.
  202.                       ;; See <https://jira.mariadb.org/browse/MDEV-7761>.
  203.                       "main.join_cache"
  204.                       "main.explain_non_select"
  205.                       "main.stat_tables_innodb"
  206.                       "roles.acl_statistics"
  207.               "main.mysqldump"
  208.  
  209.                       ;; FIXME: This test fails on i686:
  210.                       ;; -myisampack: Can't create/write to file (Errcode: 17 "File exists")
  211.                       ;; +myisampack: Can't create/write to file (Errcode: 17 "File exists)
  212.                       ;; When running "myisampack --join=foo/t3 foo/t1 foo/t2"
  213.                       ;; (all three tables must exist and be identical)
  214.                       ;; in a loop it produces the same error around 1/240 times.
  215.                       ;; montywi on #maria suggested removing the real_end check in
  216.                       ;; "strings/my_vsnprintf.c" on line 503, yet it still does not
  217.                       ;; reach the ending quote occasionally.  Disable it for now.
  218.                       "main.myisampack"
  219.                       ;; FIXME: This test fails on armhf-linux:
  220.                       "mroonga/storage.index_read_multiple_double"))
  221.  
  222.                    ;; This file contains a list of known-flaky tests for this
  223.                    ;; release.  Append our own items.
  224.                    (unstable-tests (open-file "mysql-test/unstable-tests" "a")))
  225.                (for-each (lambda (test)
  226.                            (format unstable-tests "~a : ~a\n"
  227.                                    test "Disabled in Guix"))
  228.                          disabled-tests)
  229.                (close-port unstable-tests)
  230.  
  231.                (substitute* "mysql-test/mysql-test-run.pl"
  232.                  (("/bin/ls") (which "ls"))
  233.                  (("/bin/sh") (which "sh")))
  234.                #t)))
  235.          (add-before 'configure 'disable-plugins
  236.            (lambda _
  237.              (let ((disable-plugin (lambda (name)
  238.                                      (call-with-output-file
  239.                                          (string-append "plugin/" name
  240.                                                         "/CMakeLists.txt")
  241.                                        (lambda (port)
  242.                                          (format port "\n")))))
  243.                    (disabled-plugins '(;; XXX: Causes a test failure.
  244.                                        "disks")))
  245.                (for-each disable-plugin disabled-plugins)
  246.                #t)))
  247.          (replace 'check
  248.            (lambda* (#:key (tests? #t) #:allow-other-keys)
  249.              (if tests?
  250.                  (with-directory-excursion "mysql-test"
  251.                    (invoke "./mtr" "--verbose"
  252.                            "--retry=3"
  253.                            "--testcase-timeout=40"
  254.                            "--suite-timeout=600"
  255.                            "--parallel" (number->string (parallel-job-count))
  256.                            "--skip-test-list=unstable-tests"))
  257.                  (format #t "test suite not run~%"))
  258.              #t))
  259.          (add-after
  260.           'install 'post-install
  261.           (lambda* (#:key outputs #:allow-other-keys)
  262.             (let* ((out     (assoc-ref outputs "out"))
  263.                    (test    (assoc-ref outputs "test")))
  264.               (substitute* (string-append out "/bin/mysql_install_db")
  265.                 (("basedir=\"\"")
  266.                  (string-append "basedir=\"" out "\"")))
  267.               ;; Remove unneeded files for testing.
  268.               (with-directory-excursion out
  269.                 (for-each delete-file-recursively
  270.                           '("data" "mysql-test" "sql-bench"
  271.                             "share/man/man1/mysql-test-run.pl.1"))
  272.                 ;; Delete huge and unnecessary executables.
  273.                 (for-each delete-file (find-files "bin" "(test|embedded)"))
  274.                 ;; And static libraries.
  275.                 (for-each delete-file (find-files "lib" "\\.a$")))
  276.               #t))))))
  277.     (native-inputs
  278.      `(("bison" ,bison)
  279.        ("perl" ,perl)))
  280.     (inputs
  281.      `(("jemalloc" ,jemalloc)
  282.        ("libaio" ,libaio)
  283.        ("libxml2" ,libxml2)
  284.        ("ncurses" ,ncurses)
  285.        ("pcre" ,pcre)
  286.        ("snappy" ,snappy)
  287.        ("xz" ,xz)
  288.        ("zlib" ,zlib)))
  289.     (propagated-inputs
  290.      ;; mariadb.pc says -lssl -lcrypto, so propagate it.
  291.      `(("openssl" ,openssl)))
  292.     ;; The test suite is very resource intensive and can take more than three
  293.     ;; hours on a x86_64 system.  Give slow and busy machines some leeway.
  294.     (properties '((timeout . 64800)))        ;18 hours
  295.     (home-page "https://mariadb.org/")
  296.     (synopsis "SQL database server")
  297.     (description
  298.      "MariaDB is a multi-user and multi-threaded SQL database server, designed
  299. as a drop-in replacement of MySQL.")
  300.     (license license:gpl2)))
  301.  
  302. mariadb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement