Skip to contentSkip to conversation

package/python3-jinja2: add special host variant

PATCH New Peter Seiderer 3 participants 7 messages Nov 17, 2020 – Jan 19, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 package/python3-jinja2: add special host variant

---
 package/python-jinja2/python-jinja2.mk     |  1 +
 package/python3-jinja2/python3-jinja2.hash |  5 +++++
 package/python3-jinja2/python3-jinja2.mk   | 18 ++++++++++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 package/python3-jinja2/python3-jinja2.hash
 create mode 100644 package/python3-jinja2/python3-jinja2.mk
package/python-jinja2/python-jinja2.mk +1 -0
index 5f6492915c..51b484d03e 100644
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# Please keep in sync with package/python3-jinja2/python3-jinja2.mk
 PYTHON_JINJA2_VERSION = 2.11.2
 PYTHON_JINJA2_SOURCE = Jinja2-$(PYTHON_JINJA2_VERSION).tar.gz
 PYTHON_JINJA2_SITE = https://files.pythonhosted.org/packages/64/a7/45e11eebf2f15bf987c3bc11d37dcc838d9dc81250e67e4c5968f6008b6c
package/python3-jinja2/python3-jinja2.hash new file +5 -0
new file mode 100644
index 0000000000..21170a2a99
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/jinja2/json
+md5  0362203b22547abca06ed1082bc1e7b4  Jinja2-2.11.2.tar.gz
+sha256  89aab215427ef59c34ad58735269eb58b1a5808103067f7bb9d5836c651b3bb0  Jinja2-2.11.2.tar.gz
+# Locally computed sha256 checksums
+sha256  3b49dcee4105eb37bac10faf1be260408fe85d252b8e9df2e0979fc1e094437b  LICENSE.rst
package/python3-jinja2/python3-jinja2.mk new file +18 -0
new file mode 100644
index 0000000000..cc8b1ff86f
@@ -0,0 +1,18 @@
+################################################################################
+#
+# python3-jinja2
+#
+################################################################################
+
+PYTHON3_JINJA2_VERSION = 2.11.2
+PYTHON3_JINJA2_SOURCE = Jinja2-$(PYTHON3_JINJA2_VERSION).tar.gz
+PYTHON3_JINJA2_SITE = https://files.pythonhosted.org/packages/64/a7/45e11eebf2f15bf987c3bc11d37dcc838d9dc81250e67e4c5968f6008b6c
+PYTHON3_JINJA2_SETUP_TYPE = setuptools
+PYTHON3_JINJA2_LICENSE = BSD-3-Clause
+PYTHON3_JINJA2_LICENSE_FILES = LICENSE.rst
+
+HOST_PYTHON3_JINJA2_NEEDS_HOST_PYTHON = python3
+# In host build, setup.py tries to download markupsafe if it is not installed
+HOST_PYTHON3_JINJA2_DEPENDENCIES = host-python3-markupsafe
+
+$(eval $(host-python-package))
Signature · 1 line
2.29.2
#1 lore raw

PATCH 2/5 package/python3-markupsafe: add special host variant

---
 package/python-markupsafe/python-markupsafe.mk   |  1 +
 .../python3-markupsafe/python3-markupsafe.hash   |  4 ++++
 package/python3-markupsafe/python3-markupsafe.mk | 16 ++++++++++++++++
 3 files changed, 21 insertions(+)
 create mode 100644 package/python3-markupsafe/python3-markupsafe.hash
 create mode 100644 package/python3-markupsafe/python3-markupsafe.mk
package/python-markupsafe/python-markupsafe.mk +1 -0
index b527706091..f067d94f34 100644
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# Please keep in sync with package/python3-markupsafe/python3-markupsafe.mk
 PYTHON_MARKUPSAFE_VERSION = 1.1.1
 PYTHON_MARKUPSAFE_SOURCE = MarkupSafe-$(PYTHON_MARKUPSAFE_VERSION).tar.gz
 PYTHON_MARKUPSAFE_SITE = https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094
