All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] Add python-pymupdf
@ 2020-02-07  9:37 Raphaël Mélotte
  2020-02-07  9:37 ` [Buildroot] [PATCH 1/2] package/mupdf: new package Raphaël Mélotte
  2020-02-07  9:37 ` [Buildroot] [PATCH 2/2] package/python-pymupdf: " Raphaël Mélotte
  0 siblings, 2 replies; 6+ messages in thread
From: Raphaël Mélotte @ 2020-02-07  9:37 UTC (permalink / raw)
  To: buildroot

Needs http://patchwork.ozlabs.org/patch/1161981/

Rapha?l M?lotte (2):
  package/mupdf: new package.
  package/python-pymupdf: new package.

 DEVELOPERS                                    |  2 +
 package/Config.in                             |  2 +
 ...-Makefile-add-an-install_libs-target.patch | 41 ++++++++++++
 package/mupdf/Config.in                       | 15 +++++
 package/mupdf/mupdf.hash                      |  8 +++
 package/mupdf/mupdf.mk                        | 62 +++++++++++++++++++
 package/python-pymupdf/Config.in              | 12 ++++
 package/python-pymupdf/python-pymupdf.hash    |  3 +
 package/python-pymupdf/python-pymupdf.mk      | 25 ++++++++
 9 files changed, 170 insertions(+)
 create mode 100644 package/mupdf/0001-Makefile-add-an-install_libs-target.patch
 create mode 100644 package/mupdf/Config.in
 create mode 100644 package/mupdf/mupdf.hash
 create mode 100644 package/mupdf/mupdf.mk
 create mode 100644 package/python-pymupdf/Config.in
 create mode 100644 package/python-pymupdf/python-pymupdf.hash
 create mode 100644 package/python-pymupdf/python-pymupdf.mk

-- 
2.23.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/2] package/mupdf: new package.
  2020-02-07  9:37 [Buildroot] [PATCH 0/2] Add python-pymupdf Raphaël Mélotte
