Forum: Ruby-Gnome 2 Support for pkgconfig

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4913bcb685792f601ae9813b4713abb9?d=identicon&s=25 Detlef Reichl (Guest)
on 2009-06-02 14:50
(Received via mailing list)
Hi,

till now one has to load a ruby-gnome library to see, which version is
installed.

So I will suggest to provide pkg-config files. They shall use the
original pkg-config name of the base library like gtk +-2.0.pc and add
-ruby in front of the .pc, so it will look like gtk +-2.0-ruby.pc

This will have two benefits: The test if a library is installed is much
faster and the build systems of i.e. linux distributors don't need to
have an X-Server installed.

Cheers, detlef

--
http://det.cable.nu
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2009-06-02 14:59
(Received via mailing list)
Hi,

In <20090602144905.e6f527dc.detlef.reichl@gmx.org>
  "[ruby-gnome2-devel-en] Support for pkgconfig" on Tue, 2 Jun 2009
14:49:05 +0200,
  Detlef Reichl <detlef.reichl@gmx.org> wrote:

> till now one has to load a ruby-gnome library to see, which version is
> installed.
>
> So I will suggest to provide pkg-config files. They shall use the
> original pkg-config name of the base library like gtk +-2.0.pc and add
> -ruby in front of the .pc, so it will look like gtk +-2.0-ruby.pc
>
> This will have two benefits: The test if a library is installed is much
> faster and the build systems of i.e. linux distributors don't need to
> have an X-Server installed.

I agree with your suggestion.
You can commit your suggestion into trunk. :-)


Thanks,
--
kou
4913bcb685792f601ae9813b4713abb9?d=identicon&s=25 Detlef Reichl (Guest)
on 2009-06-03 00:57
(Received via mailing list)
Attachment: pc.diff (20 KB)
Hi,

Kouhei Sutou schrieb:

>
> I agree with your suggestion.
> You can commit your suggestion into trunk. :-)

because the changes are a little bit bigger, I'll post 'em first here.
For now the name, description and version arguments are supported.

bonobo, bonoboui, gdkpixbuf, gstreamer, gtkglext and libart are not
supported for now, cause they don't have a static version information.

Cheers, detlef
4913bcb685792f601ae9813b4713abb9?d=identicon&s=25 Detlef Reichl (Guest)
on 2009-06-03 12:12
(Received via mailing list)
Attachment: pc.diff (20 KB)
Hi,

Detlef Reichl schrieb:

> bonobo, bonoboui, gdkpixbuf, gstreamer, gtkglext and libart are not
> supported for now, cause they don't have a static version information.

I changed the patch a little bit, so it takes now the version, that is
delivered by pkg-config for gstreamer, gtkglext and libart.

For gdkpixbuf the pc-file got build, but I have no clue how to install
it.

bonobo and bonoboui provide no version information in the ruby version.
Maybe this shall be changed. For now I have excluded them.

Cheers, detlef
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2009-06-03 14:48
(Received via mailing list)
Hi,

In <20090603121059.a7060ba6.detlef.reichl@gmx.org>
  "Re: [ruby-gnome2-devel-en] Support for pkgconfig" on Wed, 3 Jun 2009
12:10:59 +0200,
  Detlef Reichl <detlef.reichl@gmx.org> wrote:

>> bonobo, bonoboui, gdkpixbuf, gstreamer, gtkglext and libart are not
>> supported for now, cause they don't have a static version information.
>
> I changed the patch a little bit, so it takes now the version, that is
> delivered by pkg-config for gstreamer, gtkglext and libart.

What about passing .pc related information as arguments of
create_pkg_config_file instead of creating pkgconfig.rb?

  def create_pkg_config_file(module_name, h_file_name, pc_file)
    ...
  end

You can write
  File.new(@pc_out_file_name, File::CREAT|File::TRUNC|File::RDWR, 0644)
as
  File.new(@pc_out_file_name, "w+", 0644)

> For gdkpixbuf the pc-file got build, but I have no clue how to install
> it.

