ExtUtils-PkgConfig-1.16/000755 001750 000024 00000000000 13076263354 016173 5ustar00bdmanningstaff000000 000000 ExtUtils-PkgConfig-1.16/Changes000644 001750 000024 00000005355 13076263220 017466 0ustar00bdmanningstaff000000 000000 Revision history for Perl extension ExtUtils::PkgConfig. 1.16 Thu Apr 20 18:51:36 PDT 2017 - Add exists() method, and update README (RT#77880) - Handle removal of '.' from @INC for Perl 5.24 (RT#120819) 1.15 Sat Sep 28 22:14:31 PDT 2013 - Gracefully handle empty fields in pkg-config files. 1.14 Sun Feb 3 17:51:54 PDT 2013 - Skip tests for pkg-config binary with the '--max-version' switch on OpenBSD 5.2, due to a bug in OpenBSD's implemenation of 'pkg-config' - Updated Makefile.PL to use a META_MERGE block with WriteMakefile(); this block is what MetaCPAN reads when generating page output 1.13 Fri Apr 27 20:27:30 PDT 2012 - Correctly handle major-only versions, like '2' (RT #68246). - Updated FSF address and copyrights 1.12 Sun Oct 19 13:56:07 CEST 2008 - Try to fix a test failure. 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 ExtUtils-PkgConfig-1.16/lib/000755 001750 000024 00000000000 13076263353 016740 5ustar00bdmanningstaff000000 000000 ExtUtils-PkgConfig-1.16/Makefile.PL000644 001750 000024 00000006377 12104044176 020150 0ustar00bdmanningstaff000000 000000 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; } my %meta_merge = ( q(meta-spec) => { version => '2', url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec', }, author => ['gtk2-perl Team '], release_status => 'stable', # valid values: https://metacpan.org/module/CPAN::Meta::Spec#license license => 'lgpl_2_1', resources => { license => 'http://www.gnu.org/licenses/lgpl-2.1.html', homepage => 'http://gtk2-perl.sourceforge.net', x_MailingList => 'https://mail.gnome.org/mailman/listinfo/gtk-perl-list', bugtracker => { web => 'http://rt.cpan.org/Public/Dist/Display.html?Name=ExtUtils-PkgConfig', mailto => 'bug-ExtUtils-PkgConfig [at] rt.cpan.org', }, repository => { url => 'git://git.gnome.org/perl-ExtUtils-PkgConfig', type => 'git', web => 'http://git.gnome.org/browse/perl-ExtUtils-PkgConfig', }, }, ); WriteMakefile( 'NAME' => 'ExtUtils::PkgConfig', 'VERSION_FROM' => 'lib/ExtUtils/PkgConfig.pm', # 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', }, 'META_MERGE' => \%meta_merge, ); 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 " } ExtUtils-PkgConfig-1.16/MANIFEST000644 001750 000024 00000000627 13076263354 017331 0ustar00bdmanningstaff000000 000000 Changes lib/ExtUtils/PkgConfig.pm Makefile.PL MANIFEST MANIFEST.SKIP perl-ExtUtils-PkgConfig.doap 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 t/test_short.pc META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) ExtUtils-PkgConfig-1.16/MANIFEST.SKIP000644 001750 000024 00000000066 11747045551 020073 0ustar00bdmanningstaff000000 000000 ~$ \.bak$ \.gitignore$ \.git Makefile$ MYMETA\.* blib ExtUtils-PkgConfig-1.16/META.json000644 001750 000024 00000002724 13076263354 017621 0ustar00bdmanningstaff000000 000000 { "abstract" : "unknown", "author" : [ "unknown", "gtk2-perl Team " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.18, CPAN::Meta::Converter version 2.150005", "license" : [ "unknown", "lgpl_2_1" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "ExtUtils-PkgConfig", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-ExtUtils-PkgConfig [at] rt.cpan.org", "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=ExtUtils-PkgConfig" }, "homepage" : "http://gtk2-perl.sourceforge.net", "license" : [ "http://www.gnu.org/licenses/lgpl-2.1.html" ], "repository" : { "type" : "git", "url" : "git://git.gnome.org/perl-ExtUtils-PkgConfig", "web" : "http://git.gnome.org/browse/perl-ExtUtils-PkgConfig" }, "x_MailingList" : "https://mail.gnome.org/mailman/listinfo/gtk-perl-list" }, "version" : "1.16", "x_serialization_backend" : "JSON::PP version 2.27300" } ExtUtils-PkgConfig-1.16/META.yml000644 001750 000024 00000001533 13076263353 017445 0ustar00bdmanningstaff000000 000000 --- abstract: unknown author: - unknown - 'gtk2-perl Team ' build_requires: ExtUtils::MakeMaker: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.18, CPAN::Meta::Converter version 2.150005' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: ExtUtils-PkgConfig no_index: directory: - t - inc resources: MailingList: https://mail.gnome.org/mailman/listinfo/gtk-perl-list bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=ExtUtils-PkgConfig homepage: http://gtk2-perl.sourceforge.net license: http://www.gnu.org/licenses/lgpl-2.1.html repository: git://git.gnome.org/perl-ExtUtils-PkgConfig version: '1.16' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' ExtUtils-PkgConfig-1.16/perl-ExtUtils-PkgConfig.doap000644 001750 000024 00000002175 11664366504 023435 0ustar00bdmanningstaff000000 000000 ExtUtils::PkgConfig Simplistic interface to pkg-config muppet sarringt Torsten Schönfeld tsch Florian Ragwitz rafl ExtUtils-PkgConfig-1.16/perl-ExtUtils-PkgConfig.spec.in000644 001750 000024 00000002507 11664366504 024050 0ustar00bdmanningstaff000000 000000 Summary: ExtUtils-PkgConfig Perl module Name: perl-ExtUtils-PkgConfig Version: @VERSION@ Release: 1 Packager: gtk-perl-list@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@gnome.org - @VERSION@ - Specfile autogenerated ExtUtils-PkgConfig-1.16/README000644 001750 000024 00000007603 13076263354 017061 0ustar00bdmanningstaff000000 000000 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"; $exists = ExtUtils::PkgConfig->exists($package); $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 L This module is really just an interface to the pkg-config utility program. http://www.freedesktop.org/Software/pkgconfig AUTHORS muppet . COPYRIGHT AND LICENSE Copyright 2003-2004, 2012-2013 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 ExtUtils-PkgConfig-1.16/t/000755 001750 000024 00000000000 13076263353 016435 5ustar00bdmanningstaff000000 000000 ExtUtils-PkgConfig-1.16/t/1.t000644 001750 000024 00000002052 13076253336 016761 0ustar00bdmanningstaff000000 000000 # # $Id$ # use strict; use warnings; ######################### use Test::More tests => 10; BEGIN { use_ok('ExtUtils::PkgConfig') }; require './t/swallow_stderr.inc'; ######################### my ($major, $minor) = split /\./, `pkg-config --version`; diag ("Testing against pkg-config $major.$minor"); $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( $@ ); }); ok( ExtUtils::PkgConfig->exists(qw/test_glib-2.0 /) ); # 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} ); ok( ExtUtils::PkgConfig->exists(qw/bad1 test_glib-2.0/) ); # test 2 for failure swallow_stderr (sub { eval { %pkg = ExtUtils::PkgConfig->find(qw/bad1 bad2/); }; ok( $@ ); }); ok( !ExtUtils::PkgConfig->exists(qw/bad1 bad2/) ); ExtUtils-PkgConfig-1.16/t/2.t000644 001750 000024 00000001747 11747045551 016775 0ustar00bdmanningstaff000000 000000 #!/usr/bin/perl # # $Id$ # 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 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); } ExtUtils-PkgConfig-1.16/t/3.t000644 001750 000024 00000001415 12072653746 016771 0ustar00bdmanningstaff000000 000000 # # $Id$ # use strict; use warnings; use English; # uses $OSNAME below use Test::More tests => 6; use ExtUtils::PkgConfig; $ENV{PKG_CONFIG_PATH} = './t/'; my ($major, $minor) = split /\./, `pkg-config --version`; 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') ); SKIP: { skip("OpenBSD bug in pkg-config clone", 2) if($OSNAME eq "openbsd" && ($major == 0 && $minor <= 26)); 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.1.0') ); } ExtUtils-PkgConfig-1.16/t/4.t000644 001750 000024 00000004101 13076253336 016761 0ustar00bdmanningstaff000000 000000 # # $Id$ # use strict; use warnings; use Test::More tests => 24; 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')); # Check that '2' is turned into 2.0.0 $macros = ExtUtils::PkgConfig->create_version_macros (qw/test_short/, 'TEST'); ok (contains ($macros, 'TEST_MAJOR_VERSION (2)')); ok (contains ($macros, 'TEST_MINOR_VERSION (0)')); ok (contains ($macros, 'TEST_MICRO_VERSION (0)')); 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; } ExtUtils-PkgConfig-1.16/t/swallow_stderr.inc000644 001750 000024 00000000351 11664366504 022205 0ustar00bdmanningstaff000000 000000 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; ExtUtils-PkgConfig-1.16/t/test_glib-2.0.pc000644 001750 000024 00000000621 11664366504 021234 0ustar00bdmanningstaff000000 000000 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 ExtUtils-PkgConfig-1.16/t/test_non_numeric.pc000644 001750 000024 00000000266 11664366504 022343 0ustar00bdmanningstaff000000 000000 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 ExtUtils-PkgConfig-1.16/t/test_short.pc000644 001750 000024 00000000271 11747045551 021160 0ustar00bdmanningstaff000000 000000 prefix=/usr exec_prefix=/usr libdir=/usr/lib includedir=/usr/include Name: TestShort Description: Bla blub Version: 2 Libs: -L${libdir} -ltest-short Cflags: -I${includedir}/test-short ExtUtils-PkgConfig-1.16/lib/ExtUtils/000755 001750 000024 00000000000 13076263353 020521 5ustar00bdmanningstaff000000 000000 ExtUtils-PkgConfig-1.16/lib/ExtUtils/PkgConfig.pm000644 001750 000024 00000021512 13076263255 022730 0ustar00bdmanningstaff000000 000000 # Copyright (c) 2003-2004, 2012-2013 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., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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.16'; 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 exists { my ($class, @pkg_candidates) = @_; foreach my $candidate (@pkg_candidates) { my $output = qx/pkg-config --exists "$candidate" 2>&1/; if (0 == $CHILD_ERROR) { return 1; } } return ''; } 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 defined $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[1] = 0 unless defined $modversion[1]; $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"; $exists = ExtUtils::PkgConfig->exists($package); $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 (you'll have to know what to use here). The returned I 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, 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 for the library specified by I. The result is returned. Example input would be "gtk+-2.0" for I and "GTK" for I. =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 and I pairs and write them to the file I. If it doesn't exist, I 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 L This module is really just an interface to the pkg-config utility program. http://www.freedesktop.org/Software/pkgconfig =head1 AUTHORS muppet Escott at asofyet dot orgE. =head1 COPYRIGHT AND LICENSE Copyright 2003-2004, 2012-2013 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