RSS/Atom feed Twitter
Site is read-only, email is disabled

GIMP_DATA_DIR and GIMP_PLUGIN_DIR in m4macros/gimp-2.0.m4

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

GIMP_DATA_DIR and GIMP_PLUGIN_DIR in m4macros/gimp-2.0.m4 Toby Speight 10 Aug 15:36
  GIMP_DATA_DIR and GIMP_PLUGIN_DIR in m4macros/gimp-2.0.m4 Sven Neumann 10 Aug 18:45
   GIMP_DATA_DIR and GIMP_PLUGIN_DIR in m4macros/gimp-2.0.m4 Toby Speight 10 Aug 21:23
Toby Speight
2006-08-10 15:36:58 UTC (over 18 years ago)

GIMP_DATA_DIR and GIMP_PLUGIN_DIR in m4macros/gimp-2.0.m4

I'm playing around with my plug-in build system at the moment, tidying up the automake/autoconf stuff as I go (and as I learn about autotools - I'm a newbie there). One thing I do is find the Gimp plug-in directory like so:

/--------
| GIMP_LIBDIR=`$PKG_CONFIG --define-variable=prefix='DESTDIR' \ | --variable=gimplibdir gimp-2.0` \--------

On discovering Gimp's own autoconf macro file, I discover that it does almost what I need:

/--------
| GIMP_DATA_DIR=`$PKG_CONFIG $pkg_name --variable=gimpdatadir` | GIMP_PLUGIN_DIR=`$PKG_CONFIG $pkg_name --variable=gimplibdir` \--------

The difference being that I have passed in the DESTDIR directory supplied by Automake and used to target the installation. Without this, "make distcheck" fails because it tries to write to the real plug-ins directory rather than the supplied staging directory.

I'm raising this here rather than submitting a patch to make the macro more like my own code, because I'm not sure that unconditionally using PREFIX is a good idea, and I don't yet know how it can be done just for an Automake environment (anyone?). But I do think that this functionality ought to be available to Automake users, particularly as Mitch's Plug-in Template (on which my plug-in is founded) is Automake-based.

Sven Neumann
2006-08-10 18:45:04 UTC (over 18 years ago)

GIMP_DATA_DIR and GIMP_PLUGIN_DIR in m4macros/gimp-2.0.m4

Hi,

On Thu, 2006-08-10 at 14:36 +0100, Toby Speight wrote:

I'm playing around with my plug-in build system at the moment, tidying up the automake/autoconf stuff as I go (and as I learn about autotools - I'm a newbie there). One thing I do is find the Gimp plug-in directory like so:

/--------
| GIMP_LIBDIR=`$PKG_CONFIG --define-variable=prefix='DESTDIR' \ | --variable=gimplibdir gimp-2.0` \--------

On discovering Gimp's own autoconf macro file, I discover that it does almost what I need:

/--------
| GIMP_DATA_DIR=`$PKG_CONFIG $pkg_name --variable=gimpdatadir` | GIMP_PLUGIN_DIR=`$PKG_CONFIG $pkg_name --variable=gimplibdir` \--------

The difference being that I have passed in the DESTDIR directory supplied by Automake and used to target the installation. Without this, "make distcheck" fails because it tries to write to the real plug-ins directory rather than the supplied staging directory.

Yes, that has always been a problem for plug-ins. The plug-in needs to be installed to the GIMP plug-in directory which may be somewhere completely different than what's configured as the plug-in's prefix. I haven't seen a workaround for this yet. If your change works well, we should probably adopt it.

Sven

Toby Speight
2006-08-10 21:23:00 UTC (over 18 years ago)

GIMP_DATA_DIR and GIMP_PLUGIN_DIR in m4macros/gimp-2.0.m4

0> In article ,
0> Sven Neumann ("Sven") wrote:

Sven> On Thu, 2006-08-10 at 14:36 +0100, Toby Speight wrote:

I'm playing around with my plug-in build system at the moment, tidying up the automake/autoconf stuff as I go (and as I learn about autotools - I'm a newbie there). One thing I do is find the Gimp plug-in directory like so:

/-------- | GIMP_LIBDIR=`$PKG_CONFIG --define-variable=prefix='DESTDIR' \ | --variable=gimplibdir gimp-2.0` \--------

On discovering Gimp's own autoconf macro file, I discover that it does almost what I need:

/-------- | GIMP_DATA_DIR=`$PKG_CONFIG $pkg_name --variable=gimpdatadir` | GIMP_PLUGIN_DIR=`$PKG_CONFIG $pkg_name --variable=gimplibdir` \--------

The difference being that I have passed in the DESTDIR directory supplied by Automake and used to target the installation. Without this, "make distcheck" fails because it tries to write to the real plug-ins directory rather than the supplied staging directory.

Sven> Yes, that has always been a problem for plug-ins. The plug-in Sven> needs to be installed to the GIMP plug-in directory which may be Sven> somewhere completely different than what's configured as the Sven> plug-in's prefix. I haven't seen a workaround for this yet. If Sven> your change works well, we should probably adopt it.

It Works For Me (TM). My main concern is whether this would cause problems for anyone using Autoconf (and the Gimp's macro) but not Automake. I suspect that most plug-ins that use any auto* tools are probably based on Mitch's template, and so using Automake.

(time passes...)

Luckily, I didn't send this immediately: it's occurred to me that there's a case for making available the real location (from which to find existing plug-ins) as well as that into which the resultant plug-in will be installed. This will be necessary if a plug-in depends on another, or if (say) an auto-test wants to use script-fu to direct the test suite.

The way that this affects me is during feedback-directed optimisation, where we want to run the plug-in in a minimal environment. We do this by setting GIMP2_DIRECTORY and GIMP2_PLUGINDIR to our carefully-controlled directories; script-fu and any other dependencies are linked (or copied) into our plug-in directory before running against the training data.

I'm still experimenting with this, so I could be way off-target here, though.