I have been doing some digging through repository history and the behaviour where one defines an installation directory
but not an architecture directory is pretty much implemented as described in the comment in sub init_lib2arch()
# The user who requests an installation directory explicitly
# should not have to tell us an architecture installation directory
# as well. We look if a directory exists that is named after the
# architecture. If not we take it as a sign that it should be the
# same as the requested installation directory. Otherwise we take
# the found one.
I built and installed a v5.24.1 perl with vendor paths:
Built under freebsd
Compiled at Jun 16 2017 09:47:23
@INC:
/opt/perl-5.24.1/lib/site_perl/5.24.1/amd64-freebsd
/opt/perl-5.24.1/lib/site_perl/5.24.1
/opt/perl-5.24.1/lib/vendor_perl/5.24.1/amd64-freebsd
/opt/perl-5.24.1/lib/vendor_perl/5.24.1
/opt/perl-5.24.1/lib/5.24.1/amd64-freebsd
/opt/perl-5.24.1/lib/5.24.1
.
# perl -V:vendorlib
vendorlib='/opt/perl-5.24.1/lib/vendor_perl/5.24.1';
# perl -V:vendorarch
vendorarch='/opt/perl-5.24.1/lib/vendor_perl/5.24.1/amd64-freebsd';
We have nothing under vendor yet:
# ls /opt/perl-5.24.1/lib/vendor_perl/
#
I unwrapped the Variable-Magic-0.61 tarball and amended the Makefile.PL to add $ExtUtils::MakeMaker::Verbose=1
5 use ExtUtils::MakeMaker;
6 $ExtUtils::MakeMaker::Verbose=1;
7 use Config;
# perl Makefile.PL INSTALLDIRS=vendor INSTALLVENDORLIB=/opt/perl-5.24.1/lib/vendor_perl/5.24.1
Checking if this is ActiveState Perl 5.8.8 build 822 or higher... no
Checking if this is gcc 3.4 on Windows trying to link against an import library... no
MakeMaker (v7.3)
Checking if your kit is complete...
Looks good
ABSTRACT_FROM => q[lib/Variable/Magic.pm]
AUTHOR => [q[Vincent Pit <perl@profvince.com>]]
BUILD_REQUIRES => { Carp=>q[0], Config=>q[0], Exporter=>q[0], ExtUtils::MakeMaker=>q[0], IO::Handle=>q[0], IO::Select=>q[0], IPC::Open3=>q[0], POSIX=>q[0], Socket=>q[0], Test::More=>q[0], XSLoader=>q[0], base=>q[0], lib=>q[0] }
CONFIGURE_REQUIRES => { }
INSTALLDIRS => q[vendor]
INSTALLVENDORLIB => q[/opt/perl-5.24.1/lib/vendor_perl/5.24.1]
LICENSE => q[perl]
META_MERGE => { build_requires=>{ Carp=>q[0], Config=>q[0], Exporter=>q[0], ExtUtils::MakeMaker=>q[0], IO::Handle=>q[0], IO::Select=>q[0], IPC::Open3=>q[0], POSIX=>q[0], Socket=>q[0], Test::More=>q[0], XSLoader=>q[0], base=>q[0], lib=>q[0] }, configure_requires=>{ Config=>q[0], ExtUtils::MakeMaker=>q[0] }, dynamic_config=>q[1], resources=>{ bugtracker=>q[
http://rt.cpan.org/Dist/Display.html?Name=Variable-Magic], homepage=>q[
http://search.cpan.org/dist/Variable-Magic/], license=>q[
http://dev.perl.org/licenses/], repository=>q[
http://git.profvince.com/?p=perl%2Fmodules%2FVariable-Magic.git] } }
MIN_PERL_VERSION => q[5.008]
NAME => q[Variable::Magic]
PL_FILES => { }
PREREQ_PM => { Carp=>q[0], Exporter=>q[0], XSLoader=>q[0], base=>q[0] }
TEST_REQUIRES => { }
VERSION_FROM => q[lib/Variable/Magic.pm]
clean => { FILES=>q[Variable-Magic-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt*] }
dist => { COMPRESS=>q[gzip -9f], PREOP=>q[pod2text -u lib/Variable/Magic.pm > $(DISTVNAME)/README], SUFFIX=>q[gz] }
Directory /opt/perl-5.24.1/lib/vendor_perl/5.24.1/amd64-freebsd not found
Defaulting INSTALLVENDORARCH to /opt/perl-5.24.1/lib/vendor_perl/5.24.1
Using PERL=/opt/perl-5.24.1/bin/perl
Generating a Unix-style Makefile
Writing Makefile for Variable::Magic
Writing MYMETA.yml and MYMETA.json
The important part is "Directory /opt/perl-5.24.1/lib/vendor_perl/5.24.1/amd64-freebsd not found"
Let's create that directory:
# mkdir -p /opt/perl-5.24.1/lib/vendor_perl/5.24.1/amd64-freebsd
And run Makefile.PL again:
# perl Makefile.PL INSTALLDIRS=vendor INSTALLVENDORLIB=/opt/perl-5.24.1/lib/vendor_perl/5.24.1
Checking if this is ActiveState Perl 5.8.8 build 822 or higher... no
Checking if this is gcc 3.4 on Windows trying to link against an import library... no
MakeMaker (v7.3)
ABSTRACT_FROM => q[lib/Variable/Magic.pm]
AUTHOR => [q[Vincent Pit <perl@profvince.com>]]
BUILD_REQUIRES => { Carp=>q[0], Config=>q[0], Exporter=>q[0], ExtUtils::MakeMaker=>q[0], IO::Handle=>q[0], IO::Select=>q[0], IPC::Open3=>q[0], POSIX=>q[0], Socket=>q[0], Test::More=>q[0], XSLoader=>q[0], base=>q[0], lib=>q[0] }
CONFIGURE_REQUIRES => { }
INSTALLDIRS => q[vendor]
INSTALLVENDORLIB => q[/opt/perl-5.24.1/lib/vendor_perl/5.24.1]
LICENSE => q[perl]
META_MERGE => { build_requires=>{ Carp=>q[0], Config=>q[0], Exporter=>q[0], ExtUtils::MakeMaker=>q[0], IO::Handle=>q[0], IO::Select=>q[0], IPC::Open3=>q[0], POSIX=>q[0], Socket=>q[0], Test::More=>q[0], XSLoader=>q[0], base=>q[0], lib=>q[0] }, configure_requires=>{ Config=>q[0], ExtUtils::MakeMaker=>q[0] }, dynamic_config=>q[1], resources=>{ bugtracker=>q[
http://rt.cpan.org/Dist/Display.html?Name=Variable-Magic], homepage=>q[
http://search.cpan.org/dist/Variable-Magic/], license=>q[
http://dev.perl.org/licenses/], repository=>q[
http://git.profvince.com/?p=perl%2Fmodules%2FVariable-Magic.git] } }
MIN_PERL_VERSION => q[5.008]
NAME => q[Variable::Magic]
PL_FILES => { }
PREREQ_PM => { Carp=>q[0], Exporter=>q[0], XSLoader=>q[0], base=>q[0] }
TEST_REQUIRES => { }
VERSION_FROM => q[lib/Variable/Magic.pm]
clean => { FILES=>q[Variable-Magic-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt*] }
dist => { COMPRESS=>q[gzip -9f], PREOP=>q[pod2text -u lib/Variable/Magic.pm > $(DISTVNAME)/README], SUFFIX=>q[gz] }
Defaulting INSTALLVENDORARCH to /opt/perl-5.24.1/lib/vendor_perl/5.24.1/amd64-freebsd
Using PERL=/opt/perl-5.24.1/bin/perl
Generating a Unix-style Makefile
Writing Makefile for Variable::Magic
Writing MYMETA.yml and MYMETA.json
This time it sets INSTALLVENDORARCH correctly.