After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 568220 - need pkg-config file
need pkg-config file
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks: 568287
 
 
Reported: 2009-01-18 21:49 UTC by Christian Persch
Modified: 2009-01-25 15:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] Bug 568220 – need pkg-config file (3.44 KB, patch)
2009-01-18 21:59 UTC, Christian Persch
none Details | Review
[PATCH] Bug 568220 – need pkg-config file (1.65 KB, patch)
2009-01-20 18:13 UTC, Christian Persch
accepted-commit_now Details | Review

Description Christian Persch 2009-01-18 21:49:52 UTC
ssia
Comment 1 Christian Persch 2009-01-18 21:59:39 UTC
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(-)
Comment 2 Carlos Garcia Campos 2009-01-19 09:08:13 UTC
I think we need two different .pc files for every library. Evince backends depend only on libdocument. libview depends on libdocument. 
Comment 3 Tomeu Vizoso 2009-01-19 10:38:18 UTC
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.
Comment 4 Christian Persch 2009-01-19 20:08:52 UTC
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.

Comment 5 Tomeu Vizoso 2009-01-19 20:34:39 UTC
(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.
Comment 6 Carlos Garcia Campos 2009-01-20 09:27:41 UTC
(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. 
Comment 7 Christian Persch 2009-01-20 18:13:15 UTC
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(-)
Comment 8 Christian Persch 2009-01-20 18:14:20 UTC
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?
Comment 9 Carlos Garcia Campos 2009-01-21 09:34:20 UTC
(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!
Comment 10 Christian Persch 2009-01-21 17:01:35 UTC
Fixed & committed.
Comment 11 Tomeu Vizoso 2009-01-21 17:32:02 UTC
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
Comment 12 Christian Persch 2009-01-21 17:38:00 UTC
You're including them wrongly. I commented in bug 568287.
Comment 13 Christian Persch 2009-01-21 19:05:08 UTC
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?
Comment 14 Nickolay V. Shmyrev 2009-01-21 23:12:09 UTC
(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
Comment 15 Tomeu Vizoso 2009-01-22 09:38:35 UTC
nsh++
Comment 16 Carlos Garcia Campos 2009-01-22 10:07:11 UTC
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. 
Comment 17 Carlos Garcia Campos 2009-01-25 11:15:34 UTC
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. 
Comment 18 Christian Persch 2009-01-25 15:09:28 UTC
Committed.