Re: [vdr] [PATCH] Install headers, add pkgconfig file

2008-04-08 Thread Ville Skyttä
On Wednesday 12 March 2008, Ville Skyttä wrote:
> On Wednesday 12 March 2008, clemens kirchgatterer wrote:
> > On Tue, Mar 11, 2008 at 3:46 PM, Joerg Pulz <[EMAIL PROTECTED]> 
wrote:
> > >  Out of this four cases (there are probably more, one for every Linux
> > >  distribution on this planet), tell me which is the most reasonable
> > >  default?
> >
> > the most reasonable default is simply to put vdr.pc in
> > [$(DESTDIR)/]$(PREFIX)/lib/pkgconfig. for cases that this is not
> > appropriate, there is $PKG_CONFIG_PATH.
>
> Agreed.  The second revision of the patch is attached; compared to the
> first one this also installs the *.pc file to the first (colon separated)
> component of $PKG_CONFIG_PATH, or to $(PREFIX)/lib/pkgconfig if
> $PKG_CONFIG_PATH is not set in the environment.  Unless I've missed
> something, as far as I'm concerned this is good enough to go in.

Here's the third revision, after a bit more testing.  As a result of that, 
there were a couple of minor bug fixes, most notable of which was to the 
install-includes target.
--- Makefile.orig	2008-02-29 23:43:03.0 +0200
+++ Makefile	2008-04-04 20:18:51.0 +0300
@@ -19,6 +19,7 @@
 PREFIX  ?= /usr/local
 MANDIR   = $(PREFIX)/share/man
 BINDIR   = $(PREFIX)/bin
+INCLUDEDIR = $(PREFIX)/include
 LOCDIR   = ./locale
 LIBS = -ljpeg -lpthread -ldl -lcap -lrt -lfreetype -lfontconfig
 INCLUDES = -I/usr/include/freetype2
@@ -32,6 +33,8 @@
 DOXYGEN  = /usr/bin/doxygen
 DOXYFILE = Doxyfile
 
+PCDIR   ?= $(firstword $(subst :, , ${PKG_CONFIG_PATH}:$(PREFIX)/lib/pkgconfig))
+
 -include Make.config
 
 SILIB= $(LSIDIR)/libsi.a
@@ -75,7 +78,7 @@
 DEFINES += -DVFAT
 endif
 
-all: vdr i18n
+all: vdr i18n vdr.pc
 
 # Implicit rules:
 
@@ -101,6 +104,23 @@
 $(SILIB):
 	$(MAKE) -C $(LSIDIR) all
 
+# pkg-config file:
+
+vdr.pc: Makefile
+	echo "bindir=$(BINDIR)" > $@
+	echo "includedir=$(INCLUDEDIR)" >> $@
+	echo "configdir=$(CONFDIR)" >> $@
+	echo "videodir=$(VIDEODIR)" >> $@
+	echo "plugindir=$(PLUGINLIBDIR)" >> $@
+	echo "localedir=$(LOCDIR)" >> $@
+	echo "apiversion=$(APIVERSION)" >> $@
+	echo "" >> $@
+	echo "Name: VDR" >> $@
+	echo "Description: Video Disk Recorder" >> $@
+	echo "URL: http://www.cadsoft.de/vdr/"; >> $@
+	echo "Version: $(VDRVERSION)" >> $@
+	echo "Cflags: $(CXXFLAGS) -I$${includedir}" >> $@
+
 # Internationalization (I18N):
 
 PODIR = po
@@ -161,7 +181,8 @@
 
 # Install the files:
 
-install: install-bin install-conf install-doc install-plugins install-i18n
+install: install-bin install-conf install-doc install-plugins install-i18n \
+	install-includes install-pc
 
 # VDR binary:
 
@@ -192,6 +213,20 @@
 	@mkdir -p $(DESTDIR)$(PLUGINLIBDIR)
 	@cp --remove-destination $(PLUGINDIR)/lib/lib*-*.so.$(APIVERSION) $(DESTDIR)$(PLUGINLIBDIR)
 