@ 2020-02-07  9:37 ` Raphaël Mélotte
  2021-05-26 20:05   ` Arnout Vandecappelle
  2020-02-07  9:37 ` [Buildroot] [PATCH 2/2] package/python-pymupdf: " Raphaël Mélotte
  1 sibling, 1 reply; 6+ messages in thread
From: Raphaël Mélotte @ 2020-02-07  9:37 UTC (permalink / raw)
  To: buildroot

MuPDF is a lightweight PDF, XPS, and E-book viewer.

Note: some packages, like PyMuPDF, depend on mupdf's libraries, hence
the patch.

Signed-off-by: Rapha?l M?lotte <raphael.melotte@mind.be>
Signed-off-by: Rapha?l M?lotte <raphael.melotte@essensium.com>
---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 ...-Makefile-add-an-install_libs-target.patch | 41 ++++++++++++
 package/mupdf/Config.in                       | 15 +++++
 package/mupdf/mupdf.hash                      |  8 +++
 package/mupdf/mupdf.mk                        | 62 +++++++++++++++++++
 6 files changed, 128 insertions(+)
 create mode 100644 package/mupdf/0001-Makefile-add-an-install_libs-target.patch
 create mode 100644 package/mupdf/Config.in
 create mode 100644 package/mupdf/mupdf.hash
 create mode 100644 package/mupdf/mupdf.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 5f1e37a063..9c527c3625 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1930,6 +1930,7 @@ F:	package/paho-mqtt-cpp/
 
 N:	Rapha?l M?lotte <raphael.melotte@essensium.com>
 F:	package/jbig2dec/
+F:	package/mupdf/
 
 N:	R?mi R?rolle <remi.rerolle@gmail.com>
 F:	package/libfreeimage/
diff --git a/package/Config.in b/package/Config.in
index b2f315ae69..df29673221 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -351,6 +351,7 @@ comment "X applications"
 	source "package/gtkperf/Config.in"
 	source "package/leafpad/Config.in"
 	source "package/midori/Config.in"
+	source "package/mupdf/Config.in"
 	source "package/nodm/Config.in"
 	source "package/pcmanfm/Config.in"
 	source "package/qt-webkit-kiosk/Config.in"
diff --git a/package/mupdf/0001-Makefile-add-an-install_libs-target.patch b/package/mupdf/0001-Makefile-add-an-install_libs-target.patch
new file mode 100644
index 0000000000..9cb5a2fec9
--- /dev/null
+++ b/package/mupdf/0001-Makefile-add-an-install_libs-target.patch
@@ -0,0 +1,41 @@
+From 0989f13ecbc2155b05da0cb091801d32d750d2d4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?=
+ <raphael.melotte@essensium.com>
+Date: Thu, 29 Aug 2019 09:51:02 +0200
+Subject: [PATCH] Makefile: add an install_libs target.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This allows to install only the library files (if you need pymupdf but
+not mupdf binaries for example).
+
+Signed-off-by: Rapha?l M?lotte <raphael.melotte@essensium.com>
+---
+ Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index c5bc541ac..e14f88526 100644
+--- a/Makefile
++++ b/Makefile
+@@ -322,7 +322,7 @@ libs: $(INSTALL_LIBS)
+ tools: $(TOOL_APPS)
+ apps: $(TOOL_APPS) $(VIEW_APPS)
+ 
+-install: libs apps
++install_libs:
+ 	install -d $(DESTDIR)$(incdir)/mupdf
+ 	install -d $(DESTDIR)$(incdir)/mupdf/fitz
+ 	install -d $(DESTDIR)$(incdir)/mupdf/pdf
+@@ -333,6 +333,7 @@ install: libs apps
+ 	install -d $(DESTDIR)$(libdir)
+ 	install -m 644 $(INSTALL_LIBS) $(DESTDIR)$(libdir)
+ 
++install: libs apps install_libs
+ 	install -d $(DESTDIR)$(bindir)
+ 	install -m 755 $(TOOL_APPS) $(VIEW_APPS) $(DESTDIR)$(bindir)
+ 
+-- 
+2.21.0
+
diff --git a/package/mupdf/Config.in b/package/mupdf/Config.in
new file mode 100644
index 0000000000..d66cd0edd4
--- /dev/null
+++ b/package/mupdf/Config.in
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_MUPDF
+	bool "mupdf"
+	depends on BR2_PACKAGE_XORG7
+	select BR2_PACKAGE_FREETYPE
+	select BR2_PACKAGE_HARFBUZZ
+	select BR2_PACKAGE_JBIG2DEC
+	select BR2_PACKAGE_JPEG
+	select BR2_PACKAGE_LCMS2
+	select BR2_PACKAGE_OPENJPEG
+	select BR2_PACKAGE_XLIB_LIBX11
+	select BR2_PACKAGE_ZLIB
+	help
+	  MuPDF is a lightweight PDF, XPS, and E-book viewer.
+
+	  https://www.mupdf.com/index.html
diff --git a/package/mupdf/mupdf.hash b/package/mupdf/mupdf.hash
new file mode 100644
index 0000000000..27ae860cdd
--- /dev/null
+++ b/package/mupdf/mupdf.hash
@@ -0,0 +1,8 @@
+# From https://mupdf.com/downloads/index.html:
+sha1 18f069b7cc125e53f541163ac305c588c94dea97 mupdf-1.14.0-source.tar.gz
+
+# Locally computed:
+sha256 64d537895641b711737cc58fe762481b07ea71d1506e8bd8a13434e093b0068d  mupdf-1.16.0-source.tar.gz
+
+# Hash for license files:
+sha256 57c8ff33c9c0cfc3ef00e650a1cc910d7ee479a8bc509f6c9209a7c2a11399d6  COPYING
diff --git a/package/mupdf/mupdf.mk b/package/mupdf/mupdf.mk
new file mode 100644
index 0000000000..27cc9e5ed9
--- /dev/null
+++ b/package/mupdf/mupdf.mk
@@ -0,0 +1,62 @@
+################################################################################
+#
+# mudpf
+#
+################################################################################
+
+MUPDF_VERSION = 1.16.0
+MUPDF_SOURCE = mupdf-$(MUPDF_VERSION)-source.tar.gz
+MUPDF_SITE = https://mupdf.com/downloads/archive
+MUPDF_LICENSE = AGPL-3.0+
+MUPDF_LICENSE_FILES = COPYING
+MUPDF_INSTALL_STAGING = YES
+MUPDF_DEPENDENCIES = \
+	freetype \
+	harfbuzz \
+	host-pkgconf \
+	jbig2dec jpeg \
+	lcms2 openjpeg \
+	xlib_libX11 \
+	zlib
+
+MUPDF_PKG_CONFIG_PACKAGES = \
+	freetype2 \
+	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
+
+# Modern versions of mupdf depend on OpenGL,
+# we disable it because it may not be available:
+define MUPDF_DISABLE_OPENGL
+	sed -i 's/HAVE_GLUT := yes/HAVE_GLUT := no/g' $(@D)/Makerules
+endef
+
+MUPDF_POST_EXTRACT_HOOKS = MUPDF_DISABLE_OPENGL
+
+define MUPDF_BUILD_CMDS
+	$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) all
+endef
+
+define MUPDF_INSTALL_STAGING_CMDS
+	$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR="$(STAGING_DIR)" prefix="/usr" install_libs
+endef
+
+define MUPDF_INSTALL_TARGET_CMDS
+	$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR="$(TARGET_DIR)" prefix="/usr" install
+endef
+
+$(eval $(generic-package))
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] package/python-pymupdf: new package.
  2020-02-07  9:37 [Buildroot] [PATCH 0/2] Add python-pymupdf Raphaël Mélotte
  2020-02-07  9:37 ` [Buildroot] [PATCH 1/2] package/mupdf: new package Raphaël Mélotte
