I frequenty install the latest version of the Gimp on several
multi-user systems (Solaris and Linux).  One thing that is frequently
reported by new users is that it takes a long time to start the Gimp
for the first time.  I explain that it has to query all plug-ins once,
which is slow because of the heavily loaded NFS server and network,
but it is faster on subsequent runs.

This morning, I realized that it does not have to be that slow: a
pre-built pluginrc file could be installed each user's directory and
the first run will be much faster (the difference is not so big on a
single-user system, but it is significant when every executable has to
be fetched from the NFS server and run locally).  Even if some
plug-ins are updated or removed later, the consistency checks that are
already done on the pluginrc should ensure that everything is OK.

Included below are two simple patches that could solve this problem.

The first one is an addition to the user_install script: if there is a
pluginrc file in the ${prefix}/share/gimp/1.1 directory, then copy it
to the user's private .gimp-1.1 directory.  If no pluginrc file has
been installed there, then do nothing (some administrators may not
want to run the next step explained below).  The installation dialog
already explains what the pluginrc file is used for, so there is
nothing to add there.

The second one is an addition to the Makefile (Makefile.am): a new
target "make install-pluginrc" can be used after "make install".  It
will run the Gimp in batch mode and exit immediately, so that a
pluginrc file is created in the administrator's home directory.  This
file is then copied into the gimpdatadir in the same way as the other

I added a separate rule instead of extending the "make install" target
because some administrators may not want to start the Gimp from a
priviledged account.  In this case, they can start it from another
account and copy the file manually, or simply ignore this step (which
is why the user_install script tests if the pluginrc file has been
created or not).

Does this make sense?  If yes, then I could re-submit this patch to
ftp://ftp.gimp.org/incoming/, together with some updated instructions
in the INSTALL file.


--- user_install~       Wed Mar 15 00:18:04 2000
+++ user_install        Wed May  3 16:07:17 2000
@@ -22,6 +22,11 @@
 echo "cp $1/gtkrc $2/gtkrc"
 cp $1/gtkrc $2/gtkrc
+if test -r $1/pluginrc; then
+  echo "cp $1/pluginrc $2/pluginrc"
+  cp $1/pluginrc $2/pluginrc
 echo "mkdir $2/brushes"
 mkdir $2/brushes
 echo "mkdir $2/generated_brushes"
--- Makefile.am~        Mon Apr 24 20:55:08 2000
+++ Makefile.am Wed May  3 16:46:16 2000
@@ -145,6 +145,20 @@
        rm -f $(DESTDIR)$(bindir)/gimp-config
+       @if test -x $(DESTDIR)$(bindir)/gimp; then \
+         echo " Starting gimp in batch mode to create/update pluginrc"; \
+         $(DESTDIR)$(bindir)/gimp --batch '(gimp-quit 0)'; \
+         p=pluginrc; \
+         file=$(HOME)/$(gimpdir)/$$p; \
+         if test -f $$file; then \
+           echo " $(INSTALL_DATA) $$file $(DESTDIR)$(gimpdatadir)/$$p"; \
+           $(INSTALL_DATA) $$file $(DESTDIR)$(gimpdatadir)/$$p; \
+         fi; \
+       else \
+         echo "Please run 'make install' first."; \
+       fi
 .PHONY: files populate checkin release

Reply via email to