+# Headers:
+
+install-includes: include-dir
+	@mkdir -p $(DESTDIR)$(INCLUDEDIR)
+	@cp -pLR include/vdr include/libsi $(DESTDIR)$(INCLUDEDIR)
+
+# pkg-config file:
+
+install-pc: vdr.pc
+	if [ -n "$(PCDIR)" ] ; then \
+	mkdir -p $(DESTDIR)$(PCDIR) ; \
+	cp vdr.pc $(DESTDIR)$(PCDIR) ; \
+	fi
+
 # Source documentation:
 
 srcdoc:
@@ -204,7 +239,7 @@
 
 clean:
 	$(MAKE) -C $(LSIDIR) clean
-	-rm -f $(OBJS) $(DEPFILE) vdr core* *~
+	-rm -f $(OBJS) $(DEPFILE) vdr vdr.pc core* *~
 	-rm -rf $(LOCALEDIR) $(PODIR)/*.mo $(PODIR)/*.pot
 	-rm -rf include
 	-rm -rf srcdoc
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] [PATCH] Install headers, add pkgconfig file

2008-03-12 Thread Ville Skyttä
On Wednesday 12 March 2008, clemens kirchgatterer wrote:
> On Tue, Mar 11, 2008 at 3:46 PM, Joerg Pulz <[EMAIL PROTECTED]> wrote:
> >  Out of this four cases (there are probably more, one for every Linux
> >  distribution on this planet), tell me which is the most reasonable
> >  default?
>
> the most reasonable default is simply to put vdr.pc in
> [$(DESTDIR)/]$(PREFIX)/lib/pkgconfig. for cases that this is not
> appropriate, there is $PKG_CONFIG_PATH.

Agreed.  The second revision of the patch is attached; compared to the first 
one this also installs the *.pc file to the first (colon separated) component 
of $PKG_CONFIG_PATH, or to $(PREFIX)/lib/pkgconfig if $PKG_CONFIG_PATH is not 
set in the environment.  Unless I've missed something, as far as I'm 
concerned this is good enough to go in.

By the way, if someone's interested, the bug I reported against pkg-config 
because it can't be queried for its default *.pc dirs is 
https://bugs.freedesktop.org/show_bug.cgi?id=14975
--- Makefile.orig	2008-03-06 21:29:58.0 +0200
+++ Makefile	2008-03-12 22:41:54.0 +0200
@@ -21,2 +21,3 @@
 BINDIR   = $(PREFIX)/bin
+INCLUDEDIR = $(PREFIX)/include
 LOCDIR   = ./locale
@@ -34,2 +35,4 @@
 
+PCDIR   ?= $(firstword $(subst :, , ${PKG_CONFIG_PATH}:$(PREFIX)/lib/pkgconfig))
+
 -include Make.config
@@ -77,3 +80,3 @@
 
-all: vdr i18n
+all: vdr i18n vdr.pc
 
@@ -103,2 +106,19 @@
 
+# pkg-config file:
+
+vdr.pc: Makefile
+	echo "bindir=$(BINDIR)" > $@
+	echo "includedir=$(INCLUDEDIR)" >> $@
+	echo "confdir=$(CONFDIR)" >> $@
+	echo "videodir=$(VIDEODIR)" >> $@
+	echo "plugindir=$(PLUGINLIBDIR)" >> $@
+	echo "localedir=$(LOCDIR)" >> $@
+	echo "apiversion=$(APIVERSION)" >> $@
+	echo "" >> $@
+	echo "Name: VDR" >> $@
+	echo "Description: Video Disk Recorder" >> $@
+	echo "URL: http://www.cadsoft.de/vdr/"; >> $@
+	echo "Version: $(VDRVERSION)" >> $@
+	echo "Cflags: $(CXXFLAGS) -I$(INCLUDEDIR)" >> $@
+
 # Internationalization (I18N):
@@ -163,3 +183,4 @@
 
-install: install-bin install-conf install-doc install-plugins install-i18n
+install: install-bin install-conf install-doc install-plugins install-i18n \
+	install-includes install-pc
 
@@ -194,2 +215,16 @@
 
+# Headers:
+
+install-includes: include-dir
+	@mkdir -p $(DESTDIR)$(INCLUDEDIR)
+	@cp -pR include/vdr include/libsi $(DESTDIR)$(INCLUDEDIR)
+
+# pkg-config file:
+
+install-pc: vdr.pc
+	if [ -n "$(PCDIR)" ] ; then \
+	mkdir -p $(DESTDIR)$(PCDIR) ; \
+	cp vdr.pc $(DESTDIR)$(PCDIR) ; \
+	fi
+
 # Source documentation:
@@ -206,3 +241,3 @@
 	$(MAKE) -C $(LSIDIR) clean
-	-rm -f $(OBJS) $(DEPFILE) vdr core* *~
+	-rm -f $(OBJS) $(DEPFILE) vdr vdr.pc core* *~
 	-rm -rf $(LOCALEDIR) $(PODIR)/*.mo $(PODIR)/*.pot
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] [PATCH] Install headers, add pkgconfig file

2008-03-12 Thread clemens kirchgatterer
On Wed, Mar 12, 2008 at 8:13 AM, clemens kirchgatterer <[EMAIL PROTECTED]> 
wrote:
> On Tue, Mar 11, 2008 at 3:46 PM, Joerg Pulz <[EMAIL PROTECTED]> wrote:
>
>  >  Out of this four cases (there are probably more, one for every Linux
>  >  distribution on this planet), tell me which is the most reasonable
>  >  default?
>
>  the most reasonable default is simply to put vdr.pc in
>  [$(DESTDIR)/]$(PREFIX)/lib/pkgconfig. for cases that this is not
>  appropriate, there is $PKG_CONFIG_PATH.

i may add the reasoning: the only way i (as user) and up with software
installed in /usr/local/ is by compiling it myself. if i do so, i am
well aware of setting all relevant PATH variables as $PATH,
$LD_LIBRARY_PATH, $PKG_CONFIG_PATH. most likly these are allready set
for /usr/local in the systems default /etc/profile.

clemens

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] [PATCH] Install headers, add pkgconfig file

2008-03-12 Thread clemens kirchgatterer
On Tue, Mar 11, 2008 at 3:46 PM, Joerg Pulz <[EMAIL PROTECTED]> wrote:

>  Out of this four cases (there are probably more, one for every Linux
>  distribution on this planet), tell me which is the most reasonable
>  default?

the most reasonable default is simply to put vdr.pc in
[$(DESTDIR)/]$(PREFIX)/lib/pkgconfig. for cases that this is not
appropriate, there is $PKG_CONFIG_PATH.

best regards ...
clemens

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] [PATCH] Install headers, add pkgconfig file

2008-03-11 Thread Joerg Pulz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On Tue, 11 Mar 2008, Matthias Schwarzott wrote:


On Dienstag, 11. März 2008, clemens kirchgatterer wrote:

On Tue, Mar 11, 2008 at 12:27 AM, Matthias Schwarzott <[EMAIL PROTECTED]>

wrote:

On Montag, 10. März 2008, Ville Skyttä wrote:

 So you can install .pc file anywhere you want if you add this location
to PKG_CONFIG_PATH.

 So /usr/bin/pkg-config will always look into /usr/lib/pkgconfig.
 We can either use
 A. $(DESTDIR)/usr/lib/pkgconfig
 or
 B. $(DESTDIR)$(PREFIX)/lib/pkgconfig

 For most installations A should be fine.


definitly B, otherwise it will not work for parallel installs of
different vdr versions in different $PREFIXes.



Ack!
BUT: B with default values from Makefile gives
/usr/local/lib/pkgconfig that by default is not in pkgconfig search-path.

And I wrote: "For most installations ..."


What would you think is the default?

case 1:
download pkg-config, extract it, run configure, make, make install
and you end up with pkg-config installed in /usr/local/bin and the default 
search path will be "/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig"

as the configure script sets:
pc_path='${libdir}/pkgconfig:${datadir}/pkgconfig'
if there is no '--with-pc_path=/my/path' given to configure.
case 2:
install an openSuSE-10.3 (i386) system with the prepackaged pkg-config RPM 
and you end up with pkg-config installed in /usr/bin and the default search 
path is "/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:

/usr/lib/pkgconfig:/usr/share/pkgconfig:/opt/kde3/lib/pkgconfig"
case 3:
install a Debian-4.0 (x86_64) system with the prepackaged pkg-config DEB 
and you end up with pkg-config installed in /usr/bin and the default 
search path is "/usr/local/lib/pkgconfig:

/usr/local/lib/pkgconfig/x86_64-linux-gnu:/usr/local/share/pkgconfig:
/usr/lib/pkgconfig:/usr/lib/pkgconfig/x86_64-linux-gnu:/usr/share/pkgconfig"
case 4:
install FreeBSD and install the prebuilt pkg-config package or built it by 
hand out of the ports tree and you end up with pkg-config installed in 
/usr/local/bin and the default search path is "/usr/local/libdata/pkgconfig:

/usr/local/lib/pkgconfig"

Out of this four cases (there are probably more, one for every Linux 
distribution on this planet), tell me which is the most reasonable 
default?


Joerg

- -- 
The beginning is the most important part of the work.

-Plato
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQFH1ps+SPOsGF+KA+MRAvWCAJ9Q8xP2Zywci6CxH+Y0dLhahaLo/ACeJsrR
xSPJC+0zZ/vWNoRm879qMTs=
=auza
-END PGP SIGNATURE-___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] [PATCH] Install headers, add pkgconfig file

2008-03-11 Thread Matthias Schwarzott
On Dienstag, 11. März 2008, clemens kirchgatterer wrote:
> On Tue, Mar 11, 2008 at 12:27 AM, Matthias Schwarzott <[EMAIL PROTECTED]> 
wrote:
> > On Montag, 10. März 2008, Ville Skyttä wrote:
> >
> >  So you can install .pc file anywhere you want if you add this location
> > to PKG_CONFIG_PATH.
> >
> >  So /usr/bin/pkg-config will always look into /usr/lib/pkgconfig.
> >  We can either use
> >  A. $(DESTDIR)/usr/lib/pkgconfig
> >  or
> >  B. $(DESTDIR)$(PREFIX)/lib/pkgconfig
> >
> >  For most installations A should be fine.
>
> definitly B, otherwise it will not work for parallel installs of
> different vdr versions in different $PREFIXes.
>

Ack!
BUT: B with default values from Makefile gives
/usr/local/lib/pkgconfig that by default is not in pkgconfig search-path.

And I wrote: "For most installations ..."

Matthias

-- 
Matthias Schwarzott (zzam)

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] [PATCH] Install headers, add pkgconfig file

2008-03-11 Thread clemens kirchgatterer
On Tue, Mar 11, 2008 at 12:27 AM, Matthias Schwarzott <[EMAIL PROTECTED]> wrote:

> On Montag, 10. März 2008, Ville Skyttä wrote:

>  So you can install .pc file anywhere you want if you add this location to
>  PKG_CONFIG_PATH.
>
>  So /usr/bin/pkg-config will always look into /usr/lib/pkgconfig.
>  We can either use
>  A. $(DESTDIR)/usr/lib/pkgconfig
>  or
>  B. $(DESTDIR)$(PREFIX)/lib/pkgconfig
>
>  For most installations A should be fine.

definitly B, otherwise it will not work for parallel installs of
different vdr versions in different $PREFIXes.

best regards ...
clemens
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] [PATCH] Install headers, add pkgconfig file

2008-03-10 Thread Matthias Schwarzott
On Montag, 10. März 2008, Ville Skyttä wrote:
> Hello,
>
> As discussed in the freetype/fontconfig pkgconfig thread, here's a combined
> patch implementing installation of VDR's headers and generating a pkgconfig
> *.pc file.
>
> This patch is mostly just a discussion draft - I haven't tried installing
> the headers and the pkgconfig file isn't installed yet by any "make
> install*" (mostly because very ironically, there's no way to query
> pkg-config for its default search path, which is something I've intended to
> report a bug about since a long time ago, but failed so far - maybe I'll do
> it right now :)).
>

Citing pkg-config manpage:
By default, pkg-config looks in the directory prefix/lib/pkgconfig for these 
files; it will also look in the  colon-separated  (on  Windows,  
semicolon-separated) list of directories specified by the PKG_CONFIG_PATH 
environment variable.

So you can install .pc file anywhere you want if you add this location to 
PKG_CONFIG_PATH.

So /usr/bin/pkg-config will always look into /usr/lib/pkgconfig.
We can either use
A. $(DESTDIR)/usr/lib/pkgconfig
or
B. $(DESTDIR)$(PREFIX)/lib/pkgconfig

For most installations A should be fine.

Matthias

-- 
Matthias Schwarzott (zzam)

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr