diff options
Diffstat (limited to 'meta-oe/recipes-dbs/mysql')
27 files changed, 1407 insertions, 0 deletions
diff --git a/meta-oe/recipes-dbs/mysql/mariadb-native_10.11.7.bb b/meta-oe/recipes-dbs/mysql/mariadb-native_10.11.7.bb new file mode 100644 index 0000000000..578357b480 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb-native_10.11.7.bb @@ -0,0 +1,23 @@ +require mariadb.inc +inherit native + +PROVIDES += "mysql5-native" +DEPENDS = "ncurses-native zlib-native bison-native libpcre2-native \ +gnutls-native fmt-native \ +" + +RDEPENDS:${PN} = "" +PACKAGES = "" +EXTRA_OEMAKE = "" + +do_install() { + oe_runmake 'DESTDIR=${D}' install + + install -d ${D}${bindir} + install -m 0755 sql/gen_lex_hash ${D}${bindir}/ + install -m 0755 sql/gen_lex_token ${D}${bindir}/ + install -m 0755 extra/comp_err ${D}${bindir}/ + install -m 0755 scripts/comp_sql ${D}${bindir}/ + install -m 0755 strings/uca-dump ${D}${bindir}/ +} + diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc new file mode 100644 index 0000000000..695965f7d2 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb.inc @@ -0,0 +1,357 @@ +SUMMARY = "A robust, scalable, and reliable SQL server" +HOMEPAGE = "http://mariadb.org" +SECTION = "libs" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=b1becf0cfa3366e0f4d854d1d264f311" + +SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \ + file://my.cnf \ + file://mysqld.service \ + file://install_db.service \ + file://install_db \ + file://mysql-systemd-start \ + file://configure.cmake-fix-valgrind.patch \ + file://support-files-CMakeLists.txt-fix-do_populate_sysroot.patch \ + file://fix-arm-atomic.patch \ + file://0001-Fix-library-LZ4-lookup.patch \ + file://0001-innobase-Define-__NR_futex-if-it-does-not-exist.patch \ + file://0001-aio_linux-Check-if-syscall-exists-before-using-it.patch \ + file://ssize_t.patch \ + file://mm_malloc.patch \ + file://sys_futex.patch \ + file://cross-compiling.patch \ + file://0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch \ + file://lfs64.patch \ + file://0001-Add-missing-includes-cstdint-and-cstdio.patch \ + file://0001-Remove-the-compile_time_assert-lines.patch \ + file://0001-MDEV-33439-Fix-build-with-libxml2-2.12.patch \ + " +SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch" +SRC_URI[sha256sum] = "5239a245ed90517e96396605cd01ccd8f73cd7442d1b3076b6ffe258110e5157" + +UPSTREAM_CHECK_URI = "https://github.com/MariaDB/server/releases" + +BINCONFIG_GLOB = "mysql_config" + +inherit cmake gettext binconfig update-rc.d systemd multilib_script pkgconfig + +MULTILIB_SCRIPTS = "${PN}-server:${bindir}/mariadbd-safe \ + ${PN}-setupdb:${bindir}/mariadb-install-db" + +INITSCRIPT_PACKAGES = "${PN}-server ${PN}-setupdb" +INITSCRIPT_NAME:${PN}-server = "mysqld" +INITSCRIPT_PARAMS:${PN}-server ?= "start 45 5 . stop 45 0 6 1 ." + +INITSCRIPT_NAME:${PN}-setupdb = "install_db" +INITSCRIPT_PARAMS:${PN}-setupdb ?= "defaults 44 44" + +SYSTEMD_PACKAGES = "${PN}-server ${PN}-setupdb" +SYSTEMD_SERVICE:${PN}-server = "mysqld.service" +SYSTEMD_AUTO_ENABLE:${PN}-server ?= "disable" + +SYSTEMD_SERVICE:${PN}-setupdb = "install_db.service" +SYSTEMD_AUTO_ENABLE:${PN}-setupdb ?= "enable" +ALLOW_EMPTY:${PN}-setupdb ?= "1" +FILES:${PN}-setupdb = "${sysconfdir}/init.d/install_db \ + ${bindir}/mariadb-install-db \ + ${bindir}/my_print_defaults \ + ${bindir}/mysql_install_db \ + ${bindir}/mysql-systemd-start \ + " + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} lz4 openssl" +EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'" + +PACKAGECONFIG:class-native = "" +PACKAGECONFIG[pam] = "-DPLUGIN_AUTH_PAM=YES,-DPLUGIN_AUTH_PAM=NO,libpam" +PACKAGECONFIG[valgrind] = "-DWITH_VALGRIND=TRUE,-DWITH_VALGRIND=FALSE,valgrind" +PACKAGECONFIG[krb5] = ", ,krb5" +PACKAGECONFIG[lz4] = ", ,lz4" +PACKAGECONFIG[openssl] = "-DWITH_SSL='system',-DWITH_SSL='bundled',openssl" + +# MariaDB doesn't link properly with gold +# https://mariadb.atlassian.net/browse/MDEV-5982 +TARGET_CFLAGS += "-fuse-ld=bfd" +LDFLAGS += " -pthread" + +BUILD_CFLAGS += "-fuse-ld=bfd" +BUILD_CXXFLAGS += "-fuse-ld=bfd" + +LDFLAGS:x86:toolchain-clang = "-latomic" +LDFLAGS:riscv32:toolchain-clang = "-latomic" + +EXTRA_OECMAKE = "-DWITH_EMBEDDED_SERVER=ON \ + -DWITH_JEMALLOC=no \ + -DWITHOUT_TOKUDB=TRUE \ + -DCMAKE_DISABLE_FIND_PACKAGE_Boost=TRUE \ + -DGROFF=FALSE \ + -DNROFF=FALSE \ + -DENABLE_DTRACE=FALSE \ + -DWITH_PIC=ON \ + -DWITH_PCRE=system \ + -DINSTALL_LAYOUT=RPM \ + -DINSTALL_DOCDIR:PATH=${datadir}/doc/${BPN} \ + -DINSTALL_LIBDIR:PATH=${baselib} \ + -DINSTALL_PLUGINDIR:PATH=${baselib}/plugin \ + -DINSTALL_SYSCONFDIR:PATH=${sysconfdir} \ + -DMYSQL_DATADIR:PATH=/var/mysql \ + -DCAT_EXECUTABLE=`which cat` \ + -DSTACK_DIRECTION=1 \ + -DHAVE_SYSTEM_LIBFMT_EXITCODE=0 \ + -DCMAKE_AR:FILEPATH=${AR}" + + +# With Ninja it fails with: +# make: *** No rule to make target `install'. Stop. +OECMAKE_GENERATOR = "Unix Makefiles" + +ARM_INSTRUCTION_SET:armv4 = "arm" +ARM_INSTRUCTION_SET:armv5 = "arm" + +do_compile:prepend:class-target () { + # remove the buildpath + sed -i -e "s:CMAKE_SYSROOT:CMAKE_SYSROOT_PLACE_HOLDER:g" ${S}/libmariadb/mariadb_config/mariadb_config.c.in +} + +do_configure:append() { + # handle distros with different values of ${libexecdir} + libexecdir2=`echo ${libexecdir} | sed -e 's+/usr/++g'` + sed -i -e "s:/libexec:/$libexecdir2:g" ${S}/scripts/mysql_install_db.sh + sed -i -e "s:mysqld libexec:mysqld $libexecdir2:g" ${S}/scripts/mysql_install_db.sh + sed -i -e "s:/libexec:/$libexecdir2:g" ${S}/scripts/mysqld_safe.sh +} + +do_generate_toolchain_file:append:class-native () { + # If these are set cmake will assume we're cross-compiling, which will + # result in certain things we want being disabled + sed -i "/set( CMAKE_SYSTEM_NAME/d" ${WORKDIR}/toolchain.cmake + sed -i "/set( CMAKE_SYSTEM_PROCESSOR/d" ${WORKDIR}/toolchain.cmake +} + + +do_compile:prepend:class-target () { + # These need to be in-tree or make will think they need to be built, + # and since we're cross-compiling that is disabled + cp ${STAGING_BINDIR_NATIVE}/comp_err ${S}/extra + cp ${STAGING_BINDIR_NATIVE}/comp_sql ${S}/scripts + if [ "${@bb.utils.contains('PACKAGECONFIG', 'krb5', 'yes', 'no', d)}" = "no" ]; then + if ! [ -e ${B}/include/openssl/kssl.h ] ; then + mkdir -p ${B}/include/openssl + echo "#ifndef KSSL_H" >${B}/include/openssl/kssl.h + echo "#define KSSL_H" >>${B}/include/openssl/kssl.h + echo "#include <openssl/opensslconf.h>">>${B}/include/openssl/kssl.h + echo "#endif" >>${B}/include/openssl/kssl.h + fi + fi + install -D ${RECIPE_SYSROOT_NATIVE}/usr/bin/uca-dump ${B}/strings/uca-dump +} + +SYSROOT_PREPROCESS_FUNCS += "mariadb_sysroot_preprocess" + +# We need to append this so it runs *after* binconfig's preprocess function +# +# We really don't care exactly what the directories were set to originally. +# plugindir is not fixed, but we don't create any plugins. +# +mariadb_sysroot_preprocess () { + sed -i -es,^pkgincludedir=.*,pkgincludedir=\'${STAGING_INCDIR}/mysql\', ${SYSROOT_DESTDIR}${bindir_crossscripts}/mysql_config + sed -i -es,^pkglibdir=.*,pkglibdir=\'${STAGING_LIBDIR}\', ${SYSROOT_DESTDIR}${bindir_crossscripts}/mysql_config +} + +do_install() { + oe_runmake 'DESTDIR=${D}' install + + install -d ${D}/${sysconfdir}/init.d + install -m 0644 ${UNPACKDIR}/my.cnf ${D}/${sysconfdir}/ + install -m 0755 ${UNPACKDIR}/install_db ${D}/${sysconfdir}/init.d/ + mv ${D}/${sysconfdir}/init.d/mysql ${D}/${sysconfdir}/init.d/mysqld + + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${UNPACKDIR}/mysqld.service ${D}${systemd_unitdir}/system + install -m 0644 ${UNPACKDIR}/install_db.service ${D}${systemd_unitdir}/system + sed -i -e 's,@BINDIR@,${bindir},g' -e 's,@PREFIX@,${prefix},g' ${D}${systemd_unitdir}/system/mysqld.service \ + ${D}${systemd_unitdir}/system/install_db.service + + install -d ${D}${bindir} + install -m 755 ${UNPACKDIR}/mysql-systemd-start ${D}${bindir} + install -d ${D}${datadir}/doc/${PN} + if [ -f ${D}${datadir}/doc/README ]; then + mv ${D}${datadir}/doc/README ${D}${datadir}/doc/${PN}/ + fi + + # mini-benchmark used for Gitlab-CI to run on every commit to catch + # if there are severe performance regressions. + # remove it to avoid introducing bash dependency + if [ -f ${D}${datadir}/mysql/mini-benchmark ]; then + rm -rf ${D}${datadir}/mysql/mini-benchmark + fi + if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then + pam_so=$(find ${D} -name pam_user_map.so) + if [ x"${pam_so}" != x ]; then + pam_dir=$(dirname ${pam_so}) + mv ${pam_dir} ${D}/${libdir} + rmdir --ignore-fail-on-non-empty ${pam_dir%security} + fi + fi +} + +PACKAGES = "${PN}-dbg ${PN}-setupdb ${PN} \ + libmysqlclient-r libmysqlclient-r-dev libmysqlclient-r-staticdev \ + libmysqlclient libmysqlclient-dev libmysqlclient-staticdev \ + libmysqld libmysqld-dev ${PN}-client ${PN}-server ${PN}-leftovers" +CONFFILES:${PN}-server += "${sysconfdir}/my.cnf ${sysconfdir}/my.cnf.d/server.cnf" +CONFFILES:${PN}-client += "${sysconfdir}/my.cnf.d/mysql-clients.cnf" +CONFFILES:libmysqlclient += "${sysconfdir}/my.cnf.d/client.cnf" + +RPROVIDES:${PN}-dbg += "libmysqlclient-r-dbg libmysqlclient-dbg" + +FILES:${PN} = " " +RDEPENDS:${PN} = "${PN}-client ${PN}-server" +ALLOW_EMPTY:${PN} = "1" + +RDEPENDS:${PN}-client = "perl perl-module-getopt-long perl-module-file-temp \ + perl-module-fcntl perl-module-sys-hostname perl-module-ipc-open3 \ + perl-module-exporter" +RDEPENDS:${PN}-server = "perl perl-module-getopt-long perl-module-data-dumper \ + perl-module-file-basename perl-module-file-path perl-module-sys-hostname \ + perl-module-file-copy perl-module-file-temp perl-module-posix \ + ${PN}-client ${PN}-setupdb libdbi-perl libdbd-mysql-perl lzo" +RDEPENDS:${PN}-leftovers = "perl perl-module-cwd perl-module-benchmark perl-module-getopt-long \ + perl-module-posix perl-module-data-dumper perl-module-sigtrap perl-module-threads \ + perl-module-threads-shared perl-module-io-socket perl-module-sys-hostname perl-module-file-copy \ + perl-module-file-spec perl-module-file-find perl-module-file-basename perl-module-file-path \ + perl-module-constant perl-module-lib perl-module-file-temp perl-module-file-spec-functions \ + perl-module-io-socket-inet perl-module-io-select bash" +RDEPENDS:${PN}-setupdb = "coreutils" + +# Allow old code to link to the backward compatible library +RDEPENDS:libmysqlclient-dev = "libmysqlclient-r-dev" + +PACKAGE_PREPROCESS_FUNCS += "src_package_preprocess" +src_package_preprocess () { + # Trim build paths from comments in generated sources to ensure reproducibility + sed -i -e "s,${S}/sql/,,g" \ + -e "s,${B}/sql/,,g" \ + ${B}/sql/yy_oracle.hh \ + ${B}/sql/yy_mariadb.cc \ + ${B}/sql/yy_mariadb.hh \ + ${B}/sql/yy_oracle.cc +} + +FILES:libmysqlclient = "\ + ${libdir}/libmysqlclient.so.* \ + ${libdir}/libmariadb.so.* \ + ${sysconfdir}/my.cnf.d/client.cnf" +FILES:libmysqlclient-dev = " \ + ${includedir}/mysql/ \ + ${libdir}/libmysqlclient.so \ + ${libdir}/libmariadb.so \ + ${sysconfdir}/aclocal \ + ${bindir}/mysql_config" +FILES:libmysqlclient-staticdev = "\ + ${libdir}/*.a" + +# Avoid warnings about ha_xtradb.so.0.0.0 and ha_innodb_plugin.so.0.0.0 +# which are intentionally non-PIC on 32-bit x86 (see e.g. +# storage/xtradb/plug.in in the source) +INSANE_SKIP:libmysqlclient:append:x86 = " textrel" + +FILES:libmysqlclient-r = "${libdir}/libmysqlclient_r.so.*" +FILES:libmysqlclient-r-dev = "\ + ${libdir}/libmysqlclient_r.so" +FILES:libmysqlclient-r-staticdev = "${libdir}/libmysqlclient_r.a" + +FILES:libmysqld = "\ + ${libdir}/libmysqld.so.* \ + ${libdir}/libmariadbd.so.*" +FILES:libmysqld-dev = "\ + ${libdir}/libmysqld.so \ + ${libdir}/libmariadbd.so" + +FILES:${PN}-client = "\ + ${bindir}/myisam_ftdump \ + ${bindir}/mysql \ + ${bindir}/mariadb \ + ${bindir}/mysql_client_test \ + ${bindir}/mariadb-client-test \ + ${bindir}/mysql_client_test_embedded \ + ${bindir}/mariadb-client-test-embedded \ + ${bindir}/mysql_find_rows \ + ${bindir}/mariadb-find-rows \ + ${bindir}/mysql_fix_extensions \ + ${bindir}/mariadb-fix-extensions \ + ${bindir}/mysql_waitpid \ + ${bindir}/mariadb-waitpid \ + ${bindir}/mysqlaccess \ + ${bindir}/mariadb-access \ + ${bindir}/mysqladmin \ + ${bindir}/mariadb-admin \ + ${bindir}/mysqlcheck \ + ${bindir}/mariadb-check \ + ${bindir}/mysqldump \ + ${bindir}/mariadb-dump \ + ${bindir}/mysqldumpslow \ + ${bindir}/mariadb-dumpslow \ + ${bindir}/mysqlimport \ + ${bindir}/mariadb-import \ + ${bindir}/mysqlshow \ + ${bindir}/mariadb-show \ + ${bindir}/mysqlslap \ + ${bindir}/mariadb-slap \ + ${bindir}/mysqltest_embedded \ + ${bindir}/mariadb-test-embedded \ + ${libexecdir}/mysqlmanager \ + ${sysconfdir}/my.cnf.d/mysql-clients.cnf" + +FILES:${PN}-server = "\ + ${bindir}/msql2mysql \ + ${bindir}/my_print_defaults \ + ${bindir}/myisamchk \ + ${bindir}/myisamlog \ + ${bindir}/myisampack \ + ${bindir}/mysql_convert_table_format \ + ${bindir}/mariadb-convert-table-format \ + ${bindir}/mysql_install_db \ + ${bindir}/mysql_secure_installation \ + ${bindir}/mariadb-secure-installation \ + ${bindir}/mysql_setpermission \ + ${bindir}/mariadb-setpermission \ + ${bindir}/mysql-systemd-start \ + ${bindir}/mysql_tzinfo_to_sql \ + ${bindir}/mariadb-tzinfo-to-sql \ + ${bindir}/mysql_upgrade \ + ${bindir}/mariadb-upgrade \ + ${bindir}/mysql_plugin \ + ${bindir}/mariadb-plugin \ + ${bindir}/mysqlbinlog \ + ${bindir}/mariadb-binlog \ + ${bindir}/mysqld_multi \ + ${bindir}/mariadbd-multi \ + ${bindir}/mariadbd-safe \ + ${bindir}/mysqld_safe \ + ${bindir}/mysqld_safe_helper \ + ${bindir}/mariadbd-safe-helper \ + ${bindir}/mysqlhotcopy \ + ${bindir}/mariadb-hotcopy \ + ${bindir}/mysqltest \ + ${bindir}/mariadb-test \ + ${bindir}/perror \ + ${bindir}/replace \ + ${bindir}/resolve_stack_dump \ + ${bindir}/resolveip \ + ${libexecdir}/mysqld \ + ${sbindir}/mysqld \ + ${sbindir}/mariadbd \ + ${libdir}/plugin/*.so \ + ${libdir}/security/*.so \ + ${libdir}/plugin/auth_pam_tool_dir/auth_pam_tool \ + ${datadir}/mysql/ \ + ${localstatedir}/mysql/ \ + ${sysconfdir}/init.d/mysqld \ + ${sysconfdir}/my.cnf \ + ${sysconfdir}/my.cnf.d/server.cnf \ + ${sysconfdir}/security/user_map.conf \ + ${sysconfdir}/tmpfiles.d" + +DESCRIPTION:${PN}-leftovers = "unpackaged and probably unneeded files for ${PN}" +FILES:${PN}-leftovers = "/" diff --git a/meta-oe/recipes-dbs/mysql/mariadb/0001-Add-missing-includes-cstdint-and-cstdio.patch b/meta-oe/recipes-dbs/mysql/mariadb/0001-Add-missing-includes-cstdint-and-cstdio.patch new file mode 100644 index 0000000000..f8ccb998be --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/0001-Add-missing-includes-cstdint-and-cstdio.patch @@ -0,0 +1,84 @@ +From 68100b1f2243304289b9a9a35e8fb0e1bb0cf70f Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 24 Jan 2023 21:40:43 -0800 +Subject: [PATCH] Add missing includes <cstdint> and <cstdio> + +This is needed with GCC 13 and newer [1] + +[1] https://www.gnu.org/software/gcc/gcc-13/porting_to.html + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> +--- + .../rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h | 1 + + storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h | 1 + + .../rocksdb/rocksdb/table/block_based/data_block_hash_index.h | 1 + + storage/rocksdb/rocksdb/util/slice.cc | 1 + + storage/rocksdb/rocksdb/util/string_util.h | 1 + + 5 files changed, 5 insertions(+) + +diff --git a/storage/rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h b/storage/rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h +index 963c1d8e..73487edd 100644 +--- a/storage/rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h ++++ b/storage/rocksdb/rocksdb/db/compaction/compaction_iteration_stats.h +@@ -5,6 +5,7 @@ + + #pragma once + ++#include <cstdint> + #include "rocksdb/rocksdb_namespace.h" + + struct CompactionIterationStats { +diff --git a/storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h b/storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h +index c7f93b4c..3c2ab805 100644 +--- a/storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h ++++ b/storage/rocksdb/rocksdb/include/rocksdb/utilities/checkpoint.h +@@ -8,6 +8,7 @@ + #pragma once + #ifndef ROCKSDB_LITE + ++#include <cstdint> + #include <string> + #include <vector> + #include "rocksdb/status.h" +diff --git a/storage/rocksdb/rocksdb/table/block_based/data_block_hash_index.h b/storage/rocksdb/rocksdb/table/block_based/data_block_hash_index.h +index f356395f..32152217 100644 +--- a/storage/rocksdb/rocksdb/table/block_based/data_block_hash_index.h ++++ b/storage/rocksdb/rocksdb/table/block_based/data_block_hash_index.h +@@ -5,6 +5,7 @@ + + #pragma once + ++#include <cstdint> + #include <string> + #include <vector> + +diff --git a/storage/rocksdb/rocksdb/util/slice.cc b/storage/rocksdb/rocksdb/util/slice.cc +index 6db11cc9..c26b6a21 100644 +--- a/storage/rocksdb/rocksdb/util/slice.cc ++++ b/storage/rocksdb/rocksdb/util/slice.cc +@@ -8,6 +8,7 @@ + // found in the LICENSE file. See the AUTHORS file for names of contributors. + + #include <algorithm> ++#include <cstdint> + #include "rocksdb/slice_transform.h" + #include "rocksdb/slice.h" + #include "util/string_util.h" + +diff --git a/util/string_util.h b/util/string_util.h +index 55d106fff02..11178fd1d7b 100644 +--- a/storage/rocksdb/rocksdb/util/string_util.h ++++ b/storage/rocksdb/rocksdb/util/string_util.h +@@ -6,6 +6,7 @@ + + #pragma once + ++#include <cstdint> + #include <sstream> + #include <string> + #include <unordered_map> +-- +2.25.1 + diff --git a/meta-oe/recipes-dbs/mysql/mariadb/0001-Fix-library-LZ4-lookup.patch b/meta-oe/recipes-dbs/mysql/mariadb/0001-Fix-library-LZ4-lookup.patch new file mode 100644 index 0000000000..d8671b76b0 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/0001-Fix-library-LZ4-lookup.patch @@ -0,0 +1,33 @@ +From f15fbdf1244ca9ce01c5507660a86d685ed88bcf Mon Sep 17 00:00:00 2001 +From: Sumit Garg <sumit.garg@linaro.org> +Date: Mon, 21 Mar 2022 15:08:40 +0800 +Subject: [PATCH] Fix library LZ4 lookup. + +Signed-off-by: Sumit Garg <sumit.garg@linaro.org> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> +--- +Upstream-Status: Pending + + cmake/FindLZ4.cmake | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/cmake/FindLZ4.cmake b/cmake/FindLZ4.cmake +index eebd859..094241c 100644 +--- a/cmake/FindLZ4.cmake ++++ b/cmake/FindLZ4.cmake +@@ -1,5 +1,10 @@ +-find_path(LZ4_INCLUDE_DIRS NAMES lz4.h) +-find_library(LZ4_LIBRARIES NAMES lz4) ++find_path(LZ4_INCLUDE_DIR ++ NAMES lz4.h ++ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) ++ ++find_library(LZ4_LIBRARIES ++ NAMES lz4 ++ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + + if(LZ4_INCLUDE_DIRS AND EXISTS "${LZ4_INCLUDE_DIRS}/lz4.h") + file(STRINGS "${LZ4_INCLUDE_DIRS}/lz4.h" LZ4_H REGEX "^#define LZ4_VERSION_[MR]") +-- +2.25.1 + diff --git a/meta-oe/recipes-dbs/mysql/mariadb/0001-MDEV-33439-Fix-build-with-libxml2-2.12.patch b/meta-oe/recipes-dbs/mysql/mariadb/0001-MDEV-33439-Fix-build-with-libxml2-2.12.patch new file mode 100644 index 0000000000..3e42535dad --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/0001-MDEV-33439-Fix-build-with-libxml2-2.12.patch @@ -0,0 +1,170 @@ +From dae52f5916ef59434c93f0b716270f59dd0c3a94 Mon Sep 17 00:00:00 2001 +From: Jan Tojnar <jtojnar@gmail.com> +Date: Sun, 7 Jan 2024 10:19:54 +0100 +Subject: [PATCH] MDEV-33439 Fix build with libxml2 2.12 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +libxml2 2.12.0 made `xmlGetLastError()` return `const` pointer: + +https://gitlab.gnome.org/GNOME/libxml2/-/commit/61034116d0a3c8b295c6137956adc3ae55720711 + +Clang 16 does not like this: + + error: assigning to 'xmlErrorPtr' (aka '_xmlError *') from 'const xmlError *' (aka 'const _xmlError *') discards qualifiers + error: cannot initialize a variable of type 'xmlErrorPtr' (aka '_xmlError *') with an rvalue of type 'const xmlError *' (aka 'const _xmlError *') + +Let’s update the variables to `const`. +For older versions, it will be automatically converted. + +But then `xmlResetError(xmlError*)` will not like the `const` pointer: + + error: no matching function for call to 'xmlResetError' + note: candidate function not viable: 1st argument ('const xmlError *' (aka 'const _xmlError *')) would lose const qualifier + +Let’s replace it with `xmlResetLastError()`. + +ALso remove `LIBXMLDOC::Xerr` protected member property. +It was introduced in 65b0e5455b547a3d574fa77b34cce23ae3bea0a0 +along with the `xmlResetError` calls. +It does not appear to be used for anything. + +Upstream-Status: Backport [https://github.com/MariaDB/server/pull/2983] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + storage/connect/libdoc.cpp | 39 +++++++++++++++++++------------------- + 1 file changed, 19 insertions(+), 20 deletions(-) + +diff --git a/storage/connect/libdoc.cpp b/storage/connect/libdoc.cpp +index 67f22ce2..ab588dd4 100644 +--- a/storage/connect/libdoc.cpp ++++ b/storage/connect/libdoc.cpp +@@ -93,7 +93,6 @@ class LIBXMLDOC : public XMLDOCUMENT { + xmlXPathContextPtr Ctxp; + xmlXPathObjectPtr Xop; + xmlXPathObjectPtr NlXop; +- xmlErrorPtr Xerr; + char *Buf; // Temporary + bool Nofreelist; + }; // end of class LIBXMLDOC +@@ -327,7 +326,6 @@ LIBXMLDOC::LIBXMLDOC(char *nsl, char *nsdf, char *enc, PFBLOCK fp) + Ctxp = NULL; + Xop = NULL; + NlXop = NULL; +- Xerr = NULL; + Buf = NULL; + Nofreelist = false; + } // end of LIBXMLDOC constructor +@@ -365,8 +363,8 @@ bool LIBXMLDOC::ParseFile(PGLOBAL g, char *fn) + Encoding = (char*)Docp->encoding; + + return false; +- } else if ((Xerr = xmlGetLastError())) +- xmlResetError(Xerr); ++ } else if (xmlGetLastError()) ++ xmlResetLastError(); + + return true; + } // end of ParseFile +@@ -505,9 +503,9 @@ int LIBXMLDOC::DumpDoc(PGLOBAL g, char *ofn) + #if 1 + // This function does not crash ( + if (xmlSaveFormatFileEnc((const char *)ofn, Docp, Encoding, 0) < 0) { +- xmlErrorPtr err = xmlGetLastError(); ++ const xmlError *err = xmlGetLastError(); + strcpy(g->Message, (err) ? err->message : "Error saving XML doc"); +- xmlResetError(Xerr); ++ xmlResetLastError(); + rc = -1; + } // endif Save + // rc = xmlDocDump(of, Docp); +@@ -546,8 +544,8 @@ void LIBXMLDOC::CloseDoc(PGLOBAL g, PFBLOCK xp) + if (Nlist) { + xmlXPathFreeNodeSet(Nlist); + +- if ((Xerr = xmlGetLastError())) +- xmlResetError(Xerr); ++ if (xmlGetLastError()) ++ xmlResetLastError(); + + Nlist = NULL; + } // endif Nlist +@@ -555,8 +553,8 @@ void LIBXMLDOC::CloseDoc(PGLOBAL g, PFBLOCK xp) + if (Xop) { + xmlXPathFreeObject(Xop); + +- if ((Xerr = xmlGetLastError())) +- xmlResetError(Xerr); ++ if (xmlGetLastError()) ++ xmlResetLastError(); + + Xop = NULL; + } // endif Xop +@@ -564,8 +562,8 @@ void LIBXMLDOC::CloseDoc(PGLOBAL g, PFBLOCK xp) + if (NlXop) { + xmlXPathFreeObject(NlXop); + +- if ((Xerr = xmlGetLastError())) +- xmlResetError(Xerr); ++ if (xmlGetLastError()) ++ xmlResetLastError(); + + NlXop = NULL; + } // endif NlXop +@@ -573,8 +571,8 @@ void LIBXMLDOC::CloseDoc(PGLOBAL g, PFBLOCK xp) + if (Ctxp) { + xmlXPathFreeContext(Ctxp); + +- if ((Xerr = xmlGetLastError())) +- xmlResetError(Xerr); ++ if (xmlGetLastError()) ++ xmlResetLastError(); + + Ctxp = NULL; + } // endif Ctxp +@@ -590,6 +588,7 @@ void LIBXMLDOC::CloseDoc(PGLOBAL g, PFBLOCK xp) + /******************************************************************/ + xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp) + { ++ const xmlError *xerr; + xmlNodeSetPtr nl; + + if (trace(1)) +@@ -649,11 +648,11 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp) + } else + xmlXPathFreeObject(Xop); // Caused node not found + +- if ((Xerr = xmlGetLastError())) { +- strcpy(g->Message, Xerr->message); +- xmlResetError(Xerr); ++ if ((xerr = xmlGetLastError())) { ++ strcpy(g->Message, xerr->message); ++ xmlResetLastError(); + return NULL; +- } // endif Xerr ++ } // endif xerr + + } // endif Xop + +@@ -1079,7 +1078,7 @@ void XML2NODE::AddText(PGLOBAL g, PCSZ txtp) + /******************************************************************/ + void XML2NODE::DeleteChild(PGLOBAL g, PXNODE dnp) + { +- xmlErrorPtr xerr; ++ const xmlError *xerr; + + if (trace(1)) + htrc("DeleteChild: node=%p\n", dnp); +@@ -1122,7 +1121,7 @@ void XML2NODE::DeleteChild(PGLOBAL g, PXNODE dnp) + if (trace(1)) + htrc("DeleteChild: errmsg=%-.256s\n", xerr->message); + +- xmlResetError(xerr); ++ xmlResetLastError(); + } // end of DeleteChild + + /* -------------------- class XML2NODELIST ---------------------- */ +-- +2.44.0 + diff --git a/meta-oe/recipes-dbs/mysql/mariadb/0001-Remove-the-compile_time_assert-lines.patch b/meta-oe/recipes-dbs/mysql/mariadb/0001-Remove-the-compile_time_assert-lines.patch new file mode 100644 index 0000000000..9a6e28297b --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/0001-Remove-the-compile_time_assert-lines.patch @@ -0,0 +1,43 @@ +From cc5f1d0759b367265a1a000287e2ec15c31eb518 Mon Sep 17 00:00:00 2001 +From: Mingli Yu <mingli.yu@windriver.com> +Date: Mon, 26 Feb 2024 14:56:02 +0800 +Subject: [PATCH] Remove the compile_time_assert lines + +Remove the problematic compile_time_assert lines to fix the below build +failure on 32-bit arm. + In file included from TOPDIR/build/tmp/work/cortexa15t2hf-neon-yoe-linux-gnueabi/mariadb/10.11.7/mariadb-10.11.7/tests/mysql_client_test.c:38: + TOPDIR/build/tmp/work/cortexa15t2hf-neon-yoe-linux-gnueabi/mariadb/10.11.7/mariadb-10.11.7/tests/mysql_client_fw.c:1438:3: error: 'compile_time_assert' declared as an array with a negative size + 1438 | compile_time_assert(sizeof(MYSQL) == 77*sizeof(void*)+656); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Upstream-Status: Inappropriate [Upstream will bring the asset back + in a new way [1]] +[1] https://jira.mariadb.org/browse/MDEV-33429 + +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> +--- + tests/mysql_client_fw.c | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/tests/mysql_client_fw.c b/tests/mysql_client_fw.c +index c9e64678..5c0c7ce2 100644 +--- a/tests/mysql_client_fw.c ++++ b/tests/mysql_client_fw.c +@@ -1430,14 +1430,6 @@ int main(int argc, char **argv) + tests_to_run[i]= NULL; + } + +-#ifdef _WIN32 +- /* must be the same in C/C and embedded, 1208 on 64bit, 968 on 32bit */ +- compile_time_assert(sizeof(MYSQL) == 60*sizeof(void*)+728); +-#else +- /* must be the same in C/C and embedded, 1272 on 64bit, 964 on 32bit */ +- compile_time_assert(sizeof(MYSQL) == 77*sizeof(void*)+656); +-#endif +- + if (mysql_server_init(embedded_server_arg_count, + embedded_server_args, + (char**) embedded_server_groups)) +-- +2.25.1 + diff --git a/meta-oe/recipes-dbs/mysql/mariadb/0001-aio_linux-Check-if-syscall-exists-before-using-it.patch b/meta-oe/recipes-dbs/mysql/mariadb/0001-aio_linux-Check-if-syscall-exists-before-using-it.patch new file mode 100644 index 0000000000..aba9b9d966 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/0001-aio_linux-Check-if-syscall-exists-before-using-it.patch @@ -0,0 +1,45 @@ +From 0a3222338efc108c831fbdd719a47d35f4b0adcd Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 18 Aug 2021 06:49:25 +0000 +Subject: [PATCH] aio_linux: Check if syscall exists before using it + +Return -ENOSYS if not implememented, fixes build on arches like RISCV32 +Fixes +tpool/aio_linux.cc:63:20: error: '__NR_io_getevents' was not declared in this scope; did you mean 'io_getevents'? + 63 | int ret= syscall(__NR_io_getevents, reinterpret_cast<long>(ctx), + | ^~~~~~~~~~~~~~~~~ + | io_getevents + +Upstream-Staus: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + tpool/aio_linux.cc | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tpool/aio_linux.cc b/tpool/aio_linux.cc +index 4abc213..da75411 100644 +--- a/tpool/aio_linux.cc ++++ b/tpool/aio_linux.cc +@@ -58,6 +58,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/ + */ + static int my_getevents(io_context_t ctx, long min_nr, long nr, io_event *ev) + { ++#ifdef __NR_io_getevents + int saved_errno= errno; + int ret= syscall(__NR_io_getevents, reinterpret_cast<long>(ctx), + min_nr, nr, ev, 0); +@@ -67,6 +68,9 @@ static int my_getevents(io_context_t ctx, long min_nr, long nr, io_event *ev) + errno= saved_errno; + } + return ret; ++#else ++ return -ENOSYS; ++#endif + } + + +-- +2.29.2 + diff --git a/meta-oe/recipes-dbs/mysql/mariadb/0001-innobase-Define-__NR_futex-if-it-does-not-exist.patch b/meta-oe/recipes-dbs/mysql/mariadb/0001-innobase-Define-__NR_futex-if-it-does-not-exist.patch new file mode 100644 index 0000000000..0a2eed44f4 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/0001-innobase-Define-__NR_futex-if-it-does-not-exist.patch @@ -0,0 +1,37 @@ +From d611f78198dee64bb6a05933d200b544e2510b76 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 14 Nov 2020 14:37:13 -0800 +Subject: [PATCH] innobase: Define __NR_futex if it does not exist + +__NR_futex is not defines by newer architectures e.g. arc, riscv32 as +they only have 64bit variant of time_t. Glibc defines SYS_futex interface based +on +__NR_futex, since this is used in applications, such applications start +to fail to build for these newer architectures. This patch defines a +fallback to alias __NR_futex to __NR_futex_tim64 so SYS_futex keeps +working + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + storage/innobase/log/log0sync.cc | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/storage/innobase/log/log0sync.cc b/storage/innobase/log/log0sync.cc +index 7799e605..4fab8f74 100644 +--- a/storage/innobase/log/log0sync.cc ++++ b/storage/innobase/log/log0sync.cc +@@ -66,6 +66,9 @@ Note that if write operation is very fast, a) or b) can be fine as alternative. + #ifdef __linux__ + #include <linux/futex.h> + #include <sys/syscall.h> ++#if !defined(SYS_futex) && defined(SYS_futex_time64) ++# define SYS_futex SYS_futex_time64 ++#endif + #endif + + #include <atomic> +-- +2.29.2 + diff --git a/meta-oe/recipes-dbs/mysql/mariadb/0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch b/meta-oe/recipes-dbs/mysql/mariadb/0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch new file mode 100644 index 0000000000..456a2bad64 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch @@ -0,0 +1,69 @@ +From f92f657973997df30afdb0032c88ad3a14ead46b Mon Sep 17 00:00:00 2001 +From: Mingli Yu <mingli.yu@windriver.com> +Date: Fri, 23 Sep 2022 15:48:21 +0800 +Subject: [PATCH] sql/CMakeLists.txt: fix gen_lex_hash not found + +Fix the below do_compile issue in cross-compiling env. +| make[2]: *** No rule to make target '/build/tmp/work/aarch64-poky-linux/mariadb/10.3.13-r0/mariadb-10.3.13/sql/gen_lex_hash', needed by 'sql/lex_hash.h'. Stop. +| make[2]: *** No rule to make target '/build/tmp/work/aarch64-poky-linux/mariadb/10.3.13-r0/mariadb-10.3.13/sql/gen_lex_token', needed by 'sql/lex_token.h'. Stop. + +Upstream-Status: Inappropriate [oe build specific] + +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> +--- + sql/CMakeLists.txt | 30 ++++++++++++++++++++++-------- + 1 file changed, 22 insertions(+), 8 deletions(-) + +diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt +index 241b482..27a3991 100644 +--- a/sql/CMakeLists.txt ++++ b/sql/CMakeLists.txt +@@ -60,11 +60,18 @@ ${CMAKE_BINARY_DIR}/sql + ${CMAKE_SOURCE_DIR}/tpool + ) + +-ADD_CUSTOM_COMMAND( +- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h +- COMMAND gen_lex_token > lex_token.h +- DEPENDS gen_lex_token ++IF(NOT CMAKE_CROSSCOMPILING) ++ ADD_CUSTOM_COMMAND( ++ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h ++ COMMAND gen_lex_token > lex_token.h ++ DEPENDS gen_lex_token ++) ++ELSE() ++ ADD_CUSTOM_COMMAND( ++ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h ++ COMMAND gen_lex_token > lex_token.h + ) ++ENDIF() + + FIND_PACKAGE(BISON 2.4) + +@@ -372,11 +379,18 @@ IF(NOT CMAKE_CROSSCOMPILING OR DEFINED CMAKE_CROSSCOMPILING_EMULATOR) + ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc) + ENDIF() + +-ADD_CUSTOM_COMMAND( +- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h +- COMMAND gen_lex_hash > lex_hash.h +- DEPENDS gen_lex_hash ++IF(NOT CMAKE_CROSSCOMPILING) ++ ADD_CUSTOM_COMMAND( ++ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h ++ COMMAND gen_lex_hash > lex_hash.h ++ DEPENDS gen_lex_hash ++) ++ELSE() ++ ADD_CUSTOM_COMMAND( ++ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h ++ COMMAND gen_lex_hash > lex_hash.h + ) ++ENDIF() + + MYSQL_ADD_EXECUTABLE(mariadb-tzinfo-to-sql tztime.cc) + SET_TARGET_PROPERTIES(mariadb-tzinfo-to-sql PROPERTIES COMPILE_FLAGS "-DTZINFO2SQL") +-- +2.25.1 + diff --git a/meta-oe/recipes-dbs/mysql/mariadb/configure.cmake-fix-valgrind.patch b/meta-oe/recipes-dbs/mysql/mariadb/configure.cmake-fix-valgrind.patch new file mode 100644 index 0000000000..ac94279585 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/configure.cmake-fix-valgrind.patch @@ -0,0 +1,40 @@ +From 24e2b0edc2612acefcc48414bb6f0aeb086061a9 Mon Sep 17 00:00:00 2001 +From: Jackie Huang <jackie.huang@windriver.com> +Date: Tue, 26 Feb 2019 23:57:06 -0800 +Subject: [PATCH] configure.cmake: fix valgrind + +Check valgrind headers only if WITH_VALGRIND is set. + +mariadb uses two macros for valgrind compilations: +HAVE_valgrind - valgrind is installed and can be set by configure option -DWITH_VALGRIND +HAVE_VALGRIND - valgrind debug libraries is installed, set by auto check + +We would like to set them both by the configure option so that we can use +PACKAGECONFIG to decide if valgrind is needed or not. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> + +--- + configure.cmake | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/configure.cmake b/configure.cmake +index 3cfc4b31..d017b3b3 100644 +--- a/configure.cmake ++++ b/configure.cmake +@@ -930,10 +930,9 @@ HAVE_GCC_C11_ATOMICS) + + IF(WITH_VALGRIND) + SET(HAVE_valgrind 1) +-ENDIF() +- +-CHECK_INCLUDE_FILES("valgrind/memcheck.h;valgrind/valgrind.h" ++ CHECK_INCLUDE_FILES("valgrind/memcheck.h;valgrind/valgrind.h" + HAVE_VALGRIND_MEMCHECK_H) ++ENDIF() + + #-------------------------------------------------------------------- + # Check for IPv6 support diff --git a/meta-oe/recipes-dbs/mysql/mariadb/cross-compiling.patch b/meta-oe/recipes-dbs/mysql/mariadb/cross-compiling.patch new file mode 100644 index 0000000000..d0d6e3c730 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/cross-compiling.patch @@ -0,0 +1,34 @@ +From 80be37351d995654f86b838f6b5ed47e8a90261b Mon Sep 17 00:00:00 2001 +From: Mingli Yu <mingli.yu@windriver.com> +Date: Fri, 23 Sep 2022 12:05:17 +0800 +Subject: [PATCH] CMakeLists.txt: not include import_executables.cmake + +building failed since native does not generate import_executables.cmake +In fact, our building system will export the needed commands. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> +--- + CMakeLists.txt | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f9e2b1b..34924ba 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -394,11 +394,6 @@ CHECK_LIBFMT() + ADD_SUBDIRECTORY(tpool) + CHECK_SYSTEMD() + +-IF(CMAKE_CROSSCOMPILING AND NOT DEFINED CMAKE_CROSSCOMPILING_EMULATOR) +- SET(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Path to import_executables.cmake from a native build") +- INCLUDE(${IMPORT_EXECUTABLES}) +-ENDIF() +- + # + # Setup maintainer mode options. Platform checks are + # not run with the warning options as to not perturb fragile checks +-- +2.25.1 + diff --git a/meta-oe/recipes-dbs/mysql/mariadb/fix-arm-atomic.patch b/meta-oe/recipes-dbs/mysql/mariadb/fix-arm-atomic.patch new file mode 100644 index 0000000000..05b0cf8ff7 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/fix-arm-atomic.patch @@ -0,0 +1,34 @@ +From f447aca534d1a12809eeb146e8220d305cc3884d Mon Sep 17 00:00:00 2001 +From: Mingli Yu <mingli.yu@windriver.com> +Date: Thu, 9 Apr 2020 14:07:19 +0800 +Subject: [PATCH] build_rocksdb.cmake: fix atomic support on arm + +Check to link with libatomic to enable C11 atomics support +to fix below build error on arm: +| /build/tmp/work/armv5e-wrs-linux-gnueabi/mariadb/10.3.13-r0/recipe-sysroot-native/usr/bin/arm-wrs-linux-gnueabi/../../libexec/arm-wrs-linux-gnueabi/gcc/arm-wrs-linux-gnueabi/8.3.0/ld.bfd: librocksdblib.a(env_posix.cc.o): in function `std::__atomic_base<unsigned long long>::store(unsigned long long, std::memory_order)': +| /usr/include/c++/8.3.0/bits/atomic_base.h:374: undefined reference to `__atomic_store_8' + +Upstream-Status: Pending + +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> +--- + storage/rocksdb/build_rocksdb.cmake | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake +index d7895b0..3bcd52a 100644 +--- a/storage/rocksdb/build_rocksdb.cmake ++++ b/storage/rocksdb/build_rocksdb.cmake +@@ -470,6 +470,9 @@ list(APPEND SOURCES ${CMAKE_CURRENT_BINARY_DIR}/build_version.cc) + + ADD_CONVENIENCE_LIBRARY(rocksdblib ${SOURCES}) + target_link_libraries(rocksdblib ${THIRDPARTY_LIBS} ${SYSTEM_LIBS}) ++IF (HAVE_GCC_C11_ATOMICS_WITH_LIBATOMIC) ++ TARGET_LINK_LIBRARIES(rocksdblib atomic) ++ENDIF() + IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set_target_properties(rocksdblib PROPERTIES COMPILE_FLAGS "-fPIC -fno-builtin-memcmp -Wno-error") + endif() +-- +2.7.4 + diff --git a/meta-oe/recipes-dbs/mysql/mariadb/install_db b/meta-oe/recipes-dbs/mysql/mariadb/install_db new file mode 100755 index 0000000000..512a7da7ee --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/install_db @@ -0,0 +1,13 @@ +#! /bin/sh +case "$1" in + start) + echo "Starting to install database for mariadb" + /usr/bin/mysql-systemd-start pre + echo "done." + ;; + *) + echo "Usage: /etc/init.d/install_db start" + exit 1 +esac + +exit 0 diff --git a/meta-oe/recipes-dbs/mysql/mariadb/install_db.service b/meta-oe/recipes-dbs/mysql/mariadb/install_db.service new file mode 100644 index 0000000000..c8369f569b --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/install_db.service @@ -0,0 +1,17 @@ +# +# Simple install MySQL database service file +# It shoulb be done before mysqld.service + +[Unit] +Description=Install MySQL Community Server Database +After=network.target +After=syslog.target +Before=mysqld.service + +[Install] +WantedBy=multi-user.target + +[Service] +Type=oneshot +ExecStart=@BINDIR@/mysql-systemd-start pre + diff --git a/meta-oe/recipes-dbs/mysql/mariadb/lfs64.patch b/meta-oe/recipes-dbs/mysql/mariadb/lfs64.patch new file mode 100644 index 0000000000..7a685a6521 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/lfs64.patch @@ -0,0 +1,21 @@ +Upstream-Status: Pending + +--- a/storage/connect/os.h ++++ b/storage/connect/os.h +@@ -2,13 +2,15 @@ + #ifndef _OS_H_INCLUDED + #define _OS_H_INCLUDED + +-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) ++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) || (defined(__linux__) && !defined(__GLIBC__)) + typedef off_t off64_t; + #define lseek64(fd, offset, whence) lseek((fd), (offset), (whence)) + #define open64(path, flags, mode) open((path), (flags), (mode)) + #define ftruncate64(fd, length) ftruncate((fd), (length)) ++#ifndef O_LARGEFILE + #define O_LARGEFILE 0 + #endif ++#endif + + #ifdef _AIX + #ifndef O_LARGEFILE diff --git a/meta-oe/recipes-dbs/mysql/mariadb/mm_malloc.patch b/meta-oe/recipes-dbs/mysql/mariadb/mm_malloc.patch new file mode 100644 index 0000000000..6aa6c84882 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/mm_malloc.patch @@ -0,0 +1,13 @@ +Upstream-Status: Pending + +--- a/storage/rocksdb/rocksdb/port/jemalloc_helper.h ++++ b/storage/rocksdb/rocksdb/port/jemalloc_helper.h +@@ -5,7 +5,7 @@ + + #pragma once + +-#if defined(__clang__) ++#if defined(__clang__) && defined(__GLIBC__) + // glibc's `posix_memalign()` declaration specifies `throw()` while clang's + // declaration does not. There is a hack in clang to make its re-declaration + // compatible with glibc's if they are declared consecutively. That hack breaks diff --git a/meta-oe/recipes-dbs/mysql/mariadb/my.cnf b/meta-oe/recipes-dbs/mysql/mariadb/my.cnf new file mode 100644 index 0000000000..75db46a559 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/my.cnf @@ -0,0 +1,25 @@ +[client] +#password = password +port = 3306 +socket = /var/lib/mysql/mysql.sock + +[mysqld_safe] + +[mysqld] +user = mysql +port = 3306 +socket = /var/lib/mysql/mysql.sock +pid-file = /var/lib/mysql/mysqld.pid +log-error = /var/log/mysqld.log +basedir = /usr +datadir = /var/lib/mysql +skip-external-locking +skip-networking +ignore-builtin-innodb +default-storage-engine = myisam +bind-address = localhost + +# +# include all files from the config directory +# +!includedir /etc/my.cnf.d diff --git a/meta-oe/recipes-dbs/mysql/mariadb/mysql-systemd-start b/meta-oe/recipes-dbs/mysql/mariadb/mysql-systemd-start new file mode 100644 index 0000000000..189c02021d --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/mysql-systemd-start @@ -0,0 +1,66 @@ +#! /bin/sh +# +# Needed argument: pre | post +# +# pre mode : try to run mysql_install_db and fix perms and SELinux contexts +# post mode : ping server until answer is received +# + +get_option () { + local section=$1 + local option=$2 + local default=$3 + ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) + [ -z $ret ] && ret=$default + echo $ret +} + +install_db () { + # Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode) + datadir=$(get_option mysqld datadir "/var/lib/mysql") + + # Restore log, dir, perms and SELinux contexts + [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1 + log=/var/log/mysqld.log + [ -e $log ] || touch $log + chmod 0640 $log + chown mysql:mysql $log || exit 1 + if [ -x /usr/sbin/restorecon ]; then + /usr/sbin/restorecon "$datadir" + /usr/sbin/restorecon $log + fi + + # If special mysql dir is in place, skip db install + [ -d "$datadir/mysql" ] && exit 0 + + # Create initial db + /usr/bin/mysql_install_db --rpm --datadir="$datadir" --user=mysql + exit 0 +} + +pinger () { + # Wait for ping to answer to signal startup completed, + # might take a while in case of e.g. crash recovery + # MySQL systemd service will timeout script if no answer + datadir=$(get_option mysqld datadir "/var/lib/mysql") + socket=$(get_option mysqld socket "$datadir/mysql.sock") + case $socket in + /*) adminsocket="$socket" ;; + *) adminsocket="$datadir/$socket" ;; + esac + + while /bin/true ; do + sleep 1 + mysqladmin --no-defaults --socket="$adminsocket" --user=UNKNOWN_MYSQL_USER ping >/dev/null 2>&1 && break + done + exit 0 +} + +# main +case $1 in + "pre") install_db ;; + "post") pinger ;; +esac + +exit 0 + diff --git a/meta-oe/recipes-dbs/mysql/mariadb/mysqld.service b/meta-oe/recipes-dbs/mysql/mariadb/mysqld.service new file mode 100644 index 0000000000..d88361703d --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/mysqld.service @@ -0,0 +1,25 @@ +[Unit] +Description=MariaDB database server +After=syslog.target +After=network.target + +[Service] +PIDFile=/var/lib/mysql/mysqld.pid +Type=simple +User=mysql +Group=mysql + +# Execute post scripts as root +PermissionsStartOnly=true + +# Start main service +ExecStart=@BINDIR@/mysqld_safe --basedir=@PREFIX@ + +# Don't signal startup success before a ping works +ExecStartPost=@BINDIR@/mysql-systemd-start post + +TimeoutSec=300 +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/meta-oe/recipes-dbs/mysql/mariadb/ppc-remove-glibc-dep.patch b/meta-oe/recipes-dbs/mysql/mariadb/ppc-remove-glibc-dep.patch new file mode 100644 index 0000000000..3787b74ad1 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/ppc-remove-glibc-dep.patch @@ -0,0 +1,43 @@ +Upstream-Status: Pending + +Remove glibc specific function dependencies + +Sourced from: https://git.alpinelinux.org/aports/tree/main/mariadb/ppc-remove-glibc-dep.patch +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +diff --git a/include/my_cpu.h b/include/my_cpu.h +index f2e26fca..94599b74 100644 +--- a/include/my_cpu.h ++++ b/include/my_cpu.h +@@ -24,17 +24,16 @@ + */ + + #ifdef _ARCH_PWR8 +-#include <sys/platform/ppc.h> + /* Very low priority */ +-#define HMT_very_low() __ppc_set_ppr_very_low() ++#define HMT_very_low() asm volatile("or 31,31,31") + /* Low priority */ +-#define HMT_low() __ppc_set_ppr_low() ++#define HMT_low() asm volatile ("or 1,1,1") + /* Medium low priority */ +-#define HMT_medium_low() __ppc_set_ppr_med_low() ++#define HMT_medium_low() asm volatile ("or 6,6,6") + /* Medium priority */ +-#define HMT_medium() __ppc_set_ppr_med() ++#define HMT_medium() asm volatile ("or 2,2,2") + /* Medium high priority */ +-#define HMT_medium_high() __ppc_set_ppr_med_high() ++#define HMT_medium_high() asm volatile("or 5,5,5") + /* High priority */ + #define HMT_high() asm volatile("or 3,3,3") + #else +@@ -72,7 +71,7 @@ static inline void MY_RELAX_CPU(void) + __asm__ __volatile__ ("pause"); + #endif + #elif defined(_ARCH_PWR8) +- __ppc_get_timebase(); ++ __builtin_ppc_get_timebase(); + #elif defined __GNUC__ && (defined __arm__ || defined __aarch64__) + /* Mainly, prevent the compiler from optimizing away delay loops */ + __asm__ __volatile__ ("":::"memory"); diff --git a/meta-oe/recipes-dbs/mysql/mariadb/run-ptest b/meta-oe/recipes-dbs/mysql/mariadb/run-ptest new file mode 100644 index 0000000000..2f905cd379 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/run-ptest @@ -0,0 +1,20 @@ +#!/bin/sh + +# test case test-connect is excluded. Becasue this test case need following steps before running. +# Without these steps, test case test-connect will fail. +# 1. Disable 'skip-networking' in /etc/my.cnf +# $ sed -i '/skip-networking/s/^/#/g' /etc/my.cnf +# 2. Restart mysqld.service +# $ systemctl restart mysqld +# 3. Set password for MySQL user "root" +# $ mysql -u root +# MariaDB [(none)]> SET PASSWORD FOR "root"@"localhost" = PASSWORD("myReallyStrongPwd"); +# MariaDB [(none)]> FLUSH PRIVILEGES; + +# If test-connect is included, please uncomment these lines. +#export MASTER_MYPORT=3306 +#export MYSQL_TEST_HOST=127.0.0.1 +#export MYSQL_TEST_USER=root +#export MYSQL_TEST_PASSWD=myReallyStrongPwd + +ctest --force-new-ctest-process -E test-connect | sed -u 's/\*\*\*/ /g' | awk '/Test +#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print $6": "$4; fflush();}' diff --git a/meta-oe/recipes-dbs/mysql/mariadb/ssize_t.patch b/meta-oe/recipes-dbs/mysql/mariadb/ssize_t.patch new file mode 100644 index 0000000000..4e499d4137 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/ssize_t.patch @@ -0,0 +1,15 @@ +ssize_t comes from sys/types.h therefore include it + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- a/wsrep-lib/include/wsrep/gtid.hpp ++++ b/wsrep-lib/include/wsrep/gtid.hpp +@@ -25,7 +25,7 @@ + #include "compiler.hpp" + + #include <iosfwd> +- ++#include <sys/types.h> + /** + * Minimum number of bytes guaratneed to store GTID string representation, + * terminating '\0' not included (36 + 1 + 20). diff --git a/meta-oe/recipes-dbs/mysql/mariadb/support-files-CMakeLists.txt-fix-do_populate_sysroot.patch b/meta-oe/recipes-dbs/mysql/mariadb/support-files-CMakeLists.txt-fix-do_populate_sysroot.patch new file mode 100644 index 0000000000..233d9e6af6 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/support-files-CMakeLists.txt-fix-do_populate_sysroot.patch @@ -0,0 +1,34 @@ +From 4ac5b555d058d4d489f25a3806a787b7b2465d09 Mon Sep 17 00:00:00 2001 +From: Mingli Yu <mingli.yu@windriver.com> +Date: Wed, 27 Feb 2019 22:41:26 -0800 +Subject: [PATCH] support-files/CMakeLists.txt: fix do_populate_sysroot issue + +Comment out the logic which for suse as it introduces +below do_populate_sysroot error: +ERROR: mariadb-native-10.3.13-r0 do_populate_sysroot: sstate found an absolute path symlink /build/tmp/work/x86_64-linux/mariadb-native/10.3.13-r0/sysroot-destdir/build/tmp/work/x86_64-linux/mariadb-native/10.3.13-r0/recipe-sysroot-native/usr/sbin/rcmysql pointing at /build/tmp/work/x86_64-linux/mariadb-native/10.3.13-r0/recipe-sysroot-native/etc/init.d/mysql. Please replace this with a relative link. + +Upstream-Status: Inappropriate [oe build specific] + +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> + +--- + support-files/CMakeLists.txt | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt +index b5767432..56733de1 100644 +--- a/support-files/CMakeLists.txt ++++ b/support-files/CMakeLists.txt +@@ -165,12 +165,5 @@ IF(UNIX) + INSTALL(FILES rpm/enable_encryption.preset DESTINATION ${INSTALL_SYSCONF2DIR} + COMPONENT IniFiles) + ENDIF() +- +- # This is for SuSE: +- INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink +- ${INSTALL_SYSCONFDIR}/init.d/mysql +- ${INSTALL_SBINDIR}/rcmysql +- WORKING_DIRECTORY \$ENV{DESTDIR}${prefix})" +- COMPONENT SupportFiles) + ENDIF(INSTALL_SYSCONFDIR) + ENDIF() diff --git a/meta-oe/recipes-dbs/mysql/mariadb/sys_futex.patch b/meta-oe/recipes-dbs/mysql/mariadb/sys_futex.patch new file mode 100644 index 0000000000..3244ab8da2 --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb/sys_futex.patch @@ -0,0 +1,23 @@ +Use SYS_futex for syscall + +glibc defines SYS_futex and on newer 32bit CPUs like RISCV-32, arc there +is no 32bit time_t therefore define SYS_futex in terms of SYS_futex_time64 + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- a/storage/innobase/sync/srw_lock.cc ++++ b/storage/innobase/sync/srw_lock.cc +@@ -210,6 +210,12 @@ void ssux_lock_low::wake() { WakeByAddre + # ifdef __linux__ + # include <linux/futex.h> + # include <sys/syscall.h> ++/** Newer 32bit CPUs eg. RISCV-32 are defaulting to 64bit time_t from get go and ++ therefore do not define __NR_futex */ ++# if !defined(SYS_futex) && defined(SYS_futex_time64) ++# define SYS_futex SYS_futex_time64 ++# endif ++ + # define SRW_FUTEX(a,op,n) \ + syscall(SYS_futex, a, FUTEX_ ## op ## _PRIVATE, n, nullptr, nullptr, 0) + # elif defined __OpenBSD__ diff --git a/meta-oe/recipes-dbs/mysql/mariadb_10.11.7.bb b/meta-oe/recipes-dbs/mysql/mariadb_10.11.7.bb new file mode 100644 index 0000000000..b1d1355e2b --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mariadb_10.11.7.bb @@ -0,0 +1,63 @@ +require mariadb.inc + +inherit ptest +inherit useradd + +SRC_URI += "${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)}" +DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'rsync-native', '', d)}" +RDEPENDS:${PN}-ptest += "cmake sed perl-module-test-more" + +do_install_ptest () { + rsync -a ${B}/unittest ${B}/dbug ${D}${PTEST_PATH} \ + --exclude CMakeFiles \ + --exclude cmake_install.cmake \ + --exclude Makefile \ + --exclude=*.a \ + --exclude=*.h \ + --exclude=*.o \ + --exclude=*.so \ + --exclude=*.d \ + --exclude=*.txt + install -m 0755 -d ${D}${PTEST_PATH}/storage + rsync -a ${B}/storage/maria ${B}/storage/perfschema ${B}/storage/innobase ${D}${PTEST_PATH}/storage \ + --exclude CMakeFiles \ + --exclude cmake_install.cmake \ + --exclude Makefile \ + --exclude=*.a \ + --exclude=*.h \ + --exclude=*.o \ + --exclude=*.so \ + --exclude=*.d \ + --exclude=*.txt + cp -r ${B}/CTestTestfile.cmake ${D}${PTEST_PATH} + sed -i -e 's#${WORKDIR}##g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake` +} + +DEPENDS += "mariadb-native bison-native boost libpcre2 curl ncurses \ + zlib libaio libedit libevent libxml2 gnutls fmt lzo zstd" + +PROVIDES += "mysql5 libmysqlclient" + +USERADD_PACKAGES = "${PN}-setupdb" +USERADD_PARAM:${PN}-setupdb = "--system --home-dir /var/mysql -g mysql --shell /bin/false mysql" +GROUPADD_PARAM:${PN}-setupdb = "--system mysql" + +RPROVIDES:${PN} += "mysql5" +RREPLACES:${PN} += "mysql5" +RCONFLICTS:${PN} += "mysql5" + +RPROVIDES:${PN}-dbg += "mysql5-dbg" +RREPLACES:${PN}-dbg += "mysql5-dbg" +RCONFLICTS:${PN}-dbg += "mysql5-dbg" + +RPROVIDES:${PN}-leftovers += "mysql5-leftovers" +RREPLACES:${PN}-leftovers += "mysql5-leftovers" +RCONFLICTS:${PN}-leftovers += "mysql5-leftovers" + +RPROVIDES:${PN}-client += "mysql5-client" +RREPLACES:${PN}-client += "mysql5-client" +RCONFLICTS:${PN}-client += "mysql5-client" + +RPROVIDES:${PN}-server += "mysql5-server" +RREPLACES:${PN}-server += "mysql5-server" +RCONFLICTS:${PN}-server += "mysql5-server" diff --git a/meta-oe/recipes-dbs/mysql/mysql-python/0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch b/meta-oe/recipes-dbs/mysql/mysql-python/0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch new file mode 100644 index 0000000000..173241ea5c --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mysql-python/0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch @@ -0,0 +1,34 @@ +From 45436592aa64308b2ab46f84c6107c6d7de0a3ec Mon Sep 17 00:00:00 2001 +From: Mingli Yu <mingli.yu@windriver.com> +Date: Wed, 6 Mar 2019 00:16:17 -0800 +Subject: [PATCH] _mysql.c: fix compilation with MariaDB 10.3.13 + +Use standard API function MYSQL_OPT_RECONNECT +instead of direct modification of internal structures +which does not work for MariaDB. + +Upstream-Status: Pending + +Signed-off-by: Mingli Yu <mingli.yu@windriver.com> +--- + _mysql.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/_mysql.c ++++ b/_mysql.c +@@ -2002,7 +2002,14 @@ _mysql_ConnectionObject_ping( + int r, reconnect = -1;
+ if (!PyArg_ParseTuple(args, "|I", &reconnect)) return NULL;
+ check_connection(self);
+- if ( reconnect != -1 ) self->connection.reconnect = reconnect;
++ if ( reconnect != -1 ) {
++#if MYSQL_VERSION_ID >= 50013
++ my_bool recon = reconnect;
++ mysql_options(&self->connection, MYSQL_OPT_RECONNECT, &recon);
++#else
++ self->connection.reconnect = reconnect;
++#endif
++ }
+ Py_BEGIN_ALLOW_THREADS
+ r = mysql_ping(&(self->connection));
+ Py_END_ALLOW_THREADS
diff --git a/meta-oe/recipes-dbs/mysql/mysql-python_1.2.5.bb b/meta-oe/recipes-dbs/mysql/mysql-python_1.2.5.bb new file mode 100644 index 0000000000..15f6b6fb9a --- /dev/null +++ b/meta-oe/recipes-dbs/mysql/mysql-python_1.2.5.bb @@ -0,0 +1,26 @@ +SUMMARY = "Python interface to MySQL" +HOMEPAGE = "https://github.com/farcepest/MySQLdb1" +SECTION = "devel/python" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://GPL-2.0;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +DEPENDS = "mysql5" + +SRCNAME = "MySQL-python" + +SRC_URI = "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip \ + file://0001-_mysql.c-fix-compilation-with-MariaDB-with-10.3.13.patch \ +" +SRC_URI[md5sum] = "654f75b302db6ed8dc5a898c625e030c" +SRC_URI[sha256sum] = "811040b647e5d5686f84db415efd697e6250008b112b6909ba77ac059e140c74" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +SKIP_RECIPE[mysql-python] ?= "${@bb.utils.contains('I_SWEAR_TO_MIGRATE_TO_PYTHON3', 'yes', '', 'python2 is out of support for long time, read https://www.python.org/doc/sunset-python-2/ https://python3statement.org/ and if you really have to temporarily use this, then set I_SWEAR_TO_MIGRATE_TO_PYTHON3 to "yes"', d)}" + +inherit ${@bb.utils.contains("BBFILE_COLLECTIONS", "meta-python2", "setuptools", "", d)} + +python() { + if 'meta-python2' not in d.getVar('BBFILE_COLLECTIONS').split(): + raise bb.parse.SkipRecipe('Requires meta-python2 to be present.') +} |