Skip to contentSkip to conversation

Adding opkg configuration options for curl, curl with ssl, and sha256

PATCH New Baker 2 participants 2 messages Jun 25, 2018 – Jun 30, 2018

lore
Share & tools
lore

Baker

#0 lore raw

PATCH 1/1 Adding opkg configuration options for curl, curl with ssl, and sha256

#1 lore raw

PATCH 1/1 Adding opkg configuration options for curl, curl with ssl, and sha256

Derek, All,

On 2018-06-25 15:21 +0000, Baker, Derek spake thusly:

Quoted 19 lines

From 51a9bc5b2fc6e40f8b076a7b153caf3d84489c9c Mon Sep 17 00:00:00 2001
From: Derek Baker <[email protected]>
Date: Thu, 14 Jun 2018 16:36:31 -0400
Subject: [PATCH 1/1] Adding opkg configuration options for curl, curl with
ssl, and sha256

---
 package/opkg/Config.in | 13 +++++++++++++
 package/opkg/opkg.mk   | 20 +++++++++++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)
package/opkg/Config.in +0 -0
index 20f6fa2f53..4ce3372bc0 100644
@@ -30,4 +30,17 @@ config BR2_PACKAGE_OPKG_GPG_SIGN
       Enable opkg package signature checking support using
       gnupg/libgpgme.

package/opkg/Config.in config BR2_PACKAGE_OPKG_GPG_SIGN · line 41

Quoted 10 lines
package/opkg/Config.in +9 -0
 
+config BR2_PACKAGE_OPKG_CURL
+    bool "curl support"
+    select BR2_PACKAGE_LIBCURL
+
+if BR2_PACKAGE_OPKG_CURL
+config BR2_PACKAGE_OPKG_CURL_SSL
+    select BR2_PACKAGE_OPENSSL
+    bool "ssl support for curl"
+endif

We don;t usually add options like that for optional features. Instead, we let user enable the appropriate packages, and so...

package/opkg/Config.in config BR2_PACKAGE_OPKG_GPG_SIGN · line 43

Quoted 2 lines
package/opkg/Config.in +2 -0
+config BR2_PACKAGE_OPKG_SHA256
+    bool "SHA256 support"

Adding sha256 support looks like it is orthogonal to using libcurl, right? If so, then this should be two patches, please: one to add libcurl, then one to add sha256.

If sha256 is a requirement for libcurl, then make that the first patch.

Quoted 18 lines
package/opkg/Config.in +0 -0
 endif
package/opkg/opkg.mk +1 -1
index 4d34c6d4d3..d72f0bd97d 100644
@@ -10,7 +10,6 @@ OPKG_DEPENDENCIES = host-pkgconf libarchive
 OPKG_LICENSE = GPL-2.0+
 OPKG_LICENSE_FILES = COPYING
 OPKG_INSTALL_STAGING = YES
-OPKG_CONF_OPTS = --disable-curl
 # Populate the conf/ directory
 OPKG_AUTORECONF = YES
 
@@ -37,6 +36,25 @@ else
 OPKG_CONF_OPTS += --disable-gpg
 endif
 
+ifeq ($(BR2_PACKAGE_OPKG_SHA256),y)

package/opkg/opkg.mk else · line 49

Quoted 10 lines
package/opkg/opkg.mk +10 -0
+OPKG_CONF_OPTS += --enable-sha256
+endif
+
+ifeq ($(BR2_PACKAGE_OPKG_CURL),y)
+OPKG_CONF_OPTS += --enable-curl
+OPKG_DEPENDENCIES += libcurl
+
+ifeq ($(BR2_PACKAGE_OPKG_CURL_SSL),y)
+OPKG_CONF_OPTS += --enable-ssl-curl
+OPKG_DEPENDENCIES += libopenssl

Note in passing: you select the 'openssl' package, but you depend on 'libopenssl'. openssl is a virtual package that depends on either 'libopenssl' or 'libressl'. But see below on how to solve this...

package/opkg/opkg.mk else · line 56

Quoted 7 lines
package/opkg/opkg.mk +7 -0
+else
+OPKG_CONF_OPTS += --disable-ssl-curl
+endif
+
+else
+OPKG_CONF_OPTS += --disable-curl
+endif

Here, we would just depend on the appropriate package being enabled. Also, we like to forcibly disable the features. This would lo0ok a bit like so:

    ifeq ($(BR2_PACKAGE_LIBCURL),y)
    OPKG_CONF_OPTS += --enable-curl
    OPKG_DEPENDENCIES += libcurl
    ifeq ($(BR2_PACKAGE_OPENSSL),y)
    OPKG_CONF_OPTS += --enable-ssl-curl
    OPKG_DEPENDENCIES += openssl
    else
    OPKG_CONF_OPTS += --disable-ssl-curl
    endif
    else
    OPKG_CONF_OPTS += --disable-curl --disable-ssl-curl
    endif # libcurl

Note: if only 'libopenssl' (aka upstream openssl) is supported, then replace BR2_PACKAGE_OPENSSL by BR2_PACKAGE_LIBOPENSSL.

Regards,
Yann E. MORIN.

Quoted 10 lines
package/opkg/opkg.mk +0 -1
 OPKG_POST_INSTALL_TARGET_HOOKS += OPKG_CREATE_LOCKDIR
 
 $(eval $(autotools-package))
--

2.17.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'