[DVDnav-discuss] [PATCH] pkgconfig support for libdvdnav

Dominik 'Rathann' Mierzejewski dominik at greysector.net
Sun Jul 13 17:03:27 CEST 2008


Hi.

This is a similar patch for libdvdnav. The only difference is that pkg-config
doesn't support --prefix, so I made configure2 check for $dvdreadconfig --cflags
output instead.

Patch attached. OK to apply? Dan, could you add the corresponding autotools
part?

Regards,
R.

-- 
Fedora http://fedoraproject.org/wiki/User:Rathann
Livna http://rpm.livna.org | MPlayer http://mplayerhq.hu
"Faith manages."
        -- Delenn to Lennier in Babylon 5:"Confessions and Lamentations"
-------------- next part --------------
diff -up libdvdnav-4.1.3/configure2.p libdvdnav-4.1.3/configure2
--- libdvdnav-4.1.3/configure2.p	2008-07-13 15:01:27.000000000 +0200
+++ libdvdnav-4.1.3/configure2	2008-07-13 16:54:25.000000000 +0200
@@ -103,13 +103,12 @@ test -z "$libdir" && libdir=$PREFIX/lib
 test -z "$shlibdir" && shlibdir=$PREFIX/lib
 test -z "$incdir" && incdir=$PREFIX/include/dvdnav
 
-DVDREAD=`$DVDREAD_CONFIG --prefix`
-if test -z "$DVDREAD" ; then
-  echo "dvdread-config --prefix returned an error. Can't proceed"
-  exit 1
-fi
 dvdread_cflags=`$DVDREAD_CONFIG --cflags`
 dvdread_libs=`$DVDREAD_CONFIG --libs`
+if test -z "$dvdread_cflags" ; then
+  echo "$DVDREAD_CONFIG --cflags returned an error. Can't proceed"
+  exit 1
+fi
 
 
 targetos=`uname -s`
diff -up libdvdnav-4.1.3/Makefile.p libdvdnav-4.1.3/Makefile
--- libdvdnav-4.1.3/Makefile.p	2008-06-08 11:25:29.000000000 +0200
+++ libdvdnav-4.1.3/Makefile	2008-07-13 16:55:13.000000000 +0200
@@ -40,7 +40,7 @@ BUILDDEPS = Makefile config.mak
 
 ifeq ($(BUILD_SHARED),yes)
 all:	$(SHLIB) $(MINI_SHLIB) dvdnav-config
-install: $(SHLIB) install-shared install-dvdnav-config
+install: $(SHLIB) install-shared install-dvdnav-config install-dvdnav.pc
 endif
 
 ifeq ($(BUILD_STATIC),yes)
@@ -140,6 +140,22 @@ install-dvdnav-config: dvdnav-config
 	install -d $(DESTDIR)$(PREFIX)/bin
 	install -m 0755 $(.OBJDIR)/dvdnav-config $(DESTDIR)$(PREFIX)/bin/dvdnav-config
 
+dvdnav.pc: $(.OBJDIR)
+	@echo 'prefix=/usr' > $(.OBJDIR)/dvdnav.pc
+	@echo 'libdir=$(shlibdir)' >> $(.OBJDIR)/dvdnav.pc
+	@echo 'includedir=/usr/include' >> $(.OBJDIR)/dvdnav.pc
+	@echo >> $(.OBJDIR)/dvdnav.pc
+	@echo 'Libs: -L$${libdir} -ldvdnav $(THREADLIB)' >> $(.OBJDIR)/dvdnav.pc
+	@echo 'Cflags: -I$${includedir}' >> $(.OBJDIR)/dvdnav.pc
+	@echo 'Requires: dvdread' >> $(.OBJDIR)/dvdnav.pc
+	@echo >> $(.OBJDIR)/dvdnav.pc
+	@echo 'Name: dvdnav' >> $(.OBJDIR)/dvdnav.pc
+	@echo 'Description: High-level library for reading DVDs' >> $(.OBJDIR)/dvdnav.pc
+	@echo 'Version: $(SHLIB_VERSION)' >> $(.OBJDIR)/dvdnav.pc
+
+install-dvdnav.pc: dvdnav.pc
+	install -d $(DESTDIR)$(shlibdir)/pkgconfig
+	install -m 0644 $(.OBJDIR)/dvdnav.pc $(DESTDIR)$(shlibdir)/pkgconfig/dvdnav.pc
 
 vpath %.so ${.OBJDIR}
 vpath %.o ${.OBJDIR}


More information about the DVDnav-discuss mailing list