From 5bd46fff50c9e8e77a21e3f1397449bbcf7f18a1 Mon Sep 17 00:00:00 2001 From: Chris Hillery Date: Wed, 21 Jun 2017 00:53:43 -0700 Subject: [PATCH] MB-24964: Backport of openssl_h changes These changes add the openssl_h cbdeps package and supporting scripting updates, which allows building on MacOS Sierra. Change-Id: I090242b65073d9a41ad757c912f636ca57f49f48 Reviewed-on: http://review.couchbase.org/79776 Well-Formed: Build Bot Tested-by: Build Bot Reviewed-by: Amit Krishnan --- cmake/Modules/CBDownloadDeps.cmake | 5 +++-- cmake/Modules/FindCouchbaseOpenSSL.cmake | 3 +++ deps/manifest.cmake | 1 + deps/packages/CMakeLists.txt | 3 +++ deps/packages/openssl_h/CMakeLists.txt | 15 +++++++++++++++ 5 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 deps/packages/openssl_h/CMakeLists.txt diff --git a/cmake/Modules/CBDownloadDeps.cmake b/cmake/Modules/CBDownloadDeps.cmake index 5ae1cd9..5a1875a 100644 --- a/cmake/Modules/CBDownloadDeps.cmake +++ b/cmake/Modules/CBDownloadDeps.cmake @@ -193,8 +193,9 @@ IF (NOT CBDownloadDeps_INCLUDED) # Always add the dep subdir; this will "re-install" the dep every time you # run CMake, which might be wasteful, but at least should be safe. FILE (MAKE_DIRECTORY "${_binary_dir}") - ADD_SUBDIRECTORY ("${_explode_dir}" "${_binary_dir}" EXCLUDE_FROM_ALL) - + IF (EXISTS ${_explode_dir}/CMakeLists.txt) + ADD_SUBDIRECTORY ("${_explode_dir}" "${_binary_dir}" EXCLUDE_FROM_ALL) + ENDIF (EXISTS ${_explode_dir}/CMakeLists.txt) ENDFUNCTION (DECLARE_DEP) # Download and cache a specific version of Go, and explode it into the diff --git a/cmake/Modules/FindCouchbaseOpenSSL.cmake b/cmake/Modules/FindCouchbaseOpenSSL.cmake index c620653..340ed38 100644 --- a/cmake/Modules/FindCouchbaseOpenSSL.cmake +++ b/cmake/Modules/FindCouchbaseOpenSSL.cmake @@ -4,8 +4,11 @@ # OPENSSL_LIBRARIES, Library path and libs # OPENSSL_INCLUDE_DIR, where to find the ICU headers +SET(_openssl_h_exploded ${CMAKE_BINARY_DIR}/tlm/deps/openssl_h.exploded) + FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h HINTS + ${_openssl_h_exploded} ENV OPENSSL_DIR PATH_SUFFIXES include PATHS diff --git a/deps/manifest.cmake b/deps/manifest.cmake index be56b85..9c857d7 100644 --- a/deps/manifest.cmake +++ b/deps/manifest.cmake @@ -30,6 +30,7 @@ DECLARE_DEP (libevent VERSION 2.1.4-alpha-dev PLATFORMS windows_msvc) DECLARE_DEP (libevent VERSION 2.0.22-cb1 PLATFORMS macosx) DECLARE_DEP (libevent VERSION 2.0.22-cb2 PLATFORMS centos6 centos7 debian7 debian8 freebsd sunos suse11.2 ubuntu12.04 ubuntu14.04) DECLARE_DEP (openssl VERSION 1.0.1h PLATFORMS windows_msvc) +DECLARE_DEP (openssl_h VERSION 0.9.8za-cb1 PLATFORMS macosx) DECLARE_DEP (pysqlite2 VERSION 0ff6e32-cb1 PLATFORMS centos6 centos7 debian7 debian8 macosx sunos suse11.2 ubuntu12.04 ubuntu14.04) DECLARE_DEP (python-snappy VERSION c97d633 PLATFORMS windows_msvc) DECLARE_DEP (python-snappy VERSION c97d633-cb1 PLATFORMS centos6 centos7 debian7 debian8 freebsd macosx sunos suse11.2 ubuntu12.04 ubuntu14.04) diff --git a/deps/packages/CMakeLists.txt b/deps/packages/CMakeLists.txt index fbc412a..a029f77 100644 --- a/deps/packages/CMakeLists.txt +++ b/deps/packages/CMakeLists.txt @@ -153,3 +153,6 @@ _ADD_DEP_PACKAGE(erlang R16B03-1-couchbase couchbase-watson 3) _ADD_DEP_PACKAGE(libsqlite3 3.7.2 3.7.2 1) _ADD_DEP_PACKAGE(pysqlite2 0ff6e32 0ff6e32 1) _ADD_DEP_PACKAGE(flatbuffers 1.2.0 v1.2.0 1) +IF (APPLE) + _ADD_DEP_PACKAGE(openssl_h 0.9.8za 0.9.8za 1) +ENDIF () diff --git a/deps/packages/openssl_h/CMakeLists.txt b/deps/packages/openssl_h/CMakeLists.txt new file mode 100644 index 0000000..96e63ab --- /dev/null +++ b/deps/packages/openssl_h/CMakeLists.txt @@ -0,0 +1,15 @@ +include(ExternalProject) + +ExternalProject_Add(openssl_h + GIT_REPOSITORY ${_git_repo} + GIT_TAG ${_git_rev} + + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/install + INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory /include/openssl/ + COMMAND ${CMAKE_COMMAND} -E copy_directory /openssl/ /include/openssl/ +) + +# cbdeps boilerplate +_ADD_PACKAGE_STEP()