On Sun, Jan 14, 2024 at 09:30:11PM -0500, Brad Smith wrote: > On Sun, Jan 14, 2024 at 07:48:48PM +0000, Klemens Nanni wrote: > > On Mon, Nov 06, 2023 at 10:03:22AM +0000, Stuart Henderson wrote: > > > Tried it before, this update breaks mariadb. > > > > libfmt is still behind, perhaps we want to stick to mariadb's 8.0.1 bundle? > > It'd be a downgrade from ports 8.1.1, but mariadb builds and libfmt could > > be updated. > > > > Just a tiny .cmake patch and usual DISTFILES goo. > > > > Builds, but I don't use MariaDB. > > Thoughts? > > This should fix building with newer fmt. Only build tested with the > in tree version.
Builds with latest fmt 10.2.1, so does rspamd currently avoiding system fmt due to its older version -- diff for both below. Other fmt consumers fail to build, I'm looking into that. Index: devel/fmt/Makefile =================================================================== RCS file: /cvs/ports/devel/fmt/Makefile,v diff -u -p -r1.5 Makefile --- devel/fmt/Makefile 7 Jun 2022 11:40:17 -0000 1.5 +++ devel/fmt/Makefile 14 Jan 2024 23:30:23 -0000 @@ -1,10 +1,8 @@ COMMENT= alternative formatting library for C and C++ -GH_ACCOUNT= fmtlib -GH_PROJECT= fmt -GH_TAGNAME= 8.1.1 +DIST_TUPLE= github fmtlib fmt 10.2.1 . -SHARED_LIBS= fmt 1.1 +SHARED_LIBS= fmt 2.0 CATEGORIES= devel @@ -14,16 +12,8 @@ PERMIT_PACKAGE= Yes # C++11 COMPILER= base-clang ports-gcc MODULES= devel/cmake -WANTLIB+= ${COMPILER_LIBCXX} - +WANTLIB= ${COMPILER_LIBCXX} m CONFIGURE_ARGS+= -DBUILD_SHARED_LIBS=on - -# Fix undefined references to pthread_* symbols on clang+ld.bfd archs by -# disabling -Wl,--as-needed. -.include <bsd.port.arch.mk> -.if !${PROPERTIES:Mlld} && ${PROPERTIES:Mclang} -CONFIGURE_ARGS+= -DAS_NEEDED=off -.endif .include <bsd.port.mk> Index: devel/fmt/distinfo =================================================================== RCS file: /cvs/ports/devel/fmt/distinfo,v diff -u -p -r1.3 distinfo --- devel/fmt/distinfo 7 Jun 2022 11:40:17 -0000 1.3 +++ devel/fmt/distinfo 14 Jan 2024 23:17:10 -0000 @@ -1,2 +1,2 @@ -SHA256 (fmt-8.1.1.tar.gz) = PXlNPPZ2M7NLJ3Hrnwc73ofoRuDTldJU33shHvHsc0Y= -SIZE (fmt-8.1.1.tar.gz) = 826254 +SHA256 (fmtlib-fmt-10.2.1.tar.gz) = ElDkzFi/Bu5jFWdSP0iEjcRZYTPhY/AmFcl/eLq2yBE= +SIZE (fmtlib-fmt-10.2.1.tar.gz) = 854665 Index: devel/fmt/patches/patch-CMakeLists_txt =================================================================== RCS file: devel/fmt/patches/patch-CMakeLists_txt diff -N devel/fmt/patches/patch-CMakeLists_txt --- devel/fmt/patches/patch-CMakeLists_txt 7 Jun 2022 11:40:17 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,24 +0,0 @@ -Allow linking without '-Wl,--as-needed', fix the build on clang+ld.bfd archs. -It's needed to do it like this since target_link_libraries takes preference -over LDFLAGS. - -Index: CMakeLists.txt ---- CMakeLists.txt.orig -+++ CMakeLists.txt -@@ -72,6 +72,7 @@ set_verbose(FMT_INC_DIR ${CMAKE_INSTALL_INCLUDEDIR} CA - option(FMT_PEDANTIC "Enable extra warnings and expensive tests." OFF) - option(FMT_WERROR "Halt the compilation with an error on compiler warnings." - OFF) -+option(AS_NEEDED "Use -Wl,--as-needed for linking." ON) - - # Options that control generation of various targets. - option(FMT_DOC "Generate the doc target." ${FMT_MASTER_PROJECT}) -@@ -286,7 +287,7 @@ endif () - - if (BUILD_SHARED_LIBS) - if (UNIX AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS" AND -- NOT EMSCRIPTEN) -+ NOT EMSCRIPTEN AND AS_NEEDED) - # Fix rpmlint warning: - # unused-direct-shlib-dependency /usr/lib/libformat.so.1.1.0 /lib/libm.so.6. - target_link_libraries(fmt -Wl,--as-needed) Index: devel/fmt/patches/patch-src_os_cc =================================================================== RCS file: devel/fmt/patches/patch-src_os_cc diff -N devel/fmt/patches/patch-src_os_cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fmt/patches/patch-src_os_cc 14 Jan 2024 23:50:33 -0000 @@ -0,0 +1,17 @@ +unbreak test compilation + +/usr/ports/pobj/fmt-10.2.1/fmt-10.2.1/test/../src/os.cc:190:23: error: expected unqualified-id + int fd = FMT_SYSTEM(fileno FMT_DISABLE_MACRO(file_)); + +Index: src/os.cc +--- src/os.cc.orig ++++ src/os.cc +@@ -187,7 +187,7 @@ int buffered_file::descriptor() const { + #elif defined(FMT_HAS_SYSTEM) + // fileno is a macro on OpenBSD so we cannot use FMT_POSIX_CALL. + # define FMT_DISABLE_MACRO +- int fd = FMT_SYSTEM(fileno FMT_DISABLE_MACRO(file_)); ++ int fd = (fileno FMT_DISABLE_MACRO(file_)); + #else + int fd = fileno(file_); + #endif Index: devel/fmt/patches/patch-test_gtest-extra-test_cc =================================================================== RCS file: devel/fmt/patches/patch-test_gtest-extra-test_cc diff -N devel/fmt/patches/patch-test_gtest-extra-test_cc --- devel/fmt/patches/patch-test_gtest-extra-test_cc 11 Mar 2022 18:50:03 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,22 +0,0 @@ -Index: test/gtest-extra-test.cc ---- test/gtest-extra-test.cc.orig -+++ test/gtest-extra-test.cc -@@ -345,6 +345,10 @@ TEST(output_redirect_test, flush_error_in_ctor) { - write_copy.dup2(write_fd); // "undo" close or dtor will fail - } - -+#if !defined(__OpenBSD__) -+// NOTE(fagg): There's some bug in this test. Can't find it. -+// Upstream suggests it doesn't matter so lets leave this compiled -+// out for now while i work on figuring it out. - TEST(output_redirect_test, dup_error_in_ctor) { - buffered_file f = open_buffered_file(); - int fd = (f.fileno)(); -@@ -356,6 +360,7 @@ TEST(output_redirect_test, dup_error_in_ctor) { - fmt::format("cannot duplicate file descriptor {}", fd)); - copy.dup2(fd); // "undo" close or dtor will fail - } -+#endif - - TEST(output_redirect_test, restore_and_read) { - file read_end, write_end; Index: devel/fmt/pkg/PLIST =================================================================== RCS file: /cvs/ports/devel/fmt/pkg/PLIST,v diff -u -p -r1.3 PLIST --- devel/fmt/pkg/PLIST 11 Mar 2022 18:50:03 -0000 1.3 +++ devel/fmt/pkg/PLIST 14 Jan 2024 17:37:00 -0000 @@ -6,11 +6,11 @@ include/fmt/compile.h include/fmt/core.h include/fmt/format-inl.h include/fmt/format.h -include/fmt/locale.h include/fmt/os.h include/fmt/ostream.h include/fmt/printf.h include/fmt/ranges.h +include/fmt/std.h include/fmt/xchar.h lib/cmake/ lib/cmake/fmt/ Index: mail/rspamd/Makefile =================================================================== RCS file: /cvs/ports/mail/rspamd/Makefile,v diff -u -p -r1.123 Makefile --- mail/rspamd/Makefile 19 Dec 2023 08:49:08 -0000 1.123 +++ mail/rspamd/Makefile 15 Jan 2024 00:03:19 -0000 @@ -3,6 +3,7 @@ COMMENT= event-driven spam filtering sys GH_ACCOUNT= vstakhov GH_PROJECT= rspamd GH_TAGNAME= 3.7.5 +REVISION= 0 CATEGORIES= mail @@ -14,7 +15,7 @@ MAINTAINER= Stuart Henderson <stu.ports@ PERMIT_PACKAGE= Yes WANTLIB += ${COMPILER_LIBCXX} -WANTLIB += c crypto glib-2.0 icudata icui18n icuio icuuc +WANTLIB += c crypto glib-2.0 fmt icudata icui18n icuio icuuc WANTLIB += intl m pcre2-8 sodium sqlite3 ssl util xxhash z zstd FLAVORS= no_luajit hyperscan @@ -41,6 +42,7 @@ MODPY_RUNDEP= No LIB_DEPENDS= archivers/zstd \ databases/sqlite3 \ + devel/fmt \ devel/gettext,-runtime \ devel/glib2 \ devel/pcre2 \ @@ -65,9 +67,8 @@ CONFIGURE_ARGS+= -DOPENBSD_BUILD=1 \ -DRUNDIR="${LOCALSTATEDIR}/run/rspamd" \ -DRSPAMD_USER="_rspamd" -# not using SYSTEM_FMT; bundled version is newer, but updating -# devel/fmt breaks mariadb build -CONFIGURE_ARGS+= -DSYSTEM_XXHASH=ON \ +CONFIGURE_ARGS+= -DSYSTEM_FMT=ON \ + -DSYSTEM_XXHASH=ON \ -DSYSTEM_ZSTD=ON \ -DENABLE_JEMALLOC=OFF