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

Bug#1059341: gir1.2-cscreensaver-1.0: contains 900K of GIR XML which shouldn't usually be necessary on end user systems



Package: gir1.2-cscreensaver-1.0
Version: 5.8.1-2
Severity: normal
X-Debbugs-Cc: gobject-introspection@packages.debian.org

In addition to the binary typelib (about 50K), gir1.2-cscreensaver-1.0
contains GIR XML (about 900K). This is not right for the conventional
way to package GObject-Introspection modules, and is probably a waste of
space on end-user systems.

Typelib files are normally used by bindings for dynamic languages like
Python (PyGI), JavaScript (gjs, cjs, seed) or Perl
(Glib::Object::Introspection), as an equivalent of a C/C++ shared library.
If I understand correctly, cinnamon-screensaver is mostly written in Python,
and uses C code from libcscreensaver0 via gir1.2-cscreensaver-1.0 and PyGI.

GIR XML is normally used by bindings for static languages like C++, Rust
or Haskell, and are closer to an equivalent of C/C++ header files. They
contain a superset of the information in the equivalent typelib file,
in a less efficient but easier-to-parse encoding. I suspect that
cinnamon-screensaver doesn't actually need this.

On #1057391, Fabio Fantoni wrote:
> user testing cinnamon 6 on sid spotted -dev package in
> gir1.2-cscreensaver-1.0 actually not present, so I suppose added from recent
> dh_girepository changes. upstream have all in libcscreensaver0, so I created
> at least gir1.2-cscreensaver-1.0 in 5.4.1-2 to solve the policy issue (I not
> tried to do a PR for upstream now) but I put also gir file in it instead
> create -dev package for only it. I must create gir1.2-cscreensaver-1.0-dev
> with gir and all needed -dev deps or is possible remove the -dev deps?

If I'm understanding the question correctly, the right answer depends
on whether this is a public or private library.

I see that the way src:cinnamon-screensaver packages its shared library
libcscreensaver0 seems to be a mixture of public and private library,
which might indicate some confusion about its role. Is this library
private to src:cinnamon-screensaver and not intended to be used by other
packages? Or is it a public library that can be used by third-party
software, like GTK or libsoup? Or is there some more complicated situation?

If it's a private library
=========================

One option is to say that it's a private library, like the libgc.so
that is part of src:gnome-characters.

If it's this, then:

- the shared library should be in a non-default library path, like maybe
  /usr/lib/${DEB_HOST_MULTIARCH}/cinnamon-screensaver/
  (gnome-characters uses /usr/lib/${DEB_HOST_MULTIARCH}/org.gnome.Characters/)
  and the main executable should use the LD_LIBRARY_PATH environment
  variable, a DT_RUNPATH ELF header (gcc -Wl,-rpath), or
  g_irepository_prepend_library_path() to load it

- the typelib should also be in a non-default location, like maybe
  /usr/lib/${DEB_HOST_MULTIARCH}/cinnamon-screensaver/
  (gnome-characters uses
  /usr/lib/${DEB_HOST_MULTIARCH}/org.gnome.Characters/girepository-1.0/),
  and the main executable should use the GI_TYPELIB_PATH environment
  variable or g_irepository_prepend_search_path() to load it

- it's correct for the C/C++ header files not to be installed

- the GIR XML should either not be installed, or be installed in a
  non-default location, like maybe /usr/share/cinnamon-screensaver/

- everything can be in one large binary package

- it's probably unnecessary to run dh_girepository, because everything
  is in one large binary package anyway - although you will want to depend
  on gir1.2-gtk-3.0, either via dh_girepository or directly

src:gnome-characters seems to be a good example of this setup.

If it's a public library
========================

Another option is to say that it's a public library, like the libcheese.so.*
and libcheese-gtk.so.* that are part of src:cheese.

If it's this, then:

- the shared library should continue to be in
  /usr/lib/${DEB_HOST_MULTIARCH}/ in a libcscreensaver0 binary package

- the typelib should continue to be in
  /usr/lib/${DEB_HOST_MULTIARCH}/girepository-1.0/ in a
  gir1.2-cscreensaver-1.0 binary package

- the C/C++ header files should be installed in a new -dev package,
  probably libcscreensaver-dev, so that other C/C++ code can link to the
  library

- the GIR XML should continue to be in /usr/share/gir-1.0/ but should be
  moved into the new -dev package, which should have Depends: ${gir:Depends}
  and Provides: ${gir:Provides}

- multiple, separate binary packages will be needed

- dh_girepository should be used

src:flatpak is a good example of this setup.

If it's something more complicated
==================================

If there's some more complicated situation, like the forks of Clutter and
Cogl in src:mutter and src:muffin, then please explain, and I or other
members of the GNOME team can try to come up with a recommendation.

Thanks,
    smcv


Reply to: