Enabling gobject-introspection support in gtk3 builds

Rene Engelhard rene at debian.org
Sat Sep 12 12:13:07 PDT 2015


On Fri, Sep 11, 2015 at 12:09:06PM +0200, Miklos Vajna wrote:
> The commit to enable that for distributions is at
> <https://gerrit.libreoffice.org/#/c/18494/>. configure is updated to
> check for the newly required necessary tools. My understanding is that
[...]> 
> Knowing that, am I OK to push the patch to master?

I tried a build with the patch. Should work mostly, but it fails to "link":

g-ir-scanner: compile: x86_64-linux-gnu-gcc -Wno-deprecated-declarations -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I/usr/include/gobject-introspection-1.0 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/home/rene/LibreOffice/git/master/include -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c -o /tmp/distro-pack-desktop-integration-VhEXE5/tmp-introspect0r_64c/LOKDocView-0.1.o /tmp/distro-pack-desktop-integration-VhEXE5/tmp-introspect0r_64c/LOKDocView-0.1.c
g-ir-scanner: link: x86_64-linux-gnu-gcc -o /tmp/distro-pack-desktop-integration-VhEXE5/tmp-introspect0r_64c/LOKDocView-0.1 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro /tmp/distro-pack-desktop-integration-VhEXE5/tmp-introspect0r_64c/LOKDocView-0.1.o -L. -Wl,-rpath=. -Wl,--no-as-needed -llibreofficekitgtk -L/usr/lib/libreoffice/program/libreofficekitgtk -Wl,-rpath=/usr/lib/libreoffice/program/libreofficekitgtk -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0
/usr/bin/ld: cannot find -llibreofficekitgtk
collect2: error: ld returned 1 exit status
linking of temporary binary failed: Command '['x86_64-linux-gnu-gcc', '-o', '/tmp/distro-pack-desktop-integration-VhEXE5/tmp-introspect0r_64c/LOKDocView-0.1', '-D_FORTIFY_SOURCE=2', '-g', '-O2', '-fstack-protector-strong', '-Wformat', '-Werror=format-security', '-Wl,-z,relro', '/tmp/distro-pack-desktop-integration-VhEXE5/tmp-introspect0r_64c/LOKDocView-0.1.o', '-L.', '-Wl,-rpath=.', '-Wl,--no-as-needed', '-llibreofficekitgtk', '-L/usr/lib/libreoffice/program/libreofficekitgtk', '-Wl,-rpath=/usr/lib/libreoffice/program/libreofficekitgtk', '-lgio-2.0', '-lgobject-2.0', '-Wl,--export-dynamic', '-lgmodule-2.0', '-pthread', '-lglib-2.0']' returned non-zero exit status 1
error parsing file /home/rene/LibreOffice/git/master/debian/tmp//usr/share/gir-1.0/LOKDocView-0.1.gir: Failed to open file '/home/rene/LibreOffice/git/master/debian/tmp//usr/share/gir-1.0/LOKDocView-0.1.gir': No such file or directory

It says /program/libreofficekitgtk as the directory, which doesn't exist anywhere.

When fixing that to just /progrem it tries to pick up my systems liblibreofficekit.so which is "of course" still the 5.0.2 one (so missing symbols and built
with gtk):

