Switched to Perl local::lib for local compilation.

Taken from upstream Slic3r, thanks @alexrj.
This commit is contained in:
bubnikv 2017-08-18 09:58:50 +02:00
parent 952ca18bf9
commit 401059066e
44 changed files with 53 additions and 1 deletions

3
.gitignore vendored
View File

@ -9,4 +9,5 @@ xs/buildtmp
MANIFEST.bak
xs/MANIFEST.bak
xs/assertlib*
.init_bundle.ini
.init_bundle.ini
local-lib

View File

@ -103,6 +103,15 @@ EOF
my @cpanm_args = ();
push @cpanm_args, "--sudo" if $sudo;
# install local::lib without --local-lib otherwise it's not usable afterwards
if (!eval "use local::lib qw(local-lib); 1") {
my $res = system $cpanm, @cpanm_args, 'local::lib';
warn "Warning: local::lib is required. You might need to run the `cpanm --sudo local::lib` command in order to install it.\n"
if $res != 0;
}
push @cpanm_args, ('--local-lib', 'local-lib');
# make sure our cpanm is updated (old ones don't support the ~ syntax)
system $cpanm, @cpanm_args, 'App::cpanminus';

View File

@ -6,6 +6,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/lib";
use local::lib '--no-create', "$FindBin::Bin/local-lib";
}
use File::Basename qw(basename);

View File

@ -7,6 +7,7 @@ plan tests => 34;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Slic3r;

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first sum);

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first sum);

View File

@ -7,6 +7,7 @@ plan tests => 6;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Slic3r;

View File

@ -7,6 +7,7 @@ plan tests => 6;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(sum);

View File

@ -7,6 +7,7 @@ plan tests => 11;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Slic3r;

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first);

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Slic3r;

View File

@ -7,6 +7,7 @@ plan tests => 15;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(none all);

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first);

View File

@ -8,6 +8,7 @@ plan tests => 20;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first);

View File

@ -9,6 +9,7 @@ plan tests => 19;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first sum);

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first sum);

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first);

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first);

View File

@ -7,6 +7,7 @@ plan tests => 42;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Slic3r;

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first);

View File

@ -8,6 +8,7 @@ plan tests => 4;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Slic3r;

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first);

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Slic3r::ExtrusionLoop ':roles';

View File

@ -7,6 +7,7 @@ plan tests => 18;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Slic3r;

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first);

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(any);

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first sum);

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first);

View File

@ -8,6 +8,7 @@ plan tests => 16;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
# temporarily disable compilation errors due to constant not being exported anymore

View File

@ -8,6 +8,7 @@ plan tests => 27;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first);

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Slic3r;

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Slic3r;

View File

@ -5,6 +5,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use List::Util qw(first);

View File

@ -7,6 +7,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use File::Basename qw(basename);

View File

@ -9,6 +9,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Getopt::Long qw(:config no_auto_abbrev);

View File

@ -8,6 +8,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Slic3r;

View File

@ -7,6 +7,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Getopt::Long qw(:config no_auto_abbrev);

View File

@ -7,6 +7,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Getopt::Long qw(:config no_auto_abbrev);

View File

@ -6,6 +6,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Slic3r;

View File

@ -7,6 +7,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use File::Basename qw(basename);

View File

@ -7,6 +7,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use File::Basename qw(basename);

View File

@ -7,6 +7,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Getopt::Long qw(:config no_auto_abbrev);

View File

@ -7,6 +7,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Getopt::Long qw(:config no_auto_abbrev);

View File

@ -8,6 +8,7 @@ use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
use local::lib "$FindBin::Bin/../local-lib";
}
use Getopt::Long qw(:config no_auto_abbrev);