mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 23:34:57 -04:00
Merge branch 'release/1.10.x'
This commit is contained in:
commit
81b33a7afa
37
direct/src/dist/FreezeTool.py
vendored
37
direct/src/dist/FreezeTool.py
vendored
@ -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
|
||||
|
||||
|
27
direct/src/dist/commands.py
vendored
27
direct/src/dist/commands.py
vendored
@ -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)
|
||||
|
||||
|
@ -610,6 +610,10 @@ def MakeInstallerOSX(version, python_versions=[], installdir=None, **kwargs):
|
||||
dist.write(' </allowed-os-versions>\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(' <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(' function isPythonVersionInstalled(version) {\n')
|
||||
dist.write(' return system.files.fileExistsAtPath("/usr/bin/python" + version)\n')
|
||||
|
@ -69,6 +69,18 @@ static const struct DeviceMapping {
|
||||
{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}
|
||||
},
|
||||
// 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},
|
||||
};
|
||||
|
||||
|
@ -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.
|
||||
*/
|
||||
@ -88,6 +69,19 @@ static inline void get_cpuid(uint32_t leaf, cpuid_info &info) {
|
||||
: "0" (leaf));
|
||||
#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
|
||||
|
||||
#ifdef IS_LINUX
|
||||
|
Loading…
x
Reference in New Issue
Block a user