package/python3-markupsafe/python3-markupsafe.hash new file +4 -0
new file mode 100644
index 0000000000..df07662a86
@@ -0,0 +1,4 @@
+# md5 from https://pypi.python.org/pypi/markupsafe/json, sha256 locally computed
+md5	43fd756864fe42063068e092e220c57b  MarkupSafe-1.1.1.tar.gz
+sha256	29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b  MarkupSafe-1.1.1.tar.gz
+sha256	489a8e1108509ed98a37bb983e11e0f7e1d31f0bd8f99a79c8448e7ff37d07ea  LICENSE.rst
package/python3-markupsafe/python3-markupsafe.mk new file +16 -0
new file mode 100644
index 0000000000..58f6e67b64
@@ -0,0 +1,16 @@
+################################################################################
+#
+# python3-markupsafe
+#
+################################################################################
+
+PYTHON3_MARKUPSAFE_VERSION = 1.1.1
+PYTHON3_MARKUPSAFE_SOURCE = MarkupSafe-$(PYTHON3_MARKUPSAFE_VERSION).tar.gz
+PYTHON3_MARKUPSAFE_SITE = https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094
+PYTHON3_MARKUPSAFE_SETUP_TYPE = setuptools
+PYTHON3_MARKUPSAFE_LICENSE = BSD-3-Clause
+PYTHON3_MARKUPSAFE_LICENSE_FILES = LICENSE.rst
+
+HOST_PYTHON3_MARKUPSAFE_NEEDS_HOST_PYTHON = python3
+
+$(eval $(host-python-package))
Signature · 1 line
2.29.2
#2 lore raw

PATCH 3/5 package/python3-ply: add special host variant

In reply to Peter Seiderer
---
 package/python-ply/python-ply.mk     |  1 +
 package/python3-ply/python3-ply.hash |  5 +++++
 package/python3-ply/python3-ply.mk   | 16 ++++++++++++++++
 3 files changed, 22 insertions(+)
 create mode 100644 package/python3-ply/python3-ply.hash
 create mode 100644 package/python3-ply/python3-ply.mk
package/python-ply/python-ply.mk +1 -0
index 5dc7964d5f..50a3e32bc2 100644
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# Please keep in sync with package/python3-ply/python3-ply.mk
 PYTHON_PLY_VERSION = 3.11
 PYTHON_PLY_SOURCE = ply-$(PYTHON_PLY_VERSION).tar.gz
 PYTHON_PLY_SITE = https://files.pythonhosted.org/packages/e5/69/882ee5c9d017149285cab114ebeab373308ef0f874fcdac9beb90e0ac4da
package/python3-ply/python3-ply.hash new file +5 -0
new file mode 100644
index 0000000000..1eba3b0ffe
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/ply/json
+md5	6465f602e656455affcd7c5734c638f8  ply-3.11.tar.gz
+sha256	00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3  ply-3.11.tar.gz
+# Locally computed sha256 checksums
+sha256	1095b93b81d2043c5c55e0859875b416f75edb6d5eccb4bf2ace1b5445d1c84f  README.md
package/python3-ply/python3-ply.mk new file +16 -0
new file mode 100644
index 0000000000..15f66a49db
@@ -0,0 +1,16 @@
+################################################################################
+#
+# python3-ply
+#
+################################################################################
+
+PYTHON3_PLY_VERSION = 3.11
+PYTHON3_PLY_SOURCE = ply-$(PYTHON3_PLY_VERSION).tar.gz
+PYTHON3_PLY_SITE = https://files.pythonhosted.org/packages/e5/69/882ee5c9d017149285cab114ebeab373308ef0f874fcdac9beb90e0ac4da
+PYTHON3_PLY_SETUP_TYPE = setuptools
+PYTHON3_PLY_LICENSE = BSD-3-Clause
+PYTHON3_PLY_LICENSE_FILES = README.md
+
+HOST_PYTHON3_PLY_NEEDS_HOST_PYTHON = python3
+
+$(eval $(host-python-package))
Signature · 1 line
2.29.2
#3 lore raw

PATCH 4/5 package/libcamera: bump version to de5d03673

In reply to Peter Seiderer

- add new host-python3-jinja2 and host-python3-ply dependencies
- change android, documentation options from boolean to feature
- disable new tracing option (needs lttng-ust)

