Browse Source

darwin: redirect VLC_PKG_LIB_DIR/plugins on iOS

On iOS and tvOS, dylibs must be wrapped into a framework and frameworks
must be flattened into the frameworks/ application directory (or global
to the system which is not possible in the general case), so dylibs
can't be in the VLC_PKG_LIB_DIR/plugins folder. Redirect
VLC_PKG_LIB_DIR/plugins toward VLC_PKG_LIB_DIR/ on those platforms.

Manual cherry-pick from commit 89e90672db.
The code is written directly in the src/modules/bank.c code given that
config_GetSysPath doesn't exist in 3.0.
Alexandre Janniaux 4 years ago
parent
commit
08fe82b877
  1. 1
      src/darwin/dirs.c
  2. 9
      src/modules/bank.c

1
src/darwin/dirs.c

@ -35,6 +35,7 @@
#include <mach-o/dyld.h>
#include <CoreFoundation/CoreFoundation.h>
#include <TargetConditionals.h>
char *config_GetLibDir (void)
{

9
src/modules/bank.c

@ -49,6 +49,10 @@
#include "config/configuration.h"
#include "modules/modules.h"
#ifdef __APPLE__
#include <TargetConditionals.h>
#endif
typedef struct vlc_modcap
{
char *name;
@ -525,6 +529,11 @@ static void AllocateAllPlugins (vlc_object_t *p_this)
#if VLC_WINSTORE_APP
/* Windows Store Apps can not load external plugins with absolute paths. */
AllocatePluginPath (p_this, "plugins", mode);
#elif defined(__APPLE__) && defined(HAVE_DYNAMIC_PLUGINS) && TARGET_OS_IPHONE
/* Redirect to the application folder, plugins/ is flattened. */
char *vlcpath = config_GetLibDir ();
AllocatePluginPath (p_this, vlcpath, mode);
free(vlcpath);
#else
/* Contruct the special search path for system that have a relocatable
* executable. Set it to <vlc path>/plugins. */

Loading…
Cancel
Save