aboutsummaryrefslogtreecommitdiffstats
path: root/tools/cmake/patches
diff options
context:
space:
mode:
Diffstat (limited to 'tools/cmake/patches')
-rw-r--r--tools/cmake/patches/100-disable_qt_tests.patch34
-rw-r--r--tools/cmake/patches/110-libarchive-fix-libressl-compat.patch11
-rw-r--r--tools/cmake/patches/120-curl-fix-libressl-linking.patch37
-rw-r--r--tools/cmake/patches/130-bootstrap_parallel_make_flag.patch14
-rw-r--r--tools/cmake/patches/140-libarchive-fix-libressl.patch37
5 files changed, 133 insertions, 0 deletions
diff --git a/tools/cmake/patches/100-disable_qt_tests.patch b/tools/cmake/patches/100-disable_qt_tests.patch
new file mode 100644
index 00000000000..a354e1cac1d
--- /dev/null
+++ b/tools/cmake/patches/100-disable_qt_tests.patch
@@ -0,0 +1,34 @@
+--- a/Tests/RunCMake/CMakeLists.txt
++++ b/Tests/RunCMake/CMakeLists.txt
+@@ -290,15 +290,6 @@ add_RunCMake_test(no_install_prefix)
+ add_RunCMake_test(configure_file)
+ add_RunCMake_test(CTestTimeoutAfterMatch)
+
+-find_package(Qt4 QUIET)
+-find_package(Qt5Core QUIET)
+-if (QT4_FOUND AND Qt5Core_FOUND AND NOT Qt5Core_VERSION VERSION_LESS 5.1.0)
+- add_RunCMake_test(IncompatibleQt)
+-endif()
+-if (QT4_FOUND)
+- add_RunCMake_test(ObsoleteQtMacros -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE})
+-endif()
+-
+ find_package(PkgConfig QUIET)
+ if(PKG_CONFIG_FOUND)
+ add_RunCMake_test(FindPkgConfig)
+--- a/Tests/CMakeLists.txt
++++ b/Tests/CMakeLists.txt
+@@ -435,13 +435,6 @@ if(BUILD_TESTING)
+
+ list(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX})
+
+- if(NOT DEFINED CMake_TEST_Qt4)
+- set(CMake_TEST_Qt4 1)
+- endif()
+- if(CMake_TEST_Qt4 AND NOT QT4_FOUND)
+- find_package(Qt4 QUIET)
+- endif()
+-
+ if(CMake_TEST_Qt4 AND QT4_FOUND)
+ # test whether the Qt4 which has been found works, on some machines
+ # which run nightly builds there were errors like "wrong file format"
diff --git a/tools/cmake/patches/110-libarchive-fix-libressl-compat.patch b/tools/cmake/patches/110-libarchive-fix-libressl-compat.patch
new file mode 100644
index 00000000000..ba6565b6af0
--- /dev/null
+++ b/tools/cmake/patches/110-libarchive-fix-libressl-compat.patch
@@ -0,0 +1,11 @@
+--- a/Utilities/cmlibarchive/libarchive/archive_openssl_evp_private.h
++++ b/Utilities/cmlibarchive/libarchive/archive_openssl_evp_private.h
+@@ -28,7 +28,7 @@
+ #include <openssl/evp.h>
+ #include <openssl/opensslv.h>
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ #include <stdlib.h> /* malloc, free */
+ #include <string.h> /* memset */
+ static inline EVP_MD_CTX *EVP_MD_CTX_new(void)
diff --git a/tools/cmake/patches/120-curl-fix-libressl-linking.patch b/tools/cmake/patches/120-curl-fix-libressl-linking.patch
new file mode 100644
index 00000000000..20c5052cce1
--- /dev/null
+++ b/tools/cmake/patches/120-curl-fix-libressl-linking.patch
@@ -0,0 +1,37 @@
+From: Jo-Philipp Wich <jo@mein.io>
+Date: Wed, 11 Jan 2017 03:36:04 +0100
+Subject: [PATCH] cmcurl: link librt
+
+When cmake is linked against LibreSSL, there might be an indirect
+dependency on librt on certain systems if LibreSSL's libcrypto uses
+clock_gettime() from librt:
+
+ [ 28%] Linking C executable LIBCURL
+ .../lib/libcrypto.a(getentropy_linux.o): In function `getentropy_fallback':
+ getentropy_linux.c:(.text+0x16d): undefined reference to `clock_gettime'
+ getentropy_linux.c:(.text+0x412): undefined reference to `clock_gettime'
+ collect2: error: ld returned 1 exit status
+ make[5]: *** [Utilities/cmcurl/LIBCURL] Error 1
+
+Modify the cmcurl CMakeLists.txt to check for clock_gettime() in librt
+and unconditionally link the rt library when the symbol is found.
+
+Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+---
+--- a/Utilities/cmcurl/CMakeLists.txt
++++ b/Utilities/cmcurl/CMakeLists.txt
+@@ -452,6 +452,14 @@ if(CMAKE_USE_OPENSSL)
+ set(USE_OPENSSL ON)
+ set(HAVE_LIBCRYPTO ON)
+ set(HAVE_LIBSSL ON)
++ check_library_exists("rt" clock_gettime "" HAVE_LIBRT)
++ if(HAVE_LIBRT)
++ list(APPEND OPENSSL_LIBRARIES rt)
++ endif()
++ check_library_exists("pthread" pthread_once "" HAVE_PTHREAD)
++ if(HAVE_PTHREAD)
++ list(APPEND OPENSSL_LIBRARIES pthread)
++ endif()
+ list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES})
+ include_directories(${OPENSSL_INCLUDE_DIR})
+ set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
diff --git a/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch b/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch
new file mode 100644
index 00000000000..375bc5d979c
--- /dev/null
+++ b/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch
@@ -0,0 +1,14 @@
+--- a/bootstrap
++++ b/bootstrap
+@@ -1163,7 +1163,10 @@ int main(){ printf("1%c", (char)0x0a); r
+ ' > "test.c"
+ cmake_original_make_flags="${cmake_make_flags}"
+ if [ "x${cmake_parallel_make}" != "x" ]; then
+- cmake_make_flags="${cmake_make_flags} -j ${cmake_parallel_make}"
++ case "$cmake_paralle_make" in
++ [0-9]*) cmake_parallel_make="-j ${cmake_parallel_make}";;
++ esac
++ cmake_make_flags="${cmake_make_flags} ${cmake_parallel_make}"
+ fi
+ for a in ${cmake_make_processors}; do
+ if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then
diff --git a/tools/cmake/patches/140-libarchive-fix-libressl.patch b/tools/cmake/patches/140-libarchive-fix-libressl.patch
new file mode 100644
index 00000000000..ad8a0969a8f
--- /dev/null
+++ b/tools/cmake/patches/140-libarchive-fix-libressl.patch
@@ -0,0 +1,37 @@
+From 5da00ad75b09e262774ec3675bbe4d5a4502a852 Mon Sep 17 00:00:00 2001
+From: Bernard Spil <brnrd@FreeBSD.org>
+Date: Sun, 1 Apr 2018 23:01:44 +0200
+Subject: [PATCH] fix build with LibreSSL 2.7
+
+LibreSSL 2.7 adds OpenSSL 1.1 API leading to conflicts on method names
+
+See also: https://bugs.freebsd.org/226853
+Signed-off-by: Bernard Spil <brnrd@FreeBSD.org>
+---
+ libarchive/archive_openssl_hmac_private.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/Utilities/cmlibarchive/libarchive/archive_openssl_hmac_private.h
++++ b/Utilities/cmlibarchive/libarchive/archive_openssl_hmac_private.h
+@@ -28,7 +28,8 @@
+ #include <openssl/hmac.h>
+ #include <openssl/opensslv.h>
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
++ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ #include <stdlib.h> /* malloc, free */
+ #include <string.h> /* memset */
+ static inline HMAC_CTX *HMAC_CTX_new(void)
+--- a/Utilities/cmlibarchive/libarchive/archive_openssl_evp_private.h
++++ b/Utilities/cmlibarchive/libarchive/archive_openssl_evp_private.h
+@@ -28,7 +28,8 @@
+ #include <openssl/evp.h>
+ #include <openssl/opensslv.h>
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
++ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ #include <stdlib.h> /* malloc, free */
+ #include <string.h> /* memset */
+ static inline EVP_MD_CTX *EVP_MD_CTX_new(void)