# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 PortSystem 1.0 PortGroup active_variants 1.1 PortGroup compiler_blacklist_versions 1.0 PortGroup conflicts_build 1.0 PortGroup xcodeversion 1.0 # When updating mongodb to a new version, update mongo-tools to the # same version. name mongodb epoch 1 version 4.0.7 revision 0 checksums rmd160 df2f8bea07240eeeeb40d6593ab04ceff2908f09 \ sha256 d64db72a48e57b5db4a275a9394a6df201543740499996691502a9f4e6507013 \ size 49577148 license SSPL categories databases maintainers {ryandesign @ryandesign} description High-performance, schema-free document-oriented database long_description ${description} platforms darwin homepage https://www.mongodb.com/community master_sites https://fastdl.mongodb.org/src distname ${name}-src-r${version} depends_build port:scons \ port:py27-yaml \ port:py27-typing \ port:py27-regex \ port:py27-cheetah \ port:py27-setuptools depends_lib port:curl \ port:libpcap license_noconflict scons use_configure no # mongodb 3.0.5 and later requires C++11. Forcing the use of libc++ is # acceptable because mongodb already requires Mac OS X 10.7 or later, so we # know libc++ is available; mongodb doesn't provide any libraries for # other ports to use; and the only C++ libraries mongodb uses (boost, # pcre, snappy) are bundled. configure.cxx_stdlib libc++ PortGroup cxx11 1.1 # This matches a version check of __apple_build_version__ in SConstruct. compiler.blacklist-append *gcc* {clang < 802.0.42} macports-clang-3.3 macports-clang-3.4 macports-clang-3.7 # TODO: fix me conflicts_build libbson mongo-c-driver mongo-cxx-driver # When targeting Mac OS X 10.7, mongodb needs at least the 10.8 SDK, which is in Xcode 4.4: # https://jira.mongodb.org/browse/SERVER-20320 minimum_xcodeversions-append {11 4.4} if {[vercmp ${configure.sdk_version} 10.8] < 0} { configure.sdk_version 10.8 } # When targeting OS X 10.11, mongodb needs at least the 10.12 SDK, which is in Xcode 8: # https://jira.mongodb.org/browse/SERVER-37640 minimum_xcodeversions-append {15 8} if {[vercmp ${macosx_deployment_target} 10.11] >= 0 && [vercmp ${configure.sdk_version} 10.12] < 0} { configure.sdk_version 10.12 # We don't require the ld64 port, but if it is installed, it must defer to # Xcode to be new enough to understand the newer SDK, otherwise: # ld: unexpected token: !tapi-tbd-v2 file # See https://trac.macports.org/ticket/53784 # And require_active_variants doesn't work unless a dependency is declared. depends_build-append port:ld64 require_active_variants ld64 ld64_xcode } configure.cflags {*}${configure.cc_archflags} configure.ldflags {*}${configure.ld_archflags} if {${configure.sdkroot} ne ""} { configure.cflags-append -isysroot${configure.sdkroot} configure.ldflags-append -Wl,-syslibroot,${configure.sdkroot} } build.cmd ${prefix}/bin/scons build.target core mongobridge build.args CC="${configure.cc}" \ CCFLAGS="${configure.cflags}" \ CPPPATH="${prefix}/include" \ CXX="${configure.cxx}" \ LIBPATH="${prefix}/lib" \ LINKFLAGS="${configure.ldflags}" \ TARGET_ARCH=${build_arch} \ --disable-warnings-as-errors \ --libc++ \ --ssl \ --wiredtiger=on if {${os.platform} eq "darwin" && ${os.major} >= 15} { build.args-append \ --ssl-provider=native } else { depends_lib-append \ path:lib/libssl.dylib:openssl build.args-append \ --ssl-provider=openssl } # Specify a short variant dir because the default variant dir is deeply nested # and can be very long, so long that on some systems the build will fail with # "Argument list too long"; see https://jira.mongodb.org/browse/SERVER-13829 build.args-append VARIANT_DIR=MP # https://jira.mongodb.org/browse/SERVER-22810 supported_archs x86_64 destroot.args {*}${build.args} destroot.destdir --prefix=${destroot}${prefix} set dbdir ${prefix}/var/db/mongodb set logdir ${prefix}/var/log/mongodb set mongouser _mongo add_users ${mongouser} group=${mongouser} realname=MongoDB\ Server post-destroot { xinstall -W ${worksrcpath} mongobridge ${destroot}${prefix}/bin xinstall -m 0755 -o ${mongouser} -g ${mongouser} -d \ ${destroot}${dbdir} \ ${destroot}${logdir} destroot.keepdirs-append \ ${destroot}${dbdir} \ ${destroot}${logdir} } startupitem.create yes startupitem.executable sudo -u ${mongouser} ${prefix}/bin/mongod --dbpath ${dbdir} --logpath ${logdir}/mongodb.log --logappend if {${os.platform} eq "darwin" && ${os.major} < 11} { depends_build depends_lib pre-fetch { ui_error "${name} @${version} requires Mac OS X 10.7 or greater." return -code error "incompatible Mac OS X version" } } if {${os.platform} eq "darwin" && ${os.major} > 16} { notes-append { Warning: mongodb may lose data if it crashes on macOS 10.13 or greater.\ See https://jira.mongodb.org/browse/WT-4018. } } livecheck.url https://www.mongodb.org/downloads livecheck.regex {mongodb-src-r(\d+\.\d*[02468]\.\d+)\.}