Merge branch 'release/1.10.x'

This commit is contained in:
rdb 2020-01-06 21:06:57 +01:00
commit 81b33a7afa
5 changed files with 75 additions and 37 deletions

View File

@ -11,6 +11,7 @@ import struct
import io import io
import distutils.sysconfig as sysconf import distutils.sysconfig as sysconf
import zipfile import zipfile
import importlib
from . import pefile from . import pefile
@ -2349,12 +2350,36 @@ class PandaModuleFinder(modulefinder.ModuleFinder):
code += b'\n' if isinstance(code, bytes) else '\n' code += b'\n' if isinstance(code, bytes) else '\n'
co = compile(code, pathname, 'exec') co = compile(code, pathname, 'exec')
elif type == imp.PY_COMPILED: elif type == imp.PY_COMPILED:
try: if sys.version_info >= (3, 7):
marshal_data = importlib._bootstrap_external._validate_bytecode_header(fp.read()) try:
except ImportError as exc: data = fp.read()
self.msgout(2, "raise ImportError: " + str(exc), pathname) importlib._bootstrap_external._classify_pyc(data, fqname, {})
raise except ImportError as exc:
co = marshal.loads(marshal_data) 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: else:
co = None co = None

View File

@ -112,6 +112,7 @@ PACKAGE_DATA_DIRS = {
('cefpython3/subprocess*', '', {'PKG_DATA_MAKE_EXECUTABLE'}), ('cefpython3/subprocess*', '', {'PKG_DATA_MAKE_EXECUTABLE'}),
('cefpython3/locals/*', 'locals', {}), ('cefpython3/locals/*', 'locals', {}),
('cefpython3/Chromium Embedded Framework.framework/Resources', 'Chromium Embedded Framework.framework/Resources', {}), ('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) whlfile = self._get_zip_file(whl)
filenames = whlfile.namelist() filenames = whlfile.namelist()
for source_pattern, target_dir, flags in datadesc: 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) source_dir = os.path.dirname(source_pattern)
# Relocate the target dir to the build directory. # Relocate the target dir to the build directory.
target_dir = target_dir.replace('/', os.sep) target_dir = target_dir.replace('/', os.sep)
@ -1178,18 +1179,20 @@ class build_apps(setuptools.Command):
dylib = dylib.replace('@loader_path/../Frameworks/', '') dylib = dylib.replace('@loader_path/../Frameworks/', '')
elif dylib.startswith('@executable_path/../Frameworks/'): elif dylib.startswith('@executable_path/../Frameworks/'):
dylib = dylib.replace('@executable_path/../Frameworks/', '') dylib = dylib.replace('@executable_path/../Frameworks/', '')
elif dylib.startswith('@loader_path/'): else:
dylib = dylib.replace('@loader_path/', '') for prefix in ('@loader_path/', '@rpath/'):
if dylib.startswith(prefix):
dylib = dylib.replace(prefix, '')
# Do we need to flatten the relative reference? # Do we need to flatten the relative reference?
if '/' in dylib and flatten: if '/' in dylib and flatten:
new_dylib = '@loader_path/' + os.path.basename(dylib) new_dylib = prefix + os.path.basename(dylib)
str_size = len(cmd_data) - 16 str_size = len(cmd_data) - 16
if len(new_dylib) < str_size: if len(new_dylib) < str_size:
fp.seek(-str_size, os.SEEK_CUR) fp.seek(-str_size, os.SEEK_CUR)
fp.write(new_dylib.encode('ascii').ljust(str_size, b'\0')) fp.write(new_dylib.encode('ascii').ljust(str_size, b'\0'))
else: else:
self.warn('Unable to rewrite dependency {}'.format(orig)) self.warn('Unable to rewrite dependency {}'.format(orig))
load_dylibs.append(dylib) load_dylibs.append(dylib)

View File

@ -610,6 +610,10 @@ def MakeInstallerOSX(version, python_versions=[], installdir=None, **kwargs):
dist.write(' </allowed-os-versions>\n') dist.write(' </allowed-os-versions>\n')
dist.write(' <options customize="always" allow-external-scripts="no" rootVolumeOnly="false" hostArchitectures="x86_64"/>\n') dist.write(' <options customize="always" allow-external-scripts="no" rootVolumeOnly="false" hostArchitectures="x86_64"/>\n')
dist.write(' <license language="en" mime-type="text/plain">%s</license>\n' % ReadFile("doc/LICENSE")) dist.write(' <license language="en" mime-type="text/plain">%s</license>\n' % ReadFile("doc/LICENSE"))
dist.write(' <readme language="en" mime-type="text/plain">')
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(' </readme>')
dist.write(' <script>\n') dist.write(' <script>\n')
dist.write(' function isPythonVersionInstalled(version) {\n') dist.write(' function isPythonVersionInstalled(version) {\n')
dist.write(' return system.files.fileExistsAtPath("/usr/bin/python" + version)\n') dist.write(' return system.files.fileExistsAtPath("/usr/bin/python" + version)\n')

View File

@ -69,6 +69,18 @@ static const struct DeviceMapping {
{0x0955, 0x7214, InputDevice::DeviceClass::gamepad, 0, {0x0955, 0x7214, InputDevice::DeviceClass::gamepad, 0,
{"face_a", "face_b", 0, "face_x", "face_y", "rshoulder", "lshoulder", "rshoulder", 0, 0, 0, "start", 0, "lstick", "rstick", 0} {"face_a", "face_b", 0, "face_x", "face_y", "rshoulder", "lshoulder", "rshoulder", 0, 0, 0, "start", 0, "lstick", "rstick", 0}
}, },
// Dualshock (PS4)
{0x054c, 0x05c4, InputDevice::DeviceClass::gamepad, 0,
{"face_x", "face_a", "face_b", "face_y", "lshoulder", "rshoulder", "ltrigger", "rtrigger", "back", "start", "lstick", "rstick", "guide", 0}
},
// Dualshock 2nd Gen (PS4 Slim)
{0x054c, 0x09cc, InputDevice::DeviceClass::gamepad, 0,
{"face_x", "face_a", "face_b", "face_y", "lshoulder", "rshoulder", "ltrigger", "rtrigger", "back", "start", "lstick", "rstick", "guide", 0}
},
// Dualshock 2nd Gen (PS4 wireless adapter)
{0x054c, 0x0ba0, InputDevice::DeviceClass::gamepad, 0,
{"face_x", "face_a", "face_b", "face_y", "lshoulder", "rshoulder", "ltrigger", "rtrigger", "back", "start", "lstick", "rstick", "guide", 0}
},
{0}, {0},
}; };

