# -*- 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
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
checksums rmd160 df2f8bea07240eeeeb40d6593ab04ceff2908f09 \
sha256 d64db72a48e57b5db4a275a9394a6df201543740499996691502a9f4e6507013 \
maintainers {ryandesign @ryandesign}
description High-performance, schema-free document-oriented database
long_description ${description}
homepage https://www.mongodb.com/community
master_sites https://fastdl.mongodb.org/src
distname ${name}-src-r${version}
depends_build port:scons \
# 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++
# 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
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