Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/libzenoh-c: install to staging
@ 2025-08-13  6:08 Michel Alex
  2025-08-16 20:11 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Michel Alex @ 2025-08-13  6:08 UTC (permalink / raw)
  To: Thomas Petazzoni via buildroot; +Cc: Michel Alex


[-- Attachment #1.1: Type: text/plain, Size: 1543 bytes --]

Install libzenohc.pc to staging. Packages, which use
libzenoh-c as dependency, are not able to find it.

Signed-off-by: Alex Michel <alex.michel@wiedemann-group.com>
---
 package/libzenoh-c/libzenoh-c.mk | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/package/libzenoh-c/libzenoh-c.mk b/package/libzenoh-c/libzenoh-c.mk
index bfee8f33e0..41b04d98f8 100644
--- a/package/libzenoh-c/libzenoh-c.mk
+++ b/package/libzenoh-c/libzenoh-c.mk
@@ -35,6 +35,15 @@ 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/
+     cat $(@D)/install/zenohc.pc.in \
+           | sed "s|@CMAKE_INSTALL_PREFIX@|/usr|g" \
+           | sed "s|@PROJECT_NAME@|libzenohc|g" \
+           | sed "s|@CMAKE_PROJECT_DESCRIPTION@|The C bindings for Zenoh|g" \
+           | sed "s|@CMAKE_PROJECT_HOMEPAGE_URL@|https://github.com/eclipse-zenoh/zenoh-c|g" \
+           | sed "s|@PROJECT_VERSION@|$(LIBZENOH_C_VERSION)|g" \
+           | sed "s|@CMAKE_INSTALL_INCLUDEDIR@|include|g" \
+           | sed "s|@CMAKE_INSTALL_LIBDIR@|lib|g" \
+           | sed "s|@LIBNAME@|zenohc|g" > $(STAGING_DIR)/usr/lib/pkgconfig/libzenohc.pc
 endef

 $(eval $(cargo-package))
--
2.43.0



[-- Attachment #1.2: Type: text/html, Size: 4431 bytes --]

[-- Attachment #2: 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] 2+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/libzenoh-c: install to staging
  2025-08-13  6:08 [Buildroot] [PATCH 1/1] package/libzenoh-c: install to staging Michel Alex
@ 2025-08-16 20:11 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-08-16 20:11 UTC (permalink / raw)
  To: Michel Alex; +Cc: Thomas Petazzoni via buildroot

Hello Michel,

Thanks for the patch!

On Wed, 13 Aug 2025 06:08:13 +0000
Michel Alex <Alex.Michel@wiedemann-group.com> wrote:

> Install libzenohc.pc to staging. Packages, which use
> libzenoh-c as dependency, are not able to find it.
> 
> Signed-off-by: Alex Michel <alex.michel@wiedemann-group.com>

The commit title is misleading: this commit is not installing
libzenoh-c to staging, as this is already happening. It's installing
the pkg-config.pc file to staging. This should be reflected in the
commit title.

> diff --git a/package/libzenoh-c/libzenoh-c.mk b/package/libzenoh-c/libzenoh-c.mk
> index bfee8f33e0..41b04d98f8 100644
> --- a/package/libzenoh-c/libzenoh-c.mk
> +++ b/package/libzenoh-c/libzenoh-c.mk
> @@ -35,6 +35,15 @@ 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/
> +     cat $(@D)/install/zenohc.pc.in \
> +           | sed "s|@CMAKE_INSTALL_PREFIX@|/usr|g" \
> +           | sed "s|@PROJECT_NAME@|libzenohc|g" \
> +           | sed "s|@CMAKE_PROJECT_DESCRIPTION@|The C bindings for Zenoh|g" \
> +           | sed "s|@CMAKE_PROJECT_HOMEPAGE_URL@|https://github.com/eclipse-zenoh/zenoh-c|g" \
> +           | sed "s|@PROJECT_VERSION@|$(LIBZENOH_C_VERSION)|g" \
> +           | sed "s|@CMAKE_INSTALL_INCLUDEDIR@|include|g" \
> +           | sed "s|@CMAKE_INSTALL_LIBDIR@|lib|g" \
> +           | sed "s|@LIBNAME@|zenohc|g" > $(STAGING_DIR)/usr/lib/pkgconfig/libzenohc.pc

Can we use the same pattern as for the sed invocation in
package/pkg-cmake.mk:

        sed \
                -e 's#@@STAGING_SUBDIR@@#$(call qstrip,$(STAGING_SUBDIR))#' \
                -e 's#@@TARGET_CFLAGS@@#$(call qstrip,$(TARGET_CFLAGS))#' \
                -e 's#@@TARGET_CXXFLAGS@@#$(call qstrip,$(TARGET_CXXFLAGS))#' \
                -e 's#@@TARGET_FCFLAGS@@#$(call qstrip,$(TARGET_FCFLAGS))#' \
                -e 's#@@TARGET_LDFLAGS@@#$(call qstrip,$(TARGET_LDFLAGS))#' \
                -e 's#@@TARGET_CC@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CC)))#' \
                -e 's#@@TARGET_CXX@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CXX)))#' \
                -e 's#@@TARGET_FC@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_FC)))#' \
                -e 's#@@CMAKE_SYSTEM_PROCESSOR@@#$(call qstrip,$(CMAKE_SYSTEM_PROCESSOR))#' \
                -e 's#@@TOOLCHAIN_HAS_CXX@@#$(if $(BR2_INSTALL_LIBSTDCPP),1,0)#' \
                -e 's#@@TOOLCHAIN_HAS_FORTRAN@@#$(if $(BR2_TOOLCHAIN_HAS_FORTRAN),1,0)#' \
                -e 's#@@CMAKE_BUILD_TYPE@@#$(if $(BR2_ENABLE_RUNTIME_DEBUG),Debug,Release)#' \
                $(TOPDIR)/support/misc/toolchainfile.cmake.in \

i.e, only one sed invocation, no need for cat | sed, usage of # as a
separator.

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] 2+ messages in thread

end of thread, other threads:[~2025-08-16 20:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13  6:08 [Buildroot] [PATCH 1/1] package/libzenoh-c: install to staging Michel Alex
2025-08-16 20:11 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox