package/libssh: fix dependency on libgcrypt
authorYann E. MORIN <yann.morin.1998@free.fr>
Thu, 8 Sep 2016 21:11:47 +0000 (23:11 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 11 Sep 2016 20:48:56 +0000 (22:48 +0200)
Since 2f89476 (package/libgpg-error: bump to version 1.23), libssh has
inherited the dependency from libgcrypt (propagated from libgpg-error).

However, since libssh can use either openssl or libgcrypt as a backend,
the dependency should be relaxed when openssl is available.

But the test is broken and inverted: it will make libssh unavailable as
soon as openssl is enabled.

This in itself is already incorrect, but that can cause further issues,
as some packages (e.g. Kodi) will select (indirectly) openssl, and has
an option to select libssh; enabling that option causes unmet direct
dependencies of libssh:

    warning: (BR2_PACKAGE_KODI_LIBSSH) selects BR2_PACKAGE_LIBSSH which
    has unmet direct dependencies (BR2_USE_MMU && !BR2_STATIC_LIBS &&
    BR2_TOOLCHAIN_HAS_THREADS && BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS
    && !BR2_PACKAGE_OPENSSL)

Fix this dependency by doing what other similar packages do: select
openssl if the other crypto backend (here libgcrypt) is not enabled.
This also allows us to drop the propagated dependency on the arch
condition.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Cc: Jörg Krause <joerg.krause@embedded.rocks>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Romain Naour <romain.naour@openwide.fr>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/libssh/Config.in
package/libssh/libssh.mk

index 6029f459d34e4e8cd96367d773717009a526002e..3dbfa7d5615b4fac6342858d63419b1872917d26 100644 (file)
@@ -4,8 +4,7 @@ config BR2_PACKAGE_LIBSSH
        depends on !BR2_STATIC_LIBS
        depends on BR2_TOOLCHAIN_HAS_THREADS
        # Either OpenSSL or libgcrypt are mandatory
-       depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS && !BR2_PACKAGE_OPENSSL # libgcrypt
-       select BR2_PACKAGE_LIBGCRYPT if !BR2_PACKAGE_OPENSSL
+       select BR2_PACKAGE_OPENSSL if !BR2_PACKAGE_LIBGCRYPT
        help
          libssh is a multiplatform C library implementing the SSHv2
          and SSHv1 protocol on client and server side. With libssh,
index 29bbf4e9f247b28599a78bbb5ecddb020fe7c601..429e3c17c853e61e3473e7ee09afaca29b83f5d7 100644 (file)
@@ -23,14 +23,14 @@ else
 LIBSSH_CONF_OPTS += -DWITH_ZLIB=OFF
 endif
 
+# Dependency is either on libgcrypt or openssl, guaranteed in Config.in.
+# Favour libgcrypt.
 ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
 LIBSSH_CONF_OPTS += -DWITH_GCRYPT=ON
 LIBSSH_DEPENDENCIES += libgcrypt
 else
 LIBSSH_CONF_OPTS += -DWITH_GCRYPT=OFF
-ifeq ($(BR2_PACKAGE_OPENSSL),y)
 LIBSSH_DEPENDENCIES += openssl
 endif
-endif
 
 $(eval $(cmake-package))