From my first glance, I don’t see any easy/obvious ways to extract the extra args from SPM. I’m sure it’s possible in the longer term, maybe by adding some features to SPM. But for a quick fix, I propose that we just run pkg-config ourselves.
There’s another obstacle that I do not know how to add extra include search paths after the kernel starts running. We can work around this by making symlinks from /tmp/xyzxyzxyz/swift-install/modules to all the necessary header files.
I propose combining all these workarounds into a swift-jupyter feature that you use like this:
This feature will run the specified commands, extract the -I flags from them, and create links from the kernel’s “install location” to all the headers.
Check out that branch and add %install-extra-include-command pkg-config --cflags vips to your install cell.
I’m going to test it out on a few more notebooks and systems and add some docs in the readme. Then I will merge it.
By the way, I had to do some extra things not included in the install instructions to get SwiftVips working:
sudo ldconfig
conda install harfbuzz pango. The versions of these libs that were on my Ubuntu system had missing symbols. I’m guessing that conda installs newer versions that have more symbols, though I haven’t looked closely and compared versions and understood what’s actually going on.
FYI, I think @marcrasi’s change has been splatted in all the merge madness. I had to add the extra %install-extra-include-command pkg-config --cflags vips line to the 1st cell, and also include an import TensorFlow in the 2nd cell, to get the nb to run.
Every time running autogen.sh it got it’s panties in a twist and would not generate the deleted files on a remake. The files ltmain.sh and Makefile.in were missing ( not regenerated) by the libtoolize tool.
So my fix was once I had generated the configure file which autogen.sh thankfully did was to run individually from the command prompt :-
libtoolize --copy --force --automake automake --add-missing --copy ./configure make sudo make install
The intuition I got for this was from a 2015 issue #305