You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2018/02/22 03:01:25 UTC

[2/2] qpid-proton git commit: PROTON-1769: Fix Python Pypi package to work for more platforms

PROTON-1769: Fix Python Pypi package to work for more platforms


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/f86e74f8
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/f86e74f8
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/f86e74f8

Branch: refs/heads/master
Commit: f86e74f8caed4a857fcaf38fb948f8e34c807be1
Parents: b5553d1
Author: Andrew Stitcher <as...@apache.org>
Authored: Wed Feb 21 19:44:01 2018 -0500
Committer: Andrew Stitcher <as...@apache.org>
Committed: Wed Feb 21 21:53:35 2018 -0500

----------------------------------------------------------------------
 .travis.yml                                 |  6 ++++--
 proton-c/bindings/python/CMakeLists.txt     |  1 -
 proton-c/bindings/python/setup.py.in        | 13 ++++---------
 proton-c/bindings/python/setuputils/misc.py |  4 ++--
 4 files changed, 10 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f86e74f8/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 7eb7e8c..6d75c5e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -35,7 +35,8 @@ matrix:
   - os: osx
     osx_image: xcode7.3
     env:
-    - QPID_PROTON_CMAKE_ARGS='-DPROACTOR=libuv -DSASL_IMPL=none -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DBUILD_PERL=OFF -DBUILD_RUBY=OFF'
+    - PKG_CONFIG_PATH='/usr/local/opt/openssl/lib/pkgconfig'
+    - QPID_PROTON_CMAKE_ARGS='-DPROACTOR=libuv -DSASL_IMPL=none -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DBUILD_PERL=OFF -DBUILD_RUBY=OFF'
     before_install:
     - brew update
     - brew upgrade python openssl
@@ -44,7 +45,8 @@ matrix:
   - os: osx
     osx_image: xcode9
     env:
-    - QPID_PROTON_CMAKE_ARGS='-DPROACTOR=libuv -DSASL_IMPL=none -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DBUILD_PERL=OFF -DBUILD_RUBY=OFF'
+    - PKG_CONFIG_PATH='/usr/local/opt/openssl/lib/pkgconfig'
+    - QPID_PROTON_CMAKE_ARGS='-DPROACTOR=libuv -DSASL_IMPL=none -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DBUILD_PERL=OFF -DBUILD_RUBY=OFF'
     before_install:
     - brew update
     - brew upgrade python openssl

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f86e74f8/proton-c/bindings/python/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/CMakeLists.txt b/proton-c/bindings/python/CMakeLists.txt
index 28fed01..ce15451 100644
--- a/proton-c/bindings/python/CMakeLists.txt
+++ b/proton-c/bindings/python/CMakeLists.txt
@@ -168,7 +168,6 @@ set (all_src
   ${qpid-proton-include-extra}
   ${qpid-proton-layers-all}
   ${qpid-proton-platform-all}
-  ${qpid-proton-proactor}
   ${qpid-proton-private-includes}
   include/proton/cproton.i
 )

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f86e74f8/proton-c/bindings/python/setup.py.in
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/setup.py.in b/proton-c/bindings/python/setup.py.in
index 6249cbf..fe584e3 100755
--- a/proton-c/bindings/python/setup.py.in
+++ b/proton-c/bindings/python/setup.py.in
@@ -144,14 +144,14 @@ class Configure(build_ext):
                   'schannel.c',
                   'ssl_stub.c',
                   'cyrus_sasl.c',
-                  'cyrus_stub.c',
-                  'libuv.c']
+                  'cyrus_stub.c']
         sources = filter(lambda x: os.path.basename(x) not in cfgdep, sources)
         sources = [os.path.join(proton_base, x) for x in sources]
 
         # Look for any optional libraries that proton needs, and adjust the
         # source list and compile flags as necessary.
         libraries = []
+        includes = []
 
         # -D flags (None means no value, just define)
         macros=[('qpid_proton_EXPORTS', None),
@@ -163,6 +163,7 @@ class Configure(build_ext):
         # return True and we'll use it. Otherwise, we'll use the stub.
         if misc.pkg_config_version_installed('openssl', atleast='0'):
             libraries += ['ssl', 'crypto']
+            includes += [misc.pkg_config_get_var('openssl', 'includedir')]
             sources.append(os.path.join(proton_src, 'ssl', 'openssl.c'))
         else:
             sources.append(os.path.join(proton_src, 'ssl', 'ssl_stub.c'))
@@ -194,12 +195,6 @@ class Configure(build_ext):
                      " PLAIN mechanisms will be supported!")
             sources.append(os.path.join(proton_src, 'sasl', 'cyrus_stub.c'))
 
-        # Include proactor if libuv is available
-        if cc.has_function('uv_tcp_init', includes=['uv.h'],
-                           libraries=['uv']):
-            libraries.append('uv')
-            sources.append(os.path.join(proton_src, 'proactor', 'libuv.c'))
-
         # compile all the proton sources.  We'll add the resulting list of
         # objects to the _cproton extension as 'extra objects'.  We do this
         # instead of just lumping all the sources into the extension to prevent
@@ -213,7 +208,7 @@ class Configure(build_ext):
                              macros=macros,
                              include_dirs=[build_include,
                                            proton_include,
-                                           proton_src],
+                                           proton_src]+includes,
                              # compiler command line options:
                              extra_postargs=['-std=gnu99'],
                              output_dir=self.build_temp)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f86e74f8/proton-c/bindings/python/setuputils/misc.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/setuputils/misc.py b/proton-c/bindings/python/setuputils/misc.py
index 54a8fde..1aa5556 100644
--- a/proton-c/bindings/python/setuputils/misc.py
+++ b/proton-c/bindings/python/setuputils/misc.py
@@ -66,7 +66,7 @@ def pkg_config_version_installed(package, version=None, atleast=None):
             return False
         log.info("Using %s version %s (found via pkg-config)" %
                  (package,
-                  _call_pkg_config(['--modversion', package]).communicate()[0]))
+                  _call_pkg_config(['--modversion', package]).communicate()[0].splitlines()[0]))
         return True
     return False
 
@@ -82,5 +82,5 @@ def pkg_config_get_var(package, name):
     if p.returncode:
         out = ""
         log.warn(err)
-    return out
+    return out.splitlines()[0]
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org