@ 2020-02-07  9:37 ` Raphaël Mélotte
  2021-05-26 20:10   ` Arnout Vandecappelle
  1 sibling, 1 reply; 6+ messages in thread
From: Raphaël Mélotte @ 2020-02-07  9:37 UTC (permalink / raw)
  To: buildroot

Python bindings for the PDF rendering library MuPDF.

Signed-off-by: Rapha?l M?lotte <raphael.melotte@mind.be>
Signed-off-by: Rapha?l M?lotte <raphael.melotte@essensium.com>
---
 DEVELOPERS                                 |  1 +
 package/Config.in                          |  1 +
 package/python-pymupdf/Config.in           | 12 +++++++++++
 package/python-pymupdf/python-pymupdf.hash |  3 +++
 package/python-pymupdf/python-pymupdf.mk   | 25 ++++++++++++++++++++++
 5 files changed, 42 insertions(+)
 create mode 100644 package/python-pymupdf/Config.in
 create mode 100644 package/python-pymupdf/python-pymupdf.hash
 create mode 100644 package/python-pymupdf/python-pymupdf.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 9c527c3625..0c67165f4a 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1931,6 +1931,7 @@ F:	package/paho-mqtt-cpp/
 N:	Rapha?l M?lotte <raphael.melotte@essensium.com>
 F:	package/jbig2dec/
 F:	package/mupdf/
+F:  package/python-pymupdf/
 
 N:	R?mi R?rolle <remi.rerolle@gmail.com>
 F:	package/libfreeimage/
diff --git a/package/Config.in b/package/Config.in
index df29673221..ffe1013e82 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1013,6 +1013,7 @@ menu "External python modules"
 	source "package/python-pylibftdi/Config.in"
 	source "package/python-pylru/Config.in"
 	source "package/python-pymodbus/Config.in"
+	source "package/python-pymupdf/Config.in"
 	source "package/python-pymysql/Config.in"
 	source "package/python-pynacl/Config.in"
 	source "package/python-pyopenssl/Config.in"
diff --git a/package/python-pymupdf/Config.in b/package/python-pymupdf/Config.in
new file mode 100644
index 0000000000..2d95423e95
--- /dev/null
+++ b/package/python-pymupdf/Config.in
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_PYTHON_PYMUPDF
+	bool "python-pymupdf"
+	depends on BR2_PACKAGE_XORG7
+	select BR2_PACKAGE_MUPDF
+	select BR2_PACKAGE_ZLIB
+	help
+	  Python bindings for the PDF rendering library MuPDF.
+
+	  https://github.com/pymupdf/PyMuPDF
+
+comment "python-pymupdf needs Xorg"
+	depends on !BR2_PACKAGE_XORG7
diff --git a/package/python-pymupdf/python-pymupdf.hash b/package/python-pymupdf/python-pymupdf.hash
new file mode 100644
index 0000000000..6729c6b91b
--- /dev/null
+++ b/package/python-pymupdf/python-pymupdf.hash
@@ -0,0 +1,3 @@
+# md5, sha256 from https://pypi.org/pypi/pymupdf/json
+md5	0e924bbb7364ba63df65d33fee9656f0  PyMuPDF-1.16.0.tar.gz
+sha256	1a6cc5b8b0fb9aa16bfa453fdfed445398f00d2556e78d90ba54cdce8d900857  python-pymupdf-1.16.0.tar.gz
diff --git a/package/python-pymupdf/python-pymupdf.mk b/package/python-pymupdf/python-pymupdf.mk
new file mode 100644
index 0000000000..e0f03dc2cf
--- /dev/null
+++ b/package/python-pymupdf/python-pymupdf.mk
@@ -0,0 +1,25 @@
+################################################################################
+#
+# python-pymupdf
+#
+################################################################################
+
+PYTHON_PYMUPDF_VERSION = 1.16.0
+# python-pymupdf's version must match exactly mupdf's version
+PYTHON_PYMUPDF_SOURCE = PyMuPDF-$(PYTHON_PYMUPDF_VERSION).tar.gz
+PYTHON_PYMUPDF_SITE = https://files.pythonhosted.org/packages/d2/da/692102b6e6868a57d1dc7f98d07413116a02493b3b49a798dcd6f676d368
+PYTHON_PYMUPDF_SETUP_TYPE = distutils
+PYTHON_PYMUPDF_LICENSE = GPL-3.0
+PYTHON_PYMUPDF_DEPENDENCIES = mupdf zlib
+
+PYTHON_PYMUPDF_ENV = CFLAGS="-I$(STAGING_DIR)/usr/include/mupdf"
+
+# We need to remove the original paths as we provide them in the CFLAGS:
+define PYTHON_PYMUPDF_REMOVE_PATHS
+	sed -i "s:\/usr\/include\/mupdf::g" $(@D)/setup.py
+	sed -i "s:\/usr\/local\/include\/mupdf::g" $(@D)/setup.py
+endef
+
+PYTHON_PYMUPDF_POST_PATCH_HOOKS = PYTHON_PYMUPDF_REMOVE_PATHS
+
+$(eval $(python-package))
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/2] package/mupdf: new package.
  2020-02-07  9:37 ` [Buildroot] [PATCH 1/2] package/mupdf: new package Raphaël Mélotte
@ 2021-05-26 20:05   ` Arnout Vandecappelle
  2021-06-30 22:28     ` Raphaël Mélotte
  0 siblings, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle @ 2021-05-26 20:05 UTC (permalink / raw)
  To: buildroot

 Applied to next with some changes.

On 07/02/2020 10:37, Rapha?l M?lotte wrote:
> MuPDF is a lightweight PDF, XPS, and E-book viewer.
> 
> Note: some packages, like PyMuPDF, depend on mupdf's libraries, hence
> the patch.
> 
> Signed-off-by: Rapha?l M?lotte <raphael.melotte@mind.be>

 This sign-off wasn't needed. I removed it.

> Signed-off-by: Rapha?l M?lotte <raphael.melotte@essensium.com>
> ---
>  DEVELOPERS                                    |  1 +
>  package/Config.in                             |  1 +
>  ...-Makefile-add-an-install_libs-target.patch | 41 ++++++++++++
>  package/mupdf/Config.in                       | 15 +++++
>  package/mupdf/mupdf.hash                      |  8 +++
>  package/mupdf/mupdf.mk                        | 62 +++++++++++++++++++
>  6 files changed, 128 insertions(+)
>  create mode 100644 package/mupdf/0001-Makefile-add-an-install_libs-target.patch
>  create mode 100644 package/mupdf/Config.in
>  create mode 100644 package/mupdf/mupdf.hash
>  create mode 100644 package/mupdf/mupdf.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 5f1e37a063..9c527c3625 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1930,6 +1930,7 @@ F:	package/paho-mqtt-cpp/
>  
>  N:	Rapha?l M?lotte <raphael.melotte@essensium.com>
>  F:	package/jbig2dec/
> +F:	package/mupdf/
>  
>  N:	R?mi R?rolle <remi.rerolle@gmail.com>
>  F:	package/libfreeimage/
> diff --git a/package/Config.in b/package/Config.in
> index b2f315ae69..df29673221 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -351,6 +351,7 @@ comment "X applications"
>  	source "package/gtkperf/Config.in"
>  	source "package/leafpad/Config.in"
>  	source "package/midori/Config.in"
> +	source "package/mupdf/Config.in"
>  	source "package/nodm/Config.in"
>  	source "package/pcmanfm/Config.in"
>  	source "package/qt-webkit-kiosk/Config.in"
> diff --git a/package/mupdf/0001-Makefile-add-an-install_libs-target.patch b/package/mupdf/0001-Makefile-add-an-install_libs-target.patch
> new file mode 100644
> index 0000000000..9cb5a2fec9
> --- /dev/null
> +++ b/package/mupdf/0001-Makefile-add-an-install_libs-target.patch
> @@ -0,0 +1,41 @@
> +From 0989f13ecbc2155b05da0cb091801d32d750d2d4 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?=
> + <raphael.melotte@essensium.com>
> +Date: Thu, 29 Aug 2019 09:51:02 +0200
> +Subject: [PATCH] Makefile: add an install_libs target.
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +This allows to install only the library files (if you need pymupdf but
> +not mupdf binaries for example).
> +
> +Signed-off-by: Rapha?l M?lotte <raphael.melotte@essensium.com>

 Did you send this patch upstream?

> +---
> + Makefile | 3 ++-
> + 1 file changed, 2 insertions(+), 1 deletion(-)
> +
> +diff --git a/Makefile b/Makefile
> +index c5bc541ac..e14f88526 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -322,7 +322,7 @@ libs: $(INSTALL_LIBS)
> + tools: $(TOOL_APPS)
> + apps: $(TOOL_APPS) $(VIEW_APPS)
> + 
> +-install: libs apps
> ++install_libs:
> + 	install -d $(DESTDIR)$(incdir)/mupdf
> + 	install -d $(DESTDIR)$(incdir)/mupdf/fitz
> + 	install -d $(DESTDIR)$(incdir)/mupdf/pdf
> +@@ -333,6 +333,7 @@ install: libs apps
> + 	install -d $(DESTDIR)$(libdir)
> + 	install -m 644 $(INSTALL_LIBS) $(DESTDIR)$(libdir)
> + 
> ++install: libs apps install_libs
> + 	install -d $(DESTDIR)$(bindir)
> + 	install -m 755 $(TOOL_APPS) $(VIEW_APPS) $(DESTDIR)$(bindir)
> + 
> +-- 
> +2.21.0
> +
> diff --git a/package/mupdf/Config.in b/package/mupdf/Config.in
> new file mode 100644
> index 0000000000..d66cd0edd4
> --- /dev/null
> +++ b/package/mupdf/Config.in
> @@ -0,0 +1,15 @@
> +config BR2_PACKAGE_MUPDF
> +	bool "mupdf"
> +	depends on BR2_PACKAGE_XORG7
> +	select BR2_PACKAGE_FREETYPE
> +	select BR2_PACKAGE_HARFBUZZ

 You forgot to propagate the dependencies of harfbuzz. I fixed that.

> +	select BR2_PACKAGE_JBIG2DEC
> +	select BR2_PACKAGE_JPEG
> +	select BR2_PACKAGE_LCMS2
> +	select BR2_PACKAGE_OPENJPEG
> +	select BR2_PACKAGE_XLIB_LIBX11
> +	select BR2_PACKAGE_ZLIB
> +	help
> +	  MuPDF is a lightweight PDF, XPS, and E-book viewer.
> +
> +	  https://www.mupdf.com/index.html
> diff --git a/package/mupdf/mupdf.hash b/package/mupdf/mupdf.hash
> new file mode 100644
> index 0000000000..27ae860cdd
> --- /dev/null
> +++ b/package/mupdf/mupdf.hash
> @@ -0,0 +1,8 @@
> +# From https://mupdf.com/downloads/index.html:
> +sha1 18f069b7cc125e53f541163ac305c588c94dea97 mupdf-1.14.0-source.tar.gz

 This should have been 1.16. I fixed that.

> +
> +# Locally computed:
> +sha256 64d537895641b711737cc58fe762481b07ea71d1506e8bd8a13434e093b0068d  mupdf-1.16.0-source.tar.gz
> +
> +# Hash for license files:
> +sha256 57c8ff33c9c0cfc3ef00e650a1cc910d7ee479a8bc509f6c9209a7c2a11399d6  COPYING
> diff --git a/package/mupdf/mupdf.mk b/package/mupdf/mupdf.mk
> new file mode 100644
> index 0000000000..27cc9e5ed9
> --- /dev/null
> +++ b/package/mupdf/mupdf.mk
> @@ -0,0 +1,62 @@
> +################################################################################
> +#
> +# mudpf
> +#
> +################################################################################
> +
> +MUPDF_VERSION = 1.16.0

 You'll get weekly mails to remind you to update to 1.18.0 :-)

> +MUPDF_SOURCE = mupdf-$(MUPDF_VERSION)-source.tar.gz

 There's also a significantly smaller .xz. We prefer that.

> +MUPDF_SITE = https://mupdf.com/downloads/archive
> +MUPDF_LICENSE = AGPL-3.0+
> +MUPDF_LICENSE_FILES = COPYING
> +MUPDF_INSTALL_STAGING = YES
> +MUPDF_DEPENDENCIES = \
> +	freetype \
> +	harfbuzz \
> +	host-pkgconf \
> +	jbig2dec jpeg \
> +	lcms2 openjpeg \
> +	xlib_libX11 \
> +	zlib
> +
> +MUPDF_PKG_CONFIG_PACKAGES = \
> +	freetype2 \
> +	harfbuzz \
> +	libjpeg \
> +	zlib
> +
> +MUPDF_CFLAGS = $(TARGET_CFLAGS)\

 Weird line splitting, and there should a a space before the backslash. I fixed
that.

> +	`$(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
> +
> +# Modern versions of mupdf depend on OpenGL,
> +# we disable it because it may not be available:
> +define MUPDF_DISABLE_OPENGL

 I guess it would be OK to use GLUT if freeglut is selected, so maybe this
should be put inside ifneq ($(BR2_PACKAGE_FREEGLUT),y) ?

> +	sed -i 's/HAVE_GLUT := yes/HAVE_GLUT := no/g' $(@D)/Makerules
> +endef
> +
> +MUPDF_POST_EXTRACT_HOOKS = MUPDF_DISABLE_OPENGL

 We do patching in a post-patch hook, not post-extract. I fixed that.

 Regards,
 Arnout

> +
> +define MUPDF_BUILD_CMDS
> +	$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) all
> +endef
> +
> +define MUPDF_INSTALL_STAGING_CMDS
> +	$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR="$(STAGING_DIR)" prefix="/usr" install_libs
> +endef
> +
> +define MUPDF_INSTALL_TARGET_CMDS
> +	$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR="$(TARGET_DIR)" prefix="/usr" install
> +endef
> +
> +$(eval $(generic-package))
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] package/python-pymupdf: new package.
  2020-02-07  9:37 ` [Buildroot] [PATCH 2/2] package/python-pymupdf: " Raphaël Mélotte
@ 2021-05-26 20:10   ` Arnout Vandecappelle
  0 siblings, 0 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2021-05-26 20:10 UTC (permalink / raw)
  To: buildroot

 Applied to next, again with changes.

On 07/02/2020 10:37, Rapha?l M?lotte wrote:
> Python bindings for the PDF rendering library MuPDF.
> 
> Signed-off-by: Rapha?l M?lotte <raphael.melotte@mind.be>
> Signed-off-by: Rapha?l M?lotte <raphael.melotte@essensium.com>
> ---
>  DEVELOPERS                                 |  1 +
>  package/Config.in                          |  1 +
>  package/python-pymupdf/Config.in           | 12 +++++++++++
>  package/python-pymupdf/python-pymupdf.hash |  3 +++
>  package/python-pymupdf/python-pymupdf.mk   | 25 ++++++++++++++++++++++
>  5 files changed, 42 insertions(+)
>  create mode 100644 package/python-pymupdf/Config.in
>  create mode 100644 package/python-pymupdf/python-pymupdf.hash
>  create mode 100644 package/python-pymupdf/python-pymupdf.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 9c527c3625..0c67165f4a 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1931,6 +1931,7 @@ F:	package/paho-mqtt-cpp/
>  N:	Rapha?l M?lotte <raphael.melotte@essensium.com>
>  F:	package/jbig2dec/
>  F:	package/mupdf/
> +F:  package/python-pymupdf/

 This should have been a tab.


>  N:	R?mi R?rolle <remi.rerolle@gmail.com>
>  F:	package/libfreeimage/
> diff --git a/package/Config.in b/package/Config.in
> index df29673221..ffe1013e82 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1013,6 +1013,7 @@ menu "External python modules"
>  	source "package/python-pylibftdi/Config.in"
>  	source "package/python-pylru/Config.in"
>  	source "package/python-pymodbus/Config.in"
> +	source "package/python-pymupdf/Config.in"
>  	source "package/python-pymysql/Config.in"
>  	source "package/python-pynacl/Config.in"
>  	source "package/python-pyopenssl/Config.in"
> diff --git a/package/python-pymupdf/Config.in b/package/python-pymupdf/Config.in
> new file mode 100644
> index 0000000000..2d95423e95
> --- /dev/null
> +++ b/package/python-pymupdf/Config.in
> @@ -0,0 +1,12 @@
> +config BR2_PACKAGE_PYTHON_PYMUPDF
> +	bool "python-pymupdf"
> +	depends on BR2_PACKAGE_XORG7

 Again, harfbuzz dependencies need to be propagated.

