Feedback is welcome and appreciated.
- If you'd prefer to do things by hand check out Version 1 of this guide.
The following documents the steps I took to compile the latest version of Resynthesizer on macOS Sierra (10.12.6) for GIMP 2.10.10.
Homebrew was used to fulfill as many dependencies as possible.
After writing Version 1, I decided to make a Tap available which contains libgimp2.0
.
This should simplify the process of compiling GIMP plugins on macOS.
This guide assumes you'll be running Resynthesizer under GIMP 2.10.10 installed with brew cask install gimp
.
- Setup build directory
- Acquire sources
- Install dependencies
- Compile Resynthesizer
- Install Resynthesizer
# I setup my build directory as recommended by [this howto](https://www.GIMP.org/source/howtos/GIMP-git-build.html) on GIMP.org.
# It allows us to keep things contained.
# You can put your build directory wherever is convenient.
# However, it's best if it's a new, empty directory unless you know what you're doing.
# We will assume that our build directory is '~/Code/build-gimp-plugins'.
# Let's refer to this directory with a variable
PREFIX=~/Code/build-gimp-plugins
# We need to create this directory if it does not exist.
mkdir -p $PREFIX
# We also need to create a couple other important directories.
mkdir -p $PREFIX/share # This is where config.site should be placed.
mkdir -p $PREFIX/bin
# In my case, I had installed perl from Homebrew at some point in the past.
# It did not come with a module Resynthesizer needed to compile, so rather than install
# that module which may have worked, I symlinked the system perl into $PREFIX/bin
# to make sure it was used instead of the Homebrew version.
# You may or may not have this issue.
# ln -s /usr/bin/perl $PREFIX/bin/perl
# Make sure you've placed 'config.site' in $PREFIX/share
# Now we're going to get the Resynthesizer source.
# Make sure we're in our build directory
cd $PREFIX
# Resynthesizer
git clone git://github.com/bootchk/resynthesizer.git
# Now's the time to `git checkout` a branch or tag if you don't want to compile
# Resynthesizer's latest code.
# Resynthesizer needs libgimp2.0 to compile
brew tap ryan-robeson/gimp
brew install libgimp2.0
# We're on the home stretch now
cd resynthesizer
# NOTE: @SimplyTheOther found the following change to be unnecessary on their system.
# You should be able to skip editing the Resynthesizer source. I'm going to leave
# the info here for now just in case.
#
# ** You can likely skip this ** #
# In order to get Resynthesizer to compile on macOS, I had to make a small change in the source.
# Open lib/engineTypes.h in your editor of choice.
# At the end of the file is the definition for swap_vector_elements.
# Add 'static' in front of 'inline void'.
# Save and exit.
# Without this change I was getting a 'symbol(s) not found' error.
# I got the idea to add 'static' from https://stackoverflow.com/a/19069107
# I do not know what the ramifications of this change are, I only know that it compiled and seems to work.
# ** end skip ** #
./autogen.sh --prefix=$PREFIX
make
# I don't believe `make install` will do what we want here, so skip it.
# If there are no errors, proceed to the next step.
# You could copy the plugin files to one of GIMP's default plugin directories,
# but I decided to put them in their own directory and tell GIMP about it.
mkdir plug-ins
cp src/resynthesizer/resynthesizer plug-ins/
cp src/resynthesizer-gui/resynthesizer_gui plug-ins/
cp PluginScripts/*.py plug-ins/
chmod a+x plug-ins/*.py
# Now open your system's copy of GIMP (installed by Homebrew Cask in my case),
# open Preferences, expand the folders dropdown, select Plug-ins, and add the plug-ins folder
# we just created to the list.
# Click OK. Then restart GIMP.
# Filters > Enhance > Heal Selection and several others should now be available.
Crud. I always do intend to be more careful. I'd made a mental note to attempt using the link to /usr/bin/perl if I didn't have success without it, but I guess when those other error messages seemed to indicate more it slipped my mind.
Anyway, that didn't cut it, and I'm getting the same error messages, including the Parser Perl Module error.
Yes, I have the config.site in the share directory, copied and pasted. I made it executable, not knowing if that was necessary, and still no luck.
It feels like the next step is to link all the requisite m4 files to the proper directory, but I don't know what that directory is :-(