Exemplo n.º 1
0
 def run(self):
     if doing_bdist and not sys.platform.startswith('win'):
         # always rebuild before bdist, because linking may be wrong:
         self.run_command('clean')
         copy_and_patch_libzmq(ZMQ, 'libzmq'+lib_ext)
     build.run(self)
 def run(self):
     cfg = self.config
     if 'PyPy' in sys.version:
         info("PyPy: Nothing to configure")
         return
     
     if cfg['libzmq_extension']:
         self.bundle_libzmq_extension()
         self.finish_run()
         return
     
     # When cross-compiling and zmq is given explicitly, we can't testbuild
     # (as we can't testrun the binary), we assume things are alright.
     if cfg['skip_check_zmq'] or self.cross_compiling:
         warn("Skipping zmq version check")
         self.finish_run()
         return
     
     zmq_prefix = cfg['zmq_prefix']
     # There is no available default on Windows, so start with fallback unless
     # zmq was given explicitly, or libzmq extension was explicitly prohibited.
     if sys.platform.startswith("win") and \
             not cfg['no_libzmq_extension'] and \
             not zmq_prefix:
         self.fallback_on_bundled()
         self.finish_run()
         return
     
     if zmq_prefix and self.bundle_libzmq_dylib and not sys.platform.startswith('win'):
         copy_and_patch_libzmq(zmq_prefix, 'libzmq'+lib_ext)
     
     # first try with given config or defaults
     try:
         self.check_zmq_version()
     except Exception:
         etype, evalue, tb = sys.exc_info()
         # print the error as distutils would if we let it raise:
         info("\nerror: %s\n" % evalue)
     else:
         self.finish_run()
         return
     
     # try fallback on /usr/local on *ix if no prefix is given
     if not zmq_prefix and not sys.platform.startswith('win'):
         info("Failed with default libzmq, trying again with /usr/local")
         time.sleep(1)
         zmq_prefix = cfg['zmq_prefix'] = '/usr/local'
         self.init_settings_from_config()
         try:
             self.check_zmq_version()
         except Exception:
             etype, evalue, tb = sys.exc_info()
             # print the error as distutils would if we let it raise:
             info("\nerror: %s\n" % evalue)
         else:
             # if we get here the second run succeeded, so we need to update compiler
             # settings for the extensions with /usr/local prefix
             self.finish_run()
             return
     
     # finally, fallback on bundled
     
     if cfg['no_libzmq_extension']:
         fatal("Falling back on bundled libzmq,"
         " but setup.cfg has explicitly prohibited building the libzmq extension."
         )
     
     self.fallback_on_bundled()
     
     self.finish_run()
Exemplo n.º 3
0
 def run(self):
     if bundle_libzmq_dylib and not sys.platform.startswith('win'):
         # always rebuild before bdist, because linking may be wrong:
         self.run_command('clean')
         copy_and_patch_libzmq(ZMQ, 'libzmq'+lib_ext)
     build.run(self)
Exemplo n.º 4
0
    def run(self):
        cfg = self.config

        if cfg['libzmq_extension']:
            self.bundle_libzmq_extension()
            self.finish_run()
            return

        # When cross-compiling and zmq is given explicitly, we can't testbuild
        # (as we can't testrun the binary), we assume things are alright.
        if cfg['skip_check_zmq'] or self.cross_compiling:
            warn("Skipping zmq version check")
            self.finish_run()
            return

        zmq_prefix = cfg['zmq_prefix']
        # There is no available default on Windows, so start with fallback unless
        # zmq was given explicitly, or libzmq extension was explicitly prohibited.
        if (sys.platform.startswith("win") and not cfg['no_libzmq_extension']
                and not zmq_prefix):
            self.fallback_on_bundled()
            self.finish_run()
            return

        if (zmq_prefix and self.bundle_libzmq_dylib
                and not sys.platform.startswith('win')):
            copy_and_patch_libzmq(zmq_prefix, libzmq_name + lib_ext)

        # first try with given config or defaults
        try:
            self.check_zmq_version()
        except LibZMQVersionError as e:
            info("\nBad libzmq version: %s\n" % e)
        except Exception as e:
            # print the error as distutils would if we let it raise:
            info("\nerror: %s\n" % e)
        else:
            self.finish_run()
            return

        # try fallback on /usr/local on *ix if no prefix is given
        if not zmq_prefix and not sys.platform.startswith('win'):
            info("Failed with default libzmq, trying again with /usr/local")
            time.sleep(1)
            zmq_prefix = cfg['zmq_prefix'] = '/usr/local'
            self.init_settings_from_config()
            try:
                self.check_zmq_version()
            except LibZMQVersionError as e:
                info("\nBad libzmq version: %s\n" % e)
            except Exception as e:
                # print the error as distutils would if we let it raise:
                info("\nerror: %s\n" % e)
            else:
                # if we get here the second run succeeded, so we need to update compiler
                # settings for the extensions with /usr/local prefix
                self.finish_run()
                return

        # finally, fallback on bundled

        if cfg['no_libzmq_extension']:
            fatal(
                "Falling back on bundled libzmq,"
                " but config has explicitly prohibited building the libzmq extension."
            )

        self.fallback_on_bundled()

        self.finish_run()
Exemplo n.º 5
0
 def run(self):
     if bundle_libzmq_dylib and not sys.platform.startswith('win'):
         copy_and_patch_libzmq(CONFIG['zmq_prefix'], 'libzmq'+lib_ext)
     build.run(self)