All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] libsodium: new package
@ 2015-05-16 23:38 Frank Hunleth
  2015-05-17  3:34 ` Baruch Siach
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Frank Hunleth @ 2015-05-16 23:38 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
---
 package/Config.in                |  1 +
 package/libsodium/Config.in      |  6 ++++++
 package/libsodium/libsodium.hash |  2 ++
 package/libsodium/libsodium.mk   | 14 ++++++++++++++
 4 files changed, 23 insertions(+)
 create mode 100644 package/libsodium/Config.in
 create mode 100644 package/libsodium/libsodium.hash
 create mode 100644 package/libsodium/libsodium.mk

diff --git a/package/Config.in b/package/Config.in
index e0c2e2a..5b99639 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -723,6 +723,7 @@ menu "Crypto"
 	source "package/libnss/Config.in"
 	source "package/libsecret/Config.in"
 	source "package/libsha1/Config.in"
+	source "package/libsodium/Config.in"
 	source "package/libssh2/Config.in"
 	source "package/nettle/Config.in"
 	source "package/openssl/Config.in"
diff --git a/package/libsodium/Config.in b/package/libsodium/Config.in
new file mode 100644
index 0000000..47b9bb3
--- /dev/null
+++ b/package/libsodium/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_LIBSODIUM
+	bool "libsodium"
+	help
+	  A modern and easy-to-use crypto library.
+
+	  http://libsodium.org/
diff --git a/package/libsodium/libsodium.hash b/package/libsodium/libsodium.hash
new file mode 100644
index 0000000..089dc03
--- /dev/null
+++ b/package/libsodium/libsodium.hash
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256	cbcfc63cc90c05d18a20f229a62c7e7054a73731d0aa858c0517152c549b1288	libsodium-1.0.3.tar.gz
diff --git a/package/libsodium/libsodium.mk b/package/libsodium/libsodium.mk
new file mode 100644
index 0000000..9445f5a
--- /dev/null
+++ b/package/libsodium/libsodium.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# libsodium
+#
+################################################################################
+
+LIBSODIUM_VERSION = 1.0.3
+LIBSODIUM_SITE = https://github.com/jedisct1/libsodium/releases/download/${LIBSODIUM_VERSION}
+LIBSODIUM_LICENSE = ISC
+LIBSODIUM_LICENSE_FILES = LICENSE
+LIBSODIUM_INSTALL_STAGING = YES
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] libsodium: new package
  2015-05-16 23:38 [Buildroot] [PATCH] libsodium: new package Frank Hunleth
@ 2015-05-17  3:34 ` Baruch Siach
  2015-05-17 13:16   ` Frank Hunleth
  2015-05-17 10:59 ` Thomas Petazzoni
  2015-05-17 11:43 ` Romain Naour
  2 siblings, 1 reply; 8+ messages in thread
From: Baruch Siach @ 2015-05-17  3:34 UTC (permalink / raw)
  To: buildroot

Hi Frank,

On Sat, May 16, 2015 at 07:38:55PM -0400, Frank Hunleth wrote:
> diff --git a/package/libsodium/libsodium.mk b/package/libsodium/libsodium.mk
> new file mode 100644
> index 0000000..9445f5a
> --- /dev/null
> +++ b/package/libsodium/libsodium.mk
> @@ -0,0 +1,14 @@
> +################################################################################
> +#
> +# libsodium
> +#
> +################################################################################
> +
> +LIBSODIUM_VERSION = 1.0.3
> +LIBSODIUM_SITE = https://github.com/jedisct1/libsodium/releases/download/${LIBSODIUM_VERSION}
> +LIBSODIUM_LICENSE = ISC
> +LIBSODIUM_LICENSE_FILES = LICENSE
> +LIBSODIUM_INSTALL_STAGING = YES
> +
> +$(eval $(autotools-package))
> +$(eval $(host-autotools-package))

What is the use of the host package?

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] libsodium: new package
  2015-05-16 23:38 [Buildroot] [PATCH] libsodium: new package Frank Hunleth
  2015-05-17  3:34 ` Baruch Siach
@ 2015-05-17 10:59 ` Thomas Petazzoni
  2015-05-17 11:43 ` Romain Naour
  2 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2015-05-17 10:59 UTC (permalink / raw)
  To: buildroot

Dear Frank Hunleth,

On Sat, 16 May 2015 19:38:55 -0400, Frank Hunleth wrote:

