Files
haikuports/app-text/mupdf/mupdf-1.10~a.recipe
fbrosson 154312f651 mupdf: add recipe for version 1.10~a. (#1121)
* Mark 1.10~a as broken since there are still a few issues:
    - libmupdf.so is not being built.
    - libmupdfthird.a is being built but is empty.
    - unlike 1.8, 1.10~a cannot be built on x88_gcc2 primary
      arch because a dependency on harfbuzz was added. That
      said, it might be possible to remove that dependency.
* Updated patches from 1.8 to 1.10~a.
* Added patches to fix includes for hb.h and hb-ft.h and to
  skip unneeded workaround in source/fitz/load-jpx.c
* Merged/replaced old patch with one from @korli.
* Add dependency on libharfbuzz and libglib_2.0 too, as it is
  required by harfbuzz.
2017-02-11 20:08:30 +00:00

118 lines
3.3 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="http://www.mupdf.com/"
COPYRIGHT="2006-2016 Artifex Software, Inc"
LICENSE="AGPL-3.0"
REVISION="1"
SOURCE_URI="http://mupdf.com/downloads/archive/mupdf-${portVersion/\~/}-source.tar.gz"
CHECKSUM_SHA256="aacc1f36b9180f562022ef1ab3439b009369d944364f3cff8a2a898834e3a836"
SOURCE_DIR="mupdf-${portVersion/\~/}-source"
PATCHES="
mupdf-$portVersion.patchset
mupdf-$portVersion-openjpeg21.patchset
mupdf-$portVersion-harfbuzz.patchset
"
ARCHITECTURES="!x86_gcc2 !x86 !x86_64"
SECONDARY_ARCHITECTURES="!x86"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
mupdf$secondaryArchSuffix = $portVersion compat >= 1.1
lib:libmupdf$secondaryArchSuffix
cmd:mudraw$commandSuffix
cmd:mujstest$commandSuffix
cmd:muraster$commandSuffix
cmd:mutool$commandSuffix
"
REQUIRES="
haiku$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
devel:libmupdfthird$secondaryArchSuffix
"
REQUIRES_devel="
mupdf$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
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="
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 \
libmupdfthird
fixPkgconfig
# devel package
packageEntries devel \
$developDir
}