Re: How to determine the gnome environment



On Thu, 2002-09-26 at 12:13, Malcolm Tredinnick wrote:
> On Thu, Sep 26, 2002 at 06:46:48PM +0800, Yuedong Du wrote:
> > Who know how determine if the user is using gnome 2 environment ?
> > I want to integrate a application into gnome, but how can I know gnome 
> > exist on user's machine?
> 
> What you need to do is work out which libraries in the GNOME hierarchy
> you rely on and test for those. As a general rule, testing if they have
> libgnomeui-2.0 available should be sufficient (since that requires
> libbonobo, libgnome, gtk+, atk, pango, ....).

This should really be handled on the packaging level.  That is, when you
ship your application as an RPM, make sure the RPM has the correct
dependencies on the requisite outside packages/libraries.  Solaris uses
install-time scripts, right?  So you'd have to check for all of the
libraries your application links against in that script.

> You will need to test that pkg-config is available and then use
> pkg-config tests to see if libgnomeui-2.0 (or whatever else you want) is
> available. Have a look at the configure.in files from a few standard
> GNOME applications (things like gnome-utils or gedit or Nautilus).

This will only work for building the application; pkg-config is for
development, not testing the presence of a particular piece of software.

> > Just see if /usr/gnome exist is enough?
> 
> Definitely not. You cannot make any assumptions about how the user has
> laid out their installation. That is why pkg-config exists, for example;
> to provide you with the information required to build on each particular
> system.

Well, there is $prefix/share/gnome-about/gnome-version.xml, which is a
decent indication that GNOME is installed, but it isn't a sufficient
condition for all (or really any of) the necessary libs.

Joe



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