> diff --git a/package/libsodium/libsodium.mk b/package/libsodium/libsodium.mk
> new file mode 100644
> index 0000000..9445f5a
> --- /dev/null
> +++ b/package/libsodium/libsodium.mk
> @@ -0,0 +1,14 @@
> +################################################################################
> +#
> +# libsodium
> +#
> +################################################################################
> +
> +LIBSODIUM_VERSION = 1.0.3
> +LIBSODIUM_SITE = https://github.com/jedisct1/libsodium/releases/download/${LIBSODIUM_VERSION}

Use $() to reference make variables, not ${}.

> +LIBSODIUM_LICENSE = ISC
> +LIBSODIUM_LICENSE_FILES = LICENSE
> +LIBSODIUM_INSTALL_STAGING = YES
> +
> +$(eval $(autotools-package))
> +$(eval $(host-autotools-package))

As Baruch said, this host-autotools-package call seems useless.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] libsodium: new package
  2015-05-16 23:38 [Buildroot] [PATCH] libsodium: new package Frank Hunleth
  2015-05-17  3:34 ` Baruch Siach
  2015-05-17 10:59 ` Thomas Petazzoni
@ 2015-05-17 11:43 ` Romain Naour
  2015-05-17 18:25   ` Frank Hunleth
  2 siblings, 1 reply; 8+ messages in thread
From: Romain Naour @ 2015-05-17 11:43 UTC (permalink / raw)
  To: buildroot

Hi Frank,

Le 17/05/2015 01:38, Frank Hunleth a ?crit :
> Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
> ---
>  package/Config.in                |  1 +
>  package/libsodium/Config.in      |  6 ++++++
>  package/libsodium/libsodium.hash |  2 ++
>  package/libsodium/libsodium.mk   | 14 ++++++++++++++
>  4 files changed, 23 insertions(+)
>  create mode 100644 package/libsodium/Config.in
>  create mode 100644 package/libsodium/libsodium.hash
>  create mode 100644 package/libsodium/libsodium.mk
> 

Since you are adding a new library, some packages will try to link with it.
As far I know, zeromq can link with libsodium, so a new dependency should be
added in a follow up patch.

There is even an upstream path to disable libsodium in zeromq:
https://github.com/zeromq/zeromq4-x/commit/faaf4550263395b84e6a80d3f9d7ba8816cdd714

Care to take a look ?

Best regards,
Romain

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] libsodium: new package
  2015-05-17  3:34 ` Baruch Siach
@ 2015-05-17 13:16   ` Frank Hunleth
  0 siblings, 0 replies; 8+ messages in thread
From: Frank Hunleth @ 2015-05-17 13:16 UTC (permalink / raw)
  To: buildroot

Hi Baruch,

On Sat, May 16, 2015 at 11:34 PM, Baruch Siach <baruch@tkos.co.il> wrote:
> Hi Frank,
>
> On Sat, May 16, 2015 at 07:38:55PM -0400, Frank Hunleth wrote:
>> diff --git a/package/libsodium/libsodium.mk b/package/libsodium/libsodium.mk
>> new file mode 100644
>> index 0000000..9445f5a
>> --- /dev/null
>> +++ b/package/libsodium/libsodium.mk
>> @@ -0,0 +1,14 @@
>> +################################################################################
>> +#
>> +# libsodium
>> +#
>> +################################################################################
>> +
>> +LIBSODIUM_VERSION = 1.0.3
>> +LIBSODIUM_SITE = https://github.com/jedisct1/libsodium/releases/download/${LIBSODIUM_VERSION}
>> +LIBSODIUM_LICENSE = ISC
>> +LIBSODIUM_LICENSE_FILES = LICENSE
>> +LIBSODIUM_INSTALL_STAGING = YES
>> +
>> +$(eval $(autotools-package))
>> +$(eval $(host-autotools-package))
>
> What is the use of the host package?

I have a project that was using it for part of the build process so I
needed libsodium for both the host and target. I wasn't sure what the
Buildroot policy was for seemingly unnecessary host packages like
this. It's not a big deal for me to patch locally.

Thanks,
Frank

