All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/librsync: fix static link with popt
@ 2020-01-01 17:53 Fabrice Fontaine
  2020-01-02  8:24 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2020-01-01 17:53 UTC (permalink / raw)
  To: buildroot

Use pkg-config to retrieve popt dependencies such as iconv

Fixes:
 - http://autobuild.buildroot.org/results/896e8e3efbedad90d66ae8c4e1e50f16206cab49

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...FindPOPT.cmake-Add-PkgConfig-support.patch | 67 +++++++++++++++++++
 package/librsync/librsync.mk                  |  2 +-
 2 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 package/librsync/0002-cmake-FindPOPT.cmake-Add-PkgConfig-support.patch

diff --git a/package/librsync/0002-cmake-FindPOPT.cmake-Add-PkgConfig-support.patch b/package/librsync/0002-cmake-FindPOPT.cmake-Add-PkgConfig-support.patch
new file mode 100644
index 0000000000..1c8a332ab6
--- /dev/null
+++ b/package/librsync/0002-cmake-FindPOPT.cmake-Add-PkgConfig-support.patch
@@ -0,0 +1,67 @@
+From f5a131ab66fec23d0c79b55fc3907603b094deb9 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Tue, 31 Dec 2019 18:13:29 +0100
+Subject: [PATCH] cmake/FindPOPT.cmake: Add PkgConfig support
+
+Add PkgConfig support to retrieve popt dependencies otherwise static
+build can fail if popt has been linked with iconv:
+
+[100%] Linking C executable rdiff
+/home/buildroot/autobuild/instance-2/output-1/per-package/librsync/host/opt/ext-toolchain/bin/../lib/gcc/powerpc-buildroot-linux-uclibc/8.3.0/../../../../powerpc-buildroot-linux-uclibc/bin/ld: /home/buildroot/autobuild/instance-2/output-1/per-package/librsync/host/powerpc-buildroot-linux-uclibc/sysroot/usr/lib/libpopt.a(poptint.o): in function `POPT_fprintf':
+poptint.c:(.text+0x34c): undefined reference to `libiconv_open
+
+Fixes:
+ - http://autobuild.buildroot.org/results/896e8e3efbedad90d66ae8c4e1e50f16206cab49
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/librsync/librsync/pull/186]
+---
+ cmake/FindPOPT.cmake | 29 ++++++++++++++++++-----------
+ 1 file changed, 18 insertions(+), 11 deletions(-)
+
+diff --git a/cmake/FindPOPT.cmake b/cmake/FindPOPT.cmake
+index 1ca452a..87b3e95 100644
+--- a/cmake/FindPOPT.cmake
++++ b/cmake/FindPOPT.cmake
+@@ -42,20 +42,27 @@ if (NOT POPT_FOUND)
+   endif (NOT POPT_ROOT_DIR)
+ 
+   ##_____________________________________________________________________________
+-  ## Check for the header files
++  ## Check with PkgConfig (to retrieve static dependencies such as iconv)
++  find_package(PkgConfig QUIET)
++  pkg_search_module (POPT QUIET popt)
++  if (NOT POPT_FOUND)
+ 
+-  find_path (POPT_INCLUDE_DIRS popt.h
+-    HINTS ${POPT_ROOT_DIR} ${CMAKE_INSTALL_PREFIX} $ENV{programfiles}\\GnuWin32 $ENV{programfiles32}\\GnuWin32
+-    PATH_SUFFIXES include
+-    )
++    ##_____________________________________________________________________________
++    ## Check for the header files
+ 
+-  ##_____________________________________________________________________________
+-  ## Check for the library
++    find_path (POPT_INCLUDE_DIRS popt.h
++      HINTS ${POPT_ROOT_DIR} ${CMAKE_INSTALL_PREFIX} $ENV{programfiles}\\GnuWin32 $ENV{programfiles32}\\GnuWin32
++      PATH_SUFFIXES include
++      )
+ 
+-  find_library (POPT_LIBRARIES popt
+-    HINTS ${POPT_ROOT_DIR} ${CMAKE_INSTALL_PREFIX} $ENV{programfiles}\\GnuWin32 $ENV{programfiles32}\\GnuWin32
+-    PATH_SUFFIXES lib
+-    )
++    ##_____________________________________________________________________________
++    ## Check for the library
++
++    find_library (POPT_LIBRARIES popt
++      HINTS ${POPT_ROOT_DIR} ${CMAKE_INSTALL_PREFIX} $ENV{programfiles}\\GnuWin32 $ENV{programfiles32}\\GnuWin32
++      PATH_SUFFIXES lib
++      )
++  endif (POPT_FOUND)
+ 
+   ##_____________________________________________________________________________
+   ## Actions taken when all components have been found
+-- 
+2.24.0
+
diff --git a/package/librsync/librsync.mk b/package/librsync/librsync.mk
index 82d9b9fe2e..bf0785b427 100644
--- a/package/librsync/librsync.mk
+++ b/package/librsync/librsync.mk
@@ -9,6 +9,6 @@ LIBRSYNC_SITE = $(call github,librsync,librsync,v$(LIBRSYNC_VERSION))
 LIBRSYNC_LICENSE = LGPL-2.1+
 LIBRSYNC_LICENSE_FILES = COPYING
 LIBRSYNC_INSTALL_STAGING = YES
-LIBRSYNC_DEPENDENCIES = zlib bzip2 popt
+LIBRSYNC_DEPENDENCIES = host-pkgconf zlib bzip2 popt
 
 $(eval $(cmake-package))
-- 
2.24.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH 1/1] package/librsync: fix static link with popt
  2020-01-01 17:53 [Buildroot] [PATCH 1/1] package/librsync: fix static link with popt Fabrice Fontaine
@ 2020-01-02  8:24 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2020-01-02  8:24 UTC (permalink / raw)
  To: buildroot

On Wed,  1 Jan 2020 18:53:16 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Use pkg-config to retrieve popt dependencies such as iconv
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/896e8e3efbedad90d66ae8c4e1e50f16206cab49
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...FindPOPT.cmake-Add-PkgConfig-support.patch | 67 +++++++++++++++++++
>  package/librsync/librsync.mk                  |  2 +-
>  2 files changed, 68 insertions(+), 1 deletion(-)
>  create mode 100644 package/librsync/0002-cmake-FindPOPT.cmake-Add-PkgConfig-support.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-02  8:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-01 17:53 [Buildroot] [PATCH 1/1] package/librsync: fix static link with popt Fabrice Fontaine
2020-01-02  8:24 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.