diff --git a/direct/src/dist/FreezeTool.py b/direct/src/dist/FreezeTool.py index 5d12a2fb5c..f7b2ea9b91 100644 --- a/direct/src/dist/FreezeTool.py +++ b/direct/src/dist/FreezeTool.py @@ -11,6 +11,7 @@ import struct import io import distutils.sysconfig as sysconf import zipfile +import importlib from . import pefile @@ -2349,12 +2350,36 @@ class PandaModuleFinder(modulefinder.ModuleFinder): code += b'\n' if isinstance(code, bytes) else '\n' co = compile(code, pathname, 'exec') elif type == imp.PY_COMPILED: - try: - marshal_data = importlib._bootstrap_external._validate_bytecode_header(fp.read()) - except ImportError as exc: - self.msgout(2, "raise ImportError: " + str(exc), pathname) - raise - co = marshal.loads(marshal_data) + if sys.version_info >= (3, 7): + try: + data = fp.read() + importlib._bootstrap_external._classify_pyc(data, fqname, {}) + except ImportError as exc: + self.msgout(2, "raise ImportError: " + str(exc), pathname) + raise + + co = marshal.loads(memoryview(data)[16:]) + elif sys.version_info >= (3, 4): + try: + if sys.version_info >= (3, 5): + marshal_data = importlib._bootstrap_external._validate_bytecode_header(fp.read()) + else: + marshal_data = importlib._bootstrap._validate_bytecode_header(fp.read()) + except ImportError as exc: + self.msgout(2, "raise ImportError: " + str(exc), pathname) + raise + + co = marshal.loads(marshal_data) + else: + if fp.read(4) != imp.get_magic(): + self.msgout(2, "raise ImportError: Bad magic number", pathname) + raise ImportError("Bad magic number in %s" % pathname) + + fp.read(4) + if sys.version_info >= (3, 3): + fp.read(4) + + co = marshal.load(fp) else: co = None diff --git a/direct/src/dist/commands.py b/direct/src/dist/commands.py index b1d8422836..9dfdfbd200 100644 --- a/direct/src/dist/commands.py +++ b/direct/src/dist/commands.py @@ -112,6 +112,7 @@ PACKAGE_DATA_DIRS = { ('cefpython3/subprocess*', '', {'PKG_DATA_MAKE_EXECUTABLE'}), ('cefpython3/locals/*', 'locals', {}), ('cefpython3/Chromium Embedded Framework.framework/Resources', 'Chromium Embedded Framework.framework/Resources', {}), + ('cefpython3/Chromium Embedded Framework.framework/Chromium Embedded Framework', '', {'PKG_DATA_MAKE_EXECUTABLE'}), ], } @@ -831,7 +832,7 @@ class build_apps(setuptools.Command): whlfile = self._get_zip_file(whl) filenames = whlfile.namelist() for source_pattern, target_dir, flags in datadesc: - srcglob = p3d.GlobPattern(source_pattern) + srcglob = p3d.GlobPattern(source_pattern.lower()) source_dir = os.path.dirname(source_pattern) # Relocate the target dir to the build directory. target_dir = target_dir.replace('/', os.sep) @@ -1178,18 +1179,20 @@ class build_apps(setuptools.Command): dylib = dylib.replace('@loader_path/../Frameworks/', '') elif dylib.startswith('@executable_path/../Frameworks/'): dylib = dylib.replace('@executable_path/../Frameworks/', '') - elif dylib.startswith('@loader_path/'): - dylib = dylib.replace('@loader_path/', '') + else: + for prefix in ('@loader_path/', '@rpath/'): + if dylib.startswith(prefix): + dylib = dylib.replace(prefix, '') - # Do we need to flatten the relative reference? - if '/' in dylib and flatten: - new_dylib = '@loader_path/' + os.path.basename(dylib) - str_size = len(cmd_data) - 16 - if len(new_dylib) < str_size: - fp.seek(-str_size, os.SEEK_CUR) - fp.write(new_dylib.encode('ascii').ljust(str_size, b'\0')) - else: - self.warn('Unable to rewrite dependency {}'.format(orig)) + # Do we need to flatten the relative reference? + if '/' in dylib and flatten: + new_dylib = prefix + os.path.basename(dylib) + str_size = len(cmd_data) - 16 + if len(new_dylib) < str_size: + fp.seek(-str_size, os.SEEK_CUR) + fp.write(new_dylib.encode('ascii').ljust(str_size, b'\0')) + else: + self.warn('Unable to rewrite dependency {}'.format(orig)) load_dylibs.append(dylib) diff --git a/makepanda/makepackage.py b/makepanda/makepackage.py index 9729f0e3f3..c725317d1e 100755 --- a/makepanda/makepackage.py +++ b/makepanda/makepackage.py @@ -610,6 +610,10 @@ def MakeInstallerOSX(version, python_versions=[], installdir=None, **kwargs): dist.write(' \n') dist.write(' \n') dist.write(' %s\n' % ReadFile("doc/LICENSE")) + dist.write(' ') + dist.write('WARNING: From Panda3D version 1.10.5 onwards, the default installation has been changed from /Developer/Panda3D to /Library/Developer/Panda3D\n') + dist.write('This installation script will remove any existing installation in /Developer and if possible create a symbolic link towards /Library/Developer/Panda3D\n') + dist.write(' ') dist.write('