X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/b9fd243e354324850f35d05db773f8bfdac99e0d..f252068260cd4a0d8abcaf8fa3b0f9328854d707:/packages/mariadb/build.sh diff --git a/packages/mariadb/build.sh b/packages/mariadb/build.sh index e7f6f183..74a9e20e 100644 --- a/packages/mariadb/build.sh +++ b/packages/mariadb/build.sh @@ -1,23 +1,27 @@ TERMUX_PKG_HOMEPAGE=https://mariadb.org TERMUX_PKG_DESCRIPTION="A drop-in replacement for mysql server" -TERMUX_PKG_VERSION=10.1.23 -TERMUX_PKG_SRCURL=http://mirror.fibergrid.in/mariadb/mariadb-$TERMUX_PKG_VERSION/source/mariadb-$TERMUX_PKG_VERSION.tar.gz -TERMUX_PKG_SHA256=54d8114e24bfa5e3ebdc7d69e071ad1471912847ea481b227d204f9d644300bf +TERMUX_PKG_VERSION=10.2.7 +TERMUX_PKG_SHA256=225ba1bbc48325ad38a9f433ff99da4641028f42404a29591cc370e4a676c0bc +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` -DBUILD_CONFIG=mysql_release -DCAT_EXECUTABLE=`which cat` +-DGSSAPI_FOUND=NO -DENABLED_LOCAL_INFILE=ON -DHAVE_UCONTEXT_H=False -DIMPORT_EXECUTABLES=$TERMUX_PKG_HOSTBUILD_DIR/import_executables.cmake -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=NO -DPLUGIN_AUTH_GSSAPI=NO +-DPLUGIN_CONNECT=NO -DPLUGIN_DAEMON_EXAMPLE=NO -DPLUGIN_EXAMPLE=NO -DPLUGIN_GSSAPI=NO +-DPLUGIN_ROCKSDB=NO -DPLUGIN_TOKUDB=NO -DSTACK_DIRECTION=-1 -DTMPDIR=$TERMUX_PREFIX/tmp @@ -41,39 +45,41 @@ TERMUX_PKG_DEPENDS="liblzma, ncurses, libedit, openssl, pcre, libcrypt, libandro TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas" TERMUX_PKG_CONFLICTS="mysql" TERMUX_PKG_RM_AFTER_INSTALL="bin/mysqltest*" -# MariaDB doesn't support 32-bit off_t systems, see -# https://bugs.mysql.com/bug.php?id=41309 -# It builds with -D_FILE_OFFSET_BITS=64 but the NDK only starts supporting -# that with unified headers, -# https://android.googlesource.com/platform/ndk/+/master/docs/UnifiedHeaders.md -# The unified headers are new in the current NDK r14 release and contains some -# issues which are being fixed for r15, at which time we'll probably switch to it. -# In the meantime we don't build mariadb for 32-bit arches. -TERMUX_PKG_BLACKLISTED_ARCHES="arm,i686" termux_step_host_build () { termux_setup_cmake - cmake -G "Unix Makefiles" $TERMUX_PKG_SRCDIR -DCMAKE_BUILD_TYPE=Release + 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 () { - # it will try to define off64_t with off_t if unset - # and 32 bit Android has wrong off_t defined - CPPFLAGS="$CPPFLAGS -Dushort=u_short -D__off64_t_defined" + 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: + CFLAGS+=" -latomic" + fi } termux_step_post_make_install () { - mkdir -p $TERMUX_PREFIX/var/lib/mysql # files not needed rm -r $TERMUX_PREFIX/{mysql-test,sql-bench} rm $TERMUX_PREFIX/share/man/man1/mysql-test-run.pl.1 } termux_step_create_debscripts () { - return - echo "echo 'Initializing mysql data directory...'" > postinst - echo "$TERMUX_PREFIX/bin/mysql_install_db --user=\`whoami\` --datadir=$TERMUX_PREFIX/var/lib/mysql --basedir=$TERMUX_PREFIX" >> postinst + 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 }