diff --git a/packages/databases/mysql/package.mk b/packages/databases/mysql/package.mk index 5a25693162..c4e54e4f58 100644 --- a/packages/databases/mysql/package.mk +++ b/packages/databases/mysql/package.mk @@ -1,100 +1,110 @@ ################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv) +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2016 Team LibreELEC # -# OpenELEC is free software: you can redistribute it and/or modify +# LibreELEC is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # -# OpenELEC is distributed in the hope that it will be useful, +# LibreELEC is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with OpenELEC. If not, see . +# along with LibreELEC. If not, see . ################################################################################ PKG_NAME="mysql" -PKG_VERSION="5.1.73" +PKG_VERSION="5.7.12" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="LGPL" PKG_SITE="http://www.mysql.com" -PKG_URL="http://ftp.gwdg.de/pub/misc/$PKG_NAME/Downloads/MySQL-5.1/$PKG_NAME-$PKG_VERSION.tar.gz" +PKG_URL="http://ftp.gwdg.de/pub/misc/$PKG_NAME/Downloads/MySQL-5.7/$PKG_NAME-$PKG_VERSION.tar.gz" PKG_DEPENDS_HOST="zlib:host" -PKG_DEPENDS_TARGET="toolchain zlib netbsd-curses libressl mysql:host" +PKG_DEPENDS_TARGET="toolchain zlib netbsd-curses libressl boost mysql:host" PKG_PRIORITY="optional" PKG_SECTION="database" PKG_SHORTDESC="mysql: A database server" PKG_LONGDESC="MySQL is a SQL (Structured Query Language) database server. SQL is the most popular database language in the world. MySQL is a client server implementation that consists of a server daemon mysqld and many different client programs/libraries." PKG_IS_ADDON="no" -PKG_AUTORECONF="yes" +PKG_AUTORECONF="no" -TARGET_CFLAGS="$TARGET_CFLAGS -fPIC -DPIC" +post_unpack() { + sed -i 's|OPENSSL_MAJOR_VERSION STREQUAL "1"|OPENSSL_MAJOR_VERSION STREQUAL "2"|' $ROOT/$PKG_BUILD/cmake/ssl.cmake + sed -i 's|GET_TARGET_PROPERTY(LIBMYSQL_OS_OUTPUT_NAME libmysql OUTPUT_NAME)|SET(LIBMYSQL_OS_OUTPUT_NAME "mysqlclient")|' $ROOT/$PKG_BUILD/scripts/CMakeLists.txt + sed -i "s|COMMAND comp_err|COMMAND $ROOT/$TOOLCHAIN/bin/comp_err|" $ROOT/$PKG_BUILD/extra/CMakeLists.txt + sed -i "s|COMMAND comp_sql|COMMAND $ROOT/$TOOLCHAIN/bin/comp_sql|" $ROOT/$PKG_BUILD/scripts/CMakeLists.txt + sed -i "s|COMMAND gen_lex_hash|COMMAND $ROOT/$TOOLCHAIN/bin/gen_lex_hash|" $ROOT/$PKG_BUILD/sql/CMakeLists.txt -PKG_CONFIGURE_OPTS_HOST="--with-zlib-dir=$ROOT/$TOOLCHAIN" + sed -i '/^IF(NOT BOOST_MINOR_VERSION.*$/,/^ENDIF()$/d' $ROOT/$PKG_BUILD/cmake/boost.cmake +} -PKG_CONFIGURE_OPTS_TARGET="ac_cv_c_stack_direction=-1 \ - ac_cv_sys_restartable_syscalls=yes \ - --localstatedir=/storage/.mysql \ - --with-unix-socket-path=/var/tmp/mysql.socket \ - --with-tcp-port=3306 \ - --enable-static \ - --with-ssl=$SYSROOT_PREFIX/usr/lib \ - --disable-shared \ - --with-low-memory \ - --enable-largefile \ - --with-big-tables \ - --with-mysqld-user=mysqld \ - --with-extra-charsets=all \ - --with-pthread \ - --with-named-thread-libs=-lpthread \ - --enable-thread-safe-client \ - --enable-assembler \ - --enable-local-infile \ - --without-debug \ - --without-docs \ - --without-man \ - --with-readline \ - --without-libwrap \ - --without-pstack \ - --without-server \ - --without-embedded-server \ - --without-libedit \ - --with-query-cache \ - --without-plugin-partition \ - --without-plugin-daemon_example \ - --without-plugin-ftexample \ - --without-plugin-archive \ - --without-plugin-blackhole \ - --without-plugin-example \ - --without-plugin-federated \ - --without-plugin-ibmdb2i \ - --without-plugin-innobase \ - --without-plugin-innodb_plugin \ - --without-plugin-ndbcluster" +configure_host() { + cmake -DCMAKE_PREFIX_PATH=$ROOT/$TOOLCHAIN/ \ + -DCMAKE_BUILD_TYPE=Release \ + -DWITHOUT_SERVER=OFF \ + -DWITH_EMBEDDED_SERVER=OFF \ + -DWITH_INNOBASE_STORAGE_ENGINE=OFF \ + -DWITH_PARTITION_STORAGE_ENGINE=OFF \ + -DWITH_PERFSCHEMA_STORAGE_ENGINE=OFF \ + -DWITH_EXTRA_CHARSETS=none \ + -DWITH_EDITLINE=bundled \ + -DWITH_LIBEVENT=bundled \ + -DDOWNLOAD_BOOST=0 \ + -DLOCAL_BOOST_DIR=$(get_build_dir boost) \ + -DWITH_UNIT_TESTS=OFF \ + -DWITH_ZLIB=bundled \ + .. +} make_host() { - make -C include my_config.h - make -C mysys libmysys.a - make -C strings libmystrings.a - make -C dbug factorial - make -C vio libvio.a - make -C dbug libdbug.a - make -C regex libregex.a - make -C sql gen_lex_hash - make -C scripts comp_sql - make -C extra comp_err + make comp_err + make gen_lex_hash + make comp_sql +} + +post_make_host() { + # needed so the binary isn't built for target + cp scripts/comp_sql ../scripts/comp_sql } makeinstall_host() { - cp -PR dbug/factorial $ROOT/$TOOLCHAIN/bin/mysql-factorial - cp -PR sql/gen_lex_hash $ROOT/$TOOLCHAIN/bin/mysql-gen_lex_hash - cp -PR scripts/comp_sql $ROOT/$TOOLCHAIN/bin/mysql-comp_sql - cp -PR extra/comp_err $ROOT/$TOOLCHAIN/bin/mysql-comp_err + cp -P extra/comp_err $ROOT/$TOOLCHAIN/bin + cp -P sql/gen_lex_hash $ROOT/$TOOLCHAIN/bin + cp -P scripts/comp_sql $ROOT/$TOOLCHAIN/bin +} + +configure_target() { + cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \ + -DCMAKE_PREFIX_PATH=$SYSROOT_PREFIX/usr \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DINSTALL_INCLUDEDIR=include/mysql \ + -DCMAKE_BUILD_TYPE=Release \ + -DFEATURE_SET=classic \ + -DDISABLE_SHARED=ON \ + -DENABLE_DTRACE=OFF \ + -DWITH_EMBEDDED_SERVER=OFF \ + -DWITH_INNOBASE_STORAGE_ENGINE=OFF \ + -DWITH_PARTITION_STORAGE_ENGINE=OFF \ + -DWITH_PERFSCHEMA_STORAGE_ENGINE=OFF \ + -DWITH_EXTRA_CHARSETS=all \ + -DWITH_UNIT_TESTS=OFF \ + -DWITHOUT_SERVER=ON \ + -DWITH_EDITLINE=bundled \ + -DWITH_LIBEVENT=bundled \ + -DWITH_ZLIB=system \ + -DWITH_SSL=$SYSROOT_PREFIX/usr \ + -DDOWNLOAD_BOOST=0 \ + -DLOCAL_BOOST_DIR=$(get_build_dir boost) \ + -DSTACK_DIRECTION=1 \ + -DHAVE_LLVM_LIBCPP=1 \ + -DCMAKE_C_FLAGS="-fPIC ${CFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer -fno-delete-null-pointer-checks" \ + -DCMAKE_CXX_FLAGS="-fPIC ${CXXFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -felide-constructors -fno-delete-null-pointer-checks" \ + .. } post_makeinstall_target() { @@ -102,13 +112,6 @@ post_makeinstall_target() { sed -i "s|pkglibdir=.*|pkglibdir=\'$SYSROOT_PREFIX/usr/lib/mysql\'|" scripts/mysql_config cp scripts/mysql_config $SYSROOT_PREFIX/usr/bin ln -sf $SYSROOT_PREFIX/usr/bin/mysql_config $ROOT/$TOOLCHAIN/bin/mysql_config - - for i in `ls -d $SYSROOT_PREFIX/usr/lib/mysql/*.a`; do - ln -v -sf $i $SYSROOT_PREFIX/usr/lib - done - - rm -rf $INSTALL/usr/bin - rm -rf $INSTALL/usr/mysql-test - rm -rf $INSTALL/usr/share/mysql - rm -rf $INSTALL/usr/sql-bench + + rm -rf $INSTALL } diff --git a/packages/databases/mysql/patches/mysql-0001-link-against-termcap.patch b/packages/databases/mysql/patches/mysql-0001-link-against-termcap.patch new file mode 100644 index 0000000000..033763f9d6 --- /dev/null +++ b/packages/databases/mysql/patches/mysql-0001-link-against-termcap.patch @@ -0,0 +1,12 @@ +diff -Naur a/client/CMakeLists.txt b/client/CMakeLists.txt +--- a/client/CMakeLists.txt 2016-03-28 11:06:12.000000000 -0700 ++++ b/client/CMakeLists.txt 2016-05-19 02:34:38.828457442 -0700 +@@ -44,7 +44,7 @@ + MYSQL_ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc ../sql-common/sql_string.cc) + TARGET_LINK_LIBRARIES(mysql mysqlclient) + IF(UNIX) +- TARGET_LINK_LIBRARIES(mysql ${EDITLINE_LIBRARY}) ++ TARGET_LINK_LIBRARIES(mysql ${EDITLINE_LIBRARY} termcap) + ENDIF(UNIX) + + IF(NOT WITHOUT_SERVER) diff --git a/packages/databases/mysql/patches/mysql-010_crosscompiling.patch b/packages/databases/mysql/patches/mysql-010_crosscompiling.patch deleted file mode 100644 index b6c3e068a1..0000000000 --- a/packages/databases/mysql/patches/mysql-010_crosscompiling.patch +++ /dev/null @@ -1,128 +0,0 @@ -diff -Naur mysql-5.1.38/dbug/Makefile.am mysql-5.1.38.patch/dbug/Makefile.am ---- mysql-5.1.38/dbug/Makefile.am 2009-08-21 14:09:22.000000000 +0200 -+++ mysql-5.1.38.patch/dbug/Makefile.am 2009-09-10 02:57:59.000000000 +0200 -@@ -44,19 +44,19 @@ - -groff -mm user.r > $@ - - output1.r: factorial -- ./factorial 1 2 3 4 5 | cat > $@ -+ mysql-factorial 1 2 3 4 5 | cat > $@ - - output2.r: factorial -- ./factorial -\#t:o 2 3 | cat >$@ -+ mysql-factorial -\#t:o 2 3 | cat >$@ - - output3.r: factorial -- ./factorial -\#d:t:o 3 | cat >$@ -+ mysql-factorial -\#d:t:o 3 | cat >$@ - - output4.r: factorial -- ./factorial -\#d,result:o 4 | cat >$@ -+ mysql-factorial -\#d,result:o 4 | cat >$@ - - output5.r: factorial -- ./factorial -\#d:f,factorial:F:L:o 3 | cat >$@ -+ mysql-factorial -\#d:f,factorial:F:L:o 3 | cat >$@ - .c.r: - @RM@ -f $@ - @SED@ -e 's!\\!\\\\!g' $< > $@ -diff -Naur mysql-5.1.38/dbug/Makefile.in mysql-5.1.38.patch/dbug/Makefile.in ---- mysql-5.1.38/dbug/Makefile.in 2009-08-21 14:17:15.000000000 +0200 -+++ mysql-5.1.38.patch/dbug/Makefile.in 2009-09-10 02:58:14.000000000 +0200 -@@ -746,19 +746,19 @@ - -groff -mm user.r > $@ - - output1.r: factorial -- ./factorial 1 2 3 4 5 | cat > $@ -+ mysql-factorial 1 2 3 4 5 | cat > $@ - - output2.r: factorial -- ./factorial -\#t:o 2 3 | cat >$@ -+ mysql-factorial -\#t:o 2 3 | cat >$@ - - output3.r: factorial -- ./factorial -\#d:t:o 3 | cat >$@ -+ mysql-factorial -\#d:t:o 3 | cat >$@ - - output4.r: factorial -- ./factorial -\#d,result:o 4 | cat >$@ -+ mysql-factorial -\#d,result:o 4 | cat >$@ - - output5.r: factorial -- ./factorial -\#d:f,factorial:F:L:o 3 | cat >$@ -+ mysql-factorial -\#d:f,factorial:F:L:o 3 | cat >$@ - .c.r: - @RM@ -f $@ - @SED@ -e 's!\\!\\\\!g' $< > $@ -diff -Naur mysql-5.1.38/extra/Makefile.am mysql-5.1.38.patch/extra/Makefile.am ---- mysql-5.1.38/extra/Makefile.am 2009-08-21 14:09:23.000000000 +0200 -+++ mysql-5.1.38.patch/extra/Makefile.am 2009-09-10 02:53:50.000000000 +0200 -@@ -32,7 +32,7 @@ - $(top_builddir)/include/mysqld_error.h: comp_err.c \ - $(top_srcdir)/sql/share/errmsg.txt - $(MAKE) $(AM_MAKEFLAGS) comp_err$(EXEEXT) -- $(top_builddir)/extra/comp_err$(EXEEXT) \ -+ mysql-comp_err$(EXEEXT) \ - --charset=$(top_srcdir)/sql/share/charsets \ - --out-dir=$(top_builddir)/sql/share/ \ - --header_file=$(top_builddir)/include/mysqld_error.h \ -diff -Naur mysql-5.1.38/extra/Makefile.in mysql-5.1.38.patch/extra/Makefile.in ---- mysql-5.1.38/extra/Makefile.in 2009-08-21 14:17:16.000000000 +0200 -+++ mysql-5.1.38.patch/extra/Makefile.in 2009-09-10 02:53:16.000000000 +0200 -@@ -936,7 +936,7 @@ - $(top_builddir)/include/mysqld_error.h: comp_err.c \ - $(top_srcdir)/sql/share/errmsg.txt - $(MAKE) $(AM_MAKEFLAGS) comp_err$(EXEEXT) -- $(top_builddir)/extra/comp_err$(EXEEXT) \ -+ mysql-comp_err$(EXEEXT) \ - --charset=$(top_srcdir)/sql/share/charsets \ - --out-dir=$(top_builddir)/sql/share/ \ - --header_file=$(top_builddir)/include/mysqld_error.h \ -diff -Naur mysql-5.1.38/scripts/Makefile.am mysql-5.1.38.patch/scripts/Makefile.am ---- mysql-5.1.38/scripts/Makefile.am 2009-08-21 14:11:26.000000000 +0200 -+++ mysql-5.1.38.patch/scripts/Makefile.am 2009-09-10 02:57:01.000000000 +0200 -@@ -121,7 +121,7 @@ - mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql - $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT) - sleep 2 -- $(top_builddir)/scripts/comp_sql$(EXEEXT) \ -+ mysql-comp_sql$(EXEEXT) \ - mysql_fix_privilege_tables \ - $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@ - -diff -Naur mysql-5.1.38/scripts/Makefile.in mysql-5.1.38.patch/scripts/Makefile.in ---- mysql-5.1.38/scripts/Makefile.in 2009-08-21 14:17:23.000000000 +0200 -+++ mysql-5.1.38.patch/scripts/Makefile.in 2009-09-10 02:57:11.000000000 +0200 -@@ -802,7 +802,7 @@ - mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql - $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT) - sleep 2 -- $(top_builddir)/scripts/comp_sql$(EXEEXT) \ -+ mysql-comp_sql$(EXEEXT) \ - mysql_fix_privilege_tables \ - $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@ - -diff -Naur mysql-5.1.38/sql/Makefile.am mysql-5.1.38.patch/sql/Makefile.am ---- mysql-5.1.38/sql/Makefile.am 2009-08-21 14:12:24.000000000 +0200 -+++ mysql-5.1.38.patch/sql/Makefile.am 2009-09-10 02:55:09.000000000 +0200 -@@ -174,7 +174,7 @@ - # this avoid the rebuild of the built files in a source dist - lex_hash.h: gen_lex_hash.cc lex.h - $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT) -- ./gen_lex_hash$(EXEEXT) > $@-t -+ mysql-gen_lex_hash$(EXEEXT) > $@-t - $(MV) $@-t $@ - - # For testing of udf_example.so -diff -Naur mysql-5.1.38/sql/Makefile.in mysql-5.1.38.patch/sql/Makefile.in ---- mysql-5.1.38/sql/Makefile.in 2009-08-21 14:17:25.000000000 +0200 -+++ mysql-5.1.38.patch/sql/Makefile.in 2009-09-10 02:55:22.000000000 +0200 -@@ -1302,7 +1302,7 @@ - # this avoid the rebuild of the built files in a source dist - lex_hash.h: gen_lex_hash.cc lex.h - $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT) -- ./gen_lex_hash$(EXEEXT) > $@-t -+ mysql-gen_lex_hash$(EXEEXT) > $@-t - $(MV) $@-t $@ - - # We might have some stuff not built in this build, but that we want to install diff --git a/packages/databases/mysql/patches/mysql-011_mysql_config-dont-include-LDFLAGS-in-libs-output.patch b/packages/databases/mysql/patches/mysql-011_mysql_config-dont-include-LDFLAGS-in-libs-output.patch deleted file mode 100644 index db13465d26..0000000000 --- a/packages/databases/mysql/patches/mysql-011_mysql_config-dont-include-LDFLAGS-in-libs-output.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 161d55d84441bd3b66eba9eafd85782eeb168cdd Mon Sep 17 00:00:00 2001 -From: Stefan Saraev -Date: Fri, 28 Mar 2014 13:12:50 +0200 -Subject: [PATCH] mysql_config: dont include LDFLAGS in --libs output - ---- - scripts/mysql_config.sh | 6 +++--- - 1 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh -index 7dc9beb..eb188b6 100644 ---- a/scripts/mysql_config.sh -+++ b/scripts/mysql_config.sh -@@ -105,10 +105,10 @@ fi - - # Create options - # We intentionally add a space to the beginning and end of lib strings, simplifies replace later --libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" -+libs=" -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" - libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ " --libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@ " --embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ @openssl_libs@ " -+libs_r=" -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@ " -+embedded_libs=" -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ @openssl_libs@ " - - if [ -r "$pkglibdir/libmygcc.a" ]; then - # When linking against the static library with a different version of GCC --- -1.7.2.5 -