Files
haikuports/app-text/mupdf/mupdf-1.19.1.recipe
Ivan Holmes 05a24717d5 Add recipe for MuPDF 1.19.1 (#6823)
* Add recipe for MuPDF 1.19.1
2022-05-05 07:40:27 +02:00

129 lines
3.6 KiB
Bash

SUMMARY="A lightweight XPS and PDF rendering library"
DESCRIPTION="The renderer in MuPDF is tailored for high quality anti-aliased \
graphics. It renders text with metrics and spacing accurate to within \
fractions of a pixel for the highest fidelity in reproducing the look of a \
printed page on screen.
MuPDF is also small, fast, and yet complete. It supports PDF 1.7 with \
transparency, encryption, hyperlinks, annotations, searching and more. It also \
reads XPS/OpenXPS documents and CBZ (Comic Book archive) files."
HOMEPAGE="https://www.mupdf.com/"
COPYRIGHT="2006-2022 Artifex Software, Inc"
LICENSE="AGPL-3.0"
REVISION="1"
SOURCE_URI="https://mupdf.com/downloads/archive/mupdf-$portVersion-source.tar.xz"
CHECKSUM_SHA256="b5eac663fe74f33c430eda342f655cf41fa73d71610f0884768a856a82e3803e"
SOURCE_DIR="mupdf-$portVersion-source"
PATCHES="mupdf-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
portVersionCompat="$portVersion compat >= ${portVersion%.**}"
PROVIDES="
mupdf$secondaryArchSuffix = $portVersion
lib:libmupdf$secondaryArchSuffix = $portVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libglib_2.0$secondaryArchSuffix
lib:libharfbuzz$secondaryArchSuffix
lib:libjbig2dec$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:libopenjp2$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
mupdf${secondaryArchSuffix}_devel = $portVersion
devel:libmupdf$secondaryArchSuffix = $portVersionCompat
"
REQUIRES_devel="
mupdf$secondaryArchSuffix == $portVersion base
"
SUMMARY_tools="Tools to convert, examine and rasterise PDF files"
PROVIDES_tools="
mupdf${secondaryArchSuffix}_tools = $portVersion
cmd:muraster$commandSuffix
cmd:mutool$commandSuffix
"
REQUIRES_tools="
haiku$secondaryArchSuffix
mupdf$secondaryArchSuffix == $portVersion base
lib:libcrypto$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libharfbuzz$secondaryArchSuffix
lib:libjbig2dec$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:libopenjp2$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libcrypto$secondaryArchSuffix
devel:libcurl$secondaryArchSuffix
devel:libfreetype$secondaryArchSuffix
devel:libglib_2.0$secondaryArchSuffix
devel:libharfbuzz$secondaryArchSuffix
devel:libjbig2dec$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
devel:libopenjp2$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:find
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
defineDebugInfoPackage mupdf$secondaryArchSuffix \
"$libDir"/libmupdf.so \
"$(getPackagePrefix tools)"/bin/mutool \
"$(getPackagePrefix tools)"/bin/muraster
BUILD()
{
# remove bundled and use system libaries where possible
rm -rf thirdparty/{curl,freetype,harfbuzz,jbig2dec,libjpeg,openjpeg,zlib}
# build shared library
make USE_SYSTEM_LIBS=yes USE_SYSTEM_GUMBO=no \
XCFLAGS=-fPIC shared=yes build=release $jobArgs
}
INSTALL()
{
make USE_SYSTEM_LIBS=yes USE_SYSTEM_GUMBO=no \
shared=yes build=release install \
prefix=$prefix \
bindir=$commandBinDir \
docdir=$docDir \
libdir=$libDir \
incdir=$includeDir \
mandir=$manDir
prepareInstalledDevelLib libmupdf
fixPkgconfig
# devel package
packageEntries devel $developDir
# tools package
packageEntries tools $commandBinDir \
$manDir
}