Hello community,
here is the log from the commit of package perl-ExtUtils-Depends for openSUSE:Factory checked in at 2014-09-20 15:49:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-ExtUtils-Depends (Old)
and /work/SRC/openSUSE:Factory/.perl-ExtUtils-Depends.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-ExtUtils-Depends"
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-ExtUtils-Depends/perl-ExtUtils-Depends.changes 2013-10-11 09:00:27.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.perl-ExtUtils-Depends.new/perl-ExtUtils-Depends.changes 2014-09-20 15:49:13.000000000 +0200
@@ -1,0 +2,36 @@
+Fri Sep 19 12:15:47 UTC 2014 - coolo@suse.com
+
+- updated to 0.401
+ - Add README changes created by 'make dist' from the POD
+ - Rename test modules
+ - Test old/new schemes with .pm files
+ - Move old/new scheme tests from middle of other stuff to end
+ - Rename test packages to 8.3 unique
+
+ 0.400 Sun Aug 10 13:58:24 CEST 2014
+ - In addition to the package variables $inc, $libs and @typemaps, write an
+ 'Inline' method to <package>::Install::Files for easier interoperability
+ with the Inline module.
+ - Accompany the 'Inline' method with a 'deps' method in
+ <package>::Install::Files in addition to the @deps package variable.
+ - Make ExtUtils::Depends->load use the 'Inline' and 'deps' methods by
+ default, falling back to the package variables if the methods are not
+ defined.
+ - Make the docs recommend the 'Inline' and 'deps' approach for creating
+ <package>::Install::Files manually, without
+ ExtUtils::Depends::save_config.
+
+ 0.309 Sat Aug 2 15:23:03 PDT 2014
+ - Depends.pm: use $DLEXT instead of $SO for library filename extensions
+ - MANIFEST: remove MYMETA.* files
+ - use DynaLoader::mod2fname if available
+ - Added Android support
+
+ 0.308 Sun May 18 16:22:11 PDT 2014
+ - Fix win32 test failure in t/02_save_load.t (closes RT#95301)
+
+ 0.307 Mon Apr 28 22:04:38 PDT 2014
+ - $Data::Dumper::Terse set to 1 broke save_config
+ - Document API expected by ::load function
+
+-------------------------------------------------------------------
Old:
----
ExtUtils-Depends-0.306.tar.gz
New:
----
ExtUtils-Depends-0.401.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-ExtUtils-Depends.spec ++++++
--- /var/tmp/diff_new_pack.mUqpkm/_old 2014-09-20 15:49:14.000000000 +0200
+++ /var/tmp/diff_new_pack.mUqpkm/_new 2014-09-20 15:49:14.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-ExtUtils-Depends
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: perl-ExtUtils-Depends
-Version: 0.306
+Version: 0.401
Release: 0
%define cpan_name ExtUtils-Depends
Summary: Easily build XS extensions that depend on XS extensions
@@ -29,8 +29,7 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
-#BuildRequires: perl(ExtUtils::Depends)
-#BuildRequires: perl(TestHelper)
+BuildRequires: perl(Test::More) >= 0.88
%{perl_requires}
%description
@@ -51,6 +50,9 @@
retrieved later. The object can also reformat this information into the
data structures required by ExtUtils::MakeMaker's WriteMakefile function.
+For information on how to make your module fit into this scheme, see the
+/"hashref = ExtUtils::Depends::load (name)" manpage.
+
When creating a new Depends object, you give it a name, which is the name
of the module you are building. You can also specify the names of modules
on which this module depends. These dependencies will be loaded
@@ -69,6 +71,28 @@
this command automatically brings in all the stuff needed
for Glib, since Gtk2 depends on it.
+When the configuration information is saved, it also includes a class
+method called 'Inline', inheritable by your module. This allows you in your
+module to simply say at the top:
+
+ package Mymod;
+ use parent 'Mymod::Install::Files'; # to inherit 'Inline' method
+
+And users of 'Mymod' who want to write inline code (using the Inline
+manpage) will simply be able to write:
+
+ use Inline with => 'Mymod';
+
+And all the necessary header files, defines, and libraries will be added
+for them.
+
+The 'Mymod::Install::Files' will also implement a 'deps' method, which will
+return a list of any modules that 'Mymod' depends on - you will not
+normally need to use this:
+
+ require Mymod::Install::Files;
+ @deps = Mymod::Install::Files->deps;
+
%prep
%setup -q -n %{cpan_name}-%{version}
++++++ ExtUtils-Depends-0.306.tar.gz -> ExtUtils-Depends-0.401.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ExtUtils-Depends-0.306/Changes new/ExtUtils-Depends-0.401/Changes
--- old/ExtUtils-Depends-0.306/Changes 2013-09-29 07:05:38.000000000 +0200
+++ new/ExtUtils-Depends-0.401/Changes 2014-08-23 07:22:56.000000000 +0200
@@ -1,5 +1,38 @@
Revision history for Perl extension ExtUtils::Depends.
+0.401 Sat Aug 23 14:20:11 IRKT 2014
+ - Add README changes created by 'make dist' from the POD
+ - Rename test modules
+ - Test old/new schemes with .pm files
+ - Move old/new scheme tests from middle of other stuff to end
+ - Rename test packages to 8.3 unique
+
+0.400 Sun Aug 10 13:58:24 CEST 2014
+ - In addition to the package variables $inc, $libs and @typemaps, write an
+ 'Inline' method to <package>::Install::Files for easier interoperability
+ with the Inline module.
+ - Accompany the 'Inline' method with a 'deps' method in
+ <package>::Install::Files in addition to the @deps package variable.
+ - Make ExtUtils::Depends->load use the 'Inline' and 'deps' methods by
+ default, falling back to the package variables if the methods are not
+ defined.
+ - Make the docs recommend the 'Inline' and 'deps' approach for creating
+ <package>::Install::Files manually, without
+ ExtUtils::Depends::save_config.
+
+0.309 Sat Aug 2 15:23:03 PDT 2014
+ - Depends.pm: use $DLEXT instead of $SO for library filename extensions
+ - MANIFEST: remove MYMETA.* files
+ - use DynaLoader::mod2fname if available
+ - Added Android support
+
+0.308 Sun May 18 16:22:11 PDT 2014
+ - Fix win32 test failure in t/02_save_load.t (closes RT#95301)
+
+0.307 Mon Apr 28 22:04:38 PDT 2014
+ - $Data::Dumper::Terse set to 1 broke save_config
+ - Document API expected by ::load function
+
0.306 Mon Sep 28 22:04:38 PDT 2013
- Fixed typo in RT queue URL; fixes RT#88960
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ExtUtils-Depends-0.306/MANIFEST new/ExtUtils-Depends-0.401/MANIFEST
--- old/ExtUtils-Depends-0.306/MANIFEST 2013-09-29 07:08:18.000000000 +0200
+++ new/ExtUtils-Depends-0.401/MANIFEST 2014-08-23 07:23:53.000000000 +0200
@@ -15,6 +15,10 @@
t/inc/DepTest/DepTest.lib
t/inc/DepTest/Install/.keep
t/inc/DepTest/libDepTest.dll.a
+t/inc/DepTest/PL_DepTest.dll
+t/inc/DepTest/PL_DepTest.lib
+t/inc/DepTest/PL_DepTest.so
+t/inc/DepTest/PL_libDepTest.dll.a
t/lib/TestHelper.pm
META.yml Module YAML meta-data (added by MakeMaker)
META.json Module JSON meta-data (added by MakeMaker)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ExtUtils-Depends-0.306/META.json new/ExtUtils-Depends-0.401/META.json
--- old/ExtUtils-Depends-0.306/META.json 2013-09-29 07:08:18.000000000 +0200
+++ new/ExtUtils-Depends-0.401/META.json 2014-08-23 07:23:53.000000000 +0200
@@ -4,7 +4,7 @@
"Gtk2-Perl Team <gtk-perl-list at gnome dot org>"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921",
+ "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.141520",
"keywords" : [
"XS",
"XS extensions",
@@ -30,16 +30,26 @@
"prereqs" : {
"build" : {
"requires" : {
- "Test::More" : "0"
+ "ExtUtils::MakeMaker" : "0",
+ "Test::More" : "0.88"
}
},
"configure" : {
"requires" : {
"Data::Dumper" : "0",
+ "ExtUtils::MakeMaker" : "0",
"File::Spec" : "0",
"IO::File" : "0"
}
},
+ "runtime" : {
+ "requires" : {
+ "Data::Dumper" : "0",
+ "File::Spec" : "0",
+ "IO::File" : "0",
+ "perl" : "5.006"
+ }
+ },
"test" : {
"recommends" : {
"Test::Number::Delta" : "1"
@@ -63,5 +73,5 @@
},
"x_MailingList" : "https://mail.gnome.org/mailman/listinfo/gtk-perl-list"
},
- "version" : "0.306"
+ "version" : "0.401"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ExtUtils-Depends-0.306/META.yml new/ExtUtils-Depends-0.401/META.yml
--- old/ExtUtils-Depends-0.306/META.yml 2013-09-29 07:08:18.000000000 +0200
+++ new/ExtUtils-Depends-0.401/META.yml 2014-08-23 07:23:52.000000000 +0200
@@ -3,13 +3,15 @@
author:
- 'Gtk2-Perl Team <gtk-perl-list at gnome dot org>'
build_requires:
- Test::More: 0
+ ExtUtils::MakeMaker: '0'
+ Test::More: '0.88'
configure_requires:
- Data::Dumper: 0
- File::Spec: 0
- IO::File: 0
+ Data::Dumper: '0'
+ ExtUtils::MakeMaker: '0'
+ File::Spec: '0'
+ IO::File: '0'
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921'
+generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.141520'
keywords:
- XS
- 'XS extensions'
@@ -17,7 +19,7 @@
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ version: '1.4'
name: ExtUtils-Depends
no_index:
directory:
@@ -25,10 +27,15 @@
- inc
package:
- ExtUtils::MM
+requires:
+ Data::Dumper: '0'
+ File::Spec: '0'
+ IO::File: '0'
+ perl: '5.006'
resources:
+ MailingList: https://mail.gnome.org/mailman/listinfo/gtk-perl-list
bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=ExtUtils-Depends
homepage: http://gtk2-perl.sourceforge.net
license: http://dev.perl.org/licenses/
repository: git://git.gnome.org/perl-ExtUtils-Depends
- x_MailingList: https://mail.gnome.org/mailman/listinfo/gtk-perl-list
-version: 0.306
+version: '0.401'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ExtUtils-Depends-0.306/MYMETA.json new/ExtUtils-Depends-0.401/MYMETA.json
--- old/ExtUtils-Depends-0.306/MYMETA.json 2013-09-29 07:06:42.000000000 +0200
+++ new/ExtUtils-Depends-0.401/MYMETA.json 2014-08-23 07:23:24.000000000 +0200
@@ -4,7 +4,7 @@
"Gtk2-Perl Team <gtk-perl-list at gnome dot org>"
],
"dynamic_config" : 0,
- "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921",
+ "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.141520",
"keywords" : [
"XS",
"XS extensions",
@@ -30,16 +30,26 @@
"prereqs" : {
"build" : {
"requires" : {
- "Test::More" : "0"
+ "ExtUtils::MakeMaker" : "0",
+ "Test::More" : "0.88"
}
},
"configure" : {
"requires" : {
"Data::Dumper" : "0",
+ "ExtUtils::MakeMaker" : "0",
"File::Spec" : "0",
"IO::File" : "0"
}
},
+ "runtime" : {
+ "requires" : {
+ "Data::Dumper" : "0",
+ "File::Spec" : "0",
+ "IO::File" : "0",
+ "perl" : "5.006"
+ }
+ },
"test" : {
"recommends" : {
"Test::Number::Delta" : "1"
@@ -63,5 +73,5 @@
},
"x_MailingList" : "https://mail.gnome.org/mailman/listinfo/gtk-perl-list"
},
- "version" : "0.306"
+ "version" : "0.401"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ExtUtils-Depends-0.306/MYMETA.yml new/ExtUtils-Depends-0.401/MYMETA.yml
--- old/ExtUtils-Depends-0.306/MYMETA.yml 2013-09-29 07:06:42.000000000 +0200
+++ new/ExtUtils-Depends-0.401/MYMETA.yml 2014-08-23 07:23:24.000000000 +0200
@@ -3,13 +3,15 @@
author:
- 'Gtk2-Perl Team <gtk-perl-list at gnome dot org>'
build_requires:
- Test::More: 0
+ ExtUtils::MakeMaker: '0'
+ Test::More: '0.88'
configure_requires:
- Data::Dumper: 0
- File::Spec: 0
- IO::File: 0
+ Data::Dumper: '0'
+ ExtUtils::MakeMaker: '0'
+ File::Spec: '0'
+ IO::File: '0'
dynamic_config: 0
-generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921'
+generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.141520'
keywords:
- XS
- 'XS extensions'
@@ -17,7 +19,7 @@
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ version: '1.4'
name: ExtUtils-Depends
no_index:
directory:
@@ -25,10 +27,15 @@
- inc
package:
- ExtUtils::MM
+requires:
+ Data::Dumper: '0'
+ File::Spec: '0'
+ IO::File: '0'
+ perl: '5.006'
resources:
+ MailingList: https://mail.gnome.org/mailman/listinfo/gtk-perl-list
bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=ExtUtils-Depends
homepage: http://gtk2-perl.sourceforge.net
license: http://dev.perl.org/licenses/
repository: git://git.gnome.org/perl-ExtUtils-Depends
- x_MailingList: https://mail.gnome.org/mailman/listinfo/gtk-perl-list
-version: 0.306
+version: '0.401'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ExtUtils-Depends-0.306/Makefile.PL new/ExtUtils-Depends-0.401/Makefile.PL
--- old/ExtUtils-Depends-0.306/Makefile.PL 2013-09-29 05:13:17.000000000 +0200
+++ new/ExtUtils-Depends-0.401/Makefile.PL 2014-08-22 10:42:03.000000000 +0200
@@ -42,7 +42,7 @@
},
build => {
requires => {
- 'Test::More' => 0,
+ 'Test::More' => 0.88,
},
},
test => {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ExtUtils-Depends-0.306/README new/ExtUtils-Depends-0.401/README
--- old/ExtUtils-Depends-0.306/README 2013-09-29 07:08:18.000000000 +0200
+++ new/ExtUtils-Depends-0.401/README 2014-08-23 07:23:53.000000000 +0200
@@ -43,6 +43,9 @@
into the data structures required by ExtUtils::MakeMaker's WriteMakefile
function.
+ For information on how to make your module fit into this scheme, see
+ "hashref = ExtUtils::Depends::load (name)".
+
When creating a new Depends object, you give it a name, which is the
name of the module you are building. You can also specify the names of
modules on which this module depends. These dependencies will be loaded
@@ -61,6 +64,28 @@
this command automatically brings in all the stuff needed
for Glib, since Gtk2 depends on it.
+ When the configuration information is saved, it also includes a class
+ method called "Inline", inheritable by your module. This allows you in
+ your module to simply say at the top:
+
+ package Mymod;
+ use parent 'Mymod::Install::Files'; # to inherit 'Inline' method
+
+ And users of "Mymod" who want to write inline code (using Inline) will
+ simply be able to write:
+
+ use Inline with => 'Mymod';
+
+ And all the necessary header files, defines, and libraries will be added
+ for them.
+
+ The "Mymod::Install::Files" will also implement a "deps" method, which
+ will return a list of any modules that "Mymod" depends on - you will not
+ normally need to use this:
+
+ require Mymod::Install::Files;
+ @deps = Mymod::Install::Files->deps;
+
METHODS
$object = ExtUtils::Depends->new($name, @deps)
Create a new depends object named *$name*. Any modules listed in
@@ -108,8 +133,9 @@
Save the important information from *$depends* to *$filename*, and
set it up to be installed as *name*::Install::Files.
- Note: the actual value of *$filename* seems to be irrelevant, but
- its usage is kept for backward compatibility.
+ Note: the actual value of *$filename* is unimportant so long as it
+ doesn't clash with any other local files. It will be installed as
+ *name*::Install::Files.
hash = $depends->get_makefile_vars
Return the information in *$depends* in a format digestible by
@@ -149,6 +175,19 @@
exist when loading files created by old versions of
ExtUtils::Depends.
+ If you want to make module *name* support this, you must provide a
+ module *name*::Install::Files, which on loading will implement the
+ following class methods:
+
+ $hashref = name::Install::Files->Inline('C');
+ # hash to contain any necessary TYPEMAPS (array-ref), LIBS, INC
+ @deps = name::Install::Files->deps;
+ # any modules on which "name" depends
+
+ An easy way to achieve this is to use the method
+ "$depends->save_config ($filename)", but your package may have
+ different facilities already.
+
$depends->load_deps
Load *$depends* dependencies, by calling "load" on each dependency
module. This is usually done for you, and should only be needed if
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ExtUtils-Depends-0.306/lib/ExtUtils/Depends.pm new/ExtUtils-Depends-0.401/lib/ExtUtils/Depends.pm
--- old/ExtUtils-Depends-0.306/lib/ExtUtils/Depends.pm 2013-09-29 07:04:16.000000000 +0200
+++ new/ExtUtils-Depends-0.401/lib/ExtUtils/Depends.pm 2014-08-23 07:22:49.000000000 +0200
@@ -7,11 +7,12 @@
use strict;
use warnings;
use Carp;
+use Config;
use File::Find;
use File::Spec;
use Data::Dumper;
-our $VERSION = '0.306';
+our $VERSION = '0.401';
sub import {
my $class = shift;
@@ -112,6 +113,7 @@
sub save_config {
use Data::Dumper;
+ local $Data::Dumper::Terse = 0;
use IO::File;
my ($self, $filename) = @_;
@@ -120,19 +122,19 @@
or croak "can't open '$filename' for writing: $!\n";
print $file "package $self->{name}\::Install::Files;\n\n";
- # for modern stuff
print $file "".Data::Dumper->Dump([{
inc => join (" ", @{ $self->{inc} }),
libs => $self->{libs},
typemaps => [ map { basename $_ } @{ $self->{typemaps} } ],
deps => [keys %{ $self->{deps} }],
}], ['self']);
- # for ancient stuff
- print $file "\n\n# this is for backwards compatiblity\n";
- print $file "\@deps = \@{ \$self->{deps} };\n";
- print $file "\@typemaps = \@{ \$self->{typemaps} };\n";
- print $file "\$libs = \$self->{libs};\n";
- print $file "\$inc = \$self->{inc};\n";
+ print $file <<'EOF';
+
+@deps = @{ $self->{deps} };
+@typemaps = @{ $self->{typemaps} };
+$libs = $self->{libs};
+$inc = $self->{inc};
+EOF
# this is ridiculous, but old versions of ExtUtils::Depends take
# first $loadedmodule::CORE and then $INC{$file} --- the fallback
# includes the Filename.pm, which is not useful. so we must add
@@ -148,6 +150,17 @@
last;
}
}
+
+ sub deps { \@{ \$self->{deps} }; }
+
+ sub Inline {
+ my (\$class, \$lang) = \@_;
+ if (\$lang ne 'C') {
+ warn "Warning: Inline hints not available for \$lang language\n";
+ return;
+ }
+ +{ map { (uc(\$_) => \$self->{\$_}) } qw(inc libs typemaps) };
+ }
EOT
print $file "\n1;\n";
@@ -169,14 +182,13 @@
eval {
require $relpath
} or die " *** Can't load dependency information for $dep:\n $@\n";
- #
#print Dumper(\%INC);
# effectively $instpath = dirname($INC{$relpath})
@pieces = File::Spec->splitdir ($INC{$relpath});
pop @pieces;
my $instpath = File::Spec->catdir (@pieces);
-
+
no strict;
croak "No dependency information found for $dep"
@@ -186,20 +198,32 @@
$instpath = File::Spec->rel2abs ($instpath);
}
- my @typemaps = map {
- File::Spec->rel2abs ($_, $instpath)
- } @{"$depinstallfiles\::typemaps"};
+ my (@typemaps, $inc, $libs, @deps);
+
+ # this will not exist when loading files from old versions
+ # of ExtUtils::Depends.
+ @deps = eval { $depinstallfiles->deps };
+ @deps = @{"$depinstallfiles\::deps"}
+ if $@ and exists ${"$depinstallfiles\::"}{deps};
+
+ my $inline = eval { $depinstallfiles->Inline('C') };
+ if (!$@) {
+ $inc = $inline->{INC} || '';
+ $libs = $inline->{LIBS} || '';
+ @typemaps = @{ $inline->{TYPEMAPS} || [] };
+ } else {
+ $inc = ${"$depinstallfiles\::inc"} || '';
+ $libs = ${"$depinstallfiles\::libs"} || '';
+ @typemaps = @{"$depinstallfiles\::typemaps"};
+ }
+ @typemaps = map { File::Spec->rel2abs ($_, $instpath) } @typemaps;
{
instpath => $instpath,
typemaps => \@typemaps,
- inc => "-I$instpath ".${"$depinstallfiles\::inc"},
- libs => ${"$depinstallfiles\::libs"},
- # this will not exist when loading files from old versions
- # of ExtUtils::Depends.
- (exists ${"$depinstallfiles\::"}{deps}
- ? (deps => \@{"$depinstallfiles\::deps"})
- : ()),
+ inc => "-I$instpath $inc",
+ libs => $libs,
+ deps => \@deps,
}
}
@@ -241,7 +265,7 @@
# collect and uniquify things from the dependencies.
# first, ensure they are completely loaded.
$self->load_deps;
-
+
##my @defbits = map { split } @{ $self->{defines} };
my @incbits = map { split } @{ $self->{inc} };
my @libsbits = split /\s+/, $self->{libs};
@@ -303,7 +327,7 @@
my ($self, $vars) = @_;
$vars->{macro} ||= {};
$vars->{macro}{'INST_DYNAMIC_LIB'} =
- '$(INST_ARCHAUTODIR)/$(BASEEXT)$(LIB_EXT)';
+ '$(INST_ARCHAUTODIR)/$(DLBASE)$(LIB_EXT)';
}
# Search for extra library files to link against on Windows (either native
@@ -315,6 +339,7 @@
my %mappers = (
MSWin32 => sub { $_[0] . '\.(?:lib|a)' },
cygwin => sub { $_[0] . '\.dll'},
+ android => sub { $_[0] . '\.' . $Config{dlext} },
);
my $mapper = $mappers{$^O};
return () unless defined $mapper;
@@ -322,6 +347,10 @@
my @found_libs = ();
foreach my $name (keys %{ $self->{deps} }) {
(my $stem = $name) =~ s/^.*:://;
+ if ( defined &DynaLoader::mod2fname ) {
+ my @parts = split /::/, $name;
+ $stem = DynaLoader::mod2fname([@parts]);
+ }
my $lib = $mapper->($stem);
my $pattern = qr/$lib$/;
@@ -336,6 +365,18 @@
if ($matching_file && -f $matching_file) {
push @found_libs, ('-L' . $matching_dir, '-l' . $stem);
+ # Android's linker ignores the RTLD_GLOBAL flag
+ # and loads everything as if under RTLD_LOCAL.
+ # What this means in practice is that modules need
+ # to explicitly link to their dependencies,
+ # because otherwise they won't be able to locate any
+ # functions they define.
+ # We use the -l:foo.so flag to indicate that the
+ # actual library name to look for is foo.so, not
+ # libfoo.so
+ if ( $^O eq 'android' ) {
+ $found_libs[-1] = "-l:$stem.$Config{dlext}";
+ }
next;
}
}
@@ -358,7 +399,7 @@
return <<"__EOM__"
# This isn't actually a static lib, it just has the same name on Win32.
\$(INST_DYNAMIC_LIB): \$(INST_DYNAMIC)
- $DLLTOOL --def \$(EXPORT_LIST) --output-lib \$\@ --dllname \$(BASEEXT).\$(SO) \$(INST_DYNAMIC)
+ $DLLTOOL --def \$(EXPORT_LIST) --output-lib \$\@ --dllname \$(DLBASE).\$(DLEXT) \$(INST_DYNAMIC)
dynamic:: \$(INST_DYNAMIC_LIB)
__EOM__
@@ -414,6 +455,9 @@
into the data structures required by ExtUtils::MakeMaker's WriteMakefile
function.
+For information on how to make your module fit into this scheme, see
+L"hashref = ExtUtils::Depends::load (name)">.
+
When creating a new Depends object, you give it a name, which is the name
of the module you are building. You can also specify the names of modules
on which this module depends. These dependencies will be loaded
@@ -432,6 +476,27 @@
this command automatically brings in all the stuff needed
for Glib, since Gtk2 depends on it.
+When the configuration information is saved, it also includes a class
+method called C<Inline>, inheritable by your module. This allows you in
+your module to simply say at the top:
+
+ package Mymod;
+ use parent 'Mymod::Install::Files'; # to inherit 'Inline' method
+
+And users of C<Mymod> who want to write inline code (using L<Inline>)
+will simply be able to write:
+
+ use Inline with => 'Mymod';
+
+And all the necessary header files, defines, and libraries will be added
+for them.
+
+The CMymod::Install::Files will also implement a C<deps> method,
+which will return a list of any modules that C<Mymod> depends on -
+you will not normally need to use this:
+
+ require Mymod::Install::Files;
+ @deps = Mymod::Install::Files->deps;
=head1 METHODS
@@ -494,8 +559,9 @@
Save the important information from I<$depends> to I<$filename>, and
set it up to be installed as I<name>::Install::Files.
-Note: the actual value of I<$filename> seems to be irrelevant, but its
-usage is kept for backward compatibility.
+Note: the actual value of I<$filename> is unimportant so long as it
+doesn't clash with any other local files. It will be installed as
+I<name>::Install::Files.
=item hash = $depends->get_makefile_vars
@@ -546,6 +612,19 @@
=back
+If you want to make module I<name> support this, you must provide
+a module I<name>::Install::Files, which on loading will implement the
+following class methods:
+
+ $hashref = name::Install::Files->Inline('C');
+ # hash to contain any necessary TYPEMAPS (array-ref), LIBS, INC
+ @deps = name::Install::Files->deps;
+ # any modules on which "name" depends
+
+An easy way to achieve this is to use the method
+L"$depends-E<gt>save_config ($filename)">, but your package may have
+different facilities already.
+
=item $depends->load_deps
Load I<$depends> dependencies, by calling C<load> on each dependency module.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ExtUtils-Depends-0.306/t/02_save_load.t new/ExtUtils-Depends-0.401/t/02_save_load.t
--- old/ExtUtils-Depends-0.306/t/02_save_load.t 2011-11-27 08:56:51.000000000 +0100
+++ new/ExtUtils-Depends-0.401/t/02_save_load.t 2014-08-22 14:54:17.000000000 +0200
@@ -2,11 +2,13 @@
use strict;
use warnings;
-use Test::More tests => 24;
+use Test::More;
use FindBin;
use lib "$FindBin::Bin/lib";
use TestHelper;
+use File::Path 'mkpath';
+use File::Spec::Functions 'catdir';
use ExtUtils::Depends;
@@ -40,33 +42,35 @@
dep-private.h);
$dep_info->install (@installed_files);
+use Data::Dumper;
+$Data::Dumper::Terse = 1;
$dep_info->save_config (catfile $tmp_inc, qw(DepTest Install Files.pm));
# --------------------------------------------------------------------------- #
my %vars = $dep_info->get_makefile_vars;
-is_deeply ($vars{TYPEMAPS}, \@typemaps);
-is ($vars{INC}, $inc);
-is ($vars{LIBS}, $libs);
+is_deeply ($vars{TYPEMAPS}, \@typemaps, 'makefile vars typemaps');
+is ($vars{INC}, $inc, 'makefile vars inc');
+is ($vars{LIBS}, $libs, 'makefile vars libs');
foreach my $pm (keys %pm_mapping) {
- like ($vars{PM}{$pm}, qr/\Q$pm_mapping{$pm}\E/);
+ like ($vars{PM}{$pm}, qr/\Q$pm_mapping{$pm}\E/, 'makefile vars PM');
}
-ok (exists $vars{PM}{catfile $tmp_inc, qw(DepTest Install Files.pm)});
+ok (exists $vars{PM}{catfile $tmp_inc, qw(DepTest Install Files.pm)}, 'PM');
foreach my $file (@installed_files) {
- like ($vars{PM}{$file}, qr/\Q$file\E/);
+ like ($vars{PM}{$file}, qr/\Q$file\E/, "PM $file");
}
foreach my $xs_file (@xs_files) {
- ok (exists $vars{XS}{$xs_file});
+ ok (exists $vars{XS}{$xs_file}, "XS $xs_file");
}
foreach my $file (@c_files, @xs_files) {
(my $stem = $file) =~ s/\.(?:c|xs)\z//;
- like ($vars{OBJECT}, qr/\Q$stem\E/);
- like ($vars{clean}{FILES}, qr/\Q$stem\E/);
+ like ($vars{OBJECT}, qr/\Q$stem\E/, "OBJECT $stem");
+ like ($vars{clean}{FILES}, qr/\Q$stem\E/, "FILES $stem");
}
# --------------------------------------------------------------------------- #
@@ -74,15 +78,76 @@
my $info = ExtUtils::Depends::load ('DepTest');
my $install_part = qr|DepTest.Install|;
-like ($info->{inc}, $install_part);
-ok (-1 != index $info->{inc}, $inc);
+like ($info->{inc}, $install_part, "loaded inc");
+isnt (index($info->{inc}, $inc), -1, "loaded inc content");
-isa_ok ($info->{typemaps}, 'ARRAY');
+my @typemaps_expected = map { my $t = $_; $t =~ s#build/##; $t } @typemaps;
+sub strip_typemap { my $t = $_; my $tmp = catfile('DepTest','Install',' '); $tmp =~ s# $##; $t =~ s#.*\Q$tmp\E##; $t }
+is_deeply (
+ [ map { strip_typemap($_) } @{$info->{typemaps}} ],
+ \@typemaps_expected,
+ 'check typemaps actually saved/loaded'
+);
+
+like ($info->{instpath}, $install_part, 'instpath');
+
+is_deeply ($info->{deps}, [], 'basic deps');
+
+is ($info->{libs}, $libs, 'basic libs');
+
+# now check package vars are set, per the ::load doc!
+{
+no warnings qw(once);
+is ($DepTest::Install::Files::inc, $inc, 'package inc');
+is_deeply (
+ [ map { strip_typemap($_) } @DepTest::Install::Files::typemaps ],
+ \@typemaps_expected,
+ 'package typemaps'
+);
+is_deeply (\@DepTest::Install::Files::deps, [], 'package deps');
+is ($DepTest::Install::Files::libs, $libs, 'package libs');
+}
-like ($info->{instpath}, $install_part);
+# test Inline class methods
+is_deeply (
+ DepTest::Install::Files->Inline('C'),
+ {
+ INC => $inc,
+ LIBS => $libs,
+ TYPEMAPS => \@typemaps_expected,
+ },
+ 'api check Inline method'
+);
+is_deeply ([ DepTest::Install::Files->deps ], [], 'api check deps method');
-is_deeply ($info->{deps}, []);
+# --------------------------------------------------------------------------- #
-is ($info->{libs}, $libs);
+my $INC_FRAG = '-Ddistinctive';
+make_test_pkg('PSnew', <