Browse Source

deploy-ng: Add plugins option to specify which plugins to copy

NOTE: pandagl is no longer automatically copied and a graphics plugin
must be specified.

TODO: Per-platform overrides
Mitchell Stokes 8 years ago
parent
commit
09eb22b61e
2 changed files with 7 additions and 1 deletions
  1. 4 1
      direct/src/showutil/dist.py
  2. 3 0
      samples/asteroids/setup.py

+ 4 - 1
direct/src/showutil/dist.py

@@ -34,6 +34,7 @@ class build_apps(distutils.core.Command):
         self.include_modules = {}
         self.exclude_modules = {}
         self.deploy_platforms = []
+        self.plugins = []
         self.requirements_path = './requirements.txt'
         self.pypi_extra_indexes = []
         self.build_scripts= {
@@ -186,8 +187,10 @@ class build_apps(distutils.core.Command):
                 freezer_extras.add((mod, None))
 
         #FIXME: this is a temporary hack to pick up libpandagl.
+        plugin_list = ['panda3d/lib{}'.format(i) for i in self.plugins]
         for lib in p3dwhl.namelist():
-            if lib.startswith('panda3d/libpandagl.'):
+            plugname = os.path.splitext(lib)[0]
+            if plugname in plugin_list:
                 source_path = os.path.join(p3dwhlfn, lib)
                 target_path = os.path.join(builddir, os.path.basename(lib))
                 search_path = [os.path.dirname(source_path)]

+ 3 - 0
samples/asteroids/setup.py

@@ -9,6 +9,9 @@ setup(
             'gui_apps': {
                 'asteroids': 'main.py',
             },
+            'plugins': [
+                'pandagl',
+            ],
             'deploy_platforms': [
                 'manylinux1_x86_64',
                 'macosx_10_6_x86_64',