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

[nghttp2]: update to 1.30.0 #2739

Merged
merged 3 commits into from
Feb 7, 2018
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
2 changes: 1 addition & 1 deletion ports/nghttp2/CONTROL
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Source: nghttp2
Version: 1.29.0
Version: 1.30.0-1
Description: Implementation of the Hypertext Transfer Protocol version 2 in C
23 changes: 23 additions & 0 deletions ports/nghttp2/enable-static.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 0846d06..290679f 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -38,7 +38,7 @@ if(WIN32)
endif()

# Public shared library
-add_library(nghttp2 SHARED ${NGHTTP2_SOURCES} ${NGHTTP2_RES})
+add_library(nghttp2 ${NGHTTP2_SOURCES} ${NGHTTP2_RES})
set_target_properties(nghttp2 PROPERTIES
COMPILE_FLAGS "${WARNCFLAGS}"
VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}
@@ -48,6 +48,9 @@ target_include_directories(nghttp2 INTERFACE
"${CMAKE_CURRENT_BINARY_DIR}/includes"
"${CMAKE_CURRENT_SOURCE_DIR}/includes"
)
+if(NOT BUILD_SHARED_LIBS)
+ target_compile_definitions(nghttp2 PUBLIC "-DNGHTTP2_STATICLIB")
+endif()

if(HAVE_CUNIT)
# Static library (for unittests because of symbol visibility)
21 changes: 10 additions & 11 deletions ports/nghttp2/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
include(vcpkg_common_functions)

set(LIB_NAME nghttp2)
set(LIB_VERSION 1.29.0)

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
message("nghttp2 doesn't currently support static library build")
set(VCPKG_LIBRARY_LINKAGE dynamic)
if(VCPKG_CRT_LINKAGE STREQUAL static)
message(FATAL_ERROR "avoiding building DLL with static CRT.")
endif()
endif()
set(LIB_VERSION 1.30.0)

set(LIB_FILENAME ${LIB_NAME}-${LIB_VERSION}.tar.gz)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${LIB_NAME}-${LIB_VERSION})

vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/nghttp2/nghttp2/releases/download/v${LIB_VERSION}/${LIB_FILENAME}"
FILENAME "${LIB_FILENAME}"
SHA512 34dfda7ba637fb23b24141aacf8a0c342a369a59c84d4e2bfed9b5a867f85a5d1d950267f018a820645954406d70bf499f01e2f9b1ebaa4b76e8f47c3693fd6e
SHA512 26ce717a085e9fbdf8e644d4c8ab6961ca60029c4dfa112c9932523d1c4cc3f40fda4283afddf78a649e7f6fb7d3f3bfce3197186a4f70819b5996e8158089da
)
vcpkg_extract_source_archive(${ARCHIVE})

vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/enable-static.patch"
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DENABLE_LIB_ONLY=ON
-DENABLE_ASIO_LIB=OFF
Expand All @@ -37,7 +36,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/man)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc)

# Move dll files from /lib to /bin where vcpkg expects them
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/${LIB_NAME}.dll ${CURRENT_PACKAGES_DIR}/bin/${LIB_NAME}.dll)

Expand Down