diff mbox series

[v3] openpgm: Add Pragmatic General Multicast library

Message ID ME1PR01MB08177BC4FC2CA4A0A648B651D08D9@ME1PR01MB0817.ausprd01.prod.outlook.com
State Not Applicable
Headers show
Series [v3] openpgm: Add Pragmatic General Multicast library | expand

Commit Message

Ye Holmes Feb. 10, 2021, 12:09 p.m. UTC
OpenPGM is a library implementing the PGM reliable multicast
network protocol; The famous messaging library ZMQ has an
optional dependency on OpenPGM, with OpenPGM enabled, we can
foster the development of multicast network applications.

Signed-off-by: Ye Holmes <yeholmes@outlook.com>
---
On Dienstag, 9. Februar 2021 04:20, Adrian Schmutzler wrote:
> This comes with certain helpers like build tests etc.
Thanks, I will initiate a Pull-Reqeust on packages/github later,
to test whether build succeeds (I've tested it on my machine).

On Tue, 9 Feb 2021 17:05:00 +0100, Alberto Bursi wrote:
> I have now added a paragraph on the submitting patches article
> to send contributions to the right repository
> https://openwrt.org/submitting-patches

Thanks, a lot, Alberto! 😃

The v3 patch differs from previous patch: the relative path of
license file is changed to `LICENSE, instead of `openpgm/pgm/LICENSE,
as the post-move of source files after tarball extraction.
---
 libs/openpgm/Makefile                         | 62 +++++++++++++++++++
 .../0001-Rename-openpgm-5.2.pc.in.patch       | 22 +++++++
 ...hecksum.c-fix-build-with-32-bits-MMX.patch | 38 ++++++++++++
 3 files changed, 122 insertions(+)
 create mode 100644 libs/openpgm/Makefile
 create mode 100644 libs/openpgm/patches/0001-Rename-openpgm-5.2.pc.in.patch
 create mode 100644 libs/openpgm/patches/0002-openpgm-pgm-checksum.c-fix-build-with-32-bits-MMX.patch

Comments

Hauke Mehrtens Feb. 22, 2021, 10:54 a.m. UTC | #1
On 2/10/21 1:09 PM, Ye Holmes wrote:
> OpenPGM is a library implementing the PGM reliable multicast
> network protocol; The famous messaging library ZMQ has an
> optional dependency on OpenPGM, with OpenPGM enabled, we can
> foster the development of multicast network applications.
> 
> Signed-off-by: Ye Holmes <yeholmes@outlook.com>
> ---
> On Dienstag, 9. Februar 2021 04:20, Adrian Schmutzler wrote:
>> This comes with certain helpers like build tests etc.
> Thanks, I will initiate a Pull-Reqeust on packages/github later,
> to test whether build succeeds (I've tested it on my machine).
> 
> On Tue, 9 Feb 2021 17:05:00 +0100, Alberto Bursi wrote:
>> I have now added a paragraph on the submitting patches article
>> to send contributions to the right repository
>> https://openwrt.org/submitting-patches
> 
> Thanks, a lot, Alberto! 😃
> 
> The v3 patch differs from previous patch: the relative path of
> license file is changed to `LICENSE, instead of `openpgm/pgm/LICENSE,
> as the post-move of source files after tarball extraction.
> ---
>   libs/openpgm/Makefile                         | 62 +++++++++++++++++++
>   .../0001-Rename-openpgm-5.2.pc.in.patch       | 22 +++++++
>   ...hecksum.c-fix-build-with-32-bits-MMX.patch | 38 ++++++++++++
>   3 files changed, 122 insertions(+)
>   create mode 100644 libs/openpgm/Makefile
>   create mode 100644 libs/openpgm/patches/0001-Rename-openpgm-5.2.pc.in.patch
>   create mode 100644 libs/openpgm/patches/0002-openpgm-pgm-checksum.c-fix-build-with-32-bits-MMX.patch
> 

Please add this to the packages feed, see here:
https://github.com/openwrt/packages/blob/master/CONTRIBUTING.md

You have to create a fork of the package feed, and then a pull request 
to get this merged into the openwrt package feed on github.

Hauke
Ye Holmes Feb. 22, 2021, 11:45 a.m. UTC | #2
On Mon, 2021-02-22 at 11:54 +0100, Hauke Mehrtens wrote:
> You have to create a fork of the package feed, and then a pull
> request 
> to get this merged into the openwrt package feed on github.
> 
> Hauke

The patch has been accepted and merged into package repository
via github PR, I will examine twice about where to send patches
next time, thank you very much!

Please help mark another related thread as Not Applicable, if
convenient:

http://patchwork.ozlabs.org/project/openwrt/patch/ME1PR01MB0817192927631F9E74E124B0D0D30@ME1PR01MB0817.ausprd01.prod.outlook.com/

Best
Ye Holmes
diff mbox series

Patch

diff --git a/libs/openpgm/Makefile b/libs/openpgm/Makefile
new file mode 100644
index 000000000..5f996c125
--- /dev/null
+++ b/libs/openpgm/Makefile
@@ -0,0 +1,62 @@ 
+#
+# Copyright (C) 2021 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=openpgm
+PKG_VERSION:=5.3.128
+PKG_RELEASE:=1
+
+PKG_SOURCE:=release-5-3-128.tar.gz
+PKG_SOURCE_URL:=https://github.com/steve-o/openpgm/archive
+PKG_HASH:=8d707ef8dda45f4a7bc91016d7f2fed6a418637185d76c7ab30b306499c6d393
+
+PKG_MAINTAINER:=Ye Holmes <yeholmes@outlook.com>
+PKG_LICENSE:=LGPL-2.1-or-later
+PKG_LICENSE_FILES:=LICENSE
+PKG_CPE_ID:=cpe:/a:openpgm:openpgm
+
+PKG_FIXUP:=autoreconf
+PKG_BUILD_DIR:=$(BUILD_DIR)/openpgm-release-5-3-128
+include $(INCLUDE_DIR)/package.mk
+
+define Package/openpgm
+  TITLE:=OpenPGM, an implementation of the PGM protocol
+  URL:=http://openpgm.googlecode.com/
+  SECTION:=libs
+  CATEGORY:=Libraries
+endef
+
+define Package/openpgm/description
+  OpenPGM is a library implementing the PGM reliable multicast
+  network protocol. For more information about OpenPGM, see:
+  http://openpgm.googlecode.com/
+endef
+
+CONFIGURE_VARS += ac_cv_file__proc_cpuinfo=yes \
+    ac_cv_file__dev_rtc=no ac_cv_file__dev_hpet=no
+CONFIGURE_ARGS += --enable-static=no --enable-shared=yes
+
+define Build/Prepare
+	$(call Build/Prepare/Default)
+	mv $(PKG_BUILD_DIR)/openpgm/pgm/* $(PKG_BUILD_DIR)/
+endef
+
+define Build/InstallDev
+	$(INSTALL_DIR) $(1)/usr/include/pgm
+	$(CP) $(PKG_BUILD_DIR)/include/pgm/* $(1)/usr/include/pgm/
+	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+	$(CP) $(PKG_BUILD_DIR)/.libs/libpgm*.so* $(1)/usr/lib/
+	$(CP) $(PKG_BUILD_DIR)/openpgm-5.3.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/openpgm/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_BUILD_DIR)/.libs/libpgm*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,openpgm))
diff --git a/libs/openpgm/patches/0001-Rename-openpgm-5.2.pc.in.patch b/libs/openpgm/patches/0001-Rename-openpgm-5.2.pc.in.patch
new file mode 100644
index 000000000..a51a026f9
--- /dev/null
+++ b/libs/openpgm/patches/0001-Rename-openpgm-5.2.pc.in.patch
@@ -0,0 +1,22 @@ 
+From 240634b1afb968a051f8c68696eae2a582a02450 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Mon, 31 Aug 2020 20:16:25 +0200
+Subject: [PATCH 1/2] Rename openpgm-5.2.pc.in
+
+This will fix the following build failure:
+
+config.status: error: cannot find input file: `openpgm-5.3.pc.in'
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ openpgm/pgm/{openpgm-5.2.pc.in => openpgm-5.3.pc.in} | 0
+ 1 file changed, 0 insertions(+), 0 deletions(-)
+ rename openpgm/pgm/{openpgm-5.2.pc.in => openpgm-5.3.pc.in} (100%)
+
+diff --git a/openpgm/pgm/openpgm-5.2.pc.in b/openpgm/pgm/openpgm-5.3.pc.in
+similarity index 100%
+rename from openpgm/pgm/openpgm-5.2.pc.in
+rename to openpgm/pgm/openpgm-5.3.pc.in
+-- 
+2.25.1
+
diff --git a/libs/openpgm/patches/0002-openpgm-pgm-checksum.c-fix-build-with-32-bits-MMX.patch b/libs/openpgm/patches/0002-openpgm-pgm-checksum.c-fix-build-with-32-bits-MMX.patch
new file mode 100644
index 000000000..2012021c0
--- /dev/null
+++ b/libs/openpgm/patches/0002-openpgm-pgm-checksum.c-fix-build-with-32-bits-MMX.patch
@@ -0,0 +1,38 @@ 
+From b7fa865fa6b06d97d424c500fd1c4bc44c096359 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sun, 1 Nov 2020 22:46:18 +0100
+Subject: [PATCH 2/2] openpgm/pgm/checksum.c: fix build with 32 bits MMX
+
+Build with i386-pentium-mmx or i686 is broken since version 5-3-128 and
+https://github.com/steve-o/openpgm/commit/b276dc15be5d4e6e1143b9de25d09f63f9c85135
+because _mm_cvtm64_si64 is undefined resulting in the following build
+failure for example on zeromq:
+
+/srv/storage/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/i586-buildroot-linux-musl/8.3.0/../../../../i586-buildroot-linux-musl/bin/ld: /srv/storage/autobuild/run/instance-3/output-1/host/i586-buildroot-linux-musl/sysroot/usr/lib32/libpgm-5.3.so.0: undefined reference to `_mm_cvtm64_si64'
+
+So use the fallback if __x86_64__ is not defined
+
+Fixes:
+ - http://autobuild.buildroot.org/results/01d9be37e8a743307128f53f41785654c9971e1a
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ openpgm/pgm/checksum.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/openpgm/pgm/checksum.c b/openpgm/pgm/checksum.c
+index fef89bc..8d8dd3f 100644
+--- a/openpgm/pgm/checksum.c
++++ b/openpgm/pgm/checksum.c
+@@ -948,7 +948,7 @@ do_csumcpy_mmx (
+ 
+ 		sum = _mm_add_pi32 (sum, lo);
+ 		sum = _mm_add_pi32 (sum, hi);
+-#if 1
++#if defined(__x86_64__)
+ 		*(int64_t*)dst = _mm_cvtm64_si64 (tmp);
+ #else		
+ 		((int*)dst)[1] = _mm_cvtsi64_si32 (tmp);
+-- 
+2.25.1
+