[packages/nanopb] - updated to 0.4.7 - added config patch (enable dynamic allocation)

qboosh qboosh at pld-linux.org
Fri Jan 13 20:56:08 CET 2023


commit be42bd76f7ed54c0cfd1fd8776be2511806182a1
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Jan 13 20:57:09 2023 +0100

    - updated to 0.4.7
    - added config patch (enable dynamic allocation)

 nanopb-config.patch | 11 +++++++++++
 nanopb.spec         | 15 ++++++++++++---
 2 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/nanopb.spec b/nanopb.spec
index b2ee501..b534913 100644
--- a/nanopb.spec
+++ b/nanopb.spec
@@ -6,13 +6,14 @@
 Summary:	Nanopb - Protocol Buffers for Embedded Systems
 Summary(pl.UTF-8):	Nanopb - Protocol Buffers dla systemów wbudowanych
 Name:		nanopb
-Version:	0.4.6.4
+Version:	0.4.7
 Release:	1
 License:	BSD-like
 Group:		Libraries
 #Source0Download: https://github.com/nanopb/nanopb/tags
 Source0:	https://github.com/nanopb/nanopb/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	a80226623867d82d7b0a0a8d4f64fac8
+# Source0-md5:	ab1d32b1488a02117e52e8dc4047be1c
+Patch0:		%{name}-config.patch
 URL:		https://jpa.kapsi.fi/nanopb/
 BuildRequires:	cmake >= 2.8.12
 %{?with_apidocs:BuildRequires:	pandoc}
@@ -70,8 +71,11 @@ Dokumentacja API biblioteki Nanopb.
 
 %prep
 %setup -q
+%patch0 -p1
 
-%{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' generator/nanopb_generator.py
+%{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' \
+	generator/nanopb_generator.py \
+	generator/protoc-gen-nanopb
 
 %build
 install -d build
@@ -93,6 +97,11 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} -C build install \
 	DESTDIR=$RPM_BUILD_ROOT
 
+# missing from install
+cp -p generator/proto/__init__.py $RPM_BUILD_ROOT%{py3_sitescriptdir}/proto
+%py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}/proto
+%py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}/proto
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
diff --git a/nanopb-config.patch b/nanopb-config.patch
new file mode 100644
index 0000000..25dedce
--- /dev/null
+++ b/nanopb-config.patch
@@ -0,0 +1,11 @@
+--- nanopb-0.4.7/pb.h.orig	2022-12-11 10:51:56.000000000 +0100
++++ nanopb-0.4.7/pb.h	2023-01-13 19:58:11.797411917 +0100
+@@ -11,7 +11,7 @@
+  *****************************************************************/
+ 
+ /* Enable support for dynamically allocated fields */
+-/* #define PB_ENABLE_MALLOC 1 */
++#define PB_ENABLE_MALLOC 1
+ 
+ /* Define this if your CPU / compiler combination does not support
+  * unaligned memory access to packed structures. Note that packed
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nanopb.git/commitdiff/be42bd76f7ed54c0cfd1fd8776be2511806182a1



More information about the pld-cvs-commit mailing list