Alien-MuPDF
view release on metacpan or search on metacpan
use alienfile;
# Do not probe for system libmupdf becasue we need to compile with shared
# library flags.
share {
requires 'Alien::gmake' => 0.14;
requires 'Alien::patch' => 0.08;
requires 'Path::Tiny' => 0;
requires 'Net::SSLeay' => 0;
requires 'IO::Socket::SSL' => 0;
plugin Download => (
url => 'https://mupdf.com/releases/',
# Do not build apps other than `mutool`.
q|VIEW_APPS=|,
q|TOOL_APPS=$(MUTOOL_EXE)|,
]
];
gather sub {
my($build) =@_;
my $prefix = $build->runtime_prop->{prefix};
$build->runtime_prop->{cflags} = "-I$prefix/include";
$build->runtime_prop->{cflags_static} = "-I$prefix/include";
$build->runtime_prop->{libs} = "-L$prefix/lib";
$build->runtime_prop->{libs_static} = "-L$prefix/lib";
};
};
lib/Alien/MuPDF.pm view on Meta::CPAN
sub mutool_path {
my ($self) = @_;
File::Spec->catfile( File::Spec->rel2abs($self->dist_dir) , 'bin', 'mutool' );
}
sub inline_auto_include {
return [ 'mupdf/fitz.h' ];
}
sub cflags {
my ($self) = @_;
my $top_include = File::Spec->catfile( File::Spec->rel2abs($self->dist_dir), qw(include) );
# We do not include $self->SUPER::cflags() because that adds too many
# header files to the path. In particular, it adds -Imupdf/fitz, which
# leads to "mupdf/fitz/math.h" being included when trying to include
# the C standard "math.h" header.
return "-I$top_include";
}
sub libs {
# third party
"-lcrypto";
}
( run in 0.561 second using v1.01-cache-2.11-cpan-94b05bcf43c )