aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2016-10-18 21:20:16 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2016-10-18 21:20:16 -0700
commit2dede88deb85ef7a5f24b5e4e608069553d36a8c (patch)
tree50efb913be6bcf02b3c207faf10aeca36faa9019
parent7dea245b9ce2c8d1902c3905c925e4b2f0a4d38b (diff)
downloadvcpkg-2dede88deb85ef7a5f24b5e4e608069553d36a8c.tar.gz
vcpkg-2dede88deb85ef7a5f24b5e4e608069553d36a8c.zip
[openssl] Patches to allow building when path includes spaces
-rw-r--r--ports/openssl/CMakeLists.txt21
-rw-r--r--ports/openssl/ConfigureIncludeQuotesFix.patch13
-rw-r--r--ports/openssl/PerlScriptSpaceInPathFixes.patch35
-rw-r--r--ports/openssl/STRINGIFYPatch.patch23
-rw-r--r--ports/openssl/portfile.cmake7
5 files changed, 92 insertions, 7 deletions
diff --git a/ports/openssl/CMakeLists.txt b/ports/openssl/CMakeLists.txt
index ff034bb9a..4ec875968 100644
--- a/ports/openssl/CMakeLists.txt
+++ b/ports/openssl/CMakeLists.txt
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.0)
project(openssl NONE)
include(vcpkg_execute_required_process)
+include(vcpkg_apply_patches)
+set(SOURCE_PATH ${CMAKE_CURRENT_BINARY_DIR}/openssl-1.0.2h)
find_package(ZLIB REQUIRED)
find_program(PERL perl)
@@ -9,18 +11,25 @@ find_program(NMAKE nmake)
message(STATUS "Extracting source ${OPENSSL_SOURCE_ARCHIVE}")
vcpkg_execute_required_process(
- COMMAND ${CMAKE_COMMAND} -E tar xjf ${OPENSSL_SOURCE_ARCHIVE}
+ COMMAND ${CMAKE_COMMAND} -E tar xjf "${OPENSSL_SOURCE_ARCHIVE}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
LOGNAME extract-${TARGET_TRIPLET}-rel
)
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES ${CMAKE_CURRENT_LIST_DIR}/PerlScriptSpaceInPathFixes.patch
+ ${CMAKE_CURRENT_LIST_DIR}/ConfigureIncludeQuotesFix.patch
+ ${CMAKE_CURRENT_LIST_DIR}/STRINGIFYPatch.patch
+)
+
set(CONFIGURE_COMMAND ${PERL} Configure
no-idea
no-mdc2
no-rc5
no-asm
zlib-dynamic
- --with-zlib-include=${ZLIB_INCLUDE_DIRS}
+ "--with-zlib-include=${ZLIB_INCLUDE_DIRS}"
)
if(TARGET_TRIPLET MATCHES "x86-windows")
@@ -38,15 +47,15 @@ if(CMAKE_BUILD_TYPE MATCHES "Debug")
list(GET ZLIB_LIBRARIES -1 ZLIB_DEBUG_LIBRARY)
list(APPEND CONFIGURE_COMMAND
debug-${OPENSSL_ARCH}
- --openssldir=${OPENSSLDIR}
- --with-zlib-lib=${ZLIB_DEBUG_LIBRARY}
+ "--openssldir=${OPENSSLDIR}"
+ "--with-zlib-lib=${ZLIB_DEBUG_LIBRARY}"
)
else()
set(OPENSSLDIR ${CURRENT_PACKAGES_DIR})
list(APPEND CONFIGURE_COMMAND
${OPENSSL_ARCH}
- --openssldir=${OPENSSLDIR}
- --with-zlib-lib=${ZLIB_LIBRARIES}
+ "--openssldir=${OPENSSLDIR}"
+ "--with-zlib-lib=${ZLIB_LIBRARIES}"
)
endif()
diff --git a/ports/openssl/ConfigureIncludeQuotesFix.patch b/ports/openssl/ConfigureIncludeQuotesFix.patch
new file mode 100644
index 000000000..1689ec4e0
--- /dev/null
+++ b/ports/openssl/ConfigureIncludeQuotesFix.patch
@@ -0,0 +1,13 @@
+diff --git a/Configure b/Configure
+index c98107a..77ad9d3 100644
+--- a/Configure
++++ b/Configure
+@@ -970,7 +970,7 @@ PROCESS_ARGS:
+ }
+ elsif (/^--with-zlib-include=(.*)$/)
+ {
+- $withargs{"zlib-include"}="-I$1";
++ $withargs{"zlib-include"}="-I\"$1\"";
+ }
+ elsif (/^--with-fipsdir=(.*)$/)
+ {
diff --git a/ports/openssl/PerlScriptSpaceInPathFixes.patch b/ports/openssl/PerlScriptSpaceInPathFixes.patch
new file mode 100644
index 000000000..b3a52fc97
--- /dev/null
+++ b/ports/openssl/PerlScriptSpaceInPathFixes.patch
@@ -0,0 +1,35 @@
+diff --git a/util/copy.pl b/util/copy.pl
+index eba6d58..5d971a2 100644
+--- a/util/copy.pl
++++ b/util/copy.pl
+@@ -19,7 +19,7 @@ foreach $arg (@ARGV) {
+ next;
+ }
+ $arg =~ s|\\|/|g; # compensate for bug/feature in cygwin glob...
+- foreach (glob $arg)
++ foreach (glob "\"$arg\"")
+ {
+ push @filelist, $_;
+ }
+diff --git a/util/mk1mf.pl b/util/mk1mf.pl
+index 128a405..fd853da 100644
+--- a/util/mk1mf.pl
++++ b/util/mk1mf.pl
+@@ -427,7 +427,7 @@ EOF
+ {
+ $extra_install .= <<"EOF"
+ \$(MKDIR) \"\$(INSTALLTOP)${o}lib${o}engines\"
+- \$(CP) \"\$(E_SHLIB)\" \"\$(INSTALLTOP)${o}lib${o}engines\"
++ \$(CP) \$(E_SHLIB) \"\$(INSTALLTOP)${o}lib${o}engines\"
+ EOF
+ }
+ }
+@@ -607,7 +607,7 @@ install: all
+ \$(MKDIR) \"\$(INSTALLTOP)${o}include${o}openssl\"
+ \$(MKDIR) \"\$(INSTALLTOP)${o}lib\"
+ \$(CP) \"\$(INCO_D)${o}*.\[ch\]\" \"\$(INSTALLTOP)${o}include${o}openssl\"
+- \$(CP) \"\$(BIN_D)$o\$(E_EXE)$exep \$(INSTALLTOP)${o}bin\"
++ \$(CP) \"\$(BIN_D)$o\$(E_EXE)$exep\" \"\$(INSTALLTOP)${o}bin\"
+ \$(MKDIR) \"\$(OPENSSLDIR)\"
+ \$(CP) apps${o}openssl.cnf \"\$(OPENSSLDIR)\"
+ $extra_install
diff --git a/ports/openssl/STRINGIFYPatch.patch b/ports/openssl/STRINGIFYPatch.patch
new file mode 100644
index 000000000..dd8f9c297
--- /dev/null
+++ b/ports/openssl/STRINGIFYPatch.patch
@@ -0,0 +1,23 @@
+diff --git a/crypto/cversion.c b/crypto/cversion.c
+index bfff699..17b7912 100644
+--- a/crypto/cversion.c
++++ b/crypto/cversion.c
+@@ -56,6 +56,9 @@
+ * [including the GNU Public Licence.]
+ */
+
++#define STRINGIFY2(x) #x
++#define STRINGIFY(x) STRINGIFY2(x)
++
+ #include "cryptlib.h"
+
+ #ifndef NO_WINDOWS_BRAINDEATH
+@@ -79,7 +82,7 @@ const char *SSLeay_version(int t)
+ }
+ if (t == SSLEAY_CFLAGS) {
+ #ifdef CFLAGS
+- return (CFLAGS);
++ return STRINGIFY(CFLAGS);
+ #else
+ return ("compiler: information not available");
+ #endif
diff --git a/ports/openssl/portfile.cmake b/ports/openssl/portfile.cmake
index 9f45f0ce4..b6085cada 100644
--- a/ports/openssl/portfile.cmake
+++ b/ports/openssl/portfile.cmake
@@ -12,7 +12,12 @@ vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE
SHA512 780601f6f3f32f42b6d7bbc4c593db39a3575f9db80294a10a68b2b0bb79448d9bd529ca700b9977354cbdfc65887c76af0aa7b90d3ee421f74ab53e6f15c303
)
-file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+file(COPY
+${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt
+${CMAKE_CURRENT_LIST_DIR}/PerlScriptSpaceInPathFixes.patch
+${CMAKE_CURRENT_LIST_DIR}/ConfigureIncludeQuotesFix.patch
+${CMAKE_CURRENT_LIST_DIR}/STRINGIFYPatch.patch
+DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}