> +	select BR2_PACKAGE_MUPDF
> +	select BR2_PACKAGE_ZLIB
> +	help
> +	  Python bindings for the PDF rendering library MuPDF.
> +
> +	  https://github.com/pymupdf/PyMuPDF
> +
> +comment "python-pymupdf needs Xorg"
> +	depends on !BR2_PACKAGE_XORG7
> diff --git a/package/python-pymupdf/python-pymupdf.hash b/package/python-pymupdf/python-pymupdf.hash
> new file mode 100644
> index 0000000000..6729c6b91b
> --- /dev/null
> +++ b/package/python-pymupdf/python-pymupdf.hash
> @@ -0,0 +1,3 @@
> +# md5, sha256 from https://pypi.org/pypi/pymupdf/json
> +md5	0e924bbb7364ba63df65d33fee9656f0  PyMuPDF-1.16.0.tar.gz
> +sha256	1a6cc5b8b0fb9aa16bfa453fdfed445398f00d2556e78d90ba54cdce8d900857  python-pymupdf-1.16.0.tar.gz
> diff --git a/package/python-pymupdf/python-pymupdf.mk b/package/python-pymupdf/python-pymupdf.mk
> new file mode 100644
> index 0000000000..e0f03dc2cf
> --- /dev/null
> +++ b/package/python-pymupdf/python-pymupdf.mk
> @@ -0,0 +1,25 @@
> +################################################################################
> +#
> +# python-pymupdf
> +#
> +################################################################################
> +
> +PYTHON_PYMUPDF_VERSION = 1.16.0
> +# python-pymupdf's version must match exactly mupdf's version

 I've added a similar comment to mupdf itself.