>
> baruch
>
> --
>      http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>    - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] libsodium: new package
  2015-05-17 11:43 ` Romain Naour
@ 2015-05-17 18:25   ` Frank Hunleth
  2015-05-17 20:57     ` Romain Naour
  0 siblings, 1 reply; 8+ messages in thread
From: Frank Hunleth @ 2015-05-17 18:25 UTC (permalink / raw)
  To: buildroot

Hi Romain,

On Sun, May 17, 2015 at 7:43 AM, Romain Naour <romain.naour@openwide.fr> wrote:
> Hi Frank,
>
> Le 17/05/2015 01:38, Frank Hunleth a ?crit :
>> Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
>> ---
>>  package/Config.in                |  1 +
>>  package/libsodium/Config.in      |  6 ++++++
>>  package/libsodium/libsodium.hash |  2 ++
>>  package/libsodium/libsodium.mk   | 14 ++++++++++++++
>>  4 files changed, 23 insertions(+)
>>  create mode 100644 package/libsodium/Config.in
>>  create mode 100644 package/libsodium/libsodium.hash
>>  create mode 100644 package/libsodium/libsodium.mk
>>
>
> Since you are adding a new library, some packages will try to link with it.
> As far I know, zeromq can link with libsodium, so a new dependency should be
> added in a follow up patch.

Thanks. I didn't know about the zeromq dependency. Before I submit a
new patch, do you know of an easy way to figure out what other
packages have a hidden dependency like this?

> There is even an upstream path to disable libsodium in zeromq:
> https://github.com/zeromq/zeromq4-x/commit/faaf4550263395b84e6a80d3f9d7ba8816cdd714

I looked at it. I'm not a zeromq user, so I don't really understand
why someone would want to have libsodium support disabled if they have
it. It seems simpler for now to make sure the dependency is there in
BR if libsodium is enabled. Maybe this is more of a desktop need?

Thanks,
Frank


>
> Care to take a look ?
>
> Best regards,
> Romain

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] libsodium: new package
  2015-05-17 18:25   ` Frank Hunleth
@ 2015-05-17 20:57     ` Romain Naour
  2015-05-18 13:20       ` Frank Hunleth
  0 siblings, 1 reply; 8+ messages in thread
From: Romain Naour @ 2015-05-17 20:57 UTC (permalink / raw)
  To: buildroot

Hi Frank,

Le 17/05/2015 20:25, Frank Hunleth a ?crit :
> Hi Romain,
> 
> On Sun, May 17, 2015 at 7:43 AM, Romain Naour <romain.naour@openwide.fr> wrote:
>> Hi Frank,
>>
>> Le 17/05/2015 01:38, Frank Hunleth a ?crit :
>>> Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
>>> ---
>>>  package/Config.in                |  1 +
>>>  package/libsodium/Config.in      |  6 ++++++
>>>  package/libsodium/libsodium.hash |  2 ++
>>>  package/libsodium/libsodium.mk   | 14 ++++++++++++++
>>>  4 files changed, 23 insertions(+)
>>>  create mode 100644 package/libsodium/Config.in
>>>  create mode 100644 package/libsodium/libsodium.hash
>>>  create mode 100644 package/libsodium/libsodium.mk
>>>
>>
>> Since you are adding a new library, some packages will try to link with it.
>> As far I know, zeromq can link with libsodium, so a new dependency should be
>> added in a follow up patch.
> 
> Thanks. I didn't know about the zeromq dependency. Before I submit a
> new patch, do you know of an easy way to figure out what other
> packages have a hidden dependency like this?

There is no easy way, maybe by using the package manager from your GNU/Linux
distribution to find some hit.

Something like (debian8): sudo apt-cache rdepends libsodium13
libsodium13
Reverse Depends:
  libzmq3
  libzmq3
  libsodium-dev
  libsodium-dbg

> 
>> There is even an upstream path to disable libsodium in zeromq:
>> https://github.com/zeromq/zeromq4-x/commit/faaf4550263395b84e6a80d3f9d7ba8816cdd714
> 
> I looked at it. I'm not a zeromq user, so I don't really understand
> why someone would want to have libsodium support disabled if they have
> it. It seems simpler for now to make sure the dependency is there in
> BR if libsodium is enabled. Maybe this is more of a desktop need?

It's sometime required to do this construct in .mk files in order to handle
properly the package dependency. (from nmap.mk)

ifeq ($(BR2_PACKAGE_OPENSSL),y)
NMAP_CONF_OPTS += --with-openssl="$(STAGING_DIR)/usr"
NMAP_DEPENDENCIES += openssl
else
NMAP_CONF_OPTS += --without-openssl
endif

It's also depends if the option is on/off by default.

