forked from sergiotarxz/Peertube-dl
Getting the config on root dir and solving a build bug.
This commit is contained in:
parent
7214bdffef
commit
07e6945507
47
Makefile.PL
47
Makefile.PL
@ -1,4 +1,8 @@
|
||||
use ExtUtils::MakeMaker;
|
||||
use File::Basename;
|
||||
use Const::Fast;
|
||||
|
||||
const my $CONFIG_FILE => dirname(__FILE__) . '/peertube-dl-web.conf';
|
||||
|
||||
WriteMakefile(
|
||||
NAME => 'Peertube::DL',
|
||||
@ -10,12 +14,39 @@ WriteMakefile(
|
||||
DIR => [ 'src', 'javascript_interpreter_xs/' ],
|
||||
);
|
||||
|
||||
sub MY::postamble {
|
||||
'
|
||||
src: src/Makefile
|
||||
src && $(MAKE) $(PASSTHRU)
|
||||
javascript_interpreter_xs: javascript_interpreter_xs/Makefile
|
||||
cd javascript_interpreter_xs/ && $(MAKE) $(PASSTHRU)
|
||||
';
|
||||
}
|
||||
package MY {
|
||||
|
||||
sub top_targets {
|
||||
my $self = shift;
|
||||
my $return = $self->SUPER::top_targets(@_);
|
||||
$return = [ split /\n/, $return ];
|
||||
for my $i ( keys @$return ) {
|
||||
$return->[$i] .= ' install_config' if $return->[$i] =~ /^all :/;
|
||||
}
|
||||
return join "\n", @$return;
|
||||
}
|
||||
|
||||
sub const_config {
|
||||
my $self = shift;
|
||||
my $return = $self->SUPER::const_config(@_);
|
||||
|
||||
open my $fh, '<', $CONFIG_FILE or die "No config file";
|
||||
my $config = eval( join ' ', <$fh> );
|
||||
close $fh;
|
||||
|
||||
chomp $return;
|
||||
return $return . '
|
||||
THEME = ' . ( $config->{theme} // 'default' ) . "\n";
|
||||
}
|
||||
|
||||
sub postamble {
|
||||
return
|
||||
"\n"
|
||||
. "install_config :\n"
|
||||
. "\tinstall peertube-dl-web.conf bin/peertube-dl-web.conf\n"
|
||||
. "src: src/Makefile\n"
|
||||
. "\tcd src && $(MAKE) $(PASSTHRU)\n"
|
||||
. "javascript_interpreter_xs: javascript_interpreter_xs/Makefile\n"
|
||||
. "\tcd javascript_interpreter_xs/ && $(MAKE) $(PASSTHRU)\n";
|
||||
}
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ _duk_call_function(SV *, SV *, ...)
|
||||
}
|
||||
duk_size_t *lstring_len;
|
||||
duk_call(context, 1);
|
||||
char * return_value = duk_get_lstring(context, -1, lstring_len);
|
||||
const char * return_value = duk_get_lstring(context, -1, lstring_len);
|
||||
if ( (top_index = duk_get_top_index(context)) != DUK_INVALID_INDEX ) {
|
||||
duk_pop_n(context, top_index+1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user