Contribs: fix libssh2 linking to gpg-error
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 9 Apr 2017 18:47:31 +0000 (20:47 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 9 Apr 2017 18:48:19 +0000 (20:48 +0200)
Since gcrypt people refuse .pc files...

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
contrib/src/ssh2/0001-Add-lgpg-error-to-.pc-to-facilitate-static-linking.patch [new file with mode: 0644]
contrib/src/ssh2/rules.mak

diff --git a/contrib/src/ssh2/0001-Add-lgpg-error-to-.pc-to-facilitate-static-linking.patch b/contrib/src/ssh2/0001-Add-lgpg-error-to-.pc-to-facilitate-static-linking.patch
new file mode 100644 (file)
index 0000000..fa8cc9b
--- /dev/null
@@ -0,0 +1,30 @@
+From 2fc4ef54ec61e98e757a49719b859d8ee59af952 Mon Sep 17 00:00:00 2001
+From: Mikhail Gusarov <dottedmag@dottedmag.net>
+Date: Wed, 3 Sep 2014 15:47:19 +0200
+Subject: [PATCH] Add -lgpg-error to .pc to facilitate static linking
+
+Note that this patch is Debian-specific as we know that libssh2 is linked
+to gcrypt.
+
+Patching configure.ac to add gpg-error as a dependent library is not good, as it
+would cause overlinking of libssh2, and there is no separate variable for
+"static dependencies".
+
+All this mess ought to be solved in gcrypt inself by providing .pc file,
+but it is not.
+
+---
+ libssh2.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: libssh2/libssh2.pc.in
+===================================================================
+--- libssh2.orig/libssh2.pc.in
++++ libssh2/libssh2.pc.in
+@@ -13,5 +13,5 @@ Description: Library for SSH-based commu
+ Version: @LIBSSH2VER@
+ Requires.private: @LIBSREQUIRED@
+ Libs: -L${libdir} -lssh2 @LIBS@
+-Libs.private: @LIBS@
++Libs.private: @LIBS@ -lgpg-error
+ Cflags: -I${includedir}
index 77aafdf..ac7acfe 100644 (file)
@@ -23,6 +23,8 @@ ssh2: libssh2-$(LIBSSH2_VERSION).tar.gz .sum-ssh2
        $(UNPACK)
        $(APPLY) $(SRC)/ssh2/no-tests.patch
        $(APPLY) $(SRC)/ssh2/ced924b78a40126606797ef57a74066eb3b4b83f.patch
+       $(APPLY) $(SRC)/ssh2/0001-Add-lgpg-error-to-.pc-to-facilitate-static-linking.patch
+       $(call pkg_static,"libssh2.pc.in")
 ifdef HAVE_WINSTORE
        $(APPLY) $(SRC)/ssh2/winrt-no-agent.patch
 endif