Skip to content

Commit 19a7e1c

Browse files
committed
Introduce an INST_SHARE pseudo-target
This is not a real installation directory yet, because the backend (ExtUtils::Install and %Config) don't support that yet.
1 parent 7a553e1 commit 19a7e1c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

lib/ExtUtils/MM_Any.pm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,6 +1935,8 @@ sub init_INST {
19351935
$self->{INST_ARCHAUTODIR} = $self->catdir('$(INST_ARCHLIB)', 'auto',
19361936
'$(FULLEXT)');
19371937

1938+
$self->{INST_SHARE} ||= $self->catdir('$(INST_LIB)', 'auto', 'share');
1939+
19381940
$self->{INST_SCRIPT} ||= $self->catdir($Curdir,'blib','script');
19391941

19401942
$self->{INST_MAN1DIR} ||= $self->catdir($Curdir,'blib','man1');
@@ -2974,9 +2976,9 @@ sub sharedir {
29742976
return '' unless %share;
29752977

29762978
my %files;
2977-
$self->_sharedir_find_files(\%files, $share{dist}, File::Spec->catdir('$(INST_LIB)', qw(auto share dist), '$(DISTNAME)'), \%share) if $share{dist};
2979+
$self->_sharedir_find_files(\%files, $share{dist}, [qw/ $(INST_SHARE) dist $(DISTNAME) /], \%share) if $share{dist};
29782980
for my $module (keys %{ $share{module} || {} }) {
2979-
my $destination = File::Spec->catdir('$(INST_LIB)', qw(auto share module), $module);
2981+
my $destination = [ qw/$(INST_SHARE) module/, $module ];
29802982
$self->_sharedir_find_files(\%files, $share{module}{$module}, $destination, \%share);
29812983
}
29822984
my $pm_to_blib = $self->oneliner(q{pm_to_blib({@ARGV}, '$(INST_LIB)')}, ['-MExtUtils::Install']);
@@ -2992,7 +2994,8 @@ sub _sharedir_find_files {
29922994
return;
29932995
}
29942996
return if $options->{skip_dotfile} && /^\./;
2995-
$files->{$_} = $self->catfile($sink, $_);
2997+
my $file = $self->abs2rel($_, $source);
2998+
$files->{$_} = $self->catfile(@{$sink}, $file);
29962999
},
29973000
no_chdir => 1,
29983001
}, $source);

lib/ExtUtils/MM_Unix.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ INST_ARCHLIBDIR = $self->{INST_ARCHLIBDIR}
510510
511511
INST_AUTODIR = $self->{INST_AUTODIR}
512512
INST_ARCHAUTODIR = $self->{INST_ARCHAUTODIR}
513+
INST_SHARE = $self->{INST_SHARE}
513514
514515
INST_STATIC = $self->{INST_STATIC}
515516
INST_DYNAMIC = $self->{INST_DYNAMIC}

t/sharedir.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ SKIP: {
8484
run_ok('make');
8585
run_ok('make', 'install');
8686

87-
my $dir = catdir($install, qw/lib perl5 auto share dist TestDist share/);
87+
my $dir = catdir($install, qw/lib perl5 auto share dist TestDist/);
8888
ok(-d $dir, 'Sharedir has been created');
8989
ok(-e catfile($dir, 'normalfile'), 'File in sharedir has been created');
9090
ok(-e catfile($dir, qw/dots .dotdir .dotfile/), 'A dotfile in a dotdir installed');

0 commit comments

Comments
 (0)