r28683 - in /branches/upstream/libextutils-pkgconfig-perl: ./ current/ current/lib/ current/lib/ExtUtils/ current/t/

ryan52-guest at users.alioth.debian.org ryan52-guest at users.alioth.debian.org
Sun Dec 28 07:26:01 UTC 2008


Author: ryan52-guest
Date: Sun Dec 28 07:25:58 2008
New Revision: 28683

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=28683
Log:
[svn-inject] Installing original source of libextutils-pkgconfig-perl

Added:
    branches/upstream/libextutils-pkgconfig-perl/
    branches/upstream/libextutils-pkgconfig-perl/current/
    branches/upstream/libextutils-pkgconfig-perl/current/Changes
    branches/upstream/libextutils-pkgconfig-perl/current/MANIFEST
    branches/upstream/libextutils-pkgconfig-perl/current/MANIFEST.SKIP
    branches/upstream/libextutils-pkgconfig-perl/current/META.yml
    branches/upstream/libextutils-pkgconfig-perl/current/Makefile.PL
    branches/upstream/libextutils-pkgconfig-perl/current/README
    branches/upstream/libextutils-pkgconfig-perl/current/lib/
    branches/upstream/libextutils-pkgconfig-perl/current/lib/ExtUtils/
    branches/upstream/libextutils-pkgconfig-perl/current/lib/ExtUtils/PkgConfig.pm
    branches/upstream/libextutils-pkgconfig-perl/current/perl-ExtUtils-PkgConfig.spec.in
    branches/upstream/libextutils-pkgconfig-perl/current/t/
    branches/upstream/libextutils-pkgconfig-perl/current/t/1.t
    branches/upstream/libextutils-pkgconfig-perl/current/t/2.t
    branches/upstream/libextutils-pkgconfig-perl/current/t/3.t
    branches/upstream/libextutils-pkgconfig-perl/current/t/4.t
    branches/upstream/libextutils-pkgconfig-perl/current/t/swallow_stderr.inc
    branches/upstream/libextutils-pkgconfig-perl/current/t/test_glib-2.0.pc
    branches/upstream/libextutils-pkgconfig-perl/current/t/test_non_numeric.pc

