Skip to contentSkip to conversation

contrib/vcpkg-ports: remove openssl port

PATCH In review Lev Stipakov 2 participants 3 messages Jun 28, 2021 – Oct 19, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 contrib/vcpkg-ports: remove openssl port

From: Lev Stipakov <[email protected]...>

MSFT has merged PR to vcpkg which
added OPENSSL_NO_AUTOLOAD_CONFIG option

https://github.com/microsoft/vcpkg/pull/18389

This means that we don't need to have our own openssl port and instead we just add

set(OPENSSL_NO_AUTOLOAD_CONFIG ON)

to our custom triplets.

---
 .github/workflows/build.yaml                  |   2 +-
 contrib/vcpkg-ports/openssl/portfile.cmake    |  25 --
 .../vcpkg-ports/openssl/unix/CMakeLists.txt   | 280 ------------------
 .../vcpkg-ports/openssl/unix/portfile.cmake   |  49 ---
 .../openssl/unix/remove-deps.cmake            |   7 -
 .../openssl/unix/vcpkg-cmake-wrapper.cmake    |  18 --
 contrib/vcpkg-ports/openssl/usage             |   4 -
 .../openssl/uwp/EnableUWPSupport.patch        | 170 -----------
 .../vcpkg-ports/openssl/uwp/make-openssl.bat  |  16 -
 .../vcpkg-ports/openssl/uwp/portfile.cmake    | 156 ----------
 contrib/vcpkg-ports/openssl/vcpkg.json        |   7 -
 .../openssl/windows/portfile.cmake            | 174 -----------
 .../openssl/windows/vcpkg-cmake-wrapper.cmake |  10 -
 .../vcpkg-triplets/arm64-windows-ovpn.cmake   |   2 +
 contrib/vcpkg-triplets/x64-windows-ovpn.cmake |   2 +
 contrib/vcpkg-triplets/x86-windows-ovpn.cmake |   2 +
 16 files changed, 7 insertions(+), 917 deletions(-)
 delete mode 100644 contrib/vcpkg-ports/openssl/portfile.cmake
 delete mode 100644 contrib/vcpkg-ports/openssl/unix/CMakeLists.txt
 delete mode 100644 contrib/vcpkg-ports/openssl/unix/portfile.cmake
 delete mode 100644 contrib/vcpkg-ports/openssl/unix/remove-deps.cmake
 delete mode 100644 contrib/vcpkg-ports/openssl/unix/vcpkg-cmake-wrapper.cmake
 delete mode 100644 contrib/vcpkg-ports/openssl/usage
 delete mode 100644 contrib/vcpkg-ports/openssl/uwp/EnableUWPSupport.patch
 delete mode 100644 contrib/vcpkg-ports/openssl/uwp/make-openssl.bat
 delete mode 100644 contrib/vcpkg-ports/openssl/uwp/portfile.cmake
 delete mode 100644 contrib/vcpkg-ports/openssl/vcpkg.json
 delete mode 100644 contrib/vcpkg-ports/openssl/windows/portfile.cmake
 delete mode 100644 contrib/vcpkg-ports/openssl/windows/vcpkg-cmake-wrapper.cmake
.github/workflows/build.yaml +1 -1
index 5d7dd37b..64044da9 100644
@@ -211,7 +211,7 @@ jobs:
         with:
           vcpkgArguments: 'openssl lz4 lzo pkcs11-helper tap-windows6'
           vcpkgTriplet: '${{ matrix.triplet }}-windows-ovpn'
-          vcpkgGitCommitId: '7d472dd25830da92108eb76642c667aaa40512cb'
+          vcpkgGitCommitId: 'b361c2eefa3966cb7cec45275aff32e90430aaa6'
           cleanAfterBuild: false
 
       - name: Build
