git: 7e5dafecce04 - main - add databases/mysql81-server and databases/mysql81-client

From: Jochen Neumeister <joneum_at_FreeBSD.org>
Date: Mon, 18 Dec 2023 06:55:19 UTC
The branch main has been updated by joneum:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7e5dafecce04d97df3963192d41f25984c7e57d2

commit 7e5dafecce04d97df3963192d41f25984c7e57d2
Author:     Jochen Neumeister <joneum@FreeBSD.org>
AuthorDate: 2023-12-18 06:51:37 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2023-12-18 06:54:41 +0000

    add databases/mysql81-server and databases/mysql81-client
    
    Welcome MySQL81 to the Port Tree
    
    Special thanks for help: fluffy, both
    Sponsored by:   Netzkommune GmbH
---
 Mk/Uses/mysql.mk                                   |   1 +
 Mk/bsd.default-versions.mk                         |   2 +-
 databases/Makefile                                 |   2 +
 databases/mysql81-client/Makefile                  |  47 ++++
 databases/mysql81-client/pkg-message               |   8 +
 databases/mysql81-client/pkg-plist                 |  40 ++++
 databases/mysql81-server/Makefile                  | 221 ++++++++++++++++++
 databases/mysql81-server/distinfo                  |   3 +
 ...st__1__77__0_boost_move_detail_type__traits.hpp |  20 ++
 .../files/extra-patch-scripts_CMakeLists.txt       |  10 +
 .../extra-patch-storage_innobase_log_log0recv.cc   |  11 +
 databases/mysql81-server/files/my.cnf.sample.in    |  57 +++++
 databases/mysql81-server/files/mysql-server.in     |  78 +++++++
 .../mysql81-server/files/patch-CMakeLists.txt      |  95 ++++++++
 .../files/patch-client_CMakeLists.txt              |  70 ++++++
 .../files/patch-cmake_install__layout.cmake        |  95 ++++++++
 .../files/patch-cmake_os_DragonFly.cmake           |  27 +++
 .../files/patch-cmake_os_FreeBSD.cmake             |  25 ++
 .../mysql81-server/files/patch-cmake_plugin.cmake  |  27 +++
 .../mysql81-server/files/patch-cmake_ssl.cmake     |  23 ++
 .../files/patch-include_my__compare.h              |  11 +
 .../files/patch-include_my__stacktrace.h           |  11 +
 .../files/patch-include_my__thread__os__id.h       |  15 ++
 .../mysql81-server/files/patch-include_myisam.h    |  11 +
 .../files/patch-libmysql_CMakeLists.txt            |  68 ++++++
 .../files/patch-libservices_CMakeLists.txt         |  12 +
 .../mysql81-server/files/patch-man_CMakeLists.txt  |  76 +++++++
 .../files/patch-mysys_my__default.cc               |  62 +++++
 .../mysql81-server/files/patch-mysys_my__kdf.cc    |  20 ++
 ...ugin_password__validation_validate__password.cc |  11 +
 .../files/patch-plugin_x_CMakeLists.txt            |  11 +
 ...t_authentication_sha256__scramble__generator.cc |  11 +
 .../files/patch-plugin_x_configure.cmake           |  15 ++
 ...ysql_harness_net__ts_impl_kqueue__io__service.h |  13 ++
 ...arness_include_mysql_harness_net__ts_internet.h |  10 +
 .../patch-router_src_harness_src_CMakeLists.txt    |  24 ++
 ...-router_src_harness_src_tls__client__context.cc |  11 +
 .../patch-router_src_harness_src_tls__context.cc   |  44 ++++
 .../files/patch-router_src_http_src_CMakeLists.txt |  26 +++
 .../files/patch-router_src_io_src_CMakeLists.txt   |  10 +
 .../patch-router_src_router_src_CMakeLists.txt     |  10 +
 .../files/patch-scripts_CMakeLists.txt             |  52 +++++
 .../files/patch-scripts_mysqld__safe.sh            |  19 ++
 .../files/patch-sql_auth_sha2__password__common.cc |  11 +
 .../files/patch-sql_auth_sql__authorization.cc     |  13 ++
 .../patch-sql_conn__handler_socket__connection.cc  |  32 +++
 databases/mysql81-server/files/patch-sql_mysqld.cc |  11 +
 .../files/patch-sql_ssl__init__callback.cc         |  36 +++
 .../mysql81-server/files/patch-sql_sys__vars.cc    |  29 +++
 .../files/patch-storage_innobase_include_srv0mon.h |  13 ++
 .../patch-storage_innobase_include_ut0crc32.h      |  12 +
 .../files/patch-storage_innobase_ut_crc32.cc       | 104 +++++++++
 .../files/patch-storage_myisam_mi__dynrec.cc       |  22 ++
 ..._temptable_include_temptable_lock__free__type.h |  17 ++
 .../files/patch-support-files_CMakeLists.txt       |  39 ++++
 .../files/patch-utilities_CMakeLists.txt           |  79 +++++++
 databases/mysql81-server/files/patch-vio_viossl.cc |  30 +++
 .../files/patch-vio_viosslfactories.cc             |  46 ++++
 databases/mysql81-server/files/pkg-message.in      |  21 ++
 databases/mysql81-server/pkg-descr                 |  12 +
 databases/mysql81-server/pkg-plist                 | 253 +++++++++++++++++++++
 61 files changed, 2194 insertions(+), 1 deletion(-)