Added: branches/upstream/libextutils-pkgconfig-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/Changes?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/Changes (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/Changes Sun Dec 28 07:25:58 2008
@@ -1,0 +1,55 @@
+Revision history for Perl extension ExtUtils::PkgConfig.
+
+1.11  Sat Mar 15 00:35:35 CET 2008
+	- Fix test failures.
+	- If pkg-config isn't found, warn and exit with status 0 instead of
+          just dying so that CPAN testers don't send bogus failure reports.
+
+1.10  Sat Feb  9 20:29:22 CET 2008
+	- Fix test failures with older versions of perl and pkg-config.
+
+1.09  Tue Jan 22 21:34:35 CET 2008
+	- Add support for more pkg-config commands: cflags-only-I,
+          cflags-only-other, libs-only-other, and static-libs (RT #32426, patch
+          by Diab Jerius).
+	- Fix a test failure in t/4.t (RT #31966).
+	- Only print failure messages if appropriate; silence test suite.
+
+1.08  Fri Oct 19 22:04:08 CEST 2007
+	- add Makefile.PL to MANIFEST.
+	- In the version macro generator, handle non-numeric version number
+          parts by only using the leading digits.
+        - Make pkg-config print the errors it encounters so users know what went
+	  wrong.
+
+1.07  Sun Jan 23 13:22:03 EST 2005
+	- Disable the RPM-related postamble on Win32.  The 'date' command
+	  on windows is interactive, and caused Makefile.PL to hang.
+
+1.06  Sun Sep 19 23:29:23 CEST 2004
+	- Remove the "found package ..." message to make Makefile.PL's less
+	  verbose.
+
+1.05  Fri Jul 16 14:52:39 EDT 2004
+	- add configure-time check for pkg-config, don't build without it.
+	- add a pointer to pkg-config's webpage in the docs.
+
+1.04  Fri Mar  5 00:28:59 EST 2004
+	- add long-overdue version-checking import implementation.
+
+1.03  Thu Feb 05 22:16:44 2004
+	- add two new functions: create_version_macros and
+	  write_version_macros.
+
+1.02  Tue Nov 04 21:51:44 2003
+	- heavily modifed patch by Alberto Manuel Brandão Simões appliled that 
+	  adds some autoload stuff to extend basic functionality.
+
+1.01  Fri Oct 03 16:02:20 2003
+	- shuffle argument order to retain compatibility with newer versions
+	  of pkg-config 
+	- fixed some bugs with specfile creation
+
+1.00  Mon Sep 15 23:51:58 2003
+	- converted from Glib 1.00rc1's Glib::PkgConfig
+

Added: branches/upstream/libextutils-pkgconfig-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/MANIFEST?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/MANIFEST (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/MANIFEST Sun Dec 28 07:25:58 2008
@@ -1,0 +1,15 @@
+Changes
+lib/ExtUtils/PkgConfig.pm
+Makefile.PL
+MANIFEST
+MANIFEST.SKIP
+perl-ExtUtils-PkgConfig.spec.in
+README
+t/1.t
+t/2.t
+t/3.t
+t/4.t
+t/swallow_stderr.inc
+t/test_glib-2.0.pc
+t/test_non_numeric.pc
+META.yml                                 Module meta-data (added by MakeMaker)

Added: branches/upstream/libextutils-pkgconfig-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/MANIFEST.SKIP?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/MANIFEST.SKIP (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/MANIFEST.SKIP Sun Dec 28 07:25:58 2008
@@ -1,0 +1,4 @@
+.bak$
+.cvsignore
+CVS
+Makefile$

Added: branches/upstream/libextutils-pkgconfig-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/META.yml?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/META.yml (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/META.yml Sun Dec 28 07:25:58 2008
@@ -1,0 +1,12 @@
+--- #YAML:1.0
+name:                ExtUtils-PkgConfig
+version:             1.11
+abstract:            ~
+license:             ~
+author:              ~
+generated_by:        ExtUtils::MakeMaker version 6.44
+distribution_type:   module
+requires:     
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
+    version: 1.3

Added: branches/upstream/libextutils-pkgconfig-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/Makefile.PL?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/Makefile.PL (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/Makefile.PL Sun Dec 28 07:25:58 2008
@@ -1,0 +1,78 @@
+BEGIN { require 5.006; }
+
+use ExtUtils::MakeMaker;
+
+# don't go any further if pkg-config cannot be found.
+my $have_pkg_config = `pkg-config --version`;
+
+if ($have_pkg_config eq "") {
+	# Warn and exit with status 0 to indicate (to the user and the CPAN
+	# testers infrastructure) that this module won't work on this machine.
+	warn <<"__EOW__";
+***
+*** ExtUtils::PkgConfig requires the pkg-config utility, but it doesn't
+*** seem to be in your PATH.  Is it correctly installed?
+***  PATH=$ENV{PATH}
+***
+__EOW__
+	exit 0;
+}
+
+WriteMakefile(
+    # FIXME this doesn't work very well with native win32 perl
+    'dist' => {
+           PREOP    => 'pod2text lib/ExtUtils/PkgConfig.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
+           COMPRESS => 'gzip -9v',
+           SUFFIX   => '.gz',
+    },
+    'NAME' => 'ExtUtils::PkgConfig',
+    'VERSION_FROM' => 'lib/ExtUtils/PkgConfig.pm',
+);
+
+use Cwd;
+
+sub MY::postamble
+{
+	# none of this rpm stuff is useful on win32, and actually it can cause
+	# nmake to barf.
+	return "" if $^O eq 'MSWin32';
+
+	my @dirs = qw{$(RPMS_DIR) $(RPMS_DIR)/BUILD $(RPMS_DIR)/RPMS
+		      $(RPMS_DIR)/SOURCES $(RPMS_DIR)/SPECS $(RPMS_DIR)/SRPMS};
+	my $cwd = getcwd();
+
+	chomp (my $date = `date +"%a %b %d %Y"`);
+
+	my %subs = (
+		'VERSION' => '$(VERSION)',
+		'SOURCE' => '$(DISTNAME)-$(VERSION).tar.gz',
+		'DATE'    => $date,
+	);
+
+	my $substitute = '$(PERL) -npe \''.join('; ', map {
+			"s/\\\@$_\\\@/$subs{$_}/g";
+		} keys %subs).'\'';
+
+"
+realclean ::
+	-\$(RM_F) perl-\$(DISTNAME).spec
+
+RPMS_DIR=\$(HOME)/rpms
+
+\$(RPMS_DIR)/:
+	-mkdir @dirs
+
+SUBSTITUTE=$substitute
+
+perl-\$(DISTNAME).spec :: perl-\$(DISTNAME).spec.in \$(VERSION_FROM) Makefile
+	\$(SUBSTITUTE) \$< > \$@
+
+dist-rpms :: Makefile dist perl-\$(DISTNAME).spec \$(RPMS_DIR)/
+	cp \$(DISTNAME)-\$(VERSION).tar.gz \$(RPMS_DIR)/SOURCES/
+	rpmbuild -ba --define \"_topdir \$(RPMS_DIR)\" perl-\$(DISTNAME).spec
+
+dist-srpms :: Makefile dist perl-\$(DISTNAME).spec \$(RPMS_DIR)/
+	cp \$(DISTNAME)-\$(VERSION).tar.gz \$(RPMS_DIR)/SOURCES/
+	rpmbuild -bs --nodeps --define \"_topdir \$(RPMS_DIR)\" perl-\$(DISTNAME).spec
+"
+}

Added: branches/upstream/libextutils-pkgconfig-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/README?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/README (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/README Sun Dec 28 07:25:58 2008
@@ -1,0 +1,112 @@
+NAME
+    ExtUtils::PkgConfig - simplistic interface to pkg-config
+
+SYNOPSIS
+     use ExtUtils::PkgConfig;
+
+     $package = 'gtk+-2.0';
+
+     %pkg_info = ExtUtils::PkgConfig->find ($package);
+     print "modversion:  $pkg_info{modversion}\n";
+     print "cflags:      $pkg_info{cflags}\n";
+     print "libs:        $pkg_info{libs}\n";
+
+     $modversion = ExtUtils::PkgConfig->modversion($package);
+
+     $libs = ExtUtils::PkgConfig->libs($package);
+
+     $cflags = ExtUtils::PkgConfig->cflags($package);
+
+     $cflags_only_I = ExtUtils::PkgConfig->cflags_only_I($package);
+
+     $cflags_only_other = ExtUtils::PkgConfig->cflags_only_other($package);
+
+     $libs_only_L = ExtUtils::PkgConfig->libs_only_L($package);
+
+     $libs_only_l = ExtUtils::PkgConfig->libs_only_l($package);
+
+     $libs_only_other = ExtUtils::PkgConfig->libs_only_other($package);
+
+     $static_libs = ExtUtils::PkgConfig->static_libs($package);
+
+     $var_value = ExtUtils::PkgConfig->variable($package, $var);
+
+     if (ExtUtils::PkgConfig->atleast_version($package,$version)) {
+        ...
+     }
+
+     if (ExtUtils::PkgConfig->exact_version($package,$version)) {
+        ...
+     }
+
+     if (ExtUtils::PkgConfig->max_version($package,$version)) {
+        ...
+     }
+
+DESCRIPTION
+    The pkg-config program retrieves information about installed libraries,
+    usually for the purposes of compiling against and linking to them.
+
+    ExtUtils::PkgConfig is a very simplistic interface to this utility,
+    intended for use in the Makefile.PL of perl extensions which bind
+    libraries that pkg-config knows. It is really just boilerplate code that
+    you would've written yourself.
+
+  USAGE
+    HASH = ExtUtils::PkgConfig->find (STRING, [STRING, ...])
+        Call pkg-config on the library specified by *STRING* (you'll have to
+        know what to use here). The returned *HASH* contains the modversion,
+        cflags, and libs values under keys with those names. If multiple
+        STRINGS are passed they are attempted in the order they are given
+        till a working package is found.
+
+        If pkg-config fails to find a working *STRING*, this function croaks
+        with a message intended to be helpful to whomever is attempting to
+        compile your package.
+
+        For example:
+
+          *** can not find package bad1
+          *** check that it is properly installed and available
+          *** in PKG_CONFIG_PATH
+
+        or
+
+          *** can't find cflags for gtk+-2.0
+          *** is it properly installed and available in PKG_CONFIG_PATH?
+
+    STRING = ExtUtils::PkgConfig->create_version_macros (PACKAGE, STEM)
+        Create a set of version macros with the prefix *STEM* for the
+        library specified by *PACKAGE*. The result is returned.
+
+        Example input would be "gtk+-2.0" for *PACKAGE* and "GTK" for
+        *STEM*.
+
+    ExtUtils::PkgConfig->write_version_macros (FILE, PACKAGE, STEM,
+    [PACKAGE, STEM, ...])
+        Create one or more sets of version macros for the libraries and
+        prefixes specified by the *PACKAGE* and *STEM* pairs and write them
+        to the file *FILE*. If it doesn't exist, *FILE* will be created. If
+        it does exist, it will be overwritten.
+
+SEE ALSO
+    ExtUtils::PkgConfig was designed to work with ExtUtils::Depends for
+    compiling the various modules of the gtk2-perl project.
+
+      L<ExtUtils::Depends>
+
+      L<http://gtk2-perl.sourceforge.net/>
+
+    This module is really just an interface to the pkg-config utility
+    program. http://www.freedesktop.org/Software/pkgconfig
+
+AUTHORS
+    muppet <scott at asofyet dot org>.
+
+COPYRIGHT AND LICENSE
+    Copyright 2003-2004 by muppet, Ross McFarland, and the gtk2-perl team
+
+    This library is free software; you can redistribute it and/or modify it
+    under the terms of the Lesser General Public License (LGPL). For more
+    information, see http://www.fsf.org/licenses/lgpl.txt
+

Added: branches/upstream/libextutils-pkgconfig-perl/current/lib/ExtUtils/PkgConfig.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/lib/ExtUtils/PkgConfig.pm?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/lib/ExtUtils/PkgConfig.pm (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/lib/ExtUtils/PkgConfig.pm Sun Dec 28 07:25:58 2008
@@ -1,0 +1,313 @@
+# Copyright (c) 2003-2004 by the gtk2-perl team (see the file AUTHORS)
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the 
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
+# Boston, MA  02111-1307  USA.
+
+
+package ExtUtils::PkgConfig;
+
+use strict;
+use Carp;
+use English qw(-no_match_vars); # avoid regex performance penalty
+
+use vars qw/ $VERSION $AUTOLOAD/;
+
+$VERSION = '1.11';
+
+sub import {
+	my $class = shift;
+	return unless @_;
+        die "$class version $_[0] is required--this is only version $VERSION"
+		if $VERSION < $_[0];
+}
+
+sub AUTOLOAD 
+{
+	my $class = shift;
+	my $modulename = shift;
+	my $function = $AUTOLOAD;
+	$function =~ s/.*://;
+	$function =~ s/_/-/g;
+
+	my $ans = undef;
+	my $arg = shift;
+	if (grep {$_ eq $function} qw/libs
+	                              modversion
+	                              cflags
+	                              cflags-only-I
+	                              cflags-only-other
+	                              libs-only-L
+	                              libs-only-l
+	                              libs-only-other/)
+	{
+		# simple
+		$ans = `pkg-config --$function \"$modulename\"`;
+	}
+	elsif ('static-libs' eq $function)
+	{
+		$ans = `pkg-config --libs --static \"$modulename\"`;
+	}
+	elsif ('variable' eq $function)
+	{
+		# variable
+		$ans = `pkg-config --${function}=$arg \"$modulename\"`;
+	}
+	elsif (grep {$_ eq $function} qw/atleast-version
+	                                 exact-version
+	                                 max-version/)
+	{
+		# boolean
+		$ans = not system (
+			"pkg-config --${function}=$arg \"$modulename\"");
+	}
+	else
+	{
+		croak "method '$function' not implemented";
+		$ans = '';
+	}
+
+	chomp($ans);
+	$ans = undef if $ans eq '';
+
+	return $ans;
+}
+
+sub find {
+	my ($class, @pkg_candidates) = @_;
+	my (@pkgs_found, @error_messages);
+
+	# try all package candidates and save all those that pkg-config
+	# recognizes
+	foreach my $candidate (@pkg_candidates)
+	{
+		my $output = qx/pkg-config --exists --print-errors "$candidate" 2>&1/;
+		if (0 == $CHILD_ERROR) {
+			push @pkgs_found, $candidate;
+		}
+		else
+		{
+			push @error_messages, $output;
+		}
+	}
+
+	if (0 == scalar @pkgs_found)
+	{
+		foreach my $message (@error_messages) {
+			carp $message;
+		}
+
+		if (@pkg_candidates > 1)
+		{
+			my $list = join ', ', @pkg_candidates;
+			croak "*** can not find package for any of ($list)\n"
+			    . "*** check that one of them is properly installed and available in PKG_CONFIG_PATH\n";
+		}
+		else
+		{
+			croak "*** can not find package $pkg_candidates[0]\n"
+			    . "*** check that it is properly installed and available in PKG_CONFIG_PATH\n";
+		}
+	}
+
+	# return the data of the package that was found first
+	my %data = ();
+	$data{pkg} = $pkgs_found[0];
+	foreach my $what (qw/modversion cflags libs/) {
+		$data{$what} = `pkg-config --$what \"$data{pkg}\"`;
+                $data{$what} =~ s/[\015\012]+$//;
+		croak "*** can't find $what for \"$data{pkg}\"\n"
+		    . "*** is it properly installed and available in PKG_CONFIG_PATH?\n"
+			unless $data{$what};
+	}
+	return %data;
+}
+
+sub create_version_macros {
+	my ($class, $pkg, $stem) = @_;
+
+	if( $pkg && $stem ) {
+		my %data = ExtUtils::PkgConfig->find ($pkg);
+
+		if( %data ) {
+			my @modversion = split /\./, $data{modversion};
+			$modversion[2] = 0 unless defined $modversion[2];
+
+			# If a version part contains non-numeric characters,
+			# see if it at least starts with numbers and use those.
+			# This is needed for versions like '2.0b2'.
+			# foreach ( @modversion ) {
+			# 	if (/\D/ && /^(\d+)/) {
+			# 		$_ = $1;
+			# 	}
+			# }
+			@modversion =
+				map { /\D/ && /^(\d+)/ ? $1 : $_ } @modversion;
+
+			return <<__EOD__;
+#define $stem\_MAJOR_VERSION ($modversion[0])
+#define $stem\_MINOR_VERSION ($modversion[1])
+#define $stem\_MICRO_VERSION ($modversion[2])
+#define $stem\_CHECK_VERSION(major,minor,micro) \\
+	($stem\_MAJOR_VERSION > (major) || \\
+	 ($stem\_MAJOR_VERSION == (major) && $stem\_MINOR_VERSION > (minor)) || \\
+	 ($stem\_MAJOR_VERSION == (major) && $stem\_MINOR_VERSION == (minor) && $stem\_MICRO_VERSION >= (micro)))
+__EOD__
+		}
+	}
+
+	return undef;
+}
+
+sub write_version_macros {
+	my ($class, $file, @pkgs) = @_;
+
+	open FILE, ">$file" or croak "*** can not open file $file for writing\n";
+
+	for (my $i = 0; $i < @pkgs; $i += 2) {
+		my $macros = ExtUtils::PkgConfig->create_version_macros ($pkgs[$i], $pkgs[$i+1]);
+		if( defined $macros ) {
+			print FILE $macros;
+		}
+	}
+
+	close FILE or croak "*** can not close file $file\n";
+}
+
+1;
+
+=head1 NAME
+
+ExtUtils::PkgConfig - simplistic interface to pkg-config
+
+=head1 SYNOPSIS
+
+ use ExtUtils::PkgConfig;
+
+ $package = 'gtk+-2.0';
+
+ %pkg_info = ExtUtils::PkgConfig->find ($package);
+ print "modversion:  $pkg_info{modversion}\n";
+ print "cflags:      $pkg_info{cflags}\n";
+ print "libs:        $pkg_info{libs}\n";
+
+ $modversion = ExtUtils::PkgConfig->modversion($package);
+
+ $libs = ExtUtils::PkgConfig->libs($package);
+
+ $cflags = ExtUtils::PkgConfig->cflags($package);
+
+ $cflags_only_I = ExtUtils::PkgConfig->cflags_only_I($package);
+
+ $cflags_only_other = ExtUtils::PkgConfig->cflags_only_other($package);
+
+ $libs_only_L = ExtUtils::PkgConfig->libs_only_L($package);
+
+ $libs_only_l = ExtUtils::PkgConfig->libs_only_l($package);
+
+ $libs_only_other = ExtUtils::PkgConfig->libs_only_other($package);
+
+ $static_libs = ExtUtils::PkgConfig->static_libs($package);
+
+ $var_value = ExtUtils::PkgConfig->variable($package, $var);
+
+ if (ExtUtils::PkgConfig->atleast_version($package,$version)) {
+    ...
+ }
+
+ if (ExtUtils::PkgConfig->exact_version($package,$version)) {
+    ...
+ }
+
+ if (ExtUtils::PkgConfig->max_version($package,$version)) {
+    ...
+ }
+
+=head1 DESCRIPTION
+
+The pkg-config program retrieves information about installed libraries,
+usually for the purposes of compiling against and linking to them.
+
+ExtUtils::PkgConfig is a very simplistic interface to this utility, intended
+for use in the Makefile.PL of perl extensions which bind libraries that
+pkg-config knows.  It is really just boilerplate code that you would've
+written yourself.
+
+=head2 USAGE
+
+=over
+
+=item HASH = ExtUtils::PkgConfig->find (STRING, [STRING, ...])
+
+Call pkg-config on the library specified by I<STRING> (you'll have to know what
+to use here).  The returned I<HASH> contains the modversion, cflags, and libs
+values under keys with those names. If multiple STRINGS are passed they are
+attempted in the order they are given till a working package is found.
+
+If pkg-config fails to find a working I<STRING>, this function croaks with a
+message intended to be helpful to whomever is attempting to compile your
+package.
+
+For example:
+
+  *** can not find package bad1
+  *** check that it is properly installed and available
+  *** in PKG_CONFIG_PATH
+
+or
+
+  *** can't find cflags for gtk+-2.0
+  *** is it properly installed and available in PKG_CONFIG_PATH?
+
+=item STRING = ExtUtils::PkgConfig->create_version_macros (PACKAGE, STEM)
+
+Create a set of version macros with the prefix I<STEM> for the library
+specified by I<PACKAGE>.  The result is returned.
+
+Example input would be "gtk+-2.0" for I<PACKAGE> and "GTK" for I<STEM>.
+
+=item ExtUtils::PkgConfig->write_version_macros (FILE, PACKAGE, STEM, [PACKAGE, STEM, ...])
+
+Create one or more sets of version macros for the libraries and prefixes
+specified by the I<PACKAGE> and I<STEM> pairs and write them to the file
+I<FILE>.  If it doesn't exist, I<FILE> will be created.  If it does exist, it
+will be overwritten.
+
+=back
+
+=head1 SEE ALSO
+
+ExtUtils::PkgConfig was designed to work with ExtUtils::Depends for compiling
+the various modules of the gtk2-perl project.
+
+  L<ExtUtils::Depends>
+
+  L<http://gtk2-perl.sourceforge.net/>
+
+This module is really just an interface to the pkg-config utility program.
+http://www.freedesktop.org/Software/pkgconfig
+
+=head1 AUTHORS
+
+muppet E<lt>scott at asofyet dot orgE<gt>.
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2003-2004 by muppet, Ross McFarland, and the gtk2-perl team
+
+This library is free software; you can redistribute it and/or modify
+it under the terms of the Lesser General Public License (LGPL).  For
+more information, see http://www.fsf.org/licenses/lgpl.txt
+
+=cut

Added: branches/upstream/libextutils-pkgconfig-perl/current/perl-ExtUtils-PkgConfig.spec.in
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/perl-ExtUtils-PkgConfig.spec.in?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/perl-ExtUtils-PkgConfig.spec.in (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/perl-ExtUtils-PkgConfig.spec.in Sun Dec 28 07:25:58 2008
@@ -1,0 +1,53 @@
+Summary: ExtUtils-PkgConfig Perl module
+Name: perl-ExtUtils-PkgConfig
+Version: @VERSION@
+Release: 1
+Packager: gtk-perl-list at gnome.org
+License: LGPL
+Group: Development/Tools
+URL: http://search.cpan.org/dist/ExtUtils-PkgConfig/
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+BuildArch: noarch
+Requires: pkgconfig
+BuildRequires: perl >= 2:5.8.0
+BuildRequires: pkgconfig
+Source0: @SOURCE@
+
+%description
+This module is a simplistic Perl interface to the pkg-config command-line
+utility, for use in the Makefile.PLs used to build Perl modules which wrap
+the libraries about which pkg-config knows.
+
+%prep
+%setup -q -n ExtUtils-PkgConfig-%{version}
+
+%build
+CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL PREFIX=$RPM_BUILD_ROOT%{_prefix} 
+make OPTIMIZE="$RPM_OPT_FLAGS"
+make test
+
+%install
+%makeinstall
+ 
+[ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress
+
+find $RPM_BUILD_ROOT \( -name perllocal.pod -o -name .packlist \) -exec rm -v {} \;
+
+find $RPM_BUILD_ROOT/usr -type f -print | \
+	sed "s@^$RPM_BUILD_ROOT@@g" | \
+	grep -v perllocal.pod | \
+	grep -v "\.packlist" > %{name}-%{version}-filelist
+if [ "$(cat %{name}-%{version}-filelist)X" = "X" ] ; then
+	exit -1
+fi
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files -f %{name}-%{version}-filelist
+%defattr(-,root,root)
+
+%changelog
+* @DATE@ gtk-perl-list at gnome.org - @VERSION@
+- Specfile autogenerated
+

Added: branches/upstream/libextutils-pkgconfig-perl/current/t/1.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/t/1.t?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/t/1.t (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/t/1.t Sun Dec 28 07:25:58 2008
@@ -1,0 +1,41 @@
+#
+# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/ExtUtils-PkgConfig/t/1.t,v 1.3 2008/01/20 21:05:17 kaffeetisch Exp $
+#
+
+use strict;
+use warnings;
+
+#########################
+
+use Test::More tests => 7;
+BEGIN { use_ok('ExtUtils::PkgConfig') };
+
+require 't/swallow_stderr.inc';
+
+#########################
+
+$ENV{PKG_CONFIG_PATH} = './t/';
+
+my %pkg;
+
+# test 1 for success
+eval { %pkg = ExtUtils::PkgConfig->find(qw/test_glib-2.0/); };
+ok( not $@ );
+ok( $pkg{modversion} and $pkg{cflags} and $pkg{libs} );
+
+# test 1 for failure
+swallow_stderr (sub {
+	eval { %pkg = ExtUtils::PkgConfig->find(qw/bad1/); };
+	ok( $@ );
+});
+
+# test 2 for success
+eval { %pkg = ExtUtils::PkgConfig->find(qw/bad1 test_glib-2.0/); };
+ok( not $@ );
+ok( $pkg{modversion} and $pkg{cflags} and $pkg{libs} );
+
+# test 2 for failure
+swallow_stderr (sub {
+	eval { %pkg = ExtUtils::PkgConfig->find(qw/bad1 bad2/); };
+	ok( $@ );
+});

Added: branches/upstream/libextutils-pkgconfig-perl/current/t/2.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/t/2.t?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/t/2.t (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/t/2.t Sun Dec 28 07:25:58 2008
@@ -1,0 +1,53 @@
+#!/usr/bin/perl
+#
+# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/ExtUtils-PkgConfig/t/2.t,v 1.4 2008/03/14 23:28:25 kaffeetisch Exp $
+#
+
+use strict;
+use warnings;
+
+use Test::More tests => 11;
+use ExtUtils::PkgConfig;
+
+$ENV{PKG_CONFIG_PATH} = './t/';
+
+my ($major, $minor) = split /\./, `pkg-config --version`; # Ignore micro part
+diag ("Testing pkg-config $major.$minor");
+
+cmd_ok ('modversion');
+cmd_ok ('cflags');
+cmd_ok ('cflags-only-I');
+cmd_ok ('libs');
+cmd_ok ('libs-only-L');
+cmd_ok ('libs-only-l');
+
+SKIP: {
+  skip '*-only-other', 2
+    unless ($major > 0 || $minor >= 15);
+
+  cmd_ok ('cflags-only-other');
+  cmd_ok ('libs-only-other');
+}
+
+SKIP: {
+  skip 'static libs', 1
+    unless ($major > 0 || $minor >= 20);
+
+  my $data = ExtUtils::PkgConfig->static_libs(qw/test_glib-2.0/);
+  like ($data, qr/pthread/);
+}
+
+my $data;
+
+$data = ExtUtils::PkgConfig->variable(qw/test_glib-2.0/, 'glib_genmarshal');
+ok (defined $data);
+
+$data = ExtUtils::PkgConfig->variable(qw/test_glib-2.0/, '__bad__');
+ok (not defined $data);
+
+sub cmd_ok {
+  my ($cmd, $desc) = @_;
+
+  my $data = ExtUtils::PkgConfig->$cmd(qw/test_glib-2.0/);
+  ok (defined $data, $desc);
+}

Added: branches/upstream/libextutils-pkgconfig-perl/current/t/3.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/t/3.t?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/t/3.t (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/t/3.t Sun Dec 28 07:25:58 2008
@@ -1,0 +1,20 @@
+#
+# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/ExtUtils-PkgConfig/t/3.t,v 1.1 2006/09/24 20:30:42 kaffeetisch Exp $
+#
+
+use strict;
+use warnings;
+
+use Test::More tests => 6;
+use ExtUtils::PkgConfig;
+
+$ENV{PKG_CONFIG_PATH} = './t/';
+
+ok( ExtUtils::PkgConfig->atleast_version(qw/test_glib-2.0/, '2.2.0') );
+ok( not ExtUtils::PkgConfig->atleast_version(qw/test_glib-2.0/, '2.3.0') );
+
+ok( ExtUtils::PkgConfig->exact_version(qw/test_glib-2.0/, '2.2.3') );
+ok( not ExtUtils::PkgConfig->exact_version(qw/test_glib-2.0/, '2.3.0') );
+
+ok( ExtUtils::PkgConfig->max_version(qw/test_glib-2.0/, '2.3.0') );
+ok( not ExtUtils::PkgConfig->max_version(qw/test_glib-2.0/, '2.2.0') );

Added: branches/upstream/libextutils-pkgconfig-perl/current/t/4.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/t/4.t?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/t/4.t (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/t/4.t Sun Dec 28 07:25:58 2008
@@ -1,0 +1,74 @@
+#
+# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/ExtUtils-PkgConfig/t/4.t,v 1.4 2008/03/14 23:28:25 kaffeetisch Exp $
+#
+
+use strict;
+use warnings;
+
+use Test::More tests => 20;
+use ExtUtils::PkgConfig;
+
+require 't/swallow_stderr.inc';
+
+$ENV{PKG_CONFIG_PATH} = './t/';
+
+sub contains {
+	my ($string, $sub_string) = @_;
+	return -1 != index ($string, $sub_string);
+}
+
+my $macros;
+
+$macros = ExtUtils::PkgConfig->create_version_macros (qw/test_glib-2.0/, 'GLIB');
+ok (contains ($macros, 'GLIB_MAJOR_VERSION (2)'));
+ok (contains ($macros, 'GLIB_MINOR_VERSION (2)'));
+ok (contains ($macros, 'GLIB_MICRO_VERSION (3)'));
+ok (contains ($macros, 'GLIB_CHECK_VERSION'));
+
+# Check that '2.0b2.4' is turned into 2.0.4
+$macros = ExtUtils::PkgConfig->create_version_macros (qw/test_non_numeric/, 'TEST');
+ok (contains ($macros, 'TEST_MAJOR_VERSION (2)'));
+ok (contains ($macros, 'TEST_MINOR_VERSION (0)'));
+ok (contains ($macros, 'TEST_MICRO_VERSION (4)'));
+ok (contains ($macros, 'TEST_CHECK_VERSION'));
+
+swallow_stderr (sub {
+	eval {
+		ExtUtils::PkgConfig->create_version_macros (qw/__bad__/, 'BAD');
+	};
+	ok ($@);
+});
+
+my $header = 'eupc_test_tmp.h';
+
+ExtUtils::PkgConfig->write_version_macros (
+	$header,
+	'test_glib-2.0' => 'GLIB',
+	'test_non_numeric' => 'TEST');
+
+ok (-f $header);
+ok (open my $fh, '<', $header);
+$/ = undef; $macros = <$fh>;
+ok (contains ($macros, 'GLIB_MAJOR_VERSION'));
+ok (contains ($macros, 'GLIB_MINOR_VERSION'));
+ok (contains ($macros, 'GLIB_MICRO_VERSION'));
+ok (contains ($macros, 'GLIB_CHECK_VERSION'));
+ok (contains ($macros, 'TEST_MAJOR_VERSION'));
+ok (contains ($macros, 'TEST_MINOR_VERSION'));
+ok (contains ($macros, 'TEST_MICRO_VERSION'));
+ok (contains ($macros, 'TEST_CHECK_VERSION'));
+close $fh;
+unlink $header;
+
+swallow_stderr (sub {
+	eval {
+	  ExtUtils::PkgConfig->write_version_macros (
+		$header,
+		'__bad__' => 'BAD');
+	};
+	ok ($@);
+});
+
+if (-f $header) {
+	unlink $header;
+}

Added: branches/upstream/libextutils-pkgconfig-perl/current/t/swallow_stderr.inc
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/t/swallow_stderr.inc?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/t/swallow_stderr.inc (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/t/swallow_stderr.inc Sun Dec 28 07:25:58 2008
@@ -1,0 +1,14 @@
+sub swallow_stderr {
+	my ($code) = @_;
+
+	# We can't use the three-arg form with >& because perl 5.6 doesn't seem
+	# to support that.
+	open my $old_stderr, '>&STDERR';
+	close STDERR;
+
+	$code->();
+
+	open STDERR, ">&$old_stderr";
+}
+
+1;

Added: branches/upstream/libextutils-pkgconfig-perl/current/t/test_glib-2.0.pc
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/t/test_glib-2.0.pc?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/t/test_glib-2.0.pc (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/t/test_glib-2.0.pc Sun Dec 28 07:25:58 2008
@@ -1,0 +1,16 @@
+prefix=/opt/glib
+exec_prefix=${prefix}/libexec
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+glib_genmarshal=glib-genmarshal
+gobject_query=gobject-query
+glib_mkenums=glib-mkenums
+
+Name: GLib
+Description: C Utility Library
+Version: 2.2.3
+Libs: -L${libdir} -lglib-2.0 -Wl,--export-dynamic
+Libs.private: -pthread
+Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include -DG_DISABLE_DEPRECATED
+

Added: branches/upstream/libextutils-pkgconfig-perl/current/t/test_non_numeric.pc
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libextutils-pkgconfig-perl/current/t/test_non_numeric.pc?rev=28683&op=file
==============================================================================
--- branches/upstream/libextutils-pkgconfig-perl/current/t/test_non_numeric.pc (added)
+++ branches/upstream/libextutils-pkgconfig-perl/current/t/test_non_numeric.pc Sun Dec 28 07:25:58 2008
@@ -1,0 +1,10 @@
+prefix=/usr
+exec_prefix=/usr
+libdir=/usr/lib
+includedir=/usr/include
+
+Name: TestNN
+Description: Bla blub
+Version: 2.0b2.4
+Libs: -L${libdir} -ltest-nn
+Cflags: -I${includedir}/test-nn




More information about the Pkg-perl-cvs-commits mailing list