From 05a24717d53ea7e1781b83058fdb4d8343388faf Mon Sep 17 00:00:00 2001 From: Ivan Holmes Date: Thu, 5 May 2022 06:40:27 +0100 Subject: [PATCH] Add recipe for MuPDF 1.19.1 (#6823) * Add recipe for MuPDF 1.19.1 --- app-text/mupdf/mupdf-1.19.1.recipe | 128 +++++++++++++++++++ app-text/mupdf/patches/mupdf-1.19.1.patchset | 57 +++++++++ 2 files changed, 185 insertions(+) create mode 100644 app-text/mupdf/mupdf-1.19.1.recipe create mode 100644 app-text/mupdf/patches/mupdf-1.19.1.patchset diff --git a/app-text/mupdf/mupdf-1.19.1.recipe b/app-text/mupdf/mupdf-1.19.1.recipe new file mode 100644 index 000000000..770047b47 --- /dev/null +++ b/app-text/mupdf/mupdf-1.19.1.recipe @@ -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 +} diff --git a/app-text/mupdf/patches/mupdf-1.19.1.patchset b/app-text/mupdf/patches/mupdf-1.19.1.patchset new file mode 100644 index 000000000..16a0b584d --- /dev/null +++ b/app-text/mupdf/patches/mupdf-1.19.1.patchset @@ -0,0 +1,57 @@ +From 81cdd3449213f9265de81b1f18b3e414683d5968 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +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