diff --git a/Mk/Uses/mysql.mk b/Mk/Uses/mysql.mk
index 6805867a0076..eb8419f56b59 100644
--- a/Mk/Uses/mysql.mk
+++ b/Mk/Uses/mysql.mk
@@ -67,6 +67,7 @@ DEFAULT_MYSQL_VER?=	${MYSQL_DEFAULT:S/.//}
 MYSQL57_LIBVER=		20
 MYSQL57p_LIBVER=	20
 MYSQL80_LIBVER=		21
+MYSQL81_LIBVER=		22
 .  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 580a5be8c7c8..1c185478f6d9 100644
--- a/Mk/bsd.default-versions.mk
+++ b/Mk/bsd.default-versions.mk
@@ -105,7 +105,7 @@ LUAJIT_DEFAULT?=	luajit-devel
 .  endif
 # Possible values: 5.10, 5.20, 6.8
 MONO_DEFAULT?=		5.20
-# Possible values: 5.7, 8.0, 10.5m, 10.6m, 10.11m, 5.7p, 5.7w
+# Possible values: 5.7, 8.0, 8.1, 10.5m, 10.6m, 10.11m, 5.7p, 5.7w
 MYSQL_DEFAULT?=		8.0
 # Possible values: ninja, samurai
 NINJA_DEFAULT?=		ninja
diff --git a/databases/Makefile b/databases/Makefile
index aa34af96a0e6..1419b72701ea 100644
--- a/databases/Makefile
+++ b/databases/Makefile
@@ -198,6 +198,8 @@
     SUBDIR += mysql57-server
     SUBDIR += mysql80-client
     SUBDIR += mysql80-server
+    SUBDIR += mysql81-client
+    SUBDIR += mysql81-server
     SUBDIR += mysqlbackup
     SUBDIR += mysqldump-secure
     SUBDIR += mysqlreport
diff --git a/databases/mysql81-client/Makefile b/databases/mysql81-client/Makefile
new file mode 100644
index 000000000000..398c1429a8d4
--- /dev/null
+++ b/databases/mysql81-client/Makefile
@@ -0,0 +1,47 @@
+PORTNAME=	mysql
+PORTREVISION=	0
+PKGNAMESUFFIX=	81-client
+
+COMMENT=	Multithreaded SQL database (client)
+
+LICENSE+=	LGPL21
+
+MASTERDIR=	${.CURDIR}/../mysql81-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.22 ${STAGEDIR}${PREFIX}/lib/mysql/libmysqlclient_r.so.22
+
+.include "${MASTERDIR}/Makefile"
diff --git a/databases/mysql81-client/pkg-message b/databases/mysql81-client/pkg-message
new file mode 100644
index 000000000000..dbbd72fe1c67
--- /dev/null
+++ b/databases/mysql81-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/mysql80-server
+EOM
+}
+]
diff --git a/databases/mysql81-client/pkg-plist b/databases/mysql81-client/pkg-plist
new file mode 100644
index 000000000000..343d742a8e81
--- /dev/null
+++ b/databases/mysql81-client/pkg-plist
@@ -0,0 +1,40 @@
+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/mysqlpump
+bin/mysqlshow
+bin/mysqlslap
+bin/perror
+bin/zlib_decompress
+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.22
+lib/mysql/libmysqlclient_r.a
+lib/mysql/libmysqlclient_r.so
+lib/mysql/libmysqlclient_r.so.22
+lib/mysql/plugin/authentication_fido_client.so
+lib/mysql/plugin/authentication_ldap_sasl_client.so
+lib/mysql/plugin/authentication_oci_client.so
+libdata/pkgconfig/mysqlclient.pc
+share/aclocal/mysql.m4
diff --git a/databases/mysql81-server/Makefile b/databases/mysql81-server/Makefile
new file mode 100644
index 000000000000..6e1f76506644
--- /dev/null
+++ b/databases/mysql81-server/Makefile
@@ -0,0 +1,221 @@
+PORTNAME?=		mysql
+PORTVERSION=		8.1.0
+PORTREVISION?=		0
+CATEGORIES=		databases
+MASTER_SITES=		MYSQL/MySQL-8.1
+PKGNAMESUFFIX?=		81-server
+DISTNAME=		${PORTNAME}-boost-${PORTVERSION}${DISTVERSIONSUFFIX}
+
+MAINTAINER=		joneum@FreeBSD.org
+COMMENT?=		Multithreaded SQL database (server)
+WWW=		https://www.mysql.com/
+
+LICENSE=		GPLv2
+
+WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}${DISTVERSIONSUFFIX}
+
+SLAVEDIRS=	databases/mysql81-client
+USES=		bison:build cmake:noninja cpe groff:run libedit localbase \
+		ncurses perl5 pkgconfig shebangfix ssl
+
+CPE_VENDOR=	oracle
+
+USE_CXXSTD=	c++17
+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 \
+		libevent.so:devel/libevent \
+		libicutu.so:devel/icu \
+		liblz4.so:archivers/liblz4 \
+		libfido2.so:security/libfido2 \
+		libhidapi.so:comms/hidapi \
+		${LIB_DEPENDS_${ARCH}}
+LIB_DEPENDS_aarch64=	libunwind.so:devel/libunwind
+LIB_DEPENDS_amd64=	libunwind.so:devel/libunwind
+LIB_DEPENDS_armv7=	libunwind.so:devel/libunwind
+LIB_DEPENDS_i386=	libunwind.so:devel/libunwind
+LIB_DEPENDS_powerpc=		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_armv7=	libunwind>0:devel/libunwind
+BUILD_DEPENDS_i386=	libunwind>0:devel/libunwind
+BUILD_DEPENDS_powerpc=	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" \
+		-DMYSQL_KEYRINGDIR="${ETCDIR}/keyring" \
+		-DWITH_BOOST="${WRKSRC}/boost" \
+		-DWITH_SYSTEM_LIBS=1 \
+		-DWITH_EDITLINE=system \
+		-DWITH_LIBEVENT=system \
+		-DWITH_LZ4=system \
+		-DWITH_ICU=system \
+		-DWITH_CURL=system \
+		-DWITH_ZSTD=bundled \
+		-DWITH_PROTOBUF=bundled \
+		-DWITH_SSL=system \
+		-DWITH_AUTHENTICATION_FIDO=1 \
+		-DBUILD_BUNDLED_ZLIB=0 \
+		-DBUILD_BUNDLED_LZ4=0
+
+# The Mroonga, RocksDB, and TokuDB storage engines are disabled.
+# Mroonga is only buildable on little endian archs.
+# RocksDB is only buildable on little endian archs and requires POSIX timers.
+# TokuDB is only buildable on 64-bit little endian archs.
+CMAKE_ARGS+=	-DWITHOUT_MROONGA_STORAGE_ENGINE=1 \
+		-DWITHOUT_ROCKSDB_STORAGE_ENGINE=1 \
+		-DWITHOUT_TOKUDB_STORAGE_ENGINE=1
+
+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:81
+
+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+=	-DWITH_EMBEDDED_SERVER="ON"
+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=""
+PERFSCHM_SUB_LIST_OFF+=		PERFSCHEMRC="--skip-performance-schema"
+FEDERATED_SUB_LIST+=		FEDER="--federated"
+FEDERATED_SUB_LIST_OFF+=	FEDER=""
+.endif
+
+.include <bsd.port.options.mk>
+
+# Since 8.0.20 release innodb engine uses new memory alligned allocator
+# which is broken on i386 due to different size of types and caused a
+# 'static_assert(alignof(T) <= alignof(std::max_align_t))' error
+.if ${ARCH} == i386
+CMAKE_ARGS+=	-DDISABLE_PSI_MEMORY=1
+SSP_UNSAFE=	yes
+.endif
+
+.if ${ARCH} == powerpc
+LDFLAGS+=	-latomic
+USES+=		compiler:gcc-c++11-lib
+.else
+CXXFLAGS+=	-malign-double
+USES+=		compiler:c++17-lang
+.endif
+
+.include <bsd.port.pre.mk>
+
+post-extract:
+	@${RM} -rv ${WRKSRC}/sql/sql_hints.yy.cc ${WRKSRC}/sql/sql_hints.yy.h
+
+# This can be removed after FreeBSD 12.4 and 13.1 EoL
+.if defined(CLIENT_ONLY) && !exists(${OPENSSLBASE}/libdata/pkgconfig/openssl.pc)
+EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-scripts_CMakeLists.txt
+.endif
+
+# XXX MBi alignment issue
+.if ${ARCH} == i386
+EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-boost_boost__1__77__0_boost_move_detail_type__traits.hpp \
+	${PATCHDIR}/extra-patch-storage_innobase_log_log0recv.cc
+.endif
+
+.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/mysql81-server/distinfo b/databases/mysql81-server/distinfo
new file mode 100644
index 000000000000..13d3c57ad112
--- /dev/null
+++ b/databases/mysql81-server/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1695150470
+SHA256 (mysql-boost-8.1.0.tar.gz) = cb19648bc8719b9f6979924bfea806b278bd26b8d67740e5742c6f363f142188
+SIZE (mysql-boost-8.1.0.tar.gz) = 440038191
diff --git a/databases/mysql81-server/files/extra-patch-boost_boost__1__77__0_boost_move_detail_type__traits.hpp b/databases/mysql81-server/files/extra-patch-boost_boost__1__77__0_boost_move_detail_type__traits.hpp
new file mode 100644
index 000000000000..ee630b3a3655
--- /dev/null
+++ b/databases/mysql81-server/files/extra-patch-boost_boost__1__77__0_boost_move_detail_type__traits.hpp
@@ -0,0 +1,20 @@
+--- boost/boost_1_77_0/boost/move/detail/type_traits.hpp.orig	2021-08-05 09:42:11 UTC
++++ boost/boost_1_77_0/boost/move/detail/type_traits.hpp
+@@ -1104,7 +1104,7 @@ struct alignment_struct
+ typedef int (alignment_dummy::*member_ptr);
+ typedef int (alignment_dummy::*member_function_ptr)();
+ struct alignment_struct
+-{  long double dummy[4];  };
++{  double XXXdummy[4];  };
+ 
+ /////////////////////////////
+ //    max_align_t
+@@ -1122,7 +1122,7 @@ union max_align
+    float       float_;
+    double      double_;
+    void *      void_ptr_;
+-   long double long_double_[4];
++   double XXXlong_double_[4];
+    alignment_dummy *unknown_class_ptr_;
+    function_ptr function_ptr_;
+    member_function_ptr member_function_ptr_;
diff --git a/databases/mysql81-server/files/extra-patch-scripts_CMakeLists.txt b/databases/mysql81-server/files/extra-patch-scripts_CMakeLists.txt
new file mode 100644
index 000000000000..df891b025ccd
--- /dev/null
+++ b/databases/mysql81-server/files/extra-patch-scripts_CMakeLists.txt
@@ -0,0 +1,10 @@
+--- scripts/CMakeLists.txt.orig	2022-12-16 15:34:44 UTC
++++ scripts/CMakeLists.txt
+@@ -362,7 +362,6 @@ IF (WITH_SSL STREQUAL "system")
+   # We have implemented "system" for other platforms as well, but those
+   # are non-native packages.
+   IF(LINUX OR SOLARIS OR FREEBSD)
+-    SET(CONFIG_REQUIRES_PRIVATE "openssl")
+     STRING(REPLACE "-lssl" "" CONFIG_LIBS_PRIVATE "${CONFIG_LIBS_PRIVATE}")
+     STRING(REPLACE "-lcrypto" "" CONFIG_LIBS_PRIVATE "${CONFIG_LIBS_PRIVATE}")
+     STRING(REGEX REPLACE "[ ]+" " " CONFIG_LIBS_PRIVATE
diff --git a/databases/mysql81-server/files/extra-patch-storage_innobase_log_log0recv.cc b/databases/mysql81-server/files/extra-patch-storage_innobase_log_log0recv.cc
new file mode 100644
index 000000000000..0a6d0d4ec0df
--- /dev/null
+++ b/databases/mysql81-server/files/extra-patch-storage_innobase_log_log0recv.cc
@@ -0,0 +1,11 @@
+--- storage/innobase/log/log0recv.cc.orig	2023-12-17 10:36:48 UTC
++++ storage/innobase/log/log0recv.cc
+@@ -3695,7 +3695,7 @@ static void recv_recovery_begin(log_t &log, const lsn_
+       than number of concurrent IOs we want to sustain. We should also keep in
+       mind that the limit for the deltas hashmap is not strictly enforced and
+       this number includes the not-well specified safety margin. */
+-      size_t{256} * srv_buf_pool_instances);
++      static_cast<unsigned int>(size_t{256} * srv_buf_pool_instances));
+   const size_t delta_hashmap_max_mem =
+       UNIV_PAGE_SIZE * (buf_pool_get_n_pages() - pages_to_be_kept_free);
+
diff --git a/databases/mysql81-server/files/my.cnf.sample.in b/databases/mysql81-server/files/my.cnf.sample.in
new file mode 100644
index 000000000000..3d1264c1bd61
--- /dev/null
+++ b/databases/mysql81-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/mysql81-server/files/mysql-server.in b/databases/mysql81-server/files/mysql-server.in
new file mode 100644
index 000000000000..c79874df9f2c
--- /dev/null
+++ b/databases/mysql81-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/mysql81-server/files/patch-CMakeLists.txt b/databases/mysql81-server/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..a7c3d317d734
--- /dev/null
+++ b/databases/mysql81-server/files/patch-CMakeLists.txt
@@ -0,0 +1,95 @@
+--- CMakeLists.txt.orig	2023-06-21 07:52:10 UTC
++++ CMakeLists.txt
+@@ -1850,7 +1850,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
+@@ -1899,6 +1899,7 @@ ENDIF()
+   ENDIF()
+ ENDIF()
+ 
++IF(NOT WITHOUT_TOOLS)
+ # Add system/bundled editline.
+ MYSQL_CHECK_EDITLINE()
+ SET(EDITLINE_WARN_GIVEN)
+@@ -1909,7 +1910,9 @@ ENDIF()
+     "You can use -DWITH_EDITLINE=bundled instead."
+     )
+ ENDIF()
++ENDIF(NOT WITHOUT_TOOLS)
+ 
++IF(NOT WITHOUT_SERVER)
+ # Add libevent
+ MYSQL_CHECK_LIBEVENT()
+ UNSET(LIBEVENT_WARN_GIVEN)
+@@ -1920,6 +1923,7 @@ ENDIF()
+     "You can use -DWITH_LIBEVENT=bundled instead."
+     )
+ ENDIF()
++ENDIF(NOT WITHOUT_SERVER)
+ 
+ # Add lz4 library
+ MYSQL_CHECK_LZ4()
+@@ -2186,7 +2190,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)
+@@ -2232,12 +2238,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()
+@@ -2300,11 +2309,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()
+@@ -2331,6 +2340,7 @@ ENDIF()
+   INCLUDE(fastcov)
+ ENDIF()
+ 
++IF(FALSE)
+ IF(UNIX)
+   ADD_SUBDIRECTORY(man)
+ ENDIF()
+@@ -2530,6 +2540,7 @@ IF(NOT INSTALL_LAYOUT MATCHES "RPM")
+     PATTERN "sp-imp-spec.txt" EXCLUDE
+     PATTERN "README.build" EXCLUDE
+   )
++ENDIF()
+ ENDIF()
+ 
+ # Now that we're done with all ADD_SUBDIRECTORY and thus all feature tests,
diff --git a/databases/mysql81-server/files/patch-client_CMakeLists.txt b/databases/mysql81-server/files/patch-client_CMakeLists.txt
new file mode 100644
index 000000000000..55269b16ec3f
--- /dev/null
+++ b/databases/mysql81-server/files/patch-client_CMakeLists.txt
@@ -0,0 +1,70 @@
+--- client/CMakeLists.txt.orig	2023-06-21 07:52:10 UTC
++++ client/CMakeLists.txt
+@@ -28,10 +28,13 @@ ADD_SUBDIRECTORY(base)
+ ## Subdirectory with common client code.
+ ADD_SUBDIRECTORY(base)
+ ## Subdirectory for mysqlpump code.
++IF(WITHOUT_SERVER)
+ ADD_SUBDIRECTORY(dump)
+ ## Subdirectory for mysql_migrate_keyring code.
+ ADD_SUBDIRECTORY(migrate_keyring)
++ENDIF()
+ 
++IF(NOT WITHOUT_CLIENTLIBS)
+ INCLUDE_DIRECTORIES(
+   ${CMAKE_CURRENT_SOURCE_DIR}/include
+ )
+@@ -47,6 +50,7 @@ MYSQL_ADD_EXECUTABLE(mysql
+   ${CMAKE_CURRENT_SOURCE_DIR}/common/user_registration.cc
+   LINK_LIBRARIES mysqlclient client_base ${EDITLINE_LIBRARY}
+   )
++ENDIF()
+ 
+ IF(NOT WITHOUT_SERVER)
+   MYSQL_ADD_EXECUTABLE(mysql_upgrade
+@@ -55,6 +59,7 @@ ENDIF()
+     )
+ ENDIF()
+ 
++IF(NOT WITHOUT_SERVER)
+ MYSQL_ADD_EXECUTABLE(mysqltest
+   mysqltest.cc
+   mysqltest/error_names.cc
+@@ -71,6 +76,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
+@@ -275,7 +283,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
+@@ -290,6 +300,9 @@ 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
+@@ -300,6 +313,7 @@ MYSQL_ADD_EXECUTABLE(mysql_ssl_rsa_setup
+   path.cc
+   LINK_LIBRARIES mysys
+   )
++ENDIF()
+ 
+ # "WIN32" also covers 64 bit. "echo" is used in some files below "mysql-test/".
+ IF(WIN32)
diff --git a/databases/mysql81-server/files/patch-cmake_install__layout.cmake b/databases/mysql81-server/files/patch-cmake_install__layout.cmake
new file mode 100644
index 000000000000..ca0779443e0d
--- /dev/null
+++ b/databases/mysql81-server/files/patch-cmake_install__layout.cmake
@@ -0,0 +1,95 @@
+--- cmake/install_layout.cmake.orig	2023-06-21 07:52:10 UTC
++++ cmake/install_layout.cmake
+@@ -41,6 +41,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.
+@@ -80,7 +84,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)
+@@ -98,7 +102,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}."
+@@ -167,6 +171,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")
+@@ -361,7 +391,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
+@@ -405,6 +435,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/mysql81-server/files/patch-cmake_os_DragonFly.cmake b/databases/mysql81-server/files/patch-cmake_os_DragonFly.cmake
new file mode 100644
index 000000000000..83c154ee3bcf
--- /dev/null
+++ b/databases/mysql81-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/mysql81-server/files/patch-cmake_os_FreeBSD.cmake b/databases/mysql81-server/files/patch-cmake_os_FreeBSD.cmake
new file mode 100644
*** 1670 LINES SKIPPED ***