diff --git a/ports/c-ares/CONTROL b/ports/c-ares/CONTROL deleted file mode 100644 index c7243e1e81..0000000000 --- a/ports/c-ares/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: c-ares -Version: 1.17.1 -Homepage: https://github.com/c-ares/c-ares -Description: A C library for asynchronous DNS requests -Supports: !uwp \ No newline at end of file diff --git a/ports/c-ares/portfile.cmake b/ports/c-ares/portfile.cmake index a42fc9fc3d..0ec1740da1 100644 --- a/ports/c-ares/portfile.cmake +++ b/ports/c-ares/portfile.cmake @@ -8,43 +8,35 @@ vcpkg_from_github( HEAD_REF master ) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(CARES_STATIC 1) - set(CARES_SHARED 0) -else() - set(CARES_STATIC 0) - set(CARES_SHARED 1) -endif() +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DCARES_STATIC=${CARES_STATIC} - -DCARES_SHARED=${CARES_SHARED} + -DCARES_STATIC=${BUILD_STATIC} + -DCARES_SHARED=${BUILD_SHARED} + -DCARES_BUILD_TOOLS=OFF + -DCARES_BUILD_TESTS=OFF + -DCARES_BUILD_CONTAINER_TESTS=OFF ) vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/c-ares) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) -else() - file(GLOB EXE_FILES - "${CURRENT_PACKAGES_DIR}/bin/*.exe" - "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe" - ) - if (EXE_FILES) - file(REMOVE ${EXE_FILES}) - endif() -endif() - vcpkg_copy_pdbs() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/ares.h + "#ifdef CARES_STATICLIB" "#if 1" + ) + + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") # Empty folders +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/c-ares/vcpkg.json b/ports/c-ares/vcpkg.json new file mode 100644 index 0000000000..a8833ac425 --- /dev/null +++ b/ports/c-ares/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "c-ares", + "version": "1.17.1", + "port-version": 1, + "description": "A C library for asynchronous DNS requests", + "homepage": "https://github.com/c-ares/c-ares", + "supports": "!uwp" +} diff --git a/versions/baseline.json b/versions/baseline.json index 3cb2da8a0f..4d3b05fca0 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1058,7 +1058,7 @@ }, "c-ares": { "baseline": "1.17.1", - "port-version": 0 + "port-version": 1 }, "c4core": { "baseline": "2020-04-12", diff --git a/versions/c-/c-ares.json b/versions/c-/c-ares.json index d3fbc142ed..39bbc667cc 100644 --- a/versions/c-/c-ares.json +++ b/versions/c-/c-ares.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "1e8d84e28abdb8437a2665651b4359da40a3333f", + "version": "1.17.1", + "port-version": 1 + }, { "git-tree": "a35b0a23f91ec79cecdcb83c82840f7305dbd709", "version-string": "1.17.1",