Ticket #59826: Portfile.2

File Portfile.2, 3.2 KB (added by someuser12, 4 years ago)

Portfile for py-protobuf3.8 (workaround is to downgrade protobuf3-cpp and py-protobuf3)

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       python 1.0
5PortGroup       github 1.0
6PortGroup       cxx11 1.1
7
8name            py-protobuf3.8
9version         3.8.0
10categories-append   devel
11maintainers     {toby @tobypeterson} openmaintainer
12license         BSD
13description     Encode data in an efficient yet extensible format.
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.setup    google protobuf ${version} v
33github.tarball_from releases
34homepage        https://github.com/google/protobuf
35master_sites    https://github.com/google/protobuf/releases/download/v${version}
36distfiles       protobuf-python-${version}.tar.gz
37worksrcdir      protobuf-${version}
38
39checksums       sha256  3b7c258a79839056f2ee3be467581b4acac3e091f7757c8203360b354d32afd5 \
40                rmd160  722f912c1e457319b16efed46f2c5a94ab94dde9 \
41                size    4861658
42
43platforms       darwin
44
45python.versions 27 35 36 37 38
46
47if {${name} ne ${subport}} {
48    conflicts       py${python.version}-protobuf \
49                    py${python.version}-protobuf3
50
51    depends_build   port:py${python.version}-setuptools
52
53    depends_lib     port:protobuf3.8-cpp \
54                    port:py${python.version}-six
55
56    worksrcdir      ${worksrcdir}/python
57   
58    # tricks to force the right -stdlib setting
59    # and to put a needed CXX flag on the 10.6 build
60    # see https://trac.macports.org/ticket/56482
61    patchfiles-append patch-py-protobuf3-settings.diff
62
63    post-patch {
64        set extraargs ""
65        set clang_stdlib ""
66
67        if {[string match *clang* ${configure.compiler}]} {
68            set clang_stdlib -stdlib=${configure.cxx_stdlib}
69
70            if {${os.platform} eq "darwin" && ${os.major} < 11} {
71                set extraargs -DGOOGLE_PROTOBUF_NO_THREADLOCAL
72            }
73        }
74       
75        reinplace "s|@@MACPORTS_STDLIB@@|${clang_stdlib}|g" setup.py
76        reinplace "s|@@MACPORTS_EXTRAARG@@|${extraargs}|g" setup.py
77    }
78
79
80    destroot.cmd-append    --cpp_implementation
81
82    test.run        yes
83    test.cmd        "${python.bin} setup.py"
84    test.target     test --cpp_implementation
85
86    livecheck.type  none
87}
88
89github.livecheck.regex  {([0-9.]+)}