Skip to content

Commit

Permalink
Copy minimal files from messagepack-c as possible
Browse files Browse the repository at this point in the history
It has C++ header files and needless header files for Data::MessagePack.
  • Loading branch information
syohex committed Mar 1, 2016
1 parent 7a016d2 commit f999cb7
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -123,21 +123,33 @@ sub init_msgpack {
require File::Copy::Recursive;

File::Path::rmtree([qw(include t/std)]);
File::Path::mkpath([qw(include/msgpack t/std)]);

for my $src (<msgpack-c/include/msgpack*>) {
next if $src =~ m/^\.\.?$/;


print "AuthorMode: copy $src to include/msgpack\n";
if (-d $src) {
File::Copy::Recursive::rcopy($src, 'include/msgpack') or die "copy failed: $!";
} else {
File::Copy::copy($src, 'include/msgpack') or die "copy failed: $!";
my %msgpack_header = (
'include' => ['msgpack-c/include/msgpack.h'],
'include/msgpack' => [<msgpack-c/include/msgpack/pack*.h>,
<msgpack-c/include/msgpack/unpack*.h>,
'msgpack-c/include/msgpack/sysdep.h',
'msgpack-c/include/msgpack/predef.h'],
'include/msgpack/predef' => ['msgpack-c/include/msgpack/predef'],
);

while (my ($dest, $srcs) = each %msgpack_header) {
File::Path::mkpath([$dest]);

for my $src (@{$srcs}) {
next if $src =~ m/^\.\.?$/;
print "AuthorMode: copy $src to $dest\n";

if (-d $src) {
File::Copy::Recursive::dircopy($src, "$dest/") or die "copy failed: $!";
} else {
File::Copy::copy($src, $dest) or die "copy failed: $!";
}
}
}

for my $src(<msgpack-c/test/*.mpac msgpack-c/*.json>) {
File::Path::mkpath([qw(t/std)]);
for my $src(<msgpack-c/test/*.mpac>) {
print "AuthorMode: copy $src to t/std/\n";
File::Copy::copy($src, 't/std') or die "copy failed: $!";
}
Expand Down

0 comments on commit f999cb7

Please sign in to comment.