Re: [gedit-list] Confusion writing a Gedit plugin



Oops, sent the response privately by mistake. Forwarding to the list.

While at it I also added a small clarification

Il giorno lun, 20/06/2005 alle 20.53 +0200, Paolo Borelli ha scritto:
> Il giorno lun, 20/06/2005 alle 13.31 -0400, Tony Nelson ha scritto: 
> > At 11:02 AM +0200 6/20/05, Paolo Borelli wrote:
> > 
> > Thank you for your response.
> > 
> > You don't mention any documentaion.  Is there any, beyond (from my original
> > message):
> > 
> 
> Unfortunately no. Most of your troubles however seems to be about linux
> developement in general, not specific to gedit plugins.
> 
> > >I've been following the directions at
> > ><http://live.gnome.org/GeditPluginHowto> , but apparently extra steps are
> > >needed to turn the changed or new Makefile.am and configure.in files into
> > >Makefile and configure.  <http://developer.gnome.org/doc/GGAD/ggad.html>
> > >describes how to create the source tree, more or less ...
> > 
> > ?  Note that steps are missing from <http://live.gnome.org/GeditPluginHowto> .
> > 
> 
> I haven't written that tutorial, and while I thank Muthu for writing it
> I really haven't had time yet to review it. As far as I can see, the
> tutorial explains developing plugin from inside the gedit source tree.
> While this is the easiest solution for many people, it is not required.
> You can develop a plugin in a separate dir and also use a plain makefile
> if you prefer.
> 
> Or you can even compile it manually with a command like 
> gcc -g -O2 -fPIC -shared  `pkg-config  $(GEDIT_VERSION) --libs --cflags`
> yourplugin.c -o libyourplugin.so

to be clear, if you use this command you have to use "gedit-2.8" intead
of "$(GEDIT_VERSION)"

