diff --git a/databases/mongodb70/Makefile b/databases/mongodb70/Makefile index a58c1a2426c6..48a879949ed5 100644 --- a/databases/mongodb70/Makefile +++ b/databases/mongodb70/Makefile @@ -1,138 +1,145 @@ PORTNAME= mongodb DISTVERSIONPREFIX= r -DISTVERSION= 7.0.0-rc10 +DISTVERSION= 7.0.0 CATEGORIES= databases net PKGNAMESUFFIX= ${DISTVERSION:R:S/.//} MAINTAINER= ronald@FreeBSD.org COMMENT= Distributed document-oriented "NoSQL" database (7.0.x Branch) WWW= https://www.mongodb.com/docs/v7.0/ 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= ${PYTHON_PKGNAMEPREFIX}cheetah3>0:devel/py-cheetah3@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}psutil>0:sysutils/py-psutil@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pymongo>0:databases/py-pymongo@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}yaml>=3.11:devel/py-yaml@${PY_FLAVOR} # build depends used while running ${WRKSRC}/src/third_party/mozjs/gen-config.sh BUILD_DEPENDS+= autoconf2.13:devel/autoconf2.13 \ gsed:textproc/gsed -LIB_DEPENDS= libcurl.so:ftp/curl \ +LIB_DEPENDS= libcurl.so:ftp/curl \ libpcre2-8.so:devel/pcre2 \ 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++20-lang cpe python:build scons shebangfix # gmake is used while running ${WRKSRC}/src/third_party/mozjs/gen-config.sh USES+= gmake pkgconfig # mozjs tag comes from ${WRKSRC}/src/third_party/mozjs/get-sources.sh MOZJS_TAG= 82aac6af18abcd5bf188afbc821779ccb0ca0902 USE_GITHUB= yes GH_ACCOUNT= mongodb mongodb-forks:mozjs GH_PROJECT= mongo spidermonkey:mozjs GH_TAGNAME= ${MOZJS_TAG}:mozjs USE_RC_SUBR= mongod SHEBANG_FILES= buildscripts/scons.py python_OLD_CMD= @python_interpreter@ -MAKE_ARGS= --cxx-std=20 \ +MAKE_ARGS= --allocator=system \ + --cxx-std=20 \ --disable-warnings-as-errors \ --libc++ \ - --allocator=system \ --runtime-hardening=on \ --use-system-libunwind \ --use-system-pcre2 \ --use-system-snappy \ --use-system-stemmer \ --use-system-yaml \ --use-system-zlib \ --use-system-zstd \ -j${MAKE_JOBS_NUMBER} \ AR=llvm-ar \ MONGO_VERSION=${DISTVERSION} \ VERBOSE=on CFLAGS+= -DBOOST_NO_CXX98_FUNCTION_BASE CONFLICTS_INSTALL= mongodb[0-9][0-9] USERS= mongodb GROUPS= mongodb OPTIONS_DEFINE= LTO SASL SSL NOAVX +OPTIONS_DEFINE_aarch64= ARMV80A OPTIONS_DEFAULT= LTO SASL SSL +# MongoDB on non-LSE ARM cpu like Raspberry Pi can work but is unsupported upstream. +# Can give corruption on high concurrency. +# Please read https://jira.mongodb.org/browse/SERVER-71772. +ARMV80A_DESC= Enable non-LSE ARM64 CPUs like RPI4. NOAVX_DESC= "Disable AVX instructions on amd64 (Sandybridge+)" +ARMV80A_EXTRA_PATCHES= ${FILESDIR}/extrapatch-SConstruct + LTO_MAKE_ARGS= --lto=on NOAVX_MAKE_ARGS= --experimental-optimization="-sandybridge" SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2 SASL_MAKE_ARGS= --use-sasl-client SSL_USES= ssl SSL_MAKE_ARGS= --ssl .include ALL_TARGET= install-core # This ports is only following the Major Release. # https://docs.mongodb.com/manual/reference/versioning/ PORTSCOUT= limit:^7\.0\. CPE_PRODUCT= mongodb .if ${ARCH} == amd64 MOZJS_ARCH= x86_64 .elif ${ARCH} == powerpc64le MOZJS_ARCH= ppc64le .elif ${ARCH} == aarch64 MOZJS_ARCH= ${ARCH} .endif post-patch: ${RM} -rf ${WRKSRC}/src/third_party/pcre2 ${RM} -rf ${WRKSRC}/src/third_party/snappy-* ${RM} -rf ${WRKSRC}/src/third_party/libstemmer_c ${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-configure: # Replacement of ${WRKSRC}/src/third_party/mozjs/get-sources.sh ${LN} -sF ${WRKDIR}/spidermonkey-${MOZJS_TAG} ${WRKSRC}/src/third_party/mozjs/mozilla-release cd ${WRKSRC}/src/third_party/mozjs/mozilla-release/js/src && ${LOCALBASE}/bin/autoconf2.13 cd ${WRKSRC}/src/third_party/mozjs && PYTHON3="${PYTHON_CMD}" ${SH} ./gen-config.sh ${MOZJS_ARCH} freebsd do-build: ${WRKSRC}/buildscripts/scons.py -C ${WRKSRC} ${MAKE_ARGS} do-install: .for f in 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/mongodb70/distinfo b/databases/mongodb70/distinfo index dd9d38b66a35..cee89957d4f2 100644 --- a/databases/mongodb70/distinfo +++ b/databases/mongodb70/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1690478790 -SHA256 (mongodb-mongo-r7.0.0-rc10_GH0.tar.gz) = ea5c1cce1c58dcfc802c28ce3df34eb56db0d826f90a4fe3f13337902073887b -SIZE (mongodb-mongo-r7.0.0-rc10_GH0.tar.gz) = 113471282 +TIMESTAMP = 1691085993 +SHA256 (mongodb-mongo-r7.0.0_GH0.tar.gz) = 922460d4eafcb3f7cc2a0bfc3d77422ed1a3a6c665826a2ed7609efd598820f1 +SIZE (mongodb-mongo-r7.0.0_GH0.tar.gz) = 113448068 SHA256 (mongodb-forks-spidermonkey-82aac6af18abcd5bf188afbc821779ccb0ca0902_GH0.tar.gz) = a365bf54ef4e4fd6a136cf6afa9c620ba0c8982402473b9bfac38928a688a9e0 SIZE (mongodb-forks-spidermonkey-82aac6af18abcd5bf188afbc821779ccb0ca0902_GH0.tar.gz) = 141291901 diff --git a/databases/mongodb70/files/extrapatch-SConstruct b/databases/mongodb70/files/extrapatch-SConstruct new file mode 100644 index 000000000000..05946bd82cdc --- /dev/null +++ b/databases/mongodb70/files/extrapatch-SConstruct @@ -0,0 +1,16 @@ +--- SConstruct.orig 2023-06-07 17:07:38 UTC ++++ SConstruct +@@ -3217,8 +3205,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"}, diff --git a/databases/mongodb70/files/patch-SConstruct b/databases/mongodb70/files/patch-SConstruct index b5998fcb4a52..a6da48e57114 100644 --- a/databases/mongodb70/files/patch-SConstruct +++ b/databases/mongodb70/files/patch-SConstruct @@ -1,71 +1,57 @@ --- SConstruct.orig 2023-06-07 17:07:38 UTC +++ SConstruct @@ -23,7 +23,6 @@ import SCons.Script import SCons import SCons.Script -from mongo_tooling_metrics.lib.top_level_metrics import SConsToolingMetrics from site_scons.mongo import build_profiles # This must be first, even before EnsureSConsVersion, if @@ -1655,16 +1654,6 @@ env.AddMethod(lambda env, name, **kwargs: add_option(n del envDict env.AddMethod(lambda env, name, **kwargs: add_option(name, **kwargs), 'AddOption') -# The placement of this is intentional. Here we setup an atexit method to store tooling metrics. -# We should only register this function after env, env_vars and the parser have been properly initialized. -SConsToolingMetrics.register_metrics( - utc_starttime=datetime.utcnow(), - artifact_dir=env.Dir('$BUILD_DIR').get_abspath(), - env_vars=env_vars, - env=env, - parser=_parser, -) - if get_option('build-metrics'): env['BUILD_METRICS_ARTIFACTS_DIR'] = '$BUILD_ROOT/$VARIANT_DIR' env.Tool('build_metrics') @@ -1801,9 +1790,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()))) install_actions.setup(env, get_option('install-action')) @@ -3026,7 +3015,7 @@ 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'], ) @@ -3034,7 +3023,6 @@ if env.TargetOSIs('posix'): env.Append( CCFLAGS=[ "-fasynchronous-unwind-tables", - "-g2" if not env.TargetOSIs('emscripten') else "-g", "-Wall", "-Wsign-compare", "-Wno-unknown-pragmas", -@@ -3217,8 +3205,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"}, diff --git a/databases/mongodb70/pkg-message b/databases/mongodb70/pkg-message index e0a343760e63..53d27f877b5a 100644 --- a/databases/mongodb70/pkg-message +++ b/databases/mongodb70/pkg-message @@ -1,8 +1,9 @@ [ { type: install message: <