0
0
Fork 0
haikuports/app-text/mupdf/mupdf-1.8.recipe

98 lines
2.9 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-2015 Artifex Software, Inc"
LICENSE="AGPL-3.0"
REVISION="5"
SOURCE_URI="https://www.mupdf.com/downloads/archive/mupdf-$portVersion-source.tar.gz"
CHECKSUM_SHA256="a2a3c64d8b24920f87cf4ea9339a25abf7388496440f13b37482d1403c33c206"
SOURCE_DIR="mupdf-$portVersion-source"
PATCHES="mupdf-1.8.patchset"
ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
mupdf$secondaryArchSuffix = $portVersion compat >= 1.1
cmd:mudraw$secondaryArchSuffix
cmd:mujstest$secondaryArchSuffix
cmd:mutool$secondaryArchSuffix
lib:libmupdf$secondaryArchSuffix = $portVersion compat >= 1.1
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libjbig2dec$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:libopenjp2$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
mupdf${secondaryArchSuffix}_devel = $portVersion
devel:libmupdf$secondaryArchSuffix = $portVersion compat >= 1
"
REQUIRES_devel="
mupdf$secondaryArchSuffix == $portVersion
"
BUILD_REQUIRES="
devel:libfreetype$secondaryArchSuffix
devel:libjbig2dec$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
devel:libopenjp2$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel
cmd:find
cmd:freetype_config$secondaryArchSuffix
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
# don't use builtin libs
rm -rf thirdparty
# static lib
my_soname=libmupdf.so.$portVersion
my_soname_js_none=libmupdf-js-none.so.$portVersion
sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \
-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \
-e "/^MUPDF_LIB :=/s:=.*:= \$(OUT)/${my_soname}:" \
-e "\$a\$(MUPDF_JS_NONE_LIB):" \
-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \
-e "/install/s: COPYING : :" \
-i Makefile || die
make XCFLAGS=-fpic build=release $jobArgs
}
INSTALL()
{
make build=release install \
prefix=$prefix \
bindir=$binDir \
docdir=$docDir \
libdir=$libDir \
incdir=$includeDir \
mandir=$manDir
ln -s libmupdf.so.$portVersion $libDir/libmupdf.so
prepareInstalledDevelLibs libmupdf
# devel package
packageEntries devel \
$developDir
}