Changes in create_top_makefile should be done in ./src/depend
file. (./depend for Ruby/GdkPixbuf)

> bonobo and bonoboui provide no version information in the ruby version.
> Maybe this shall be changed. For now I have excluded them.

You can add it.


Thanks,
--
kou
4913bcb685792f601ae9813b4713abb9?d=identicon&s=25 Detlef Reichl (Guest)
on 2009-06-03 18:59
(Received via mailing list)
Hi,

Kouhei Sutou schrieb:
>
> What about passing .pc related information as arguments of
> create_pkg_config_file instead of creating pkgconfig.rb?
>

the simplest solutions often the best :-)

>
> Changes in create_top_makefile should be done in ./src/depend
> file. (./depend for Ruby/GdkPixbuf)
>
Ahh, learned something new. Thanks!


> > bonobo and bonoboui provide no version information in the ruby version.
> > Maybe this shall be changed. For now I have excluded them.
>
> You can add it.

Done and committed.

Cheers, detlef


--
http://det.cable.nu
5f1937e6efb5c6b0d698cc060f8cce35?d=identicon&s=25 Yaakov (cygwin ports) (yselkowitz)
on 2009-07-29 09:10
Attachment: 0.19.1-pkgconfig-install.patch (8 KB)
Detlef Reichl wrote:
> Done and committed.

I have several issues related to the pkgconfig files in 0.19.1:

1) The DESTDIR build is broken because nothing assures that
$(libdir)/pkgconfig exists before installing files there.  Patch against
SVN trunk attached.

2) If vte-0.20 is present, no vte-ruby.pc is created at all, and hence
'make install' fails due to the missing file.  I can make a patch for
this as well, but exactly how depends on:

3) What exactly is Version: supposed to represent, the rg2 version or
the version of the C library it is built against?  Most contain the
latter, except for glib/gtk/rsvg which all use
glib/src/rbglib.h(RBGLIB_*_VERSION) and hence have "0.19.1".  IMHO it
should be the rg2 version, but whichever way it should at least be
consistent.


Yaakov
Ruby/GtkSourceView2 maintainer
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2009-08-01 12:59
(Received via mailing list)
Hi,

In <a8a388d81a7b2a258bf3b7842f17c9fd@ruby-forum.com>
  "Re: [ruby-gnome2-devel-en] Support for pkgconfig" on Wed, 29 Jul 2009
09:10:48 +0200,
  "Yaakov (cygwin ports)" <ruby-forum-incoming@andreas-s.net> wrote:

> 1) The DESTDIR build is broken because nothing assures that
> $(libdir)/pkgconfig exists before installing files there.  Patch against
> SVN trunk attached.

Please commit.

> 2) If vte-0.20 is present, no vte-ruby.pc is created at all, and hence
> 'make install' fails due to the missing file.  I can make a patch for
> this as well, but exactly how depends on:

Please.

> 3) What exactly is Version: supposed to represent, the rg2 version or
> the version of the C library it is built against?  Most contain the
> latter, except for glib/gtk/rsvg which all use
> glib/src/rbglib.h(RBGLIB_*_VERSION) and hence have "0.19.1".  IMHO it
> should be the rg2 version, but whichever way it should at least be
> consistent.

We should provide Ruby-GNOME2 version as BINDING_VERSION.
Could you fix it like Ruby/GLib2, Ruby/GTK+ and Ruby/RSVG?


Thanks,
--
kou
5f1937e6efb5c6b0d698cc060f8cce35?d=identicon&s=25 Yaakov (cygwin ports) (yselkowitz)
on 2009-08-02 08:27
Kouhei Sutou wrote:
> Yaakov (cygwin ports) wrote:
>> 1) The DESTDIR build is broken because nothing assures that
>> $(libdir)/pkgconfig exists before installing files there.  Patch against
>> SVN trunk attached.
>
> Please commit.

Done, r3682.

