def getClass(self, name, cls): if in_system_path(name): return ExcludedMachO for base in self.excludes: if name.startswith(base): return ExcludedMachO return cls
def match_func(pth): """For system libraries is still used absolute path. It is unchanged.""" # Match non system dynamic libraries. if not util.in_system_path(pth): # Use relative path to dependend dynamic libraries bases on # location of the executable. return os.path.join('@executable_path', os.path.basename(pth))
def search(self, libname): # First try global exclude list. If it matches then # return it's result otherwise continue with other check. result = self._exclude_list.search(libname) if result: return result else: return util.in_system_path(libname)
def _warn_if_activetcl_or_teapot_installed(tcl_root, tcltree): """ If the current Tcl installation is a Teapot-distributed version of ActiveTcl *and* the current platform is OS X, log a non-fatal warning that the resulting executable will (probably) fail to run on non-host systems. PyInstaller does *not* freeze all ActiveTcl dependencies -- including Teapot, which is typically ignorable. Since Teapot is *not* ignorable in this case, this function warns of impending failure. See Also ------- https://github.com/pyinstaller/pyinstaller/issues/621 """ from PyInstaller.lib.macholib import util # System libraries do not experience this problem. if util.in_system_path(tcl_root): return # Absolute path of the "init.tcl" script. try: init_resource = [r[1] for r in tcltree if r[1].endswith('init.tcl')][0] # If such script could not be found, silently return. except IndexError: return mentions_activetcl = False mentions_teapot = False with open(init_resource, 'r') as init_file: for line in init_file.readlines(): line = line.strip().lower() if line.startswith('#'): continue if 'activetcl' in line: mentions_activetcl = True if 'teapot' in line: mentions_teapot = True if mentions_activetcl and mentions_teapot: break if mentions_activetcl and mentions_teapot: logger.warning( """ You appear to be using an ActiveTcl build of Tcl/Tk, which PyInstaller has difficulty freezing. To fix this, comment out all references to "teapot" in: %s See https://github.com/pyinstaller/pyinstaller/issues/621 for more information. """ % init_resource)
def _warn_if_actvivetcl_or_teapot_install(tcl_root, tcltree): """ Workaround ActiveTcl on OS X PyInstaller does not package all requirements of ActiveTcl (most notably teapot, which is not typically required). This means packages built against ActiveTcl usually won't run on non-host systems. This method checks if ActiveTcl is being used, and if so logs a warning if the problematic code is not commented out. https://github.com/pyinstaller/pyinstaller/issues/621 """ from PyInstaller.lib.macholib import util if util.in_system_path(tcl_root): # system libraries do not experience this problem return # get the path to the 'init.tcl' script try: init_resource = [r[1] for r in tcltree if r[1].endswith('init.tcl')][0] except IndexError: # couldn't find the init script, return return mentions_activetcl = False mentions_teapot = False with open(init_resource, 'r') as init_file: for line in init_file.readlines(): line = line.strip().lower() if line.startswith('#'): continue if 'activetcl' in line: mentions_activetcl = True if 'teapot' in line: mentions_teapot = True if mentions_activetcl and mentions_teapot: break if mentions_activetcl and mentions_teapot: logger.warning("""It seems you are using an ActiveTcl build of Tcl/Tk.\ This may not package correctly with PyInstaller. To fix the problem, please try commenting out all mentions of 'teapot' in: %s See https://github.com/pyinstaller/pyinstaller/issues/621 for more information""" % init_resource)
def locate(self, filename): if in_system_path(filename): return filename if filename.startswith(self.base): return filename for base in self.excludes: if filename.startswith(base): return filename if filename in self.changemap: return self.changemap[filename] info = framework_info(filename) if info is None: res = self.copy_dylib(filename) self.changemap[filename] = res return res else: res = self.copy_framework(info) self.changemap[filename] = res return res
def search(self, libname): return util.in_system_path(libname)
def search(self, libname): if "/Tcl" in libname or "/Tk" in libname: return False return util.in_system_path(libname)