diff mbox series

[1/2] package/gensio: add libgensio.pc

Message ID 20200216200242.1414766-1-fontaine.fabrice@gmail.com
State Changes Requested
Headers show
Series [1/2] package/gensio: add libgensio.pc | expand

Commit Message

Fabrice Fontaine Feb. 16, 2020, 8:02 p.m. UTC
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/gensio/0002-Add-libgensio.pc.patch | 73 ++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 package/gensio/0002-Add-libgensio.pc.patch

Comments

Thomas Petazzoni April 12, 2020, 9:06 p.m. UTC | #1
Hello Fabrice,

On Sun, 16 Feb 2020 21:02:41 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/gensio/0002-Add-libgensio.pc.patch | 73 ++++++++++++++++++++++
>  1 file changed, 73 insertions(+)
>  create mode 100644 package/gensio/0002-Add-libgensio.pc.patch

So, your patch was merged in upstream gensio:

  https://github.com/cminyard/gensio/commit/cd7fcd3197722910bfe6be3da4f55b28b8880dc3#diff-8afe8fc980005e7f95dba9eb6fd3747c

Which is now part of the 2.0.1 version of gensio that Buildroot is
using.

However, upstream has applied another patch on top, which drops the
Libs.private entry of your .pc.in:

  https://github.com/cminyard/gensio/commit/6f9ac3bca6dd17f12fc319d888d0875814a07878#diff-8afe8fc980005e7f95dba9eb6fd3747c

In Buildroot, we have added a work-around to link against openssl in
ser2net:

  https://git.buildroot.org/buildroot/commit/package/ser2net?id=a5feea5ea3c3e8b0c8c7e92ec5cefb145215d2c6

So, ideally this work-around should no longer be needed. And indeed, it
does build fine without it. But how come it works since openssl is not
in gensio.pc Libs.private ?

Could you have a look at this whole story ?

Thanks,

Thomas
diff mbox series

Patch

diff --git a/package/gensio/0002-Add-libgensio.pc.patch b/package/gensio/0002-Add-libgensio.pc.patch
new file mode 100644
index 0000000000..61bba89580
--- /dev/null
+++ b/package/gensio/0002-Add-libgensio.pc.patch
@@ -0,0 +1,73 @@ 
+From 4ac29c3d2c33b084214b05c568c68cfe4980939b Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Wed, 12 Feb 2020 08:49:34 +0100
+Subject: [PATCH] Add libgensio.pc
+
+gensio can optionally depends on openssl so add libgensio.pc to allow
+packages (such as ser2net) that link statically with gensio to use
+pkg-config to retrieve those static dependencies
+
+For example, this will avoid the following build failure on ser2net:
+
+checking gensio/gensio.h usability... yes
+checking gensio/gensio.h presence... yes
+checking for gensio/gensio.h... yes
+checking for str_to_gensio in -lgensio... no
+configure: error: libgensio won't link, please install gensio dev package
+
+Fixes:
+ - http://autobuild.buildroot.org/results/f15cf961ddaf849987afce01ede0e3d1e77a0fc0
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/cminyard/gensio/pull/12]
+---
+ configure.ac        |  1 +
+ lib/Makefile.am     |  5 +++++
+ lib/libgensio.pc.in | 10 ++++++++++
+ 3 files changed, 16 insertions(+)
+ create mode 100644 lib/libgensio.pc.in
+
+diff --git a/configure.ac b/configure.ac
+index 2f0221e..8cc8eff 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -267,6 +267,7 @@ if test "x$enable_internal_trace" != xno; then
+ fi
+ 
+ AC_OUTPUT([Makefile
++	lib/libgensio.pc
+ 	lib/Makefile
+ 	include/Makefile
+ 	include/gensio/Makefile
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index aacc618..d39b889 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -25,3 +25,8 @@ libgensio_la_SOURCES = \
+ libgensio_la_LDFLAGS = $(OPENSSL_LIBS)
+ 
+ EXTRA_DIST = README.rst
++
++# This variable must have 'exec' in its name, in order to be installed
++# by 'install-exec' target (instead of default 'install-data')
++pkgconfigexecdir = $(libdir)/pkgconfig
++pkgconfigexec_DATA = libgensio.pc
+diff --git a/lib/libgensio.pc.in b/lib/libgensio.pc.in
+new file mode 100644
+index 0000000..23451a3
+--- /dev/null
++++ b/lib/libgensio.pc.in
+@@ -0,0 +1,10 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: libgensio
++Description: A library to abstract stream I/O like serial port, TCP, telnet, UDP, SSL, IPMI SOL, etc. 
++Version: @VERSION@
++Libs: -L${libdir} -lgensio
++Libs.private: @OPENSSL_LIBS@
+-- 
+2.24.1
+