PROTON-885: allow pip to set the install path for proton
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/a21bd427 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/a21bd427 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/a21bd427 Branch: refs/heads/cjansen-cpp-client Commit: a21bd4272838c71212be954931e811277a94eb70 Parents: 26a0622 Author: Flavio Percoco <[email protected]> Authored: Wed May 27 13:11:14 2015 -0400 Committer: Ken Giusti <[email protected]> Committed: Wed May 27 13:11:14 2015 -0400 ---------------------------------------------------------------------- proton-c/bindings/python/setup.py | 12 +++++++----- proton-c/bindings/python/setuputils/bundle.py | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a21bd427/proton-c/bindings/python/setup.py ---------------------------------------------------------------------- diff --git a/proton-c/bindings/python/setup.py b/proton-c/bindings/python/setup.py index e61edc7..09fa76a 100755 --- a/proton-c/bindings/python/setup.py +++ b/proton-c/bindings/python/setup.py @@ -133,7 +133,9 @@ class Configure(build_ext): description = "Discover Qpid Proton version" def bundle_libqpid_proton_extension(self): - bundledir = "bundled" + base = self.get_finalized_command('build').build_base + install = self.get_finalized_command('install').install_base + bundledir = os.path.join(base, "bundled") ext_modules = self.distribution.ext_modules log.info("Using bundled libqpid-proton") @@ -154,7 +156,7 @@ class Configure(build_ext): # is in `distutils.sysconfig.PREFIX` and finally, disable testing # as well. The python binding will be built by this script later # on. Don't let cmake do it. - extra_compile_args = ['-DCMAKE_INSTALL_PREFIX:PATH=%s' % ds_sys.PREFIX, + extra_compile_args = ['-DCMAKE_INSTALL_PREFIX:PATH=%s' % install, '-DBUILD_PYTHON=False', '-DBUILD_JAVA=False', '-DBUILD_PERL=False', @@ -168,6 +170,7 @@ class Configure(build_ext): # NOTE(flaper87): Register this new extension and make # sure it's built and installed *before* `_cproton`. self.distribution.ext_modules.insert(0, libqpid_proton) + return install def set_cproton_settings(self, prefix=None): settings = misc.settings_from_prefix(prefix) @@ -191,8 +194,7 @@ class Configure(build_ext): def run(self): prefix = None if self.bundle_proton: - self.bundle_libqpid_proton_extension() - prefix = ds_sys.PREFIX + prefix = self.bundle_libqpid_proton_extension() self.set_cproton_settings(prefix) @@ -204,7 +206,7 @@ cmdclass = {'configure': Configure, setup(name='python-qpid-proton', - version=bundle.min_qpid_proton_str, + version=bundle.bundled_version_str, description='An AMQP based messaging library.', author='Apache Qpid', author_email='[email protected]', http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a21bd427/proton-c/bindings/python/setuputils/bundle.py ---------------------------------------------------------------------- diff --git a/proton-c/bindings/python/setuputils/bundle.py b/proton-c/bindings/python/setuputils/bundle.py index 498e163..920744d 100644 --- a/proton-c/bindings/python/setuputils/bundle.py +++ b/proton-c/bindings/python/setuputils/bundle.py @@ -36,7 +36,7 @@ min_qpid_proton = (0, 9) min_qpid_proton_str = "%i.%i" % min_qpid_proton bundled_version = (0,9,1) -bundled_version_str = "%i.%i.%i" % (0,9,1) +bundled_version_str = "%i.%i.%i" % bundled_version libqpid_proton = "qpid-proton-%s.tar.gz" % bundled_version_str libqpid_proton_url = ("http://www.apache.org/dist/qpid/proton/%s/%s" % (bundled_version_str, libqpid_proton)) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
