diff options
author | Jochen Neumeister <joneum@FreeBSD.org> | 2024-05-24 16:08:52 +0000 |
---|---|---|
committer | Jochen Neumeister <joneum@FreeBSD.org> | 2024-05-24 16:15:44 +0000 |
commit | 3c10befc00dadfb8ff0db2e9016ef092df855345 (patch) | |
tree | 750fd5f30964323d1f52e0213e507e3f8bb50da1 | |
parent | c5bbdddbac5e1cc8ee1e0ca1710c85914cec040a (diff) | |
download | ports-3c10befc00dadfb8ff0db2e9016ef092df855345.tar.gz ports-3c10befc00dadfb8ff0db2e9016ef092df855345.zip |
databases/mysql84-{server|client}: add new Ports
Welcome MySQL 8.4
What is new in MySQL8.4 since MySQL 8.0:
https://dev.mysql.com/doc/refman/8.4/en/mysql-nutshell.html
HINT: MySQL8.2+ supports only 64-bit platforms!!!
special thanks for the majority of the work on this port: samm aka Alex
S.
57 files changed, 2047 insertions, 1 deletions
diff --git a/Mk/Uses/mysql.mk b/Mk/Uses/mysql.mk index cf5840131744..9cd094dcfc03 100644 --- a/Mk/Uses/mysql.mk +++ b/Mk/Uses/mysql.mk @@ -61,6 +61,8 @@ DEFAULT_MYSQL_VER?= ${MYSQL_DEFAULT:S/.//} # Mk/bsd.default-versions.mk in sync. MYSQL80_LIBVER= 21 MYSQL81_LIBVER= 22 +MYSQL84_LIBVER= 24 + . for v in 5 6 11 MYSQL10${v}m_LIBVER= 3 . endfor diff --git a/Mk/bsd.default-versions.mk b/Mk/bsd.default-versions.mk index 3e4f6c29ca70..b54f262c6b44 100644 --- a/Mk/bsd.default-versions.mk +++ b/Mk/bsd.default-versions.mk @@ -101,7 +101,7 @@ LUAJIT_DEFAULT?= luajit-devel . endif # Possible values: 5.10, 5.20, 6.8 MONO_DEFAULT?= 5.20 -# Possible values: 8.0, 8.1, 10.5m, 10.6m, 10.11m +# Possible values: 8.0, 8.1, 8.4, 10.5m, 10.6m, 10.11m MYSQL_DEFAULT?= 8.0 # Possible values: ninja, samurai NINJA_DEFAULT?= ninja diff --git a/databases/Makefile b/databases/Makefile index 72561ecb07fe..c6fe4dc0d10e 100644 --- a/databases/Makefile +++ b/databases/Makefile @@ -205,6 +205,8 @@ SUBDIR += mysql80-server SUBDIR += mysql81-client SUBDIR += mysql81-server + SUBDIR += mysql84-client + SUBDIR += mysql84-server SUBDIR += mysqlbackup SUBDIR += mysqldump-secure SUBDIR += mysqlreport diff --git a/databases/mysql84-client/Makefile b/databases/mysql84-client/Makefile new file mode 100644 index 000000000000..a49c38ce338d --- /dev/null +++ b/databases/mysql84-client/Makefile @@ -0,0 +1,51 @@ +PORTNAME= mysql +PORTREVISION= 0 +PKGNAMESUFFIX= 84-client + +COMMENT= Multithreaded SQL database (client) + +LICENSE+= LGPL21 + +# MySQL8.2+ supports only 64-bit platforms +# Review list after 13.x EoL +NOT_FOR_ARCHS= armv6 armv7 i386 powerpc + +MASTERDIR= ${.CURDIR}/../mysql84-server + +PKGMESSAGE= ${.CURDIR}/pkg-message +PATCHDIR= ${MASTERDIR}/files +PLIST= ${.CURDIR}/pkg-plist + +CONFLICTS_INSTALL= mysql8[1-9]-client \ + mysql[0-79][0-9]-client \ + mariadb[0-9][0-9]-client \ + percona[0-9][0-9]-client + +CMAKE_ARGS+= -DWITHOUT_SERVER=1 -DINSTALL_SUPPORTFILESDIR=0 + +USE_LDCONFIG+= ${PREFIX}/lib/mysql + +MMAN1= comp_err.1 lz4_decompress.1 mysql.1 mysql_config.1 mysql_config_editor.1 \ + mysqladmin.1 mysqlbinlog.1 mysqlcheck.1 mysqldump.1 mysqlimport.1 mysqlman.1 \ + mysqlpump.1 mysqlshow.1 mysqlslap.1 perror.1 zlib_decompress.1 + +CLIENT_ONLY= yes + +OPTIONS_GROUP+= PLUGINS +PLUGINS_DESC= Default Client Plugins +OPTIONS_GROUP_PLUGINS= SASLCLIENT +SASLCLIENT_DESC= SASL client plugin module +SASLCLIENT_CMAKE_BOOL= WITH_AUTHENTICATION_LDAP +SASLCLIENT_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2 +SASLCLIENT_USES= ldap + +OPTIONS_DEFAULT+= SASLCLIENT +OPTIONS_SUB= yes + +post-install: + @${RM} -r ${STAGEDIR}${PREFIX}/lib/mysql/private + @${LN} -s libmysqlclient.a ${STAGEDIR}${PREFIX}/lib/mysql/libmysqlclient_r.a + @${LN} -s libmysqlclient.so ${STAGEDIR}${PREFIX}/lib/mysql/libmysqlclient_r.so + @${LN} -s libmysqlclient.so.24 ${STAGEDIR}${PREFIX}/lib/mysql/libmysqlclient_r.so.24 + +.include "${MASTERDIR}/Makefile" diff --git a/databases/mysql84-client/pkg-message b/databases/mysql84-client/pkg-message new file mode 100644 index 000000000000..06b3b2d0774a --- /dev/null +++ b/databases/mysql84-client/pkg-message @@ -0,0 +1,8 @@ +[ +{ type: install + message: <<EOM +This is the mysql CLIENT without the server. +for complete server and client, please install databases/mysql84-server +EOM +} +] diff --git a/databases/mysql84-client/pkg-plist b/databases/mysql84-client/pkg-plist new file mode 100644 index 000000000000..249fcb61e163 --- /dev/null +++ b/databases/mysql84-client/pkg-plist @@ -0,0 +1,38 @@ +bin/comp_err +bin/my_print_defaults +bin/mysql +bin/mysql_config +bin/mysql_config_editor +bin/mysql_migrate_keyring +bin/mysqladmin +bin/mysqlbinlog +bin/mysqlcheck +bin/mysqldump +bin/mysqlimport +bin/mysqlshow +bin/mysqlslap +bin/perror +include/mysql/errmsg.h +include/mysql/field_types.h +include/mysql/my_command.h +include/mysql/my_compress.h +include/mysql/my_list.h +include/mysql/mysql.h +include/mysql/mysql/client_plugin.h +include/mysql/mysql/plugin_auth_common.h +include/mysql/mysql/udf_registration_types.h +include/mysql/mysql_com.h +include/mysql/mysql_time.h +include/mysql/mysql_version.h +include/mysql/mysqld_error.h +lib/mysql/libmysqlclient.a +lib/mysql/libmysqlclient.so +lib/mysql/libmysqlclient.so.24 +lib/mysql/libmysqlclient_r.a +lib/mysql/libmysqlclient_r.so +lib/mysql/libmysqlclient_r.so.24 +lib/mysql/plugin/authentication_ldap_sasl_client.so +lib/mysql/plugin/authentication_oci_client.so +lib/mysql/plugin/authentication_webauthn_client.so +libdata/pkgconfig/mysqlclient.pc +share/aclocal/mysql.m4 diff --git a/databases/mysql84-server/Makefile b/databases/mysql84-server/Makefile new file mode 100644 index 000000000000..b3558ea26132 --- /dev/null +++ b/databases/mysql84-server/Makefile @@ -0,0 +1,183 @@ +PORTNAME?= mysql +PORTVERSION= 8.4.0 +PORTREVISION?= 0 +CATEGORIES= databases +MASTER_SITES= MYSQL/MySQL-8.4 +PKGNAMESUFFIX?= 84-server + +MAINTAINER= joneum@FreeBSD.org +COMMENT?= Multithreaded SQL database (server) +WWW= https://www.mysql.com/ + +LICENSE= GPLv2 + +# MySQL8.2+ supports only 64-bit platforms +# Review list after 13.x EoL +NOT_FOR_ARCHS= armv6 armv7 i386 powerpc + +USES= bison:build cmake:noninja cpe groff:run libedit localbase \ + ncurses perl5 pkgconfig shebangfix ssl compiler:c++20-lang + +WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}${DISTVERSIONSUFFIX} + +SLAVEDIRS= databases/mysql84-client + +CPE_VENDOR= oracle + +USE_CXXSTD= c++20 +USE_PERL5= run + +MY_DBDIR= /var/db/mysql +MY_SECDIR= /var/db/mysql_secure +MY_TMPDIR= /var/db/mysql_tmpdir + +LIB_DEPENDS+= libcurl.so:ftp/curl \ + libicutu.so:devel/icu \ + liblz4.so:archivers/liblz4 \ + libhidapi.so:comms/hidapi \ + libfido2.so:security/libfido2 \ + ${LIB_DEPENDS_${ARCH}} +LIB_DEPENDS_aarch64= libunwind.so:devel/libunwind +LIB_DEPENDS_amd64= libunwind.so:devel/libunwind +LIB_DEPENDS_powerpc64= libunwind.so:devel/libunwind +LIB_DEPENDS_powerpc64le= libunwind.so:devel/libunwind + +BUILD_DEPENDS= liblz4>0:archivers/liblz4 \ + ${BUILD_DEPENDS_${ARCH}} +BUILD_DEPENDS_aarch64= libunwind>0:devel/libunwind +BUILD_DEPENDS_amd64= libunwind>0:devel/libunwind +BUILD_DEPENDS_powerpc64= libunwind>0:devel/libunwind +BUILD_DEPENDS_powerpc64le= libunwind>0:devel/libunwind + +CMAKE_BUILD_TYPE= Release +CFLAGS+= -fPIC +CFLAGS_aarch64?= -march=armv8-a+crc+crypto + +CMAKE_ARGS+= -DINSTALL_LAYOUT=FREEBSD \ + -DINSTALL_LDCONFIGDIR="${LOCALBASE}/libdata/ldconfig" \ + -DINSTALL_PKGCONFIGDIR="${LOCALBASE}/libdata/pkgconfig" \ + -DINSTALL_DOCDIR="share/doc/mysql" \ + -DINSTALL_DOCREADMEDIR="share/doc/mysql" \ + -DINSTALL_INCLUDEDIR="include/mysql" \ + -DINSTALL_INFODIR="${INFO_PATH}" \ + -DINSTALL_LIBDIR="lib/mysql" \ + -DINSTALL_PRIV_LIBDIR="lib/mysql/private" \ + -DINSTALL_MANDIR="share/man" \ + -DINSTALL_MYSQLDATADIR="${MY_DBDIR}" \ + -DINSTALL_MYSQLKEYRINGDIR="etc/mysql/keyring" \ + -DINSTALL_MYSQLSHAREDIR="share/mysql" \ + -DINSTALL_MYSQLTESTDIR="" \ + -DINSTALL_PLUGINDIR="lib/mysql/plugin" \ + -DINSTALL_SBINDIR="libexec" \ + -DINSTALL_SCRIPTDIR="bin" \ + -DINSTALL_SECURE_FILE_PRIVDIR="${MY_SECDIR}" \ + -DINSTALL_SHAREDIR="share" \ + -DINSTALL_SUPPORTFILESDIR="share/mysql" \ + -DWITH_BOOST="${WRKSRC}/boost" \ + -DWITH_SYSTEM_LIBS=1 \ + -DWITH_EDITLINE=system \ + -DWITH_LZ4=system \ + -DWITH_ICU=system \ + -DWITH_CURL=system \ + -DWITH_ZSTD=bundled \ + -DWITH_PROTOBUF=bundled \ + -DWITH_SSL=system \ + -DWITH_ZLIB=system \ + -DWITH_LZ4=system + +SHEBANG_FILES= scripts/*.pl* scripts/*.sh + +.ifdef USE_MYSQL +IGNORE= you have `USE_MYSQL' variable defined either in environment or in make(1) arguments, please undefine and try again +.endif + +SUB_LIST= MY_DBDIR=${MY_DBDIR} \ + MY_SECDIR=${MY_SECDIR} \ + MY_TMPDIR=${MY_TMPDIR} + +PLIST_SUB= MY_DBDIR=${MY_DBDIR} \ + MY_SECDIR=${MY_SECDIR} \ + MY_TMPDIR=${MY_TMPDIR} \ + MYSQL80_LIBVER=${MYSQL80_LIBVER} + +# MySQL-Server part +.if !defined(CLIENT_ONLY) +USES+= mysql:84 + +CONFLICTS_INSTALL= mysql*-server \ + mysqlwsrep*-server \ + mariadb*-server \ + percona*-server + +USE_RC_SUBR= mysql-server + +SUB_FILES= my.cnf.sample pkg-message + +USERS= mysql +GROUPS= mysql + +USE_LDCONFIG+= ${PREFIX}/lib/mysql/plugin + +MMAN1= ibd2sdi.1 innochecksum.1 my_print_defaults.1 myisam_ftdump.1 myisamchk.1 \ + myisamlog.1 myisampack.1 mysql_secure_installation.1 mysql_ssl_rsa_setup.1 \ + mysql_tzinfo_to_sql.1 mysql_upgrade.1 mysql.server.1 mysqldumpslow.1 mysqld_multi.1 \ + mysqld_safe.1 mysqlrouter_passwd.1 mysqlrouter_plugin_info.1 mysqlrouter.1 +MMAN8= mysqld.8 + +CMAKE_ARGS+= -DWITHOUT_CLIENTLIBS="ON" +# Disable unit tests, it fails on !amd64 and <13.0 due to c++17 rules +CMAKE_ARGS+= -DWITH_UNIT_TESTS="OFF" + +OPTIONS_GROUP= STORAGE +OPTIONS_GROUP_STORAGE= ARCHIVE BLACKHOLE EXAMPLE FEDERATED INNOBASE PARTITION PERFSCHEMA +OPTIONS_SUB= YES +STORAGE_DESC= Permissible "Storage Engines" (to compile statically into the server) +ARCHIVE_DESC= Compile "Archive Storage" statically in server +BLACKHOLE_DESC= Compile "Blackhole Storage" statically in server +EXAMPLE_DESC= Compile "Example Storage" statically in server +FEDERATED_DESC= Compile "Federated Storage" statically in server +INNOBASE_DESC= Compile "InnoDB Storage" statically in server +PARTITION_DESC= Compile "Partitioning support Storage" statically in server +PERFSCHEMA_DESC= Compile "Performance Schema Storage" statically in server + +ARCHIVE_CMAKE_ON= -DWITH_ARCHIVE_STORAGE_ENGINE=1 +BLACKHOLE_CMAKE_ON= -DWITH_BLACKHOLE_STORAGE_ENGINE=1 +EXAMPLE_CMAKE_ON= -DWITH_EXAMPLE_STORAGE_ENGINE=1 +FEDERATED_CMAKE_ON= -DWITH_FEDERATED_STORAGE_ENGINE=1 +INNOBASE_CMAKE_ON= -DWITH_INNOBASE_STORAGE_ENGINE=1 +PARTITION_CMAKE_ON= -DWITH_PARTITION_STORAGE_ENGINE=1 +PERFSCHEMA_CMAKE_ON= -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 + +OPTIONS_GROUP+= FEATURES +OPTIONS_GROUP_FEATURES= PERFSCHM +FEATURES_DESC= Default features knobs +PERFSCHM_DESC= Enable "Performance Schema" by default (High RAM usage) +OPTIONS_DEFAULT+= PERFSCHM + +PERFSCHM_SUB_LIST+= PERFSCHEMRC="" +# todo, likely broken, see +# https://dev.mysql.com/doc/refman/8.4/en/source-configuration-options.html +PERFSCHM_SUB_LIST_OFF+= PERFSCHEMRC="--skip-performance-schema" +FEDERATED_SUB_LIST+= FEDER="--federated" +FEDERATED_SUB_LIST_OFF+= FEDER="" +.endif + +.include <bsd.port.options.mk> + +CXXFLAGS+= -malign-double + +.include <bsd.port.pre.mk> + +post-extract: + @${RM} -rv ${WRKSRC}/sql/sql_hints.yy.cc ${WRKSRC}/sql/sql_hints.yy.h + +.if !defined(CLIENT_ONLY) +post-install: + ${MKDIR} ${STAGEDIR}${ETCDIR} + ${INSTALL_DATA} ${WRKDIR}/my.cnf.sample ${STAGEDIR}${ETCDIR}/my.cnf.sample + ${MKDIR} ${STAGEDIR}${ETCDIR}/keyring + ${MKDIR} ${STAGEDIR}${MY_SECDIR} + ${MKDIR} ${STAGEDIR}${MY_TMPDIR} +.endif + +.include <bsd.port.post.mk> diff --git a/databases/mysql84-server/distinfo b/databases/mysql84-server/distinfo new file mode 100644 index 000000000000..3c5822a40a59 --- /dev/null +++ b/databases/mysql84-server/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1715251111 +SHA256 (mysql-8.4.0.tar.gz) = 47a5433fcdd639db836b99e1b5459c2b813cbdad23ff2b5dd4ad27f792ba918e +SIZE (mysql-8.4.0.tar.gz) = 413221068 diff --git a/databases/mysql84-server/files/my.cnf.sample.in b/databases/mysql84-server/files/my.cnf.sample.in new file mode 100644 index 000000000000..3d1264c1bd61 --- /dev/null +++ b/databases/mysql84-server/files/my.cnf.sample.in @@ -0,0 +1,57 @@ +[client] +port = 3306 +socket = /tmp/mysql.sock + +[mysql] +prompt = \u@\h [\d]>\_ +no_auto_rehash + +[mysqld] +user = mysql +port = 3306 +socket = /tmp/mysql.sock +bind-address = 127.0.0.1 +basedir = %%PREFIX%% +datadir = %%MY_DBDIR%% +tmpdir = %%MY_TMPDIR%% +replica-load-tmpdir = %%MY_TMPDIR%% +secure-file-priv = %%MY_SECDIR%% +log-bin = mysql-bin +log-output = TABLE +relay-log-recovery = 1 +slow-query-log = 1 +server-id = 1 +sync_binlog = 1 +sync_relay_log = 1 +binlog_cache_size = 16M +binlog_expire_logs_seconds = 2592000 +default_password_lifetime = 0 +enforce-gtid-consistency = 1 +gtid-mode = ON +safe-user-create = 1 +lower_case_table_names = 1 +explicit-defaults-for-timestamp = 1 +myisam-recover-options = BACKUP,FORCE +open_files_limit = 32768 +table_open_cache = 16384 +table_definition_cache = 8192 +net_retry_count = 16384 +key_buffer_size = 256M +max_allowed_packet = 64M +long_query_time = 0.5 +innodb_buffer_pool_size = 1G +innodb_data_home_dir = %%MY_DBDIR%% +innodb_log_group_home_dir = %%MY_DBDIR%% +innodb_data_file_path = ibdata1:128M:autoextend +innodb_temp_data_file_path = ibtmp1:128M:autoextend +innodb_flush_method = O_DIRECT +innodb_redo_log_capacity = 512M +innodb_log_buffer_size = 16M +innodb_write_io_threads = 8 +innodb_read_io_threads = 8 +innodb_autoinc_lock_mode = 2 + +[mysqldump] +max_allowed_packet = 256M +quote_names +quick diff --git a/databases/mysql84-server/files/mysql-server.in b/databases/mysql84-server/files/mysql-server.in new file mode 100644 index 000000000000..c79874df9f2c --- /dev/null +++ b/databases/mysql84-server/files/mysql-server.in @@ -0,0 +1,78 @@ +#!/bin/sh + +# PROVIDE: mysql +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable mysql: +# mysql_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable MySQL. +# mysql_dbdir (str): Default to "%%MY_DBDIR%%" +# Base database directory. +# mysql_confdir (str): Default to "%%ETCDIR%%" +# Base configuration directory. +# mysql_optfile (str): Server-specific option file. +# Set it in the rc.conf or default behaviour of +# `mysqld_safe` itself, will be picking +# ${mysql_confdir}/my.cnf if it exists. +# mysql_pidfile (str): Custom PID file path and name. +# Default to "${mysql_dbdir}/${hostname}.pid". +# mysql_args (str): Custom additional arguments to be passed +# to mysqld_safe (default empty). +# + +. /etc/rc.subr + +name="mysql" +rcvar=mysql_enable + +load_rc_config $name + +: ${mysql_enable="NO"} +: ${mysql_dbdir="%%MY_DBDIR%%"} +: ${mysql_confdir="%%ETCDIR%%"} +if [ -f "${mysql_confdir}/my.cnf" ]; then +: ${mysql_optfile="${mysql_confdir}/my.cnf"} +elif [ -f "${mysql_dbdir}/my.cnf" ]; then +: ${mysql_optfile="${mysql_dbdir}/my.cnf"} +fi +if [ ! -z "${mysql_optfile}" ]; then +mysql_extra="--defaults-extra-file=${mysql_optfile}" +fi + +mysql_user="mysql" +: ${hostname:=`/bin/hostname`} +pidfile=${mysql_pidfile:-"${mysql_dbdir}/${hostname}.pid"} +command="/usr/sbin/daemon" +command_args="-c -f %%PREFIX%%/bin/mysqld_safe ${mysql_extra} --basedir=%%PREFIX%% --datadir=${mysql_dbdir} --pid-file=${pidfile} --user=${mysql_user} ${mysql_args} %%FEDER%% %%PERFSCHEMRC%%" +procname="%%PREFIX%%/libexec/mysqld" +start_precmd="${name}_prestart" +start_postcmd="${name}_poststart" +mysqld_init="${procname}" +mysqld_init_args="${mysql_extra} --initialize-insecure --basedir=%%PREFIX%% --datadir=${mysql_dbdir} --user=${mysql_user}" + +mysql_create_auth_tables() +{ + eval $mysqld_init $mysqld_init_args >/dev/null 2>/dev/null +} + +mysql_prestart() +{ + if [ ! -d "${mysql_dbdir}/mysql/." ]; then + mysql_create_auth_tables || return 1 + fi + return 0 +} + +mysql_poststart() +{ + local timeout=15 + while [ ! -f "${pidfile}" -a ${timeout} -gt 0 ]; do + timeout=$(( timeout - 1 )) + sleep 1 + done + return 0 +} + +run_rc_command "$1" diff --git a/databases/mysql84-server/files/patch-CMakeLists.txt b/databases/mysql84-server/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..8ad23c61d72f --- /dev/null +++ b/databases/mysql84-server/files/patch-CMakeLists.txt @@ -0,0 +1,80 @@ +--- CMakeLists.txt.orig 2024-04-10 06:26:28 UTC ++++ CMakeLists.txt +@@ -1836,7 +1836,7 @@ IF(WITH_AUTHENTICATION_LDAP) + ENDIF() + + IF(WITH_AUTHENTICATION_LDAP) +- IF(LINUX AND KNOWN_CUSTOM_LIBRARIES) ++ IF(LINUX OR FREEBSD AND KNOWN_CUSTOM_LIBRARIES) + # LDAP / SASL / KERBEROS / SSL must all be "system" or "custom", not a mix. + IF(WITH_LDAP STREQUAL "system" OR + WITH_SASL STREQUAL "system" OR +@@ -1887,6 +1887,7 @@ ENDIF() + ENDIF() + ENDIF() + ++IF(NOT WITHOUT_TOOLS) + # Add system/bundled editline. + MYSQL_CHECK_EDITLINE() + SET(EDITLINE_WARN_GIVEN) +@@ -1897,6 +1898,7 @@ ENDIF() + "You can use -DWITH_EDITLINE=bundled instead." + ) + ENDIF() ++ENDIF(NOT WITHOUT_TOOLS) + + # Add lz4 library + MYSQL_CHECK_LZ4() +@@ -2189,7 +2191,9 @@ ADD_DEPENDENCIES(clang_tidy_prerequisites GenError) + ADD_DEPENDENCIES(clang_tidy_prerequisites protobuf_generated_all) + ADD_DEPENDENCIES(clang_tidy_prerequisites GenError) + +-ADD_SUBDIRECTORY(include) ++IF(NOT WITHOUT_CLIENTLIBS) ++ ADD_SUBDIRECTORY(include) ++ENDIF(NOT WITHOUT_CLIENTLIBS) + ADD_SUBDIRECTORY(strings) + ADD_SUBDIRECTORY(vio) + ADD_SUBDIRECTORY(mysys) +@@ -2235,12 +2239,15 @@ ENDIF() + ADD_SUBDIRECTORY(unittest/mytap/t) + ENDIF() + +-ADD_SUBDIRECTORY(client) ++IF(NOT WITHOUT_TOOLS) ++ ADD_SUBDIRECTORY(client) ++ENDIF(NOT WITHOUT_TOOLS) ++ + ADD_SUBDIRECTORY(utilities) +-ADD_SUBDIRECTORY(share) + ADD_SUBDIRECTORY(libservices) + + IF(NOT WITHOUT_SERVER) ++ ADD_SUBDIRECTORY(share) + ADD_SUBDIRECTORY(testclients) + ADD_SUBDIRECTORY(sql) + ENDIF() +@@ -2318,11 +2325,11 @@ ADD_SUBDIRECTORY(scripts) + # scripts/mysql_config depends on client and server targets loaded above. + # It is referenced by some of the directories below, so we insert it here. + ADD_SUBDIRECTORY(scripts) ++ADD_SUBDIRECTORY(support-files) + + IF(NOT WITHOUT_SERVER) + ADD_SUBDIRECTORY(mysql-test) + ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess) +- ADD_SUBDIRECTORY(support-files) + IF(WITH_INTERNAL) + ADD_SUBDIRECTORY(internal) + ENDIF() +@@ -2350,8 +2357,10 @@ ENDIF() + INCLUDE(fastcov) + ENDIF() + ++IF(FALSE) + IF(UNIX) + ADD_SUBDIRECTORY(man) ++ENDIF() + ENDIF() + + IF(LINUX AND NOT WITHOUT_SERVER) diff --git a/databases/mysql84-server/files/patch-client_CMakeLists.txt b/databases/mysql84-server/files/patch-client_CMakeLists.txt new file mode 100644 index 000000000000..780490a1b465 --- /dev/null +++ b/databases/mysql84-server/files/patch-client_CMakeLists.txt @@ -0,0 +1,60 @@ +--- client/CMakeLists.txt.orig 2024-04-10 06:26:28 UTC ++++ client/CMakeLists.txt +@@ -26,9 +26,12 @@ DISABLE_MISSING_PROFILE_WARNING() + # We are not interesting in profiling clients. + DISABLE_MISSING_PROFILE_WARNING() + ++IF(WITHOUT_SERVER) + ## Subdirectory for mysql_migrate_keyring code. + ADD_SUBDIRECTORY(migrate_keyring) ++ENDIF() + ++IF(WITHOUT_SERVER) + MYSQL_ADD_EXECUTABLE(mysql + ${CMAKE_SOURCE_DIR}/sql-common/net_ns.cc + completion_hash.cc +@@ -42,7 +45,9 @@ MYSQL_ADD_EXECUTABLE(mysql + ${CMAKE_SOURCE_DIR}/sql-common/sql_string.cc + LINK_LIBRARIES mysqlclient ${EDITLINE_LIBRARY} + ) ++ENDIF() + ++IF(NOT WITHOUT_SERVER) + MYSQL_ADD_EXECUTABLE(mysqltest + mysqltest.cc + mysqltest/error_names.cc +@@ -59,6 +64,9 @@ MYSQL_ADD_EXECUTABLE(mysqltest + ENABLE_EXPORTS + LINK_LIBRARIES mysqlclient + ) ++ENDIF() ++ ++IF(WITHOUT_SERVER) + MYSQL_ADD_EXECUTABLE(mysqlcheck + check/mysqlcheck.cc + check/mysqlcheck_core.cc +@@ -274,7 +282,9 @@ TARGET_INCLUDE_DIRECTORIES(mysqlbinlog PRIVATE ${CMAKE + + TARGET_COMPILE_DEFINITIONS(mysqlbinlog PRIVATE DISABLE_PSI_MUTEX) + TARGET_INCLUDE_DIRECTORIES(mysqlbinlog PRIVATE ${CMAKE_SOURCE_DIR}/sql) ++ENDIF() + ++IF(WITHOUT_SERVER) + MYSQL_ADD_EXECUTABLE(mysqladmin + mysqladmin.cc + multi_factor_passwordopt-vars.cc +@@ -289,10 +299,14 @@ MYSQL_ADD_EXECUTABLE(mysql_config_editor + mysql_config_editor.cc + LINK_LIBRARIES mysqlclient + ) ++ENDIF() ++ ++IF(NOT WITHOUT_SERVER) + MYSQL_ADD_EXECUTABLE(mysql_secure_installation + mysql_secure_installation.cc + LINK_LIBRARIES mysqlclient + ) ++ENDIF() + + # "WIN32" also covers 64 bit. "echo" is used in some files below "mysql-test/". + IF(WIN32) diff --git a/databases/mysql84-server/files/patch-cmake_install__layout.cmake b/databases/mysql84-server/files/patch-cmake_install__layout.cmake new file mode 100644 index 000000000000..c7da17769e5e --- /dev/null +++ b/databases/mysql84-server/files/patch-cmake_install__layout.cmake @@ -0,0 +1,95 @@ +--- cmake/install_layout.cmake.orig 2024-04-10 06:26:28 UTC ++++ cmake/install_layout.cmake +@@ -42,6 +42,10 @@ + # Build with prefix=/usr/local/mysql, create tarball with install prefix="." + # and relative links. + # ++# FREEBSD ++# Build with prefix=/usr/local, create tarball with install prefix="." ++# and relative links. ++# + # To force a directory layout, use -DINSTALL_LAYOUT=<layout>. + # + # The default is STANDALONE. +@@ -81,7 +85,7 @@ SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}" + ENDIF() + + SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}" +- CACHE STRING "Installation directory layout. Options are: TARGZ (as in tar.gz installer), STANDALONE, RPM, DEB, SVR4" ++ CACHE STRING "Installation directory layout. Options are: TARGZ (as in tar.gz installer), STANDALONE, FREEBSD, RPM, DEB, SVR4" + ) + + IF(UNIX) +@@ -99,7 +103,7 @@ IF(UNIX) + CACHE PATH "install prefix" FORCE) + ENDIF() + SET(VALID_INSTALL_LAYOUTS +- "RPM" "DEB" "SVR4" "TARGZ" "STANDALONE") ++ "RPM" "DEB" "SVR4" "TARGZ" "FREEBSD" "STANDALONE") + LIST(FIND VALID_INSTALL_LAYOUTS "${INSTALL_LAYOUT}" ind) + IF(ind EQUAL -1) + MESSAGE(FATAL_ERROR "Invalid INSTALL_LAYOUT parameter:${INSTALL_LAYOUT}." +@@ -168,6 +172,32 @@ SET(INSTALL_SECURE_FILE_PRIVDIR_STANDALONE ${secure_fi + SET(INSTALL_SECURE_FILE_PRIVDIR_STANDALONE ${secure_file_priv_path}) + + # ++# FREEBSD layout ++# ++SET(INSTALL_BINDIR_FREEBSD "bin") ++SET(INSTALL_SBINDIR_FREEBSD "bin") ++# ++SET(INSTALL_LIBDIR_FREEBSD "lib") ++SET(INSTALL_PRIV_LIBDIR_FREEBSD "lib/private") ++SET(INSTALL_PLUGINDIR_FREEBSD "lib/plugin") ++# ++SET(INSTALL_INCLUDEDIR_FREEBSD "include") ++# ++SET(INSTALL_DOCDIR_FREEBSD "docs") ++SET(INSTALL_DOCREADMEDIR_FREEBSD ".") ++SET(INSTALL_MANDIR_FREEBSD "man") ++SET(INSTALL_INFODIR_FREEBSD "docs") ++# ++SET(INSTALL_SHAREDIR_FREEBSD "share") ++SET(INSTALL_MYSQLSHAREDIR_FREEBSD "share") ++SET(INSTALL_MYSQLTESTDIR_FREEBSD "mysql-test") ++SET(INSTALL_SUPPORTFILESDIR_FREEBSD "support-files") ++# ++SET(INSTALL_MYSQLDATADIR_FREEBSD "data") ++SET(INSTALL_MYSQLKEYRINGDIR_FREEBSD "keyring") ++SET(INSTALL_SECURE_FILE_PRIVDIR_FREEBSD ${secure_file_priv_path}) ++ ++# + # TARGZ layout + # + SET(INSTALL_BINDIR_TARGZ "bin") +@@ -362,7 +392,7 @@ SET(ROUTER_INSTALL_LAYOUT "${DEFAULT_ROUTER_INSTALL_LA + SET(ROUTER_INSTALL_LAYOUT "${DEFAULT_ROUTER_INSTALL_LAYOUT}" + CACHE + STRING +- "Installation directory layout. Options are: STANDALONE RPM DEB SVR4 TARGZ") ++ "Installation directory layout. Options are: STANDALONE FREEBSD RPM DEB SVR4 TARGZ") + + # If we are shared STANDALONE with the the server, we shouldn't write + # into the server's data/ as that would create a "schemadir" in +@@ -406,6 +436,21 @@ ENDFOREACH() + ) + SET(ROUTER_INSTALL_${var}DIR_TARGZ ${ROUTER_INSTALL_${var}DIR_STANDALONE}) + ENDFOREACH() ++ ++# ++# FreeBSD layout ++# ++SET(ROUTER_INSTALL_CONFIGDIR_FREEBSD "/usr/local/etc/mysqlrouter") ++SET(ROUTER_INSTALL_DATADIR_FREEBSD "/var/db/mysqlrouter") ++SET(ROUTER_INSTALL_LOGDIR_FREEBSD "/var/log/mysqlrouter") ++SET(ROUTER_INSTALL_RUNTIMEDIR_FREEBSD "/var/run/mysqlrouter") ++ ++SET(ROUTER_INSTALL_BINDIR_FREEBSD "bin") ++SET(ROUTER_INSTALL_LIBDIR_FREEBSD "lib/mysql") ++SET(ROUTER_INSTALL_PLUGINDIR_FREEBSD "lib/mysql/mysqlrouter") ++SET(ROUTER_INSTALL_LOGROTATEDIR_FREEBSD "etc/logrotate.d") ++SET(ROUTER_INSTALL_LOGROTATEFILE_FREEBSD "mysqlrouter") ++SET(ROUTER_INSTALL_DOCDIR_FREEBSD "share/mysqlrouter/docs") + + FOREACH(var + LOGROTATE diff --git a/databases/mysql84-server/files/patch-cmake_os_DragonFly.cmake b/databases/mysql84-server/files/patch-cmake_os_DragonFly.cmake new file mode 100644 index 000000000000..83c154ee3bcf --- /dev/null +++ b/databases/mysql84-server/files/patch-cmake_os_DragonFly.cmake @@ -0,0 +1,27 @@ +--- cmake/os/DragonFly.cmake.orig 2016-04-14 10:16:17 UTC ++++ cmake/os/DragonFly.cmake +@@ -0,0 +1,24 @@ ++INCLUDE(CheckCSourceRuns) ++ ++# We require at least GCC 4.4 or Clang 3.3. ++IF(NOT FORCE_UNSUPPORTED_COMPILER) ++ IF(CMAKE_COMPILER_IS_GNUCC) ++ EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion ++ OUTPUT_VARIABLE GCC_VERSION) ++ IF(GCC_VERSION VERSION_LESS 4.4) ++ MESSAGE(FATAL_ERROR "GCC 4.4 or newer is required!") ++ ENDIF() ++ ELSEIF(CMAKE_C_COMPILER_ID MATCHES "Clang") ++ CHECK_C_SOURCE_RUNS(" ++ int main() ++ { ++ return (__clang_major__ < 3) || ++ (__clang_major__ == 3 && __clang_minor__ < 3); ++ }" HAVE_SUPPORTED_CLANG_VERSION) ++ IF(NOT HAVE_SUPPORTED_CLANG_VERSION) ++ MESSAGE(FATAL_ERROR "Clang 3.3 or newer is required!") ++ ENDIF() ++ ELSE() ++ MESSAGE(FATAL_ERROR "Unsupported compiler!") ++ ENDIF() ++ENDIF() diff --git a/databases/mysql84-server/files/patch-cmake_plugin.cmake b/databases/mysql84-server/files/patch-cmake_plugin.cmake new file mode 100644 index 000000000000..19c48f038d4a --- /dev/null +++ b/databases/mysql84-server/files/patch-cmake_plugin.cmake @@ -0,0 +1,27 @@ +--- cmake/plugin.cmake.orig 2024-04-10 06:26:28 UTC ++++ cmake/plugin.cmake +@@ -274,15 +274,15 @@ MACRO(MYSQL_ADD_PLUGIN plugin_arg) + + # For testing purposes, we need + # <...>/lib/plugin/debug/authentication_ldap_sasl_client.so +- IF(ARG_CLIENT_ONLY) +- INSTALL_DEBUG_TARGET(${target} +- DESTINATION ${INSTALL_PLUGINDIR}/debug +- COMPONENT Test) +- ELSE() +- INSTALL_DEBUG_TARGET(${target} +- DESTINATION ${INSTALL_PLUGINDIR}/debug +- COMPONENT ${INSTALL_COMPONENT}) +- ENDIF() ++# IF(ARG_CLIENT_ONLY) ++# INSTALL_DEBUG_TARGET(${target} ++# DESTINATION ${INSTALL_PLUGINDIR}/debug ++# COMPONENT Test) ++# ELSE() ++# INSTALL_DEBUG_TARGET(${target} ++# DESTINATION ${INSTALL_PLUGINDIR}/debug ++# COMPONENT ${INSTALL_COMPONENT}) ++# ENDIF() + ENDIF() + ELSE() + IF(WITHOUT_${plugin}) diff --git a/databases/mysql84-server/files/patch-cmake_ssl.cmake b/databases/mysql84-server/files/patch-cmake_ssl.cmake new file mode 100644 index 000000000000..41c725984ec3 --- /dev/null +++ b/databases/mysql84-server/files/patch-cmake_ssl.cmake @@ -0,0 +1,25 @@ +--- cmake/ssl.cmake.orig 2024-04-10 06:26:28 UTC ++++ cmake/ssl.cmake +@@ -156,7 +156,7 @@ MACRO(FIND_OPENSSL_VERSION) + # Encoded as MNNFFPPS: major minor fix patch status + FILE(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" + OPENSSL_VERSION_NUMBER +- REGEX "^#[ ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*" ++ REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*" + ) + STRING(REGEX REPLACE + "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1" +@@ -566,9 +566,10 @@ FUNCTION(MYSQL_CHECK_SSL) + ENDIF() + + # TODO(tdidriks): move to config.h.cmake / my_config.h +- IF("${OPENSSL_MAJOR_MINOR_FIX_VERSION}" VERSION_GREATER "1.1.0") +- ADD_DEFINITIONS(-DHAVE_TLSv13) +- ENDIF() ++ CHECK_SYMBOL_EXISTS(TLS1_3_VERSION "openssl/tls1.h" HAVE_TLS1_3_VERSION) ++ IF(HAVE_TLS1_3_VERSION) ++ #ADD_DEFINITIONS(-DHAVE_TLSv13) ++ ENDIF() + + GET_TARGET_PROPERTY(foo OpenSSL::SSL INTERFACE_INCLUDE_DIRECTORIES) + MESSAGE(STATUS "OPENSSL_INCLUDE_DIR = ${foo}") diff --git a/databases/mysql84-server/files/patch-extra_abseil_abseil-cpp-20230802.1_absl_time_internal_cctz_src_time__zone__format.cc b/databases/mysql84-server/files/patch-extra_abseil_abseil-cpp-20230802.1_absl_time_internal_cctz_src_time__zone__format.cc new file mode 100644 index 000000000000..0f46d1309196 --- /dev/null +++ b/databases/mysql84-server/files/patch-extra_abseil_abseil-cpp-20230802.1_absl_time_internal_cctz_src_time__zone__format.cc @@ -0,0 +1,20 @@ +--- extra/abseil/abseil-cpp-20230802.1/absl/time/internal/cctz/src/time_zone_format.cc.orig 2024-05-09 19:37:37 UTC ++++ extra/abseil/abseil-cpp-20230802.1/absl/time/internal/cctz/src/time_zone_format.cc +@@ -13,7 +13,7 @@ + // limitations under the License. + + #if !defined(HAS_STRPTIME) +-#if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__VXWORKS__) ++#if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__VXWORKS__) && !defined(__FreeBSD__) + #define HAS_STRPTIME 1 // Assume everyone else has strptime(). + #endif + #endif +@@ -648,7 +648,7 @@ const char* ParseTM(const char* dp, const char* fmt, s + // Parses a string into a std::tm using strptime(3). + const char* ParseTM(const char* dp, const char* fmt, std::tm* tm) { + if (dp != nullptr) { +- dp = strptime(dp, fmt, tm); ++ dp = ::strptime(dp, fmt, tm); + } + return dp; + } diff --git a/databases/mysql84-server/files/patch-include_my__compare.h b/databases/mysql84-server/files/patch-include_my__compare.h new file mode 100644 index 000000000000..3f85d7b82acb --- /dev/null +++ b/databases/mysql84-server/files/patch-include_my__compare.h @@ -0,0 +1,11 @@ +--- include/my_compare.h.orig 2024-04-10 06:26:28 UTC ++++ include/my_compare.h +@@ -50,7 +50,7 @@ + But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and HA_MAX_KEY_LENGTH. + */ + +-#define HA_MAX_KEY_LENGTH 1000 /* Max length in bytes */ ++#define HA_MAX_KEY_LENGTH 4000 /* Max length in bytes */ + #define HA_MAX_KEY_SEG 16 /* Max segments for key */ + + #define HA_MAX_POSSIBLE_KEY_BUFF (HA_MAX_KEY_LENGTH + 24 + 6 + 6) diff --git a/databases/mysql84-server/files/patch-include_my__stacktrace.h b/databases/mysql84-server/files/patch-include_my__stacktrace.h new file mode 100644 index 000000000000..c9435e093fd5 --- /dev/null +++ b/databases/mysql84-server/files/patch-include_my__stacktrace.h @@ -0,0 +1,11 @@ +--- include/my_stacktrace.h.orig 2024-04-10 06:26:28 UTC ++++ include/my_stacktrace.h +@@ -45,7 +45,7 @@ + _WIN32 - Windows + HAVE_EXT_BACKTRACE - Unixes without backtrace(3) + */ +-#if defined(HAVE_BACKTRACE) || defined(_WIN32) || defined(HAVE_EXT_BACKTRACE) ++#if (defined(HAVE_BACKTRACE) && (defined(__aarch64__) || defined(__amd64__))) || defined(_WIN32) || defined(HAVE_EXT_BACKTRACE) + #define HAVE_STACKTRACE 1 + void my_init_stacktrace(); + void my_print_stacktrace(const uchar *stack_bottom, ulong thread_stack); diff --git a/databases/mysql84-server/files/patch-include_my__thread__os__id.h b/databases/mysql84-server/files/patch-include_my__thread__os__id.h new file mode 100644 index 000000000000..086e04f85457 --- /dev/null +++ b/databases/mysql84-server/files/patch-include_my__thread__os__id.h @@ -0,0 +1,15 @@ +--- include/my_thread_os_id.h.orig 2024-04-10 06:26:28 UTC ++++ include/my_thread_os_id.h +@@ -85,8 +85,12 @@ static inline my_thread_os_id_t my_thread_os_id() { + return pthread_getthreadid_np(); + #else + #ifdef HAVE_INTEGER_PTHREAD_SELF ++# ifdef __DragonFly__ ++ return syscall(SYS_lwp_gettid); ++# else + /* Unknown platform, fallback. */ + return pthread_self(); ++# endif + #else + /* Feature not available. */ + return 0; diff --git a/databases/mysql84-server/files/patch-include_myisam.h b/databases/mysql84-server/files/patch-include_myisam.h new file mode 100644 index 000000000000..540439461c6c --- /dev/null +++ b/databases/mysql84-server/files/patch-include_myisam.h @@ -0,0 +1,11 @@ +--- include/myisam.h.orig 2024-04-10 06:26:28 UTC ++++ include/myisam.h +@@ -60,7 +60,7 @@ + The following defines can be increased if necessary. + But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and MI_MAX_KEY_LENGTH. + */ +-#define MI_MAX_KEY_LENGTH 1000 /* Max length in bytes */ ++#define MI_MAX_KEY_LENGTH 4000 /* Max length in bytes */ + #define MI_MAX_KEY_SEG 16 /* Max segments for key */ + + #define MI_MAX_KEY_BUFF (MI_MAX_KEY_LENGTH + MI_MAX_KEY_SEG * 6 + 8 + 8) diff --git a/databases/mysql84-server/files/patch-libmysql_CMakeLists.txt b/databases/mysql84-server/files/patch-libmysql_CMakeLists.txt new file mode 100644 index 000000000000..aedf0137861a --- /dev/null +++ b/databases/mysql84-server/files/patch-libmysql_CMakeLists.txt @@ -0,0 +1,64 @@ +--- libmysql/CMakeLists.txt.orig 2024-04-10 06:26:28 UTC ++++ libmysql/CMakeLists.txt +@@ -214,6 +214,11 @@ ENDIF() + ../sql-common/mysql_native_authentication_client.cc) + ENDIF() + ++INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake) ++IF (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") ++ ADD_COMPILE_FLAGS(${CLIENT_SOURCES} COMPILE_FLAGS "-fPIC") ++ENDIF() ++ + # + # Include protocol tracing infrastructure and the test + # trace plugin if enabled by build options. +@@ -308,10 +313,18 @@ ADD_SUBDIRECTORY(fido_client) + ADD_SUBDIRECTORY(fido_client) + + # Merge several convenience libraries into one big mysqlclient ++IF(WITHOUT_CLIENTLIBS) + MERGE_CONVENIENCE_LIBRARIES(mysqlclient ${LIBS_TO_MERGE} + COMPONENT Development + LINK_LIBRARIES ${LIBS_TO_LINK} ++ SKIP_INSTALL + ) ++ELSE() ++MERGE_CONVENIENCE_LIBRARIES(mysqlclient ${LIBS_TO_MERGE} ++ COMPONENT Development ++ LINK_LIBRARIES ${LIBS_TO_LINK} ++ ) ++ENDIF() + + # Visual Studio users need debug static library for debug projects + IF(MSVC) +@@ -358,6 +371,7 @@ ENDIF() + + # Merge several convenience libraries into one big mysqlclient + # and link them together into shared library. ++IF(WITHOUT_CLIENTLIBS) + MERGE_LIBRARIES_SHARED(libmysql ${LIBS_TO_MERGE} + EXPORTS + ${CLIENT_API_FUNCTIONS} +@@ -365,11 +379,21 @@ MERGE_LIBRARIES_SHARED(libmysql ${LIBS_TO_MERGE} + ${CLIENT_API_NONBLOCKING_FUNCTIONS} + COMPONENT SharedLibraries + LINK_LIBRARIES ${LIBS_TO_LINK} ++ SKIP_INSTALL ++ ) ++ELSE() ++MERGE_LIBRARIES_SHARED(libmysql ${LIBS_TO_MERGE} ++ EXPORTS ++ ${CLIENT_API_FUNCTIONS} ++ ${CLIENT_API_FUNCTIONS_UNDOCUMENTED} ++ ${CLIENT_API_NONBLOCKING_FUNCTIONS} ++ COMPONENT SharedLibraries ++ LINK_LIBRARIES ${LIBS_TO_LINK} + ${UNIX_OUTPUT_NAME} + ${UNIX_SOVERSION} + ${UNIX_VERSION} + ) +- ++ENDIF() + # Downgrade warning for strncat in my_crypt_genhash. + IF((WITH_LTO OR CMAKE_COMPILER_FLAG_WITH_LTO) AND MY_COMPILER_IS_GNU) + MY_TARGET_LINK_OPTIONS(libmysql "-Wno-error=stringop-truncation") diff --git a/databases/mysql84-server/files/patch-libservices_CMakeLists.txt b/databases/mysql84-server/files/patch-libservices_CMakeLists.txt new file mode 100644 index 000000000000..16968fab53f4 --- /dev/null +++ b/databases/mysql84-server/files/patch-libservices_CMakeLists.txt @@ -0,0 +1,12 @@ +--- libservices/CMakeLists.txt.orig 2024-04-10 06:26:28 UTC ++++ libservices/CMakeLists.txt +@@ -48,7 +48,9 @@ ADD_LIBRARY(mysqlservices STATIC ${MYSQLSERVICES_SOURC + plugin_registry_service.c) + + ADD_LIBRARY(mysqlservices STATIC ${MYSQLSERVICES_SOURCES}) ++IF(FALSE) + IF(INSTALL_STATIC_LIBRARIES) + INSTALL(TARGETS mysqlservices + DESTINATION ${INSTALL_LIBDIR} COMPONENT Development) ++ENDIF() + ENDIF() diff --git a/databases/mysql84-server/files/patch-man_CMakeLists.txt b/databases/mysql84-server/files/patch-man_CMakeLists.txt new file mode 100644 index 000000000000..89140e0259ea --- /dev/null +++ b/databases/mysql84-server/files/patch-man_CMakeLists.txt @@ -0,0 +1,71 @@ +--- man/CMakeLists.txt.orig 2024-04-10 06:26:28 UTC ++++ man/CMakeLists.txt +@@ -24,13 +24,6 @@ SET(MAN1 + # Copy man pages + SET(MAN1 + comp_err.1 +- ibd2sdi.1 +- innochecksum.1 +- my_print_defaults.1 +- myisam_ftdump.1 +- myisamchk.1 +- myisamlog.1 +- myisampack.1 + mysql.1 + mysql_config.1 + mysql_config_editor.1 +@@ -40,7 +33,6 @@ SET(MAN1 + mysqlbinlog.1 + mysqlcheck.1 + mysqldump.1 +- mysqldumpslow.1 + mysqlimport.1 + mysqlman.1 + mysqlshow.1 +@@ -48,13 +40,23 @@ SET(MAN1 + perror.1 + ) + +-IF(NOT WITH_SYSTEMD) +- LIST(APPEND MAN1 +- mysql.server.1 +- mysqld_multi.1 +- mysqld_safe.1 ++SET(MAN1_TOOLS ++ ibd2sdi.1 ++ innochecksum.1 ++ my_print_defaults.1 ++ myisam_ftdump.1 ++ myisamchk.1 ++ myisamlog.1 ++ myisampack.1 ++ mysql.server.1 ++ mysql_secure_installation.1 ++ mysql_ssl_rsa_setup.1 ++ mysql_tzinfo_to_sql.1 ++ mysql_upgrade.1 ++ mysqldumpslow.1 ++ mysqld_multi.1 ++ mysqld_safe.1 + ) +-ENDIF() + + SET(MAN1_NDB + ndb_blob_tool.1 +@@ -101,8 +103,14 @@ SET(MAN8_NDB + ndbmtd.8 + ) + +-INSTALL(FILES ${MAN1} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPages) +-INSTALL(FILES ${MAN8} DESTINATION ${INSTALL_MANDIR}/man8 COMPONENT ManPages) ++IF(NOT WITHOUT_CLIENTLIBS) ++ INSTALL(FILES ${MAN1} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPages) ++ENDIF() ++ ++IF(NOT WITHOUT_SERVER) ++ INSTALL(FILES ${MAN1_TOOLS} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPages) ++ INSTALL(FILES ${MAN8} DESTINATION ${INSTALL_MANDIR}/man8 COMPONENT ManPages) ++ENDIF() + + IF(WITH_ROUTER) + INSTALL(FILES ${MAN1_ROUTER} diff --git a/databases/mysql84-server/files/patch-mysys_my__default.cc b/databases/mysql84-server/files/patch-mysys_my__default.cc new file mode 100644 index 000000000000..3ab4649e0467 --- /dev/null +++ b/databases/mysql84-server/files/patch-mysys_my__default.cc @@ -0,0 +1,62 @@ +--- mysys/my_default.cc.orig 2024-04-10 06:26:28 UTC ++++ mysys/my_default.cc +@@ -209,7 +209,7 @@ bool no_defaults = false; + + /* Which directories are searched for options (and in which order) */ + +-#define MAX_DEFAULT_DIRS 6 ++#define MAX_DEFAULT_DIRS 7 + #define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1) /* Terminate with NULL */ + static const char **default_directories = nullptr; + +@@ -962,6 +962,14 @@ static int search_default_file_with_ext(Process_option + return 1; /* Ignore wrong files */ + } + ++ if (strstr(name, "/etc") == name) ++ { ++ fprintf(stderr, ++ "error: Config file %s in invalid location, please move to or merge with /usr/local%s\n", ++ name,name); ++ goto err; ++ } ++ + while (true) { + auto fileline = mysql_file_getline(buff, sizeof(buff), fp, is_login_file); + char *linebuff = fileline.get(); +@@ -1351,7 +1359,8 @@ void my_print_default_files(const char *conf_file) { + end[(strlen(end) - 1)] = ' '; + else + strxmov(end, conf_file, *ext, " ", NullS); +- fputs(name, stdout); ++ if (strstr(name, "/etc") != name) ++ fputs(name, stdout); + } + } + } +@@ -1693,14 +1702,9 @@ static const char **init_default_directories(MEM_ROOT + + #else + +- errors += add_directory(alloc, "/etc/", dirs); +- errors += add_directory(alloc, "/etc/mysql/", dirs); ++ errors += add_directory(alloc, "/usr/local/etc/", dirs); ++ errors += add_directory(alloc, "/usr/local/etc/mysql/", dirs); + +-#if defined(DEFAULT_SYSCONFDIR) +- if (DEFAULT_SYSCONFDIR[0]) +- errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs); +-#endif /* DEFAULT_SYSCONFDIR */ +- + #endif + + if ((env = getenv("MYSQL_HOME"))) errors += add_directory(alloc, env, dirs); +@@ -1765,7 +1769,7 @@ int check_file_permissions(const char *file_name, bool + #if !defined(_WIN32) + MY_STAT stat_info; + +- if (!my_stat(file_name, &stat_info, flags)) return 1; ++ if (!my_stat(file_name, &stat_info, flags)) return 0; + /* + Ignore .mylogin.cnf file if not exclusively readable/writable + by current user. diff --git a/databases/mysql84-server/files/patch-mysys_my__kdf.cc b/databases/mysql84-server/files/patch-mysys_my__kdf.cc new file mode 100644 index 000000000000..c316de281c26 --- /dev/null +++ b/databases/mysql84-server/files/patch-mysys_my__kdf.cc @@ -0,0 +1,20 @@ +--- mysys/my_kdf.cc.orig 2024-04-10 06:26:28 UTC ++++ mysys/my_kdf.cc +@@ -57,7 +57,7 @@ int create_kdf_key(const unsigned char *key, const uns + std::unique_ptr<Key_derivation_function> kdf_function; + + if (kdf_name == "hkdf") { +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) + kdf_function = std::make_unique<Key_hkdf_function>(kdf_options); + #else + return 1; +@@ -72,7 +72,7 @@ int create_kdf_key(const unsigned char *key, const uns + return kdf_function->derive_key(key, key_length, rkey, rkey_size); + } + +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) + Key_hkdf_function::Key_hkdf_function(vector<string> *kdf_options) { + kdf_options_ = {kdf_options}; + } diff --git a/databases/mysql84-server/files/patch-plugin_password__validation_validate__password.cc b/databases/mysql84-server/files/patch-plugin_password__validation_validate__password.cc new file mode 100644 index 000000000000..9c5129e24b2d --- /dev/null +++ b/databases/mysql84-server/files/patch-plugin_password__validation_validate__password.cc @@ -0,0 +1,11 @@ +--- plugin/password_validation/validate_password.cc.orig 2024-04-10 06:26:28 UTC ++++ plugin/password_validation/validate_password.cc +@@ -26,6 +26,8 @@ + #include <mysql/plugin_validate_password.h> + #include <mysql/service_my_plugin_log.h> + #include <mysql/service_mysql_string.h> ++/* solve clash between libc++ bitset::test() and test macro from my_global.h */ ++#undef test + #include <stdio.h> + #include <stdlib.h> + #include <string.h> diff --git a/databases/mysql84-server/files/patch-plugin_x_CMakeLists.txt b/databases/mysql84-server/files/patch-plugin_x_CMakeLists.txt new file mode 100644 index 000000000000..e9337bfaff87 --- /dev/null +++ b/databases/mysql84-server/files/patch-plugin_x_CMakeLists.txt @@ -0,0 +1,11 @@ +--- plugin/x/CMakeLists.txt.orig 2024-04-10 06:26:28 UTC ++++ plugin/x/CMakeLists.txt +@@ -75,6 +75,8 @@ INCLUDE_DIRECTORIES( + ${MYSQLX_GENERATE_DIR} + ${MYSQLX_PROTOCOL_INCLUDE_DIR} + ${MYSQLX_CLIENT_INCLUDE_DIR} ++ ${OPENSSL_INCLUDE_DIR} ++ ${BOOST_INCLUDE_DIR} + ) + + ADD_COMPILE_FLAGS(${XPLUGIN_SRC} diff --git a/databases/mysql84-server/files/patch-plugin_x_client_authentication_sha256__scramble__generator.cc b/databases/mysql84-server/files/patch-plugin_x_client_authentication_sha256__scramble__generator.cc new file mode 100644 index 000000000000..e279ad846196 --- /dev/null +++ b/databases/mysql84-server/files/patch-plugin_x_client_authentication_sha256__scramble__generator.cc @@ -0,0 +1,11 @@ +--- plugin/x/client/authentication/sha256_scramble_generator.cc.orig 2024-04-10 06:26:28 UTC ++++ plugin/x/client/authentication/sha256_scramble_generator.cc +@@ -98,7 +98,7 @@ bool SHA256_digest::retrieve_digest(unsigned char *dig + return true; + } + m_ok = EVP_DigestFinal_ex(md_context, m_digest, nullptr); +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_MD_CTX_cleanup(md_context); + #else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + EVP_MD_CTX_reset(md_context); diff --git a/databases/mysql84-server/files/patch-plugin_x_configure.cmake b/databases/mysql84-server/files/patch-plugin_x_configure.cmake new file mode 100644 index 000000000000..bf593103b5b1 --- /dev/null +++ b/databases/mysql84-server/files/patch-plugin_x_configure.cmake @@ -0,0 +1,15 @@ +--- plugin/x/configure.cmake.orig 2024-04-10 06:26:28 UTC ++++ plugin/x/configure.cmake +@@ -46,6 +46,7 @@ CONFIGURE_FILE(${MYSQLX_PROJECT_DIR}/src/config/mysqlx + CONFIGURE_FILE(${MYSQLX_PROJECT_DIR}/src/config/mysqlx_version.h.in + ${MYSQLX_GENERATE_DIR}/mysqlx_version.h ) + ++IF(FALSE) + INSTALL(FILES ${MYSQLX_GENERATE_DIR}/mysqlx_error.h + DESTINATION ${INSTALL_INCLUDEDIR} + COMPONENT Development) +@@ -57,3 +58,4 @@ INSTALL(FILES ${MYSQLX_GENERATE_DIR}/mysqlx_version.h + INSTALL(FILES ${MYSQLX_GENERATE_DIR}/mysqlx_version.h + DESTINATION ${INSTALL_INCLUDEDIR} + COMPONENT Development) ++ENDIF() diff --git a/databases/mysql84-server/files/patch-router_src_harness_include_mysql_harness_net__ts_impl_kqueue__io__service.h b/databases/mysql84-server/files/patch-router_src_harness_include_mysql_harness_net__ts_impl_kqueue__io__service.h new file mode 100644 index 000000000000..6414b45c32b0 --- /dev/null +++ b/databases/mysql84-server/files/patch-router_src_harness_include_mysql_harness_net__ts_impl_kqueue__io__service.h @@ -0,0 +1,13 @@ +--- router/src/harness/include/mysql/harness/net_ts/impl/kqueue_io_service.h.orig 2024-04-10 06:26:28 UTC ++++ router/src/harness/include/mysql/harness/net_ts/impl/kqueue_io_service.h +@@ -189,8 +189,8 @@ class kqueue_io_service : public IoServiceBase { + auto secs = std::chrono::duration_cast<std::chrono::seconds>(timeout); + timeout -= secs; + +- ts = {secs.count(), +- std::chrono::duration_cast<std::chrono::nanoseconds>(timeout) ++ ts = {(time_t)secs.count(), ++ (long)std::chrono::duration_cast<std::chrono::nanoseconds>(timeout) + .count()}; + + p_ts = &ts; diff --git a/databases/mysql84-server/files/patch-router_src_harness_include_mysql_harness_net__ts_internet.h b/databases/mysql84-server/files/patch-router_src_harness_include_mysql_harness_net__ts_internet.h new file mode 100644 index 000000000000..c793fe7b022d --- /dev/null +++ b/databases/mysql84-server/files/patch-router_src_harness_include_mysql_harness_net__ts_internet.h @@ -0,0 +1,10 @@ +--- router/src/harness/include/mysql/harness/net_ts/internet.h.orig 2024-04-10 06:26:28 UTC ++++ router/src/harness/include/mysql/harness/net_ts/internet.h +@@ -45,6 +45,7 @@ + #include <arpa/inet.h> // inet_ntop + #include <netdb.h> // getaddrinfo + #include <netinet/in.h> // in_addr_t ++#include <sys/types.h> // u_int32_t + #include <netinet/ip6.h> // in6_addr_t + #include <netinet/tcp.h> // TCP_NODELAY + #include <sys/ioctl.h> // ioctl diff --git a/databases/mysql84-server/files/patch-router_src_harness_src_CMakeLists.txt b/databases/mysql84-server/files/patch-router_src_harness_src_CMakeLists.txt new file mode 100644 index 000000000000..223346bbf72b --- /dev/null +++ b/databases/mysql84-server/files/patch-router_src_harness_src_CMakeLists.txt @@ -0,0 +1,24 @@ +--- router/src/harness/src/CMakeLists.txt.orig 2024-04-10 06:26:28 UTC ++++ router/src/harness/src/CMakeLists.txt +@@ -241,7 +241,6 @@ ELSE() + INSTALL(TARGETS harness-library + LIBRARY + DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router +- NAMELINK_SKIP + ) + ENDIF() + +@@ -273,7 +272,6 @@ INSTALL(TARGETS harness_stdx + RUNTIME DESTINATION ${ROUTER_INSTALL_BINDIR} COMPONENT Router + ARCHIVE DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router + LIBRARY DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router +- NAMELINK_SKIP + ) + + ## harness_tls +@@ -315,5 +313,4 @@ INSTALL(TARGETS harness_tls + RUNTIME DESTINATION ${ROUTER_INSTALL_BINDIR} COMPONENT Router + ARCHIVE DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router + LIBRARY DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router +- NAMELINK_SKIP + ) diff --git a/databases/mysql84-server/files/patch-router_src_harness_src_tls__client__context.cc b/databases/mysql84-server/files/patch-router_src_harness_src_tls__client__context.cc new file mode 100644 index 000000000000..5cd410e2e748 --- /dev/null +++ b/databases/mysql84-server/files/patch-router_src_harness_src_tls__client__context.cc @@ -0,0 +1,11 @@ +--- router/src/harness/src/tls_client_context.cc.orig 2024-04-10 06:26:28 UTC ++++ router/src/harness/src/tls_client_context.cc +@@ -104,7 +104,7 @@ stdx::expected<void, std::error_code> TlsClientContext + stdx::expected<void, std::error_code> TlsClientContext::cipher_suites( + const std::string &ciphers) { + // TLSv1.3 ciphers are controlled via SSL_CTX_set_ciphersuites() +-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 1) ++#ifdef TLS1_3_VERSION + if (1 != SSL_CTX_set_ciphersuites(ssl_ctx_.get(), ciphers.c_str())) { + return stdx::unexpected(make_tls_error()); + } diff --git a/databases/mysql84-server/files/patch-router_src_harness_src_tls__context.cc b/databases/mysql84-server/files/patch-router_src_harness_src_tls__context.cc new file mode 100644 index 000000000000..8a03c53ddbbd --- /dev/null +++ b/databases/mysql84-server/files/patch-router_src_harness_src_tls__context.cc @@ -0,0 +1,44 @@ +--- router/src/harness/src/tls_context.cc.orig 2024-04-10 06:26:28 UTC ++++ router/src/harness/src/tls_context.cc +@@ -277,7 +277,7 @@ static int o11x_version(TlsVersion version) { + return TLS1_1_VERSION; + case TlsVersion::TLS_1_2: + return TLS1_2_VERSION; +-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 1) ++#ifdef TLS1_3_VERSION + case TlsVersion::TLS_1_3: + return TLS1_3_VERSION; + #endif +@@ -308,9 +308,11 @@ stdx::expected<void, std::error_code> TlsContext::vers + default: + // unknown, leave all disabled + [[fallthrough]]; ++#ifdef TLS1_3_VERSION + case TlsVersion::TLS_1_3: + opts |= SSL_OP_NO_TLSv1_2; + [[fallthrough]]; ++#endif + case TlsVersion::TLS_1_2: + opts |= SSL_OP_NO_TLSv1_1; + [[fallthrough]]; +@@ -358,8 +360,10 @@ TlsVersion TlsContext::min_version() const { + return TlsVersion::TLS_1_1; + case TLS1_2_VERSION: + return TlsVersion::TLS_1_2; ++#ifdef TLS1_3_VERSION + case TLS1_3_VERSION: + return TlsVersion::TLS_1_3; ++#endif + case 0: + return TlsVersion::AUTO; + default: +@@ -513,7 +517,8 @@ int TlsContext::security_level() const { + } + + int TlsContext::security_level() const { +-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) ++#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) && \ ++ !defined(LIBRESSL_VERSION_NUMBER) + return SSL_CTX_get_security_level(ssl_ctx_.get()); + #else + return 0; diff --git a/databases/mysql84-server/files/patch-router_src_http_src_CMakeLists.txt b/databases/mysql84-server/files/patch-router_src_http_src_CMakeLists.txt new file mode 100644 index 000000000000..8c7d705207fd --- /dev/null +++ b/databases/mysql84-server/files/patch-router_src_http_src_CMakeLists.txt @@ -0,0 +1,26 @@ +--- router/src/http/src/CMakeLists.txt.orig 2024-04-10 06:26:28 UTC ++++ router/src/http/src/CMakeLists.txt +@@ -72,7 +72,6 @@ INSTALL(TARGETS http_common + RUNTIME DESTINATION ${ROUTER_INSTALL_BINDIR} COMPONENT Router + ARCHIVE DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router + LIBRARY DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router +- NAMELINK_SKIP + ) + + ## split library code from the plugin to use them _passwd and tests +@@ -99,7 +98,6 @@ INSTALL(TARGETS http_auth_backend_lib + RUNTIME DESTINATION ${ROUTER_INSTALL_BINDIR} COMPONENT Router + ARCHIVE DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router + LIBRARY DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router +- NAMELINK_SKIP + ) + TARGET_INCLUDE_DIRECTORIES(http_auth_backend_lib PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} +@@ -152,7 +150,6 @@ INSTALL(TARGETS http_auth_realm_lib + RUNTIME DESTINATION ${ROUTER_INSTALL_BINDIR} COMPONENT Router + ARCHIVE DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router + LIBRARY DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router +- NAMELINK_SKIP + ) + ## the rpath for the bundled openssl + ADD_INSTALL_RPATH_FOR_OPENSSL(http_auth_realm_lib) diff --git a/databases/mysql84-server/files/patch-router_src_io_src_CMakeLists.txt b/databases/mysql84-server/files/patch-router_src_io_src_CMakeLists.txt new file mode 100644 index 000000000000..33ad809e338f --- /dev/null +++ b/databases/mysql84-server/files/patch-router_src_io_src_CMakeLists.txt @@ -0,0 +1,10 @@ +--- router/src/io/src/CMakeLists.txt.orig 2024-04-10 06:26:28 UTC ++++ router/src/io/src/CMakeLists.txt +@@ -48,7 +48,6 @@ INSTALL(TARGETS io_component + RUNTIME DESTINATION ${ROUTER_INSTALL_BINDIR} COMPONENT Router + ARCHIVE DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router + LIBRARY DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router +- NAMELINK_SKIP + ) + + GENERATE_EXPORT_HEADER(io_component diff --git a/databases/mysql84-server/files/patch-router_src_router_src_CMakeLists.txt b/databases/mysql84-server/files/patch-router_src_router_src_CMakeLists.txt new file mode 100644 index 000000000000..6be721ccac1c --- /dev/null +++ b/databases/mysql84-server/files/patch-router_src_router_src_CMakeLists.txt @@ -0,0 +1,10 @@ +--- router/src/router/src/CMakeLists.txt.orig 2024-04-10 06:26:28 UTC ++++ router/src/router/src/CMakeLists.txt +@@ -156,7 +156,6 @@ INSTALL(TARGETS router_lib + RUNTIME DESTINATION ${ROUTER_INSTALL_BINDIR} COMPONENT Router + ARCHIVE DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router + LIBRARY DESTINATION ${ROUTER_INSTALL_LIBDIR} COMPONENT Router +- NAMELINK_SKIP + ) + + MYSQL_ADD_EXECUTABLE(mysqlrouter_keyring diff --git a/databases/mysql84-server/files/patch-scripts_CMakeLists.txt b/databases/mysql84-server/files/patch-scripts_CMakeLists.txt new file mode 100644 index 000000000000..9900330982dc --- /dev/null +++ b/databases/mysql84-server/files/patch-scripts_CMakeLists.txt @@ -0,0 +1,52 @@ +--- scripts/CMakeLists.txt.orig 2024-04-10 06:26:28 UTC ++++ scripts/CMakeLists.txt +@@ -411,6 +411,8 @@ MACRO(EXTRACT_LINK_LIBRARIES target var) + SET(${var} "${${var}}-L${dir} " ) + ENDIF() + SET(${var} "${${var}}-l${lib} " ) ++ ELSEIF(lib STREQUAL "-pthread") ++ SET(${var} "${${var}}-pthread " ) + ELSE() + SET(${var} "${${var}}-l${lib} " ) + ENDIF() +@@ -484,7 +486,7 @@ ELSE() + ${CMAKE_CURRENT_BINARY_DIR}/${PKGCONFIG_FILE} + ESCAPE_QUOTES @ONLY) + +- IF(INSTALL_PKGCONFIGDIR) ++ IF(INSTALL_PKGCONFIGDIR AND NOT WITHOUT_CLIENTLIBS) + MESSAGE(STATUS "INSTALL ${PKGCONFIG_FILE} ${INSTALL_PKGCONFIGDIR}") + INSTALL(FILES + ${CMAKE_CURRENT_BINARY_DIR}/${PKGCONFIG_FILE} +@@ -497,23 +499,28 @@ ELSE() + # mysqld_safe used in mtr even for systemd platforms + IF(WITH_SYSTEMD) + SET(BIN_SCRIPTS +- mysql_config + mysqldumpslow + mysqld_safe + ) + ELSE() + SET(BIN_SCRIPTS +- mysql_config + mysqldumpslow + mysqld_multi + mysqld_safe + ) + ENDIF() + ++ IF(NOT WITHOUT_CLIENTLIBS) ++ SET(BIN_SCRIPTS ++ ${BIN_SCRIPTS} ++ mysql_config ++ ) ++ ENDIF(NOT WITHOUT_CLIENTLIBS) ++ + FOREACH(file ${BIN_SCRIPTS}) + IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh +- ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY ++ ${CMAKE_CURRENT_BINARY_DIR}/${file} @ONLY + ) + ELSEIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.pl.in) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.pl.in diff --git a/databases/mysql84-server/files/patch-scripts_mysqld__safe.sh b/databases/mysql84-server/files/patch-scripts_mysqld__safe.sh new file mode 100644 index 000000000000..47bc81e3963b --- /dev/null +++ b/databases/mysql84-server/files/patch-scripts_mysqld__safe.sh @@ -0,0 +1,19 @@ +--- scripts/mysqld_safe.sh.orig 2022-01-23 11:48:36 UTC ++++ scripts/mysqld_safe.sh +@@ -360,7 +360,7 @@ mysqld_ld_preload_text() { + # running mysqld. See ld.so for details. + set_malloc_lib() { + # This list is kept intentionally simple. +- malloc_dirs="/usr/lib /usr/lib64 /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu" ++ malloc_dirs="/usr/lib /usr/lib64 /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu /usr/local/lib" + malloc_lib="$1" + + # Allow --malloc-lib='' to override other settings +@@ -379,6 +379,7 @@ set_malloc_lib() { + /usr/lib64) ;; + /usr/lib/i386-linux-gnu) ;; + /usr/lib/x86_64-linux-gnu) ;; ++ /usr/local/lib) ;; + *) + log_error "--malloc-lib must be located in one of the directories: $malloc_dirs" + exit 1 diff --git a/databases/mysql84-server/files/patch-sql_auth_sha2__password__common.cc b/databases/mysql84-server/files/patch-sql_auth_sha2__password__common.cc new file mode 100644 index 000000000000..58ee2f44c3a6 --- /dev/null +++ b/databases/mysql84-server/files/patch-sql_auth_sha2__password__common.cc @@ -0,0 +1,11 @@ +--- sql/auth/sha2_password_common.cc.orig 2024-04-10 06:26:28 UTC ++++ sql/auth/sha2_password_common.cc +@@ -102,7 +102,7 @@ bool SHA256_digest::retrieve_digest(unsigned char *dig + return true; + } + m_ok = EVP_DigestFinal_ex(md_context, m_digest, nullptr); +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L + EVP_MD_CTX_cleanup(md_context); + #else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + EVP_MD_CTX_reset(md_context); diff --git a/databases/mysql84-server/files/patch-sql_auth_sql__authorization.cc b/databases/mysql84-server/files/patch-sql_auth_sql__authorization.cc new file mode 100644 index 000000000000..17a8d3d0ba71 --- /dev/null +++ b/databases/mysql84-server/files/patch-sql_auth_sql__authorization.cc @@ -0,0 +1,13 @@ +--- sql/auth/sql_authorization.cc.orig 2024-04-10 06:26:28 UTC ++++ sql/auth/sql_authorization.cc +@@ -237,6 +237,10 @@ bool operator==(const Role_id &a, const std::string &b + return tmp == b; + } + ++bool operator==(const Role_id &a, const LEX_CSTRING &b) { ++ return a == to_string(b); ++} ++ + bool operator==(const std::pair<Role_id, bool> &a, const std::string &b) { + return a.first == b; + } diff --git a/databases/mysql84-server/files/patch-sql_conn__handler_socket__connection.cc b/databases/mysql84-server/files/patch-sql_conn__handler_socket__connection.cc new file mode 100644 index 000000000000..38341a4c6902 --- /dev/null +++ b/databases/mysql84-server/files/patch-sql_conn__handler_socket__connection.cc @@ -0,0 +1,32 @@ +--- sql/conn_handler/socket_connection.cc.orig 2024-04-10 06:26:28 UTC ++++ sql/conn_handler/socket_connection.cc +@@ -961,9 +961,11 @@ bool check_connection_refused_by_tcp_wrapper(MYSQL_SOC + signal(SIGCHLD, SIG_DFL); + request_init(&req, RQ_DAEMON, libwrap_name, RQ_FILE, + mysql_socket_getfd(connect_sock), nullptr); +- fromhost(&req); ++ void (*my_fromhost) (void *) = (void (*)(void *)) fromhost; ++ my_fromhost(&req); + +- if (!hosts_access(&req)) { ++ int (*my_hosts_access) (void *) = (int (*) (void *)) hosts_access; ++ if (!my_hosts_access(&req)) { + /* + This may be stupid but refuse() includes an exit(0) + which we surely don't want... +@@ -975,12 +977,13 @@ bool check_connection_refused_by_tcp_wrapper(MYSQL_SOC + This is unproblematic as TCP-wrapper is unix specific, + anyway. + */ ++ char *(*my_eval_client) (void *) = (char *(*) (void *)) eval_client; + syslog(LOG_AUTH | LOG_WARNING, "refused connect from %s", +- eval_client(&req)); ++ my_eval_client(&req)); + + #ifdef HAVE_LIBWRAP_PROTOTYPES + // Some distros have patched tcpd.h to have proper prototypes +- if (req.sink) (req.sink)(req.fd); ++ if (req.sink) ((void (*)(int)) (req.sink))(req.fd); + #else + // Some distros have not patched tcpd.h + if (req.sink) ((void (*)(int))req.sink)(req.fd); diff --git a/databases/mysql84-server/files/patch-sql_mysqld.cc b/databases/mysql84-server/files/patch-sql_mysqld.cc new file mode 100644 index 000000000000..ee83e9bcd358 --- /dev/null +++ b/databases/mysql84-server/files/patch-sql_mysqld.cc @@ -0,0 +1,11 @@ +--- sql/mysqld.cc.orig 2024-04-10 06:26:28 UTC ++++ sql/mysqld.cc +@@ -7000,7 +7000,7 @@ static PSI_memory_key key_memory_openssl = PSI_NOT_INS + + static PSI_memory_key key_memory_openssl = PSI_NOT_INSTRUMENTED; + +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + #define FILE_LINE_ARGS + #else + #define FILE_LINE_ARGS , const char *, int diff --git a/databases/mysql84-server/files/patch-sql_ssl__init__callback.cc b/databases/mysql84-server/files/patch-sql_ssl__init__callback.cc new file mode 100644 index 000000000000..59d4ee2445db --- /dev/null +++ b/databases/mysql84-server/files/patch-sql_ssl__init__callback.cc @@ -0,0 +1,36 @@ +--- sql/ssl_init_callback.cc.orig 2024-04-10 06:26:28 UTC ++++ sql/ssl_init_callback.cc +@@ -165,14 +165,14 @@ static Sys_var_charptr Sys_tls_version( + + static Sys_var_charptr Sys_tls_version( + "tls_version", +-#ifdef HAVE_TLSv13 ++#if defined(HAVE_TLSv13) && !defined(LIBRESSL_VERSION_NUMBER) + "TLS version, permitted values are TLSv1.2, TLSv1.3", + #else + "TLS version, permitted values are TLSv1.2", + #endif + PERSIST_AS_READONLY GLOBAL_VAR(opt_tls_version), + CMD_LINE(REQUIRED_ARG, OPT_TLS_VERSION), IN_FS_CHARSET, +-#ifdef HAVE_TLSv13 ++#if defined(HAVE_TLSv13) && !defined(LIBRESSL_VERSION_NUMBER) + "TLSv1.2,TLSv1.3", + #else + "TLSv1.2", +@@ -248,14 +248,14 @@ static Sys_var_charptr Sys_admin_tls_version( + + static Sys_var_charptr Sys_admin_tls_version( + "admin_tls_version", +-#ifdef HAVE_TLSv13 ++#if defined(HAVE_TLSv13) && !defined(LIBRESSL_VERSION_NUMBER) + "TLS version for --admin-port, permitted values are TLSv1.2, TLSv1.3", + #else + "TLS version for --admin-port, permitted values are TLSv1.2", + #endif + PERSIST_AS_READONLY GLOBAL_VAR(opt_admin_tls_version), + CMD_LINE(REQUIRED_ARG, OPT_ADMIN_TLS_VERSION), IN_FS_CHARSET, +-#ifdef HAVE_TLSv13 ++#if defined(HAVE_TLSv13) && !defined(LIBRESSL_VERSION_NUMBER) + "TLSv1.2,TLSv1.3", + #else + "TLSv1.2", diff --git a/databases/mysql84-server/files/patch-sql_sys__vars.cc b/databases/mysql84-server/files/patch-sql_sys__vars.cc new file mode 100644 index 000000000000..df10cf5efa42 --- /dev/null +++ b/databases/mysql84-server/files/patch-sql_sys__vars.cc @@ -0,0 +1,29 @@ +--- sql/sys_vars.cc.orig 2024-04-10 06:26:28 UTC ++++ sql/sys_vars.cc +@@ -1999,7 +1999,7 @@ static Sys_var_ulong Sys_connect_timeout( + "The number of seconds the mysqld server is waiting for a connect " + "packet before responding with 'Bad handshake'", + GLOBAL_VAR(connect_timeout), CMD_LINE(REQUIRED_ARG), +- VALID_RANGE(2, LONG_TIMEOUT), DEFAULT(CONNECT_TIMEOUT), BLOCK_SIZE(1)); ++ VALID_RANGE(2, INT_MAX32 / 1000), DEFAULT(CONNECT_TIMEOUT), BLOCK_SIZE(1)); + + static Sys_var_ulong Sys_information_schema_stats_expiry( + "information_schema_stats_expiry", +@@ -3036,7 +3036,7 @@ static Sys_var_ulong Sys_net_read_timeout( + "Number of seconds to wait for more data from a connection before " + "aborting the read", + SESSION_VAR(net_read_timeout), CMD_LINE(REQUIRED_ARG), +- VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_READ_TIMEOUT), BLOCK_SIZE(1), ++ VALID_RANGE(1, INT_MAX32 / 1000), DEFAULT(NET_READ_TIMEOUT), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(nullptr), + ON_UPDATE(fix_net_read_timeout)); + +@@ -3057,7 +3057,7 @@ static Sys_var_ulong Sys_net_write_timeout( + "Number of seconds to wait for a block to be written to a connection " + "before aborting the write", + SESSION_VAR(net_write_timeout), CMD_LINE(REQUIRED_ARG), +- VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_WRITE_TIMEOUT), BLOCK_SIZE(1), ++ VALID_RANGE(1, INT_MAX32 / 1000), DEFAULT(NET_WRITE_TIMEOUT), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(nullptr), + ON_UPDATE(fix_net_write_timeout)); + diff --git a/databases/mysql84-server/files/patch-storage_innobase_include_srv0mon.h b/databases/mysql84-server/files/patch-storage_innobase_include_srv0mon.h new file mode 100644 index 000000000000..a0279de2a126 --- /dev/null +++ b/databases/mysql84-server/files/patch-storage_innobase_include_srv0mon.h @@ -0,0 +1,13 @@ +--- storage/innobase/include/srv0mon.h.orig 2024-04-10 06:26:28 UTC ++++ storage/innobase/include/srv0mon.h +@@ -41,6 +41,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + /* Required for FreeBSD so that INT64_MAX is defined. */ + #define __STDC_LIMIT_MACROS + #endif /* __STDC_LIMIT_MACROS */ ++#ifdef __DragonFly__ ++/* The hack above doen't work for dragonfly, stdint.h already imported */ ++#include <machine/int_limits.h> ++#endif + + #include <stdint.h> + diff --git a/databases/mysql84-server/files/patch-storage_innobase_include_ut0crc32.h b/databases/mysql84-server/files/patch-storage_innobase_include_ut0crc32.h new file mode 100644 index 000000000000..b1b372a2d8c7 --- /dev/null +++ b/databases/mysql84-server/files/patch-storage_innobase_include_ut0crc32.h @@ -0,0 +1,12 @@ +--- storage/innobase/include/ut0crc32.h.orig 2024-04-10 06:26:28 UTC ++++ storage/innobase/include/ut0crc32.h +@@ -133,7 +133,9 @@ CRC32_DEFAULT + #endif /* CRC32_ARM64 */ + + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __FreeBSD__ + #include <asm/hwcap.h> ++#endif /* __FreeBSD__ */ + #include <sys/auxv.h> + #endif /* CRC32_ARM64_DEFAULT */ + diff --git a/databases/mysql84-server/files/patch-storage_innobase_ut_crc32.cc b/databases/mysql84-server/files/patch-storage_innobase_ut_crc32.cc new file mode 100644 index 000000000000..af15dd2ee114 --- /dev/null +++ b/databases/mysql84-server/files/patch-storage_innobase_ut_crc32.cc @@ -0,0 +1,104 @@ +--- storage/innobase/ut/crc32.cc.orig 2024-04-10 06:26:28 UTC ++++ storage/innobase/ut/crc32.cc +@@ -333,8 +333,25 @@ bool can_use_poly_mul() { return true; } + #endif /* CRC32_ARM64_APPLE */ + + #ifdef CRC32_ARM64_DEFAULT ++#ifdef __FreeBSD__ ++bool can_use_crc32() { ++ unsigned long capabilities; ++ ++ if (elf_aux_info(AT_HWCAP, &capabilities, sizeof(unsigned long))) ++ return false; ++ return capabilities & HWCAP_CRC32; ++} ++bool can_use_poly_mul() { ++ unsigned long capabilities; ++ ++ if (elf_aux_info(AT_HWCAP, &capabilities, sizeof(unsigned long))) ++ return false; ++ return capabilities & HWCAP_CRC32; ++} ++#else + bool can_use_crc32() { return getauxval(AT_HWCAP) & HWCAP_CRC32; } + bool can_use_poly_mul() { return getauxval(AT_HWCAP) & HWCAP_PMULL; } ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + + /** A helper template to statically unroll a loop with a fixed number of +@@ -443,25 +460,39 @@ uint64_t crc32_impl::update(uint64_t crc, uint64_t dat + + #ifdef CRC32_ARM64 + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __clang__ + MY_ATTRIBUTE((target("+crc"))) ++#else ++MY_ATTRIBUTE((target("crc"))) ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + uint32_t crc32_impl::update(uint32_t crc, unsigned char data) { + return __crc32cb(crc, data); + } + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __clang__ + MY_ATTRIBUTE((target("+crc"))) ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + uint32_t crc32_impl::update(uint32_t crc, uint16_t data) { + return __crc32ch(crc, data); + } + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __clang__ + MY_ATTRIBUTE((target("+crc"))) ++#else ++MY_ATTRIBUTE((target("crc"))) ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + uint32_t crc32_impl::update(uint32_t crc, uint32_t data) { + return __crc32cw(crc, data); + } + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __clang__ + MY_ATTRIBUTE((target("+crc"))) ++#else ++MY_ATTRIBUTE((target("crc"))) ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + uint64_t crc32_impl::update(uint64_t crc, uint64_t data) { + return (uint64_t)__crc32cd((uint32_t)crc, data); +@@ -508,7 +539,11 @@ template <uint32_t w> + } + template <uint32_t w> + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __clang__ + MY_ATTRIBUTE((target("+crypto"))) ++#else ++MY_ATTRIBUTE((target("crypto"))) ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + uint64_t use_pclmul::polynomial_mul_rev(uint32_t rev_u) { + constexpr uint64_t flipped_w = flip_at_32(w); +@@ -751,7 +786,11 @@ MY_ATTRIBUTE((flatten)) + MY_ATTRIBUTE((flatten)) + #endif /* CRC32_ARM64_APPLE */ + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __clang__ + MY_ATTRIBUTE((target("+crc+crypto"), flatten)) ++#else ++MY_ATTRIBUTE((target("crc,crypto"))) ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + uint32_t crc32_using_pclmul(const byte *data, size_t len) { + return crc32<use_pclmul>(0, data, len); +@@ -771,7 +810,11 @@ MY_ATTRIBUTE((flatten)) + MY_ATTRIBUTE((flatten)) + #endif /* CRC32_ARM64_APPLE */ + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __clang__ + MY_ATTRIBUTE((target("+crc"), flatten)) ++#else ++MY_ATTRIBUTE((target("crc"))) ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + uint32_t crc32_using_unrolled_loop_poly_mul(const byte *data, size_t len) { + return crc32<use_unrolled_loop_poly_mul>(0, data, len); diff --git a/databases/mysql84-server/files/patch-storage_myisam_mi__dynrec.cc b/databases/mysql84-server/files/patch-storage_myisam_mi__dynrec.cc new file mode 100644 index 000000000000..b9d73f50435e --- /dev/null +++ b/databases/mysql84-server/files/patch-storage_myisam_mi__dynrec.cc @@ -0,0 +1,22 @@ +--- storage/myisam/mi_dynrec.cc.orig 2024-04-10 06:26:28 UTC ++++ storage/myisam/mi_dynrec.cc +@@ -86,17 +86,12 @@ bool mi_dynmap_file(MI_INFO *info, my_off_t size) { + return true; + } + /* +- I wonder if it is good to use MAP_NORESERVE. From the Linux man page: +- MAP_NORESERVE +- Do not reserve swap space for this mapping. When swap space is +- reserved, one has the guarantee that it is possible to modify the +- mapping. When swap space is not reserved one might get SIGSEGV +- upon a write if no physical memory is available. ++ MAP_NORESERVE is unimplemented in FreeBSD + */ + info->s->file_map = (uchar *)my_mmap( + nullptr, (size_t)size, + info->s->mode == O_RDONLY ? PROT_READ : PROT_READ | PROT_WRITE, +- MAP_SHARED | MAP_NORESERVE, info->dfile, 0L); ++ MAP_SHARED, info->dfile, 0L); + if (info->s->file_map == (uchar *)MAP_FAILED) { + info->s->file_map = nullptr; + return true; diff --git a/databases/mysql84-server/files/patch-support-files_CMakeLists.txt b/databases/mysql84-server/files/patch-support-files_CMakeLists.txt new file mode 100644 index 000000000000..1ce8c74a9680 --- /dev/null +++ b/databases/mysql84-server/files/patch-support-files_CMakeLists.txt @@ -0,0 +1,39 @@ +--- support-files/CMakeLists.txt.orig 2024-04-10 06:26:28 UTC ++++ support-files/CMakeLists.txt +@@ -25,8 +25,9 @@ ENDIF() + RETURN() + ENDIF() + +-INSTALL(FILES mysql.m4 +- DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development) ++IF(NOT WITHOUT_CLIENTLIBS) ++ INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development) ++ENDIF(NOT WITHOUT_CLIENTLIBS) + + SET(localstatedir "${MYSQL_DATADIR}") + +@@ -44,7 +45,7 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql-log-r + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql-log-rotate.in + ${CMAKE_CURRENT_BINARY_DIR}/mysql-log-rotate @ONLY) + +-IF(NOT WITH_SYSTEMD) ++IF(NOT WITHOUT_SERVER) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql.server.sh + ${CMAKE_CURRENT_BINARY_DIR}/mysql.server @ONLY + ) +@@ -60,6 +61,7 @@ ENDIF() + ) + ENDIF() + ++IF(NOT WITHOUT_SERVER) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql-log-rotate + COMPONENT Server_Scripts + DESTINATION ${INSTALL_SUPPORTFILESDIR} +@@ -67,6 +69,7 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql-log-ro + OWNER_READ OWNER_WRITE + GROUP_READ WORLD_READ + ) ++ENDIF() + + IF(WITH_ROUTER) + IF(NOT WITH_SYSTEMD) diff --git a/databases/mysql84-server/files/patch-utilities_CMakeLists.txt b/databases/mysql84-server/files/patch-utilities_CMakeLists.txt new file mode 100644 index 000000000000..ba5520dc4474 --- /dev/null +++ b/databases/mysql84-server/files/patch-utilities_CMakeLists.txt @@ -0,0 +1,68 @@ +--- utilities/CMakeLists.txt.orig 2024-04-10 06:26:28 UTC ++++ utilities/CMakeLists.txt +@@ -30,13 +30,19 @@ ENDIF() + DISABLE_DOCUMENTATION_WARNINGS() + ENDIF() + +-IF(NOT CMAKE_CROSSCOMPILING) ++IF(WITHOUT_CLIENTLIBS) + MYSQL_ADD_EXECUTABLE(comp_err + comp_err.cc + COMPONENT Test + LINK_LIBRARIES mysys ++ SKIP_INSTALL) ++ELSE(WITHOUT_CLIENTLIBS) ++ MYSQL_ADD_EXECUTABLE(comp_err ++ comp_err.cc ++ COMPONENT Test ++ LINK_LIBRARIES mysys + ) +-ENDIF() ++ENDIF(WITHOUT_CLIENTLIBS) + + MYSQL_ADD_EXECUTABLE(comp_client_err + comp_client_err.cc +@@ -121,10 +127,35 @@ MYSQL_ADD_EXECUTABLE(static_thread_local_test + EXCLUDE_FROM_ALL + ) + ++IF(WITHOUT_CLIENTLIBS) + MYSQL_ADD_EXECUTABLE(my_print_defaults + my_print_defaults.cc + COMPONENT Server + LINK_LIBRARIES mysys ++ SKIP_INSTALL ) ++MYSQL_ADD_EXECUTABLE(perror ++ perror.cc ++ COMPONENT Server ++ DEPENDENCIES GenError ++ LINK_LIBRARIES mysys ++ SKIP_INSTALL ) ++ENDIF(WITHOUT_CLIENTLIBS) ++ ++IF(WITHOUT_CLIENTLIBS) ++IF(BUILD_BUNDLED_LZ4) ++ MYSQL_ADD_EXECUTABLE(lz4_decompress ++ lz4_decompress.cc ++ COMPONENT Server ++ LINK_LIBRARIES ${LZ4_LIBRARY} mysys ++ SKIP_INSTALL ) ++ENDIF() ++ENDIF(WITHOUT_CLIENTLIBS) ++ ++IF(NOT WITHOUT_CLIENTLIBS) ++MYSQL_ADD_EXECUTABLE(my_print_defaults ++ my_print_defaults.cc ++ COMPONENT Server ++ LINK_LIBRARIES mysys + ) + MYSQL_ADD_EXECUTABLE(perror + perror.cc +@@ -132,6 +163,7 @@ MYSQL_ADD_EXECUTABLE(perror + DEPENDENCIES GenError + LINK_LIBRARIES mysys + ) ++ENDIF() + + # All targets below belong to COMPONENT Server and depend on InnoDB. + IF(WITHOUT_SERVER) diff --git a/databases/mysql84-server/files/patch-vio_viossl.cc b/databases/mysql84-server/files/patch-vio_viossl.cc new file mode 100644 index 000000000000..100aa9242692 --- /dev/null +++ b/databases/mysql84-server/files/patch-vio_viossl.cc @@ -0,0 +1,30 @@ +--- vio/viossl.cc.orig 2024-04-10 06:26:28 UTC ++++ vio/viossl.cc +@@ -46,7 +46,8 @@ + BIO_set_callback_ex was added in openSSL 1.1.1 + For older openSSL, use the deprecated BIO_set_callback. + */ +-#if OPENSSL_VERSION_NUMBER >= 0x10101000L ++#if OPENSSL_VERSION_NUMBER >= 0x10101000L && \ ++ !defined(LIBRESSL_VERSION_NUMBER) + #define HAVE_BIO_SET_CALLBACK_EX + #endif + +@@ -700,7 +701,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, l + #if !defined(NDEBUG) + { + STACK_OF(SSL_COMP) *ssl_comp_methods = nullptr; +- ssl_comp_methods = SSL_COMP_get_compression_methods(); ++ ssl_comp_methods = (STACK_OF(SSL_COMP) *)SSL_COMP_get_compression_methods(); + n = sk_SSL_COMP_num(ssl_comp_methods); + DBUG_PRINT("info", ("Available compression methods:\n")); + if (n == 0) +@@ -708,7 +709,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, l + else + for (j = 0; j < n; j++) { + SSL_COMP *c = sk_SSL_COMP_value(ssl_comp_methods, j); +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + DBUG_PRINT("info", (" %d: %s\n", c->id, c->name)); + #else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + DBUG_PRINT("info", diff --git a/databases/mysql84-server/files/patch-vio_viosslfactories.cc b/databases/mysql84-server/files/patch-vio_viosslfactories.cc new file mode 100644 index 000000000000..0e28a57cf4f4 --- /dev/null +++ b/databases/mysql84-server/files/patch-vio_viosslfactories.cc @@ -0,0 +1,46 @@ +--- vio/viosslfactories.cc.orig 2024-04-10 06:26:28 UTC ++++ vio/viosslfactories.cc +@@ -46,6 +46,7 @@ + #include <tls_ciphers.h> + + #include "my_openssl_fips.h" ++#include "openssl/crypto.h" + #define TLS_VERSION_OPTION_SIZE 256 + + static bool ssl_initialized = false; +@@ -334,7 +335,7 @@ long process_tls_version(const char *tls_version) { + const char *separator = ","; + char *token, *lasts = nullptr; + +-#ifdef HAVE_TLSv13 ++#if defined(HAVE_TLSv13) && !defined(LIBRESSL_VERSION_NUMBER) + const char *tls_version_name_list[] = {"TLSv1.2", "TLSv1.3"}; + const char ctx_flag_default[] = "TLSv1.2,TLSv1.3"; + const long tls_ctx_list[] = {SSL_OP_NO_TLSv1_2, SSL_OP_NO_TLSv1_3}; +@@ -405,7 +406,7 @@ static struct st_VioSSLFd *new_VioSSLFd( + ssl_ctx_options = (ssl_ctx_options | ssl_ctx_flags) & + (SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | + SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2 +-#ifdef HAVE_TLSv13 ++#if defined(HAVE_TLSv13) && !defined(LIBRESSL_VERSION_NUMBER) + | SSL_OP_NO_TLSv1_3 + #endif /* HAVE_TLSv13 */ + | SSL_OP_NO_TICKET); +@@ -414,7 +415,7 @@ static struct st_VioSSLFd *new_VioSSLFd( + return nullptr; + + if (!(ssl_fd->ssl_context = SSL_CTX_new(is_client ? +-#ifdef HAVE_TLSv13 ++#if defined(HAVE_TLSv13) && !defined(LIBRESSL_VERSION_NUMBER) + TLS_client_method() + : TLS_server_method() + #else /* HAVE_TLSv13 */ +@@ -429,7 +430,7 @@ static struct st_VioSSLFd *new_VioSSLFd( + return nullptr; + } + +-#ifdef HAVE_TLSv13 ++#if defined(HAVE_TLSv13) && !defined(LIBRESSL_VERSION_NUMBER) + /* + Set OpenSSL TLS v1.3 ciphersuites. + Note that an empty list is permissible. diff --git a/databases/mysql84-server/files/pkg-message.in b/databases/mysql84-server/files/pkg-message.in new file mode 100644 index 000000000000..605517879bee --- /dev/null +++ b/databases/mysql84-server/files/pkg-message.in @@ -0,0 +1,21 @@ +[ +{ type: install + message: <<EOM +There is no initial password for first time use of MySQL. +Keep in mind to reset it to a secure password. + +MySQL 8.4 has a default %%ETCDIR%%/my.cnf, +remember to replace it with your own +or set `mysql_optfile="$YOUR_CNF_FILE` in rc.conf. +EOM +} +{ type: upgrade + message: <<EOM +As of MySQL 8.0.16, the MySQL server performs the upgrade tasks previously +handled by mysql_upgrade. Consequently, mysql_upgrade is unneeded and is +deprecated as of that version, and will be removed in a future MySQL version. +Because mysql_upgrade no longer performs upgrade tasks, +it exits with status 0 unconditionally. +EOM +} +] diff --git a/databases/mysql84-server/pkg-descr b/databases/mysql84-server/pkg-descr new file mode 100644 index 000000000000..2d1842c56336 --- /dev/null +++ b/databases/mysql84-server/pkg-descr @@ -0,0 +1,4 @@ +MySQL is a very fast, multi-threaded, multi-user and robust SQL +(Structured Query Language) database server. MySQL Server is intended for +mission-critical, heavy-load production systems as well as for embedding +into mass-deployed software diff --git a/databases/mysql84-server/pkg-plist b/databases/mysql84-server/pkg-plist new file mode 100644 index 000000000000..a206f562ddbf --- /dev/null +++ b/databases/mysql84-server/pkg-plist @@ -0,0 +1,255 @@ +LICENSE.router +README.router +bin/ibd2sdi +bin/innochecksum +bin/myisam_ftdump +bin/myisamchk +bin/myisamlog +bin/myisampack +bin/mysql_client_test +bin/mysql_keyring_encryption_test +bin/mysql_secure_installation +bin/mysql_test_event_tracking +bin/mysql_tzinfo_to_sql +bin/mysqld_multi +bin/mysqld_safe +bin/mysqldumpslow +bin/mysqlrouter +bin/mysqlrouter_keyring +bin/mysqlrouter_passwd +bin/mysqlrouter_plugin_info +bin/mysqltest +bin/mysqltest_safe_process +bin/mysqlxtest +etc/logrotate.d/mysqlrouter +%%ETCDIR%%/my.cnf.sample +lib/mysql/libmysqlharness.so +lib/mysql/libmysqlharness.so.1 +lib/mysql/libmysqlharness_stdx.so +lib/mysql/libmysqlharness_stdx.so.1 +lib/mysql/libmysqlharness_tls.so +lib/mysql/libmysqlharness_tls.so.1 +lib/mysql/libmysqlrouter.so +lib/mysql/libmysqlrouter.so.1 +lib/mysql/libmysqlrouter_connection_pool.so.1 +lib/mysql/libmysqlrouter_destination_status.so.1 +lib/mysql/libmysqlrouter_http.so +lib/mysql/libmysqlrouter_http.so.1 +lib/mysql/libmysqlrouter_http_auth_backend.so +lib/mysql/libmysqlrouter_http_auth_backend.so.1 +lib/mysql/libmysqlrouter_http_auth_realm.so +lib/mysql/libmysqlrouter_http_auth_realm.so.1 +lib/mysql/libmysqlrouter_io_component.so +lib/mysql/libmysqlrouter_io_component.so.1 +lib/mysql/libmysqlrouter_metadata_cache.so.1 +lib/mysql/libmysqlrouter_mysqlxmessages.so.1 +lib/mysql/libmysqlrouter_routing.so.1 +lib/mysql/libmysqlrouter_routing_connections.so.1 +lib/mysql/libprotobuf-lite.so.24.4.0 +lib/mysql/mysqlrouter/connection_pool.so +lib/mysql/mysqlrouter/destination_status.so +lib/mysql/mysqlrouter/http_auth_backend.so +lib/mysql/mysqlrouter/http_auth_realm.so +lib/mysql/mysqlrouter/http_server.so +lib/mysql/mysqlrouter/io.so +lib/mysql/mysqlrouter/keepalive.so +lib/mysql/mysqlrouter/metadata_cache.so +lib/mysql/mysqlrouter/rest_api.so +lib/mysql/mysqlrouter/rest_connection_pool.so +lib/mysql/mysqlrouter/rest_metadata_cache.so +lib/mysql/mysqlrouter/rest_router.so +lib/mysql/mysqlrouter/rest_routing.so +lib/mysql/mysqlrouter/router_openssl.so +lib/mysql/mysqlrouter/router_protobuf.so +lib/mysql/mysqlrouter/routing.so +lib/mysql/plugin/adt_null.so +lib/mysql/plugin/auth.so +lib/mysql/plugin/auth_test_plugin.so +lib/mysql/plugin/component_audit_api_message_emit.so +lib/mysql/plugin/component_example_component1.so +lib/mysql/plugin/component_example_component2.so +lib/mysql/plugin/component_example_component3.so +lib/mysql/plugin/component_log_filter_dragnet.so +lib/mysql/plugin/component_log_sink_json.so +lib/mysql/plugin/component_log_sink_syseventlog.so +lib/mysql/plugin/component_log_sink_test.so +lib/mysql/plugin/component_mysqlbackup.so +lib/mysql/plugin/component_mysqlx_global_reset.so +lib/mysql/plugin/component_pfs_example.so +lib/mysql/plugin/component_pfs_example_component_population.so +lib/mysql/plugin/component_query_attributes.so +lib/mysql/plugin/component_reference_cache.so +lib/mysql/plugin/component_test_audit_api_message.so +lib/mysql/plugin/component_test_backup_lock_service.so +lib/mysql/plugin/component_test_component_deinit.so +lib/mysql/plugin/component_test_event_tracking_consumer.so +lib/mysql/plugin/component_test_event_tracking_consumer_a.so +lib/mysql/plugin/component_test_event_tracking_consumer_b.so +lib/mysql/plugin/component_test_event_tracking_consumer_c.so +lib/mysql/plugin/component_test_event_tracking_producer_a.so +lib/mysql/plugin/component_test_event_tracking_producer_b.so +lib/mysql/plugin/component_test_host_application_signal.so +lib/mysql/plugin/component_test_mysql_command_services.so +lib/mysql/plugin/component_test_mysql_current_thread_reader.so +lib/mysql/plugin/component_test_mysql_runtime_error.so +lib/mysql/plugin/component_test_mysql_system_variable_set.so +lib/mysql/plugin/component_test_mysql_thd_store_service.so +lib/mysql/plugin/component_test_pfs_notification.so +lib/mysql/plugin/component_test_pfs_resource_group.so +lib/mysql/plugin/component_test_sensitive_system_variables.so +lib/mysql/plugin/component_test_server_telemetry_traces.so +lib/mysql/plugin/component_test_status_var_reader.so +lib/mysql/plugin/component_test_status_var_service.so +lib/mysql/plugin/component_test_status_var_service_int.so +lib/mysql/plugin/component_test_status_var_service_reg_only.so +lib/mysql/plugin/component_test_status_var_service_str.so +lib/mysql/plugin/component_test_status_var_service_unreg_only.so +lib/mysql/plugin/component_test_string_service.so +lib/mysql/plugin/component_test_string_service_charset.so +lib/mysql/plugin/component_test_string_service_long.so +lib/mysql/plugin/component_test_sys_var_service.so +lib/mysql/plugin/component_test_sys_var_service_int.so +lib/mysql/plugin/component_test_sys_var_service_same.so +lib/mysql/plugin/component_test_sys_var_service_str.so +lib/mysql/plugin/component_test_system_variable_source.so +lib/mysql/plugin/component_test_table_access.so +lib/mysql/plugin/component_test_udf_registration.so +lib/mysql/plugin/component_test_udf_services.so +lib/mysql/plugin/component_udf_reg_3_func.so +lib/mysql/plugin/component_udf_reg_avg_func.so +lib/mysql/plugin/component_udf_reg_int_func.so +lib/mysql/plugin/component_udf_reg_int_same_func.so +lib/mysql/plugin/component_udf_reg_only_3_func.so +lib/mysql/plugin/component_udf_reg_real_func.so +lib/mysql/plugin/component_udf_unreg_3_func.so +lib/mysql/plugin/component_udf_unreg_int_func.so +lib/mysql/plugin/component_udf_unreg_real_func.so +lib/mysql/plugin/component_validate_password.so +lib/mysql/plugin/component_keyring_file.so +lib/mysql/plugin/conflicting_variables.so +lib/mysql/plugin/connection_control.so +lib/mysql/plugin/daemon_example.ini +lib/mysql/plugin/ddl_rewriter.so +lib/mysql/plugin/group_replication.so +lib/mysql/plugin/ha_example.so +lib/mysql/plugin/ha_mock.so +lib/mysql/plugin/keyring_udf.so +lib/mysql/plugin/libdaemon_example.so +lib/mysql/plugin/libtest_framework.so +lib/mysql/plugin/libtest_services.so +lib/mysql/plugin/libtest_services_threaded.so +lib/mysql/plugin/libtest_session_attach.so +lib/mysql/plugin/libtest_session_detach.so +lib/mysql/plugin/libtest_session_in_thd.so +lib/mysql/plugin/libtest_session_info.so +lib/mysql/plugin/libtest_sql_2_sessions.so +lib/mysql/plugin/libtest_sql_all_col_types.so +lib/mysql/plugin/libtest_sql_cmds_1.so +lib/mysql/plugin/libtest_sql_commit.so +lib/mysql/plugin/libtest_sql_complex.so +lib/mysql/plugin/libtest_sql_errors.so +lib/mysql/plugin/libtest_sql_lock.so +lib/mysql/plugin/libtest_sql_processlist.so +lib/mysql/plugin/libtest_sql_replication.so +lib/mysql/plugin/libtest_sql_reset_connection.so +lib/mysql/plugin/libtest_sql_shutdown.so +lib/mysql/plugin/libtest_sql_sleep_is_connected.so +lib/mysql/plugin/libtest_sql_sqlmode.so +lib/mysql/plugin/libtest_sql_stmt.so +lib/mysql/plugin/libtest_sql_stored_procedures_functions.so +lib/mysql/plugin/libtest_sql_views_triggers.so +lib/mysql/plugin/libtest_x_sessions_deinit.so +lib/mysql/plugin/libtest_x_sessions_init.so +lib/mysql/plugin/locking_service.so +lib/mysql/plugin/mypluglib.so +lib/mysql/plugin/mysql_clone.so +lib/mysql/plugin/mysql_no_login.so +lib/mysql/plugin/pfs_example_plugin_employee.so +lib/mysql/plugin/qa_auth_client.so +lib/mysql/plugin/qa_auth_interface.so +lib/mysql/plugin/qa_auth_server.so +lib/mysql/plugin/replication_observers_example_plugin.so +lib/mysql/plugin/rewrite_example.so +lib/mysql/plugin/rewriter.so +lib/mysql/plugin/semisync_master.so +lib/mysql/plugin/semisync_replica.so +lib/mysql/plugin/semisync_slave.so +lib/mysql/plugin/semisync_source.so +lib/mysql/plugin/component_test_execute_prepared_statement.so +lib/mysql/plugin/component_test_execute_regular_statement.so +lib/mysql/plugin/component_test_mysql_signal_handler.so +lib/mysql/plugin/component_test_server_telemetry_metrics.so +lib/mysql/plugin/test_security_context.so +lib/mysql/plugin/test_services_command_services.so +lib/mysql/plugin/test_services_host_application_signal.so +lib/mysql/plugin/test_services_plugin_registry.so +lib/mysql/plugin/test_udf_services.so +lib/mysql/plugin/udf_example.so +lib/mysql/plugin/validate_password.so +lib/mysql/plugin/version_token.so +lib/mysql/private/libprotobuf-lite.so.24.4.0 +lib/mysql/private/libprotobuf.so.24.4.0 +libexec/mysqld +%%DATADIR%%/bulgarian/errmsg.sys +%%DATADIR%%/charsets/Index.xml +%%DATADIR%%/charsets/README +%%DATADIR%%/charsets/armscii8.xml +%%DATADIR%%/charsets/ascii.xml +%%DATADIR%%/charsets/cp1250.xml +%%DATADIR%%/charsets/cp1251.xml +%%DATADIR%%/charsets/cp1256.xml +%%DATADIR%%/charsets/cp1257.xml +%%DATADIR%%/charsets/cp850.xml +%%DATADIR%%/charsets/cp852.xml +%%DATADIR%%/charsets/cp866.xml +%%DATADIR%%/charsets/dec8.xml +%%DATADIR%%/charsets/geostd8.xml +%%DATADIR%%/charsets/greek.xml +%%DATADIR%%/charsets/hebrew.xml +%%DATADIR%%/charsets/hp8.xml +%%DATADIR%%/charsets/keybcs2.xml +%%DATADIR%%/charsets/koi8r.xml +%%DATADIR%%/charsets/koi8u.xml +%%DATADIR%%/charsets/latin1.xml +%%DATADIR%%/charsets/latin2.xml +%%DATADIR%%/charsets/latin5.xml +%%DATADIR%%/charsets/latin7.xml +%%DATADIR%%/charsets/macce.xml +%%DATADIR%%/charsets/macroman.xml +%%DATADIR%%/charsets/swe7.xml +%%DATADIR%%/czech/errmsg.sys +%%DATADIR%%/danish/errmsg.sys +%%DATADIR%%/dictionary.txt +%%DATADIR%%/dutch/errmsg.sys +%%DATADIR%%/english/errmsg.sys +%%DATADIR%%/estonian/errmsg.sys +%%DATADIR%%/french/errmsg.sys +%%DATADIR%%/german/errmsg.sys +%%DATADIR%%/greek/errmsg.sys +%%DATADIR%%/hungarian/errmsg.sys +%%DATADIR%%/install_rewriter.sql +%%DATADIR%%/italian/errmsg.sys +%%DATADIR%%/japanese/errmsg.sys +%%DATADIR%%/korean/errmsg.sys +%%DATADIR%%/messages_to_clients.txt +%%DATADIR%%/messages_to_error_log.txt +%%DATADIR%%/mysql-log-rotate +%%DATADIR%%/mysql.server +%%DATADIR%%/mysqld_multi.server +%%DATADIR%%/norwegian-ny/errmsg.sys +%%DATADIR%%/norwegian/errmsg.sys +%%DATADIR%%/polish/errmsg.sys +%%DATADIR%%/portuguese/errmsg.sys +%%DATADIR%%/romanian/errmsg.sys +%%DATADIR%%/russian/errmsg.sys +%%DATADIR%%/serbian/errmsg.sys +%%DATADIR%%/slovak/errmsg.sys +%%DATADIR%%/spanish/errmsg.sys +%%DATADIR%%/swedish/errmsg.sys +%%DATADIR%%/ukrainian/errmsg.sys +%%DATADIR%%/uninstall_rewriter.sql +%%DATADIR%%router/docs/sample_mysqlrouter.conf +@dir %%ETCDIR%%/keyring +@dir lib/mysql/plugin/debug +@dir %%MY_SECDIR%% +@dir %%MY_TMPDIR%% |