---
 package/libcamera/libcamera.hash | 2 +-
 package/libcamera/libcamera.mk   | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)
package/libcamera/libcamera.hash +1 -1
index 41416da712..32c19f4abf 100644
@@ -1,4 +1,4 @@
-sha256  a7800b54584dee321874610ef70b1b7690c79d8340c5b134ea35176657681e29  libcamera-e59713c68678f3eb6b6ebe97cabdc88c7042567f.tar.gz
+sha256  de6528224c3d54854e7eac6e8ce139ff9168cafe830f559d4aac879084dc7716  libcamera-de5d03673c41f5f117d03c23495de5620fd6f42e.tar.gz
 
 # license files
 sha256  fd38b2c053c0cce46d9c5ef3545a6e34d157a240ba99c9b8dca5d37a8147da6c  LICENSES/BSD-2-Clause.txt
package/libcamera/libcamera.mk +6 -3
index e6cd714207..aed5c6e83c 100644
@@ -5,17 +5,20 @@
 ################################################################################
 
 LIBCAMERA_SITE = https://git.linuxtv.org/libcamera.git
-LIBCAMERA_VERSION = e59713c68678f3eb6b6ebe97cabdc88c7042567f
+LIBCAMERA_VERSION = de5d03673c41f5f117d03c23495de5620fd6f42e
 LIBCAMERA_SITE_METHOD = git
 LIBCAMERA_DEPENDENCIES = \
 	host-openssl \
 	host-pkgconf \
+	host-python3-jinja2 \
+	host-python3-ply \
 	host-python3-pyyaml \
 	gnutls
 LIBCAMERA_CONF_OPTS = \
-	-Dandroid=false \
-	-Ddocumentation=false \
+	-Dandroid=disabled \
+	-Ddocumentation=disabled \
 	-Dtest=false \
+	-Dtracing=disabled \
 	-Dwerror=false
 LIBCAMERA_INSTALL_STAGING = YES
 LIBCAMERA_LICENSE = \
Signature · 1 line
2.29.2
#4 lore raw

PATCH 5/5 package/libcamera: add optional lttng-libust dependency

In reply to Peter Seiderer

Add optional lttng-libust support and enable tracing support in case.

---
 package/libcamera/libcamera.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
package/libcamera/libcamera.mk +7 -1
index aed5c6e83c..ae074c2893 100644
@@ -18,7 +18,6 @@ LIBCAMERA_CONF_OPTS = \
 	-Dandroid=disabled \
 	-Ddocumentation=disabled \
 	-Dtest=false \
-	-Dtracing=disabled \
 	-Dwerror=false
 LIBCAMERA_INSTALL_STAGING = YES
 LIBCAMERA_LICENSE = \
@@ -86,4 +85,11 @@ ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
 LIBCAMERA_DEPENDENCIES += udev
 endif
 
+ifeq ($(BR2_PACKAGE_LTTNG_LIBUST),y)
+LIBCAMERA_CONF_OPTS += -Dtracing=enabled
+LIBCAMERA_DEPENDENCIES += lttng-libust
+else
+LIBCAMERA_CONF_OPTS += -Dtracing=disabled
+endif
+
 $(eval $(meson-package))
Signature · 1 line
2.29.2
#5 lore raw

PATCH 1/5 package/python3-jinja2: add special host variant

In reply to Peter Seiderer
Quoted 14 lines · Peter Seiderer
---
 package/python-jinja2/python-jinja2.mk     |  1 +
 package/python3-jinja2/python3-jinja2.hash |  5 +++++
 package/python3-jinja2/python3-jinja2.mk   | 18 ++++++++++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 package/python3-jinja2/python3-jinja2.hash
 create mode 100644 package/python3-jinja2/python3-jinja2.mk
package/python-jinja2/python-jinja2.mk +0 -0
index 5f6492915c..51b484d03e 100644

package/python-jinja2/python-jinja2.mk line 7

Quoted 4 lines
package/python-jinja2/python-jinja2.mk +1 -0
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# Please keep in sync with package/python3-jinja2/python3-jinja2.mk

