[macports-ports] branch master updated: py-protobuf3: fix build on older systems
Ryan Schmidt
ryandesign at macports.org
Fri May 25 15:38:52 UTC 2018
On May 24, 2018, at 23:15, Ken wrote:
> Ken (kencu) pushed a commit to branch master
> in repository macports-ports.
>
>
> https://github.com/macports/macports-ports/commit/5cb3bb12990f7ea682e4b964eb86269923521397
>
> The following commit(s) were added to refs/heads/master by this push:
>
> new 5cb3bb1 py-protobuf3: fix build on older systems
>
> 5cb3bb1 is described below
>
>
> commit 5cb3bb12990f7ea682e4b964eb86269923521397
>
> Author: Ken Cunningham
> AuthorDate: Thu May 24 20:17:44 2018 -0700
>
> py-protobuf3: fix build on older systems
>
> add cxx11 1.1 PG
> add -stdlib flag to clang builds
> add needed CXX flag to systems without thread_local
> closes: https://trac.macports.org/ticket/56482
>
> ---
> python/py-protobuf3/Portfile | 21 +++++++++++++++++++++
> .../files/patch-py-protobuf3-settings.diff | 11 +++++++++++
> 2 files changed, 32 insertions(+)
>
> diff --git a/python/py-protobuf3/Portfile b/python/py-protobuf3/Portfile
> index 46a95dd..fa24a95 100644
> --- a/python/py-protobuf3/Portfile
> +++ b/python/py-protobuf3/Portfile
> + # tricks to force the right -stdlib setting
> + # and to put a needed CXX flag on the 10.6 build
If this is supposed to help 10.6...
> diff --git a/python/py-protobuf3/files/patch-py-protobuf3-settings.diff b/python/py-protobuf3/files/patch-py-protobuf3-settings.diff
> new file mode 100644
> index 0000000..6293b45
> --- /dev/null
> +++ b/python/py-protobuf3/files/patch-py-protobuf3-settings.diff
> @@ -0,0 +1,11 @@
> +--- setup.py.old 2018-05-24 19:42:16.000000000 -0700
> ++++ setup.py 2018-05-24 19:43:21.000000000 -0700
> +@@ -197,6 +197,8 @@
> + v = float('.'.join(v.split('.')[:2]))
> + if v >= 10.12:
> + extra_compile_args.append('-std=c++11')
> ++ extra_compile_args.append('@@MACPORTS_STDLIB@@')
> ++ extra_compile_args.append('@@MACPORTS_EXTRAARG@@')
...why is it inside an if statement that's for 10.12 and later?
I guess it works because the if statement is erroneously treating the version number as a floating point number, in which case 10.6 is considered to be greater than 10.12.
So the question is: does this code always require C++11? If so, remove the if statement.
If it does not always require C++11, fix the if statement so that it correctly uses C++11 only on 10.12 and later.
More information about the macports-dev
mailing list