Skip to content

Commit

Permalink
Introduce an INST_SHARE pseudo-target
Browse files Browse the repository at this point in the history
This is not a real installation directory yet, because the backend
(ExtUtils::Install and %Config) don't support that yet.
  • Loading branch information
Leont committed Apr 28, 2024
1 parent 7a553e1 commit 19a7e1c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lib/ExtUtils/MM_Any.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1935,6 +1935,8 @@ sub init_INST {
$self->{INST_ARCHAUTODIR} = $self->catdir('$(INST_ARCHLIB)', 'auto',
'$(FULLEXT)');

$self->{INST_SHARE} ||= $self->catdir('$(INST_LIB)', 'auto', 'share');

$self->{INST_SCRIPT} ||= $self->catdir($Curdir,'blib','script');

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

my %files;
$self->_sharedir_find_files(\%files, $share{dist}, File::Spec->catdir('$(INST_LIB)', qw(auto share dist), '$(DISTNAME)'), \%share) if $share{dist};
$self->_sharedir_find_files(\%files, $share{dist}, [qw/ $(INST_SHARE) dist $(DISTNAME) /], \%share) if $share{dist};
for my $module (keys %{ $share{module} || {} }) {
my $destination = File::Spec->catdir('$(INST_LIB)', qw(auto share module), $module);
my $destination = [ qw/$(INST_SHARE) module/, $module ];
$self->_sharedir_find_files(\%files, $share{module}{$module}, $destination, \%share);
}
my $pm_to_blib = $self->oneliner(q{pm_to_blib({@ARGV}, '$(INST_LIB)')}, ['-MExtUtils::Install']);
Expand All @@ -2992,7 +2994,8 @@ sub _sharedir_find_files {
return;
}
return if $options->{skip_dotfile} && /^\./;
$files->{$_} = $self->catfile($sink, $_);
my $file = $self->abs2rel($_, $source);
$files->{$_} = $self->catfile(@{$sink}, $file);
},
no_chdir => 1,
}, $source);
Expand Down
1 change: 1 addition & 0 deletions lib/ExtUtils/MM_Unix.pm
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ INST_ARCHLIBDIR = $self->{INST_ARCHLIBDIR}
INST_AUTODIR = $self->{INST_AUTODIR}
INST_ARCHAUTODIR = $self->{INST_ARCHAUTODIR}
INST_SHARE = $self->{INST_SHARE}
INST_STATIC = $self->{INST_STATIC}
INST_DYNAMIC = $self->{INST_DYNAMIC}
Expand Down
2 changes: 1 addition & 1 deletion t/sharedir.t
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ SKIP: {
run_ok('make');
run_ok('make', 'install');

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

0 comments on commit 19a7e1c

Please sign in to comment.