We have taken this approach for a number of host python packages, but I would
like to avoid continuing down this path. The idea is to slowly deprecate python2, so adding workarounds for it is not great...

We discussed this at FOSDEM this year [1]. The conclusion that is relevant for
this is:

host python modules will always use host-python3. So the host-python-package infra should be adapted to handle that.

Of course, the last part of that sentence never happened... But I really would prefer to implement that rather than adding 3 more packages.

[Adding a couple of people in Cc that I vaguely remember were involved in the discussion.]

Regards,
Arnout

[1]
https://elinux.org/Buildroot:DeveloperDaysFOSDEM2020#Continue_Python2_deprecation_.28Titouan.29

Quoted 39 lines
package/python-jinja2/python-jinja2.mk +0 -0
 PYTHON_JINJA2_VERSION = 2.11.2
 PYTHON_JINJA2_SOURCE = Jinja2-$(PYTHON_JINJA2_VERSION).tar.gz
 PYTHON_JINJA2_SITE = https://files.pythonhosted.org/packages/64/a7/45e11eebf2f15bf987c3bc11d37dcc838d9dc81250e67e4c5968f6008b6c
package/python3-jinja2/python3-jinja2.hash new file +5 -0
new file mode 100644
index 0000000000..21170a2a99
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/jinja2/json
+md5  0362203b22547abca06ed1082bc1e7b4  Jinja2-2.11.2.tar.gz
+sha256  89aab215427ef59c34ad58735269eb58b1a5808103067f7bb9d5836c651b3bb0  Jinja2-2.11.2.tar.gz
+# Locally computed sha256 checksums
+sha256  3b49dcee4105eb37bac10faf1be260408fe85d252b8e9df2e0979fc1e094437b  LICENSE.rst
package/python3-jinja2/python3-jinja2.mk new file +18 -0
new file mode 100644
index 0000000000..cc8b1ff86f
@@ -0,0 +1,18 @@
+################################################################################
+#
+# python3-jinja2
+#
+################################################################################
+
+PYTHON3_JINJA2_VERSION = 2.11.2
+PYTHON3_JINJA2_SOURCE = Jinja2-$(PYTHON3_JINJA2_VERSION).tar.gz
+PYTHON3_JINJA2_SITE = https://files.pythonhosted.org/packages/64/a7/45e11eebf2f15bf987c3bc11d37dcc838d9dc81250e67e4c5968f6008b6c
+PYTHON3_JINJA2_SETUP_TYPE = setuptools
+PYTHON3_JINJA2_LICENSE = BSD-3-Clause
+PYTHON3_JINJA2_LICENSE_FILES = LICENSE.rst
+
+HOST_PYTHON3_JINJA2_NEEDS_HOST_PYTHON = python3
+# In host build, setup.py tries to download markupsafe if it is not installed
+HOST_PYTHON3_JINJA2_DEPENDENCIES = host-python3-markupsafe
+
+$(eval $(host-python-package))
#6 lore raw

PATCH 1/5 package/python3-jinja2: add special host variant

In reply to Peter Seiderer
Quoted 8 lines · On Tue, 17 Nov 2020 23:34:32 +0100 Peter Seiderer <[email protected]> wrote:
---
 package/python-jinja2/python-jinja2.mk     |  1 +
 package/python3-jinja2/python3-jinja2.hash |  5 +++++
 package/python3-jinja2/python3-jinja2.mk   | 18 ++++++++++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 package/python3-jinja2/python3-jinja2.hash
 create mode 100644 package/python3-jinja2/python3-jinja2.mk

So, despite Arnout's disagreement, I have applied the series. Indeed, what you're doing in this series is what we do today with host Python packages when they must be available with Python 3. My view is that there is not much point in changing how we do things today until we get rid of Python 2.x altogether.

However, in your series, I changed a few things:

* The patch for jinja2 should have been after the patch for markupsafe, as jinja2 uses markupsafe

* You duplicated the hash files of the packages between the python-<foo> package and the corresponding python3-<foo> package, while we normally use a symlink for the hash file, so I've done that.

* Due to other changes since then on the Git downloading, the change in the libcamera hash file was no longer correct, I fixed that.

So, entire series applied with those changes. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com