Skip to content

Commit b012d24

Browse files
committed
python3-pynng: New recipe for version 0.8.1
Signed-off-by: Zoltán Böszörményi <[email protected]>
1 parent ad9b01d commit b012d24

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
Upstream-Status: Inappropriate [Yocto specific]
2+
3+
diff -durpN pynng-0.8.1.old/build_pynng.py pynng-0.8.1/build_pynng.py
4+
--- pynng-0.8.1.old/build_pynng.py 2025-01-13 03:41:51.000000000 +0100
5+
+++ pynng-0.8.1/build_pynng.py 2025-03-06 13:45:53.398035144 +0100
6+
@@ -29,13 +29,8 @@ if sys.platform == "win32":
7+
# objects = None
8+
else:
9+
incdirs = ["nng/include"]
10+
- objects = [
11+
- "./nng/build/libnng.a",
12+
- "./mbedtls/prefix/lib/libmbedtls.a",
13+
- "./mbedtls/prefix/lib/libmbedx509.a",
14+
- "./mbedtls/prefix/lib/libmbedcrypto.a",
15+
- ]
16+
- libraries = ["pthread"]
17+
+ objects = []
18+
+ libraries = ["nng", "pthread"]
19+
machine = os.uname().machine
20+
# this is a pretty heuristic... but let's go with it anyway.
21+
# it would be better to get linker information from cmake somehow.
22+
diff -durpN pynng-0.8.1.old/setup.cfg pynng-0.8.1/setup.cfg
23+
--- pynng-0.8.1.old/setup.cfg 2025-01-13 03:43:01.313147000 +0100
24+
+++ pynng-0.8.1/setup.cfg 2025-03-06 13:46:18.741355762 +0100
25+
@@ -1,11 +1,3 @@
26+
-[build_nng]
27+
-repo = https://github.com/nanomsg/nng
28+
-rev = v1.6.0
29+
-
30+
-[build_mbedtls]
31+
-repo = https://github.com/ARMmbed/mbedtls.git
32+
-rev = v3.5.1
33+
-
34+
[build_ext]
35+
inplace = 1
36+
37+
diff -durpN pynng-0.8.1.old/setup.py pynng-0.8.1/setup.py
38+
--- pynng-0.8.1.old/setup.py 2025-01-13 03:41:51.000000000 +0100
39+
+++ pynng-0.8.1/setup.py 2025-03-06 13:48:29.218006420 +0100
40+
@@ -4,12 +4,6 @@ import platform
41+
import shutil
42+
import sys
43+
44+
-if platform.machine() == "i686" and platform.system() == "Linux":
45+
- # mbedtls v3.5.1 will not build without these flags on 32-bit linux.
46+
- # https://github.com/Mbed-TLS/mbedtls/issues/8334
47+
- # this is hopefully going to be fixed in another release.
48+
- # There is probably a better way to do this...
49+
- os.environ["CFLAGS"] = "-mpclmul -msse2 -maes"
50+
from setuptools import Command, setup, find_packages
51+
from setuptools.command.build_ext import build_ext
52+
53+
@@ -156,8 +150,6 @@ class BuildBuild(build_ext):
54+
"""
55+
Running...
56+
"""
57+
- self.run_command("build_mbedtls")
58+
- self.run_command("build_nng")
59+
60+
build_ext.run(self) # proceed with "normal" build steps
61+
62+
@@ -167,8 +159,6 @@ with open("README.md", "r", encoding="ut
63+
64+
setup(
65+
cmdclass={
66+
- "build_mbedtls": BuildMbedTls,
67+
- "build_nng": BuildNng,
68+
"build_ext": BuildBuild,
69+
},
70+
cffi_modules=["build_pynng.py:ffibuilder"],
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
SUMMARY = "Networking made simply using nng"
2+
LICENSE = "MIT"
3+
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=57ac8de47c94532bc709cda1fe21c1a5"
4+
5+
DEPENDS = " \
6+
python3-setuptools-scm-native \
7+
python3-cffi-native python3-cmake-native \
8+
nng \
9+
"
10+
11+
inherit pypi python_setuptools_build_meta
12+
SRC_URI[sha256sum] = "60165f34bdf501885e0acceaeed79bc35a57f3ca3c913cb38c14919b9bd3656f"
13+
14+
SRC_URI += "file://pynng-0.8.1-use-shared-nng.patch"
15+
16+
RDEPENDS:${PN} = " \
17+
python3-cffi \
18+
python3-sniffio \
19+
python3-trio \
20+
"

0 commit comments

Comments
 (0)