[PATCH] add pkg-config .pc file for cdparanoia

Tim-Philipp Müller <[email protected]> Tue, 13 Apr 2010 12:38:04 +0100
Newsgroups gmane.comp.audio.cd-paranoia.devel
Message-ID <1271158684.18675.13.camel@zingle>
--=-5CJxoyY5ntNlozx8IK/n
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit

Hi,

it would be nice if Cdparanoia installed a .pc file for pkg-config
alongside its headers and libs.

This makes it easier for applications and libs using cdparanoia to
correctly check for the existence of cdparanoia, query its version, or
figure out the right include paths and linker flags.

Patch attached (configure in svn will need to be recreated after
applying the patch).

 Cheers
  -Tim

--=-5CJxoyY5ntNlozx8IK/n
Content-Disposition: attachment; filename="cdparanoia-pkgconfig-1.diff"
Content-Type: text/x-patch; name="cdparanoia-pkgconfig-1.diff"; charset="UTF-8"
Content-Transfer-Encoding: 7bit

Index: Makefile.in
===================================================================
--- Makefile.in	(revision 17144)
+++ Makefile.in	(working copy)
@@ -3,7 +3,7 @@
 # DO NOT EDIT BELOW! ##########################################################
 # (unless, of course, you know what you are doing :) ##########################
 
-VERSION=10.2
+VERSION=@VERSION@
 VPATH=@srcdir@
 srcdir=@srcdir@
 
@@ -23,6 +23,7 @@
 MANDIR=@mandir@
 INCLUDEDIR=@includedir@
 LIBDIR=@libdir@
+PKGCONFIGDIR=@libdir@/pkgconfig
 PWD = $(shell pwd)
 
 OFILES = main.o report.o header.o buffering_write.o cachetest.o
@@ -85,6 +86,8 @@
 		$(LIBDIR)/libcdda_paranoia.so.0
 	ln -fs libcdda_paranoia.so.0.$(VERSION) \
 		$(LIBDIR)/libcdda_paranoia.so
+	$(INSTALL) -d -m 0755 $(PKGCONFIGDIR)
+	$(INSTALL) -m 0644 $(srcdir)/cdparanoia.pc $(PKGCONFIGDIR)
 
 cdparanoia:	$(OFILES) $(LIBDEP)
 		$(LD) $(CFLAGS) $(LDFLAGS) $(OFILES) \
@@ -104,6 +107,6 @@
 	cd interface && $(MAKE) distclean
 	cd paranoia && $(MAKE) distclean
 	-rm -f cdparanoia *~ config.* *.o *.wav *.aifc *.raw test.file \
-		Makefile verify_test core gmon.out
+		Makefile verify_test core gmon.out cdparanoia.pc
 
 .PHONY: all debug test lib slib install clean distclean
Index: configure.in
===================================================================
--- configure.in	(revision 17144)
+++ configure.in	(working copy)
@@ -1,5 +1,8 @@
 AC_INIT(interface/interface.c)
 
+VERSION="10.2"
+AC_SUBST(VERSION)
+
 cp $srcdir/configure.guess $srcdir/config.guess
 cp $srcdir/configure.sub $srcdir/config.sub
 
@@ -67,4 +70,4 @@
 AC_SUBST(DEBUG)
 AC_SUBST(CC)
 
-AC_OUTPUT(Makefile interface/Makefile paranoia/Makefile)
+AC_OUTPUT(Makefile interface/Makefile paranoia/Makefile cdparanoia.pc)
Index: cdparanoia.pc.in
===================================================================
--- cdparanoia.pc.in	(revision 0)
+++ cdparanoia.pc.in	(revision 0)
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: Cdparanoia
+Description: Compact Disc Digital Audio (CDDA) Digital Audio Extraction (DAE) library
+Requires:
+Version: 3.@VERSION@
+Libs: -L${libdir} -lcdda_interface -lcdda_paranoia
+Cflags: -I${includedir}

--=-5CJxoyY5ntNlozx8IK/n
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Paranoia-dev mailing list
[email protected]
http://lists.xiph.org/mailman/listinfo/paranoia-dev

--=-5CJxoyY5ntNlozx8IK/n--