mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 14:09:01 +08:00
[openssl] Patches to allow building when path includes spaces
This commit is contained in:
parent
7dea245b9c
commit
2dede88deb
@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.0)
|
|||||||
project(openssl NONE)
|
project(openssl NONE)
|
||||||
|
|
||||||
include(vcpkg_execute_required_process)
|
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_package(ZLIB REQUIRED)
|
||||||
find_program(PERL perl)
|
find_program(PERL perl)
|
||||||
@ -9,18 +11,25 @@ find_program(NMAKE nmake)
|
|||||||
|
|
||||||
message(STATUS "Extracting source ${OPENSSL_SOURCE_ARCHIVE}")
|
message(STATUS "Extracting source ${OPENSSL_SOURCE_ARCHIVE}")
|
||||||
vcpkg_execute_required_process(
|
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}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
LOGNAME extract-${TARGET_TRIPLET}-rel
|
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
|
set(CONFIGURE_COMMAND ${PERL} Configure
|
||||||
no-idea
|
no-idea
|
||||||
no-mdc2
|
no-mdc2
|
||||||
no-rc5
|
no-rc5
|
||||||
no-asm
|
no-asm
|
||||||
zlib-dynamic
|
zlib-dynamic
|
||||||
--with-zlib-include=${ZLIB_INCLUDE_DIRS}
|
"--with-zlib-include=${ZLIB_INCLUDE_DIRS}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(TARGET_TRIPLET MATCHES "x86-windows")
|
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(GET ZLIB_LIBRARIES -1 ZLIB_DEBUG_LIBRARY)
|
||||||
list(APPEND CONFIGURE_COMMAND
|
list(APPEND CONFIGURE_COMMAND
|
||||||
debug-${OPENSSL_ARCH}
|
debug-${OPENSSL_ARCH}
|
||||||
--openssldir=${OPENSSLDIR}
|
"--openssldir=${OPENSSLDIR}"
|
||||||
--with-zlib-lib=${ZLIB_DEBUG_LIBRARY}
|
"--with-zlib-lib=${ZLIB_DEBUG_LIBRARY}"
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
set(OPENSSLDIR ${CURRENT_PACKAGES_DIR})
|
set(OPENSSLDIR ${CURRENT_PACKAGES_DIR})
|
||||||
list(APPEND CONFIGURE_COMMAND
|
list(APPEND CONFIGURE_COMMAND
|
||||||
${OPENSSL_ARCH}
|
${OPENSSL_ARCH}
|
||||||
--openssldir=${OPENSSLDIR}
|
"--openssldir=${OPENSSLDIR}"
|
||||||
--with-zlib-lib=${ZLIB_LIBRARIES}
|
"--with-zlib-lib=${ZLIB_LIBRARIES}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
13
ports/openssl/ConfigureIncludeQuotesFix.patch
Normal file
13
ports/openssl/ConfigureIncludeQuotesFix.patch
Normal file
@ -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=(.*)$/)
|
||||||
|
{
|
35
ports/openssl/PerlScriptSpaceInPathFixes.patch
Normal file
35
ports/openssl/PerlScriptSpaceInPathFixes.patch
Normal file
@ -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
|
23
ports/openssl/STRINGIFYPatch.patch
Normal file
23
ports/openssl/STRINGIFYPatch.patch
Normal file
@ -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
|
@ -12,7 +12,12 @@ vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE
|
|||||||
SHA512 780601f6f3f32f42b6d7bbc4c593db39a3575f9db80294a10a68b2b0bb79448d9bd529ca700b9977354cbdfc65887c76af0aa7b90d3ee421f74ab53e6f15c303
|
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(
|
vcpkg_configure_cmake(
|
||||||
SOURCE_PATH ${SOURCE_PATH}
|
SOURCE_PATH ${SOURCE_PATH}
|
||||||
|
Loading…
Reference in New Issue
Block a user