diff --git a/databases/xtrabackup8/Makefile b/databases/xtrabackup8/Makefile index a44d56c4e1b2..c38b83ce5ee1 100644 --- a/databases/xtrabackup8/Makefile +++ b/databases/xtrabackup8/Makefile @@ -1,71 +1,83 @@ PORTNAME= xtrabackup -PORTVERSION= 8.0.14 -PORTREVISION= 6 +PORTVERSION= 8.0.31 +DISTVERSIONSUFFIX= -24 CATEGORIES= databases -MASTER_SITES= https://www.percona.com/downloads/Percona-XtraBackup-${PORTVERSION:R}/Percona-XtraBackup-${PORTVERSION}/source/tarball/:precona \ - https://github.com/percona/percona-xtrabackup/archive/:percona \ +MASTER_SITES= https://github.com/percona/percona-xtrabackup/archive/:percona \ SF/boost/boost/${BOOST_VERSION}:boost PKGNAMESUFFIX= 8 -DISTNAME= percona-${PORTNAME}-${PORTVERSION} -DISTFILES= percona-${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX}:percona \ +DISTFILES= ${PPORTNAME}-${DVERSION}${EXTRACT_SUFX}:percona \ boost_${BOOST_VERSION_UNDER}${EXTRACT_SUFX}:boost MAINTAINER= eugene@zhegan.in COMMENT= Open-source backup tool for InnoDB and XtraDB WWW= https://www.percona.com/doc/percona-xtrabackup/ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/LICENSE -BUILD_DEPENDS= xxd:editors/vim \ - protobuf>=3.0:devel/protobuf \ +BUILD_DEPENDS= protobuf>=3.0:devel/protobuf \ rapidjson>=1.1.0:devel/rapidjson \ - libevent>=2.1:devel/libevent + libevent>=2.1:devel/libevent \ + ncurses>=6.3:devel/ncurses LIB_DEPENDS= libcurl.so:ftp/curl \ libev.so:devel/libev \ libgcrypt.so:security/libgcrypt \ libgpg-error.so:security/libgpg-error \ libicudata.so:devel/icu \ + libncurses.so.6:devel/ncurses \ + libprotobuf-lite.so:devel/protobuf \ libunwind.so:devel/libunwind \ libzstd.so:archivers/zstd RUN_DEPENDS= qpress:archivers/qpress -CONFLICTS_INSTALL= ${PORTNAME} - USES= bison cmake compiler:c++14-lang cpe pkgconfig ssl CPE_VENDOR= percona -CMAKE_ARGS= -DBUILD_CONFIG:STRING=xtrabackup_release +CMAKE_ARGS= -DBUILD_CONFIG:STRING=xtrabackup_release \ + -DWITHOUT_COMPONENT_KEYRING_KMIP:STRING=yes \ + -DWITH_VERSION_CHECK=false + .for component in EDITLINE ICU LIBEVENT PROTOBUF RAPIDJSON ZSTD CMAKE_ARGS+= -DWITH_${component}:STRING=system .endfor +CONFLICTS_INSTALL= ${PORTNAME} + # Bundle last supported Boost release -BOOST_VERSION= 1.72.0 +BOOST_VERSION= 1.77.0 BOOST_VERSION_UNDER= ${BOOST_VERSION:C/\./_/g} CMAKE_ARGS+= -DWITH_BOOST=${WRKDIR}/boost_${BOOST_VERSION_UNDER} +# Build fails without NDEBUG, so force it +CFLAGS+= -DNDEBUG +CXXFLAGS+= -DNDEBUG + +DVERSION= ${PORTVERSION}${DISTVERSIONSUFFIX} +PPORTNAME= percona-${PORTNAME} +WRKSRC= ${WRKDIR}/${PPORTNAME}-${PPORTNAME}-${DVERSION} + .include # Since MySQL 8.0.20 InnoDB engine uses new memory alligned allocator # which is broken on i386 due to different size of types and causes a # 'static_assert(alignof(T) <= alignof(std::max_align_t))' error .if ${ARCH} == i386 CMAKE_ARGS+= -DDISABLE_PSI_MEMORY=1 .endif -post-extract: -# Delete bundled components so we won't accidentally use them, except LZ4 -# which cannot be removed just yet - @${MV} ${WRKSRC}/extra/lz4 ${WRKSRC} - @${RM} -r ${WRKSRC}/extra/* - @${MV} ${WRKSRC}/lz4 ${WRKSRC}/extra +KEEP_EXTRA= lz4 robin-hood-hashing zlib -post-patch: - @${REINPLACE_CMD} -e 's,TRUE,true,' ${WRKSRC}/sql/mysqld.cc +pre-configure: +.for dir in ${KEEP_EXTRA} + @${MV} ${WRKSRC}/extra/${dir} ${WRKDIR} +.endfor + @${RM} -r ${WRKSRC}/extra/* +.for dir in ${KEEP_EXTRA} + @${MV} ${WRKDIR}/${dir} ${WRKSRC}/extra +.endfor post-stage: @${RM} -r ${STAGEDIR}${PREFIX}/docs @${RMDIR} ${STAGEDIR}${PREFIX}/lib/plugin/debug .include diff --git a/databases/xtrabackup8/distinfo b/databases/xtrabackup8/distinfo index 6675fcff0dc8..d0cdcc263929 100644 --- a/databases/xtrabackup8/distinfo +++ b/databases/xtrabackup8/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1650736843 -SHA256 (percona-xtrabackup-8.0.14.tar.gz) = db8d6d2c6a6b016bf24b4942582ebdbd55c09253ccc78daa6911217bd5a73d5d -SIZE (percona-xtrabackup-8.0.14.tar.gz) = 285621091 -SHA256 (boost_1_72_0.tar.gz) = c66e88d5786f2ca4dbebb14e06b566fb642a1a6947ad8cc9091f9f445134143f -SIZE (boost_1_72_0.tar.gz) = 126580835 +TIMESTAMP = 1677255149 +SHA256 (percona-xtrabackup-8.0.31-24.tar.gz) = 0031a91501a98e09b8d3955d580552ae05ac28696143369ba461aa1fa04c5140 +SIZE (percona-xtrabackup-8.0.31-24.tar.gz) = 336261760 +SHA256 (boost_1_77_0.tar.gz) = 5347464af5b14ac54bb945dc68f1dd7c56f0dad7262816b956138fc53bcc0131 +SIZE (boost_1_77_0.tar.gz) = 130620992 diff --git a/databases/xtrabackup8/files/patch-CMakeLists.txt b/databases/xtrabackup8/files/patch-CMakeLists.txt index 15735641fee2..59e23aedca07 100644 --- a/databases/xtrabackup8/files/patch-CMakeLists.txt +++ b/databases/xtrabackup8/files/patch-CMakeLists.txt @@ -1,13 +1,21 @@ ---- CMakeLists.txt.orig 2020-08-28 21:02:32 UTC +--- CMakeLists.txt.orig 2023-01-30 13:34:34 UTC +++ CMakeLists.txt -@@ -1575,10 +1575,6 @@ IF(ENABLE_GCOV) - INCLUDE(fastcov) +@@ -2081,7 +2081,6 @@ ENDIF() + ENDIF() ENDIF() --IF(UNIX) -- ADD_SUBDIRECTORY(man) +-ADD_SUBDIRECTORY(extra/libkmip) + + # + # Setup maintainer mode options by the end. Platform checks are +@@ -2292,10 +2291,6 @@ IF(ENABLE_GCOV) + + IF(ENABLE_GCOV) + INCLUDE(fastcov) -ENDIF() - +-IF(UNIX) +- ADD_SUBDIRECTORY(man) + ENDIF() + IF(NOT WITHOUT_SERVER) - ADD_SUBDIRECTORY(packaging/rpm-common) - ADD_SUBDIRECTORY(packaging/rpm-oel) diff --git a/databases/xtrabackup8/files/patch-llvm-15 b/databases/xtrabackup8/files/patch-llvm-15 new file mode 100644 index 000000000000..95eba05846e8 --- /dev/null +++ b/databases/xtrabackup8/files/patch-llvm-15 @@ -0,0 +1,41 @@ +--- include/varlen_sort.h.orig 2023-01-30 20:34:34.000000000 +0700 ++++ include/varlen_sort.h 2023-02-25 15:15:11.238374000 +0700 +@@ -184,7 +184,9 @@ template <> + + // Required for Iterator. + template <> +-struct iterator_traits : iterator_traits {}; ++struct iterator_traits : iterator_traits { ++ using reference = varlen_element; ++}; + + } // namespace std + +--- storage/innobase/include/ddl0impl.h.orig 2023-01-30 20:34:34.000000000 +0700 ++++ storage/innobase/include/ddl0impl.h 2023-02-25 15:17:06.382636000 +0700 +@@ -118,14 +118,6 @@ struct Row { + + /** Physical row context. */ + struct Row { +- /** Constructor. */ +- Row() = default; +- +- Row(const Row &) = default; +- +- /** Destructor. */ +- ~Row() = default; +- + /** Build a row from a raw record. + @param[in,out] ctx DDL context. + @param[in,out] index Index the record belongs to. +--- unittest/gunit/mysys_my_rdtsc-t.cc.orig 2023-01-30 20:34:34.000000000 +0700 ++++ unittest/gunit/mysys_my_rdtsc-t.cc 2023-02-25 15:23:43.264080000 +0700 +@@ -113,7 +113,7 @@ TEST_F(RDTimeStampCounter, TestCycle) { + ulonglong t1 = my_timer_cycles(); + ulonglong t2; + int i; +- int backward = 0; ++ int backward [[maybe_unused]] = 0; + int nonzero = 0; + + for (i = 0; i < LOOP_COUNT; i++) { diff --git a/databases/xtrabackup8/files/patch-procps b/databases/xtrabackup8/files/patch-procps new file mode 100644 index 000000000000..3331e9140f8a --- /dev/null +++ b/databases/xtrabackup8/files/patch-procps @@ -0,0 +1,15 @@ +--- storage/innobase/xtrabackup/src/CMakeLists.txt.orig 2023-01-30 20:34:34.000000000 +0700 ++++ storage/innobase/xtrabackup/src/CMakeLists.txt 2023-02-25 17:34:58.412247000 +0700 +@@ -132,12 +132,6 @@ TARGET_LINK_LIBRARIES(xtrabackup + crc + ) + +-IF(NOT APPLE) +- TARGET_LINK_LIBRARIES(xtrabackup +- procps +- ) +-ENDIF() +- + # We depend on protobuf because of the mysqlx plugin and replication. + IF(UNIX_INSTALL_RPATH_ORIGIN_PRIV_LIBDIR) + ADD_INSTALL_RPATH_FOR_PROTOBUF(xtrabackup) diff --git a/databases/xtrabackup8/files/patch-sql_binlog.cc b/databases/xtrabackup8/files/patch-sql_binlog.cc deleted file mode 100644 index 2bae3d050d5a..000000000000 --- a/databases/xtrabackup8/files/patch-sql_binlog.cc +++ /dev/null @@ -1,24 +0,0 @@ ---- sql/binlog.cc.orig 2020-08-28 21:02:32 UTC -+++ sql/binlog.cc -@@ -9163,8 +9163,8 @@ void MYSQL_BIN_LOG::report_missing_purged_gtids( - - char *missing_gtids = NULL; - char *slave_executed_gtids = NULL; -- gtid_missing.to_string(&missing_gtids, NULL); -- slave_executed_gtid_set->to_string(&slave_executed_gtids, NULL); -+ gtid_missing.to_string(&missing_gtids, false); -+ slave_executed_gtid_set->to_string(&slave_executed_gtids, false); - - /* - Log the information about the missing purged GTIDs to the error log. -@@ -9217,8 +9217,8 @@ void MYSQL_BIN_LOG::report_missing_gtids( - Gtid_set gtid_missing(slave_executed_gtid_set->get_sid_map()); - gtid_missing.add_gtid_set(slave_executed_gtid_set); - gtid_missing.remove_gtid_set(previous_gtid_set); -- gtid_missing.to_string(&missing_gtids, NULL); -- slave_executed_gtid_set->to_string(&slave_executed_gtids, NULL); -+ gtid_missing.to_string(&missing_gtids, false); -+ slave_executed_gtid_set->to_string(&slave_executed_gtids, false); - - String tmp_uuid; - diff --git a/databases/xtrabackup8/files/patch-storage_innobase_xtrabackup_src_utils.cc b/databases/xtrabackup8/files/patch-storage_innobase_xtrabackup_src_utils.cc new file mode 100644 index 000000000000..34feee9867f6 --- /dev/null +++ b/databases/xtrabackup8/files/patch-storage_innobase_xtrabackup_src_utils.cc @@ -0,0 +1,59 @@ +--- storage/innobase/xtrabackup/src/utils.cc.orig 2023-01-30 20:34:34.000000000 +0700 ++++ storage/innobase/xtrabackup/src/utils.cc 2023-02-25 02:50:31.899561000 +0700 +@@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Bos + + #ifdef __APPLE__ + #include ++#endif ++#if defined(__APPLE__) || defined(__FreeBSD__) + #include + #else + #include +@@ -112,12 +114,14 @@ unsigned long get_version_number(std::string version_s + return major * 10000 + minor * 100 + version; + } + +-#ifdef __APPLE__ ++#if defined(__APPLE__) || defined(__FreeBSD__) + unsigned long host_total_memory() { + unsigned long total_mem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE); + return total_mem; + } ++#endif + ++#ifdef __APPLE__ + unsigned long host_free_memory() { + unsigned long total_mem = host_total_memory(); + int64_t used_mem; +@@ -138,6 +142,31 @@ unsigned long host_free_memory() { + return total_mem - (unsigned long)used_mem; + } + return 0; ++} ++#elif defined(__FreeBSD__) ++unsigned long host_free_memory() { ++ static int mib_free[2] = { -1, 0 }; ++ static int mib_inactive[2] = { -1, 0 }; ++ size_t miblen = sizeof(mib_free) / sizeof(mib_free[0]); ++ uint32_t free_pages, inactive_pages; ++ size_t sz = sizeof(free_pages); ++ ++ free_pages = inactive_pages = 0; ++ ++ if (mib_free[0] < 0 && ++ sysctlnametomib("vm.stats.vm.v_free_count", mib_free, &miblen) < 0) ++ mib_free[0] = 0; ++ if (mib_inactive[0] < 0 && ++ sysctlnametomib("vm.stats.vm.v_inactive_count", mib_inactive, &miblen) < 0) ++ mib_inactive[0] = 0; ++ ++ if (mib_free[0] && ++ sysctl(mib_free, 2, &free_pages, &sz, NULL, 0) < 0) ++ free_pages = 0; /* should not happen */ ++ if (mib_inactive[0] && sysctl(mib_inactive, 2, &inactive_pages, &sz, NULL, 0) < 0) ++ inactive_pages = 0; /* should not happen, too */ ++ ++ return (free_pages + inactive_pages) * sysconf(_SC_PAGESIZE); + } + #else + unsigned long host_total_memory() {