Codebase list libextutils-depends-perl / df57d5d
New upstream version 0.8001 gregor herrmann 2 years ago
6 changed file(s) with 29 addition(s) and 58 deletion(s). Raw diff Collapse all Expand all
00 Revision history for Perl extension ExtUtils::Depends.
1
2 0.8001
3 - Remove hack (cf https://rt.cpan.org/Ticket/Display.html?id=45224)
4 The hijacking of EUMM's `static_lib` method is now obsolete, as well as
5 causing problems.
6 - Also added a couple of code tidy-ups
17
28 0.8000
39 - Bump version so https://metacpan.org/pod/ExtUtils::Depends shows the
44 "Gtk2-Perl Team <gtk-perl-list at gnome dot org>"
55 ],
66 "dynamic_config" : 1,
7 "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010",
7 "generated_by" : "ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010",
88 "keywords" : [
99 "XS",
1010 "XS extensions",
3838 "configure" : {
3939 "requires" : {
4040 "Data::Dumper" : "0",
41 "ExtUtils::MakeMaker" : "0",
41 "ExtUtils::MakeMaker" : "7.44",
4242 "File::Spec" : "0",
4343 "IO::File" : "0"
4444 }
4646 "runtime" : {
4747 "requires" : {
4848 "Data::Dumper" : "0",
49 "ExtUtils::MakeMaker" : "7.44",
4950 "File::Spec" : "0",
5051 "IO::File" : "0",
5152 "perl" : "5.006"
7475 },
7576 "x_MailingList" : "https://mail.gnome.org/mailman/listinfo/gtk-perl-list"
7677 },
77 "version" : "0.8000",
78 "version" : "0.8001",
7879 "x_serialization_backend" : "JSON::PP version 2.97001"
7980 }
77 Test::More: '0'
88 configure_requires:
99 Data::Dumper: '0'
10 ExtUtils::MakeMaker: '0'
10 ExtUtils::MakeMaker: '7.44'
1111 File::Spec: '0'
1212 IO::File: '0'
1313 dynamic_config: 1
14 generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010'
14 generated_by: 'ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010'
1515 keywords:
1616 - XS
1717 - 'XS extensions'
2929 - ExtUtils::MM
3030 requires:
3131 Data::Dumper: '0'
32 ExtUtils::MakeMaker: '7.44'
3233 File::Spec: '0'
3334 IO::File: '0'
3435 perl: '5.006'
3839 homepage: http://gtk2-perl.sourceforge.net
3940 license: http://dev.perl.org/licenses/
4041 repository: git://git.gnome.org/perl-ExtUtils-Depends
41 version: '0.8000'
42 version: '0.8001'
4243 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
77 'File::Spec' => 0,
88 'Data::Dumper' => 0,
99 'IO::File' => 0,
10 'ExtUtils::MakeMaker' => '7.44', # no need for Win32 static_lib hack
1011 );
1112
1213 my %meta_merge = (
77 use File::Spec;
88 use Data::Dumper;
99
10 our $VERSION = '0.8000';
10 our $VERSION = '0.8001';
1111
1212 sub import {
1313 my $class = shift;
151151
152152 sub Inline {
153153 my (\$class, \$lang) = \@_;
154 if (\$lang ne 'C') {
155 warn "Warning: Inline hints not available for \$lang language\n";
156 return;
157 }
158154 +{ map { (uc(\$_) => \$self->{\$_}) } qw(inc libs typemaps) };
159155 }
160156 EOT
228224
229225 sub load_deps {
230226 my $self = shift;
231 my @load = grep { not $self->{deps}{$_} } keys %{ $self->{deps} };
227 my @load = grep !$self->{deps}{$_}, keys %{ $self->{deps} };
228 my %in_load; @in_load{@load} = ();
232229 foreach my $d (@load) {
233 my $dep = load ($d);
234 $self->{deps}{$d} = $dep;
235 if ($dep->{deps}) {
236 foreach my $childdep (@{ $dep->{deps} }) {
237 push @load, $childdep
238 unless
239 $self->{deps}{$childdep}
240 or
241 grep {$_ eq $childdep} @load;
242 }
243 }
230 $self->{deps}{$d} = my $dep = load($d);
231 my @new_deps = grep !($self->{deps}{$_} || exists $in_load{$_}),
232 @{ $dep->{deps} || [] };
233 push @load, @new_deps;
234 @in_load{@new_deps} = ();
244235 }
245236 }
246237
247238 sub uniquify {
248239 my %seen;
249 # we use a seen hash, but also keep indices to preserve
250 # first-seen order.
251 my $i = 0;
252 foreach (@_) {
253 $seen{$_} = ++$i
254 unless exists $seen{$_};
255 }
256 #warn "stripped ".(@_ - (keys %seen))." redundant elements\n";
257 sort { $seen{$a} <=> $seen{$b} } keys %seen;
258 }
259
240 grep !$seen{$_}++, @_;
241 }
260242
261243 sub get_makefile_vars {
262244 my $self = shift;
385367 return @found_libs;
386368 }
387369
388 # Hook into ExtUtils::MakeMaker to create an import library on MSWin32 when gcc
389 # is used. FIXME: Ideally, this should be done in EU::MM itself.
390 package # wrap to fool the CPAN indexer
391 ExtUtils::MM;
392 use Config;
393 sub static_lib {
394 my $base = shift->SUPER::static_lib(@_);
395
396 return $base unless $^O =~ /MSWin32/ && $Config{cc} =~ /\bgcc\b/i;
397
398 my $DLLTOOL = $Config{'dlltool'} || 'dlltool';
399
400 return <<"__EOM__"
401 # This isn't actually a static lib, it just has the same name on Win32.
402 \$(INST_DYNAMIC_LIB): \$(INST_DYNAMIC)
403 $DLLTOOL --def \$(EXPORT_LIST) --output-lib \$\@ --dllname \$(DLBASE).\$(DLEXT) \$(INST_DYNAMIC)
404
405 dynamic:: \$(INST_DYNAMIC_LIB)
406 __EOM__
407 }
408
409 1;
410
411370 __END__
412371
413372 =head1 NAME
11 use strict;
22 use warnings;
33
4 use Test::More tests => 40;
4 use Test::More tests => 41;
55
66 use FindBin;
77 use lib "$FindBin::Bin/lib";
5050 open my $iffh, '>>', $IFpm or die "write $IFpm: $!";
5151 print $iffh qq{\nwarn "LOADING\\n";\n1;\n};
5252 undef $iffh;
53
54 # test utility function
55 is_deeply [ExtUtils::Depends::uniquify(qw(a c b c a b))], [qw(a c b)];
5356
5457 # --------------------------------------------------------------------------- #
5558