Codebase list libextutils-depends-perl / upstream/0.307
Imported Upstream version 0.307 Florian Schlichting 10 years ago
8 changed file(s) with 97 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
00 Revision history for Perl extension ExtUtils::Depends.
1
2 0.307 Mon Apr 28 22:04:38 PDT 2014
3 - $Data::Dumper::Terse set to 1 broke save_config
4 - Document API expected by ::load function
15
26 0.306 Mon Sep 28 22:04:38 PDT 2013
37 - Fixed typo in RT queue URL; fixes RT#88960
33 "Gtk2-Perl Team <gtk-perl-list at gnome dot org>"
44 ],
55 "dynamic_config" : 1,
6 "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921",
6 "generated_by" : "ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 2.133380",
77 "keywords" : [
88 "XS",
99 "XS extensions",
2929 "prereqs" : {
3030 "build" : {
3131 "requires" : {
32 "ExtUtils::MakeMaker" : "0",
3233 "Test::More" : "0"
3334 }
3435 },
3536 "configure" : {
3637 "requires" : {
3738 "Data::Dumper" : "0",
39 "ExtUtils::MakeMaker" : "0",
3840 "File::Spec" : "0",
3941 "IO::File" : "0"
42 }
43 },
44 "runtime" : {
45 "requires" : {
46 "Data::Dumper" : "0",
47 "File::Spec" : "0",
48 "IO::File" : "0",
49 "perl" : "5.006"
4050 }
4151 },
4252 "test" : {
6272 },
6373 "x_MailingList" : "https://mail.gnome.org/mailman/listinfo/gtk-perl-list"
6474 },
65 "version" : "0.306"
75 "version" : "0.307"
6676 }
22 author:
33 - 'Gtk2-Perl Team <gtk-perl-list at gnome dot org>'
44 build_requires:
5 ExtUtils::MakeMaker: 0
56 Test::More: 0
67 configure_requires:
78 Data::Dumper: 0
9 ExtUtils::MakeMaker: 0
810 File::Spec: 0
911 IO::File: 0
1012 dynamic_config: 1
11 generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921'
13 generated_by: 'ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 2.133380'
1214 keywords:
1315 - XS
1416 - 'XS extensions'
2426 - inc
2527 package:
2628 - ExtUtils::MM
29 requires:
30 Data::Dumper: 0
31 File::Spec: 0
32 IO::File: 0
33 perl: 5.006
2734 resources:
35 MailingList: https://mail.gnome.org/mailman/listinfo/gtk-perl-list
2836 bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=ExtUtils-Depends
2937 homepage: http://gtk2-perl.sourceforge.net
3038 license: http://dev.perl.org/licenses/
3139 repository: git://git.gnome.org/perl-ExtUtils-Depends
32 x_MailingList: https://mail.gnome.org/mailman/listinfo/gtk-perl-list
33 version: 0.306
40 version: 0.307
33 "Gtk2-Perl Team <gtk-perl-list at gnome dot org>"
44 ],
55 "dynamic_config" : 0,
6 "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921",
6 "generated_by" : "ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 2.133380",
77 "keywords" : [
88 "XS",
99 "XS extensions",
2929 "prereqs" : {
3030 "build" : {
3131 "requires" : {
32 "ExtUtils::MakeMaker" : "0",
3233 "Test::More" : "0"
3334 }
3435 },
3536 "configure" : {
3637 "requires" : {
3738 "Data::Dumper" : "0",
39 "ExtUtils::MakeMaker" : "0",
3840 "File::Spec" : "0",
3941 "IO::File" : "0"
42 }
43 },
44 "runtime" : {
45 "requires" : {
46 "Data::Dumper" : "0",
47 "File::Spec" : "0",
48 "IO::File" : "0",
49 "perl" : "5.006"
4050 }
4151 },
4252 "test" : {
6272 },
6373 "x_MailingList" : "https://mail.gnome.org/mailman/listinfo/gtk-perl-list"
6474 },
65 "version" : "0.306"
75 "version" : "0.307"
6676 }
22 author:
33 - 'Gtk2-Perl Team <gtk-perl-list at gnome dot org>'
44 build_requires:
5 ExtUtils::MakeMaker: 0
56 Test::More: 0
67 configure_requires:
78 Data::Dumper: 0
9 ExtUtils::MakeMaker: 0
810 File::Spec: 0
911 IO::File: 0
1012 dynamic_config: 0
11 generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921'
13 generated_by: 'ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 2.133380'
1214 keywords:
1315 - XS
1416 - 'XS extensions'
2426 - inc
2527 package:
2628 - ExtUtils::MM
29 requires:
30 Data::Dumper: 0
31 File::Spec: 0
32 IO::File: 0
33 perl: 5.006
2734 resources:
35 MailingList: https://mail.gnome.org/mailman/listinfo/gtk-perl-list
2836 bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=ExtUtils-Depends
2937 homepage: http://gtk2-perl.sourceforge.net
3038 license: http://dev.perl.org/licenses/
3139 repository: git://git.gnome.org/perl-ExtUtils-Depends
32 x_MailingList: https://mail.gnome.org/mailman/listinfo/gtk-perl-list
33 version: 0.306
40 version: 0.307
4242 into the data structures required by ExtUtils::MakeMaker's WriteMakefile
4343 function.
4444
45 For information on how to make your module fit into this scheme, see
46 "hashref = ExtUtils::Depends::load (name)".
47
4548 When creating a new Depends object, you give it a name, which is the
4649 name of the module you are building. You can also specify the names of
4750 modules on which this module depends. These dependencies will be loaded
148151 exist when loading files created by old versions of
149152 ExtUtils::Depends.
150153
154 If you want to make module *name* support this, you must provide a
155 module *name*::Install::Files, which on loading will provide the
156 following package variables: @typemaps, $inc, $libs, $deps, with the
157 same contents as above (not coincidentally). The "load" function
158 will supply the "instpath". An easy way to achieve this is to use
159 the method "$depends->save_config ($filename)", but your package may
160 have different facilities already.
161
151162 $depends->load_deps
152163 Load *$depends* dependencies, by calling "load" on each dependency
153164 module. This is usually done for you, and should only be needed if
1010 use File::Spec;
1111 use Data::Dumper;
1212
13 our $VERSION = '0.306';
13 our $VERSION = '0.307';
1414
1515 sub import {
1616 my $class = shift;
111111
112112 sub save_config {
113113 use Data::Dumper;
114 local $Data::Dumper::Terse = 0;
114115 use IO::File;
115116
116117 my ($self, $filename) = @_;
119120 or croak "can't open '$filename' for writing: $!\n";
120121
121122 print $file "package $self->{name}\::Install::Files;\n\n";
122 # for modern stuff
123123 print $file "".Data::Dumper->Dump([{
124124 inc => join (" ", @{ $self->{inc} }),
125125 libs => $self->{libs},
126126 typemaps => [ map { basename $_ } @{ $self->{typemaps} } ],
127127 deps => [keys %{ $self->{deps} }],
128128 }], ['self']);
129 # for ancient stuff
130 print $file "\n\n# this is for backwards compatiblity\n";
131 print $file "\@deps = \@{ \$self->{deps} };\n";
129 print $file "\n\n\@deps = \@{ \$self->{deps} };\n";
132130 print $file "\@typemaps = \@{ \$self->{typemaps} };\n";
133131 print $file "\$libs = \$self->{libs};\n";
134132 print $file "\$inc = \$self->{inc};\n";
413411 into the data structures required by ExtUtils::MakeMaker's WriteMakefile
414412 function.
415413
414 For information on how to make your module fit into this scheme, see
415 L</"hashref = ExtUtils::Depends::load (name)">.
416
416417 When creating a new Depends object, you give it a name, which is the name
417418 of the module you are building. You can also specify the names of modules
418419 on which this module depends. These dependencies will be loaded
545546
546547 =back
547548
549 If you want to make module I<name> support this, you must provide
550 a module I<name>::Install::Files, which on loading will provide the
551 following package variables: C<@typemaps>, C<$inc>, C<$libs>, C<$deps>,
552 with the same contents as above (not coincidentally). The C<load>
553 function will supply the C<instpath>. An easy way to achieve this is
554 to use the method L</"$depends-E<gt>save_config ($filename)">, but your
555 package may have different facilities already.
556
548557 =item $depends->load_deps
549558
550559 Load I<$depends> dependencies, by calling C<load> on each dependency module.
11 use strict;
22 use warnings;
33
4 use Test::More tests => 24;
4 use Test::More tests => 28;
55
66 use FindBin;
77 use lib "$FindBin::Bin/lib";
3939 dep-private.h);
4040 $dep_info->install (@installed_files);
4141
42 use Data::Dumper;
43 $Data::Dumper::Terse = 1;
4244 $dep_info->save_config (catfile $tmp_inc, qw(DepTest Install Files.pm));
4345
4446 # --------------------------------------------------------------------------- #
7476
7577 my $install_part = qr|DepTest.Install|;
7678 like ($info->{inc}, $install_part);
77 ok (-1 != index $info->{inc}, $inc);
79 isnt (index($info->{inc}, $inc), -1);
7880
79 isa_ok ($info->{typemaps}, 'ARRAY');
81 my @typemaps_expected = map { my $t = $_; $t =~ s#build/##; $t } @typemaps;
82 sub strip_typemap { my $t = $_; $t =~ s#.*DepTest/Install/##; $t }
83 is_deeply (
84 [ map { strip_typemap($_) } @{$info->{typemaps}} ],
85 \@typemaps_expected,
86 'check typemaps actually saved/loaded'
87 );
8088
8189 like ($info->{instpath}, $install_part);
8290
8492
8593 is ($info->{libs}, $libs);
8694
95 # now check package vars are set, per the ::load doc!
96 {
97 no warnings qw(once);
98 is ($DepTest::Install::Files::inc, $inc);
99 is_deeply (
100 [ map { strip_typemap($_) } @DepTest::Install::Files::typemaps ],
101 \@typemaps_expected,
102 'api check typemaps'
103 );
104 is_deeply (\@DepTest::Install::Files::deps, []);
105 is ($DepTest::Install::Files::libs, $libs);
106 }
107
87108 # --------------------------------------------------------------------------- #