GNOME Bugzilla – Bug 568220
need pkg-config file
Last modified: 2009-01-25 15:09:28 UTC
ssia
Created attachment 126722 [details] [review] [PATCH] Bug 568220 – need pkg-config file Makefile.am | 3 +++ configure.ac | 1 + evince.pc.in | 11 +++++++++++ libdocument/Makefile.am | 4 ++-- libview/Makefile.am | 10 +++++----- 5 files changed, 22 insertions(+), 7 deletions(-)
I think we need two different .pc files for every library. Evince backends depend only on libdocument. libview depends on libdocument.
This worked fine for me for adding evince python bindings to gnome-python-desktop, though had to modify evince.pc.in in this way: prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/evince/@EV_API_VERSION@ Name: Evince Description: GNOME document viewer backend and view libraries Version: @VERSION@ Requires: glib-2.0 gthread-2.0 gio-2.0 gtk+-2.0 Libs: -L${libdir} -levview -levbackend Cflags: -I${includedir}/ev-view -I${includedir}/ev-backend Carlos' suggestion of splitting the pc makes sense to me, though python-evince wouldn't care much.
I'll fix the patch to produce two pc files instead. Cflags: -I${includedir}/ev-view -I${includedir}/ev-backend That depends on how we want to present these includes: #include <ev-backend/ev-something.h> or #include <ev-something.h> ? I like the first one better, and it's also the one taken by gtk etc.
(In reply to comment #4) > > I like the first one better, and it's also the one taken by gtk etc. Sounds good to me. Also, if I can do anything about this or the two bugs below, will have time tomorrow morning: http://bugzilla.gnome.org/show_bug.cgi?id=567787 http://bugzilla.gnome.org/show_bug.cgi?id=567790 Then I will ask for the API break exception so python-evince gets into gnome-python-desktop in this cycle.
(In reply to comment #4) > I'll fix the patch to produce two pc files instead. > > Cflags: -I${includedir}/ev-view -I${includedir}/ev-backend > > That depends on how we want to present these includes: > > #include <ev-backend/ev-something.h> > > or > > #include <ev-something.h> ? > > I like the first one better, and it's also the one taken by gtk etc. > me too.
Created attachment 126852 [details] [review] [PATCH] Bug 568220 – need pkg-config file Add separate pc files for the backend and view libraries. --- Makefile.am | 5 +++++ configure.ac | 3 +++ evince-backend.pc.in | 11 +++++++++++ evince-view.pc.in | 11 +++++++++++ 4 files changed, 30 insertions(+), 0 deletions(-)
I made them both use the same EV_API_VERSION. Or do you think it'll be necessary to separately version the backend and the view libs?
(In reply to comment #8) > I made them both use the same EV_API_VERSION. Or do you think it'll be > necessary to separately version the backend and the view libs? > it's ok, I think it's important to have different versions for the soname, but we can keep the same API_VERSION like GTK+ and GDK. Patch looks good to me, the only thing is that libevview requires libevbackend. Change this and commit it, please. Thanks!
Fixed & committed.
I'm a bit confused about how we can build against libevview in this way. I'm getting this error when trying to build the python bindings: 18:21:14 runner system command -> ['/usr/bin/gcc', '-fPIC', '-DPIC', '-pthread', '-fno-strict-aliasing', '-Idefault', '-I..', '-I/home/tomeu/sugar-jhbuild/install/include/evince/2.25', '-I/home/tomeu/sugar-jhbuild/install/include/gtk-2.0', '-I/home/tomeu/sugar-jhbuild/install/include/glib-2.0', '-I/home/tomeu/sugar-jhbuild/install/lib/glib-2.0/include', '-I/home/tomeu/sugar-jhbuild/install/lib/gtk-2.0/include', '-I/home/tomeu/sugar-jhbuild/install/include/pygtk-2.0', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/pango-1.0', '-I/usr/include/pixman-1', '-I/usr/include/freetype2', '-I/usr/include/libpng12', '-I/usr/include/pygtk-2.0', '-I/usr/include/python2.5', '-DHAVE_CONFIG_H', 'default/evince/evince.c', '-c', '-o', 'default/evince/evince_2.o'] In file included from ../evince/evince.override:19: /home/tomeu/sugar-jhbuild/install/include/evince/2.25/ev-view/ev-view.h:25:25: error: ev-document.h: No such file or directory /home/tomeu/sugar-jhbuild/install/include/evince/2.25/ev-view/ev-view.h:26:21: error: ev-link.h: No such file or directory
You're including them wrongly. I commented in bug 568287.
Ok, I see the where the problem is. While it's fine for things inside ev-view to #include "other file inside ev-view", it doesn't work to do so for things in ev-backend. To fix that, we could make things in ev-view/ include <ev-backend/ev-thing.h> (and would need to rename libdocument to ev-backend in svn too probably). Opinions, other ideas?
(02:03:14) nsh: heh, that renaming goes too far (02:03:22) nsh: why not use a single pc files (02:04:07) nsh: and install in /usr/include/evince/2.0/libdocument and libview respectively (02:04:12) nsh: as it's in sources (02:04:26) nsh: that will save a lot of maintaince and other work
nsh++
The point of having two different pc files is because if someone wants to write a new backend (chm support for instance) he/she would only want to link to libevbackend, libevview is not needed to write evince backends. For someone who wants to embed EvView into another application it's not a problem, since libevview depends on libevbackend. Remember we have two different uses cases here: backends writers and embedders.
I think we finally have an agreement for this. My proposal is to rename libevbackend as libevdocument and install the headers under prefix/evince/version/libdocument and libview so that it matches the sources tree layout. In combination with bug #568227, which should install single headers evince-view.h and evince-document.h, it would fix all the pending issues regarding the libraries. If there aren't objections, Christian please, feel free to commit the patches needed.
Committed.