Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1 RESEND] package/python-construct: new package
@ 2022-08-03 15:42 Martin Povišer
  2022-08-03 19:58 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Povišer @ 2022-08-03 15:42 UTC (permalink / raw)
  To: buildroot; +Cc: Martin Povišer, Thomas Petazzoni

construct is a Python library for declarative serialization/
deserialization of structured binary data.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
---
I don't know if you set a bar for the inclusion of packages in
buildroot, but I think by its nature construct makes for a useful
package on embedded systems.

DEVELOPERS                                     |  3 +++
package/Config.in                              |  1 +
package/python-construct/Config.in             |  6 ++++++
package/python-construct/python-construct.hash |  5 +++++
package/python-construct/python-construct.mk   | 15 +++++++++++++++
5 files changed, 30 insertions(+)
create mode 100644 package/python-construct/Config.in
create mode 100644 package/python-construct/python-construct.hash
create mode 100644 package/python-construct/python-construct.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 63bb80fc9d..a91e566bdd 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1924,6 +1924,9 @@ F:	package/tslib/
F:	package/x11r7/xdriver_xf86-input-tslib/
F:	package/x11vnc/

+N:  Martin Povišer <povik+lin@cutebit.org>
+F:  package/python-construct/
+
N:	Masahiro Yamada <yamada.masahiro@socionext.com>
F:	board/arm/foundation-v8/
F:	configs/arm_foundationv8_defconfig
diff --git a/package/Config.in b/package/Config.in
index 61783ba400..7663ce0fbf 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -990,6 +990,7 @@ menu "External python modules"
	source "package/python-colorzero/Config.in"
	source "package/python-configshell-fb/Config.in"
	source "package/python-constantly/Config.in"
+	source "package/python-construct/Config.in"
	source "package/python-couchdb/Config.in"
	source "package/python-crayons/Config.in"
	source "package/python-crc16/Config.in"
diff --git a/package/python-construct/Config.in b/package/python-construct/Config.in
new file mode 100644
index 0000000000..ace47c9989
--- /dev/null
+++ b/package/python-construct/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_PYTHON_CONSTRUCT
+	bool "python-construct"
+	help
+	  A powerful declarative symmetric parser/builder for binary data.
+
+	  https://construct.readthedocs.io/
diff --git a/package/python-construct/python-construct.hash b/package/python-construct/python-construct.hash
new file mode 100644
index 0000000000..2c3b898121
--- /dev/null
+++ b/package/python-construct/python-construct.hash
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/project/construct
+md5  e426d3dd1566066e4ef1a03fe474dec0  construct-2.10.68.tar.gz 
+sha256  7b2a3fd8e5f597a5aa1d614c3bd516fa065db01704c72a1efaaeec6ef23d8b45  construct-2.10.68.tar.gz 
+# Locally computed sha256 checksums
+sha256  1552d70acfd0d3fe464ce13d30113ddc6fe4bac21e52212acc98509e3cc1a8f4  LICENSE
diff --git a/package/python-construct/python-construct.mk b/package/python-construct/python-construct.mk
new file mode 100644
index 0000000000..db8dc0cf26
--- /dev/null
+++ b/package/python-construct/python-construct.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# python-construct
+#
+################################################################################
+
+PYTHON_CONSTRUCT_VERSION = 2.10.68
+PYTHON_CONSTRUCT_SOURCE = construct-$(PYTHON_CONSTRUCT_VERSION).tar.gz
+PYTHON_CONSTRUCT_SITE = https://files.pythonhosted.org/packages/e0/b7/a4a032e94bcfdff481f2e6fecd472794d9da09f474a2185ed33b2c7cad64
+PYTHON_CONSTRUCT_SETUP_TYPE = setuptools
+PYTHON_CONSTRUCT_LICENSE = MIT
+PYTHON_CONSTRUCT_LICENSE_FILES = LICENSE
+PYTHON_CONSTRUCT_DEPENDENCIES = host-python-setuptools-scm
+
+$(eval $(python-package))
-- 
2.37.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1 RESEND] package/python-construct: new package
  2022-08-03 15:42 [Buildroot] [PATCH 1/1 RESEND] package/python-construct: new package Martin Povišer
