From c9921271d6355fbbfc614f1c20e768c81f1bf63b Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 12 Nov 2015 02:57:51 +0100 Subject: [PATCH 1/4] Fix recursion in inline function in LFrustum --- panda/src/mathutil/frustum_src.I | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/panda/src/mathutil/frustum_src.I b/panda/src/mathutil/frustum_src.I index be0bf11aee..ce1e72eebc 100644 --- a/panda/src/mathutil/frustum_src.I +++ b/panda/src/mathutil/frustum_src.I @@ -203,16 +203,20 @@ get_perspective_projection_mat(CoordinateSystem cs) const { case CS_yup_right: return FLOATNAME(LMatrix4)( a, 0.0f, 0.0f, 0.0f, 0.0f, e, 0.0f, 0.0f, - d, b, -c,-1.0f, + d, b, -c, -1.0f, 0.0f, 0.0f, f, 0.0f); case CS_zup_left: - return FLOATNAME(LMatrix4)::convert_mat(CS_zup_right, CS_zup_left) * - get_perspective_projection_mat(CS_zup_right); + return FLOATNAME(LMatrix4)( a, 0.0f, 0.0f, 0.0f, + 0.0f, b, -c, -1.0f, + d, e, 0.0f, 0.0f, + 0.0f, 0.0f, f, 0.0f); case CS_yup_left: - return FLOATNAME(LMatrix4)::convert_mat(CS_yup_right, CS_yup_left) * - get_perspective_projection_mat(CS_yup_right); + return FLOATNAME(LMatrix4)( a, 0.0f, 0.0f, 0.0f, + 0.0f, e, 0.0f, 0.0f, + -d, -b, c, 1.0f, + 0.0f, 0.0f, f, 0.0f); default: mathutil_cat.error() @@ -251,8 +255,10 @@ get_ortho_projection_mat(CoordinateSystem cs) const { */ switch (cs) { case CS_zup_right: - return FLOATNAME(LMatrix4)::convert_mat(CS_yup_right, CS_zup_right) * - get_ortho_projection_mat(CS_yup_right); + return FLOATNAME(LMatrix4)( a, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, -c, 0.0f, + 0.0f, -b, 0.0f, 0.0f, + -d, -e, -f, 1.0f); case CS_yup_right: return FLOATNAME(LMatrix4)( a, 0.0f, 0.0f, 0.0f, @@ -261,12 +267,16 @@ get_ortho_projection_mat(CoordinateSystem cs) const { -d, -e, -f, 1.0f); case CS_zup_left: - return FLOATNAME(LMatrix4)::convert_mat(CS_zup_right, CS_zup_left) * - get_ortho_projection_mat(CS_zup_right); + return FLOATNAME(LMatrix4)( a, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, -c, 0.0f, + 0.0f, b, 0.0f, 0.0f, + -d, -e, -f, 1.0f); case CS_yup_left: - return FLOATNAME(LMatrix4)::convert_mat(CS_yup_right, CS_yup_left) * - get_ortho_projection_mat(CS_yup_right); + return FLOATNAME(LMatrix4)( a, 0.0f, 0.0f, 0.0f, + 0.0f, b, 0.0f, 0.0f, + 0.0f, 0.0f, c, 0.0f, + -d, -e, -f, 1.0f); default: mathutil_cat.error() From 0869266f1a336e23625123cb5695e1c3061a153b Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 13 Nov 2015 19:13:23 +0100 Subject: [PATCH 2/4] Fix base.config error in 1.9 --- direct/src/showbase/ShowBase.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index fb1fdd2b78..8ac8bd901d 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -63,15 +63,16 @@ def exitfunc(): # *seem* to cause anyone any problems. class ShowBase(DirectObject.DirectObject): + config = get_config_showbase() notify = directNotify.newCategory("ShowBase") def __init__(self, fStartDirect = True, windowType = None): - self.__dev__ = config.GetBool('want-dev', __debug__) + self.__dev__ = self.config.GetBool('want-dev', __debug__) builtins.__dev__ = self.__dev__ - logStackDump = (config.GetBool('log-stack-dump', False) or - config.GetBool('client-log-stack-dump', False)) - uploadStackDump = config.GetBool('upload-stack-dump', False) + logStackDump = (self.config.GetBool('log-stack-dump', False) or + self.config.GetBool('client-log-stack-dump', False)) + uploadStackDump = self.config.GetBool('upload-stack-dump', False) if logStackDump or uploadStackDump: ExceptionVarDump.install(logStackDump, uploadStackDump) @@ -88,8 +89,6 @@ class ShowBase(DirectObject.DirectObject): #debug running multiplier self.debugRunningMultiplier = 4 - # Get the dconfig object - self.config = config # Setup wantVerifyPdb as soon as reasonable: Verify.wantVerifyPdb = self.config.GetBool('want-verify-pdb', 0) From f9e61f82311e3c7e2b2859d4571156359bae88ce Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 13 Nov 2015 19:25:39 +0100 Subject: [PATCH 3/4] Fix OSX 10.11: use pkgbuild instead of PackageMaker, backport relocatability from master --- makepanda/makepanda.py | 74 ++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 28 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 3c6e1979f9..3ebe2321b1 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1591,12 +1591,13 @@ def CompileLink(dll, obj, opts): else: if (GetTarget() == "darwin"): cmd = cxx + ' -undefined dynamic_lookup' - if ("BUNDLE" in opts): cmd += ' -bundle ' + if ("BUNDLE" in opts): + cmd += ' -bundle ' else: if GetOrigExt(dll) == ".pyd": install_name = '@loader_path/../panda3d/' + os.path.basename(dll) else: - install_name = os.path.basename(dll) + install_name = '@loader_path/../lib/' + os.path.basename(dll) cmd += ' -dynamiclib -install_name ' + install_name cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp' @@ -2625,6 +2626,12 @@ ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc) tp_dir = GetThirdpartyDir() if tp_dir is not None: + dylibs = set() + + if GetTarget() == 'darwin': + for lib in glob.glob(tp_dir + "/*/lib/*.dylib"): + dylibs.add(os.path.basename(lib)) + for pkg in PkgListGet(): if PkgSkip(pkg): continue @@ -2644,12 +2651,36 @@ if tp_dir is not None: CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib) if GetTarget() == 'darwin': - for tp_lib in glob.glob(tp_pkg + "/lib/*.dylib"): - CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib) + tp_libs = glob.glob(tp_pkg + "/lib/*.dylib") if not PkgSkip("PYTHON"): - for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.dylib")): - CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib) + tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.dylib")) + + for tp_lib in tp_libs: + basename = os.path.basename(tp_lib) + target = GetOutputDir() + "/lib/" + basename + if not NeedsBuild([target], [tp_lib]): + continue + + CopyFile(target, tp_lib) + if os.path.islink(target): + continue + + # Correct the inter-library dependencies so that the build is relocatable. + oscmd('install_name_tool -id @loader_path/../lib/%s %s' % (basename, target)) + oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True) + + for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"): + line = line.strip() + if not line or line.startswith('@loader_path/../lib/') or line.endswith(":"): + continue + + libdep = line.split(" ", 1)[0] + dep_basename = os.path.basename(libdep) + if dep_basename in dylibs: + oscmd("install_name_tool -change %s @loader_path/../lib/%s %s" % (libdep, dep_basename, target), True) + + JustBuilt([target], [tp_lib]) for fwx in glob.glob(tp_pkg + "/*.framework"): CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx) @@ -6662,16 +6693,6 @@ def MakeInstallerOSX(): # On OSX, just specifying -P is not enough to do that. oscmd("cp -R -P " + GetOutputDir() + "/" + base + " " + libname) - # Execute install_name_tool to make them reference an absolute path - if (libname.endswith(".dylib") or libname.endswith(".so")) and not os.path.islink(libname): - oscmd("install_name_tool -id /Developer/Panda3D/%s %s" % (base, libname), True) - oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (libname, GetOutputDir()), True) - for line in open(GetOutputDir()+"/tmp/otool-libs.txt", "r"): - if len(line.strip()) > 0 and not line.strip().endswith(":"): - libdep = line.strip().split(" ", 1)[0] - if 'lib/' + os.path.basename(libdep) in install_libs: - oscmd("install_name_tool -change %s /Developer/Panda3D/lib/%s %s" % (libdep, os.path.basename(libdep), libname), True) - oscmd("mkdir -p dstroot/tools/Developer/Tools/Panda3D") oscmd("mkdir -p dstroot/tools/Developer/Panda3D") oscmd("mkdir -p dstroot/tools/etc/paths.d") @@ -6686,15 +6707,6 @@ def MakeInstallerOSX(): # OSX needs the -R argument to copy symbolic links correctly, it doesn't have -d. How weird. oscmd("cp -R " + GetOutputDir() + "/bin/" + base + " " + binname) - # Execute install_name_tool to make the binaries reference an absolute path - if (not os.path.islink(binname)): - oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (binname, GetOutputDir()), True) - for line in open(GetOutputDir()+"/tmp/otool-libs.txt", "r"): - if len(line.strip()) > 0 and not line.strip().endswith(":"): - libdep = line.strip().split(" ", 1)[0] - if 'lib/' + os.path.basename(libdep) in install_libs: - oscmd("install_name_tool -change %s /Developer/Panda3D/lib/%s %s" % (libdep, os.path.basename(libdep), binname), True) - if PkgSkip("PYTHON")==0: PV = SDK["PYTHONVERSION"].replace("python", "") oscmd("mkdir -p dstroot/pythoncode/usr/local/bin") @@ -6733,8 +6745,9 @@ def MakeInstallerOSX(): if PkgSkip("PYTHON")==0: pkgs.append("pythoncode") if os.path.isdir("samples"): pkgs.append("samples") for pkg in pkgs: + identifier = "org.panda3d.panda3d.%s.pkg" % pkg plist = open("/tmp/Info_plist", "w") - plist.write(Info_plist % { "package_id" : "org.panda3d.panda3d.%s.pkg" % pkg, "version" : VERSION }) + plist.write(Info_plist % { "package_id" : identifier, "version" : VERSION }) plist.close() if not os.path.isdir("dstroot/" + pkg): os.makedirs("dstroot/" + pkg) @@ -6744,14 +6757,19 @@ def MakeInstallerOSX(): else: target = '' - if os.path.exists("/Developer/usr/bin/packagemaker"): + if os.path.exists("/usr/bin/pkgbuild"): + # This new package builder is used in Lion and above. + cmd = '/usr/bin/pkgbuild --identifier ' + identifier + ' --version ' + VERSION + ' --root dstroot/' + pkg + '/ dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg' + + # In older versions, we use PackageMaker. Apple keeps changing its location. + elif os.path.exists("/Developer/usr/bin/packagemaker"): cmd = '/Developer/usr/bin/packagemaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg ' + target + ' --domain system --root dstroot/' + pkg + '/ --no-relocate' elif os.path.exists("/Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"): cmd = '/Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg ' + target + ' --domain system --root dstroot/' + pkg + '/ --no-relocate' elif os.path.exists("/Developer/Tools/packagemaker"): cmd = '/Developer/Tools/packagemaker -build -f dstroot/' + pkg + '/ -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg -i /tmp/Info_plist' else: - exit("PackageMaker could not be found!") + exit("Neither pkgbuild nor PackageMaker could be found!") oscmd(cmd) if os.path.isfile("/tmp/Info_plist"): From 68298559d5dc597a6c1a3c8e758233e00cc662f1 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 13 Nov 2015 19:26:09 +0100 Subject: [PATCH 4/4] Update readme in 1.9 --- README.md | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 615074193e..a4bd9f39d5 100644 --- a/README.md +++ b/README.md @@ -81,20 +81,23 @@ sudo apt-get install build-essential pkg-config python-dev libpng-dev libjpeg-de ``` Once Panda3D has built, you can either install the .deb or .rpm package that -it produced (if relevant to your platform, and you added --installer). On -other systems, you will need to use the installpanda script to install it onto -your system. Careful: it is not easy to uninstall Panda3D in this way! +it produced, depending on which Linux distribution you are using. For example, +to install the package on Debian or Ubuntu, use this: ```bash -python2.7 makepanda/installpanda.py --prefix=/usr/local +sudo dpkg -i panda3d*.deb ``` +If you are not using a Linux distribution that supports .deb or .rpm packages, you +may have to use the installpanda.py script instead, which will directly copy the +files into the appropriate locations on your computer. You may have to run the +`ldconfig` tool in order to update your library cache after installing Panda3D. + Mac OS X -------- -On Mac OS X, all you need to compile Panda3D is a set of precompiled -thirdparty packages, which can be acquired from here: -https://www.panda3d.org/download/panda3d-1.9.0/panda3d-1.9.0-tools-mac.tar.gz +On Mac OS X, you will need to download a set of precompiled thirdparty packages in order to +compile Panda3D, which can be acquired from [here](https://www.panda3d.org/download/panda3d-1.9.0/panda3d-1.9.0-tools-mac.tar.gz). After placing the thirdparty directory inside the panda3d source directory, you may build Panda3D using a command like the following: @@ -110,3 +113,20 @@ by the release number, eg. 10.6 or 10.7. If the build was successful, makepanda will have generated a .dmg file in the source directory containing the installer. Simply open it and run the package file in order to install the SDK onto your system. + +Reporting Issues +================ + +If you encounter any bugs when using Panda3D, please report them in the bug +tracker. This is hosted at: + + https://bugs.launchpad.net/panda3d + +Make sure to first use the search function to see if the bug has already been +reported. When filling out a bug report, make sure that you include as much +information as possible to help the developers track down the issue, such as +your version of Panda3D, operating system, architecture, and any code and +models that are necessary for the developers to reproduce the issue. + +If you're not sure whether you've encountered a bug, feel free to ask about +it in the forums or the IRC channel first.