But you're right, you need only something like this since libsodium is not
enabled by default.

ifeq ($(BR2_PACKAGE_LIBSODIUM),y)
ZEROMQ_DEPENDENCIES += libsodium
ZEROMQ_CONF_OPTS += --with-libsodium="$(STAGING_DIR)/usr"
endif

Best regards,
Romain

> 
> Thanks,
> Frank
> 
> 
>>
>> Care to take a look ?
>>
>> Best regards,
>> Romain

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] libsodium: new package
  2015-05-17 20:57     ` Romain Naour
@ 2015-05-18 13:20       ` Frank Hunleth
  0 siblings, 0 replies; 8+ messages in thread
From: Frank Hunleth @ 2015-05-18 13:20 UTC (permalink / raw)
  To: buildroot

Hi Romain,

On Sun, May 17, 2015 at 4:57 PM, Romain Naour <romain.naour@openwide.fr> wrote:
> Hi Frank,
>
> Le 17/05/2015 20:25, Frank Hunleth a ?crit :
>> Hi Romain,
>>
>> On Sun, May 17, 2015 at 7:43 AM, Romain Naour <romain.naour@openwide.fr> wrote:
>>> Hi Frank,
>>>
>>> Le 17/05/2015 01:38, Frank Hunleth a ?crit :
>>>> Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
>>>> ---
>>>>  package/Config.in                |  1 +
>>>>  package/libsodium/Config.in      |  6 ++++++
>>>>  package/libsodium/libsodium.hash |  2 ++
>>>>  package/libsodium/libsodium.mk   | 14 ++++++++++++++
>>>>  4 files changed, 23 insertions(+)
>>>>  create mode 100644 package/libsodium/Config.in
>>>>  create mode 100644 package/libsodium/libsodium.hash
>>>>  create mode 100644 package/libsodium/libsodium.mk
>>>>
>>>
>>> Since you are adding a new library, some packages will try to link with it.
>>> As far I know, zeromq can link with libsodium, so a new dependency should be
>>> added in a follow up patch.
>>
>> Thanks. I didn't know about the zeromq dependency. Before I submit a
>> new patch, do you know of an easy way to figure out what other
>> packages have a hidden dependency like this?
>
> There is no easy way, maybe by using the package manager from your GNU/Linux
> distribution to find some hit.
>
> Something like (debian8): sudo apt-cache rdepends libsodium13
> libsodium13
> Reverse Depends:
>   libzmq3
>   libzmq3
>   libsodium-dev
>   libsodium-dbg

I see basically the same list on my system. I did some searching
around and didn't see anything else.

>>> There is even an upstream path to disable libsodium in zeromq:
>>> https://github.com/zeromq/zeromq4-x/commit/faaf4550263395b84e6a80d3f9d7ba8816cdd714
>>
>> I looked at it. I'm not a zeromq user, so I don't really understand
>> why someone would want to have libsodium support disabled if they have
>> it. It seems simpler for now to make sure the dependency is there in
>> BR if libsodium is enabled. Maybe this is more of a desktop need?
>
> It's sometime required to do this construct in .mk files in order to handle
> properly the package dependency. (from nmap.mk)
>
> ifeq ($(BR2_PACKAGE_OPENSSL),y)
> NMAP_CONF_OPTS += --with-openssl="$(STAGING_DIR)/usr"
> NMAP_DEPENDENCIES += openssl
> else
> NMAP_CONF_OPTS += --without-openssl
> endif
>
> It's also depends if the option is on/off by default.
>
> But you're right, you need only something like this since libsodium is not
> enabled by default.
>
> ifeq ($(BR2_PACKAGE_LIBSODIUM),y)
> ZEROMQ_DEPENDENCIES += libsodium
> ZEROMQ_CONF_OPTS += --with-libsodium="$(STAGING_DIR)/usr"
> endif

I'm sending a followup patch series with this shortly.

Thanks,
Frank

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-05-18 13:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-16 23:38 [Buildroot] [PATCH] libsodium: new package Frank Hunleth
2015-05-17  3:34 ` Baruch Siach
2015-05-17 13:16   ` Frank Hunleth
2015-05-17 10:59 ` Thomas Petazzoni
2015-05-17 11:43 ` Romain Naour
2015-05-17 18:25   ` Frank Hunleth
2015-05-17 20:57     ` Romain Naour
2015-05-18 13:20       ` Frank Hunleth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.