mariadb: Update from 10.1.23 to 10.2.6
[termux-packages] / packages / mariadb / build.sh
CommitLineData
f8cb5237 1TERMUX_PKG_HOMEPAGE=https://mariadb.org
4664501d 2TERMUX_PKG_DESCRIPTION="A drop-in replacement for mysql server"
d86664c3
FF
3TERMUX_PKG_VERSION=10.2.6
4TERMUX_PKG_SRCURL=https://ftp.osuosl.org/pub/mariadb/mariadb-$TERMUX_PKG_VERSION/source/mariadb-$TERMUX_PKG_VERSION.tar.gz
5TERMUX_PKG_SHA256=c385c76e40d6e5f0577eba021805da5f494a30c9ef51884baefe206d5658a2e5
4664501d 6TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
210798fc 7-DBISON_EXECUTABLE=`which bison`
4664501d 8-DBUILD_CONFIG=mysql_release
210798fc 9-DCAT_EXECUTABLE=`which cat`
4664501d
FF
10-DENABLED_LOCAL_INFILE=ON
11-DHAVE_UCONTEXT_H=False
12-DIMPORT_EXECUTABLES=$TERMUX_PKG_HOSTBUILD_DIR/import_executables.cmake
18640855 13-DINSTALL_LAYOUT=DEB
4664501d
FF
14-DINSTALL_UNIX_ADDRDIR=$TERMUX_PREFIX/tmp/mysqld.sock
15-DMYSQL_DATADIR=$TERMUX_PREFIX/var/lib/mysql
16-DPLUGIN_AUTH_GSSAPI_CLIENT=NO
17-DPLUGIN_AUTH_GSSAPI=NO
18-DPLUGIN_DAEMON_EXAMPLE=NO
19-DPLUGIN_EXAMPLE=NO
20-DPLUGIN_GSSAPI=NO
d86664c3 21-DPLUGIN_ROCKSDB=NO
b9fd243e 22-DPLUGIN_TOKUDB=NO
4664501d
FF
23-DSTACK_DIRECTION=-1
24-DTMPDIR=$TERMUX_PREFIX/tmp
25-DWITH_EXTRA_CHARSETS=complex
26-DWITH_JEMALLOC=OFF
c9d43c92 27-DWITH_MARIABACKUP=OFF
4664501d
FF
28-DWITH_PCRE=system
29-DWITH_READLINE=OFF
30-DWITH_SSL=system
31-DWITH_WSREP=False
210798fc
FF
32-DWITH_ZLIB=system
33-DWITH_INNODB_BZIP2=OFF
34-DWITH_INNODB_LZ4=OFF
35-DWITH_INNODB_LZMA=ON
36-DWITH_INNODB_LZO=OFF
37-DWITH_INNODB_SNAPPY=OFF
b9fd243e 38-DWITH_UNIT_TESTS=OFF
4664501d 39"
f8cb5237 40TERMUX_PKG_HOSTBUILD=true
210798fc 41TERMUX_PKG_DEPENDS="liblzma, ncurses, libedit, openssl, pcre, libcrypt, libandroid-support, libandroid-glob"
f8cb5237 42TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas"
f8cb5237 43TERMUX_PKG_CONFLICTS="mysql"
4664501d 44TERMUX_PKG_RM_AFTER_INSTALL="bin/mysqltest*"
53ea1579
FF
45# MariaDB doesn't support 32-bit off_t systems, see
46# https://bugs.mysql.com/bug.php?id=41309
47# It builds with -D_FILE_OFFSET_BITS=64 but the NDK only starts supporting
48# that with unified headers,
49# https://android.googlesource.com/platform/ndk/+/master/docs/UnifiedHeaders.md
50# The unified headers are new in the current NDK r14 release and contains some
51# issues which are being fixed for r15, at which time we'll probably switch to it.
52# In the meantime we don't build mariadb for 32-bit arches.
53TERMUX_PKG_BLACKLISTED_ARCHES="arm,i686"
f8cb5237
VB
54
55termux_step_host_build () {
56 termux_setup_cmake
d86664c3
FF
57 cmake -G "Unix Makefiles" \
58 $TERMUX_PKG_SRCDIR \
59 -DWITH_SSL=bundled \
60 -DCMAKE_BUILD_TYPE=Release
f8cb5237
VB
61 make -j $TERMUX_MAKE_PROCESSES import_executables
62}
63
64termux_step_pre_configure () {
65 # it will try to define off64_t with off_t if unset
66 # and 32 bit Android has wrong off_t defined
67 CPPFLAGS="$CPPFLAGS -Dushort=u_short -D__off64_t_defined"
68}
69
70termux_step_post_make_install () {
71 mkdir -p $TERMUX_PREFIX/var/lib/mysql
72 # files not needed
18640855 73 rm -r $TERMUX_PREFIX/{mysql-test,sql-bench}
f8cb5237
VB
74 rm $TERMUX_PREFIX/share/man/man1/mysql-test-run.pl.1
75}
76
77termux_step_create_debscripts () {
78 return
79 echo "echo 'Initializing mysql data directory...'" > postinst
80 echo "$TERMUX_PREFIX/bin/mysql_install_db --user=\`whoami\` --datadir=$TERMUX_PREFIX/var/lib/mysql --basedir=$TERMUX_PREFIX" >> postinst
81 echo "exit 0" >> postinst
82 chmod 0755 postinst
83}