source: trunk/dports/databases/leveldb/Portfile

Last change on this file was 153953, checked in by ryandesign@…, 13 months ago

leveldb: Update to 1.19

Also fix shared library install_name.

Resolves #52608

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1# -*- 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
2# $Id: Portfile 153953 2016-10-16 22:16:03Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           github 1.0
6
7# When trying to build a universal variant, build_detect_platform script mistakenly can't find library snappy
8# The following test fails for multiple archs (see https://llvm.org/bugs/show_bug.cgi?id=15403)
9#    # Test whether Snappy library is installed
10#    # http://code.google.com/p/snappy/
11#    $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT 2>/dev/null  <<EOF
12#    #include <snappy.h>
13#    int main() {}
14#    EOF
15# We therefore use muniversal PortGroup
16PortGroup           muniversal 1.0
17
18github.setup        google leveldb 1.19 v
19
20categories          databases
21platforms           darwin
22license             BSD
23maintainers         nomaintainer
24description         A fast and lightweight key/value database library by Google
25long_description    A fast and lightweight key/value database library by Google
26
27checksums           rmd160  9586c14604093fe2ca855539f7d69ce55c999da5 \
28                    sha256  6835203e749f7f437f87f7fb788e96d0718f62ca28c0160a35f48d1ba17a8e7b
29
30depends_lib         port:snappy
31
32patchfiles          install_name.patch
33
34use_configure       no
35
36if { [variant_isset universal] } {
37    foreach arch ${configure.universal_archs} {
38        set merger_build_env(${arch}) "CFLAGS=\"-arch ${arch}\" CXXFLAGS=\"-arch ${arch}\" LDFLAGS=\"-arch ${arch} -L${prefix}/lib\""
39    }
40} else {
41    build.env-append \
42        CFLAGS="[get_canonical_archflags cc]" \
43        CXXFLAGS="[get_canonical_archflags cxx]" \
44        LDFLAGS="[get_canonical_archflags ld] -L${prefix}/lib"
45}
46
47build.env-append                          \
48    INSTALL_PATH=${prefix}/lib            \
49    CC="${configure.cc}"                  \
50    CXX="${configure.cxx}"                \
51    OPT="${configure.optflags} -DNDEBUG"
52
53# muniversal build requires Makefile
54post-extract {
55    set makefile [open ${worksrcpath}/Makefile-Install "w"]
56    puts ${makefile} {install:}
57    puts ${makefile} "\t/usr/bin/install -d -m 0755 \$(DESTDIR)${prefix}/include/leveldb"
58    puts ${makefile} "\t/usr/bin/install -d -m 0755 \$(DESTDIR)${prefix}/include/helpers/memenv"
59    puts ${makefile} "\t/usr/bin/install -m 0644 include/leveldb/*.h \$(DESTDIR)${prefix}/include/leveldb"
60    puts ${makefile} "\t/usr/bin/install -m 0644 helpers/memenv/memenv.h \$(DESTDIR)${prefix}/include/helpers/memenv"
61    puts ${makefile} "\t/bin/cp -R out-shared/libleveldb* \$(DESTDIR)${prefix}/lib"
62    puts ${makefile} "\t/usr/bin/install -m 0644 out-static/lib*.a \$(DESTDIR)${prefix}/lib"
63    close ${makefile}
64}
65
66destroot.args-append -f Makefile-Install
Note: See TracBrowser for help on using the repository browser.