Skip to content

py-protobuf3: update to 5.29.3, remove py27 and py38 subports #27351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 19 additions & 116 deletions python/py-protobuf3/Portfile
Original file line number Diff line number Diff line change
@@ -1,134 +1,37 @@
# -*- 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 compiler_blacklist_versions 1.0
PortGroup python 1.0
PortGroup github 1.0

# note the python package is a major version greater than the cpp package
# Note that the Python package is a different major version than the C++
# package. https://protobuf.dev/support/version-support/
set release_version \
21.12
29.3
name py-protobuf3
version 4.${release_version}
revision 2
python.rootname protobuf
version 5.${release_version}
revision 0

checksums sha256 e2b976e67d6fcf7078f799143a73f2a4d9cf3126ca68a1a6f1bda30fe5f3585c \
rmd160 5cb0e68bcf7674138208d5acac258330d5a6d4dd \
size 5211420
checksums sha256 5da0f41edaf117bde316404bad1a486cb4ededf8e4a54891296f648e8e076620 \
rmd160 f4b56ea8e0195d255d5e91ce95654d176e56ea99 \
size 424945

categories-append devel
maintainers nomaintainer
license BSD
description Encode data in an efficient yet extensible format.
description An extensible mechanism for serializing structured data.

long_description \
Google Protocol Buffers are a flexible, efficient, \
automated mechanism for serializing structured data -- \
think XML, but smaller, faster, and simpler. You \
define how you want your data to be structured once, \
then you can use special generated source code to \
easily write and read your structured data to and from \
a variety of data streams and using a variety of \
languages. You can even update your data structure \
without breaking deployed programs that are compiled \
against the "old" format. You specify how you want \
the information you're serializing to be structured by \
defining protocol buffer message types in .proto \
files. Each protocol buffer message is a small \
logical record of information, containing a series of \
name-value pairs.
Protocol buffers are Google’s language-neutral, \
platform-neutral, extensible mechanism for serializing \
structured data – think XML, but smaller, faster, and simpler. \
You define how you want your data to be structured once, then \
you can use special generated source code to easily write and \
read your structured data to and from a variety of data \
streams and using a variety of languages.

supported_archs noarch
platforms {darwin any}

github.setup google protobuf ${version} v
github.tarball_from releases
homepage https://github.com/google/protobuf
master_sites https://github.com/google/protobuf/releases/download/v${release_version}
distfiles protobuf-python-${version}.tar.gz
homepage https://protobuf.dev/

compiler.cxx_standard \
2011
# error: constexpr constructor never produces a constant expression [-Winvalid-constexpr]
compiler.blacklist {clang < 900}

python.versions 27 38 39 310 311 312 313

if {${name} ne ${subport}} {
conflicts py${python.version}-protobuf

depends_build-append \
port:py${python.version}-setuptools

depends_lib-append \
port:protobuf3-cpp \
port:py${python.version}-six

if {${python.version} == 27} {
# Use the last compatible version.
set release_version \
17.3
version 3.${release_version}
revision 0
checksums sha256 3253c6d17ec0bb6f6382e555cf5ca0a9ffab8d81b691f100f96ce9f5e753018e \
rmd160 548d88f3d75b8c75fe43eb0d620e8f40757e1566 \
size 5038061
github.setup google protobuf ${version} v
master_sites https://github.com/google/protobuf/releases/download/v${release_version}
distfiles protobuf-python-${version}.tar.gz
}

if {${python.version} > 36} {
depends_lib-append \
port:py${python.version}-flatbuffers
}

worksrcdir ${worksrcdir}/python

if {${python.version} > 27} {
# tricks to force the right -stdlib setting
# and to put a needed CXX flag on the 10.6 build
# see https://trac.macports.org/ticket/56482
patchfiles-append \
patch-py-protobuf3-settings.diff
}

if {${python.version} >= 311} {
patchfiles-append \
patch-protobuf-pyext-descriptor.cc.diff
}
if {${python.pep517}} {
build.cmd-append -C--cpp_implementation
} else {
build.cmd-append --cpp_implementation

destroot.cmd-append --cpp_implementation
}


post-patch {
set extraargs ""
set clang_stdlib ""

if {[string match *clang* ${configure.compiler}] && ${configure.cxx_stdlib} ne ""} {
set clang_stdlib -stdlib=${configure.cxx_stdlib}

if {${os.platform} eq "darwin" && ${os.major} < 11} {
set extraargs -DGOOGLE_PROTOBUF_NO_THREADLOCAL
}
}

reinplace "s|@@MACPORTS_STDLIB@@|${clang_stdlib}|g" setup.py
reinplace "s|@@MACPORTS_EXTRAARG@@|${extraargs}|g" setup.py
}


if {${python.version} > 27} {
test.run yes
python.test_framework
test.cmd "${python.bin} setup.py"
test.target test --cpp_implementation
}
}

github.livecheck.regex {([0-9.]+)}
python.versions 39 310 311 312 313