# -*- 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 clang_dependency 1.0
# Increase the revision of p5-berkeleydb any time the db48 version changes.
# See https://trac.macports.org/ticket/56561
set branch [join [lrange [split ${version} .] 0 1] {}]
maintainers {jmr @jmroot} openmaintainer
description The Berkeley DB package, version 4.8
Version 4.8 of the Berkeley Data Base library which \
offers (key/value) storage with optional concurrent \
access or transactions interface. This port will \
install the AES (American Encryption Standard) \
homepage http://www.oracle.com/us/products/database/berkeley-db/db/overview/index.html
master_sites http://download.oracle.com/berkeley-db/
checksums md5 f80022099c5742cd179343556179aa8c \
sha1 ab36c170dda5b2ceaad3915ced96e41c6b7e493c \
rmd160 dd2fcd4c9b857a91e2f491fd4fadb0c51b993a9c
if {${os.platform} eq "darwin" && ${os.major} < 11 && ${cxx_stdlib} eq "libc++"} {
# This port is in the dependency chain for clang 3.7 and later
clang_dependency.extra_versions 3.7
patchfiles patch-dbinc_atomic.h
# Don't link with "-flat_namespace -undefined suppress" on Yosemite and
patchfiles-append yosemite-libtool.patch
configure.dir ${worksrcpath}/build_unix
build.dir ${configure.dir}
configure.cmd ../dist/configure
configure.args --enable-cxx \
--includedir=\\\${prefix}/include/db${branch} \
--libdir=\\\${prefix}/lib/db${branch}
if {[string match *clang* ${configure.cxx}]} {
set cxx_stdlibflags -stdlib=${configure.cxx_stdlib}
configure.cxx ${configure.cxx} ${cxx_stdlibflags}
destroot.args docdir=${prefix}/share/doc/${name}
foreach bin [glob -tails -directory ${destroot}${prefix}/bin/ db_*] {
set newbin [regsub {^db_} ${bin} "db${branch}_"]
move ${destroot}${prefix}/bin/${bin} \
${destroot}${prefix}/bin/${newbin}
variant java description {Build the Java API} {
configure.args-append --enable-java
if {${os.subplatform} eq "macosx" && ${os.major} < 11} {
variant tcl description {Build Tcl API} {
depends_lib-append port:tcl
configure.args-append --enable-tcl --with-tcl=${prefix}/lib
variant umrw description {Mask harmless uninitialized memory read/writes for the benefit of memory debuggers such as Valgrind} {
configure.args-append --enable-umrw
if { [variant_isset universal] } {
if {${os.arch} eq "i386"} {
if { ${os.major} >= 10 } {
set merger_configure_args(ppc) --with-mutex=Darwin/_spin_lock_try
set merger_configure_args(ppc64) --with-mutex=Darwin/_spin_lock_try