From 9e80282affb4ce19430fdd3e16d4b3ec4d49e2b8 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 2 Apr 2020 22:34:04 +0200 Subject: [PATCH] dist: replace p3fmod_audio with p3openal_audio if former is missing This helps when deploying to macOS, where p3fmod_audio is the default for 1.10 builds, a fact that is very easy to overlook when deploying to macOS and only including the p3openal_audio plug-in. --- direct/src/dist/commands.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/direct/src/dist/commands.py b/direct/src/dist/commands.py index 5d2aaa8f2d..632d9c9859 100644 --- a/direct/src/dist/commands.py +++ b/direct/src/dist/commands.py @@ -623,6 +623,13 @@ class build_apps(setuptools.Command): if var == 'model-cache-dir' and value: value = value.replace('/panda3d', '/{}'.format(self.distribution.get_name())) + if var == 'audio-library-name': + # We have the default set to p3fmod_audio on macOS in 1.10, + # but this can be unexpected as other platforms use OpenAL + # by default. Switch it up if FMOD is not included. + if value not in self.plugins and value == 'p3fmod_audio' and 'p3openal_audio' in self.plugins: + self.warn("Missing audio plugin p3fmod_audio referenced in PRC data, replacing with p3openal_audio") + for plugin in check_plugins: if plugin in value and plugin not in self.plugins: useline = False