> and then copy the resulting .so and a hand written .gedit-plugin.
> 
> > If there isn't documentation, which /few/ source files are relevent to
> > writing plugins, beyond the plugins' own source in the ./plugins directory?
> > 
> 
> the only thing apart from what it's in ./plugin are some the .h files
> in ./gedit: for instance if you want to use the gedit_view_foo()
> function from your plugin you need to include gedit-view.h.
> 
> > Documentation would help if you want people to write plugins for Gedit, as
> > would having your own version of of Fedora's gedit-devel for out-of-tree
> > plugin development, and supporting the old plugin format along with the new
> > plugin format.  The hurdles to writing plugins seem pretty high now.  The
> > very idea of plugins seems to include their out-of-tree development.
> > Currently, from what you say below, plugins must be developed for the exact
> > version of Gedit they will run in.
> > 
> 
> No, out of tree plugins are perfectly possible right now (for instance
> seahorse, an encryption application, provides a gedit plugin).
> Plugins work fine across pretty much all the versions, including 2.6,
> 2.8, 2.10 and probably 2.12. The "new" and icompatible plugin system is
> in the experimental new_mdi cvs branch, and making it incompatible was a
> forced choice since we are dumping the use of bonoboui which is part of
> the current plugin api.
> 
> > OK.  I can't claim to be familiar with rpms either; I just know that's how
> > Fedora Core works, and that installing from tarballs or source trees is
> > asking for trouble.
> > 
> 
> the common practice is to install in a separate prefix (that also
> requires setting PATH etc though).
> 
> > >Let me note some things:
> > >- Fedora should have a gedit-dev package which shoud allow to develop
> > >plugins for gedit without recompilig gedit itself (if such package
> > >doesn't exists, it's a fedora bug and you shoud report it to the fedora
> > >folks).
> > 
> > I have installed the gedit-devel rpm, but, as usual, I don't know where it
> > went.  I'll ask on the Fedora list.
> > 
> > >Obviosly if you want to build the sample plugin, you would still
> > >need to use the gedit sources since the plugin is included there.
> > 
> > OK.  Is there a way to develop plugins without working from the various
> > sample plugins?  The Gedit sources, which have the plugin sources, appear
> > to be the only real "documentation".
> > 
> 
> The sample plugins are the currently preferred "documentation", that
> doesn't mean that you need to use the same build system: just use the .c
> files as an example.
> 
> > 
> > >- In general if you are interested in developement, the best thing is to
> > >properly assemble a developing environment using all the required
> > >versions from cvs, since targetting a year old release is not the best
> > >thing...
> > 
> > That year old release is what I use.  If I develop for some other release
> > using a different plugin arch, will what I make be useful for me or other
> > Fedore Core 3 users?
> 
> see above.
> 
> > 
> > If you will hold my hand every step of the way, and show me how to make a
> > plugin useful to me and other Fedora Core 3 users as well as to you,
> > without damaging my Fedora Core 3 installation, I will give it a try.  Note
> > that I won't upgrade packages on my Fedora Core 3 installation without
> > convincing evidence that no possible harm to my Fedora Core 3 installation
> > could result, as I want it to keep working.  Any changes that affect only
> > one user account should be safe, as long as it isn't my normal account.  I
> > will need explicit step-by-step instructions, and I will have to return for
> > more instructions each time I have a problem, such as a step not working or
> > apparently changing something outside of the development account's home
> > directory.
> > 
> > >however if you are just experimenting, it is completely understandable
> > >that you can't be bothered to build everything from cvs.
> > 
> > I don't want to damage my Fedora Core 3 installation.  Random package
> > upgrades seem to be the main reported source of problems.  If checking out
> > the source tree from CVS had worked, I might have proceeded that way, but
> > it didn't.
> > 
> 
> as explained above there is no harm and you have many options:
> - install in a different prefix
> - do not run make install at all and just copy your compiled plugin to
> ~/.gedit-2/plugins
> - even if you run make install, it will install in /usr/local so you
> always have the chance to run make uninstall without damaging your rpm
> installation
> 
> > >I however suggest you to grab gedit from cvs anyway by using the gedit-2-8
> > >branch: "cvs -z3 -d:pserver:anonymous anoncvs gnome org:/cvs/gnome co -r
> > >gedit-2-8 gedit" At that point, assuming you already have all the required
> > >dev packages, you just need to run ./autogen.sh, run make and make
> > >install.
> > 
> > What is the advantage of using the CVS tree 2.8.0 source over using the
> > Fedora Core 3 2.8.1 package sources?  The Fedora Core 3 package has patches
> > that the Fedora folks thought important for running on Fedora Core 3.  Will
> > I be able to get Gedit working properly on Fedora Core 3 without those
> > patches?
> > 
> 
> the patches were just pretty minor enanchements and anyway you are free
> to apply them. I suggested using cvs in order to use ./autogen.sh, but
> using the tarballs is pretty much equivalent. The other nice thing about
> using cvs is that it allows "cvs diff" to easily see your modifications.
> 
> > 
> > >When you add a directory and modify configure.in and Makefile.am, just
> > >rerun ./autogen.sh, which takes care of rerunning autoconf, automake etc
> > 
> > So ./autogen will replace:
> > 
> > aclocal
> > automake
> > autoconf ./configure.in >configure
> > ./configure
> > 
> 
> substantially, yes.
> 
> > 
> > >> Now I want to install the plugin into Gedit.  I don't see how to do that
> > >> (either).  Copying all the likely files from my plugin's source dir into
> > >> ~/.gedit-2/plugins didn't seem to be quite enough, as the checkbox for it
> > >> in Edit menu Preferences dialog Plugins tab is disabled.  Where should I
> > >> put the new plugin's files?
> > >
> > >If you build your plugin from inside the gedit source tree (that is by
> > >adding it to configure.in), than make install will already install your
> > >plugin.
> > 
> > Does it try to install it in my home directory, or in /usr/lib?  Actually,
> > it seems to try to put it in /usr/local/share, but (fortunately) fails.  Is
> > there a variant on make install that will install the plugin in my home
> > directory, not messing with global directories?
> > 
> 
> no, make install installs system-wide. If you don't specify any prefix
> to configure the default installation prefix is /usr/local (in order to
> not conflict with your rpms which are in /usr). To write in /usr/local
> you have to be root.
> 
> 
> paolo




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]