diff --git a/ports/civetweb/pkgconfig.patch b/ports/civetweb/pkgconfig.patch new file mode 100644 index 0000000000..4c23cbff5e --- /dev/null +++ b/ports/civetweb/pkgconfig.patch @@ -0,0 +1,49 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c5368c0..c297861 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -614,6 +614,10 @@ configure_package_config_file( + PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR CIVETWEB_ENABLE_CXX + ) + ++set(PROJECT_VERSION "${VERSION}") ++if(CIVETWEB_ENABLE_SSL) ++ set(REQUIRES_OPENSSL openssl) ++endif() + configure_file( + cmake/${PROJECT_NAME}.pc.in + ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.pc +@@ -629,13 +633,13 @@ configure_file( + install( + FILES + "${PROJECT_BINARY_DIR}/${PROJECT_NAME}.pc" +- DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig" ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" + ) + + install( + FILES + "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-cpp.pc" +- DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig" ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" + ) + + write_basic_package_version_file(${PROJECT_NAME}-config-version.cmake +diff --git a/cmake/civetweb-cpp.pc.in b/cmake/civetweb-cpp.pc.in +index ca1232c..495da46 100644 +--- a/cmake/civetweb-cpp.pc.in ++++ b/cmake/civetweb-cpp.pc.in +@@ -10,3 +10,4 @@ Requires: + Libs: -L${libdir} -l@PROJECT_NAME@-cpp + Cflags: -I${includedir} + ++Requires.private: civetweb +diff --git a/cmake/civetweb.pc.in b/cmake/civetweb.pc.in +index 27cea8f..0826f61 100644 +--- a/cmake/civetweb.pc.in ++++ b/cmake/civetweb.pc.in +@@ -11,3 +11,4 @@ Libs: -L${libdir} -l@PROJECT_NAME@ + Cflags: -I${includedir} + + ++Requires.private: @REQUIRES_OPENSSL@ diff --git a/ports/civetweb/portfile.cmake b/ports/civetweb/portfile.cmake index 8387cac907..35cc9d1635 100644 --- a/ports/civetweb/portfile.cmake +++ b/ports/civetweb/portfile.cmake @@ -1,5 +1,3 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO civetweb/civetweb @@ -9,7 +7,9 @@ vcpkg_from_github( PATCHES disable_warnings.patch # cl will simply ignore the other invalid options. fix-fseeko.patch + pkgconfig.patch ) +file(REMOVE_RECURSE "${SOURCE_PATH}/src/third_party") vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES @@ -31,22 +31,23 @@ vcpkg_cmake_configure( -DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=OFF -DCIVETWEB_ENABLE_WEBSOCKETS=ON -DCIVETWEB_ALLOW_WARNINGS=ON + "-DVERSION=${VERSION}" ${FEATURE_OPTIONS} ) vcpkg_cmake_install() - +vcpkg_copy_pdbs() vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/civetweb) +vcpkg_fixup_pkgconfig() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/civetweb.h" "defined(CIVETWEB_DLL_IMPORTS)" 1) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/CivetServer.h" "defined(CIVETWEB_CXX_DLL_IMPORTS)" 1) +endif() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/pkgconfig") -file(RENAME "${CURRENT_PACKAGES_DIR}/share/pkgconfig/civetweb.pc" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/civetweb.pc") -file(RENAME "${CURRENT_PACKAGES_DIR}/share/pkgconfig/civetweb-cpp.pc" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/civetweb-cpp.pc") -vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/pkgconfig") -# Handle copyright -file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) - -vcpkg_copy_pdbs() +file(COPY "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md") diff --git a/ports/civetweb/usage b/ports/civetweb/usage new file mode 100644 index 0000000000..287a2ff668 --- /dev/null +++ b/ports/civetweb/usage @@ -0,0 +1,4 @@ +civetweb provides CMake targets: + + find_package(civetweb CONFIG REQUIRED) + target_link_libraries(main PRIVATE civetweb::civetweb) diff --git a/ports/civetweb/vcpkg.json b/ports/civetweb/vcpkg.json index ab5c083e91..9c09781558 100644 --- a/ports/civetweb/vcpkg.json +++ b/ports/civetweb/vcpkg.json @@ -1,6 +1,7 @@ { "name": "civetweb", "version": "1.16", + "port-version": 1, "description": "Easy to use, powerful, C/C++ embeddable web server.", "homepage": "https://github.com/civetweb/civetweb", "supports": "!uwp", diff --git a/versions/baseline.json b/versions/baseline.json index 2a79f1a69b..5fe6a006d8 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1582,7 +1582,7 @@ }, "civetweb": { "baseline": "1.16", - "port-version": 0 + "port-version": 1 }, "cjson": { "baseline": "1.7.16", diff --git a/versions/c-/civetweb.json b/versions/c-/civetweb.json index 323c526f17..3faace72dd 100644 --- a/versions/c-/civetweb.json +++ b/versions/c-/civetweb.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "23fa18e460290d6b0629ca6487f69b56845cfbda", + "version": "1.16", + "port-version": 1 + }, { "git-tree": "46ba5309a5759827c0d729344e8f17cc5f3132b9", "version": "1.16",