@ 2022-08-03 19:58 ` Thomas Petazzoni via buildroot
  2022-08-03 20:19   ` Martin Povišer
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-03 19:58 UTC (permalink / raw)
  To: Martin Povišer; +Cc: buildroot

Hello Martin,

On Wed, 3 Aug 2022 17:42:48 +0200
Martin Povišer <povik+lin@cutebit.org> wrote:

> construct is a Python library for declarative serialization/
> deserialization of structured binary data.
> 
> Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
> ---
> I don't know if you set a bar for the inclusion of packages in
> buildroot, but I think by its nature construct makes for a useful
> package on embedded systems.

Thanks for your contribution! It looked good, but there was one issue:
the patch was damaged, perhaps because you didn't send it using git
send-email?

So I fixed up the damage, but also added a test in our runtime test
infrastructure for this new package. This allows to verify that the
package works at runtime, which is quite important for Python modules.

See:

  support/testing/tests/package/test_python_construct.py

which builds a simple Buildroot configuration with python-construct
enabled, boots it under Qemu, and runs:

  support/testing/tests/package/sample_python_construct.py

inside this environment.

> +PYTHON_CONSTRUCT_DEPENDENCIES = host-python-setuptools-scm

I also dropped this dependency, because I couldn't see in setup.py why
this dependency would be needed, and a test build without this
dependency showed it was working. Hopefully I was not wrong on this :-)

See the final commit at:

  https://gitlab.com/buildroot.org/buildroot/-/commit/c05caa755723737e91ffd57e736298cb19c9c87f

Again, thanks for your contribution!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1 RESEND] package/python-construct: new package
  2022-08-03 19:58 ` Thomas Petazzoni via buildroot
@ 2022-08-03 20:19   ` Martin Povišer
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Povišer @ 2022-08-03 20:19 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot


> On 3. 8. 2022, at 21:58, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> 
> Hello Martin,

Hi Thomas!

> 
> On Wed, 3 Aug 2022 17:42:48 +0200
> Martin Povišer <povik+lin@cutebit.org> wrote:
> 
>> construct is a Python library for declarative serialization/
>> deserialization of structured binary data.
>> 
>> Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
>> ---
>> I don't know if you set a bar for the inclusion of packages in
>> buildroot, but I think by its nature construct makes for a useful
>> package on embedded systems.
> 
> Thanks for your contribution! It looked good, but there was one issue:
> the patch was damaged, perhaps because you didn't send it using git
> send-email?

Yeah, I sent first email with git send-email, got a bounce back because
I wasn’t subscribed to the ML, then I took my chances resending using
the Apple Mail client. Useful to know that doesn’t work.

> So I fixed up the damage, but also added a test in our runtime test
> infrastructure for this new package. This allows to verify that the
> package works at runtime, which is quite important for Python modules.
> 
> See:
> 
>  support/testing/tests/package/test_python_construct.py
> 
> which builds a simple Buildroot configuration with python-construct
> enabled, boots it under Qemu, and runs:
> 
>  support/testing/tests/package/sample_python_construct.py
> 
> inside this environment.

Cool!

>> +PYTHON_CONSTRUCT_DEPENDENCIES = host-python-setuptools-scm
> 
> I also dropped this dependency, because I couldn't see in setup.py why
> this dependency would be needed, and a test build without this
> dependency showed it was working. Hopefully I was not wrong on this :-)

Most likely you are not wrong. I copied it from elsewhere and thought
that meant setuptools in general, but I guess the -scm postfix matters
here.

> See the final commit at:
> 
>  https://gitlab.com/buildroot.org/buildroot/-/commit/c05caa755723737e91ffd57e736298cb19c9c87f
> 
> Again, thanks for your contribution!

Thanks for the final touches on it! Looking forward to having this in
buildroot out-of-the-box.

> 
> Thomas

Martin

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-08-03 20:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-03 15:42 [Buildroot] [PATCH 1/1 RESEND] package/python-construct: new package Martin Povišer
2022-08-03 19:58 ` Thomas Petazzoni via buildroot
2022-08-03 20:19   ` Martin Povišer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox