Ticket #67473: Portfile-23.2

File Portfile-23.2, 5.2 KB (added by Schamschula (Marius Schamschula), 18 months ago)
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       cmake                       1.1
5PortGroup       compiler_blacklist_versions 1.0
6
7# NOTE: For any version number change, also
8# NOTE:   Update py-protobuf3 version's number to match
9# NOTE: For a minor or major version number change, also
10# NOTE:   Revbump et, protobuf-c, mosh and py-onnx
11version         23.2
12revision        0
13
14name            protobuf3-cpp
15categories      devel
16maintainers     nomaintainer
17license         BSD
18
19conflicts       protobuf-cpp
20
21description     Encode data in an efficient yet extensible format.
22
23long_description \
24                Google Protocol Buffers are a flexible, efficient, \
25                automated mechanism for serializing structured data -- \
26                think XML, but smaller, faster, and simpler.  You \
27                define how you want your data to be structured once, \
28                then you can use special generated source code to \
29                easily write and read your structured data to and from \
30                a variety of data streams and using a variety of \
31                languages.  You can even update your data structure \
32                without breaking deployed programs that are compiled \
33                against the "old" format.  You specify how you want \
34                the information you're serializing to be structured by \
35                defining protocol buffer message types in .proto \
36                files.  Each protocol buffer message is a small \
37                logical record of information, containing a series of \
38                name-value pairs.
39
40homepage        https://developers.google.com/protocol-buffers/
41
42set abseil_version     20230125.3
43set googletest_version 1.13.0
44set jsoncpp_version    1.9.5
45
46master_sites    https://github.com/protocolbuffers/protobuf/releases/download/v${version}:protobuf \
47                https://github.com/abseil/abseil-cpp/archive/refs/tags/:abseil \
48                https://github.com/google/googletest/archive/refs/tags/:googletest \
49                https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/:jsoncpp
50
51distfiles       protobuf-${version}${extract.suffix}:protobuf \
52                ${abseil_version}${extract.suffix}:abseil \
53                v${googletest_version}${extract.suffix}:googletest \
54                ${jsoncpp_version}${extract.suffix}:jsoncpp
55
56checksums       protobuf-${version}${extract.suffix} \
57                rmd160  dc3cb50ffcb5a35afc2e55cc79c9232bdf071892 \
58                sha256  ddf8c9c1ffccb7e80afd183b3bd32b3b62f7cc54b106be190bf49f2bc09daab5 \
59                size    5037572 \
60                ${abseil_version}${extract.suffix} \
61                rmd160  c6e43d815435d6ec064aada62694067e73789316 \
62                sha256  5366d7e7fa7ba0d915014d387b66d0d002c03236448e1ba9ef98122c13b35c36 \
63                size    2119655 \
64                v${googletest_version}${extract.suffix} \
65                rmd160  a9c9160e28d4d2573f07235f05e25ae1cad8f261 \
66                sha256  ad7fdba11ea011c1d925b3289cf4af2c66a352e18d4c7264392fead75e919363 \
67                size    862871 \
68                ${jsoncpp_version}${extract.suffix} \
69                rmd160  30ecfad1f1996992e5022af96426985d178fc611 \
70                sha256  f409856e5920c18d0c2fb85276e24ee607d2a09b5e7d5f0a371368903c275da2 \
71                size    216055
72
73worksrcdir      protobuf-${version}
74
75pre-configure {
76    # protobuf3-cpp will pick up old header files
77    if {![catch {lindex [registry_active protobuf3-cpp] 0} installed]} {
78        set _version [lindex $installed 1]
79        if {[vercmp $_version 20] < 0} {
80            registry_deactivate_composite protobuf3-cpp "" [list ports_nodepcheck 1]
81        }
82    }
83}
84
85post-extract {
86    delete ${worksrcpath}/third_party/abseil-cpp
87    move ${workpath}/abseil-cpp-${abseil_version}/ ${worksrcpath}/third_party/abseil-cpp
88    delete ${worksrcpath}/third_party/googletest
89    move ${workpath}/googletest-${googletest_version}/ ${worksrcpath}/third_party/googletest
90    delete ${worksrcpath}/third_party/jsoncpp
91    move ${workpath}/jsoncpp-${jsoncpp_version}/ ${worksrcpath}/third_party/jsoncpp
92}
93
94compiler.cxx_standard   2014
95compiler.thread_local_storage   yes
96# error: constexpr constructor never produces a constant expression [-Winvalid-constexpr]
97compiler.blacklist {clang < 900}
98
99# bundled libtool version doesn't recognise -stdlib
100# use_autoreconf  yes
101
102platforms       darwin
103
104depends_lib     port:zlib \
105                port:abseil
106
107# see https://trac.macports.org/wiki/UsingTheRightCompiler
108# configure.env-append \
109#     CC_FOR_BUILD=${configure.cc} \
110#     CXX_FOR_BUILD=${configure.cxx}
111#
112# configure.cflags-append     -g
113# configure.cppflags-append   -g
114
115configure.args-append \
116                    -DBUILD_SHARED_LIBS=ON \
117                    -DCMAKE_CXX_STANDARD=14 \
118                    -DABSL_PROPAGATE_CXX_STD=ON
119
120post-destroot {
121    set docdir ${destroot}${prefix}/share/doc/${name}
122
123    xinstall -d -m 755 ${docdir}
124
125    foreach f {CHANGES.txt CONTRIBUTORS.txt LICENSE README.md editors examples} {
126        file copy ${worksrcpath}/${f} ${docdir}
127    }
128}
129
130test.run    yes
131test.target check
132
133#github.livecheck.regex  {([0-9.]+)}