Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[boringssl] Add pkg-config file so it still works with gRPC #27082

Merged
merged 2 commits into from
Oct 9, 2022
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
39 changes: 39 additions & 0 deletions ports/boringssl/install-pc-files.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
function(install_pc_file name pc_data)
# fix platform-specific details
if(NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_MINGW)
string(REPLACE "-llibssl" "-lssl" pc_data "${pc_data}")
string(REPLACE "-llibcrypt" "-lcrypto" pc_data "${pc_data}")
string(REPLACE "-lcrypt32" "" pc_data "${pc_data}")
string(REPLACE "-lws2_32" "" pc_data "${pc_data}")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${name}.pc" @ONLY)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${name}.pc" @ONLY)
endif()
endfunction()

install_pc_file(openssl [[
Name: BoringSSL
Description: Secure Sockets Layer and cryptography libraries and tools
Requires: libssl libcrypto
]])

install_pc_file(libssl [[
Name: BoringSSL-libssl
Description: Secure Sockets Layer and cryptography libraries
Libs: -L"${libdir}" -llibssl
Requires: libcrypto
Cflags: -I"${includedir}"
]])

install_pc_file(libcrypto [[
Name: BoringSSL-libcrypto
Description: OpenSSL cryptography library
Libs: -L"${libdir}" -llibcrypto
Libs.private: -lcrypt32 -lws2_32
Cflags: -I"${includedir}"
]])

vcpkg_fixup_pkgconfig()
6 changes: 6 additions & 0 deletions ports/boringssl/openssl.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Version: @OPENSSL_VERSION@
@pc_data@
2 changes: 2 additions & 0 deletions ports/boringssl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ vcpkg_cmake_configure(

vcpkg_cmake_install()

include("${CMAKE_CURRENT_LIST_DIR}/install-pc-files.cmake")

if(IS_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/boringssl)
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/boringssl")
endif()
Expand Down
4 changes: 2 additions & 2 deletions ports/boringssl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "boringssl",
"version-date": "2021-06-23",
"port-version": 2,
"description": "BoringSSl is a fork of OpenSSL developed by Google",
"port-version": 3,
"description": "BoringSSL is a fork of OpenSSL developed by Google",
"homepage": "https://boringssl.googlesource.com/boringssl",
"supports": "!uwp",
"dependencies": [
Expand Down
5 changes: 5 additions & 0 deletions versions/b-/boringssl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "cb83700b7bf53177773421dfb803fb8478e6a72d",
"version-date": "2021-06-23",
"port-version": 3
},
{
"git-tree": "8d28c72d322cf2245e69075deef73c5edefee0b5",
"version-date": "2021-06-23",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@
},
"boringssl": {
"baseline": "2021-06-23",
"port-version": 2
"port-version": 3
},
"botan": {
"baseline": "2.19.1",
Expand Down