Add recipe for MuPDF 1.19.1 (#6823)

* Add recipe for MuPDF 1.19.1
This commit is contained in:
Ivan Holmes
2022-05-05 06:40:27 +01:00
committed by GitHub
parent a6cb3b229d
commit 05a24717d5
2 changed files with 185 additions and 0 deletions

View File

@@ -0,0 +1,128 @@
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
}

View File

@@ -0,0 +1,57 @@
From 81cdd3449213f9265de81b1f18b3e414683d5968 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Thu, 14 Apr 2022 14:06:41 +0100
Subject: Add Haiku support to Makerules
diff --git a/Makerules b/Makerules
index 0fdaecb..7a4d6d2 100644
--- a/Makerules
+++ b/Makerules
@@ -155,6 +155,44 @@ else ifeq ($(OS),MACOS)
endif
endif
+else ifeq ($(OS),Haiku)
+ HAVE_OBJCOPY := yes
+
+ ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
+ SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
+ SYS_FREETYPE_LIBS := $(shell pkg-config --libs freetype2)
+ endif
+ ifeq ($(shell pkg-config --exists harfbuzz && echo yes),yes)
+ SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz)
+ SYS_HARFBUZZ_LIBS := $(shell pkg-config --libs harfbuzz)
+ endif
+ ifeq ($(shell pkg-config --exists libjpeg && echo yes),yes)
+ SYS_LIBJPEG_CFLAGS := $(shell pkg-config --cflags libjpeg)
+ SYS_LIBJPEG_LIBS := $(shell pkg-config --libs libjpeg)
+ endif
+ ifeq ($(shell pkg-config --exists libopenjp2 && echo yes),yes)
+ SYS_OPENJPEG_CFLAGS := $(shell pkg-config --cflags libopenjp2)
+ SYS_OPENJPEG_LIBS := $(shell pkg-config --libs libopenjp2)
+ endif
+ ifeq ($(shell pkg-config --exists zlib && echo yes),yes)
+ SYS_ZLIB_CFLAGS := $(shell pkg-config --cflags zlib)
+ SYS_ZLIB_LIBS := $(shell pkg-config --libs zlib)
+ endif
+
+ HAVE_SYS_CURL := $(shell pkg-config --exists libcurl && echo yes)
+ ifeq ($(HAVE_SYS_CURL),yes)
+ SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
+ SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
+ endif
+
+ HAVE_LIBCRYPTO := $(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)
+ ifeq ($(HAVE_LIBCRYPTO),yes)
+ LIBCRYPTO_CFLAGS := $(shell pkg-config --cflags libcrypto) -DHAVE_LIBCRYPTO
+ LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
+ endif
+
+ HAVE_PTHREAD := yes
+
else ifeq ($(OS),Linux)
HAVE_OBJCOPY := yes
--
2.30.2