Skip to content

Commit

Permalink
databases/mongodb70: update to 7.0.0 release
Browse files Browse the repository at this point in the history
Changes: https://www.mongodb.com/docs/v7.0/release-notes/7.0/

* version bump
* new option ARMV80A to support older ARM cpus like Raspberry Pi 4
* pet portclippy and portfmt
* poudriere stage-qa: ok

As upstream has stopped supporting non-LSE ARM cpus I'm adapting
the port also. The option ARMV80A is for backwards compatibility,
but use at your own risk. See pkg-message for more info.
  • Loading branch information
Ronald Klop authored and Ronald Klop committed Aug 15, 2023
1 parent 1905bd0 commit 32bbdaf
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 22 deletions.
15 changes: 11 additions & 4 deletions databases/mongodb70/Makefile
@@ -1,6 +1,6 @@
PORTNAME= mongodb
DISTVERSIONPREFIX= r
DISTVERSION= 7.0.0-rc10
DISTVERSION= 7.0.0
CATEGORIES= databases net
PKGNAMESUFFIX= ${DISTVERSION:R:S/.//}

Expand All @@ -25,7 +25,7 @@ BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cheetah3>0:devel/py-cheetah3@${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 \
Expand All @@ -49,10 +49,10 @@ 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 \
Expand All @@ -74,10 +74,17 @@ 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"
Expand Down
6 changes: 3 additions & 3 deletions 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
16 changes: 16 additions & 0 deletions 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"},
14 changes: 0 additions & 14 deletions databases/mongodb70/files/patch-SConstruct
Expand Up @@ -55,17 +55,3 @@
"-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"},
3 changes: 2 additions & 1 deletion databases/mongodb70/pkg-message
Expand Up @@ -2,7 +2,8 @@
{ type: install
message: <<EOM
MongoDB on Raspberry Pi can work but is unsupported upstream.
Please read https://jira.mongodb.org/browse/SERVER-71772 if you run this on a non-LSE ARM cpu.
Please read https://jira.mongodb.org/browse/SERVER-71772 and enable option
ARMV80A if you run this on a non-LSE ARM cpu like Raspberry Pi 4.
EOM
}
]

0 comments on commit 32bbdaf

Please sign in to comment.