From a60aecfea810b3fa9199c046fa342dae55f31c15 Mon Sep 17 00:00:00 2001
From: Gerardo Ganis <Gerardo.Ganis@cern.ch>
Date: Wed, 7 Aug 2019 11:20:00 +0200
Subject: [PATCH 1/2] Add libsodium and make use of it for zeromq

Address issue SPI-1399
---
 cmake/toolchain/heptools-dev-base.cmake |  1 +
 externals/CMakeLists.txt                | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/cmake/toolchain/heptools-dev-base.cmake b/cmake/toolchain/heptools-dev-base.cmake
index 0a489ffc9c..5ed3d08388 100644
--- a/cmake/toolchain/heptools-dev-base.cmake
+++ b/cmake/toolchain/heptools-dev-base.cmake
@@ -264,6 +264,7 @@ LCG_external_package(libaio            0.3.110-1
 LCG_external_package(libffi            3.2.1                                    )
 LCG_external_package(libgeotiff        1.5.1                                    )
 LCG_external_package(libgit2           0.28.2                                   )
+LCG_external_package(libsodium         1.0.18                                   )
 LCG_external_package(libtool           2.4.2                                    )
 if( NOT ${LCG_OS} MATCHES ubuntu|mac )
   LCG_external_package(libxkbcommon    0.7.1                                    )
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
index a1c889e89a..6ea9f13104 100644
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -1657,7 +1657,16 @@ LCGPackage_Add(
 LCGPackage_Add(
   zeromq
   URL ${GenURL}/zeromq-${zeromq_native_version}.tar.gz
-  CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR> --with-libsodium=no
+  CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR> --with-libsodium=yes
+  BUILD_IN_SOURCE 1
+  DEPENDS libsodium
+)
+
+#---libsodium----------------------------------------------------------------------
+LCGPackage_Add(
+  libsodium
+  URL ${GenURL}/libsodium-${libsodium_native_version}.tar.gz
+  CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR>
   BUILD_IN_SOURCE 1
 )
 
-- 
GitLab


From 203f6bcf1b9ce939432f1f6ae3aa6b5c144f28b9 Mon Sep 17 00:00:00 2001
From: Gerardo Ganis <Gerardo.Ganis@cern.ch>
Date: Wed, 7 Aug 2019 11:31:51 +0200
Subject: [PATCH 2/2] Make sure libsodium comes before its usage

---
 externals/CMakeLists.txt | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
index 6ea9f13104..5d09d6a09a 100644
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -1653,6 +1653,14 @@ LCGPackage_Add(
   DEPENDS Python
 )
 
+#---libsodium----------------------------------------------------------------------
+LCGPackage_Add(
+  libsodium
+  URL ${GenURL}/libsodium-${libsodium_native_version}.tar.gz
+  CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR>
+  BUILD_IN_SOURCE 1
+)
+
 #---zeromq----------------------------------------------------------------------
 LCGPackage_Add(
   zeromq
@@ -1662,14 +1670,6 @@ LCGPackage_Add(
   DEPENDS libsodium
 )
 
-#---libsodium----------------------------------------------------------------------
-LCGPackage_Add(
-  libsodium
-  URL ${GenURL}/libsodium-${libsodium_native_version}.tar.gz
-  CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR>
-  BUILD_IN_SOURCE 1
-)
-
 #----autoconf-------------------------------------------------------------------
 LCGPackage_Add(
   autoconf
-- 
GitLab