mariadb.mk 4.3 KB

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