pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/databases
Module Name: pkgsrc
Committed By: adam
Date: Sat Jul 29 11:51:15 UTC 2023
Modified Files:
pkgsrc/databases: Makefile
Added Files:
pkgsrc/databases/mongodb4: DESCR Makefile PLIST distinfo options.mk
pkgsrc/databases/mongodb4/files: mongodb.sh
pkgsrc/databases/mongodb4/files/smf: manifest.xml mongodb.sh
pkgsrc/databases/mongodb4/patches: patch-SConstruct
patch-site__scons_mongo_platform.py
patch-site__scons_site__tools_libtool.py
patch-src_mongo_base_initializer.h
patch-src_mongo_db_query_collation_collator__interface__icu.h
patch-src_mongo_db_repl_isself.cpp
patch-src_mongo_db_storage_storage__repair__observer.cpp
patch-src_mongo_platform_random.cpp
patch-src_mongo_platform_stack__locator__netbsd.cpp
patch-src_mongo_shell_linenoise__utf8.h
patch-src_mongo_shell_shell__utils__extended.cpp
patch-src_mongo_util_intrusive__counter.h
patch-src_mongo_util_processinfo__netbsd.cpp
patch-src_mongo_util_time__support.cpp
patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_float128_op__system.h
patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_src_bid__functions.h
patch-src_third__party_asio-master_asio_include_asio_detail_impl_kqueue__reactor.ipp
patch-src_third__party_mozjs-60_platform_x86__64_netbsd_build_js-confdefs.h
patch-src_third__party_s2_base_port.h
patch-src_third__party_wiredtiger_SConscript
patch-src_third__party_wiredtiger_src_os__posix_os__fs.c
Log Message:
mongodb4: added version 4.4.23
https://www.mongodb.com/docs/manual/release-notes/4.4/
To generate a diff of this commit:
cvs rdiff -u -r1.680 -r1.681 pkgsrc/databases/Makefile
cvs rdiff -u -r0 -r1.1 pkgsrc/databases/mongodb4/DESCR \
pkgsrc/databases/mongodb4/Makefile pkgsrc/databases/mongodb4/PLIST \
pkgsrc/databases/mongodb4/distinfo pkgsrc/databases/mongodb4/options.mk
cvs rdiff -u -r0 -r1.1 pkgsrc/databases/mongodb4/files/mongodb.sh
cvs rdiff -u -r0 -r1.1 pkgsrc/databases/mongodb4/files/smf/manifest.xml \
pkgsrc/databases/mongodb4/files/smf/mongodb.sh
cvs rdiff -u -r0 -r1.1 pkgsrc/databases/mongodb4/patches/patch-SConstruct \
pkgsrc/databases/mongodb4/patches/patch-site__scons_mongo_platform.py \
pkgsrc/databases/mongodb4/patches/patch-site__scons_site__tools_libtool.py \
pkgsrc/databases/mongodb4/patches/patch-src_mongo_base_initializer.h \
pkgsrc/databases/mongodb4/patches/patch-src_mongo_db_query_collation_collator__interface__icu.h \
pkgsrc/databases/mongodb4/patches/patch-src_mongo_db_repl_isself.cpp \
pkgsrc/databases/mongodb4/patches/patch-src_mongo_db_storage_storage__repair__observer.cpp \
pkgsrc/databases/mongodb4/patches/patch-src_mongo_platform_random.cpp \
pkgsrc/databases/mongodb4/patches/patch-src_mongo_platform_stack__locator__netbsd.cpp \
pkgsrc/databases/mongodb4/patches/patch-src_mongo_shell_linenoise__utf8.h \
pkgsrc/databases/mongodb4/patches/patch-src_mongo_shell_shell__utils__extended.cpp \
pkgsrc/databases/mongodb4/patches/patch-src_mongo_util_intrusive__counter.h \
pkgsrc/databases/mongodb4/patches/patch-src_mongo_util_processinfo__netbsd.cpp \
pkgsrc/databases/mongodb4/patches/patch-src_mongo_util_time__support.cpp \
pkgsrc/databases/mongodb4/patches/patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_float128_op__system.h \
pkgsrc/databases/mongodb4/patches/patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_src_bid__functions.h \
pkgsrc/databases/mongodb4/patches/patch-src_third__party_asio-master_asio_include_asio_detail_impl_kqueue__reactor.ipp \
pkgsrc/databases/mongodb4/patches/patch-src_third__party_mozjs-60_platform_x86__64_netbsd_build_js-confdefs.h \
pkgsrc/databases/mongodb4/patches/patch-src_third__party_s2_base_port.h \
pkgsrc/databases/mongodb4/patches/patch-src_third__party_wiredtiger_SConscript \
pkgsrc/databases/mongodb4/patches/patch-src_third__party_wiredtiger_src_os__posix_os__fs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/databases/Makefile
diff -u pkgsrc/databases/Makefile:1.680 pkgsrc/databases/Makefile:1.681
--- pkgsrc/databases/Makefile:1.680 Mon Jul 10 22:55:49 2023
+++ pkgsrc/databases/Makefile Sat Jul 29 11:51:15 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.680 2023/07/10 22:55:49 nia Exp $
+# $NetBSD: Makefile,v 1.681 2023/07/29 11:51:15 adam Exp $
COMMENT= Databases
@@ -113,6 +113,7 @@ SUBDIR+= mongo-c-driver
SUBDIR+= mongo-tools
SUBDIR+= mongodb
SUBDIR+= mongodb3
+SUBDIR+= mongodb4
SUBDIR+= myodbc
SUBDIR+= mysql-connector-c++
SUBDIR+= mysql56-client
Added files:
Index: pkgsrc/databases/mongodb4/DESCR
diff -u /dev/null pkgsrc/databases/mongodb4/DESCR:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/DESCR Sat Jul 29 11:51:15 2023
@@ -0,0 +1,6 @@
+Mongo (from "humongous") is a high-performance, open source, schema-free,
+document-oriented database. It features: document data model with dynamic
+schemas; full, flexible index support and rich queries; auto-Sharding for
+horizontal scalability; built-in replication for high availability; text
+search; advanced security; aggregation Framework and MapReduce; large media
+storage with GridFS.
Index: pkgsrc/databases/mongodb4/Makefile
diff -u /dev/null pkgsrc/databases/mongodb4/Makefile:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/Makefile Sat Jul 29 11:51:15 2023
@@ -0,0 +1,188 @@
+# $NetBSD: Makefile,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+DISTNAME= mongodb-src-r4.4.23
+PKGNAME= ${DISTNAME:S/src-r//}
+CATEGORIES= databases
+MASTER_SITES= http://fastdl.mongodb.org/src/
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://www.mongodb.com/
+COMMENT= NoSQL distributed document-oriented database
+LICENSE= server-side-public-license # Client and tools licensed under apache-2.0
+
+# MongoDB 3.4 onwards explicitly does not support 32-bit x86 platforms
+NOT_FOR_PLATFORM+= *-*-i386
+
+EXTRACT_USING= bsdtar
+
+# etc/pip/core-requirements.txt
+TOOL_DEPENDS+= ${PYPKGPREFIX}-cheetah-[0-9]*:../../devel/py-cheetah3
+TOOL_DEPENDS+= ${PYPKGPREFIX}-mongo>=3.0:../../databases/py-mongo
+TOOL_DEPENDS+= ${PYPKGPREFIX}-psutil-[0-9]*:../../sysutils/py-psutil
+TOOL_DEPENDS+= ${PYPKGPREFIX}-regex-[0-9]*:../../textproc/py-regex
+TOOL_DEPENDS+= ${PYPKGPREFIX}-requests>=2.0.0:../../devel/py-requests
+TOOL_DEPENDS+= ${PYPKGPREFIX}-yaml>=3.0.0:../../textproc/py-yaml
+TOOL_DEPENDS+= ${PYPKGPREFIX}-wrapt>=1.12.1:../../devel/py-wrapt
+
+# https://github.com/mongodb/mongo/blob/master/docs/building.md
+USE_LANGUAGES= c99 c++17
+USE_CXX_FEATURES+= c++17 filesystem
+
+USE_TOOLS+= pkg-config
+
+SCONS_BUILD_ARGS= ${_MAKE_JOBS}
+SCONS_BUILD_ARGS+= --dbg=off # on: argument parsing problem
+SCONS_BUILD_ARGS+= --disable-warnings-as-errors
+SCONS_BUILD_ARGS+= --release
+SCONS_BUILD_ARGS+= --runtime-hardening=off # on: does not produce executables
+#SCONS_BUILD_ARGS+= --use-system-abseil-cpp
+#SCONS_BUILD_ARGS+= --use-system-asio
+SCONS_BUILD_ARGS+= --use-system-boost
+SCONS_BUILD_ARGS+= --use-system-icu
+SCONS_BUILD_ARGS+= --use-system-mongo-c
+SCONS_BUILD_ARGS+= --use-system-pcre
+SCONS_BUILD_ARGS+= --use-system-snappy
+SCONS_BUILD_ARGS+= --use-system-tcmalloc
+#SCONS_BUILD_ARGS+= --use-system-wiredtiger
+SCONS_BUILD_ARGS+= --use-system-yaml
+SCONS_BUILD_ARGS+= --use-system-zlib
+SCONS_BUILD_ARGS+= --use-system-zstd
+
+PYTHON_VERSIONS_INCOMPATIBLE= 27
+
+.include "../../mk/bsd.prefs.mk"
+
+INCL_PATH+= ${BUILDLINK_PREFIX.mongo-c-driver}/include/libbson-1.0
+INCL_PATH+= ${BUILDLINK_PREFIX.mongo-c-driver}/include/libmongoc-1.0
+LDFLAGS+= ${COMPILER_RPATH_FLAG}${PREFIX}/lib -L${PREFIX}/lib
+
+# needed for linking against boost_log, otherwise some symbols are not found
+SCONS_BUILD_ARGS+= CPPDEFINES=-DBOOST_LOG_DYN_LINK=1
+SCONS_BUILD_ARGS+= CC=${CC:Q}
+SCONS_BUILD_ARGS+= CXX=${CXX:Q}
+SCONS_BUILD_ARGS+= CFLAGS=${CFLAGS:Q}
+SCONS_BUILD_ARGS+= CXXFLAGS=${CXXFLAGS:Q}
+SCONS_BUILD_ARGS+= LINKFLAGS=${LDFLAGS:Q}
+SCONS_BUILD_ARGS+= CPPPATH=${INCL_PATH:Q}
+INSTALL_TARGET= install-devcore
+SCONS_INSTALL_ARGS+= DESTDIR=${DESTDIR}
+SCONS_INSTALL_ARGS+= PREFIX=${PREFIX}
+
+.include "options.mk"
+
+SMF_METHODS+= mongodb
+
+BUILD_DEFS+= VARBASE
+BUILD_DEFS+= MONGODB_USER MONGODB_GROUP MONGODB_DBPATH
+BUILD_DEFS+= MONGODB_LOGPATH
+
+MONGODB_USER?= mongodb
+MONGODB_GROUP?= mongodb
+MONGODB_DBPATH?= ${VARBASE}/mongodb
+MONGODB_CONFIGDBPATH?= ${VARBASE}/mongoconfigdb
+MONGODB_LOGPATH?= ${VARBASE}/log/mongodb
+
+PKG_USERS_VARS+= MONGODB_USER
+PKG_GROUPS_VARS+= MONGODB_GROUP
+
+PKG_GROUPS= ${MONGODB_GROUP}
+PKG_USERS= ${MONGODB_USER}:${MONGODB_GROUP}
+
+PKG_GECOS.${MONGODB_USER}= MongoDB database administrator
+PKG_HOME.${MONGODB_USER}= ${MONGODB_DBPATH}
+PKG_SHELL.${MONGODB_USER}= ${SH}
+
+OWN_DIRS_PERMS+= ${MONGODB_DBPATH:Q} ${MONGODB_USER} ${MONGODB_GROUP} 0755
+OWN_DIRS_PERMS+= ${MONGODB_DBPATH:Q}/journal ${MONGODB_USER} ${MONGODB_GROUP} 0755
+OWN_DIRS_PERMS+= ${MONGODB_LOGPATH:Q} ${MONGODB_USER} ${MONGODB_GROUP} 0755
+
+FILES_SUBST+= MONGODB_USER=${MONGODB_USER}
+FILES_SUBST+= MONGODB_GROUP=${MONGODB_GROUP}
+FILES_SUBST+= MONGODB_DBPATH=${MONGODB_DBPATH}
+FILES_SUBST+= MONGODB_LOGPATH=${MONGODB_LOGPATH}
+
+SUBST_CLASSES+= path
+SUBST_STAGE.path= pre-build
+SUBST_MESSAGE.path= Replacing database paths.
+SUBST_FILES.path= debian/mongo.1 debian/mongod.1
+SUBST_FILES.path+= src/mongo/db/storage/storage_options.cpp
+SUBST_SED.path= -e 's,/data/db,${MONGODB_DBPATH},g'
+SUBST_SED.path+= -e 's,/data/configdb,${MONGODB_CONFIGDBPATH},g'
+SUBST_SED.path+= -e 's,/etc,${PKG_SYSCONFDIR},g'
+
+SUBST_CLASSES+= varbase
+SUBST_STAGE.varbase= pre-build
+SUBST_MESSAGE.varbase= Changing /var to ${VARBASE}.
+SUBST_FILES.varbase= debian/mongod.conf
+SUBST_SED.varbase= -e 's,/var/lib/mongodb,${VARBASE}/mongodb,g'
+SUBST_SED.varbase+= -e 's,/var/log/mongodb,${VARBASE}/mongodb,g'
+
+REPLACE_PYTHON+= src/mongo/installer/compass/install_compass
+
+NOT_PAX_MPROTECT_SAFE+= bin/mongo bin/mongod bin/mongos
+
+RCD_SCRIPTS= mongodb
+
+INSTALLATION_DIRS+= share/doc/mongodb share/examples/mongodb ${PKGMANDIR}/man1
+
+CONF_FILES+= share/examples/mongodb/mongod.conf \
+ ${PKG_SYSCONFDIR}/mongod.conf
+
+CHECK_PORTABILITY_SKIP= src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/go.mongodb.org/mongo-driver/etc/add-license.sh
+
+# Copy system specific files for NetBSD and DragonFly
+post-extract:
+ ${CHMOD} -R g-w ${WRKSRC}
+ ${CP} -R ${WRKSRC}/src/third_party/mozjs-60/platform/x86_64/freebsd \
+ ${WRKSRC}/src/third_party/mozjs-60/platform/x86_64/dragonfly
+ ${CP} -R ${WRKSRC}/src/third_party/mozjs-60/platform/x86_64/freebsd \
+ ${WRKSRC}/src/third_party/mozjs-60/platform/x86_64/netbsd
+ ${CP} ${WRKSRC}/src/mongo/db/ftdc/ftdc_system_stats_openbsd.cpp \
+ ${WRKSRC}/src/mongo/db/ftdc/ftdc_system_stats_netbsd.cpp
+ ${CP} ${WRKSRC}/src/mongo/db/ftdc/ftdc_system_stats_freebsd.cpp \
+ ${WRKSRC}/src/mongo/db/ftdc/ftdc_system_stats_dragonfly.cpp
+ ${CP} ${WRKSRC}/src/mongo/util/processinfo_openbsd.cpp \
+ ${WRKSRC}/src/mongo/util/processinfo_netbsd.cpp
+ ${CP} ${WRKSRC}/src/mongo/util/processinfo_freebsd.cpp \
+ ${WRKSRC}/src/mongo/util/processinfo_dragonfly.cpp
+ ${CP} ${WRKSRC}/src/mongo/platform/stack_locator_freebsd.cpp \
+ ${WRKSRC}/src/mongo/platform/stack_locator_netbsd.cpp
+ ${CP} ${WRKSRC}/src/mongo/platform/stack_locator_freebsd.cpp \
+ ${WRKSRC}/src/mongo/platform/stack_locator_dragonfly.cpp
+ ${CP} -R ${WRKSRC}/src/third_party/wiredtiger/build_openbsd \
+ ${WRKSRC}/src/third_party/wiredtiger/build_netbsd
+ ${CP} -R ${WRKSRC}/src/third_party/wiredtiger/build_freebsd \
+ ${WRKSRC}/src/third_party/wiredtiger/build_dragonfly
+
+# let REPLACE_INTERPRETER kick in
+do-configure:
+ ${DO_NADA}
+
+post-install:
+.for junk in LICENSE-Community.txt MPL-2 README THIRD-PARTY-NOTICES bin/resmoke.py macos_mongodb.plist
+ ${RM} -f ${DESTDIR}${PREFIX}/${junk}
+.endfor
+ ${INSTALL_MAN} ${WRKSRC}/debian/*.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
+ ${INSTALL_DATA} ${WRKSRC}/debian/mongod.conf \
+ ${DESTDIR}${PREFIX}/share/examples/mongodb
+
+.include "../../archivers/zstd/buildlink3.mk"
+.include "../../databases/mongo-c-driver/buildlink3.mk"
+#.include "../../databases/wiredtiger/buildlink3.mk"
+#.include "../../devel/abseil/buildlink3.mk"
+#.include "../../devel/asio/buildlink3.mk"
+.include "../../devel/boost-headers/buildlink3.mk"
+.include "../../devel/boost-libs/buildlink3.mk"
+.include "../../devel/libexecinfo/buildlink3.mk"
+.include "../../devel/pcre/buildlink3.mk"
+.include "../../devel/scons4/build.mk"
+_SCONS_BUILD_ARGS= -j${MAKE_JOBS:U1}
+_SCONS_BUILD_ARGS+= ${SCONS_BUILD_ARGS}
+.include "../../devel/snappy/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../lang/python/application.mk"
+.include "../../net/libpcap/buildlink3.mk"
+.include "../../textproc/icu/buildlink3.mk"
+.include "../../textproc/yaml-cpp/buildlink3.mk"
+.include "../../www/curl/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/databases/mongodb4/PLIST
diff -u /dev/null pkgsrc/databases/mongodb4/PLIST:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/PLIST Sat Jul 29 11:51:15 2023
@@ -0,0 +1,10 @@
+@comment $NetBSD: PLIST,v 1.1 2023/07/29 11:51:15 adam Exp $
+bin/mongo
+bin/mongod
+bin/mongos
+man/man1/mongo.1
+man/man1/mongod.1
+man/man1/mongokerberos.1
+man/man1/mongoldap.1
+man/man1/mongos.1
+share/examples/mongodb/mongod.conf
Index: pkgsrc/databases/mongodb4/distinfo
diff -u /dev/null pkgsrc/databases/mongodb4/distinfo:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/distinfo Sat Jul 29 11:51:15 2023
@@ -0,0 +1,26 @@
+$NetBSD: distinfo,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+BLAKE2s (mongodb-src-r4.4.23.tar.gz) = ea3a0a1fc31c488918fd291f95cebb892886f6a412ded4cac802277489b726fc
+SHA512 (mongodb-src-r4.4.23.tar.gz) = 54274526cd9ea8eb56398d4ec2aca12c560e8d8a44083c965ede9b6b8058e79a89a8f00e5a791f3b6e21f6deaf9082a57527f582ac3b11e310baa10c9d09f4f6
+Size (mongodb-src-r4.4.23.tar.gz) = 50914660 bytes
+SHA1 (patch-SConstruct) = 2f8402c96d5a94c65a422a063e34785277ef7cc9
+SHA1 (patch-site__scons_mongo_platform.py) = 6a6daba04876f9779a26c579e6f6a66f55e1cbe6
+SHA1 (patch-site__scons_site__tools_libtool.py) = 5663c0095939fa5404776bfb7b472b27cfe3a254
+SHA1 (patch-src_mongo_base_initializer.h) = efaec2e3b5b8a4bfb15c65c6952924cd1469bdc7
+SHA1 (patch-src_mongo_db_query_collation_collator__interface__icu.h) = f6382a3dcdbaed26fe692aa1ea43b2640168b253
+SHA1 (patch-src_mongo_db_repl_isself.cpp) = b7931feac26dcffa7eac68f5cb348feb6b993c37
+SHA1 (patch-src_mongo_db_storage_storage__repair__observer.cpp) = 0a390aa59a4f041acbdd546a45241f9ffa2953dc
+SHA1 (patch-src_mongo_platform_random.cpp) = 593cac552d27a64157b58be3f7c0d8656e5b604f
+SHA1 (patch-src_mongo_platform_stack__locator__netbsd.cpp) = b4343403628b8b51177468eaa9f8a82b4c6bf21f
+SHA1 (patch-src_mongo_shell_linenoise__utf8.h) = a29cbf034716ce48a23192320caf4928282b6c1a
+SHA1 (patch-src_mongo_shell_shell__utils__extended.cpp) = a17b7b93f956b37f5239b57b69f7a745e7e25e51
+SHA1 (patch-src_mongo_util_intrusive__counter.h) = 4c8e0d2e834686403a557de489ad518071851911
+SHA1 (patch-src_mongo_util_processinfo__netbsd.cpp) = 6c15ceeddecb9fa81a44fc322081596d0c85969e
+SHA1 (patch-src_mongo_util_time__support.cpp) = d576d8d39b10c496e492c8f0faf7e81f09ca875c
+SHA1 (patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_float128_op__system.h) = 3c168389b9288df9055df0b01e8d26cf2f67293e
+SHA1 (patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_src_bid__functions.h) = aed897879501d74b19dd06a142ded0abf910898d
+SHA1 (patch-src_third__party_asio-master_asio_include_asio_detail_impl_kqueue__reactor.ipp) = 49a74ef12f20c4b243d328a2cd8317aa1a668b18
+SHA1 (patch-src_third__party_mozjs-60_platform_x86__64_netbsd_build_js-confdefs.h) = 2474fc221f0c59381c8529e986db1f3f67c405ec
+SHA1 (patch-src_third__party_s2_base_port.h) = 892ce91b5aaa432f34e1e7c169b7fd6eea2a3e94
+SHA1 (patch-src_third__party_wiredtiger_SConscript) = e97dea310463f246c0a8007a1ba9c5385105036d
+SHA1 (patch-src_third__party_wiredtiger_src_os__posix_os__fs.c) = 42c56c11e79b768aa3e454b63a62954d91953e0f
Index: pkgsrc/databases/mongodb4/options.mk
diff -u /dev/null pkgsrc/databases/mongodb4/options.mk:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/options.mk Sat Jul 29 11:51:15 2023
@@ -0,0 +1,14 @@
+# $NetBSD: options.mk,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.mongodb
+PKG_SUPPORTED_OPTIONS= ssl
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mssl)
+.include "../../security/openssl/buildlink3.mk"
+SCONS_BUILD_ARGS+= --ssl=on
+SCONS_BUILD_ARGS+= --ssl-provider=openssl
+.else
+SCONS_BUILD_ARGS+= --ssl=off
+.endif
Index: pkgsrc/databases/mongodb4/files/mongodb.sh
diff -u /dev/null pkgsrc/databases/mongodb4/files/mongodb.sh:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/files/mongodb.sh Sat Jul 29 11:51:15 2023
@@ -0,0 +1,37 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: mongodb.sh,v 1.1 2023/07/29 11:51:15 adam Exp $
+#
+# PROVIDE: mongodb
+# REQUIRE: DAEMON LOGIN mountall
+# KEYWORD: shutdown
+#
+# You will need to set some variables in /etc/rc.conf to start MongoDB:
+#
+# mongodb=YES
+#
+# The following variables are optional:
+#
+# mongodb_user="@MONGODB_USER@" # user to run mongod as
+# mongodb_group="@MONGODB_GROUP@" # group to run mongod as
+# mongodb_dbpath="@MONGODB_DBPATH@" # path to MongoDB database directory
+#
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+name="mongodb"
+rcvar=${name}
+command="@PREFIX@/bin/mongod"
+: ${mongodb_user:=@MONGODB_USER@}
+: ${mongodb_group:=@MONGODB_GROUP@}
+: ${mongodb_dbpath:=@MONGODB_DBPATH@}
+pidfile="${mongodb_dbpath}/mongod.pid"
+logfile="${mongodb_dbpath}/mongod.log"
+required_dirs="${mongodb_dbpath}"
+
+command_args="--fork --logpath ${logfile} --logappend --pidfilepath ${pidfile} --dbpath ${mongodb_dbpath} --smallfiles"
+
+load_rc_config ${name}
+run_rc_command "$1"
Index: pkgsrc/databases/mongodb4/files/smf/manifest.xml
diff -u /dev/null pkgsrc/databases/mongodb4/files/smf/manifest.xml:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/files/smf/manifest.xml Sat Jul 29 11:51:15 2023
@@ -0,0 +1,40 @@
+<?xml version='1.0'?>
+<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
+<service_bundle type='manifest' name='export'>
+ <service name='@SMF_PREFIX@/@SMF_NAME@' type='service' version='0'>
+ <create_default_instance enabled='false'/>
+ <single_instance/>
+ <dependency name='fs' grouping='require_all' restart_on='none' type='service'>
+ <service_fmri value='svc:/system/filesystem/local'/>
+ </dependency>
+ <dependency name='net' grouping='require_all' restart_on='none' type='service'>
+ <service_fmri value='svc:/network/loopback'/>
+ </dependency>
+ <dependency name='config' grouping='require_all' restart_on='none' type='path'>
+ <service_fmri value='file://@PKG_SYSCONFDIR@/mongod.conf'/>
+ </dependency>
+ <method_context working_directory='@MONGODB_DBPATH@'>
+ <method_credential group='@MONGODB_USER@' user='@MONGODB_GROUP@'/>
+ <method_environment>
+ <envvar name='PATH' value='@PREFIX@/bin:@PREFIX@/gnu/bin:@PREFIX@/sbin:/usr/bin:/usr/sbin'/>
+ </method_environment>
+ </method_context>
+ <exec_method name='start' type='method' exec='@PREFIX@/@SMF_METHOD_FILE.mongodb@ start' timeout_seconds='18446744073709551615'/>
+ <exec_method name='stop' type='method' exec='@PREFIX@/@SMF_METHOD_FILE.mongodb@ stop' timeout_seconds='18446744073709551615'/>
+ <exec_method name='restart' type='method' exec='@PREFIX@/@SMF_METHOD_FILE.mongodb@ restart' timeout_seconds='18446744073709551615'/>
+ <property_group name='replication' type='application'>
+ <propval name='name' type='astring' value=''/>
+ <propval name='key' type='astring' value=''/>
+ <propval name='members' type='astring' value=''/>
+ </property_group>
+ <template>
+ <common_name>
+ <loctext xml:lang='C'>MongoDB Database</loctext>
+ </common_name>
+ <documentation>
+ <doc_link name='wiki.joyent.com' uri='http://wiki.joyent.com/display/jpc2/Joyent+MongoDB+SmartMachine'/>
+ </documentation>
+ </template>
+ </service>
+</service_bundle>
+
Index: pkgsrc/databases/mongodb4/files/smf/mongodb.sh
diff -u /dev/null pkgsrc/databases/mongodb4/files/smf/mongodb.sh:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/files/smf/mongodb.sh Sat Jul 29 11:51:15 2023
@@ -0,0 +1,33 @@
+#!/bin/bash
+#
+# SMF method for svc:/pkgsrc/mongodb:default
+
+. /lib/svc/share/smf_include.sh
+
+# mongodb doesn't really work with anything else but C locale
+export LANG=C
+
+PATH="@PREFIX@/bin:@PREFIX@/gnu/bin:@PREFIX@/sbin:/usr/bin:/usr/sbin";
+MONGO_DBPATH="@MONGODB_DBPATH@";
+MONGO_CONF="@PKG_SYSCONFDIR@/mongod.conf";
+MONGO_PID="${MONGO_DBPATH}/mongod.pid";
+
+case "$1" in
+ 'start')
+ mongod --fork -f ${MONGO_CONF} --pidfilepath ${MONGO_PID}
+ ;;
+
+ 'stop')
+ [[ -s ${MONGO_PID} ]] && kill $(cat ${MONGO_PID}) 2>/dev/null
+ ;;
+
+ 'restart')
+ [[ -s ${MONGO_PID} ]] && kill $(cat ${MONGO_PID}) 2>/dev/null
+ sleep 3;
+ mongod --fork -f ${MONGO_CONF} --pidfilepath ${MONGO_PID}
+ ;;
+ *)
+ echo "usage: $0 { start | stop | restart }"
+ exit 1;
+ ;;
+esac
Index: pkgsrc/databases/mongodb4/patches/patch-SConstruct
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-SConstruct:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-SConstruct Sat Jul 29 11:51:15 2023
@@ -0,0 +1,105 @@
+$NetBSD: patch-SConstruct,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Add support for NetBSD and Dragonfly.
+Fix locations.
+Don't compile with debug info.
+Don't mess with the linker.
+Respect LDFLAGS and CXXFLAGS.
+
+--- SConstruct.orig 2023-06-29 02:35:52.000000000 +0000
++++ SConstruct
+@@ -1196,6 +1196,7 @@ envDict = dict(BUILD_ROOT=buildDir,
+ CONFIGURELOG='$BUILD_ROOT/scons/config.log',
+ CONFIG_HEADER_DEFINES={},
+ LIBDEPS_TAG_EXPANSIONS=[],
++ ENV=os.environ,
+ )
+
+ # TODO: Remove these when hygienic builds are default.
+@@ -1367,7 +1368,9 @@ def CheckForProcessor(context, which_arc
+ os_macros = {
+ "windows": "defined(_WIN32)",
+ "solaris": "defined(__sun)",
++ "dragonfly": "defined(__DragonFly__)",
+ "freebsd": "defined(__FreeBSD__)",
++ "netbsd": "defined(__NetBSD__)",
+ "openbsd": "defined(__OpenBSD__)",
+ "iOS": "defined(__APPLE__) && TARGET_OS_IOS && !TARGET_OS_SIMULATOR",
+ "iOS-sim": "defined(__APPLE__) && TARGET_OS_IOS && TARGET_OS_SIMULATOR",
+@@ -1859,7 +1862,7 @@ if env['_LIBDEPS'] == '$_LIBDEPS_LIBS':
+ if not env.TargetOSIs('solaris', 'darwin', 'windows', 'openbsd'):
+ env.Tool('thin_archive')
+
+-if env.TargetOSIs('linux', 'freebsd', 'openbsd'):
++if env.TargetOSIs('linux', 'freebsd', 'openbsd', 'netbsd', 'dragonfly'):
+ # NOTE: The leading and trailing spaces here are important. Do not remove them.
+ env['LINK_WHOLE_ARCHIVE_LIB_START'] = '-Wl,--whole-archive '
+ env['LINK_WHOLE_ARCHIVE_LIB_END'] = ' -Wl,--no-whole-archive'
+@@ -1899,14 +1902,14 @@ if env.TargetOSIs('linux'):
+ elif env.TargetOSIs('solaris'):
+ env.Append( LIBS=["socket","resolv","lgrp"] )
+
+-elif env.TargetOSIs('freebsd'):
++elif env.TargetOSIs('freebsd', 'dragonfly'):
+ env.Append( LIBS=[ "kvm" ] )
+ env.Append( CCFLAGS=[ "-fno-omit-frame-pointer" ] )
+
+ elif env.TargetOSIs('darwin'):
+ env.Append( LIBS=["resolv"] )
+
+-elif env.TargetOSIs('openbsd'):
++elif env.TargetOSIs('netbsd', 'openbsd'):
+ env.Append( LIBS=[ "kvm" ] )
+
+ elif env.TargetOSIs('windows'):
+@@ -2204,7 +2207,6 @@ if env.TargetOSIs('posix'):
+ env.Append( CCFLAGS=["-fno-omit-frame-pointer",
+ "-fno-strict-aliasing",
+ "-fasynchronous-unwind-tables",
+- "-ggdb" if not env.TargetOSIs('emscripten') else "-g",
+ "-pthread",
+ "-Wall",
+ "-Wsign-compare",
+@@ -2869,9 +2871,9 @@ def doConfigure(myenv):
+ if usingLibStdCxx:
+ def CheckModernLibStdCxx(context):
+ test_body = """
+- #if !__has_include(<experimental/filesystem>)
+- #error "libstdc++ from GCC 5.3.0 or newer is required"
+- #endif
++ //#if !__has_include(<experimental/filesystem>)
++ //#error "libstdc++ from GCC 5.3.0 or newer is required"
++ //#endif
+ """
+
+ context.Message('Checking for libstdc++ 5.3.0 or better... ')
+@@ -3226,7 +3228,7 @@ def doConfigure(myenv):
+ #
+ myenv.Append( CCFLAGS=["/Zc:inline"])
+
+- if myenv.ToolchainIs('gcc', 'clang'):
++ if myenv.ToolchainIs('gcc', 'clang') and get_option('runtime-hardening') == "on":
+ # This tells clang/gcc to use the gold linker if it is available - we prefer the gold linker
+ # because it is much faster. Don't use it if the user has already configured another linker
+ # selection manually.
+@@ -3458,8 +3460,9 @@ def doConfigure(myenv):
+ def checkOpenSSL(conf):
+ sslLibName = "ssl"
+ cryptoLibName = "crypto"
+- sslLinkDependencies = ["crypto", "dl"]
+- if conf.env.TargetOSIs('freebsd'):
++ if conf.env.TargetOSIs('linux', 'solaris'):
++ sslLinkDependencies = ["crypto", "dl"]
++ else:
+ sslLinkDependencies = ["crypto"]
+
+ if conf.env.TargetOSIs('windows'):
+@@ -3796,7 +3799,7 @@ def doConfigure(myenv):
+ myenv.ConfError("Couldn't find SASL header/libraries")
+
+ # requires ports devel/libexecinfo to be installed
+- if env.TargetOSIs('freebsd', 'openbsd'):
++ if env.TargetOSIs('dragonfly', 'freebsd', 'netbsd', 'openbsd'):
+ if not conf.CheckLib("execinfo"):
+ myenv.ConfError("Cannot find libexecinfo, please install devel/libexecinfo.")
+
Index: pkgsrc/databases/mongodb4/patches/patch-site__scons_mongo_platform.py
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-site__scons_mongo_platform.py:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-site__scons_mongo_platform.py Sat Jul 29 11:51:15 2023
@@ -0,0 +1,26 @@
+$NetBSD: patch-site__scons_mongo_platform.py,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Add NetBSD and Dragonfly support.
+
+--- site_scons/mongo/platform.py.orig 2019-12-04 23:29:59.000000000 +0000
++++ site_scons/mongo/platform.py
+@@ -22,6 +22,10 @@ def get_running_os_name():
+ running_os = 'linux'
+ elif running_os.startswith('freebsd'):
+ running_os = 'freebsd'
++ elif running_os.startswith('dragonfly'):
++ running_os = 'dragonfly'
++ elif running_os.startswith('netbsd'):
++ running_os = 'netbsd'
+ elif running_os.startswith('openbsd'):
+ running_os = 'openbsd'
+ elif running_os == 'sunos5':
+@@ -42,7 +46,7 @@ def env_get_os_name_wrapper(self):
+ def is_os_raw(target_os, os_list_to_check):
+ darwin_os_list = ['macOS', 'tvOS', 'tvOS-sim', 'iOS', 'iOS-sim', 'watchOS', 'watchOS-sim']
+ linux_os_list = ['android', 'linux']
+- posix_os_list = ['openbsd', 'freebsd', 'solaris', 'emscripten'] + darwin_os_list + linux_os_list
++ posix_os_list = ['netbsd', 'openbsd', 'freebsd', 'dragonfly', 'solaris', 'emscripten'] + darwin_os_list + linux_os_list
+
+ os_families = {
+ "darwin": darwin_os_list,
Index: pkgsrc/databases/mongodb4/patches/patch-site__scons_site__tools_libtool.py
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-site__scons_site__tools_libtool.py:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-site__scons_site__tools_libtool.py Sat Jul 29 11:51:15 2023
@@ -0,0 +1,15 @@
+$NetBSD: patch-site__scons_site__tools_libtool.py,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Use system libtool (Darwin only).
+
+--- site_scons/site_tools/libtool.py.orig 2023-06-29 02:35:52.000000000 +0000
++++ site_scons/site_tools/libtool.py
+@@ -3,7 +3,7 @@ import SCons
+
+ def generate(env):
+
+- env["AR"] = "libtool"
++ env["AR"] = "/usr/bin/libtool"
+ env["ARCOM"] = "$AR -static -o $TARGET $ARFLAGS $SOURCES"
+ env["ARFLAGS"] = ["-s", "-no_warning_for_no_symbols"]
+
Index: pkgsrc/databases/mongodb4/patches/patch-src_mongo_base_initializer.h
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_mongo_base_initializer.h:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_mongo_base_initializer.h Sat Jul 29 11:51:15 2023
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_mongo_base_initializer.h,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Fixes at least SunOS.
+
+--- src/mongo/base/initializer.h.orig 2019-12-04 23:29:59.000000000 +0000
++++ src/mongo/base/initializer.h
+@@ -31,6 +31,7 @@
+
+ #include <string>
+ #include <vector>
++#include <unistd.h>
+
+ #include "mongo/base/initializer_context.h"
+ #include "mongo/base/initializer_dependency_graph.h"
Index: pkgsrc/databases/mongodb4/patches/patch-src_mongo_db_query_collation_collator__interface__icu.h
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_mongo_db_query_collation_collator__interface__icu.h:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_mongo_db_query_collation_collator__interface__icu.h Sat Jul 29 11:51:15 2023
@@ -0,0 +1,35 @@
+$NetBSD: patch-src_mongo_db_query_collation_collator__interface__icu.h,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Fix for newer ICU.
+
+--- src/mongo/db/query/collation/collator_interface_icu.h.orig 2020-01-26 09:25:13.000000000 +0000
++++ src/mongo/db/query/collation/collator_interface_icu.h
+@@ -33,9 +33,7 @@
+
+ #include <memory>
+
+-namespace icu {
+-class Collator;
+-} // namespace icu
++#include <unicode/coll.h>
+
+ namespace mongo {
+
+@@ -45,7 +43,7 @@ namespace mongo {
+ */
+ class CollatorInterfaceICU final : public CollatorInterface {
+ public:
+- CollatorInterfaceICU(CollationSpec spec, std::unique_ptr<icu::Collator> collator);
++ CollatorInterfaceICU(CollationSpec spec, std::unique_ptr<U_ICU_NAMESPACE::Collator> collator);
+
+ std::unique_ptr<CollatorInterface> clone() const final;
+
+@@ -56,7 +54,7 @@ public:
+ private:
+ // The ICU implementation of the collator to which we delegate interesting work. Const methods
+ // on the ICU collator are expected to be thread-safe.
+- const std::unique_ptr<icu::Collator> _collator;
++ const std::unique_ptr<U_ICU_NAMESPACE::Collator> _collator;
+ };
+
+ } // namespace mongo
Index: pkgsrc/databases/mongodb4/patches/patch-src_mongo_db_repl_isself.cpp
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_mongo_db_repl_isself.cpp:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_mongo_db_repl_isself.cpp Sat Jul 29 11:51:15 2023
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_mongo_db_repl_isself.cpp,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Add NetBSD support.
+
+--- src/mongo/db/repl/isself.cpp.orig 2017-04-20 21:43:42.000000000 +0000
++++ src/mongo/db/repl/isself.cpp
+@@ -50,7 +50,7 @@
+ #include "mongo/util/scopeguard.h"
+
+ #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun) || \
+- defined(__OpenBSD__)
++ defined(__OpenBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
+ #define FASTPATH_UNIX 1
+ #endif
+
+@@ -63,7 +63,7 @@
+ #include <ifaddrs.h>
+ #include <netdb.h>
+
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ #include <netinet/in.h>
+ #endif
+
Index: pkgsrc/databases/mongodb4/patches/patch-src_mongo_db_storage_storage__repair__observer.cpp
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_mongo_db_storage_storage__repair__observer.cpp:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_mongo_db_storage_storage__repair__observer.cpp Sat Jul 29 11:51:15 2023
@@ -0,0 +1,23 @@
+$NetBSD: patch-src_mongo_db_storage_storage__repair__observer.cpp,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+boost::filesystem::ofstream is deprected, use std::ofstream instead.
+
+--- src/mongo/db/storage/storage_repair_observer.cpp.orig 2023-06-29 02:35:52.000000000 +0000
++++ src/mongo/db/storage/storage_repair_observer.cpp
+@@ -34,6 +34,7 @@
+ #include <algorithm>
+ #include <cerrno>
+ #include <cstring>
++#include <fstream>
+
+ #ifdef __linux__
+ #include <fcntl.h>
+@@ -121,7 +122,7 @@ bool StorageRepairObserver::isDataInvali
+ }
+
+ void StorageRepairObserver::_touchRepairIncompleteFile() {
+- boost::filesystem::ofstream fileStream(_repairIncompleteFilePath);
++ std::ofstream fileStream(_repairIncompleteFilePath.string());
+ fileStream << "This file indicates that a repair operation is in progress or incomplete.";
+ if (fileStream.fail()) {
+ LOGV2_FATAL_NOTRACE(50920,
Index: pkgsrc/databases/mongodb4/patches/patch-src_mongo_platform_random.cpp
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_mongo_platform_random.cpp:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_mongo_platform_random.cpp Sat Jul 29 11:51:15 2023
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_mongo_platform_random.cpp,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Add NetBSD and DragonFly support.
+
+--- src/mongo/platform/random.cpp.orig 2023-06-29 02:35:52.000000000 +0000
++++ src/mongo/platform/random.cpp
+@@ -57,7 +57,7 @@
+ #ifdef _WIN32
+ #define SECURE_RANDOM_BCRYPT
+ #elif defined(__linux__) || defined(__sun) || defined(__APPLE__) || defined(__FreeBSD__) || \
+- defined(__EMSCRIPTEN__)
++ defined(__EMSCRIPTEN__) || defined(__DragonFly__) || defined(__NetBSD__)
+ #define SECURE_RANDOM_URANDOM
+ #elif defined(__OpenBSD__)
+ #define SECURE_RANDOM_ARCFOUR
Index: pkgsrc/databases/mongodb4/patches/patch-src_mongo_platform_stack__locator__netbsd.cpp
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_mongo_platform_stack__locator__netbsd.cpp:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_mongo_platform_stack__locator__netbsd.cpp Sat Jul 29 11:51:15 2023
@@ -0,0 +1,23 @@
+$NetBSD: patch-src_mongo_platform_stack__locator__netbsd.cpp,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Add NetBSD support.
+
+--- src/mongo/platform/stack_locator_netbsd.cpp.orig 2023-07-27 07:57:01.000000000 +0000
++++ src/mongo/platform/stack_locator_netbsd.cpp
+@@ -32,7 +32,6 @@
+ #include "mongo/platform/stack_locator.h"
+
+ #include <pthread.h>
+-#include <pthread_np.h>
+
+ #include "mongo/util/assert_util.h"
+ #include "mongo/util/scopeguard.h"
+@@ -52,7 +51,7 @@ StackLocator::StackLocator() {
+
+ invariant(pthread_attr_getstack(&attr, &_end, &size) == 0);
+
+- // TODO: Assumes stack grows downward on FreeBSD
++ // TODO: Assumes stack grows downward on NetBSD
+ _begin = static_cast<char*>(_end) + size;
+ }
+
Index: pkgsrc/databases/mongodb4/patches/patch-src_mongo_shell_linenoise__utf8.h
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_mongo_shell_linenoise__utf8.h:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_mongo_shell_linenoise__utf8.h Sat Jul 29 11:51:15 2023
@@ -0,0 +1,27 @@
+$NetBSD: patch-src_mongo_shell_linenoise__utf8.h,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Use Boost swap instead of std. Fixes build on SunOS.
+
+--- src/mongo/shell/linenoise_utf8.h.orig 2019-01-30 14:26:33.000000000 +0000
++++ src/mongo/shell/linenoise_utf8.h
+@@ -29,6 +29,7 @@
+ * it in the license file.
+ */
+
++#include <boost/core/swap.hpp>
+ #include <algorithm>
+ #include <memory>
+ #include <string.h>
+@@ -176,9 +177,9 @@ struct UtfStringMixin {
+ }
+
+ void swap(UtfStringMixin& other) {
+- std::swap(_len, other._len);
+- std::swap(_cap, other._cap);
+- std::swap(_chars, other._chars);
++ boost::swap(_len, other._len);
++ boost::swap(_cap, other._cap);
++ boost::swap(_chars, other._chars);
+ _str.swap(other._str);
+ }
+
Index: pkgsrc/databases/mongodb4/patches/patch-src_mongo_shell_shell__utils__extended.cpp
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_mongo_shell_shell__utils__extended.cpp:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_mongo_shell_shell__utils__extended.cpp Sat Jul 29 11:51:15 2023
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_mongo_shell_shell__utils__extended.cpp,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+boost::filesystem::ofstream is deprected, use std::ofstream instead.
+
+--- src/mongo/shell/shell_utils_extended.cpp.orig 2023-06-29 02:35:52.000000000 +0000
++++ src/mongo/shell/shell_utils_extended.cpp
+@@ -318,7 +318,7 @@ BSONObj writeFile(const BSONObj& args, v
+ mode |= std::ios::binary;
+ }
+
+- boost::filesystem::ofstream ofs{normalizedFilePath, mode};
++ std::ofstream ofs{normalizedFilePath.string(), mode};
+ uassert(40346,
+ str::stream() << "failed to open file " << normalizedFilePath.string()
+ << " for writing",
+@@ -382,7 +382,7 @@ BSONObj readDumpFile(const BSONObj& a, v
+
+ // Open the file for reading in binary mode.
+ const auto pathStr = a.firstElement().String();
+- boost::filesystem::ifstream stream(pathStr, std::ios::in | std::ios::binary);
++ ifstream stream(pathStr, std::ios::in | std::ios::binary);
+ uassert(31405,
+ str::stream() << "readDumpFile(): Unable to open file \"" << pathStr
+ << "\" for reading",
Index: pkgsrc/databases/mongodb4/patches/patch-src_mongo_util_intrusive__counter.h
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_mongo_util_intrusive__counter.h:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_mongo_util_intrusive__counter.h Sat Jul 29 11:51:15 2023
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_mongo_util_intrusive__counter.h,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Fix buidling.
+
+--- src/mongo/util/intrusive_counter.h.orig 2016-01-05 18:31:44.000000000 +0000
++++ src/mongo/util/intrusive_counter.h
+@@ -28,6 +28,7 @@
+
+ #pragma once
+
++#include <cstdlib>
+ #include <boost/intrusive_ptr.hpp>
+ #include <stdlib.h>
+
Index: pkgsrc/databases/mongodb4/patches/patch-src_mongo_util_processinfo__netbsd.cpp
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_mongo_util_processinfo__netbsd.cpp:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_mongo_util_processinfo__netbsd.cpp Sat Jul 29 11:51:15 2023
@@ -0,0 +1,58 @@
+$NetBSD: patch-src_mongo_util_processinfo__netbsd.cpp,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Add NetBSD support.
+
+--- src/mongo/util/processinfo_netbsd.cpp.orig 2023-07-27 08:51:13.000000000 +0000
++++ src/mongo/util/processinfo_netbsd.cpp
+@@ -26,6 +26,7 @@
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
++#define _KMEMUSER
+
+ #define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kControl
+
+@@ -38,7 +39,6 @@
+ #include <sys/param.h>
+ #include <sys/sysctl.h>
+ #include <sys/types.h>
+-#include <sys/user.h>
+ #include <sys/vmmeter.h>
+ #include <unistd.h>
+
+@@ -85,7 +85,7 @@ template <>
+ int getSysctlByIDWithDefault<std::string>(const int* sysctlID,
+ const int idLen,
+ const std::string& defaultValue,
+- string* result) {
++ std::string* result) {
+ char value[256] = {0};
+ size_t len = sizeof(value);
+ if (sysctl(sysctlID, idLen, &value, &len, NULL, 0) == -1) {
+@@ -105,7 +105,7 @@ int ProcessInfo::getVirtualMemorySize()
+ return -1;
+ }
+
+- kinfo_proc* task = kvm_getprocs(kd, KERN_PROC_PID, _pid.toNative(), sizeof(kinfo_proc), &cnt);
++ kinfo_proc2* task = kvm_getproc2(kd, KERN_PROC_PID, _pid.toNative(), sizeof(kinfo_proc), &cnt);
+ int vss = ((task->p_vm_dsize + task->p_vm_ssize + task->p_vm_tsize) * sysconf(_SC_PAGESIZE)) /
+ 1048576;
+ kvm_close(kd);
+@@ -120,7 +120,7 @@ int ProcessInfo::getResidentSize() {
+ LOGV2(23344, "Unable to get res mem size: {err}", "err"_attr = err);
+ return -1;
+ }
+- kinfo_proc* task = kvm_getprocs(kd, KERN_PROC_PID, _pid.toNative(), sizeof(kinfo_proc), &cnt);
++ kinfo_proc2* task = kvm_getproc2(kd, KERN_PROC_PID, _pid.toNative(), sizeof(kinfo_proc), &cnt);
+ int rss = (task->p_vm_rssize * sysconf(_SC_PAGESIZE)) / 1048576; // convert from pages to MB
+ kvm_close(kd);
+ return rss;
+@@ -132,7 +132,7 @@ double ProcessInfo::getSystemMemoryPress
+
+ void ProcessInfo::SystemInfo::collectSystemInfo() {
+ osType = "BSD";
+- osName = "OpenBSD";
++ osName = "NetBSD";
+ int mib[2];
+
+ mib[0] = CTL_KERN;
Index: pkgsrc/databases/mongodb4/patches/patch-src_mongo_util_time__support.cpp
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_mongo_util_time__support.cpp:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_mongo_util_time__support.cpp Sat Jul 29 11:51:15 2023
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_mongo_util_time__support.cpp,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Add support for NetBSD, OpenBSD, and DragonFly.
+
+--- src/mongo/util/time_support.cpp.orig 2019-12-04 23:29:59.000000000 +0000
++++ src/mongo/util/time_support.cpp
+@@ -952,7 +952,7 @@ private:
+ // Find minimum timer resolution of OS
+ Nanoseconds getMinimumTimerResolution() {
+ Nanoseconds minTimerResolution;
+-#if defined(__linux__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ struct timespec tp;
+ clock_getres(CLOCK_REALTIME, &tp);
+ minTimerResolution = Nanoseconds{tp.tv_nsec};
Index: pkgsrc/databases/mongodb4/patches/patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_float128_op__system.h
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_float128_op__system.h:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_float128_op__system.h Sat Jul 29 11:51:15 2023
@@ -0,0 +1,132 @@
+$NetBSD: patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_float128_op__system.h,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Support NetBSD.
+
+--- src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/op_system.h.orig 2019-12-04 23:29:59.000000000 +0000
++++ src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/op_system.h
+@@ -45,6 +45,7 @@
+ # undef darwin
+ # undef interix
+ # undef emscripten
++# undef netbsd
+
+ # define dos 1
+ # define OP_SYSTEM dos
+@@ -64,6 +65,7 @@
+ # undef darwin
+ # undef interix
+ # undef emscripten
++# undef netbsd
+
+ # define vms 2
+ # define OP_SYSTEM vms
+@@ -83,6 +85,7 @@
+ # undef darwin
+ # undef interix
+ # undef emscripten
++# undef netbsd
+
+ # define wnt 3
+ # define OP_SYSTEM wnt
+@@ -102,6 +105,7 @@
+ # undef darwin
+ # undef interix
+ # undef emscripten
++# undef netbsd
+
+ # define linux 8
+ # define OP_SYSTEM linux
+@@ -122,6 +126,7 @@
+ # undef darwin
+ # undef interix
+ # undef emscripten
++# undef netbsd
+
+ # define osf 4
+ # define OP_SYSTEM osf
+@@ -141,6 +146,7 @@
+ # undef darwin
+ # undef interix
+ # undef emscripten
++# undef netbsd
+
+ # define hp_ux 5
+ # define OP_SYSTEM hp_ux
+@@ -160,6 +166,7 @@
+ # undef darwin
+ # undef interix
+ # undef emscripten
++# undef netbsd
+
+ # define unicos 6
+ # define OP_SYSTEM unicos
+@@ -179,6 +186,7 @@
+ # undef darwin
+ # undef interix
+ # undef emscripten
++# undef netbsd
+
+ # define ultrix 7
+ # define OP_SYSTEM ultrix
+@@ -197,6 +205,7 @@
+ # undef darwin
+ # undef interix
+ # undef emscripten
++# undef netbsd
+
+ # define win64 9
+ # define OP_SYSTEM win64
+@@ -215,6 +224,7 @@
+ # undef darwin
+ # undef interix
+ # undef emscripten
++# undef netbsd
+
+ # define darwin 10
+ # define OP_SYSTEM darwin
+@@ -232,6 +242,7 @@
+ # undef darwin
+ # undef interix
+ # undef emscripten
++# undef netbsd
+
+ # define interix 11
+ # define OP_SYSTEM interix
+@@ -250,10 +261,29 @@
+ # undef darwin
+ # undef interix
+ # undef emscripten
++# undef netbsd
+
+ # define emscripten 12
+ # define OP_SYSTEM emscripten
+
++#elif defined(__NetBSD__)
++# undef dos
++# undef vms
++# undef wnt
++# undef osf
++# undef hp_ux
++# undef linux
++# undef unicos
++# undef ultrix
++# undef win64
++# undef darwin
++# undef interix
++# undef emscripten
++# undef netbsd
++
++# define netbsd 12
++# define OP_SYSTEM netbsd
++
+ #else
+
+ # error Operating system must be specified.
+@@ -266,6 +296,7 @@
+ OP_SYSTEM == osf || \
+ OP_SYSTEM == ultrix || \
+ OP_SYSTEM == unicos || \
++ OP_SYSTEM == netbsd || \
+ OP_SYSTEM == emscripten \
+ )
+
Index: pkgsrc/databases/mongodb4/patches/patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_src_bid__functions.h
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_src_bid__functions.h:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_src_bid__functions.h Sat Jul 29 11:51:15 2023
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_third__party_IntelRDFPMathLib20U1_LIBRARY_src_bid__functions.h,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Fix buidling.
+
+--- src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h.orig 2019-01-30 14:26:33.000000000 +0000
++++ src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h
+@@ -164,7 +164,7 @@ typedef unsigned long fexcept_t;
+ typedef unsigned bid__int64 fexcept_t;
+ #endif
+ #else
+-#if defined(__QNX__) || defined(__OpenBSD__)
++#if defined(__QNX__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <fenv.h>
+ #else
+ typedef unsigned short int fexcept_t;
Index: pkgsrc/databases/mongodb4/patches/patch-src_third__party_asio-master_asio_include_asio_detail_impl_kqueue__reactor.ipp
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_third__party_asio-master_asio_include_asio_detail_impl_kqueue__reactor.ipp:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_third__party_asio-master_asio_include_asio_detail_impl_kqueue__reactor.ipp Sat Jul 29 11:51:15 2023
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_third__party_asio-master_asio_include_asio_detail_impl_kqueue__reactor.ipp,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Fix build with recent NetBSD 9.99.
+
+--- src/third_party/asio-master/asio/include/asio/detail/impl/kqueue_reactor.ipp.orig 2020-01-26 17:31:51.341577994 +0000
++++ src/third_party/asio-master/asio/include/asio/detail/impl/kqueue_reactor.ipp
+@@ -28,6 +28,10 @@
+ #include "asio/detail/push_options.hpp"
+
+ #if defined(__NetBSD__)
++#include <sys/param.h>
++#endif
++
++#if defined(__NetBSD__) && __NetBSD_Version__ < 999001500
+ # define ASIO_KQUEUE_EV_SET(ev, ident, filt, flags, fflags, data, udata) \
+ EV_SET(ev, ident, filt, flags, fflags, data, \
+ reinterpret_cast<intptr_t>(static_cast<void*>(udata)))
Index: pkgsrc/databases/mongodb4/patches/patch-src_third__party_mozjs-60_platform_x86__64_netbsd_build_js-confdefs.h
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_third__party_mozjs-60_platform_x86__64_netbsd_build_js-confdefs.h:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_third__party_mozjs-60_platform_x86__64_netbsd_build_js-confdefs.h Sat Jul 29 11:51:15 2023
@@ -0,0 +1,21 @@
+$NetBSD: patch-src_third__party_mozjs-60_platform_x86__64_netbsd_build_js-confdefs.h,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+--- src/third_party/mozjs-60/platform/x86_64/netbsd/build/js-confdefs.h.orig 2020-01-29 20:09:04.581823530 +0000
++++ src/third_party/mozjs-60/platform/x86_64/netbsd/build/js-confdefs.h
+@@ -31,7 +31,6 @@
+ #define HAVE_POSIX_FALLOCATE 1
+ #define HAVE_POSIX_MEMALIGN 1
+ #define HAVE_RES_NINIT 1
+-#define HAVE_SINCOS 1
+ #define HAVE_SSIZE_T 1
+ #define HAVE_STDINT_H 1
+ #define HAVE_STRNDUP 1
+@@ -54,7 +53,7 @@
+ #define JS_POSIX_NSPR 1
+ #define JS_PUNBOX64 1
+ #define JS_STANDALONE 1
+-#define MALLOC_H <malloc_np.h>
++#define MALLOC_H <stdlib.h>
+ #define MALLOC_USABLE_SIZE_CONST_PTR const
+ #define MOZILLA_UAVERSION "60.0"
+ #define MOZILLA_VERSION "60.3.0"
Index: pkgsrc/databases/mongodb4/patches/patch-src_third__party_s2_base_port.h
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_third__party_s2_base_port.h:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_third__party_s2_base_port.h Sat Jul 29 11:51:15 2023
@@ -0,0 +1,27 @@
+$NetBSD: patch-src_third__party_s2_base_port.h,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+* Add NetBSD support.
+
+--- src/third_party/s2/base/port.h.orig 2016-01-05 18:31:44.000000000 +0000
++++ src/third_party/s2/base/port.h
+@@ -102,7 +102,7 @@ typedef uint16_t u_int16_t;
+
+ #endif
+
+-#if defined __sun || defined __FreeBSD__ || defined __OpenBSD__
++#if defined __sun || defined __FreeBSD__ || defined __OpenBSD__ || defined __DragonFly__ || defined __NetBSD__
+ #ifdef _LITTLE_ENDIAN
+ #define IS_LITTLE_ENDIAN
+ #elif defined _BIG_ENDIAN
+@@ -139,6 +139,11 @@ typedef uint16_t u_int16_t;
+ #define bswap_16(x) swap16(x)
+ #define bswap_32(x) swap32(x)
+ #define bswap_64(x) swap64(x)
++#elif defined __NetBSD__
++#include <machine/bswap.h>
++#define bswap_16(x) bswap16(x)
++#define bswap_32(x) bswap32(x)
++#define bswap_64(x) bswap64(x)
+ #else
+ #include <byteswap.h>
+ #endif
Index: pkgsrc/databases/mongodb4/patches/patch-src_third__party_wiredtiger_SConscript
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_third__party_wiredtiger_SConscript:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_third__party_wiredtiger_SConscript Sat Jul 29 11:51:15 2023
@@ -0,0 +1,19 @@
+$NetBSD: patch-src_third__party_wiredtiger_SConscript,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+Support NetBSD and Dragonfly.
+
+--- src/third_party/wiredtiger/SConscript.orig 2017-04-20 21:43:42.000000000 +0000
++++ src/third_party/wiredtiger/SConscript
+@@ -62,8 +62,12 @@ elif env.TargetOSIs('solaris'):
+ # For an explanation of __EXTENSIONS__,
+ # see http://docs.oracle.com/cd/E19253-01/816-5175/standards-5/index.html
+ env.Append(CPPDEFINES=["__EXTENSIONS__"])
++elif env.TargetOSIs('dragonfly'):
++ env.Append(CPPPATH=["build_dragonfly"])
+ elif env.TargetOSIs('freebsd'):
+ env.Append(CPPPATH=["build_freebsd"])
++elif env.TargetOSIs('netbsd'):
++ env.Append(CPPPATH=["build_netbsd"])
+ elif env.TargetOSIs('openbsd'):
+ env.Append(CPPPATH=["build_openbsd"])
+ elif env.TargetOSIs('linux'):
Index: pkgsrc/databases/mongodb4/patches/patch-src_third__party_wiredtiger_src_os__posix_os__fs.c
diff -u /dev/null pkgsrc/databases/mongodb4/patches/patch-src_third__party_wiredtiger_src_os__posix_os__fs.c:1.1
--- /dev/null Sat Jul 29 11:51:15 2023
+++ pkgsrc/databases/mongodb4/patches/patch-src_third__party_wiredtiger_src_os__posix_os__fs.c Sat Jul 29 11:51:15 2023
@@ -0,0 +1,22 @@
+$NetBSD: patch-src_third__party_wiredtiger_src_os__posix_os__fs.c,v 1.1 2023/07/29 11:51:15 adam Exp $
+
+The fdatasync call is specified by POSIX, and the definition has changed:
+ https://pubs.opengroup.org/onlinepubs/009695399/functions/fdatasync.html
+ https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html
+
+NetBSD's fdatasync follows the earlier specification. For now, simply avoid
+crashing on EBADF, at the possible expense of sync safety.
+
+\todo Change NetBSD to follow the current standard.
+
+--- src/third_party/wiredtiger/src/os_posix/os_fs.c.orig 2023-06-29 02:35:52.000000000 +0000
++++ src/third_party/wiredtiger/src/os_posix/os_fs.c
+@@ -89,7 +89,7 @@ __posix_sync(WT_SESSION_IMPL *session, i
+ #if defined(HAVE_FDATASYNC)
+ /* See comment in __posix_sync(): sync cannot be retried or fail. */
+ WT_SYSCALL(fdatasync(fd), ret);
+- if (ret == 0)
++ if (ret == 0 || errno == EBADF)
+ return (0);
+ WT_RET_PANIC(session, ret, "%s: %s: fdatasync", name, func);
+ #else
Home |
Main Index |
Thread Index |
Old Index