2013-07-21 17:13:21 +02:00
################################################################################
2016-05-19 13:28:14 -07:00
# This file is part of LibreELEC - https://libreelec.tv
2017-08-18 19:25:48 +02:00
# Copyright (C) 2016-present Team LibreELEC
2013-07-21 17:13:21 +02:00
#
2016-05-19 13:28:14 -07:00
# LibreELEC is free software: you can redistribute it and/or modify
2013-07-21 17:13:21 +02:00
# it under the terms of the GNU General Public License as published by
2013-12-21 21:51:48 +01:00
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
2013-07-21 17:13:21 +02:00
#
2016-05-19 13:28:14 -07:00
# LibreELEC is distributed in the hope that it will be useful,
2013-07-21 17:13:21 +02:00
# but WITHOUT ANY WARRANTY; without even the implied warranty of
2013-12-21 21:51:48 +01:00
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2013-07-21 17:13:21 +02:00
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
2016-05-19 13:28:14 -07:00
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
2013-07-21 17:13:21 +02:00
################################################################################
PKG_NAME = "mysql"
2018-01-06 12:19:29 +00:00
PKG_VERSION = "5.7.20"
PKG_SHA256 = "5397549bb7c238f396c123db2df4cad2191b11adf8986de7fe63bff8e2786487"
2013-07-21 17:13:21 +02:00
PKG_ARCH = "any"
PKG_LICENSE = "LGPL"
PKG_SITE = "http://www.mysql.com"
2016-05-19 13:28:14 -07:00
PKG_URL = " http://ftp.gwdg.de/pub/misc/ $PKG_NAME /Downloads/MySQL-5.7/ $PKG_NAME - $PKG_VERSION .tar.gz "
2016-11-13 12:44:21 +01:00
PKG_DEPENDS_HOST = "toolchain zlib:host"
2017-08-18 19:25:48 +02:00
PKG_DEPENDS_TARGET = "toolchain zlib ncurses openssl boost mysql:host"
2013-07-21 17:13:21 +02:00
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."
2016-05-19 13:28:14 -07:00
p o s t _ u n p a c k ( ) {
2017-02-17 06:40:16 +00:00
sed -i 's|GET_TARGET_PROPERTY(LIBMYSQL_OS_OUTPUT_NAME libmysql OUTPUT_NAME)|SET(LIBMYSQL_OS_OUTPUT_NAME "mysqlclient")|' $PKG_BUILD /scripts/CMakeLists.txt
sed -i " s|COMMAND comp_err|COMMAND $TOOLCHAIN /bin/comp_err| " $PKG_BUILD /extra/CMakeLists.txt
sed -i " s|COMMAND comp_sql|COMMAND $TOOLCHAIN /bin/comp_sql| " $PKG_BUILD /scripts/CMakeLists.txt
sed -i " s|COMMAND gen_lex_hash|COMMAND $TOOLCHAIN /bin/gen_lex_hash| " $PKG_BUILD /sql/CMakeLists.txt
2013-08-19 16:53:55 +02:00
2017-02-17 06:40:16 +00:00
sed -i '/^IF(NOT BOOST_MINOR_VERSION.*$/,/^ENDIF()$/d' $PKG_BUILD /cmake/boost.cmake
2016-05-19 13:28:14 -07:00
}
2013-07-21 17:13:21 +02:00
2016-09-23 14:29:49 -07:00
PKG_CMAKE_OPTS_HOST = " -DCMAKE_BUILD_TYPE=Release \
-DSTACK_DIRECTION= -1 \
-DHAVE_LLVM_LIBCPP_EXITCODE= 0 \
-DHAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE_EXITCODE= 0 \
-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"
2013-07-21 17:13:21 +02:00
2017-01-11 18:34:07 +01:00
i f [ "$DEBUG" = y e s - a "$TARGET_ARCH" = a a r c h 6 4 ] ; t h e n
pre_configure_target( ) {
strip_lto
}
f i
2013-07-21 17:13:21 +02:00
m a k e _ h o s t ( ) {
2016-12-02 11:22:20 -08:00
ninja comp_err
ninja gen_lex_hash
ninja comp_sql
2016-05-19 13:28:14 -07:00
}
p o s t _ m a k e _ h o s t ( ) {
# needed so the binary isn't built for target
cp scripts/comp_sql ../scripts/comp_sql
2013-07-21 17:13:21 +02:00
}
m a k e i n s t a l l _ h o s t ( ) {
2017-02-17 06:40:16 +00:00
cp -P extra/comp_err $TOOLCHAIN /bin
cp -P sql/gen_lex_hash $TOOLCHAIN /bin
cp -P scripts/comp_sql $TOOLCHAIN /bin
2016-05-19 13:28:14 -07:00
}
2016-09-23 14:29:49 -07:00
PKG_CMAKE_OPTS_TARGET = " -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"
2013-07-21 17:13:21 +02:00
p o s t _ m a k e i n s t a l l _ t a r g e t ( ) {
sed -i " s|pkgincludedir=.*|pkgincludedir=\' $SYSROOT_PREFIX /usr/include/mysql\'| " scripts/mysql_config
sed -i " s|pkglibdir=.*|pkglibdir=\' $SYSROOT_PREFIX /usr/lib/mysql\'| " scripts/mysql_config
2013-08-19 16:54:04 +02:00
cp scripts/mysql_config $SYSROOT_PREFIX /usr/bin
2017-02-17 06:40:16 +00:00
ln -sf $SYSROOT_PREFIX /usr/bin/mysql_config $TOOLCHAIN /bin/mysql_config
2016-09-23 14:29:49 -07:00
2016-05-19 13:28:14 -07:00
rm -rf $INSTALL
2013-07-21 17:13:21 +02:00
}