View File

@ -55,25 +55,6 @@ union cpuid_info {
}; };
}; };
/**
* Returns the highest cpuid leaf that is supported by the CPU.
*/
static inline uint32_t get_cpuid_max(uint32_t leaf) {
#if defined(__GNUC__) && !defined(__APPLE__)
return __get_cpuid_max(leaf, nullptr);
#elif defined(_MSC_VER)
uint32_t p[4] = {0};
__cpuid((int *)p, leaf);
return p[0];
#else
unsigned int eax = 0;
__asm__ ("cpuid\n\t"
: "=a" (eax)
: "0" (leaf));
return eax;
#endif
}
/** /**
* Gets cpuid info for the given leaf. * Gets cpuid info for the given leaf.
*/ */
@ -88,6 +69,19 @@ static inline void get_cpuid(uint32_t leaf, cpuid_info &info) {
: "0" (leaf)); : "0" (leaf));
#endif #endif
} }
/**
* Returns the highest cpuid leaf that is supported by the CPU.
*/
static inline uint32_t get_cpuid_max(uint32_t leaf) {
#if defined(__GNUC__) && !defined(__APPLE__)
return __get_cpuid_max(leaf, nullptr);
#else
cpuid_info info;
get_cpuid(leaf, info);
return info.eax;
#endif
}
#endif #endif
#ifdef IS_LINUX #ifdef IS_LINUX