Changeset View
Standalone View
databases/mongodb60/Makefile
PORTNAME= mongodb | PORTNAME= mongodb | ||||
DISTVERSIONPREFIX= r | DISTVERSIONPREFIX= r | ||||
DISTVERSION= 6.0.1 | DISTVERSION= 6.0.2 | ||||
CATEGORIES= databases net | CATEGORIES= databases net | ||||
PKGNAMESUFFIX= ${DISTVERSION:R:S/.//} | PKGNAMESUFFIX= ${DISTVERSION:R:S/.//} | ||||
MAINTAINER= ronald-lists@klop.ws | MAINTAINER= ronald@FreeBSD.org | ||||
COMMENT= Distributed document-oriented "NoSQL" database (6.0.x Branch) | COMMENT= Distributed document-oriented "NoSQL" database (6.0.x Branch) | ||||
WWW= https://docs.mongodb.com/v6.0/ | WWW= https://docs.mongodb.com/v6.0/ | ||||
LICENSE= APACHE20 SSPLv1 # mongodb is SSPLv1, C++ driver is APACHE20 | LICENSE= APACHE20 SSPLv1 # mongodb is SSPLv1, C++ driver is APACHE20 | ||||
LICENSE_COMB= multi | LICENSE_COMB= multi | ||||
LICENSE_NAME_SSPLv1= Server Side Public License Version 1 | LICENSE_NAME_SSPLv1= Server Side Public License Version 1 | ||||
LICENSE_FILE_SSPLv1= ${WRKSRC}/LICENSE-Community.txt | LICENSE_FILE_SSPLv1= ${WRKSRC}/LICENSE-Community.txt | ||||
LICENSE_PERMS_SSPLv1= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept | LICENSE_PERMS_SSPLv1= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept | ||||
ONLY_FOR_ARCHS= aarch64 amd64 | ONLY_FOR_ARCHS= aarch64 amd64 powerpc64le | ||||
ONLY_FOR_ARCHS_REASON= only ported to amd64 and aarch64 on FreeBSD; upstream supports arm64, ppc64le, s390x, and x86-64 | ONLY_FOR_ARCHS_REASON= only ported to amd64, aarch64, and powerpc64le on FreeBSD; upstream supports arm64, ppc64le, s390x, and x86-64 | ||||
rene: Perhaps make the FreeBSD and upstream architecture names the same for consistency? | |||||
Done Inline ActionsI used this naming on purpose to connect the architecture names used by FreeBSD to the names used by MongoDB. ronald_klop.ws: I used this naming on purpose to connect the architecture names used by FreeBSD to the names… | |||||
Not Done Inline ActionsAh, from an upstream point of view your naing would make more sense. rene: Ah, from an upstream point of view your naing would make more sense. | |||||
BUILD_DEPENDS= ${LOCALBASE}/bin/ar:devel/binutils \ | BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cheetah3>0:devel/py-cheetah3@${PY_FLAVOR} \ | ||||
${PYTHON_PKGNAMEPREFIX}cheetah3>0:devel/py-cheetah3@${PY_FLAVOR} \ | |||||
${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} \ | ${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} \ | ||||
${PYTHON_PKGNAMEPREFIX}psutil>0:sysutils/py-psutil@${PY_FLAVOR} \ | ${PYTHON_PKGNAMEPREFIX}psutil>0:sysutils/py-psutil@${PY_FLAVOR} \ | ||||
${PYTHON_PKGNAMEPREFIX}pymongo>0:databases/py-pymongo@${PY_FLAVOR} \ | ${PYTHON_PKGNAMEPREFIX}pymongo>0:databases/py-pymongo@${PY_FLAVOR} \ | ||||
${PYTHON_PKGNAMEPREFIX}yaml>=3.11:devel/py-yaml@${PY_FLAVOR} | ${PYTHON_PKGNAMEPREFIX}yaml>=3.11:devel/py-yaml@${PY_FLAVOR} | ||||
LIB_DEPENDS= libcurl.so:ftp/curl \ | # 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= libboost_system.so:devel/boost-libs \ | |||||
libcurl.so:ftp/curl \ | |||||
libicuuc.so:devel/icu \ | |||||
libunwind.so:devel/libunwind \ | |||||
libpcre.so:devel/pcre \ | libpcre.so:devel/pcre \ | ||||
libsnappy.so:archivers/snappy | libsnappy.so:archivers/snappy \ | ||||
libstemmer.so:textproc/snowballstemmer \ | |||||
libyaml-cpp.so:devel/yaml-cpp \ | |||||
libzstd.so:archivers/zstd | |||||
USES= compiler:c++17-lang cpe python:3.5+,build scons shebangfix | USES= compiler:c++17-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 | USE_GITHUB= yes | ||||
GH_ACCOUNT= mongodb | GH_ACCOUNT= mongodb mongodb-forks:mozjs | ||||
GH_PROJECT= mongo | GH_PROJECT= mongo spidermonkey:mozjs | ||||
GH_TAGNAME= ${MOZJS_TAG}:mozjs | |||||
USE_RC_SUBR= mongod | USE_RC_SUBR= mongod | ||||
SHEBANG_FILES= buildscripts/scons.py | SHEBANG_FILES= buildscripts/scons.py | ||||
python_OLD_CMD= @python_interpreter@ | python_OLD_CMD= @python_interpreter@ | ||||
CONFLICTS_INSTALL= mongodb[0-9][0-9] | |||||
USERS= mongodb | |||||
GROUPS= mongodb | |||||
OPTIONS_DEFINE= LTO SASL SSL | |||||
OPTIONS_DEFAULT= LTO SASL SSL | |||||
MAKE_ARGS= --cxx-std=17 \ | MAKE_ARGS= --cxx-std=17 \ | ||||
--disable-warnings-as-errors \ | --disable-warnings-as-errors \ | ||||
--libc++ \ | --libc++ \ | ||||
--runtime-hardening=on \ | --runtime-hardening=on \ | ||||
--use-system-boost \ | |||||
--use-system-icu \ | |||||
--use-system-libunwind \ | |||||
--use-system-pcre \ | --use-system-pcre \ | ||||
--use-system-snappy \ | --use-system-snappy \ | ||||
--use-system-stemmer \ | |||||
--use-system-yaml \ | |||||
--use-system-zlib \ | --use-system-zlib \ | ||||
--use-system-zstd \ | |||||
-j ${MAKE_JOBS_NUMBER} \ | -j ${MAKE_JOBS_NUMBER} \ | ||||
AR=${PREFIX}/bin/ar \ | AR=llvm-ar \ | ||||
MONGO_VERSION=${DISTVERSION} \ | MONGO_VERSION=${DISTVERSION} \ | ||||
VERBOSE=on | VERBOSE=on | ||||
CONFLICTS_INSTALL= mongodb[0-9][0-9] | |||||
USERS= mongodb | |||||
GROUPS= mongodb | |||||
OPTIONS_DEFINE= LTO SASL SSL | |||||
OPTIONS_DEFAULT= LTO SASL SSL | |||||
LTO_MAKE_ARGS= --lto=on | LTO_MAKE_ARGS= --lto=on | ||||
SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2 | SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2 | ||||
SASL_MAKE_ARGS= --use-sasl-client | SASL_MAKE_ARGS= --use-sasl-client | ||||
SSL_USES= ssl | SSL_USES= ssl | ||||
SSL_MAKE_ARGS= --ssl | SSL_MAKE_ARGS= --ssl | ||||
.include <bsd.port.pre.mk> | .include <bsd.port.pre.mk> | ||||
.if ${ARCH} == aarch64 || ${ARCH} == powerpc64le | |||||
EXTRA_PATCHES= ${FILESDIR}/${ARCH} | |||||
.endif | |||||
ALL_TARGET= install-core | ALL_TARGET= install-core | ||||
# This ports is only following the Major Release. | # This ports is only following the Major Release. | ||||
# https://docs.mongodb.com/manual/reference/versioning/ | # https://docs.mongodb.com/manual/reference/versioning/ | ||||
PORTSCOUT= limit:^6\.0\. | PORTSCOUT= limit:^6\.0\. | ||||
CPE_PRODUCT= mongodb | CPE_PRODUCT= mongodb | ||||
#pre-patch: | .if ${ARCH} == amd64 | ||||
# ${MV} ${WRKSRC}/src/third_party/wiredtiger/src/checksum/power8/crc32.sx ${WRKSRC}/src/third_party/wiredtiger/src/checksum/power8/crc32.S | MOZJS_ARCH=x86_64 | ||||
.elif ${ARCH} == powerpc64le | |||||
MOZJS_ARCH=ppc64le | |||||
.elif ${ARCH} == aarch64 | |||||
MOZJS_ARCH=${ARCH} | |||||
.else | |||||
.error Unsupport architecture "${ARCH}" | |||||
Not Done Inline ActionsMinor nit, this .error is already caught by the ONLY_FOR_ARCHS above? So perhaps just .if ${ARCH} == amd64 MOZJS_ARCH=x86_64 .elif ${ARCH} == powerpc64le MOZJS_ARCH=ppc64le .else MOZJS_ARCH=${ARCH} .endif rene: Minor nit, this .error is already caught by the ONLY_FOR_ARCHS above? So perhaps just
```
.if… | |||||
Done Inline ActionsI doubted quite a bit about this when I wrote it. My first version was similar to your construction. I choose the current one because I thought it might point the attention of someone doing a port to a place where some action is needed. ronald_klop.ws: I doubted quite a bit about this when I wrote it. My first version was similar to your… | |||||
Not Done Inline ActionsFail loudly has it advantages :) rene: Fail loudly has it advantages :) | |||||
Not Done Inline ActionsIt turns out that this fail-loud construction broke the tree, see https://cgit.FreeBSD.org/ports/commit/?id=9f13b7867d45995913dbad00c131dce4eac4bb23 rene: It turns out that this fail-loud construction broke the tree, see https://cgit.FreeBSD. | |||||
.endif | |||||
post-patch: | |||||
${RM} -rf ${WRKSRC}/src/third_party/boost | |||||
${RM} -rf ${WRKSRC}/src/third_party/icu4c-* | |||||
${RM} -rf ${WRKSRC}/src/third_party/pcre-* | |||||
${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: | do-build: | ||||
${WRKSRC}/buildscripts/scons.py -C ${WRKSRC} ${MAKE_ARGS} | ${WRKSRC}/buildscripts/scons.py -C ${WRKSRC} ${MAKE_ARGS} | ||||
do-install: | do-install: | ||||
.for f in mongod mongos | .for f in mongod mongos | ||||
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${f} | ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${f} | ||||
.endfor | .endfor | ||||
${INSTALL_DATA} ${WRKSRC}/rpm/mongod.conf ${STAGEDIR}${PREFIX}/etc/mongodb.conf.sample | ${INSTALL_DATA} ${WRKSRC}/rpm/mongod.conf ${STAGEDIR}${PREFIX}/etc/mongodb.conf.sample | ||||
${MKDIR} ${STAGEDIR}${DOCSDIR} | ${MKDIR} ${STAGEDIR}${DOCSDIR} | ||||
.for doc in LICENSE-Community.txt MPL-2 README THIRD-PARTY-NOTICES | .for doc in LICENSE-Community.txt MPL-2 README THIRD-PARTY-NOTICES | ||||
${MV} ${STAGEDIR}${PREFIX}/${doc} ${STAGEDIR}${DOCSDIR}/ | ${MV} ${STAGEDIR}${PREFIX}/${doc} ${STAGEDIR}${DOCSDIR}/ | ||||
.endfor | .endfor | ||||
${RM} ${STAGEDIR}${PREFIX}/bin/resmoke.py | ${RM} ${STAGEDIR}${PREFIX}/bin/resmoke.py | ||||
.include <bsd.port.post.mk> | .include <bsd.port.post.mk> |
Perhaps make the FreeBSD and upstream architecture names the same for consistency?