kumquat-buildroot/package/mupdf/mupdf.mk
Fabrice Fontaine cf8900b063 package/mupdf: disable objcopy
Drop fourth patch and disable objcopy as suggested by upstream in
https://bugs.ghostscript.com/show_bug.cgi?id=704442#c2

This will also fix the following build failure on sparc and xtensa:

    OBJCOPY build/release/resources/fonts/urw/Dingbats.cff.o
/home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc64-buildroot-linux-gnu/9.3.0/../../../../sparc64-buildroot-linux-gnu/bin/ld: --relax and -r may not be used together

While at it, drop MUPDF_DISABLE_OPENGL and use the new MUPDF_MAKE_OPTS
variable

Fixes:
 - http://autobuild.buildroot.org/results/e64d456174a0f701c0e0de68317debcdc429a660
 - http://autobuild.buildroot.net/results/0945f305d31530677282f38fa7c99af5295d47bd

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-11-16 21:29:54 +01:00

80 lines
2.0 KiB
Makefile

################################################################################
#
# mudpf
#
################################################################################
# python-pymupdf's version must match mupdf's version
MUPDF_VERSION = 1.18.0
MUPDF_SOURCE = mupdf-$(MUPDF_VERSION)-source.tar.xz
MUPDF_SITE = https://mupdf.com/downloads/archive
MUPDF_LICENSE = AGPL-3.0+
MUPDF_LICENSE_FILES = COPYING
MUPDF_CPE_ID_VENDOR = artifex
MUPDF_INSTALL_STAGING = YES
MUPDF_DEPENDENCIES = \
freetype \
gumbo-parser \
harfbuzz \
host-pkgconf \
jbig2dec jpeg \
lcms2 openjpeg \
xlib_libX11 \
zlib
# 0002-Bug-703366-Fix-double-free-of-object-during-linearization.patch
MUPDF_IGNORE_CVES += CVE-2021-3407
# 0003-Bug-703791-Stay-within-hash-table-max-key-size-in-cached-color-converter.patch
MUPDF_IGNORE_CVES += CVE-2021-37220
# The pkg-config name for gumbo-parser is `gumbo`.
MUPDF_PKG_CONFIG_PACKAGES = \
freetype2 \
gumbo \
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
MUPDF_MAKE_OPTS = \
HAVE_OBJCOPY=no \
prefix="/usr"
ifeq ($(BR2_PACKAGE_LIBFREEGLUT),y)
MUPDF_DEPENDENCIES += libfreeglut
else
MUPDF_MAKE_OPTS += HAVE_GLUT=no
endif
define MUPDF_BUILD_CMDS
$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) $(MUPDF_MAKE_OPTS) all
endef
define MUPDF_INSTALL_STAGING_CMDS
$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) $(MUPDF_MAKE_OPTS) \
DESTDIR="$(STAGING_DIR)" install_libs
endef
define MUPDF_INSTALL_TARGET_CMDS
$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) $(MUPDF_MAKE_OPTS) \
DESTDIR="$(TARGET_DIR)" install
endef
$(eval $(generic-package))