* [Buildroot] [PATCH] package/zenoh-c: new package
@ 2023-10-18 8:15 Michel Alex
2023-11-01 17:46 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 7+ messages in thread
From: Michel Alex @ 2023-10-18 8:15 UTC (permalink / raw)
To: buildroot@buildroot.org
This package provides a C binding based on the main
Zenoh implementation written in Rust.
https://github.com/eclipse-zenoh/zenoh-c
Signed-off-by: Alex Michel <alex.michel@wiedemann-group.com>
---
package/Config.in | 1 +
package/zenoh-c/Config.in | 9 +++++++++
package/zenoh-c/zenoh-c.hash | 3 +++
package/zenoh-c/zenoh-c.mk | 26 ++++++++++++++++++++++++++
4 files changed, 39 insertions(+)
create mode 100644 package/zenoh-c/Config.in
create mode 100644 package/zenoh-c/zenoh-c.hash
create mode 100644 package/zenoh-c/zenoh-c.mk
diff --git a/package/Config.in b/package/Config.in
index 4e489c4706..a53b7d29b5 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2033,6 +2033,7 @@ menu "Networking"
source "package/usbredir/Config.in"
source "package/wampcc/Config.in"
source "package/websocketpp/Config.in"
+ source "package/zenoh-c/Config.in"
source "package/zeromq/Config.in"
source "package/zmqpp/Config.in"
source "package/zyre/Config.in"
diff --git a/package/zenoh-c/Config.in b/package/zenoh-c/Config.in
new file mode 100644
index 0000000000..cde6135356
--- /dev/null
+++ b/package/zenoh-c/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_ZENOH_C
+ bool "zenoh-c"
+ depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+ select BR2_PACKAGE_HOST_RUSTC
+ help
+ This package provides a C binding based on the main
+ Zenoh implementation written in Rust.
+
+ https://github.com/eclipse-zenoh/zenoh-c
diff --git a/package/zenoh-c/zenoh-c.hash b/package/zenoh-c/zenoh-c.hash
new file mode 100644
index 0000000000..c343c464b4
--- /dev/null
+++ b/package/zenoh-c/zenoh-c.hash
@@ -0,0 +1,3 @@
+# Locally computed
+sha256 9a61829a117526d1a6d92382dd989cee65bfac75d3c06a6b27250580c4ca6dd7 zenoh-c-0.10.0-rc.tar.gz
+sha256 01a44774f7b1a453595c7c6d7f7308284ba6a1059dc49e14dad6647e1d44a338 LICENSE
diff --git a/package/zenoh-c/zenoh-c.mk b/package/zenoh-c/zenoh-c.mk
new file mode 100644
index 0000000000..cbfece8068
--- /dev/null
+++ b/package/zenoh-c/zenoh-c.mk
@@ -0,0 +1,26 @@
+################################################################################
+#
+# zenoh-c
+#
+################################################################################
+
+ZENOH_C_VERSION = 0.10.0-rc
+ZENOH_C_SITE = $(call github,eclipse-zenoh,zenoh-c,$(ZENOH_C_VERSION))
+ZENOH_C_LICENSE = EPL-2.0
+ZENOH_C_LICENSE_FILES = LICENSE
+
+# Install default config file
+define ZENOH_C_INSTALL_FILES
+ $(INSTALL) -D -m 644 $(@D)/target/*/release/libzenohc.so $(TARGET_DIR)/usr/lib/
+ $(INSTALL) -D -m 644 $(@D)/include/* $(STAGING_DIR)/usr/include/
+endef
+ZENOH_C_POST_INSTALL_TARGET_HOOKS += ZENOH_C_INSTALL_FILES
+
+# no install step necessary because it is not possible to install libraries using cargo command
+# library and header files are installed above
+define ZENOH_C_INSTALL_TARGET_CMDS
+ # empty
+endef
+
+$(eval $(cargo-package))
+
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH] package/zenoh-c: new package
2023-10-18 8:15 [Buildroot] [PATCH] package/zenoh-c: new package Michel Alex
@ 2023-11-01 17:46 ` Thomas Petazzoni via buildroot
2023-11-06 9:53 ` Michel Alex
0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-11-01 17:46 UTC (permalink / raw)
To: Michel Alex; +Cc: buildroot@buildroot.org
Hello Alex,
On Wed, 18 Oct 2023 08:15:28 +0000
Michel Alex <Alex.Michel@wiedemann-group.com> wrote:
> This package provides a C binding based on the main
> Zenoh implementation written in Rust.
>
> https://github.com/eclipse-zenoh/zenoh-c
>
> Signed-off-by: Alex Michel <alex.michel@wiedemann-group.com>
Thanks for this contribution.
> package/Config.in | 1 +
> package/zenoh-c/Config.in | 9 +++++++++
> package/zenoh-c/zenoh-c.hash | 3 +++
> package/zenoh-c/zenoh-c.mk | 26 ++++++++++++++++++++++++++
> 4 files changed, 39 insertions(+)
Entry in the DEVELOPERS file is missing.
> +ZENOH_C_VERSION = 0.10.0-rc
> +ZENOH_C_SITE = $(call github,eclipse-zenoh,zenoh-c,$(ZENOH_C_VERSION))
> +ZENOH_C_LICENSE = EPL-2.0
License is:
Apache-2.0 or EPL-2.0
> +ZENOH_C_LICENSE_FILES = LICENSE
> +
> +# Install default config file
> +define ZENOH_C_INSTALL_FILES
> + $(INSTALL) -D -m 644 $(@D)/target/*/release/libzenohc.so $(TARGET_DIR)/usr/lib/
> + $(INSTALL) -D -m 644 $(@D)/include/* $(STAGING_DIR)/usr/include/
Meh, you're installing things to staging in the post install target
hook. Also, the shared library should also be installed to staging.
> +endef
> +ZENOH_C_POST_INSTALL_TARGET_HOOKS += ZENOH_C_INSTALL_FILES
> +
> +# no install step necessary because it is not possible to install libraries using cargo command
> +# library and header files are installed above
> +define ZENOH_C_INSTALL_TARGET_CMDS
> + # empty
> +endef
Then what you should do is:
define ZENOH_C_INSTALL_FILES
$(INSTALL) -D -m 644 $(@D)/target/*/release/libzenohc.so $(1)/usr/lib/libzenohc.so
mkdir -p $(STAGING_DIR)/usr/include/
cp -dpfr $(@D)/include/* $(STAGING_DIR)/usr/include/
endif
define ZENOH_C_INSTALL_TARGET_CMDS
$(call ZENOH_C_INSTALL_FILES,$(TARGET_DIR))
endef
define ZENOH_C_INSTALL_STAGING_CMDS
$(call ZENOH_C_INSTALL_FILES,$(STAGING_DIR))
endef
However, I have some other questions:
- You're using cargo to build this package, but at
https://github.com/eclipse-zenoh/zenoh-c they suggest to use CMake.
Any opinion on this?
- When using cargo to build,
https://github.com/eclipse-zenoh/zenoh-c/blob/master/Cargo.toml is
used, and I'm worried by the following lines:
zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "master", features = [ "shared-memory", "unstable" ] }
zenoh-protocol = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "master", features = [ "shared-memory" ] }
zenoh-util = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "master" }
I'm not too familiar with Cargo, but to me this looks like it is
going to pull the latest "master" branch of zenoh, zenoh-protocol,
zenoh-util. So it means that the build of zenoh-c is not
reproducible, as you will pull different things from those master
branches depending on when you do your build. Could you comment on
this?
Thanks a lot!
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] 7+ messages in thread
* Re: [Buildroot] [PATCH] package/zenoh-c: new package
2023-11-01 17:46 ` Thomas Petazzoni via buildroot
@ 2023-11-06 9:53 ` Michel Alex
2024-03-01 9:56 ` [Buildroot] [PATCH v3] package/libzenoh-c: " Michel Alex
0 siblings, 1 reply; 7+ messages in thread
From: Michel Alex @ 2023-11-06 9:53 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot@buildroot.org
Hello Thomas,
I fixed all issues you found in my first patch and there is the second version of my patch in the end of this email:
-----Original Message-----
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Sent: Wednesday, November 1, 2023 6:47 PM
To: Michel Alex <Alex.Michel@wiedemann-group.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/zenoh-c: new package
> However, I have some other questions:
>
> - You're using cargo to build this package, but at
> https://github.com/eclipse-zenoh/zenoh-c they suggest to use CMake.
> Any opinion on this?
When using CMake, I have to additionally specify some RUSTFLAGS which are needed for cross compilation,
because the cmake uses rustc command to build the package:
ZENOH_C_CONF_ENV = RUSTFLAGS="-Clinker=arm-linux-gnueabihf-gcc -Car=arm-linux-gnueabihf-ar"
ZENOH_C_MAKE_ENV = RUSTFLAGS="-Clinker=arm-linux-gnueabihf-gcc -Car=arm-linux-gnueabihf-ar"
ZENOH_C_CONF_OPTS = -DZENOHC_CUSTOM_TARGET="arm-unknown-linux-gnueabihf"
All the 3 lines are passed automatically when building with cargo infrastructure.
> - When using cargo to build,
> https://github.com/eclipse-zenoh/zenoh-c/blob/master/Cargo.toml is
> used, and I'm worried by the following lines:
>
> zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "master", features = [ "shared-memory", "unstable" ] } zenoh-protocol = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "master", features = [ "shared-memory" ] } zenoh-util = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "master" }
Please look at the 0.10.0-rc version instead of master as you did -> https://github.com/eclipse-zenoh/zenoh-c/blob/0.10.0-rc/Cargo.toml
zenoh = { version = "0.10.0-rc", features = [ "shared-memory", "unstable" ] }
zenoh-protocol = { version = "0.10.0-rc", features = [ "shared-memory" ] }
zenoh-util = { version = "0.10.0-rc" }
Here is the patch:
From 9e7425a785d87fd177a0541802b24772df3fc466 Mon Sep 17 00:00:00 2001
From: Alex Michel <alex.michel@wiedemann-group.com>
Date: Wed, 18 Oct 2023 10:05:57 +0200
Subject: [PATCH v2] package/libzenoh-c: new package
This package provides a C binding based on the main
Zenoh implementation written in Rust.
https://github.com/eclipse-zenoh/zenoh-c
Signed-off-by: Alex Michel <alex.michel@wiedemann-group.com>
---
Changes v1 -> v2:
- renamed zenoh-c to libzenoh-c
- added myself to DEVELOPERS
- fixed LICENSE
- install shared libraries to staging and to target
---
DEVELOPERS | 1 +
package/Config.in | 1 +
package/libzenoh-c/Config.in | 9 +++++++++
package/libzenoh-c/libzenoh-c.hash | 3 +++
package/libzenoh-c/libzenoh-c.mk | 26 ++++++++++++++++++++++++++
5 files changed, 40 insertions(+)
create mode 100644 package/libzenoh-c/Config.in
create mode 100644 package/libzenoh-c/libzenoh-c.hash
create mode 100644 package/libzenoh-c/libzenoh-c.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index ac277423a1..08c3d9a5a1 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -75,6 +75,7 @@ N: Alessandro Partesotti <a.partesotti@gmail.com>
F: package/oatpp/
N: Alex Michel <alex.michel@wiedemann-group.com>
+F: package/libzenoh-c/
F: package/libzenoh-pico/
F: package/network-manager-openvpn/
diff --git a/package/Config.in b/package/Config.in
index cd687a682b..af1ee30585 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1996,6 +1996,7 @@ menu "Networking"
source "package/libwebsock/Config.in"
source "package/libwebsockets/Config.in"
source "package/libyang/Config.in"
+ source "package/libzenoh-c/Config.in"
source "package/libzenoh-pico/Config.in"
source "package/lksctp-tools/Config.in"
source "package/mbuffer/Config.in"
diff --git a/package/libzenoh-c/Config.in b/package/libzenoh-c/Config.in
new file mode 100644
index 0000000000..d22807c047
--- /dev/null
+++ b/package/libzenoh-c/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_LIBZENOH_C
+ bool "libzenoh-c"
+ depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+ select BR2_PACKAGE_HOST_RUSTC
+ help
+ This package provides a C binding based on the main
+ Zenoh implementation written in Rust.
+
+ https://github.com/eclipse-zenoh/zenoh-c
diff --git a/package/libzenoh-c/libzenoh-c.hash b/package/libzenoh-c/libzenoh-c.hash
new file mode 100644
index 0000000000..4a7da25233
--- /dev/null
+++ b/package/libzenoh-c/libzenoh-c.hash
@@ -0,0 +1,3 @@
+# Locally computed
+sha256 43c77a6768439681e804c8f02627dcb293f6ebec22d5c67ceb50d42f6c7badda libzenoh-c-0.10.0-rc.tar.gz
+sha256 01a44774f7b1a453595c7c6d7f7308284ba6a1059dc49e14dad6647e1d44a338 LICENSE
diff --git a/package/libzenoh-c/libzenoh-c.mk b/package/libzenoh-c/libzenoh-c.mk
new file mode 100644
index 0000000000..b1452c1a97
--- /dev/null
+++ b/package/libzenoh-c/libzenoh-c.mk
@@ -0,0 +1,26 @@
+################################################################################
+#
+# libzenoh-c
+#
+################################################################################
+
+LIBZENOH_C_VERSION = 0.10.0-rc
+LIBZENOH_C_SITE = $(call github,eclipse-zenoh,zenoh-c,$(LIBZENOH_C_VERSION))
+LIBZENOH_C_LICENSE = Apache-2.0 or EPL-2.0
+LIBZENOH_C_LICENSE_FILES = LICENSE
+
+define LIBZENOH_C_INSTALL_FILES
+ $(INSTALL) -D -m 644 $(@D)/target/*/release/libzenohc.so $(1)/usr/lib/libzenohc.so
+ mkdir -p $(STAGING_DIR)/usr/include/
+ cp -dpfr $(@D)/include/* $(STAGING_DIR)/usr/include/
+endef
+
+define LIBZENOH_C_INSTALL_TARGET_CMDS
+ $(call LIBZENOH_C_INSTALL_FILES,$(TARGET_DIR))
+endef
+
+define LIBZENOH_C_INSTALL_STAGING_CMDS
+ $(call LIBZENOH_C_INSTALL_FILES,$(STAGING_DIR))
+endef
+
+$(eval $(cargo-package))
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH v3] package/libzenoh-c: new package
2023-11-06 9:53 ` Michel Alex
@ 2024-03-01 9:56 ` Michel Alex
2024-03-01 17:49 ` Yann E. MORIN
0 siblings, 1 reply; 7+ messages in thread
From: Michel Alex @ 2024-03-01 9:56 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot@buildroot.org
This package provides a C binding based on the main
Zenoh implementation written in Rust.
https://github.com/eclipse-zenoh/zenoh-c
Signed-off-by: Alex Michel <alex.michel@wiedemann-group.com>
---
Changes v2 -> v3:
- bump package to 0.10.1-rc
- set INSTALL_STAGING
Changes v1 -> v2:
- renamed zenoh-c to libzenoh-c
- added myself to DEVELOPERS
- fixed LICENSE
- install shared libraries to staging and to target
---
DEVELOPERS | 1 +
package/Config.in | 1 +
package/libzenoh-c/Config.in | 9 +++++++++
package/libzenoh-c/libzenoh-c.hash | 3 +++
package/libzenoh-c/libzenoh-c.mk | 27 +++++++++++++++++++++++++++
5 files changed, 41 insertions(+)
create mode 100644 package/libzenoh-c/Config.in
create mode 100644 package/libzenoh-c/libzenoh-c.hash
create mode 100644 package/libzenoh-c/libzenoh-c.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index ac277423a1..08c3d9a5a1 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -75,6 +75,7 @@ N: Alessandro Partesotti <a.partesotti@gmail.com>
F: package/oatpp/
N: Alex Michel <alex.michel@wiedemann-group.com>
+F: package/libzenoh-c/
F: package/libzenoh-pico/
F: package/network-manager-openvpn/
diff --git a/package/Config.in b/package/Config.in
index cd687a682b..af1ee30585 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1996,6 +1996,7 @@ menu "Networking"
source "package/libwebsock/Config.in"
source "package/libwebsockets/Config.in"
source "package/libyang/Config.in"
+ source "package/libzenoh-c/Config.in"
source "package/libzenoh-pico/Config.in"
source "package/lksctp-tools/Config.in"
source "package/mbuffer/Config.in"
diff --git a/package/libzenoh-c/Config.in b/package/libzenoh-c/Config.in
new file mode 100644
index 0000000000..d22807c047
--- /dev/null
+++ b/package/libzenoh-c/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_LIBZENOH_C
+ bool "libzenoh-c"
+ depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+ select BR2_PACKAGE_HOST_RUSTC
+ help
+ This package provides a C binding based on the main
+ Zenoh implementation written in Rust.
+
+ https://github.com/eclipse-zenoh/zenoh-c
diff --git a/package/libzenoh-c/libzenoh-c.hash b/package/libzenoh-c/libzenoh-c.hash
new file mode 100644
index 0000000000..8c93a7a091
--- /dev/null
+++ b/package/libzenoh-c/libzenoh-c.hash
@@ -0,0 +1,3 @@
+# Locally computed
+sha256 3ede587dd08ccd6b0b7f0b44faeefa466eb5e18826db0b1cd93c51ffc59377ec libzenoh-c-0.10.1-rc.tar.gz
+sha256 01a44774f7b1a453595c7c6d7f7308284ba6a1059dc49e14dad6647e1d44a338 LICENSE
diff --git a/package/libzenoh-c/libzenoh-c.mk b/package/libzenoh-c/libzenoh-c.mk
new file mode 100644
index 0000000000..738758e13f
--- /dev/null
+++ b/package/libzenoh-c/libzenoh-c.mk
@@ -0,0 +1,27 @@
+################################################################################
+#
+# libzenoh-c
+#
+################################################################################
+
+LIBZENOH_C_VERSION = 0.10.1-rc
+LIBZENOH_C_SITE = $(call github,eclipse-zenoh,zenoh-c,$(LIBZENOH_C_VERSION))
+LIBZENOH_C_LICENSE = Apache-2.0 or EPL-2.0
+LIBZENOH_C_LICENSE_FILES = LICENSE
+LIBZENOH_C_INSTALL_STAGING = YES
+
+define LIBZENOH_C_INSTALL_FILES
+ $(INSTALL) -D -m 644 $(@D)/target/*/release/libzenohc.so $(1)/usr/lib/libzenohc.so
+ mkdir -p $(STAGING_DIR)/usr/include/
+ cp -dpfr $(@D)/include/* $(STAGING_DIR)/usr/include/
+endef
+
+define LIBZENOH_C_INSTALL_TARGET_CMDS
+ $(call LIBZENOH_C_INSTALL_FILES,$(TARGET_DIR))
+endef
+
+define LIBZENOH_C_INSTALL_STAGING_CMDS
+ $(call LIBZENOH_C_INSTALL_FILES,$(STAGING_DIR))
+endef
+
+$(eval $(cargo-package))
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH v3] package/libzenoh-c: new package
2024-03-01 9:56 ` [Buildroot] [PATCH v3] package/libzenoh-c: " Michel Alex
@ 2024-03-01 17:49 ` Yann E. MORIN
2024-03-06 13:19 ` Michel Alex
0 siblings, 1 reply; 7+ messages in thread
From: Yann E. MORIN @ 2024-03-01 17:49 UTC (permalink / raw)
To: Michel Alex; +Cc: Thomas Petazzoni, buildroot@buildroot.org
Michel, All,
Thanks for this new iteration. Howeve, I have some comments and
questions, see bewlow...
On 2024-03-01 09:56 +0000, Michel Alex spake thusly:
> This package provides a C binding based on the main
> Zenoh implementation written in Rust.
>
> https://github.com/eclipse-zenoh/zenoh-c
Having _just_ the description of the package in the commit log is not
that interesting, especially as it is just a copy of the description
in the help text.
The commit log is there to explain the change; it is meant to help
reviewers (and maintainers) assess the quality of the change.
In htis case, what would have been interesting to have in the commit
log, is the explanations on why you had to override the install
commands, rather than use thje default ones provided by the
cargo-package infra, that are supposed to cover the vast majority of
cases; diverging from that should be explained.
See other comments, below...
> Signed-off-by: Alex Michel <alex.michel@wiedemann-group.com>
> ---
> Changes v2 -> v3:
> - bump package to 0.10.1-rc
> - set INSTALL_STAGING
>
> Changes v1 -> v2:
> - renamed zenoh-c to libzenoh-c
> - added myself to DEVELOPERS
> - fixed LICENSE
> - install shared libraries to staging and to target
Thanks for the changelog, that's very good and much appreciated! 👍
> ---
> DEVELOPERS | 1 +
> package/Config.in | 1 +
> package/libzenoh-c/Config.in | 9 +++++++++
> package/libzenoh-c/libzenoh-c.hash | 3 +++
> package/libzenoh-c/libzenoh-c.mk | 27 +++++++++++++++++++++++++++
> 5 files changed, 41 insertions(+)
> create mode 100644 package/libzenoh-c/Config.in
> create mode 100644 package/libzenoh-c/libzenoh-c.hash
> create mode 100644 package/libzenoh-c/libzenoh-c.mk
>
> diff --git a/DEVELOPERS b/DEVELOPERS
> index ac277423a1..08c3d9a5a1 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -75,6 +75,7 @@ N: Alessandro Partesotti <a.partesotti@gmail.com>
> F: package/oatpp/
>
> N: Alex Michel <alex.michel@wiedemann-group.com>
> +F: package/libzenoh-c/
Normally, this file is indented with TABs, but your mail only contains
spaces. Not sure how you are sending it, but using git send-email
ensures it is properly sent.
Of course, that means the patch does not apply...
> F: package/libzenoh-pico/
> F: package/network-manager-openvpn/
>
> diff --git a/package/Config.in b/package/Config.in
> index cd687a682b..af1ee30585 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1996,6 +1996,7 @@ menu "Networking"
> source "package/libwebsock/Config.in"
> source "package/libwebsockets/Config.in"
> source "package/libyang/Config.in"
> + source "package/libzenoh-c/Config.in"
> source "package/libzenoh-pico/Config.in"
> source "package/lksctp-tools/Config.in"
> source "package/mbuffer/Config.in"
Ditto, this file is TAB-indented.
> diff --git a/package/libzenoh-c/Config.in b/package/libzenoh-c/Config.in
> new file mode 100644
> index 0000000000..d22807c047
> --- /dev/null
> +++ b/package/libzenoh-c/Config.in
> @@ -0,0 +1,9 @@
> +config BR2_PACKAGE_LIBZENOH_C
> + bool "libzenoh-c"
> + depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> + select BR2_PACKAGE_HOST_RUSTC
> + help
> + This package provides a C binding based on the main
> + Zenoh implementation written in Rust.
> +
> + https://github.com/eclipse-zenoh/zenoh-c
Leading TABs are missing here as well... :-/
> diff --git a/package/libzenoh-c/libzenoh-c.hash b/package/libzenoh-c/libzenoh-c.hash
> new file mode 100644
> index 0000000000..8c93a7a091
> --- /dev/null
> +++ b/package/libzenoh-c/libzenoh-c.hash
> @@ -0,0 +1,3 @@
> +# Locally computed
> +sha256 3ede587dd08ccd6b0b7f0b44faeefa466eb5e18826db0b1cd93c51ffc59377ec libzenoh-c-0.10.1-rc.tar.gz
> +sha256 01a44774f7b1a453595c7c6d7f7308284ba6a1059dc49e14dad6647e1d44a338 LICENSE
> diff --git a/package/libzenoh-c/libzenoh-c.mk b/package/libzenoh-c/libzenoh-c.mk
> new file mode 100644
> index 0000000000..738758e13f
> --- /dev/null
> +++ b/package/libzenoh-c/libzenoh-c.mk
> @@ -0,0 +1,27 @@
> +################################################################################
> +#
> +# libzenoh-c
> +#
> +################################################################################
> +
> +LIBZENOH_C_VERSION = 0.10.1-rc
> +LIBZENOH_C_SITE = $(call github,eclipse-zenoh,zenoh-c,$(LIBZENOH_C_VERSION))
> +LIBZENOH_C_LICENSE = Apache-2.0 or EPL-2.0
> +LIBZENOH_C_LICENSE_FILES = LICENSE
> +LIBZENOH_C_INSTALL_STAGING = YES
> +
> +define LIBZENOH_C_INSTALL_FILES
> + $(INSTALL) -D -m 644 $(@D)/target/*/release/libzenohc.so $(1)/usr/lib/libzenohc.so
Please wrap the long lines so they are below the 80-ish char length:
$(INSTALL) -D -m 644 \
$(@D)/target/*/release/libzenohc.so \
$(1)/usr/lib/libzenohc.so
Also, I think the 'release' path component will change when
BR2_ENABLE_DEBUG=y, as we do not pass --release in that case.
Aslo, why do we need a '*' path component? Since the destination is a
single file, we do only expect ne inout file, so the '*' is expected to
match a single directory, which we should have a way to know. Can you
explain that as well, please?
> + mkdir -p $(STAGING_DIR)/usr/include/
> + cp -dpfr $(@D)/include/* $(STAGING_DIR)/usr/include/
> +endef
This macro is expanded in the INSTALL_TARGET case, which means files
will be installed to staging during the target install. That does not
look right.
So, assuming those overrides are needed (as will be explained in the
commit log ;-)), the shared macro should only be concerned about
installing the common set of files, i.e. the .so files.
The files only installed in staging should be installed with
_INSTALL_STAGING_CMDS.
Regards,
Yann E. MORIN.
> +define LIBZENOH_C_INSTALL_TARGET_CMDS
> + $(call LIBZENOH_C_INSTALL_FILES,$(TARGET_DIR))
> +endef
> +
> +define LIBZENOH_C_INSTALL_STAGING_CMDS
> + $(call LIBZENOH_C_INSTALL_FILES,$(STAGING_DIR))
> +endef
> +
> +$(eval $(cargo-package))
> --
> 2.34.1
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH v3] package/libzenoh-c: new package
2024-03-01 17:49 ` Yann E. MORIN
@ 2024-03-06 13:19 ` Michel Alex
2024-04-16 10:03 ` [Buildroot] [PATCH v4] " Michel Alex
0 siblings, 1 reply; 7+ messages in thread
From: Michel Alex @ 2024-03-06 13:19 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: Thomas Petazzoni, buildroot@buildroot.org
[-- Attachment #1: Type: text/plain, Size: 2245 bytes --]
Yann,
thanks for your comments. See my answer below:
>
> > ---
> > DEVELOPERS | 1 +
> > package/Config.in | 1 +
> > package/libzenoh-c/Config.in | 9 +++++++++
> > package/libzenoh-c/libzenoh-c.hash | 3 +++
> > package/libzenoh-c/libzenoh-c.mk | 27 +++++++++++++++++++++++++++
> > 5 files changed, 41 insertions(+)
> > create mode 100644 package/libzenoh-c/Config.in create mode 100644
> > package/libzenoh-c/libzenoh-c.hash
> > create mode 100644 package/libzenoh-c/libzenoh-c.mk
> >
> > diff --git a/DEVELOPERS b/DEVELOPERS
> > index ac277423a1..08c3d9a5a1 100644
> > --- a/DEVELOPERS
> > +++ b/DEVELOPERS
> > @@ -75,6 +75,7 @@ N: Alessandro Partesotti <a.partesotti@gmail.com>
> > F: package/oatpp/
> >
> > N: Alex Michel <alex.michel@wiedemann-group.com>
> > +F: package/libzenoh-c/
>
> Normally, this file is indented with TABs, but your mail only contains spaces. Not
> sure how you are sending it, but using git send-email ensures it is properly sent.
>
Sorry but I am not allowed to use git send-email command, I have to use Outlook instead.
Perhaps outlook auto-corrects all indentation to whitespaces, I don't know. I will provide
the next version of my patch as attachment to this email.
>
> $(INSTALL) -D -m 644 \
> $(@D)/target/*/release/libzenohc.so \
> $(1)/usr/lib/libzenohc.so
>
> Also, I think the 'release' path component will change when
> BR2_ENABLE_DEBUG=y, as we do not pass --release in that case.
>
> Aslo, why do we need a '*' path component? Since the destination is a single file,
> we do only expect ne inout file, so the '*' is expected to match a single directory,
> which we should have a way to know. Can you explain that as well, please?
Fixed, use now BR2_ENABLE_DEBUG and RUSTC_TARGET_NAME variables.
>
> > + mkdir -p $(STAGING_DIR)/usr/include/
> > + cp -dpfr $(@D)/include/* $(STAGING_DIR)/usr/include/ endef
>
> This macro is expanded in the INSTALL_TARGET case, which means files will be
> installed to staging during the target install. That does not look right.
>
Fixed.
See attachment, thanks.
Regards,
Alex
[-- Attachment #2: v4-0001-package-libzenoh-c-new-package.patch --]
[-- Type: application/octet-stream, Size: 4709 bytes --]
From 929209cc47e2937c494cb0d6b0ad48f70da48a49 Mon Sep 17 00:00:00 2001
From: Alex Michel <alex.michel@wiedemann-group.com>
Date: Wed, 18 Oct 2023 10:05:57 +0200
Subject: [PATCH v4] package/libzenoh-c: new package
This package provides a C binding based on the main
Zenoh implementation written in Rust.
Because this lib does not provide any binaries or examples,
and the cargo infra does not provide any possibility to
disable the --bins option in cargo install step, we
have to override the INSTALL_STAGING_CMDS and the
INSTALL_TARGET_CMDS macros to prevent failing of the
buildroot installation step.
https://github.com/eclipse-zenoh/zenoh-c
Signed-off-by: Alex Michel <alex.michel@wiedemann-group.com>
---
Changes v3 -> v4:
- wrapped long lines to 80 characters
- use BR2_ENABLE_DEBUG variable instead of "release" path component
- use RUSTC_TARGET_NAME variable instead of "*" path component
- shared macro installs only the common set of files
- INSTALL_TARGET_CMDS installs only the lib
- INSTALL_STAGING_CMDS installs both the lib and include files
Changes v2 -> v3:
- bump package to 0.10.1-rc
- set INSTALL_STAGING
Changes v1 -> v2:
- renamed zenoh-c to libzenoh-c
- added myself to DEVELOPERS
- fixed LICENSE
- install shared libraries to staging and to target
---
DEVELOPERS | 1 +
package/Config.in | 1 +
package/libzenoh-c/Config.in | 9 ++++++++
package/libzenoh-c/libzenoh-c.hash | 3 +++
package/libzenoh-c/libzenoh-c.mk | 35 ++++++++++++++++++++++++++++++
5 files changed, 49 insertions(+)
create mode 100644 package/libzenoh-c/Config.in
create mode 100644 package/libzenoh-c/libzenoh-c.hash
create mode 100644 package/libzenoh-c/libzenoh-c.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index ac277423a1..08c3d9a5a1 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -75,6 +75,7 @@ N: Alessandro Partesotti <a.partesotti@gmail.com>
F: package/oatpp/
N: Alex Michel <alex.michel@wiedemann-group.com>
+F: package/libzenoh-c/
F: package/libzenoh-pico/
F: package/network-manager-openvpn/
diff --git a/package/Config.in b/package/Config.in
index cd687a682b..af1ee30585 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1996,6 +1996,7 @@ menu "Networking"
source "package/libwebsock/Config.in"
source "package/libwebsockets/Config.in"
source "package/libyang/Config.in"
+ source "package/libzenoh-c/Config.in"
source "package/libzenoh-pico/Config.in"
source "package/lksctp-tools/Config.in"
source "package/mbuffer/Config.in"
diff --git a/package/libzenoh-c/Config.in b/package/libzenoh-c/Config.in
new file mode 100644
index 0000000000..d22807c047
--- /dev/null
+++ b/package/libzenoh-c/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_LIBZENOH_C
+ bool "libzenoh-c"
+ depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+ select BR2_PACKAGE_HOST_RUSTC
+ help
+ This package provides a C binding based on the main
+ Zenoh implementation written in Rust.
+
+ https://github.com/eclipse-zenoh/zenoh-c
diff --git a/package/libzenoh-c/libzenoh-c.hash b/package/libzenoh-c/libzenoh-c.hash
new file mode 100644
index 0000000000..8c93a7a091
--- /dev/null
+++ b/package/libzenoh-c/libzenoh-c.hash
@@ -0,0 +1,3 @@
+# Locally computed
+sha256 3ede587dd08ccd6b0b7f0b44faeefa466eb5e18826db0b1cd93c51ffc59377ec libzenoh-c-0.10.1-rc.tar.gz
+sha256 01a44774f7b1a453595c7c6d7f7308284ba6a1059dc49e14dad6647e1d44a338 LICENSE
diff --git a/package/libzenoh-c/libzenoh-c.mk b/package/libzenoh-c/libzenoh-c.mk
new file mode 100644
index 0000000000..0ad81f3e41
--- /dev/null
+++ b/package/libzenoh-c/libzenoh-c.mk
@@ -0,0 +1,35 @@
+################################################################################
+#
+# libzenoh-c
+#
+################################################################################
+
+LIBZENOH_C_VERSION = 0.10.1-rc
+LIBZENOH_C_SITE = $(call github,eclipse-zenoh,zenoh-c,$(LIBZENOH_C_VERSION))
+LIBZENOH_C_LICENSE = Apache-2.0 or EPL-2.0
+LIBZENOH_C_LICENSE_FILES = LICENSE
+LIBZENOH_C_INSTALL_STAGING = YES
+
+ifeq ($(BR2_ENABLE_DEBUG),y)
+LIBZENOH_C_LIB_LOCATION = $(@D)/target/$(RUSTC_TARGET_NAME)/debug
+else
+LIBZENOH_C_LIB_LOCATION = $(@D)/target/$(RUSTC_TARGET_NAME)/release
+endif
+
+define LIBZENOH_C_INSTALL_FILES
+ $(INSTALL) -D -m 644 \
+ $(LIBZENOH_C_LIB_LOCATION)/libzenohc.so \
+ $(1)/usr/lib/libzenohc.so
+endef
+
+define LIBZENOH_C_INSTALL_TARGET_CMDS
+ $(call LIBZENOH_C_INSTALL_FILES,$(TARGET_DIR))
+endef
+
+define LIBZENOH_C_INSTALL_STAGING_CMDS
+ $(call LIBZENOH_C_INSTALL_FILES,$(STAGING_DIR))
+ mkdir -p $(STAGING_DIR)/usr/include/
+ cp -dpfr $(@D)/include/* $(STAGING_DIR)/usr/include/
+endef
+
+$(eval $(cargo-package))
--
2.34.1
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH v4] package/libzenoh-c: new package
2024-03-06 13:19 ` Michel Alex
@ 2024-04-16 10:03 ` Michel Alex
0 siblings, 0 replies; 7+ messages in thread
From: Michel Alex @ 2024-04-16 10:03 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: Thomas Petazzoni, buildroot@buildroot.org
Hello,
I'm not sure if you received my last email with new version of my patch as attachment. Below you can find it as plain text. Sorry for that, but I have to use outlook as email client and not allowed to use git send mail. Please let me know if any further changes are necessary.
Here is the patch:
This package provides a C binding based on the main
Zenoh implementation written in Rust.
Because this lib does not provide any binaries or examples,
and the cargo infra does not provide any possibility to
disable the --bins option in cargo install step, we
have to override the INSTALL_STAGING_CMDS and the
INSTALL_TARGET_CMDS macros to prevent failing of the
buildroot installation step.
https://github.com/eclipse-zenoh/zenoh-c
Signed-off-by: Alex Michel <alex.michel@wiedemann-group.com>
---
Changes v3 -> v4:
- wrapped long lines to 80 characters
- use BR2_ENABLE_DEBUG variable instead of "release" path component
- use RUSTC_TARGET_NAME variable instead of "*" path component
- shared macro installs only the common set of files
- INSTALL_TARGET_CMDS installs only the lib
- INSTALL_STAGING_CMDS installs both the lib and include files
Changes v2 -> v3:
- bump package to 0.10.1-rc
- set INSTALL_STAGING
Changes v1 -> v2:
- renamed zenoh-c to libzenoh-c
- added myself to DEVELOPERS
- fixed LICENSE
- install shared libraries to staging and to target
---
DEVELOPERS | 1 +
package/Config.in | 1 +
package/libzenoh-c/Config.in | 9 ++++++++
package/libzenoh-c/libzenoh-c.hash | 3 +++
package/libzenoh-c/libzenoh-c.mk | 35 ++++++++++++++++++++++++++++++
5 files changed, 49 insertions(+)
create mode 100644 package/libzenoh-c/Config.in
create mode 100644 package/libzenoh-c/libzenoh-c.hash
create mode 100644 package/libzenoh-c/libzenoh-c.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index ac277423a1..08c3d9a5a1 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -75,6 +75,7 @@ N: Alessandro Partesotti <a.partesotti@gmail.com>
F: package/oatpp/
N: Alex Michel <alex.michel@wiedemann-group.com>
+F: package/libzenoh-c/
F: package/libzenoh-pico/
F: package/network-manager-openvpn/
diff --git a/package/Config.in b/package/Config.in
index cd687a682b..af1ee30585 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1996,6 +1996,7 @@ menu "Networking"
source "package/libwebsock/Config.in"
source "package/libwebsockets/Config.in"
source "package/libyang/Config.in"
+ source "package/libzenoh-c/Config.in"
source "package/libzenoh-pico/Config.in"
source "package/lksctp-tools/Config.in"
source "package/mbuffer/Config.in"
diff --git a/package/libzenoh-c/Config.in b/package/libzenoh-c/Config.in
new file mode 100644
index 0000000000..d22807c047
--- /dev/null
+++ b/package/libzenoh-c/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_LIBZENOH_C
+ bool "libzenoh-c"
+ depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+ select BR2_PACKAGE_HOST_RUSTC
+ help
+ This package provides a C binding based on the main
+ Zenoh implementation written in Rust.
+
+ https://github.com/eclipse-zenoh/zenoh-c
diff --git a/package/libzenoh-c/libzenoh-c.hash b/package/libzenoh-c/libzenoh-c.hash
new file mode 100644
index 0000000000..8c93a7a091
--- /dev/null
+++ b/package/libzenoh-c/libzenoh-c.hash
@@ -0,0 +1,3 @@
+# Locally computed
+sha256 3ede587dd08ccd6b0b7f0b44faeefa466eb5e18826db0b1cd93c51ffc59377ec libzenoh-c-0.10.1-rc.tar.gz
+sha256 01a44774f7b1a453595c7c6d7f7308284ba6a1059dc49e14dad6647e1d44a338 LICENSE
diff --git a/package/libzenoh-c/libzenoh-c.mk b/package/libzenoh-c/libzenoh-c.mk
new file mode 100644
index 0000000000..0ad81f3e41
--- /dev/null
+++ b/package/libzenoh-c/libzenoh-c.mk
@@ -0,0 +1,35 @@
+################################################################################
+#
+# libzenoh-c
+#
+################################################################################
+
+LIBZENOH_C_VERSION = 0.10.1-rc
+LIBZENOH_C_SITE = $(call github,eclipse-zenoh,zenoh-c,$(LIBZENOH_C_VERSION))
+LIBZENOH_C_LICENSE = Apache-2.0 or EPL-2.0
+LIBZENOH_C_LICENSE_FILES = LICENSE
+LIBZENOH_C_INSTALL_STAGING = YES
+
+ifeq ($(BR2_ENABLE_DEBUG),y)
+LIBZENOH_C_LIB_LOCATION = $(@D)/target/$(RUSTC_TARGET_NAME)/debug
+else
+LIBZENOH_C_LIB_LOCATION = $(@D)/target/$(RUSTC_TARGET_NAME)/release
+endif
+
+define LIBZENOH_C_INSTALL_FILES
+ $(INSTALL) -D -m 644 \
+ $(LIBZENOH_C_LIB_LOCATION)/libzenohc.so \
+ $(1)/usr/lib/libzenohc.so
+endef
+
+define LIBZENOH_C_INSTALL_TARGET_CMDS
+ $(call LIBZENOH_C_INSTALL_FILES,$(TARGET_DIR))
+endef
+
+define LIBZENOH_C_INSTALL_STAGING_CMDS
+ $(call LIBZENOH_C_INSTALL_FILES,$(STAGING_DIR))
+ mkdir -p $(STAGING_DIR)/usr/include/
+ cp -dpfr $(@D)/include/* $(STAGING_DIR)/usr/include/
+endef
+
+$(eval $(cargo-package))
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-04-16 10:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-18 8:15 [Buildroot] [PATCH] package/zenoh-c: new package Michel Alex
2023-11-01 17:46 ` Thomas Petazzoni via buildroot
2023-11-06 9:53 ` Michel Alex
2024-03-01 9:56 ` [Buildroot] [PATCH v3] package/libzenoh-c: " Michel Alex
2024-03-01 17:49 ` Yann E. MORIN
2024-03-06 13:19 ` Michel Alex
2024-04-16 10:03 ` [Buildroot] [PATCH v4] " Michel Alex
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox