Skip to contentSkip to conversation

libsodium: new package

PATCH Superseded Frank Hunleth 3 participants 6 messages May 18, 2015 – May 19, 2015

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 libsodium: new package

---
Changes v1 -> v2:
- fix curly braces on variables (thanks to Thomas for noticing)
- added patch for zeromq (in separate patch) to address libsodium dependency in that library (thanks to Romain for this). I didn't find any other packages with a similar dependency, but it's not that easy to do that search.

 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
package/Config.in +1 -0
index e0c2e2a..5b99639 100644
@@ -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"
package/libsodium/Config.in new file +6 -0
new file mode 100644
index 0000000..47b9bb3
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_LIBSODIUM
+	bool "libsodium"
+	help
+	  A modern and easy-to-use crypto library.
+
+	  http://libsodium.org/
package/libsodium/libsodium.hash new file +2 -0
new file mode 100644
index 0000000..089dc03
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256	cbcfc63cc90c05d18a20f229a62c7e7054a73731d0aa858c0517152c549b1288	libsodium-1.0.3.tar.gz
package/libsodium/libsodium.mk new file +14 -0
new file mode 100644
index 0000000..f58c324
@@ -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

#1 lore raw

PATCH v2 2/2 zeromq: depend on libsodium if available

ZeroMQ doesn't require libsodium, but will enable CURVE security if it's available. This patch adds the optional dependency.

---
 package/zeromq/zeromq.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/zeromq/zeromq.mk +6 -0
index 7e9ed19..a876d5e 100644
@@ -34,4 +34,10 @@ ZEROMQ_DEPENDENCIES += host-pkgconf openpgm
 ZEROMQ_CONF_OPTS += --with-system-pgm
 endif
 
+# ZeroMQ uses libsodium if it's available.
+ifeq ($(BR2_PACKAGE_LIBSODIUM), y)
+ZEROMQ_DEPENDENCIES += libsodium
+ZEROMQ_CONF_OPTS += --with-libsodium="$(STAGING_DIR)/usr"
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
2.1.4
#2 lore raw

PATCH v2 1/2 libsodium: new package

In reply to Frank Hunleth

Hi Frank,

Quoted 10 lines · Frank Hunleth
package/libsodium/libsodium.mk new file +4 -0
new file mode 100644
index 0000000..f58c324
@@ -0,0 +1,14 @@
+################################################################################
+#
+# libsodium
+#

package/libsodium/libsodium.mk line 14

Quoted 10 lines
package/libsodium/libsodium.mk new file +10 -0
+################################################################################
+
+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))

The host package is still here. Please remove.

baruch

Signature · 3 lines
     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 -
#3 lore raw

PATCH v2 1/2 libsodium: new package

Quoted 17 lines · Baruch Siach

Hi Frank,

Quoted 14 lines · Frank Hunleth
package/libsodium/libsodium.mk new file +8 -0
new file mode 100644
index 0000000..f58c324
@@ -0,0 +1,14 @@
+################################################################################
+#
+# libsodium
+#
+################################################################################
+
+LIBSODIUM_VERSION = 1.0.3
+LIBSODIUM_SITE = https://github.com/jedisct1/libsodium/releases/download/$(LIBSODIUM_VERSION)
Quoted 8 lines

package/libsodium/libsodium.mk line 14

Quoted 6 lines
package/libsodium/libsodium.mk new file +6 -0
+LIBSODIUM_LICENSE = ISC
+LIBSODIUM_LICENSE_FILES = LICENSE
+LIBSODIUM_INSTALL_STAGING = YES
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))

The host package is still here. Please remove.

As I said in a previous email, I use the host package and asked for guidance for including host packages or not. I didn't see a response. While I certainly don't mind removing it, it would be nice to know why host packages are such a problem. For me, it is very convenient that Buildroot requires so little of the host Linux environment to work. Libsodium, in particular, is annoying since you can't apt-get install it in Ubuntu 12.04. I know that's old, but it's around. Anyway, that's my 2 cents. It will be gone for v3...

Frank

#4 lore raw

PATCH v2 1/2 libsodium: new package

Dear Frank Hunleth,

Quoted 8 lines · Frank Hunleth

As I said in a previous email, I use the host package and asked for guidance for including host packages or not. I didn't see a response. While I certainly don't mind removing it, it would be nice to know why host packages are such a problem. For me, it is very convenient that Buildroot requires so little of the host Linux environment to work. Libsodium, in particular, is annoying since you can't apt-get install it in Ubuntu 12.04. I know that's old, but it's around. Anyway, that's my 2 cents. It will be gone for v3...

The thing is that we generally don't like to have "dangling" packages, that are not used by anything in Buildroot.

Normally, host packages fall into one of the two following categories:

* Used as a dependency to build a target package. In this case, the host package is listed as host-<foo> in the <pkg>_DEPENDENCIES of another package. So it is actually used by something in Buildroot.

* Used as a tool (for flashing, creating images, debugging, etc.) and in this case, it's listed in the "Host utilities" menu in menuconfig. In this case, it is directly visible to the user.

But what you propose here does not fall into any of these two cases. We don't put host libraries in the "Host utilities" menu, and your host package is not used by any other package in Buildroot, hence Baruch's reaction.

I think we may have made a couple of exceptions in the past, but I'm not sure how many. And they still have the major drawback that such packages will never be tested, because they cannot be reached by autobuilder testing.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH v2 1/2 libsodium: new package

Hi Thomas,

Quoted 31 lines · Thomas Petazzoni

Dear Frank Hunleth,

Quoted 8 lines · Frank Hunleth

As I said in a previous email, I use the host package and asked for guidance for including host packages or not. I didn't see a response. While I certainly don't mind removing it, it would be nice to know why host packages are such a problem. For me, it is very convenient that Buildroot requires so little of the host Linux environment to work. Libsodium, in particular, is annoying since you can't apt-get install it in Ubuntu 12.04. I know that's old, but it's around. Anyway, that's my 2 cents. It will be gone for v3...

The thing is that we generally don't like to have "dangling" packages, that are not used by anything in Buildroot.

Normally, host packages fall into one of the two following categories:

* Used as a dependency to build a target package. In this case, the host package is listed as host-<foo> in the <pkg>_DEPENDENCIES of another package. So it is actually used by something in Buildroot.

* Used as a tool (for flashing, creating images, debugging, etc.) and in this case, it's listed in the "Host utilities" menu in menuconfig. In this case, it is directly visible to the user.

But what you propose here does not fall into any of these two cases. We don't put host libraries in the "Host utilities" menu, and your host package is not used by any other package in Buildroot, hence Baruch's reaction.

Quoted 4 lines

I think we may have made a couple of exceptions in the past, but I'm not sure how many. And they still have the major drawback that such packages will never be tested, because they cannot be reached by autobuilder testing.

Thanks for the explanation. That encourages me to get the host utility that uses libsodium submitted. :)

A follow-up patch for libsodium is coming shortly. Hopefully this one passes muster.

Thanks,
Frank