1 ################################################################################
5 ################################################################################
7 MARIADB_VERSION = 10.1.31
8 MARIADB_SITE = https://downloads.mariadb.org/interstitial/mariadb-$(MARIADB_VERSION)/source
9 MARIADB_LICENSE = GPL-2.0 (server), GPL-2.0 with FLOSS exception (GPL client library), LGPL-2.0 (LGPL client library)
10 # Tarball no longer contains LGPL license text
11 # https://jira.mariadb.org/browse/MDEV-12297
12 MARIADB_LICENSE_FILES = README COPYING
13 MARIADB_INSTALL_STAGING = YES
14 MARIADB_PROVIDES = mysql
16 MARIADB_DEPENDENCIES = \
25 # We won't need unit tests
26 MARIADB_CONF_OPTS += -DWITH_UNIT_TESTS=0
28 # Mroonga needs libstemmer. Some work still needs to be done before it can be
29 # included in buildroot. Disable it for now.
30 MARIADB_CONF_OPTS += -DWITHOUT_MROONGA=1
32 # This value is determined automatically during straight compile by compiling
33 # and running a test code. You cannot do that during cross-compile. However the
34 # stack grows downward in most if not all modern systems. The only exception I
35 # am aware of is PA-RISC which is not supported by buildroot. Therefore it makes
36 # sense to hardcode the value. If an arch is added the stack of which grows up
37 # one should expect unpredictable behavior at run time.
38 MARIADB_CONF_OPTS += -DSTACK_DIRECTION=-1
40 # Jemalloc was added for TokuDB. Since its configure script seems somewhat broken
41 # when it comes to cross-compilation we shall disable it and also disable TokuDB.
42 MARIADB_CONF_OPTS += -DWITH_JEMALLOC=no -DWITHOUT_TOKUDB=1
44 # Make it explicit that we are cross-compiling
45 MARIADB_CONF_OPTS += -DCMAKE_CROSSCOMPILING=1
47 # Explicitly disable dtrace to avoid detection of a host version
48 MARIADB_CONF_OPTS += -DENABLE_DTRACE=0
50 ifeq ($(BR2_PACKAGE_MARIADB_SERVER),y)
51 MARIADB_CONF_OPTS += -DWITH_EMBEDDED_SERVER=ON
53 MARIADB_CONF_OPTS += -DWITHOUT_SERVER=ON
56 MARIADB_CONF_OPTS += \
57 -DINSTALL_DOCDIR=share/doc/mariadb-$(MARIADB_VERSION) \
58 -DINSTALL_DOCREADMEDIR=share/doc/mariadb-$(MARIADB_VERSION) \
59 -DINSTALL_MANDIR=share/man \
60 -DINSTALL_MYSQLSHAREDIR=share/mysql \
61 -DINSTALL_MYSQLTESTDIR=share/mysql/test \
62 -DINSTALL_PLUGINDIR=lib/mysql/plugin \
63 -DINSTALL_SBINDIR=sbin \
64 -DINSTALL_SCRIPTDIR=bin \
65 -DINSTALL_SQLBENCHDIR=share/mysql/bench \
66 -DINSTALL_SUPPORTFILESDIR=share/mysql \
67 -DMYSQL_DATADIR=/var/lib/mysql \
68 -DMYSQL_UNIX_ADDR=$(MYSQL_SOCKET)
70 HOST_MARIADB_CONF_OPTS += -DWITH_SSL=bundled
72 # Some helpers must be compiled for host in order to crosscompile mariadb for
73 # the target. They are then included by import_executables.cmake which is
74 # generated during the build of the host helpers. It is not necessary to build
75 # the whole host package, only the "import_executables" target.
76 # -DIMPORT_EXECUTABLES=$(HOST_MARIADB_BUILDDIR)/import_executables.cmake
77 # must then be passed to cmake during target build.
78 # see also https://mariadb.com/kb/en/mariadb/cross-compiling-mariadb/
79 HOST_MARIADB_MAKE_OPTS = import_executables
81 MARIADB_CONF_OPTS += \
82 -DIMPORT_EXECUTABLES=$(HOST_MARIADB_BUILDDIR)/import_executables.cmake
84 # Don't install host-mariadb. We just need to build import_executable
85 # Therefore only run 'true' and do nothing, not even the default action.
86 HOST_MARIADB_INSTALL_CMDS = true
88 ifeq ($(BR2_PACKAGE_MARIADB_SERVER),y)
90 mysql -1 mysql -1 * /var/lib/mysql - - MySQL Server
93 define MARIADB_INSTALL_INIT_SYSV
94 $(INSTALL) -D -m 0755 package/mariadb/S97mysqld \
95 $(TARGET_DIR)/etc/init.d/S97mysqld
98 define MARIADB_INSTALL_INIT_SYSTEMD
99 $(INSTALL) -D -m 644 package/mariadb/mysqld.service \
100 $(TARGET_DIR)/usr/lib/systemd/system/mysqld.service
101 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
102 ln -sf ../../../../usr/lib/systemd/system/mysqld.service \
103 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mysqld.service
107 define MARIADB_POST_INSTALL
108 mkdir -p $(TARGET_DIR)/var/lib/mysql
109 $(INSTALL) -D -m 644 $(TARGET_DIR)/usr/share/mysql/my-small.cnf \
110 $(TARGET_DIR)/etc/mysql/my.cnf
111 # We don't need this on the target as it's only useful in staging
112 $(RM) $(TARGET_DIR)/usr/bin/mysql_config
114 $(RM) -r $(TARGET_DIR)/usr/share/mysql/test
117 MARIADB_POST_INSTALL_TARGET_HOOKS += MARIADB_POST_INSTALL
119 $(eval $(cmake-package))
120 $(eval $(host-cmake-package))