g-ir-scanner: compile: x86_64-linux-gnu-gcc -Wno-deprecated-declarations -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I/usr/include/gobject-introspection-1.0 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/home/rene/LibreOffice/git/master/include -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c -o /tmp/distro-pack-desktop-integration-g3mH1m/tmp-introspectYYW53V/LOKDocView-0.1.o /tmp/distro-pack-desktop-integration-g3mH1m/tmp-introspectYYW53V/LOKDocView-0.1.c
g-ir-scanner: link: x86_64-linux-gnu-gcc -o /tmp/distro-pack-desktop-integration-g3mH1m/tmp-introspectYYW53V/LOKDocView-0.1 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro /tmp/distro-pack-desktop-integration-g3mH1m/tmp-introspectYYW53V/LOKDocView-0.1.o -L. -Wl,-rpath=. -Wl,--no-as-needed -llibreofficekitgtk -L/usr/lib/libreoffice/program -Wl,-rpath=/usr/lib/libreoffice/program -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0
/tmp/distro-pack-desktop-integration-g3mH1m/tmp-introspectYYW53V/LOKDocView-0.1.o:(.data+0x0): undefined reference to `lok_doc_view_get_type'
collect2: error: ld returned 1 exit status
linking of temporary binary failed: Command '['x86_64-linux-gnu-gcc', '-o', '/tmp/distro-pack-desktop-integration-g3mH1m/tmp-introspectYYW53V/LOKDocView-0.1', '-D_FORTIFY_SOURCE=2', '-g', '-O2', '-fstack-protector-strong', '-Wformat', '-Werror=format-security', '-Wl,-z,relro', '/tmp/distro-pack-desktop-integration-g3mH1m/tmp-introspectYYW53V/LOKDocView-0.1.o', '-L.', '-Wl,-rpath=.', '-Wl,--no-as-needed', '-llibreofficekitgtk', '-L/usr/lib/libreoffice/program', '-Wl,-rpath=/usr/lib/libreoffice/program', '-lgio-2.0', '-lgobject-2.0', '-Wl,--export-dynamic', '-lgmodule-2.0', '-pthread', '-lglib-2.0']' returned non-zero exit status 1
error parsing file /home/rene/LibreOffice/git/master/debian/tmp//usr/share/gir-1.0/LOKDocView-0.1.gir: Failed to open file '/home/rene/LibreOffice/git/master/debian/tmp//usr/share/gir-1.0/LOKDocView-0.1.gir': No such file or directory

And if it wouldn't be installed like in a clean chroot, it would also fail, no?

So I think one wants to change

             --library=libreofficekitgtk --library-path="${INSTALLDIR}/program/libreofficekitgtk" \

into

             --library=libreofficekitgtk --library-path="${DESTDIR}/${INSTALLDIR}/program/libreofficekitgtk" \

so that a) the path is correct (/program) and b) it looks where the stuff is
installed to, not in the system.

That then results in

g-ir-scanner: compile: x86_64-linux-gnu-gcc -Wno-deprecated-declarations -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I/usr/include/gobject-introspection-1.0 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/home/rene/LibreOffice/git/master/include -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c -o /tmp/distro-pack-desktop-integration-kLYoER/tmp-introspecty8Ezce/LOKDocView-0.1.o /tmp/distro-pack-desktop-integration-kLYoER/tmp-introspecty8Ezce/LOKDocView-0.1.c
g-ir-scanner: link: x86_64-linux-gnu-gcc -o /tmp/distro-pack-desktop-integration-kLYoER/tmp-introspecty8Ezce/LOKDocView-0.1 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro /tmp/distro-pack-desktop-integration-kLYoER/tmp-introspecty8Ezce/LOKDocView-0.1.o -L. -Wl,-rpath=. -Wl,--no-as-needed -llibreofficekitgtk -L/home/rene/LibreOffice/git/master/debian/tmp//usr/lib/libreoffice/program -Wl,-rpath=/home/rene/LibreOffice/git/master/debian/tmp//usr/lib/libreoffice/program -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0
home/rene/LibreOffice/git/master/libreofficekit/source/gtk/lokdocview.cxx:1843: Warning: LOKDocView: lok_doc_view_get_document: return value: Unresolved type: 'LibreOfficeKitDocument*'

This builds, but I am not sure what negative side-effects the -Wl,-rpath=/home/rene/LibreOffice/git/master/debian/tmp//usr/lib/libreoffice/program to the *build* directory has...
Probably none as it's a temporary binary afaics, but...

Regards,

Rene


More information about the LibreOffice mailing list