Skip to content

Commit

Permalink
Fix installation via panda
Browse files Browse the repository at this point in the history
  • Loading branch information
niner committed Feb 16, 2015
1 parent df208e7 commit 327148b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Build.pm
Expand Up @@ -5,12 +5,29 @@ use Shell::Command;
use LibraryMake;

class Build is Panda::Builder {
sub get_config_var(Str $name) {
return chomp(qqx/python -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('$name'));"/);
}

method build($dir) {
my Str $blib = "$dir/blib";
rm_f("$dir/lib/Inline/pyhelper.so");
rm_rf($blib);
mkpath("$blib/lib/Inline");
make($dir, "$blib/lib");

my %vars = get-vars("$blib/lib");
%vars<INCLUDEPY> = get_config_var('INCLUDEPY');
my $library = get_config_var('LIBRARY');
$library ~~ s/\.a$//;
$library ~~ s/^lib//;
%vars<LIBRARYPY> = $library;
%vars<LIBPLPY> = get_config_var('LIBPL');
process-makefile($dir, %vars);

my $goback = $*CWD;
chdir($dir);
shell(%vars<MAKE>);
chdir($goback);
}
}

Expand Down

0 comments on commit 327148b

Please sign in to comment.