My Any File plugin uses ImageMagick's "composite" program, and it is bundled in the plugin distribution, for precisely the reasons you describe. It was pretty painful for me, not being a Mac programmer, to figure out how to build ImageMagick without shared libraries, so that "composite" was completely self-contained. Here are my notes on how to do that:
1. Download ImageMagick.tar.gz distribution to /Users/John. Unpack it by
doing:
cd /Users/John
tar xvfz ImageMagick.tar.gz
See http://www.imagemagick.org/script/advanced-unix-installation.php
2. Download the jpegsrc.tar.gz library from:
http://www.imagemagick.org/download/delegates/
to /Users/John/ImageMagick and unpack it with:
cd /Users/John/ImageMagick
tar xvfz jpegsrc.tar.gz
mv jpegsrc<version> jpeg
3. Configure and build the jpeg library:
cd jpeg
./configure --disable-shared
make clean; make
4. Download the libpng.tar.gz library from:
http://www.imagemagick.org/download/delegates/
to /Users/John/ImageMagick and unpack it with:
cd /Users/John/ImageMagick
tar xvfz libpng.tar.gz
mv libpng<verszion> png
5. Configure and build the png library:
cd png
./configure --disable-shared
make clean; make
6. Configure and build ImageMagick; copy configure.sh to ImageMagick
folder and do:
cd /Users/John/ImageMagick
sh configure.sh
make clean; make
7. Verify that composite is only loading dynamic libraries from /System and /usr/lib:
otool -L utilities/composite
7. Copy utilities/composite and config/delegates.xml to anyfile.lrdevplugin.
And here's the contents of the "configure.sh" script referenced above:
# Image-magick configure script for configuring with Any File
# --disable-opencl \
./configure \
--disable-installed \
--disable-shared \
--enable-delegate-build \
--prefix=/ImageMagick-6.7.3-7 \
--disable-dependency-tracking \
--with-x=no \
--without-perl \
--with-freetype=no \
--with-jp2=no \
--with-tiff=no \
--with-magick-plus-plus=no \
--with-bzlib=no