Merge remote-tracking branch 'origin/release/1.9.x'

Conflicts:
	direct/src/showutil/FreezeTool.py
This commit is contained in:
rdb 2015-08-10 04:02:53 +02:00
commit 63c65b4228
9 changed files with 59 additions and 18 deletions

View File

@ -16,6 +16,7 @@ import types
import getpass
import struct
import subprocess
import copy
from direct.p3d.FileSpec import FileSpec
from direct.p3d.SeqValue import SeqValue
from direct.showbase import Loader
@ -839,6 +840,14 @@ class Packager:
self.packager.contents[pe.getKey()] = pe
self.packager.contentsChanged = True
# Hack for coreapi package, to preserve backward compatibility
# with old versions of the runtime, which still called the
# 32-bit Windows platform "win32".
if self.packageName == "coreapi" and self.platform == "win_i386":
pe2 = copy.copy(pe)
pe2.platform = "win32"
self.packager.contents[pe2.getKey()] = pe2
self.cleanup()
return True
@ -1832,7 +1841,10 @@ class Packager:
self.notify.warning(message)
return
self.freezer.addModule(moduleName, filename = file.filename)
if file.text:
self.freezer.addModule(moduleName, filename = file.filename, text = file.text)
else:
self.freezer.addModule(moduleName, filename = file.filename)
def addEggFile(self, file):
# Precompile egg files to bam's.

View File

@ -362,8 +362,16 @@ class rocket(package):
config(display_name = "Panda3D libRocket support")
require('panda3d')
module('panda3d.rocket', required = True)
module('_rocketcore', '_rocketcontrols')
file('rocket.py', extract = True, text = """
from _rocketcore import *
try:
from _rocketcontrols import *
except ImportError:
pass
""")
module('panda3d.rocket', '_rocketcore', required = True)
module('_rocketcontrols')
file('libp3rocket.dll', required = True)
class vrpn(package):

View File

@ -258,9 +258,17 @@ initialize(int api_version, const string &contents_filename,
// TODO: Linux multiplatform support. Just add the
// appropriate platform strings to _supported_platforms.
} else {
nout << "Platform string was set by plugin to " << _platform << "\n";
}
if (_supported_platforms.empty()) {
// Hack for older plug-ins, which should still remain compatible with
// newer versions of the runtime distribution.
if (_platform == "win32") {
_supported_platforms.push_back("win_i386");
}
// We always support at least the specific platform on which we're
// running.
_supported_platforms.push_back(_platform);

View File

@ -681,10 +681,13 @@ subprocess_run() {
}
}
if (input_ready) {
while (input_ready) {
// Empty the pipe of whatever is in it.
receive_command();
input_ready = _pipe_read.has_gdata();
}
// Sleep a good amount in order not to lock up the system.
struct timespec req;
req.tv_sec = 0;
req.tv_nsec = 50000000; // 50 ms

View File

@ -76,8 +76,7 @@ class VFSImporter:
if desc[2] != imp.C_EXTENSION:
continue
filename = Filename(path)
filename.setExtension(desc[0][1:])
filename = Filename(path + desc[0])
vfile = vfs.getFile(filename, True)
if vfile:
return VFSLoader(dir_path, vfile, filename, FTExtensionModule,

View File

@ -8,6 +8,7 @@ import marshal
import imp
import platform
import types
from StringIO import StringIO
from distutils.sysconfig import PREFIX, get_python_inc, get_python_version, get_config_var
# Temporary (?) try..except to protect against unbuilt p3extend_frozen.
@ -497,7 +498,8 @@ class Freezer:
def __init__(self, moduleName, filename = None,
implicit = False, guess = False,
exclude = False, forbid = False,
allowChildren = False, fromSource = None):
allowChildren = False, fromSource = None,
text = None):
# The Python module name.
self.moduleName = moduleName
@ -532,6 +534,9 @@ class Freezer:
# record came from, supplied by the caller.
self.fromSource = fromSource
# If this is set, it contains Python code of the module.
self.text = text
# Some sanity checks.
if not self.exclude:
self.allowChildren = True
@ -748,7 +753,8 @@ class Freezer:
return modules
def addModule(self, moduleName, implicit = False, newName = None,
filename = None, guess = False, fromSource = None):
filename = None, guess = False, fromSource = None,
text = None):
""" Adds a module to the list of modules to be exported by
this tool. If implicit is true, it is OK if the module does
not actually exist.
@ -804,7 +810,7 @@ class Freezer:
# It's actually a regular module.
self.modules[newParentName] = self.ModuleDef(
parentName, implicit = implicit, guess = guess,
fromSource = fromSource)
fromSource = fromSource, text = text)
else:
# Now get all the py files in the parent directory.
@ -819,7 +825,7 @@ class Freezer:
# A normal, explicit module name.
self.modules[newName] = self.ModuleDef(
moduleName, filename = filename, implicit = implicit,
guess = guess, fromSource = fromSource)
guess = guess, fromSource = fromSource, text = text)
def done(self, compileToExe = False):
""" Call this method after you have added all modules with
@ -970,7 +976,10 @@ class Freezer:
stuff = ("", "rb", imp.PY_COMPILED)
self.mf.load_module(mdef.moduleName, fp, pathname, stuff)
else:
fp = open(pathname, 'U')
if mdef.text:
fp = StringIO(mdef.text)
else:
fp = open(pathname, 'U')
stuff = ("", "r", imp.PY_SOURCE)
self.mf.load_module(mdef.moduleName, fp, pathname, stuff)

View File

@ -455,9 +455,8 @@ SdkAutoDisableMax()
SdkAutoDisablePhysX()
SdkAutoDisableSpeedTree()
if (RTDIST and DISTRIBUTOR == "cmu"):
HOST_URL = "https://runtime.panda3d.org/"
if RTDIST and DISTRIBUTOR == "cmu":
# Some validation checks for the CMU builds.
if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
@ -465,7 +464,7 @@ if (RTDIST and DISTRIBUTOR == "cmu"):
elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
elif RTDIST and not HOST_URL:
if RTDIST and not HOST_URL:
exit("You must specify a host URL when building the rtdist!")
if RUNTIME and not HOST_URL:

View File

@ -34,6 +34,8 @@ TypeHandle RocketInputHandler::_type_handle;
RocketInputHandler::
RocketInputHandler(const string &name) :
DataNode(name),
_mouse_xy(-1),
_mouse_xy_changed(false),
_modifiers(0),
_wheel_delta(0)
{

View File

@ -27,7 +27,7 @@
#include "configVariableBool.h"
#include "panda_getopt_long.h"
#include "preprocess_argv.h"
#include "pandaVersion.h"
#include "pandaSystem.h"
#include <stdlib.h>
#include <algorithm>
@ -222,7 +222,8 @@ write_man_page(ostream &out) {
}
}
out << " 1 \"" << date_str << "\" \"" PANDA_VERSION_STR "\" Panda3D\n";
out << " 1 \"" << date_str << "\" \""
<< PandaSystem::get_version_string() << "\" Panda3D\n";
out << ".SH NAME\n";
if (_brief.empty()) {