> +PYTHON_PYMUPDF_SOURCE = PyMuPDF-$(PYTHON_PYMUPDF_VERSION).tar.gz
> +PYTHON_PYMUPDF_SITE = https://files.pythonhosted.org/packages/d2/da/692102b6e6868a57d1dc7f98d07413116a02493b3b49a798dcd6f676d368
> +PYTHON_PYMUPDF_SETUP_TYPE = distutils
> +PYTHON_PYMUPDF_LICENSE = GPL-3.0

 Actually, it's also AGPL-3.0+, because the swig-generated files are under the
mupdf license as well. This is explained in the README on github.

 I also added a comment about the lack of license files.

> +PYTHON_PYMUPDF_DEPENDENCIES = mupdf zlib
> +
> +PYTHON_PYMUPDF_ENV = CFLAGS="-I$(STAGING_DIR)/usr/include/mupdf"
> +
> +# We need to remove the original paths as we provide them in the CFLAGS:
> +define PYTHON_PYMUPDF_REMOVE_PATHS
> +	sed -i "s:\/usr\/include\/mupdf::g" $(@D)/setup.py
> +	sed -i "s:\/usr\/local\/include\/mupdf::g" $(@D)/setup.py
> +endef
> +
> +PYTHON_PYMUPDF_POST_PATCH_HOOKS = PYTHON_PYMUPDF_REMOVE_PATHS

 See, you *knew* that it had to be post-patch :-)

 Regards,
 Arnout

