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

plug-in observations/questions

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.

5 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

plug-in observations/questions Steve Lipa 06 Apr 06:33
  plug-in observations/questions Sven Neumann 06 Apr 13:33
   plug-in observations/questions Steve Lipa 06 Apr 18:45
    plug-in observations/questions Sven Neumann 06 Apr 21:10
     plug-in observations/questions Steve Lipa 06 Apr 23:40
Steve Lipa
2004-04-06 06:33:23 UTC (about 20 years ago)

plug-in observations/questions

GIMP developers:

Congratulations on 2.0, it is extremely nice.

I have a couple of observations/questions regarding plug-in updates and would appreciate any feedback you might be willing to share.

First, the gimp-plugin-template is set up to use a static gimp-help.xml file that always points to a web address:

In general a plug-in may not have a static web site to point to, which complicates gimp-help.xml, which must then change at install time. My solution is to supply a temporary file gimp-help.tmp:




and modify this at install time by adding the following two lines to .configure.in:

GIMPHELPXML=$prefix/share/plugin_name sed -e "s#TMPDIR#$GIMPHELPXML#g" ./help/en/gimp-help.tmp > ./help/en/gimp-help.xml

This works for me but I have not released my plug-in update to the wild yet. Does this approach make sense or does anyone have a suggestion for improving it?

Recent changes in gimp-plugin-template have changed some things. First, in the file Makefile.am in the src directory, the idea of a PLUGIN_DIR seems to have gone away and the gimp-plugin-template puts the binary in:

bindir = $(GIMP_LIBDIR)/plug-ins

This destination seems (at least in my case) to be controlled by the contents of my gimp-2.0.pc file and the prefix in that file overrides any --prefix specification that I use when installing the plug-in. It seems to me that for general plug-in users who might not be allowed to write to the system gimplibdir the following makes more sense, and it works for me:

bindir = $(prefix)/lib/gimp/2.0/plug-ins

Can anyone let me know which of these is better and why?

Also, some craziness with Makefile.in.in has rendered the whole gettext system unworkable for me. Since I don't have any translations I just ripped out the po directory and the gettext stuff from .configure.in. Is that crazy? It seems to work fine without it.

Thanks in advance for any feedback and for your work on the GIMP.

Steve

Sven Neumann
2004-04-06 13:33:27 UTC (about 20 years ago)

plug-in observations/questions

Hi,

Steve Lipa writes:

First, the gimp-plugin-template is set up to use a static gimp-help.xml file that always points to a web address:


This is a misunderstanding. The URL given there is just a unique identifier of the XML namespace declaration for "template:". There doesn't need to be any page pointed to by this URL. Please read up on XML namespaces if you want to understand this better or just ask again here.

I have posted detailed explanations of the help system earlier on this list. Perhaps we should pull these out of the archives and put them online on developer.gimp.org.

Recent changes in gimp-plugin-template have changed some things. First, in the file Makefile.am in the src directory, the idea of a PLUGIN_DIR seems to have gone away and the gimp-plugin-template puts the binary in:

bindir = $(GIMP_LIBDIR)/plug-ins

This destination seems (at least in my case) to be controlled by the contents of my gimp-2.0.pc file and the prefix in that file overrides any --prefix specification that I use when installing the plug-in. It seems to me that for general plug-in users who might not be allowed to write to the system gimplibdir the following makes more sense, and it works for me:

bindir = $(prefix)/lib/gimp/2.0/plug-ins

Can anyone let me know which of these is better and why?

The latter won't work if GIMP is not installed in the same prefix and I don't understand your problem with the first approach. You cannot simply install GIMP plug-ins somewhere, they need to go into the GIMP plug-in dir which is determined from the gimp-2.0.pc file. What is probably missing here is the addition of $(DESTDIR). I will consider to add that.

Sven

Steve Lipa
2004-04-06 18:45:39 UTC (about 20 years ago)

plug-in observations/questions

On Apr 06 Sven Neumann (sven@gimp.org) wrote:

Hi,

Steve Lipa writes:

First, the gimp-plugin-template is set up to use a static gimp-help.xml file that always points to a web address:


This is a misunderstanding. The URL given there is just a unique identifier of the XML namespace declaration for "template:". There doesn't need to be any page pointed to by this URL. Please read up on XML namespaces if you want to understand this better or just ask again here.

I have posted detailed explanations of the help system earlier on this list. Perhaps we should pull these out of the archives and put them online on developer.gimp.org.

Sven:

