2020-02-07 10:37:04 +01:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# mudpf
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2021-07-01 01:47:15 +02:00
|
|
|
# python-pymupdf's version must match mupdf's version
|
|
|
|
MUPDF_VERSION = 1.18.0
|
|
|
|
MUPDF_SOURCE = mupdf-$(MUPDF_VERSION)-source.tar.xz
|
2020-02-07 10:37:04 +01:00
|
|
|
MUPDF_SITE = https://mupdf.com/downloads/archive
|
|
|
|
MUPDF_LICENSE = AGPL-3.0+
|
|
|
|
MUPDF_LICENSE_FILES = COPYING
|
2021-06-12 17:20:03 +02:00
|
|
|
MUPDF_CPE_ID_VENDOR = artifex
|
2020-02-07 10:37:04 +01:00
|
|
|
MUPDF_INSTALL_STAGING = YES
|
|
|
|
MUPDF_DEPENDENCIES = \
|
|
|
|
freetype \
|
2021-07-01 01:47:15 +02:00
|
|
|
gumbo-parser \
|
2020-02-07 10:37:04 +01:00
|
|
|
harfbuzz \
|
|
|
|
host-pkgconf \
|
|
|
|
jbig2dec jpeg \
|
|
|
|
lcms2 openjpeg \
|
|
|
|
xlib_libX11 \
|
|
|
|
zlib
|
|
|
|
|
2021-08-05 11:22:25 +02:00
|
|
|
# 0002-Bug-703366-Fix-double-free-of-object-during-linearization.patch
|
2021-07-22 07:31:17 +02:00
|
|
|
MUPDF_IGNORE_CVES += CVE-2021-3407
|
|
|
|
|
2021-08-05 11:22:26 +02:00
|
|
|
# 0003-Bug-703791-Stay-within-hash-table-max-key-size-in-cached-color-converter.patch
|
|
|
|
MUPDF_IGNORE_CVES += CVE-2021-37220
|
|
|
|
|
2021-07-01 01:47:15 +02:00
|
|
|
# The pkg-config name for gumbo-parser is `gumbo`.
|
2020-02-07 10:37:04 +01:00
|
|
|
MUPDF_PKG_CONFIG_PACKAGES = \
|
|
|
|
freetype2 \
|
2021-07-01 01:47:15 +02:00
|
|
|
gumbo \
|
2020-02-07 10:37:04 +01:00
|
|
|
harfbuzz \
|
|
|
|
libjpeg \
|
|
|
|
zlib
|
|
|
|
|
|
|
|
MUPDF_CFLAGS = \
|
|
|
|
$(TARGET_CFLAGS) \
|
|
|
|
`$(PKG_CONFIG_HOST_BINARY) --cflags $(MUPDF_PKG_CONFIG_PACKAGES)` \
|
|
|
|
-fPIC # -fPIC is needed because the Makefile doesn't append it.
|
|
|
|
|
|
|
|
MUPDF_LDFLAGS = \
|
|
|
|
$(TARGET_LDFLAGS) \
|
|
|
|
`$(PKG_CONFIG_HOST_BINARY) --libs $(MUPDF_PKG_CONFIG_PACKAGES)`
|
|
|
|
|
|
|
|
# mupdf doesn't use CFLAGS and LIBS but XCFLAGS and XLIBS instead.
|
|
|
|
# with USE_SYSTEM_LIBS it will try to use system libraries instead of the bundled ones.
|
|
|
|
MUPDF_MAKE_ENV = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
|
|
|
|
XCFLAGS="$(MUPDF_CFLAGS)" \
|
|
|
|
XLIBS="$(MUPDF_LDFLAGS)" \
|
|
|
|
USE_SYSTEM_LIBS=yes
|
|
|
|
|
2021-11-15 18:33:44 +01:00
|
|
|
MUPDF_MAKE_OPTS = \
|
|
|
|
HAVE_OBJCOPY=no \
|
|
|
|
prefix="/usr"
|
|
|
|
|
2021-07-01 01:47:15 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBFREEGLUT),y)
|
|
|
|
MUPDF_DEPENDENCIES += libfreeglut
|
|
|
|
else
|
2021-11-15 18:33:44 +01:00
|
|
|
MUPDF_MAKE_OPTS += HAVE_GLUT=no
|
2021-07-01 01:47:15 +02:00
|
|
|
endif
|
2020-02-07 10:37:04 +01:00
|
|
|
|
|
|
|
define MUPDF_BUILD_CMDS
|
2021-11-15 18:33:44 +01:00
|
|
|
$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) $(MUPDF_MAKE_OPTS) all
|
2020-02-07 10:37:04 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
define MUPDF_INSTALL_STAGING_CMDS
|
2021-11-15 18:33:44 +01:00
|
|
|
$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) $(MUPDF_MAKE_OPTS) \
|
|
|
|
DESTDIR="$(STAGING_DIR)" install_libs
|
2020-02-07 10:37:04 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
define MUPDF_INSTALL_TARGET_CMDS
|
2021-11-15 18:33:44 +01:00
|
|
|
$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) $(MUPDF_MAKE_OPTS) \
|
|
|
|
DESTDIR="$(TARGET_DIR)" install
|
2020-02-07 10:37:04 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(generic-package))
|