From 661480d4c6c05316d178cc825d24ee8573232a8d Mon Sep 17 00:00:00 2001 From: Albert Graef <aggraef@gmail.com> Date: Tue, 23 Aug 2022 20:08:06 +0200 Subject: [PATCH] Include the libquicktime plugins in the Homebrew build. On the Mac, we have to ship these along with libquicktime itself, and define LIBQUICKTIME_PLUGIN_DIR in the environment so that libquicktime finds them. Otherwise Gem's QT4L plugins won't be of much use. --- packages/darwin_app/embed-MacOSX-dependencies.sh | 2 ++ pd/src/s_main.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/packages/darwin_app/embed-MacOSX-dependencies.sh b/packages/darwin_app/embed-MacOSX-dependencies.sh index 8a146d318..7109c9734 100755 --- a/packages/darwin_app/embed-MacOSX-dependencies.sh +++ b/packages/darwin_app/embed-MacOSX-dependencies.sh @@ -52,6 +52,8 @@ for pd_darwin in `find $PD_APP_CONTENTS -name '*.pd_darwin'`; do done # check for .so plugins used by libquicktime and others +rm -rf $PD_APP_PLUGINS/libquicktime +test -d ${optlocal}/libquicktime/lib/libquicktime && cp -r ${optlocal}/libquicktime/lib/libquicktime $PD_APP_PLUGINS || true for so in $PD_APP_PLUGINS/*/*.so; do LIBS=`otool -L $so | sed -n 's|.*'"${optlocal}"'/\(.*\.dylib\).*|\1|p'` if [ "x$LIBS" != "x" ]; then diff --git a/pd/src/s_main.c b/pd/src/s_main.c index 0fb8cc065..8b2abb0db 100644 --- a/pd/src/s_main.c +++ b/pd/src/s_main.c @@ -389,6 +389,17 @@ int sys_main(int argc, char **argv) #ifndef MSW if (!noprefs) sys_rcfile(); /* parse the startup file */ +#endif +#ifdef __APPLE__ + // Initialize libquicktime for Gem, so that it finds its plugins. + char *plugins = strdup(argv[0]), *t = strstr(plugins, "/Contents"); + if (t) { + strncpy(t, "/Contents/Plugins/libquicktime", strlen(t)); + fprintf(stderr, "LIBQUICKTIME_PLUGIN_DIR = %s\n", plugins); + // We don't override an existing value here, since the user may have + // already set up her own libquicktime plugin collection. + setenv("LIBQUICKTIME_PLUGIN_DIR", plugins, 0); + } #endif if (sys_argparse(argc-1, argv+1)) /* parse cmd line */ return (1); -- GitLab