Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] Adding opkg configuration options for curl, curl with  ssl, and sha256
Date: Sat, 30 Jun 2018 19:23:35 +0200	[thread overview]
Message-ID: <20180630172335.GH2384@scaer> (raw)
In-Reply-To: <SN6PR02MB39982FB384F220BD142434F9F24A0@SN6PR02MB3998.namprd02.prod.outlook.com>

Derek, All,

On 2018-06-25 15:21 +0000, Baker, Derek spake thusly:
> From 51a9bc5b2fc6e40f8b076a7b153caf3d84489c9c Mon Sep 17 00:00:00 2001
> From: Derek Baker <derek-baker@idexx.com>
> Date: Thu, 14 Jun 2018 16:36:31 -0400
> Subject: [PATCH 1/1] Adding opkg configuration options for curl, curl with
>  ssl, and sha256
> 
> Signed-off-by: Derek Baker <derek-baker@idexx.com>
> ---
>  package/opkg/Config.in | 13 +++++++++++++
>  package/opkg/opkg.mk   | 20 +++++++++++++++++++-
>  2 files changed, 32 insertions(+), 1 deletion(-)
> 
> diff --git a/package/opkg/Config.in b/package/opkg/Config.in
> index 20f6fa2f53..4ce3372bc0 100644
> --- a/package/opkg/Config.in
> +++ b/package/opkg/Config.in
> @@ -30,4 +30,17 @@ config BR2_PACKAGE_OPKG_GPG_SIGN
>        Enable opkg package signature checking support using
>        gnupg/libgpgme.
> 
> +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...

> +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.

>  endif
> diff --git a/package/opkg/opkg.mk b/package/opkg/opkg.mk
> index 4d34c6d4d3..d72f0bd97d 100644
> --- a/package/opkg/opkg.mk
> +++ b/package/opkg/opkg.mk
> @@ -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)
> +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...

> +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.

>  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


-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

      reply	other threads:[~2018-06-30 17:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-25 15:21 [Buildroot] [PATCH 1/1] Adding opkg configuration options for curl, curl with ssl, and sha256 Baker, Derek
2018-06-30 17:23 ` Yann E. MORIN [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180630172335.GH2384@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox