mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
deploy-ng: Expose default_prc_dir as a build_apps option
If not set, this defaults to '<auto>etc' if embed_prc_data is False or '' (no default PRC dir) if embed_prc_data is True.
This commit is contained in:
parent
164ef3fa4b
commit
b91cb655c3
@ -85,6 +85,7 @@ class build_apps(distutils.core.Command):
|
|||||||
self.embed_prc_data = True
|
self.embed_prc_data = True
|
||||||
self.extra_prc_files = []
|
self.extra_prc_files = []
|
||||||
self.extra_prc_data = ''
|
self.extra_prc_data = ''
|
||||||
|
self.default_prc_dir = None
|
||||||
self.requirements_path = './requirements.txt'
|
self.requirements_path = './requirements.txt'
|
||||||
self.pypi_extra_indexes = []
|
self.pypi_extra_indexes = []
|
||||||
self.file_handlers= {
|
self.file_handlers= {
|
||||||
@ -132,6 +133,9 @@ class build_apps(distutils.core.Command):
|
|||||||
self.plugins = _parse_list(self.plugins)
|
self.plugins = _parse_list(self.plugins)
|
||||||
self.extra_prc_files = _parse_list(self.extra_prc_files)
|
self.extra_prc_files = _parse_list(self.extra_prc_files)
|
||||||
|
|
||||||
|
if self.default_prc_dir is None:
|
||||||
|
self.default_prc_dir = '<auto>etc' if not self.embed_prc_data else ''
|
||||||
|
|
||||||
num_gui_apps = len(self.gui_apps)
|
num_gui_apps = len(self.gui_apps)
|
||||||
num_console_apps = len(self.console_apps)
|
num_console_apps = len(self.console_apps)
|
||||||
|
|
||||||
@ -329,9 +333,10 @@ class build_apps(distutils.core.Command):
|
|||||||
# Export PRC data
|
# Export PRC data
|
||||||
prcexport = '\n'.join(prcexport)
|
prcexport = '\n'.join(prcexport)
|
||||||
if not self.embed_prc_data:
|
if not self.embed_prc_data:
|
||||||
etcdir = os.path.join(builddir, 'etc')
|
prcdir = self.default_prc_dir.replace('<auto>', '')
|
||||||
os.makedirs(etcdir)
|
prcdir = os.path.join(builddir, prcdir)
|
||||||
with open (os.path.join(etcdir, '00-panda3d.prc'), 'w') as f:
|
os.makedirs(prcdir)
|
||||||
|
with open (os.path.join(prcdir, '00-panda3d.prc'), 'w') as f:
|
||||||
f.write(prcexport)
|
f.write(prcexport)
|
||||||
|
|
||||||
# Create runtimes
|
# Create runtimes
|
||||||
@ -368,7 +373,7 @@ class build_apps(distutils.core.Command):
|
|||||||
|
|
||||||
freezer.generateRuntimeFromStub(target_path, stub_file, use_console, {
|
freezer.generateRuntimeFromStub(target_path, stub_file, use_console, {
|
||||||
'prc_data': prcexport if self.embed_prc_data else None,
|
'prc_data': prcexport if self.embed_prc_data else None,
|
||||||
'default_prc_dir': None,
|
'default_prc_dir': self.default_prc_dir,
|
||||||
'prc_dir_envvars': None,
|
'prc_dir_envvars': None,
|
||||||
'prc_path_envvars': None,
|
'prc_path_envvars': None,
|
||||||
'prc_patterns': None,
|
'prc_patterns': None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user