python3-matplotlib: provide a -native variant
PATCH 1/2 python3-matplotlib: provide a -native variant
From: André Draszik <[email protected]>
This is useful e.g. for smem-native.
Signed-off-by André Draszik <[email protected]>
--- meta-python/recipes-devtools/python/python3-matplotlib_3.1.1.bb | 2 ++ 1 file changed, 2 insertions(+)
meta-python/recipes-devtools/python/python3-matplotlib_3.1.1.bb +2 -0
@@ -15,3 +15,5 @@ SRC_URI[sha256sum] = "1febd22afe1489b13c6749ea059d392c03261b2950d1d45c17e3aed812 PYPI_PACKAGE = "matplotlib" inherit pypi setuptools3 + +BBCLASSEXTEND = "native"
Signature · 1 line
2.23.0.rc1
PATCH 2/2 smem: update to v1.5 (python3 compatibility)
smem generally works using the upstream code, but the --source argument still throws exceptions - add a patch to resolve those as well.
There is no release on the downloads URL, but a tag in mercurial - so this now downloads the snapshot that tag is pointing to.
Signed-off-by André Draszik <[email protected]>
---
...ix-support-for-source-option-python3.patch | 53 +++++++++++++++++++
.../smem/{smem_1.4.bb => smem_1.5.bb} | 20 +++++--
2 files changed, 68 insertions(+), 5 deletions(-)
create mode 100644 meta-oe/recipes-support/smem/smem/0001-smem-fix-support-for-source-option-python3.patch
rename meta-oe/recipes-support/smem/{smem_1.4.bb => smem_1.5.bb} (56%)meta-oe/recipes-support/smem/smem/0001-smem-fix-support-for-source-option-python3.patch new file +53 -0
@@ -0,0 +1,53 @@ +From 3ff78f1f00973393d1a7ee4e467a2bacf1c807f3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]> +Date: Wed, 5 Feb 2020 16:14:21 +0000 +Subject: [PATCH] smem: fix support for --source option (python3) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Using --source doesn't work without this patch: +Traceback (most recent call last): + File "./smem", line 727, in <module> + showpids() + File "./smem", line 299, in showpids + showtable(pt.keys(), fields, columns.split(), options.sort or 'pss') + File "./smem", line 519, in showtable + mt = totalmem() + File "./smem", line 118, in totalmem + _totalmem = memory()['memtotal'] + File "./smem", line 193, in memory + m = f.match(l) +TypeError: cannot use a string pattern on a bytes-like object + +python3's tarfile returns bytes, whereas all of the rest of +the code assumes str. + +Fix the tarfile usage to convert to str before returning the +results. + +Signed-off-by: André Draszik <[email protected]> +Upstream-Status: Inappropriate [upstream wants to support python2 & python3] +--- + smem | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/smem b/smem +index 46a3189..54d40dd 100755 +--- a/smem ++++ b/smem +@@ -90,9 +90,9 @@ class tardata(procdata): + d,f = ti.name.split('/') + yield d + def _read(self, f): +- return self.tar.extractfile(f).read() ++ return self.tar.extractfile(f).read().decode() + def _readlines(self, f): +- return self.tar.extractfile(f).readlines() ++ return [l.decode() for l in self.tar.extractfile(f).readlines()] + def piduser(self, p): + t = self.tar.getmember("%d" % p) + if t.uname: +-- +2.23.0.rc1 +
meta-oe/recipes-support/smem/smem_1.5.bb renamed from meta-oe/recipes-support/smem/smem_1.4.bb +15 -5
@@ -9,9 +9,16 @@ SECTION = "Applications/System" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" -SRC_URI = "http://www.selenic.com/${BPN}/download/${BP}.tar.gz" -SRC_URI[md5sum] = "fe79435c3930389bfdb560255c802162" -SRC_URI[sha256sum] = "2ea9f878f4cf3c276774c3f7e2a41977a1f2d64f98d2dcb6a15f1f3d84df61ec" +HG_CHANGESET = "98273ce331bb" +SRC_URI = "https://selenic.com/repo/${BPN}/archive/${HG_CHANGESET}.tar.bz2;downloadfilename=${BP}.tar.bz2 \ + file://0001-smem-fix-support-for-source-option-python3.patch" +SRC_URI[md5sum] = "51c3989779360f42b42ef46b2831be3a" +SRC_URI[sha256sum] = "161131c686a6d9962a0e96912526dd46308e022d62e3f8acaed5a56fda8e08ce" + +UPSTREAM_CHECK_URI = "https://selenic.com/repo/smem/tags" +UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)" + +S = "${WORKDIR}/${BPN}-${HG_CHANGESET}" do_compile() { ${CC} ${CFLAGS} ${LDFLAGS} smemcap.c -o smemcap
@@ -21,12 +28,15 @@ do_install() { install -d ${D}/${bindir}/ install -d ${D}/${mandir}/man8 install -m 0755 ${S}/smem ${D}${bindir}/ + sed -i -e '1s,#!.*python.*,#!${USRBINPATH}/env python3,' ${D}${bindir}/smem install -m 0755 ${S}/smemcap ${D}${bindir}/ install -m 0644 ${S}/smem.8 ${D}/${mandir}/man8/ } -RDEPENDS_${PN} += "python-textutils python-compression python-shell python-codecs" -PACKAGES =+ "smemcap" +RDEPENDS_${PN} = "python3-core python3-compression" +RRECOMMENDS_${PN} = "python3-matplotlib python3-numpy" + +PACKAGE_BEFORE_PN = "smemcap" FILES_smemcap = "${bindir}/smemcap"
Signature · 1 line
2.23.0.rc1