summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-05-22 05:15:41 +0100
committerSam James <sam@gentoo.org>2022-05-22 05:15:41 +0100
commit8ee74d32043e563010851b08c8f68d5a9d3b9e5b (patch)
treef827b62ab3bbf0746ed48f876b2d40b2d99ec83a /app-misc
parentmedia-video/ffmpeg2theora: enable py3.10 and disable py3.7 (diff)
downloadgentoo-8ee74d32043e563010851b08c8f68d5a9d3b9e5b.tar.gz
gentoo-8ee74d32043e563010851b08c8f68d5a9d3b9e5b.tar.bz2
gentoo-8ee74d32043e563010851b08c8f68d5a9d3b9e5b.zip
app-misc/binwalk: add Python 3.10, PEP517
Closes: https://bugs.gentoo.org/845489 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-misc')
-rw-r--r--app-misc/binwalk/binwalk-2.3.3-r1.ebuild44
-rw-r--r--app-misc/binwalk/binwalk-9999.ebuild19
-rw-r--r--app-misc/binwalk/files/binwalk-2.3.3-syntax-fix.patch36
3 files changed, 91 insertions, 8 deletions
diff --git a/app-misc/binwalk/binwalk-2.3.3-r1.ebuild b/app-misc/binwalk/binwalk-2.3.3-r1.ebuild
new file mode 100644
index 000000000000..a83e98e6723c
--- /dev/null
+++ b/app-misc/binwalk/binwalk-2.3.3-r1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..10} pypy3 )
+
+inherit distutils-r1
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/ReFirmLabs/binwalk.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/ReFirmLabs/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="amd64 ~arm arm64 ~ppc ppc64 ~riscv x86 ~x64-macos"
+fi
+
+DESCRIPTION="A tool for identifying files embedded inside firmware images"
+HOMEPAGE="https://github.com/ReFirmLabs/binwalk"
+
+LICENSE="MIT"
+SLOT="0"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.2.0-disable-test-coverage.patch
+ "${FILESDIR}"/2.3.3-tests.patch
+ "${FILESDIR}"/${PN}-2.3.3-syntax-fix.patch
+
+)
+
+distutils_enable_tests nose
+
+python_install_all() {
+ local DOCS=( API.md INSTALL.md README.md )
+ distutils-r1_python_install_all
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "binwalk has many optional dependencies to automatically"
+ elog "extract/decompress data, see INSTALL.md for more details."
+ fi
+}
diff --git a/app-misc/binwalk/binwalk-9999.ebuild b/app-misc/binwalk/binwalk-9999.ebuild
index d819647e95dc..7c288ad1f32b 100644
--- a/app-misc/binwalk/binwalk-9999.ebuild
+++ b/app-misc/binwalk/binwalk-9999.ebuild
@@ -1,19 +1,19 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-DISTUTILS_USE_SETUPTOOLS=bdepend
-PYTHON_COMPAT=( python3_{7..9} pypy3 )
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..10} pypy3 )
inherit distutils-r1
-if [[ ${PV} == "9999" ]] ; then
+if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="https://github.com/ReFirmLabs/binwalk.git"
inherit git-r3
else
SRC_URI="https://github.com/ReFirmLabs/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
- KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~x64-macos"
+ KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86 ~x64-macos"
fi
DESCRIPTION="A tool for identifying files embedded inside firmware images"
@@ -22,9 +22,12 @@ HOMEPAGE="https://github.com/ReFirmLabs/binwalk"
LICENSE="MIT"
SLOT="0"
-PATCHES=( "${FILESDIR}"/${PN}-2.2.0-disable-test-coverage.patch )
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.2.0-disable-test-coverage.patch
-distutils_enable_tests --install nose
+)
+
+distutils_enable_tests nose
python_install_all() {
local DOCS=( API.md INSTALL.md README.md )
diff --git a/app-misc/binwalk/files/binwalk-2.3.3-syntax-fix.patch b/app-misc/binwalk/files/binwalk-2.3.3-syntax-fix.patch
new file mode 100644
index 000000000000..5edd530b2293
--- /dev/null
+++ b/app-misc/binwalk/files/binwalk-2.3.3-syntax-fix.patch
@@ -0,0 +1,36 @@
+https://github.com/ReFirmLabs/binwalk/pull/585
+
+From bce53d1bb57c2e6dccf718147ebe9472779b7903 Mon Sep 17 00:00:00 2001
+From: Cameron Katri <me@cameronkatri.com>
+Date: Mon, 3 Jan 2022 15:20:39 -0500
+Subject: [PATCH] Fix SyntaxWarning message
+
+/usr/lib/python3/dist-packages/binwalk/modules/extractor.py:969: SyntaxWarning: "is" with a literal. Did you mean "=="?
+ if child_pid is 0:
+/usr/lib/python3/dist-packages/binwalk/modules/extractor.py:984: SyntaxWarning: "is" with a literal. Did you mean "=="?
+ if child_pid is 0:
+--- a/src/binwalk/modules/extractor.py
++++ b/src/binwalk/modules/extractor.py
+@@ -966,7 +966,7 @@ def shell_call(self, command):
+
+ # Fork a child process
+ child_pid = os.fork()
+- if child_pid is 0:
++ if child_pid == 0:
+ # Switch to the run-as user privileges, if one has been set
+ if self.runas_uid is not None and self.runas_gid is not None:
+ os.setgid(self.runas_uid)
+@@ -981,10 +981,10 @@ def shell_call(self, command):
+ rval = subprocess.call(shlex.split(command), stdout=tmp, stderr=tmp)
+
+ # A true child process should exit with the subprocess exit value
+- if child_pid is 0:
++ if child_pid == 0:
+ sys.exit(rval)
+ # If no os.fork() happened, just return the subprocess exit value
+- elif child_pid is None:
++ elif child_pid == None:
+ return rval
+ # Else, os.fork() happened and we're the parent. Wait and return the child's exit value.
+ else:
+