Trust me, I have tried to figure this out by reading through the old archives but I haven't been able to find anything that applies. This problem is exacerbated by the fact that the gimp-devel search engine gives me nothing by error messages about not being able to find a .htaccess file or some such, so it is hard to search effectively.

I have found by trial and error that if I don't have this xmlns:etc line pointing to the directory that the documentation is in, the help system simply does not work for me. The approach I am using is the only one that I have been able to get to work.

I think most plug-ins will be like mine, in that they will have built-in documentation, so it might make sense for the gimp-plugin-template to have an example of how to do it right. Failing that, I was hoping to do my plug-in right so people could use it as an example. The other plug-ins I've looked at so far simply have not been any help.

The latter won't work if GIMP is not installed in the same prefix and I don't understand your problem with the first approach. You cannot simply install GIMP plug-ins somewhere, they need to go into the GIMP plug-in dir which is determined from the gimp-2.0.pc file. What is probably missing here is the addition of $(DESTDIR). I will consider to add that.

Sven

In the good old days, users could install plug-ins in ~/.gimp-x.x/plug-ins. Up until very recently, gimp-plugin-template (effectively) put plug-ins in ${prefix}/lib/gimp/2.0/plug-ins. The latest CVS version doesn't. But if you say $(GIMP_LIBDIR) will put them in the right place then that's good enough for me!

Sven Neumann
2004-04-06 21:10:04 UTC (about 20 years ago)

plug-in observations/questions

Hi,

Steve Lipa writes:

I have found by trial and error that if I don't have this xmlns:etc line pointing to the directory that the documentation is in, the help system simply does not work for me. The approach I am using is the only one that I have been able to get to work.

I think most plug-ins will be like mine, in that they will have built-in documentation, so it might make sense for the gimp-plugin-template to have an example of how to do it right. Failing that, I was hoping to do my plug-in right so people could use it as an example. The other plug-ins I've looked at so far simply have not been any help.

The example in the gimp-plugin-template is correct, works and it shows how to install html files distributed with the plug-in. I don't understand why you messed the template up so badly when all you had to do was replacing "template" with the name of your plug-in and providing a unique URL to identify the help domain registered by your plug-in.

I will paste the gimp-help.xml from the gimp-plugin-template below and explain once more what's going on:

The raw version: ----------------

A commented version: --------------------

The classic XML header, just keep it.

The toplevel element of each gimp-help.xml file is . Here we define a namespace for the identifiers that we are going to register with the GIMP's help system. The namespace has the prefix "template", you should change this to the name of your plug-in, let's call it "foobar". The URI is _not_ pointing to any files on the world wide web. It's sole purpose is to provide a unique identifier. An identifier that is guaranteed not to be used by any other GIMP plug-in that registers help pages. The idea is that you use an address on your web-server, on your area of the web. You don't need to put any pages there, just make sure that it's a unique URI.

Here we install a mapping from an ID to a HTML file. You will notice that id is defined in the "template" namespace defined above. So you will need to use "foobar:id" here instead. The identifier "plug-in-template" is mapped to the file "index.html". This filename is relative to the position of gimp-help.xml that we are reading right now.

There could be more lines like the above if you want to install more help IDs.

This closes the top-level element again.

An example ==========

So, assuming your plug-in is named "foobar", your gimp-help.xml would look like this:

I do hope this explanation clears things up. If you have further questions, please ask them.

In the good old days, users could install plug-ins in ~/.gimp-x.x/plug-ins. Up until very recently, gimp-plugin-template (effectively) put plug-ins in ${prefix}/lib/gimp/2.0/plug-ins. The latest CVS version doesn't. But if you say $(GIMP_LIBDIR) will put them in the right place then that's good enough for me!

The gimp-plugin-template Makefile installs the plug-in system-wide. That's better then doing it for each user individually. But I will look into adding a "user-install" make target that puts the plug-in into the user's gimp directory. We need to make a 2.0.0 release of gimp-plugin-template anyway. There are a few minor changes in CVS that need to be released.

Sven

Steve Lipa
2004-04-06 23:40:46 UTC (about 20 years ago)

plug-in observations/questions

On Apr 06 Sven Neumann (sven@gimp.org) wrote:

The example in the gimp-plugin-template is correct, works and it shows how to install html files distributed with the plug-in. I don't understand why you messed the template up so badly when all you had to do was replacing "template" with the name of your plug-in and providing a unique URL to identify the help domain registered by your plug-in.

OK. Sorry about that. I think what happened was that early on I got my call to gimp_plugin_help_register out of sync with what was in the gimp-help.xml file. That, combined with ignorance, superstition, and hubris led me down the wrong path. Thanks for straightening me out!

Steve