contrib/vcpkg-ports/openssl/portfile.cmake deleted +0 -25
deleted file mode 100644
index 9b59a3c8..00000000
@@ -1,25 +0,0 @@
-if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h")
-  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()
-
-set(OPENSSL_VERSION 1.1.1k)
-vcpkg_download_distfile(ARCHIVE
-    URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/1.1.1/openssl-${OPENSSL_VERSION}.tar.gz"
-    FILENAME "openssl-${OPENSSL_VERSION}.tar.gz"
-    SHA512 73cd042d4056585e5a9dd7ab68e7c7310a3a4c783eafa07ab0b560e7462b924e4376436a6d38a155c687f6942a881cfc0c1b9394afcde1d8c46bf396e7d51121
-)
-
-vcpkg_find_acquire_program(PERL)
-get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
-vcpkg_add_to_path("${PERL_EXE_PATH}")
-
-if(VCPKG_TARGET_IS_UWP)
-    include("${CMAKE_CURRENT_LIST_DIR}/uwp/portfile.cmake")
-elseif(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
-    include("${CMAKE_CURRENT_LIST_DIR}/windows/portfile.cmake")
-else()
-    include("${CMAKE_CURRENT_LIST_DIR}/unix/portfile.cmake")
-endif()
-
-
-file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
contrib/vcpkg-ports/openssl/unix/CMakeLists.txt deleted +0 -280

280 lines not on this page · raw message

contrib/vcpkg-ports/openssl/unix/portfile.cmake deleted +0 -49

49 lines not on this page · raw message

contrib/vcpkg-ports/openssl/unix/remove-deps.cmake deleted +0 -7
deleted file mode 100644
index 53ad6ef2..00000000
@@ -1,7 +0,0 @@
-file(GLOB_RECURSE MAKEFILES ${DIR}/*/Makefile)
-foreach(MAKEFILE ${MAKEFILES})
-    message("removing deps from ${MAKEFILE}")
-    file(READ "${MAKEFILE}" _contents)
-    string(REGEX REPLACE "\n# DO NOT DELETE THIS LINE.*" "" _contents "${_contents}")
-    file(WRITE "${MAKEFILE}" "${_contents}")
-endforeach()
contrib/vcpkg-ports/openssl/unix/vcpkg-cmake-wrapper.cmake deleted +0 -18
deleted file mode 100644
index f36b6876..00000000
@@ -1,18 +0,0 @@
-_find_package(${ARGS})
-if(OPENSSL_FOUND)
-    find_library(OPENSSL_DL_LIBRARY NAMES dl)
-    if(OPENSSL_DL_LIBRARY)
-        list(APPEND OPENSSL_LIBRARIES "dl")
-        if(TARGET OpenSSL::Crypto)
-            set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "dl")
-        endif()
-    endif()
-    find_package(Threads REQUIRED)
-    list(APPEND OPENSSL_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
-    if(TARGET OpenSSL::Crypto)
-        set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Threads::Threads")
-    endif()
-    if(TARGET OpenSSL::SSL)
-        set_property(TARGET OpenSSL::SSL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Threads::Threads")
-    endif()
-endif()
contrib/vcpkg-ports/openssl/usage deleted +0 -4
deleted file mode 100644
index cf83f339..00000000
@@ -1,4 +0,0 @@
-The package openssl is compatible with built-in CMake targets:
-
-    find_package(OpenSSL REQUIRED)
-    target_link_libraries(main PRIVATE OpenSSL::SSL OpenSSL::Crypto)
contrib/vcpkg-ports/openssl/uwp/EnableUWPSupport.patch deleted +0 -170

170 lines not on this page · raw message

contrib/vcpkg-ports/openssl/uwp/make-openssl.bat deleted +0 -16
deleted file mode 100644
index 6f6166a2..00000000
@@ -1,16 +0,0 @@
-set build=%1
-
-perl Configure no-asm no-hw no-dso VC-WINUNIVERSAL -FS -FIWindows.h
-
-for /D %%f in ("%WindowsSdkDir%References\%WindowsSDKLibVersion%Windows.Foundation.FoundationContract\*") do set LibPath=%LibPath%;%%f\
-for /D %%f in ("%WindowsSdkDir%References\%WindowsSDKLibVersion%Windows.Foundation.UniversalApiContract\*") do set LibPath=%LibPath%;%%f\
-for /D %%f in ("%WindowsSdkDir%References\Windows.Foundation.FoundationContract\*") do set LibPath=%LibPath%;%%f\
-for /D %%f in ("%WindowsSdkDir%References\Windows.Foundation.UniversalApiContract\*") do set LibPath=%LibPath%;%%f\
-
-call ms\do_winuniversal.bat
-
-mkdir inc32\openssl
-
-jom -j %NUMBER_OF_PROCESSORS% -k -f ms\ntdll.mak
-REM due to a race condition in the build, we need to have a second single-threaded pass.
-nmake -f ms\ntdll.mak
contrib/vcpkg-ports/openssl/uwp/portfile.cmake deleted +0 -156

156 lines not on this page · raw message

contrib/vcpkg-ports/openssl/vcpkg.json deleted +0 -7
deleted file mode 100644
index 2d0eb137..00000000
@@ -1,7 +0,0 @@
-{
-  "name": "openssl",
-  "version-string": "1.1.1k",
-  "port-version": 4,
-  "description": "OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.",
-  "homepage": "https://www.openssl.org"
-}
contrib/vcpkg-ports/openssl/windows/portfile.cmake deleted +0 -174

174 lines not on this page · raw message

contrib/vcpkg-ports/openssl/windows/vcpkg-cmake-wrapper.cmake deleted +0 -10
deleted file mode 100644
index 1e3b837e..00000000
@@ -1,10 +0,0 @@
-_find_package(${ARGS})
-if(OPENSSL_FOUND)
-    list(APPEND OPENSSL_LIBRARIES Crypt32.lib ws2_32.lib)
-    if(TARGET OpenSSL::Crypto)
-        set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Crypt32.lib;ws2_32.lib")
-    endif()
-    if(TARGET OpenSSL::SSL)
-        set_property(TARGET OpenSSL::SSL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "Crypt32.lib;ws2_32.lib")
-    endif()
-endif()
contrib/vcpkg-triplets/arm64-windows-ovpn.cmake +2 -0
index dd3c6c0a..89f6a279 100644
@@ -5,3 +5,5 @@ set(VCPKG_LIBRARY_LINKAGE dynamic)
 if(PORT STREQUAL "lz4")
     set(VCPKG_LIBRARY_LINKAGE static)
 endif()
+
+set(OPENSSL_NO_AUTOLOAD_CONFIG ON)
contrib/vcpkg-triplets/x64-windows-ovpn.cmake +2 -0
index 7036ed2d..d860eed6 100644
@@ -5,3 +5,5 @@ set(VCPKG_LIBRARY_LINKAGE dynamic)
 if(PORT STREQUAL "lz4")
     set(VCPKG_LIBRARY_LINKAGE static)
 endif()
+
+set(OPENSSL_NO_AUTOLOAD_CONFIG ON)
contrib/vcpkg-triplets/x86-windows-ovpn.cmake +2 -0
index 7d3bf340..c1ea6ef3 100644
@@ -5,3 +5,5 @@ set(VCPKG_LIBRARY_LINKAGE dynamic)
 if(PORT STREQUAL "lz4")
     set(VCPKG_LIBRARY_LINKAGE static)
 endif()
+
+set(OPENSSL_NO_AUTOLOAD_CONFIG ON)
Signature · 1 line
2.23.0.windows.1
Acked-by on v1 1/1
#1 lore raw

Since we never wanted to maintain our own patch, this is welcome.

I have left out the hunk to .github/workflows/build.yaml, as that has been superseded by commit de8871f86db.

(I have not tested this in any way, just looked at the patch to see which files it modifies and whether those look halfway reasonable)

Your patch has been applied to the master branch.

commit 7e33127d566da6dc4e412c11a445be74a542729e

Author: Lev Stipakov
Date:   Mon Jun 28 11:08:32 2021 +0300
     contrib/vcpkg-ports: remove openssl port

     Signed-off-by: Lev Stipakov <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg22616.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#2 lore raw

Hi,

Quoted 10 lines · Gert Doering

Since we never wanted to maintain our own patch, this is welcome.

I have left out the hunk to .github/workflows/build.yaml, as that has been superseded by commit de8871f86db.

(I have not tested this in any way, just looked at the patch to see which files it modifies and whether those look halfway reasonable)

Quoted 7 lines

Your patch has been applied to the master branch.

commit 7e33127d566da6dc4e412c11a445be74a542729e

Author: Lev Stipakov
Date:   Mon Jun 28 11:08:32 2021 +0300

contrib/vcpkg-ports: remove openssl port

As requested (and as this is more a "build thing, depending on external factors" than "openvpn code") I have backported this to 2.5 as well now.

commit a0e6707ab384a9ae408993363c767d38e022c025 (HEAD -> release/2.5)

Author: Lev Stipakov <[email protected]...>
Date:   Mon Jun 28 11:08:32 2021 +0300

contrib/vcpkg-ports: remove openssl port

The resulting Windows installer needs a bit of testing before releasing the next official one...

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...