Installing scripts and plug-ins

Discussion in 'GIMP for Mac' started by Auria, Apr 6, 2008.

  1. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    python and scheme scripts are interpreted thus very easy to install.
    • Scheme (.scm) scripts can go in [your home]/Library/Applications Support/Gimp/scripts (create directory if necessary)
    • Python (.py) scripts can go in [your home]/Library/Applications Support/Gimp/plug-ins (create directory if necessary)

    C plugins, on the other hand, are more difficult since they usually need to be built from source first.

    To build plug-ins, you will first of all need GIMP installed from source via macports (see compilation guide for more info on this). Note that in order to compile plugins you need at least some experience using the terminal to build stuff from source otherwise you will probably get lost very quickly

    The first problem we meet is that every plugin provides its own build system and there is standard build system. Some are autotools-based (http://gimp-texturize.sourceforge.net), others simply provide makefiles (http://registry.gimp.org/node/471, http://registry.gimp.org/node/137) sometimes there is a makefile specifically for mac, sometimes there isn't. In those cases the linux makefile will usually work fine unless they use uncommon compilation flags.

    First, re-create the symlink just like during compilation
    (remove /tmp/skl if created by Gimp.app)
    Code:
    mkdir -p /tmp/skl
    cd /tmp/skl
    ln -s ~/src/macports/Gimp.app Gimp.app
    cd - 
    set-up your environment
    Code:
    export PATH=$PATH:/tmp/skl/Gimp.app/Contents/Resources/bin
    export PKG_CONFIG_PATH=/tmp/skl/Gimp.app/Contents/Resources/lib/pkgconfig
    export GIMPTOOL=/tmp/skl/Gimp.app/Contents/Resources/bin/gimptool-2.0
    depending on what you are building and your environment you may need to set more envrionment variables

    Now time to build the plug-in. Below are just generic guidelines, you'll need to read the plug-in's own instructions and adapt them for your computer

    If your plug-in is autotools-based, you'll probably have the easiest time this way
    Code:
    ./configure --prefix=/opt/gimp-plugin
    make
    sudo make install #may or may not be necessary; if you do check output to see where it's sending the plug-in executable
    
    In this snippet i'm sending the files to /opt/gimp-plugin so they're easier to find. you may want to wipe this directory once you're done.

    if it is makefile based, it may look like that
    Code:
    # a single makefile for all
    make
    
    # a makefile for each platform
    make -f makefile.macosx # adapt name as needed
    
    # a makefile with a target for each platform
    make macosx # adapt target name as needed
    
    # a makefile with a target for each platform, and none for mac
    make linux # adapt target name as needed
    
    Once the plug-in is built, no matter how no matter where, locate the generated plug-in executable file and copy it to ~/Library/Application Support/Gimp/plug-ins (create directory if necessary)

    Then open GIMP and cross your fingers ;)
  2. Dominus

    Dominus New Member

    Joined:
    Dec 7, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Thanks, I'm gonna try this out for our shp file plugin. Really great guides now online, especially right now when I came here specifically to ask for such guides :)

    Edit sometimes I'm such a noob, I thought this was a much newer post, maybe I should get some sleep after all

Share This Page