Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions ports/openssl/disable-install-docs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 110ba06..5b6b1c7 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -611,7 +611,7 @@ install_sw: install_dev install_engines install_modules install_runtime

uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev

-install_docs: install_man_docs install_html_docs
+install_docs:

uninstall_docs: uninstall_man_docs uninstall_html_docs
$(RM) -r $(DESTDIR)$(DOCDIR)
diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl
index d054431..b5c1c88 100644
--- a/Configurations/windows-makefile.tmpl
+++ b/Configurations/windows-makefile.tmpl
@@ -487,7 +487,7 @@ install_sw: install_dev install_engines install_modules install_runtime

uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev

-install_docs: install_html_docs
+install_docs:

uninstall_docs: uninstall_html_docs

54 changes: 37 additions & 17 deletions ports/openssl/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,31 +1,57 @@
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you're still using VERSION; should this be kept?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The check is obsolete since the check in scripts/ports.cmake was updated.

if(EXISTS "${CURRENT_INSTALLED_DIR}/share/libressl/copyright"
OR EXISTS "${CURRENT_INSTALLED_DIR}/share/boringssl/copyright")
message(FATAL_ERROR "Can't build openssl if libressl/boringssl is installed. Please remove libressl/boringssl, and try install openssl again if you need it.")
endif()

if (VCPKG_TARGET_IS_LINUX)
message(WARNING
[[openssl currently requires the following library from the system package manager:
linux-headers
It can be installed on alpine systems via apk add linux-headers.]]
)
if(VCPKG_TARGET_IS_EMSCRIPTEN)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

if (NOT "${VERSION}" MATCHES [[^([0-9]+)\.([0-9]+)\.([0-9]+)$]])
message(FATAL_ERROR "Version regex did not match.")
endif()
set(OPENSSL_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(OPENSSL_VERSION_MINOR "${CMAKE_MATCH_2}")
set(OPENSSL_VERSION_FIX "${CMAKE_MATCH_3}")
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO openssl/openssl
REF "openssl-${VERSION}"
SHA512 5a821aaaaa89027ce08a347e5fc216757c2971e29f7d24792609378c54f657839b3775bf639e7330b28b4f96ef0d32869f0a96afcb25c8a2e1c2fe51a6eb4aa3
PATCHES
disable-install-docs.patch
script-prefix.patch
windows/install-layout.patch
windows/install-pdbs.patch
windows/umul128-arm64.patch # Fixed upstream in https://github.com/openssl/openssl/pull/20244, but not released as of 3.0.8
unix/move-openssldir.patch
unix/no-empty-dirs.patch
unix/no-static-libs-for-shared.patch
)

vcpkg_list(SET CONFIGURE_OPTIONS
enable-static-engine
enable-capieng
no-ssl3
no-weak-ssl-ciphers
no-tests
)

vcpkg_find_acquire_program(PERL)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
vcpkg_add_to_path("${PERL_EXE_PATH}")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
vcpkg_list(APPEND CONFIGURE_OPTIONS shared)
else()
vcpkg_list(APPEND CONFIGURE_OPTIONS no-shared no-module)
endif()

if(DEFINED OPENSSL_USE_NOPINSHARED)
vcpkg_list(APPEND CONFIGURE_OPTIONS no-pinshared)
endif()

if(OPENSSL_NO_AUTOLOAD_CONFIG)
vcpkg_list(APPEND CONFIGURE_OPTIONS no-autoload-config)
endif()

if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
include("${CMAKE_CURRENT_LIST_DIR}/windows/portfile.cmake")
Expand All @@ -34,11 +60,5 @@ else()
include("${CMAKE_CURRENT_LIST_DIR}/unix/portfile.cmake")
endif()

if (NOT "${VERSION}" MATCHES [[^([0-9]+)\.([0-9]+)\.([0-9]+)$]])
message(FATAL_ERROR "Version regex did not match.")
endif()
set(OPENSSL_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(OPENSSL_VERSION_MINOR "${CMAKE_MATCH_2}")
set(OPENSSL_VERSION_FIX "${CMAKE_MATCH_3}")
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
22 changes: 22 additions & 0 deletions ports/openssl/script-prefix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/tools/c_rehash.in b/tools/c_rehash.in
index 343cdc1..e48038e 100644
--- a/tools/c_rehash.in
+++ b/tools/c_rehash.in
@@ -12,7 +12,7 @@
# and add symbolic links to their hash values.

my $dir = {- quotify1($config{openssldir}) -};
-my $prefix = {- quotify1($config{prefix}) -};
+use FindBin;

my $errorcount = 0;
my $openssl = $ENV{OPENSSL} || "openssl";
@@ -61,7 +61,7 @@ if (defined(&Cwd::getcwd)) {

# DOS/Win32 or Unix delimiter? Prefix our installdir, then search.
my $path_delim = ($pwd =~ /^[a-z]\:/i) ? ';' : ':';
-$ENV{PATH} = "$prefix/bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : "");
+$ENV{PATH} = "$FindBin::Bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : "");

if (! -x $openssl) {
my $found = 0;
Loading