Ticket #56366: Portfile2

File Portfile2, 2.7 KB (added by letaage, 6 years ago)

Compiles successfully using this port file

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
3PortSystem 1.0
4PortGroup  github 1.0
5PortGroup  cxx11 1.1
6
7github.setup    google protobuf 3.5.1 v
8name            protobuf3-cpp
9categories      devel
10maintainers     blair
11license         BSD
12description     Encode data in an efficient yet extensible format.
13conflicts       protobuf-cpp
14
15long_description \
16                Google Protocol Buffers are a flexible, efficient, \
17                automated mechanism for serializing structured data -- \
18                think XML, but smaller, faster, and simpler.  You \
19                define how you want your data to be structured once, \
20                then you can use special generated source code to \
21                easily write and read your structured data to and from \
22                a variety of data streams and using a variety of \
23                languages.  You can even update your data structure \
24                without breaking deployed programs that are compiled \
25                against the "old" format.  You specify how you want \
26                the information you're serializing to be structured by \
27                defining protocol buffer message types in .proto \
28                files.  Each protocol buffer message is a small \
29                logical record of information, containing a series of \
30                name-value pairs.
31
32github.tarball_from releases
33distname        protobuf-cpp-${version}
34worksrcdir      protobuf-${version}
35
36if {${os.platform} eq "darwin" && ${os.major} < 11} {
37    if {[string match *clang* ${configure.compiler}] && ${configure.cxx_stdlib} eq "macports-libstdc++"} {
38        # GCC emulates thread-local storage
39        compiler.whitelist  macports-gcc-7
40    } else {
41        configure.cppflags-append -DGOOGLE_PROTOBUF_NO_THREADLOCAL
42    }
43}
44
45checksums       rmd160  21375095e562cfee25ba68d68e481cf608ac9a9a \
46                sha256  c28dba8782da2cfea1e11c61d335958c31a9c1bc553063546af9cbe98f204092
47
48platforms       darwin
49
50depends_lib     port:zlib
51
52# see https://trac.macports.org/wiki/UsingTheRightCompiler
53configure.env-append \
54    CC_FOR_BUILD=${configure.cc} \
55    CXX_FOR_BUILD=${configure.cxx}
56
57configure.cflags-append     -g
58configure.cppflags-append   -g
59
60depends_build-append port:libtool
61post-configure {
62    # when linking, libtool does not respect -stdlib
63    delete ${worksrcpath}/libtool
64    xinstall -m 0755 ${prefix}/bin/glibtool ${worksrcpath}/libtool
65}
66
67post-destroot {
68    set docdir ${destroot}${prefix}/share/doc/${name}
69
70    xinstall -d -m 755 ${docdir}
71
72    foreach f {CHANGES.txt CONTRIBUTORS.txt LICENSE README.md editors examples} {
73        file copy ${worksrcpath}/${f} ${docdir}
74    }
75}
76
77test.run    yes
78test.target check