termux-packages/packages/mariadb/build.sh

88 lines
2.6 KiB
Bash
Raw Normal View History

TERMUX_PKG_HOMEPAGE=https://mariadb.org
TERMUX_PKG_DESCRIPTION="A drop-in replacement for mysql server"
2018-06-14 23:30:43 +02:00
TERMUX_PKG_VERSION=10.3.7
TERMUX_PKG_SHA256=e990afee6ae7cf9ac40154d0e150be359385dd6ef408ad80ea30df34e2c164cf
2017-06-16 23:26:46 +02:00
TERMUX_PKG_SRCURL=https://ftp.osuosl.org/pub/mariadb/mariadb-$TERMUX_PKG_VERSION/source/mariadb-$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DBISON_EXECUTABLE=`which bison`
-DGETCONF=`which getconf`
-DBUILD_CONFIG=mysql_release
-DCAT_EXECUTABLE=`which cat`
2017-06-18 02:28:07 +02:00
-DGSSAPI_FOUND=NO
2018-05-19 04:11:16 +02:00
-DGRN_WITH_LZ4=no
-DENABLED_LOCAL_INFILE=ON
-DHAVE_UCONTEXT_H=False
-DIMPORT_EXECUTABLES=$TERMUX_PKG_HOSTBUILD_DIR/import_executables.cmake
2017-04-10 16:59:29 +02:00
-DINSTALL_LAYOUT=DEB
-DINSTALL_UNIX_ADDRDIR=$TERMUX_PREFIX/tmp/mysqld.sock
-DINSTALL_SBINDIR=$TERMUX_PREFIX/bin
-DMYSQL_DATADIR=$TERMUX_PREFIX/var/lib/mysql
-DPLUGIN_AUTH_GSSAPI_CLIENT=OFF
-DPLUGIN_AUTH_GSSAPI=NO
2017-06-18 02:28:07 +02:00
-DPLUGIN_CONNECT=NO
-DPLUGIN_DAEMON_EXAMPLE=NO
-DPLUGIN_EXAMPLE=NO
-DPLUGIN_GSSAPI=OFF
2017-06-16 23:26:46 +02:00
-DPLUGIN_ROCKSDB=NO
-DPLUGIN_TOKUDB=OFF
-DSTACK_DIRECTION=-1
-DTMPDIR=$TERMUX_PREFIX/tmp
-DWITH_EXTRA_CHARSETS=complex
-DWITH_JEMALLOC=OFF
-DWITH_MARIABACKUP=OFF
-DWITH_PCRE=system
-DWITH_READLINE=OFF
-DWITH_SSL=system
-DWITH_WSREP=False
-DWITH_ZLIB=system
-DWITH_INNODB_BZIP2=OFF
-DWITH_INNODB_LZ4=OFF
-DWITH_INNODB_LZMA=ON
-DWITH_INNODB_LZO=OFF
-DWITH_INNODB_SNAPPY=OFF
-DWITH_UNIT_TESTS=OFF
"
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_DEPENDS="liblzma, ncurses, libedit, openssl, pcre, libcrypt, libandroid-support, libandroid-glob"
TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas"
TERMUX_PKG_CONFLICTS="mysql"
TERMUX_PKG_RM_AFTER_INSTALL="bin/mysqltest*"
termux_step_host_build () {
termux_setup_cmake
2017-06-16 23:26:46 +02:00
cmake -G "Unix Makefiles" \
$TERMUX_PKG_SRCDIR \
-DWITH_SSL=bundled \
-DCMAKE_BUILD_TYPE=Release
make -j $TERMUX_MAKE_PROCESSES import_executables
}
termux_step_pre_configure () {
2017-07-10 01:49:17 +02:00
CPPFLAGS+=" -Dushort=u_short"
if [ $TERMUX_ARCH_BITS = 32 ]; then
CPPFLAGS+=" -D__off64_t_defined -DTERMUX_EXPOSE_FILE_OFFSET64=1"
fi
if [ $TERMUX_ARCH = "i686" ]; then
# Avoid undefined reference to __atomic_load_8:
2017-07-02 21:41:14 +02:00
CFLAGS+=" -latomic"
fi
}
termux_step_post_make_install () {
# files not needed
2017-04-10 16:59:29 +02:00
rm -r $TERMUX_PREFIX/{mysql-test,sql-bench}
rm $TERMUX_PREFIX/share/man/man1/mysql-test-run.pl.1
}
termux_step_create_debscripts () {
echo "if [ ! -e "$TERMUX_PREFIX/var/lib/mysql" ]; then" > postinst
echo " echo 'Initializing mysql data directory...'" >> postinst
echo " mkdir -p $TERMUX_PREFIX/var/lib/mysql" >> postinst
echo " $TERMUX_PREFIX/bin/mysql_install_db --user=\`whoami\` --datadir=$TERMUX_PREFIX/var/lib/mysql --basedir=$TERMUX_PREFIX" >> postinst
echo "fi" >> postinst
echo "exit 0" >> postinst
chmod 0755 postinst
}