From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 24 Feb 2023 08:25:36 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pVSSW-000Tjs-PD for lore@lore.pengutronix.de; Fri, 24 Feb 2023 08:25:36 +0100 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pVSSW-0003NT-6n; Fri, 24 Feb 2023 08:25:36 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVSRh-0003Mw-Dw; Fri, 24 Feb 2023 08:24:45 +0100 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pVSRf-0078JR-31; Fri, 24 Feb 2023 08:24:44 +0100 Received: from mol by dude05.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pVSRf-0069QM-GS; Fri, 24 Feb 2023 08:24:43 +0100 From: Michael Olbrich To: ptxdist@pengutronix.de Date: Fri, 24 Feb 2023 08:24:43 +0100 Message-Id: <20230224072443.1463800-1-m.olbrich@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230217151700.13618-1-abbotti@mev.co.uk> References: <20230217151700.13618-1-abbotti@mev.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [ptxdist] [APPLIED] libtahu: new package X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Ian Abbott Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false Thanks, applied as 82b302a3540122eda1502acf44d3f971ea5365d0. Michael [sent from post-receive hook] On Fri, 24 Feb 2023 08:24:43 +0100, Ian Abbott wrote: > Includes the C library from the Eclipse Tahu project that provides an > implementation of the Sparkplug specification. This package does not > include the implementations from the Tahu project for other programming > languages other than C. > > Only the dynamic C library is built. > > Signed-off-by: Ian Abbott > Message-Id: <20230217151700.13618-1-abbotti@mev.co.uk> > Signed-off-by: Michael Olbrich > > diff --git a/patches/libtahu-1.0.1/0001-c-core-Makefile-Fixes-for-parallel-make-and-make-lib.patch b/patches/libtahu-1.0.1/0001-c-core-Makefile-Fixes-for-parallel-make-and-make-lib.patch > new file mode 100644 > index 000000000000..602fee06d377 > --- /dev/null > +++ b/patches/libtahu-1.0.1/0001-c-core-Makefile-Fixes-for-parallel-make-and-make-lib.patch > @@ -0,0 +1,34 @@ > +From 6f70eff53d370b96070d1362ebcd4ce153b2a172 Mon Sep 17 00:00:00 2001 > +From: Ian Abbott > +Date: Fri, 17 Feb 2023 10:41:20 +0000 > +Subject: [PATCH] c/core/Makefile: Fixes for parallel make and make > + lib/libtahu.so > + > +Change $(TEST) target to depend on the built library files. > + > +Change $(DNAME) target rules to create the lib directory. > + > +Signed-off-by: Ian Abbott > +--- > + c/core/Makefile | 3 ++- > + 1 file changed, 2 insertions(+), 1 deletion(-) > + > +diff --git a/c/core/Makefile b/c/core/Makefile > +index 8243a67..17c5e3d 100644 > +--- a/c/core/Makefile > ++++ b/c/core/Makefile > +@@ -36,9 +36,10 @@ $(SNAME): $(OBJ) > + > + $(DNAME): LDFLAGS += -shared > + $(DNAME): $(OBJ) > ++ mkdir -p lib > + $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) > + > +-$(TEST): > ++$(TEST): $(SNAME) $(DNAME) > + $(CC) $(CFLAGS) -o test/test_static $(TEST_OBJ) $(SNAME) -lmosquitto > + $(CC) $(CFLAGS) $(LD_TEST) -o test/test_dynamic $(TEST_OBJ) -l$(NAME) -lmosquitto > + > +-- > +2.39.1 > + > diff --git a/patches/libtahu-1.0.1/0002-tahu.h-Do-not-define-SPARKPLUG_DEBUG.patch b/patches/libtahu-1.0.1/0002-tahu.h-Do-not-define-SPARKPLUG_DEBUG.patch > new file mode 100644 > index 000000000000..417cec0981ed > --- /dev/null > +++ b/patches/libtahu-1.0.1/0002-tahu.h-Do-not-define-SPARKPLUG_DEBUG.patch > @@ -0,0 +1,28 @@ > +From cff7b099c23937bad205833ea1e4e8278690eb21 Mon Sep 17 00:00:00 2001 > +From: Ian Abbott > +Date: Fri, 17 Feb 2023 14:40:58 +0000 > +Subject: [PATCH] tahu.h: Do not define SPARKPLUG_DEBUG > + > +If SPARKPLUG_DEBUG is defined in tahu.c, the library will write lots of > +debug messages to standard output. That's OK for experimentation, but > +not for a live system, so comment out the macro definition. > +--- > + c/core/include/tahu.h | 2 +- > + 1 file changed, 1 insertion(+), 1 deletion(-) > + > +diff --git a/c/core/include/tahu.h b/c/core/include/tahu.h > +index e599146..03fbaaa 100644 > +--- a/c/core/include/tahu.h > ++++ b/c/core/include/tahu.h > +@@ -29,7 +29,7 @@ extern "C" { > + #endif > + > + // Enable/disable debug messages > +-#define SPARKPLUG_DEBUG 1 > ++//#define SPARKPLUG_DEBUG 1 > + > + #ifdef SPARKPLUG_DEBUG > + #define DEBUG_PRINT(...) printf(__VA_ARGS__) > +-- > +2.39.1 > + > diff --git a/patches/libtahu-1.0.1/series b/patches/libtahu-1.0.1/series > new file mode 100644 > index 000000000000..31edd1b86205 > --- /dev/null > +++ b/patches/libtahu-1.0.1/series > @@ -0,0 +1,2 @@ > +0001-c-core-Makefile-Fixes-for-parallel-make-and-make-lib.patch > +0002-tahu.h-Do-not-define-SPARKPLUG_DEBUG.patch > diff --git a/rules/libtahu.in b/rules/libtahu.in > new file mode 100644 > index 000000000000..451d409579b5 > --- /dev/null > +++ b/rules/libtahu.in > @@ -0,0 +1,11 @@ > +## SECTION=system_libraries > + > +config LIBTAHU > + tristate > + prompt "libtahu" > + help > + Eclipse Tahu C library for encoding and decoding Sparkplug B > + messages. > + > + A typical application will also require an MQTT library such > + as "mosquitto". > diff --git a/rules/libtahu.make b/rules/libtahu.make > new file mode 100644 > index 000000000000..26c064c6d15d > --- /dev/null > +++ b/rules/libtahu.make > @@ -0,0 +1,83 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2023 by Ian Abbott > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +# > +# We provide this package > +# > +PACKAGES-$(PTXCONF_LIBTAHU) += libtahu > + > +# > +# Paths and names > +# > +LIBTAHU_VERSION := 1.0.1 > +LIBTAHU_MD5 := 7e980ed17e34a78d6d61c000e4957292 > +LIBTAHU := libtahu-$(LIBTAHU_VERSION) > +LIBTAHU_SUFFIX := tar.gz > +LIBTAHU_URL := https://github.com/eclipse/tahu/archive/refs/tags/v$(LIBTAHU_VERSION).$(LIBTAHU_SUFFIX) > +LIBTAHU_SOURCE := $(SRCDIR)/$(LIBTAHU).$(LIBTAHU_SUFFIX) > +LIBTAHU_DIR := $(BUILDDIR)/$(LIBTAHU) > +LIBTAHU_SUBDIR := c/core > +LIBTAHU_LICENSE := EPL-2.0 > +LIBTAHU_LICENSE_FILES := \ > + file://LICENCE;md5=c7cc8aa73fb5717f8291fcec5ce9ed6c \ > + file://notice.html;md5=618d2440fc58e15450a9416cd6804477 > + > +# ---------------------------------------------------------------------------- > +# Prepare > +# ---------------------------------------------------------------------------- > + > +LIBTAHU_CONF_TOOL := NO > + > +# ---------------------------------------------------------------------------- > +# Compile > +# ---------------------------------------------------------------------------- > + > +#LIBTAHU_MAKE_ENV := $(CROSS_ENV) > + > +# Just build the dynamic library. > +LIBTAHU_MAKE_OPT := \ > + $(CROSS_ENV_PROGS) \ > + lib/libtahu.so > + > +# ---------------------------------------------------------------------------- > +# Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/libtahu.install: > + @$(call targetinfo) > + @install -m 644 -v -D -t "$(LIBTAHU_PKGDIR)/usr/lib" \ > + "$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/lib/libtahu.so" > + @install -m 644 -v -D -t "$(LIBTAHU_PKGDIR)/usr/include" \ > + "$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/pb.h" \ > + "$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/pb_common.h" \ > + "$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/pb_decode.h" \ > + "$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/pb_encode.h" \ > + "$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/tahu.h" \ > + "$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/tahu.pb.h" > + @$(call touch) > + > +# ---------------------------------------------------------------------------- > +# Target-Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/libtahu.targetinstall: > + @$(call targetinfo) > + > + @$(call install_init, libtahu) > + @$(call install_fixup, libtahu,PRIORITY,optional) > + @$(call install_fixup, libtahu,SECTION,base) > + @$(call install_fixup, libtahu,AUTHOR,"Ian Abbott ") > + @$(call install_fixup, libtahu,DESCRIPTION,missing) > + > + @$(call install_lib, libtahu, 0, 0, 0644, libtahu) > + > + @$(call install_finish, libtahu) > + > + @$(call touch) > + > +# vim: syntax=make