Skip to contentSkip to conversation

libsodium: new package

PATCH New Frank Hunleth 4 participants 8 messages May 16, 2015 – May 18, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libsodium: new package

---
 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..9445f5a
@@ -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))
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 libsodium: new package

Hi Frank,

Quoted 10 lines · Frank Hunleth
package/libsodium/libsodium.mk new file +4 -0
new file mode 100644
index 0000000..9445f5a
@@ -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))

What is the use of the host package?

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 -
#2 lore raw

PATCH 1/1 libsodium: new package

Hi Baruch,

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..9445f5a
@@ -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))

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

Quoted 7 lines

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 -

#3 lore raw

PATCH 1/1 libsodium: new package

In reply to Frank Hunleth

Dear Frank Hunleth,

Quoted 6 lines · Frank Hunleth
package/libsodium/libsodium.mk new file +0 -0
new file mode 100644
index 0000000..9445f5a

package/libsodium/libsodium.mk line 8

Quoted 8 lines
package/libsodium/libsodium.mk new file +8 -0
@@ -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 ${}.

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))

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

Best regards,

Thomas

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

PATCH 1/1 libsodium: new package

In reply to Frank Hunleth

Hi Frank,

Le 17/05/2015 01:38, Frank Hunleth a ?crit :

Quoted 11 lines
---
 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

#5 lore raw

PATCH 1/1 libsodium: new package

Hi Romain,

Quoted 15 lines · Romain Naour

Hi Frank,

Le 17/05/2015 01:38, Frank Hunleth a ?crit :

Quoted 11 lines
---
 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
Quoted 3 lines

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?

Quoted 2 lines

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

Quoted 5 lines

Care to take a look ?

Best regards,
Romain

#6 lore raw

PATCH 1/1 libsodium: new package

Hi Frank,

Le 17/05/2015 20:25, Frank Hunleth a ?crit :

Quoted 18 lines

Hi Romain,

Quoted 15 lines · Romain Naour

Hi Frank,

Le 17/05/2015 01:38, Frank Hunleth a ?crit :

Quoted 11 lines
---
 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
Quoted 7 lines
Quoted 3 lines

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

Quoted 8 lines
Quoted 3 lines

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

Quoted 10 lines

Thanks,
Frank

Quoted 5 lines

Care to take a look ?

Best regards,
Romain

#7 lore raw

PATCH 1/1 libsodium: new package

Hi Romain,

Quoted 32 lines · Romain Naour

Hi Frank,

Le 17/05/2015 20:25, Frank Hunleth a ?crit :

Quoted 18 lines

Hi Romain,

Quoted 15 lines · Romain Naour

Hi Frank,

Le 17/05/2015 01:38, Frank Hunleth a ?crit :

Quoted 11 lines
---
 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
Quoted 7 lines
Quoted 3 lines

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.

Quoted 7 lines

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.

Quoted 20 lines
Quoted 7 lines
Quoted 2 lines

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.

Quoted 7 lines

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