diff --git a/databases/mongodb50/Makefile b/databases/mongodb50/Makefile index d7651e3e3103..853eb146a685 100644 --- a/databases/mongodb50/Makefile +++ b/databases/mongodb50/Makefile @@ -1,96 +1,116 @@ PORTNAME= mongodb DISTVERSIONPREFIX= r DISTVERSION= 5.0.10 +PORTREVISION= 1 CATEGORIES= databases net MASTER_SITES= https://fastdl.mongodb.org/src/ \ http://fastdl.mongodb.org/src/ PKGNAMESUFFIX= ${DISTVERSION:R:S/.//} DISTNAME= mongodb-src-${DISTVERSIONPREFIX}${DISTVERSION} MAINTAINER= ronald-lists@klop.ws COMMENT= Distributed document-oriented "NoSQL" database (5.0.x Branch) LICENSE= APACHE20 SSPLv1 # mongodb is SSPLv1, C++ driver is APACHE20 LICENSE_COMB= multi LICENSE_NAME_SSPLv1= Server Side Public License Version 1 LICENSE_FILE_SSPLv1= ${WRKSRC}/LICENSE-Community.txt LICENSE_PERMS_SSPLv1= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept ONLY_FOR_ARCHS= aarch64 amd64 powerpc64le ONLY_FOR_ARCHS_REASON= only ported to amd64, aarch64, and powerpc64le on FreeBSD; upstream supports arm64, ppc64le, s390x, and x86-64 BUILD_DEPENDS= ${LOCALBASE}/bin/ar:devel/binutils \ ${PYTHON_PKGNAMEPREFIX}cheetah3>0:devel/py-cheetah3@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}psutil>0:sysutils/py-psutil@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}yaml>=3.11:devel/py-yaml@${PY_FLAVOR} -LIB_DEPENDS= libcurl.so:ftp/curl \ +LIB_DEPENDS= libboost_log.so:devel/boost-libs \ + libcurl.so:ftp/curl \ libpcre.so:devel/pcre \ - libsnappy.so:archivers/snappy + libsnappy.so:archivers/snappy \ + libstemmer.so:textproc/snowballstemmer \ + libunwind.so:devel/libunwind \ + libyaml-cpp.so:devel/yaml-cpp \ + libzstd.so:archivers/zstd USES= compiler:c++17-lang cpe python:3.5+,build scons shebangfix USE_RC_SUBR= mongod SHEBANG_FILES= buildscripts/scons.py python_OLD_CMD= @python_interpreter@ MAKE_ARGS= --cxx-std=17 \ --disable-warnings-as-errors \ --libc++ \ --runtime-hardening=on \ + --use-system-boost \ --use-system-pcre \ --use-system-snappy \ + --use-system-stemmer \ + --use-system-libunwind \ + --use-system-yaml \ --use-system-zlib \ + --use-system-zstd \ -j ${MAKE_JOBS_NUMBER} \ AR=${PREFIX}/bin/ar \ VERBOSE=on CONFLICTS_INSTALL= mongodb[0-9][0-9] # etc/mongodb.conf.sample USERS= mongodb GROUPS= mongodb OPTIONS_DEFINE= LTO SASL SSL OPTIONS_DEFAULT= LTO SASL SSL OPTIONS_EXCLUDE_aarch64= ${OPTIONS_EXCLUDE_${ARCH}_${OSREL:R}} OPTIONS_EXCLUDE_aarch64_14= LTO # Does not work with llvm12/llvm13 on aarch64. LTO_MAKE_ARGS= --lto=on SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2 SASL_MAKE_ARGS= --use-sasl-client SSL_USES= ssl SSL_MAKE_ARGS= --ssl .include .if ${ARCH} == aarch64 || ${ARCH} == powerpc64le EXTRA_PATCHES= ${FILESDIR}/${ARCH} .endif ALL_TARGET= install-core # This ports is only following the Major Release. # https://docs.mongodb.com/manual/reference/versioning/ PORTSCOUT= limit:^5\.0\. CPE_PRODUCT= mongodb pre-patch: ${MV} ${WRKSRC}/src/third_party/wiredtiger/src/checksum/power8/crc32.sx ${WRKSRC}/src/third_party/wiredtiger/src/checksum/power8/crc32.S +post-patch: + ${RM} -rf ${WRKSRC}/src/third_party/boost + ${RM} -rf ${WRKSRC}/src/third_party/pcre-* + ${RM} -rf ${WRKSRC}/src/third_party/snappy-* + ${RM} -rf ${WRKSRC}/src/third_party/unwind + ${RM} -rf ${WRKSRC}/src/third_party/yaml-cpp + ${RM} -rf ${WRKSRC}/src/third_party/zlib-* + ${RM} -rf ${WRKSRC}/src/third_party/zstandard-* + do-build: ${WRKSRC}/buildscripts/scons.py -C ${WRKSRC} ${MAKE_ARGS} do-install: .for f in mongo mongod mongos ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${f} .endfor ${INSTALL_DATA} ${WRKSRC}/rpm/mongod.conf ${STAGEDIR}${PREFIX}/etc/mongodb.conf.sample ${MKDIR} ${STAGEDIR}${DOCSDIR} .for doc in LICENSE-Community.txt MPL-2 README THIRD-PARTY-NOTICES ${MV} ${STAGEDIR}${PREFIX}/${doc} ${STAGEDIR}${DOCSDIR}/ .endfor ${RM} ${STAGEDIR}${PREFIX}/bin/resmoke.py .include diff --git a/databases/mongodb50/files/patch-SConstruct b/databases/mongodb50/files/patch-SConstruct index fa8b0bb3ca4f..01af9a42437c 100644 --- a/databases/mongodb50/files/patch-SConstruct +++ b/databases/mongodb50/files/patch-SConstruct @@ -1,45 +1,54 @@ --- SConstruct.orig 2022-05-17 13:56:34 UTC +++ SConstruct @@ -1301,9 +1301,9 @@ if has_option('variables-help'): print(env_vars.GenerateHelpText(env)) Exit(0) -unknown_vars = env_vars.UnknownVariables() -if unknown_vars: - env.FatalError("Unknown variables specified: {0}", ", ".join(list(unknown_vars.keys()))) +#unknown_vars = env_vars.UnknownVariables() +#if unknown_vars: +# env.FatalError("Unknown variables specified: {0}", ", ".join(list(unknown_vars.keys()))) if get_option('install-action') != 'default' and get_option('ninja') != "disabled": env.FatalError("Cannot use non-default install actions when generating Ninja.") @@ -2370,13 +2370,13 @@ if env.TargetOSIs('posix'): # If runtime hardening is requested, then build anything # destined for an executable with the necessary flags for PIE. env.AppendUnique( - PROGCCFLAGS=['-fPIE'], + PROGCCFLAGS=['-fpic'], PROGLINKFLAGS=['-pie'], ) # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used. env.Append( CCFLAGS=["-fasynchronous-unwind-tables", - "-ggdb" if not env.TargetOSIs('emscripten') else "-g", + # "-ggdb" if not env.TargetOSIs('emscripten') else "-g", "-Wall", "-Wsign-compare", "-Wno-unknown-pragmas", @@ -2541,8 +2541,12 @@ if not env.TargetOSIs('windows', 'macOS') and (env.Too # setting it for both C and C++ by setting both of CFLAGS and # CXXFLAGS. + arm_march_flag = "armv8-a" + if get_option('use-hardware-crc32') == "on": + arm_march_flag += "+crc" + default_targeting_flags_for_architecture = { - "aarch64" : { "-march=" : "armv8.2-a", "-mtune=" : "generic" }, + "aarch64" : { "-march=" : arm_march_flag, "-mtune=" : "generic" }, "i386" : { "-march=" : "nocona", "-mtune=" : "generic" }, "ppc64le" : { "-mcpu=" : "power8", "-mtune=" : "power8", "-mcmodel=" : "medium" }, "s390x" : { "-march=" : "z196", "-mtune=" : "zEC12" }, +@@ -2554,7 +2558,7 @@ if not env.TargetOSIs('windows', 'macOS') and (env.Too + if "sandybridge" in selected_experimental_optimizations: + default_targeting_flags_for_architecture["x86_64"] = { + "-march=" : "sandybridge", +- "-mtune=" : "generic", ++ # "-mtune=" : "generic", + "-mprefer-vector-width=" : "128", + } + diff --git a/databases/mongodb50/files/patch-boost-179-compat b/databases/mongodb50/files/patch-boost-179-compat new file mode 100644 index 000000000000..8135db48dd3c --- /dev/null +++ b/databases/mongodb50/files/patch-boost-179-compat @@ -0,0 +1,70 @@ +--- src/mongo/db/auth/security_key_test.cpp ++++ src/mongo/db/auth/security_key_test.cpp +@@ -30,6 +30,7 @@ + #include "mongo/platform/basic.h" + + #include ++#include + + #include "mongo/base/string_data.h" + #include "mongo/db/auth/authorization_manager.h" +--- src/mongo/db/storage/storage_repair_observer.cpp ++++ src/mongo/db/storage/storage_repair_observer.cpp +@@ -41,6 +41,7 @@ + #include + #endif + ++#include + #include + + #include "mongo/db/dbhelpers.h" +--- src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine_test.cpp ++++ src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine_test.cpp +@@ -34,6 +34,7 @@ + #include "mongo/db/storage/kv/kv_engine_test_harness.h" + + #include ++#include + #include + #include + +--- src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp ++++ src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp +@@ -36,6 +36,7 @@ + #include + + #include ++#include + #include + + #include "mongo/base/simple_string_data_comparator.h" +--- src/mongo/shell/shell_utils_extended.cpp ++++ src/mongo/shell/shell_utils_extended.cpp +@@ -37,6 +37,7 @@ + #endif + + #include ++#include + #include + #include + +--- src/mongo/util/stacktrace_threads.cpp ++++ src/mongo/util/stacktrace_threads.cpp +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + #include + #include + #include +--- src/mongo/util/processinfo_linux.cpp ++++ src/mongo/util/processinfo_linux.cpp +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/databases/mongodb50/files/patch-boost-179-link-fix b/databases/mongodb50/files/patch-boost-179-link-fix new file mode 100644 index 000000000000..157ebaaf0221 --- /dev/null +++ b/databases/mongodb50/files/patch-boost-179-link-fix @@ -0,0 +1,21 @@ +--- SConstruct ++++ SConstruct +@@ -3511,17 +3511,11 @@ def doConfigure(myenv): + "BOOST_LOG_NO_SHORTHAND_NAMES", + "BOOST_LOG_USE_NATIVE_SYSLOG", + "BOOST_LOG_WITHOUT_THREAD_ATTR", ++ "BOOST_LOG_DYN_LINK", + "ABSL_FORCE_ALIGNED_ACCESS", + ] + ) + +- if link_model.startswith("dynamic") and not link_model == 'dynamic-sdk': +- conf.env.AppendUnique( +- CPPDEFINES=[ +- "BOOST_LOG_DYN_LINK", +- ] +- ) +- + if use_system_version_of_library("boost"): + if not conf.CheckCXXHeader( "boost/filesystem/operations.hpp" ): + myenv.ConfError("can't find boost headers")