>> 2) If vte-0.20 is present, no vte-ruby.pc is created at all, and hence
>> 'make install' fails due to the missing file.  I can make a patch for
>> this as well, but exactly how depends on:
>
> Please.
>
>> 3) What exactly is Version: supposed to represent, the rg2 version or
>> the version of the C library it is built against?  Most contain the
>> latter, except for glib/gtk/rsvg which all use
>> glib/src/rbglib.h(RBGLIB_*_VERSION) and hence have "0.19.1".  IMHO it
>> should be the rg2 version, but whichever way it should at least be
>> consistent.
>
> We should provide Ruby-GNOME2 version as BINDING_VERSION.
> Could you fix it like Ruby/GLib2, Ruby/GTK+ and Ruby/RSVG?

Patch attached.


Yaakov
Ruby/GtkSourceView2 maintainer
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2009-08-02 11:03
(Received via mailing list)
Hi,

In <c630ab34985a2393bb22094953511b5c@ruby-forum.com>
  "Re: [ruby-gnome2-devel-en] Support for pkgconfig" on Sun, 2 Aug 2009
08:27:25 +0200,
  "Yaakov (cygwin ports)" <ruby-forum-incoming@andreas-s.net> wrote:

> Kouhei Sutou wrote:
>> Yaakov (cygwin ports) wrote:
>>> 1) The DESTDIR build is broken because nothing assures that
>>> $(libdir)/pkgconfig exists before installing files there.  Patch against
>>> SVN trunk attached.
>>
>> Please commit.
>
> Done, r3682.

Thanks.

>>> should be the rg2 version, but whichever way it should at least be
>>> consistent.
>>
>> We should provide Ruby-GNOME2 version as BINDING_VERSION.
>> Could you fix it like Ruby/GLib2, Ruby/GTK+ and Ruby/RSVG?
>
> Patch attached.

First please do 2). 3) is the next step.

I noticed that create_pkg_config_file's signature is strange
after I saw your patch. create_pkg_config_file's signature
should be:
  def create_pkg_config_file(out_file_name, version=nil)

And we provide ruby_gnome2_version method:
  def ruby_gnome2_version(glib_source_directory=nil)
    glib_source_directory ||= File.join(File.dirname(__FILE__), "..")
    # extract version from File.join(glib_source_directory, "rbglib.h")
    version
  end

We will use them like the following in extconf.rb:
  create_pkg_config_file("...-ruby.pc", ruby_gnome2_version)

What do you think about this?


Thanks,
--
kou
5f1937e6efb5c6b0d698cc060f8cce35?d=identicon&s=25 Yaakov (cygwin ports) (yselkowitz)
on 2009-08-03 19:51
Kouhei Sutou wrote:
> First please do 2). 3) is the next step.

The patch does both 2) and 3), since they are related.

> I noticed that create_pkg_config_file's signature is strange
> after I saw your patch. create_pkg_config_file's signature
> should be:
>   def create_pkg_config_file(out_file_name, version=nil)
>
> And we provide ruby_gnome2_version method:
>   def ruby_gnome2_version(glib_source_directory=nil)
>     glib_source_directory ||= File.join(File.dirname(__FILE__), "..")
>     # extract version from File.join(glib_source_directory, "rbglib.h")
>     version
>   end
>
> We will use them like the following in extconf.rb:
>   create_pkg_config_file("...-ruby.pc", ruby_gnome2_version)
>
> What do you think about this?

Patch against trunk attached for review.


Yaakov
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2009-08-04 12:54
(Received via mailing list)
Hi,

In <406779d3949d162d243571008eae483f@ruby-forum.com>
  "Re: [ruby-gnome2-devel-en] Support for pkgconfig" on Mon, 3 Aug 2009
19:51:50 +0200,
  "Yaakov (cygwin ports)" <ruby-forum-incoming@andreas-s.net> wrote:

>> And we provide ruby_gnome2_version method:
>
> Patch against trunk attached for review.

Please commit. If there is a bug, we will fix it after your
commit.


Thanks,
--
kou
5f1937e6efb5c6b0d698cc060f8cce35?d=identicon&s=25 Yaakov (cygwin ports) (yselkowitz)
on 2009-08-04 21:43
Kouhei Sutou wrote:
> Please commit. If there is a bug, we will fix it after your
> commit.