> +
> +$(eval $(python-package))
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/2] package/mupdf: new package.
  2021-05-26 20:05   ` Arnout Vandecappelle
@ 2021-06-30 22:28     ` Raphaël Mélotte
  0 siblings, 0 replies; 6+ messages in thread
From: Raphaël Mélotte @ 2021-06-30 22:28 UTC (permalink / raw)
  To: buildroot


On 5/26/21 10:05 PM, Arnout Vandecappelle wrote:
>   Applied to next with some changes.

Thanks a lot for the fixups and the merge!

> 
>   Did you send this patch upstream?
> 

Not originally, but now I did ([1]), thanks for the reminder.

>   You'll get weekly mails to remind you to update to 1.18.0 :-)
> 

For some reason I don't, even though release-monitoring knows about 1.18.0...

> 
>   There's also a significantly smaller .xz. We prefer that.
> 

Okay, I'll take it into account for 1.18.0.

> 
>   I guess it would be OK to use GLUT if freeglut is selected, so maybe this
> should be put inside ifneq ($(BR2_PACKAGE_FREEGLUT),y) ?
> 

Okay, I'll do that.


Thanks,

Rapha?l

[1]: https://github.com/ArtifexSoftware/mupdf/pull/25

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-30 22:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-07  9:37 [Buildroot] [PATCH 0/2] Add python-pymupdf Raphaël Mélotte
2020-02-07  9:37 ` [Buildroot] [PATCH 1/2] package/mupdf: new package Raphaël Mélotte
2021-05-26 20:05   ` Arnout Vandecappelle
2021-06-30 22:28     ` Raphaël Mélotte
2020-02-07  9:37 ` [Buildroot] [PATCH 2/2] package/python-pymupdf: " Raphaël Mélotte
2021-05-26 20:10   ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.