kumquat-buildroot/package/python-pymupdf/python-pymupdf.mk
Raphaël Mélotte 833e7db4f6 package/python-pymupdf: bump to version 1.18.14
Recent tarballs from PyPI use setuptools instead of distutils, so
change `PYTHON_PYMUPDF_SETUP_TYPE`.

They also include a license file, so include it and a hash for it.

This version also has a new dependency: freetype2.

PYTHON_PYMUPDF_REMOVE_PATHS is updated to take the new dependency into
account, but also the sed command are changed to delete include lines
instead of turning them into empty strings. Indeed, empty include
strings lead to using multiple `-I` flags which were not followed by
anything. Depending on the number of empty include strings (because
two successive `-I` "cancel" each other out), it would have failed to
compile.

Also, it turns out the patch version of python-pymupdf doesn't have to
match mupdf's version (e.g. python-pymupdf 1.18.14 is compatible with
mupdf 1.18.*) so while at it, remove the word "exactly" from the
comment.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2021-07-20 23:38:07 +02:00

30 lines
1.2 KiB
Makefile

################################################################################
#
# python-pymupdf
#
################################################################################
# python-pymupdf's version must match mupdf's version
PYTHON_PYMUPDF_VERSION = 1.18.14
PYTHON_PYMUPDF_SOURCE = PyMuPDF-$(PYTHON_PYMUPDF_VERSION).tar.gz
PYTHON_PYMUPDF_SITE = https://files.pythonhosted.org/packages/41/f6/dbefe3d6949fa81fb7bcac9141e4345330d272724718ac5a6af78297498b
PYTHON_PYMUPDF_SETUP_TYPE = setuptools
PYTHON_PYMUPDF_LICENSE = GPL-3.0, AGPL-3.0+ (code generated from mupdf)
PYTHON_PYMUPDF_LICENSE_FILES = COPYING
# No license file included in pip, but it's present on github
PYTHON_PYMUPDF_DEPENDENCIES = freetype mupdf zlib
PYTHON_PYMUPDF_ENV = CFLAGS="-I$(STAGING_DIR)/usr/include/mupdf -I$(STAGING_DIR)/usr/include/freetype2"
# We need to remove the original paths as we provide them in the CFLAGS:
define PYTHON_PYMUPDF_REMOVE_PATHS
sed -i "/\/usr\/include\/mupdf/d" $(@D)/setup.py
sed -i "/\/usr\/include\/freetype2/d" $(@D)/setup.py
sed -i "/\/usr\/local\/include\/mupdf/d" $(@D)/setup.py
sed -i "/mupdf\/thirdparty\/freetype\/include/d" $(@D)/setup.py
endef
PYTHON_PYMUPDF_POST_PATCH_HOOKS = PYTHON_PYMUPDF_REMOVE_PATHS
$(eval $(python-package))