I discovered an issue with the patch.  Two .pc files were renamed:
libgnome-2.0-ruby.pc -> libgnomeui-2.0-ruby.pc and poppler-ruby.pc ->
poppler-glib-ruby.pc.

The problem is that create_pkg_config_file() requires that the ruby .pc
filename match that of the respective C library with the '-ruby.pc'
suffix.  In the first case, Ruby/Gnome2 binds both libgnome-2.0 and
libgnomeui-2.0; in the second, Ruby/Poppler bindings libpoppler-glib but
the module is simply called 'poppler'.  Furthermore, with gtkmozembed,
the .pc file may be any of 5 different names but the ruby module has the
same name regardless of which it is built against.

Perhaps for consistency we should consider changing the naming scheme of
the .pc files:

def create_pkg_config_file(ruby_mod_name, c_package, version=nil)
  version ||= PKGConfig.modversion c_package
  pc_file = File.new('ruby-' + ruby_mod_name + '.pc', 'w+', 0644)
  ...

with each module doing:

create_pkg_config_file(PACKAGE_NAME, PACKAGE_ID, ruby_gnome2_version)

thereby creating ruby-glib2.pc, ruby-atk.pc, ruby-poppler.pc, etc.

OTOH, as there was already one (unstable) release with the existing
names, would it be too late to change this?

Please advise.


Yaakov
5f1937e6efb5c6b0d698cc060f8cce35?d=identicon&s=25 Yaakov (cygwin ports) (yselkowitz)
on 2009-08-04 22:39
Attachment: 0.19.2-pkgconfig-rename.patch (30 KB)
Yaakov (cygwin ports) wrote:
> Perhaps for consistency we should consider changing the naming scheme of
> the .pc files:
>
> def create_pkg_config_file(ruby_mod_name, c_package, version=nil)
>   version ||= PKGConfig.modversion c_package
>   pc_file = File.new('ruby-' + ruby_mod_name + '.pc', 'w+', 0644)
>   ...
>
> with each module doing:
>
> create_pkg_config_file(PACKAGE_NAME, PACKAGE_ID, ruby_gnome2_version)
>
> thereby creating ruby-glib2.pc, ruby-atk.pc, ruby-poppler.pc, etc.

Patch against trunk attached.  Please let me know how you wish to
proceed.


Yaakov
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2009-08-09 16:59
(Received via mailing list)
Hi,

In <f2f80bf282b860f60d44029a61d34945@ruby-forum.com>
  "Re: [ruby-gnome2-devel-en] Support for pkgconfig" on Tue, 4 Aug 2009
21:43:24 +0200,
  "Yaakov (cygwin ports)" <ruby-forum-incoming@andreas-s.net> wrote:

>
> def create_pkg_config_file(ruby_mod_name, c_package, version=nil)
>   version ||= PKGConfig.modversion c_package
>   pc_file = File.new('ruby-' + ruby_mod_name + '.pc', 'w+', 0644)
>   ...
>
> with each module doing:
>
> create_pkg_config_file(PACKAGE_NAME, PACKAGE_ID, ruby_gnome2_version)
>
> thereby creating ruby-glib2.pc, ruby-atk.pc, ruby-poppler.pc, etc.

OK. Please commit your patch.

> OTOH, as there was already one (unstable) release with the existing
> names, would it be too late to change this?

We can change it because the current naming rule doesn't
follow convention. Many .pc uses prefix (e.g. Clutter uses
clutter- prefix) not suffix.

Packagers, I'm so sorry...

Thanks,
--
kou
5f1937e6efb5c6b0d698cc060f8cce35?d=identicon&s=25 Yaakov (cygwin ports) (yselkowitz)
on 2009-08-10 02:09
Kouhei Sutou wrote:
> OK. Please commit your patch.

Committed to trunk, r3684.

> Packagers, I'm so sorry...

0.19 is meant to be an unstable/development series, after all.


Yaakov
This topic is locked and can not be replied to.