Browse Source

support packp3d -p

David Rose 16 years ago
parent
commit
87b54a32b6
3 changed files with 15 additions and 4 deletions
  1. 1 1
      direct/src/p3d/Packager.py
  2. 12 2
      direct/src/p3d/packp3d.py
  3. 2 1
      direct/src/p3d/ppackage.py

+ 1 - 1
direct/src/p3d/Packager.py

@@ -910,7 +910,7 @@ class Packager:
                     continue
                     continue
 
 
                 tempFile = Filename.temporary('', 'p3d_', '.txt')
                 tempFile = Filename.temporary('', 'p3d_', '.txt')
-                command = 'otool -L "%s" >"%s"' % (
+                command = '/usr/bin/otool -L "%s" >"%s"' % (
                     file.filename.toOsSpecific(),
                     file.filename.toOsSpecific(),
                     tempFile.toOsSpecific())
                     tempFile.toOsSpecific())
                 try:
                 try:

+ 12 - 2
direct/src/p3d/packp3d.py

@@ -54,6 +54,13 @@ Options:
      instead of -e for files that are uncompressible by their nature
      instead of -e for files that are uncompressible by their nature
      (e.g. mpg files).  This option may be repeated as necessary.
      (e.g. mpg files).  This option may be repeated as necessary.
 
 
+  -p python_lib_dir
+     Adds a directory to search for additional Python modules.  You
+     can use this to add your system's Python path, to allow packp3d
+     to find any system modules not included in the standard Panda3D
+     release, but your version of Python must match this one (%s).
+     This option may be repeated to add multiple directories.
+
   -c config=value
   -c config=value
      Sets the indicated config flag in the application.  This option
      Sets the indicated config flag in the application.  This option
      may be repeated as necessary.
      may be repeated as necessary.
@@ -93,7 +100,7 @@ class ArgumentError(StandardError):
     pass
     pass
 
 
 def makePackedApp(args):
 def makePackedApp(args):
-    opts, args = getopt.getopt(args, 'o:d:m:S:e:n:c:r:s:Dh')
+    opts, args = getopt.getopt(args, 'o:d:m:S:e:n:p:c:r:s:Dh')
 
 
     packager = Packager.Packager()
     packager = Packager.Packager()
 
 
@@ -121,6 +128,8 @@ def makePackedApp(args):
             packager.binaryExtensions.append(value)
             packager.binaryExtensions.append(value)
         elif option == '-n':
         elif option == '-n':
             packager.uncompressibleExtensions.append(value)
             packager.uncompressibleExtensions.append(value)
+        elif option == '-p':
+            sys.path.append(value)
         elif option == '-c':
         elif option == '-c':
             configFlags.append(value.split('=', 1))
             configFlags.append(value.split('=', 1))
         elif option == '-r':
         elif option == '-r':
@@ -134,7 +143,8 @@ def makePackedApp(args):
         elif option == '-D':
         elif option == '-D':
             allowPythonDev = True
             allowPythonDev = True
         elif option == '-h':
         elif option == '-h':
-            print usageText % (os.path.split(sys.argv[0])[1])
+            print usageText % (os.path.split(sys.argv[0])[1],
+                               '%s.%s' % (sys.version_info[0], sys.version_info[1]))
             sys.exit(1)
             sys.exit(1)
 
 
     if not appFilename:
     if not appFilename:

+ 2 - 1
direct/src/p3d/ppackage.py

@@ -141,7 +141,8 @@ if len(args) > 1:
     packageNames = args[1:]
     packageNames = args[1:]
 
 
 if not packager.installDir:
 if not packager.installDir:
-    packager.installDir = Filename('install')
+    print '\nYou must name the target install directory with the -i parameter.\n'
+    sys.exit(1)
 packager.installSearch.prependDirectory(packager.installDir)
 packager.installSearch.prependDirectory(packager.installDir)
 
 
 try:
 try: