# -*- 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 github 1.0 # When trying to build a universal variant, build_detect_platform script mistakenly can't find library snappy # The following test fails for multiple archs (see https://llvm.org/bugs/show_bug.cgi?id=15403) # # Test whether Snappy library is installed # # https://code.google.com/p/snappy/ # $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT 2>/dev/null < # int main() {} # EOF # We therefore use muniversal PortGroup PortGroup muniversal 1.0 github.setup google leveldb 1.20 v revision 3 categories databases platforms darwin license BSD maintainers nomaintainer description A fast and lightweight key/value database library by Google long_description A fast and lightweight key/value database library by Google checksums rmd160 dd72b89d356031709df9a41da2c31ea2e093361d \ sha256 154d804980d92b08d08dafff8e937ad79a45ef0fe87c9f5d69ea74690f85a933 \ size 223200 depends_lib port:snappy # see https://trac.macports.org/ticket/56164 # see https://trac.macports.org/ticket/56508 patchfiles install_name.patch \ patch-build_detect_platform.diff use_configure no if {[string match *clang* ${configure.cxx}] && ${configure.cxx_stdlib} ne ""} { configure.cxxflags-append -stdlib=${configure.cxx_stdlib} configure.ldflags-append -stdlib=${configure.cxx_stdlib} } if {${universal_possible} && [variant_isset universal]} { foreach arch ${configure.universal_archs} { lappend merger_build_env(${arch}) \ "CFLAGS=${configure.cflags} -arch ${arch}" \ "CXXFLAGS=${configure.cxxflags} -arch ${arch}" \ "LDFLAGS=${configure.ldflags} -arch ${arch}" } } else { build.env-append \ "CFLAGS=${configure.cflags} [get_canonical_archflags cc]" \ "CXXFLAGS=${configure.cxxflags} [get_canonical_archflags cxx]" \ "LDFLAGS=${configure.ldflags} [get_canonical_archflags ld]" } build.env-append \ INSTALL_PATH=${prefix}/lib \ CC=${configure.cc} \ CXX=${configure.cxx} \ OPT=-DNDEBUG destroot { xinstall -d -m 0755 ${destroot}${prefix}/include/leveldb xinstall -d -m 0755 ${destroot}${prefix}/include/helpers/memenv xinstall -m 0644 {*}[glob ${worksrcpath}/include/leveldb/*.h] ${destroot}${prefix}/include/leveldb xinstall -m 0644 ${worksrcpath}/helpers/memenv/memenv.h ${destroot}${prefix}/include/helpers/memenv copy {*}[glob ${worksrcpath}/out-shared/libleveldb*.dylib] ${destroot}${prefix}/lib xinstall -m 0644 {*}[glob ${worksrcpath}/out-static/lib*.a] ${destroot}${prefix}/lib }