Skip to content

Commit

Permalink
[many ports]switch to vcpkg-cmake / vckg-cmake-config part 1 (microso…
Browse files Browse the repository at this point in the history
…ft#29880)

* [many ports]switch to vcpkg-cmake / vckg-cmake-config

* version

* Missing changes

* version

* typo

* version

* typo

* version

* fix typo

* version

* deprecate vcpkg_extract_source_archive_ex

* version

* fix arguments

* version

---------

Co-authored-by: jyu49 <[email protected]>
  • Loading branch information
JackBoosY and jyu49 authored Mar 6, 2023
1 parent bd719c5 commit a6cb729
Show file tree
Hide file tree
Showing 154 changed files with 1,228 additions and 556 deletions.
17 changes: 8 additions & 9 deletions ports/absent/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,28 @@ vcpkg_from_github(
SHA512 c7b7d29422ef8afc48e3093496e1dd055cfe9969ae037c2b06ea70fe4283e7a7e9129171efaa257e909c535e24df5861b992b24b00ec03f965730e6a22e13015
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTS=OFF
)

vcpkg_install_cmake()
vcpkg_cmake_install()

vcpkg_fixup_cmake_targets(
vcpkg_cmake_config_fixup(
CONFIG_PATH lib/cmake/${PORT}
)

file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug
${CURRENT_PACKAGES_DIR}/lib
"${CURRENT_PACKAGES_DIR}/debug"
"${CURRENT_PACKAGES_DIR}/lib"
)

file(INSTALL
${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}
"${SOURCE_PATH}/README.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
)

file(INSTALL
${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright
"${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright
)

14 changes: 12 additions & 2 deletions ports/absent/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"name": "absent",
"version-string": "0.3.1",
"port-version": 1,
"port-version": 2,
"description": "A small C++17 library meant to simplify the composition of nullable types in a generic, type-safe, and declarative way",
"homepage": "https://github.com/rvarago/absent"
"homepage": "https://github.com/rvarago/absent",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
15 changes: 7 additions & 8 deletions ports/ade/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@ vcpkg_from_github(
HEAD_REF master
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_DEBUG
-DCMAKE_DEBUG_POSTFIX=d
)

vcpkg_install_cmake()
vcpkg_cmake_install()

vcpkg_fixup_cmake_targets()
vcpkg_cmake_config_fixup()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ade RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
14 changes: 12 additions & 2 deletions ports/ade/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"name": "ade",
"version-string": "0.1.1f",
"port-version": 2,
"description": "ADE Framework is a graph construction, manipulation, and processing framework. ADE Framework is suitable for organizing data flow processing and execution."
"port-version": 3,
"description": "ADE Framework is a graph construction, manipulation, and processing framework. ADE Framework is suitable for organizing data flow processing and execution.",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
21 changes: 10 additions & 11 deletions ports/alac-decoder/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,26 @@ vcpkg_download_distfile(ARCHIVE
SHA512 4b37d4fe37681bfccaa4a27fbaf11eb2a1fba5f14e77d219a6d9814ff44d1168534d05eb19443dd2fd11e6fcdf4da3a22e3f3c79314cb7a6767c152351b13e29
)

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE "${ARCHIVE}"
PATCHES
remove_stdint_headers.patch
no-pragma-warning.patch
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/decomp.c DESTINATION ${SOURCE_PATH})
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/decomp.c" DESTINATION "${SOURCE_PATH}")

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_DEBUG
-DDISABLE_INSTALL_HEADERS=ON
-DDISABLE_INSTALL_TOOLS=ON
)

vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")

file(INSTALL ${SOURCE_PATH}/README DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/README" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
14 changes: 12 additions & 2 deletions ports/alac-decoder/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"name": "alac-decoder",
"version-string": "0.2",
"port-version": 5,
"port-version": 6,
"description": "ALAC C implementation of a decoder, written from reverse engineering the file format",
"homepage": "https://distfiles.macports.org/alac_decoder"
"homepage": "https://distfiles.macports.org/alac_decoder",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
17 changes: 9 additions & 8 deletions ports/alac/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ vcpkg_from_github(
HEAD_REF master
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON -DDISABLE_INSTALL_TOOLS=ON
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_DEBUG
-DDISABLE_INSTALL_HEADERS=ON
-DDISABLE_INSTALL_TOOLS=ON
)

vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/alac)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/alac RENAME copyright)
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/alac" RENAME copyright)
14 changes: 12 additions & 2 deletions ports/alac/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
{
"name": "alac",
"version-string": "2017-11-03-c38887c5",
"port-version": 2,
"port-version": 3,
"description": "The Apple Lossless Audio Codec (ALAC) is a lossless audio codec developed by Apple and deployed on all of its platforms and devices.",
"homepage": "https://github.com/macosforge/alac",
"supports": "!uwp"
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
12 changes: 5 additions & 7 deletions ports/aliyun-oss-c-sdk/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ vcpkg_from_github(
patch.patch
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)

vcpkg_install_cmake()
vcpkg_cmake_install()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
12 changes: 10 additions & 2 deletions ports/aliyun-oss-c-sdk/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
{
"name": "aliyun-oss-c-sdk",
"version-string": "3.10.0",
"port-version": 1,
"port-version": 2,
"description": "Alibaba Cloud Object Storage Service (OSS) is a cloud storage service provided by Alibaba Cloud, featuring massive capacity, security, a low cost, and high reliability.",
"supports": "!(uwp | linux | osx)",
"dependencies": [
"apr-util",
"curl"
"curl",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
19 changes: 9 additions & 10 deletions ports/ampl-mp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,29 @@ if (NOT TARGET_TRIPLET STREQUAL HOST_TRIPLET)
endif()
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD=no
-DBUILD_TESTING=OFF
-DMP_VARIADIC_TEMPLATES=OFF
-DARITHCHK_EXEC=${ARITHCHK_EXEC}
)

vcpkg_install_cmake()
vcpkg_cmake_install()

vcpkg_copy_pdbs()

vcpkg_copy_tools(TOOL_NAMES gen-expr-info AUTO_CLEAN)

vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-mp TARGET_PATH share/unofficial-mp)
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-mp)

file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/share
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
# remove amplsig.dll and cp.dll, see https://github.com/ampl/mp/issues/130
${CURRENT_PACKAGES_DIR}/debug/bin
${CURRENT_PACKAGES_DIR}/bin
"${CURRENT_PACKAGES_DIR}/debug/bin"
"${CURRENT_PACKAGES_DIR}/bin"
)

configure_file(${SOURCE_PATH}/LICENSE.rst ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
configure_file("${SOURCE_PATH}/LICENSE.rst" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
10 changes: 9 additions & 1 deletion ports/ampl-mp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ampl-mp",
"version-date": "2020-11-11",
"port-version": 3,
"port-version": 4,
"description": "An open-source library for mathematical programming",
"homepage": "https://github.com/ampl/mp",
"supports": "!uwp",
Expand All @@ -10,6 +10,14 @@
{
"name": "ampl-mp",
"host": true
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
5 changes: 2 additions & 3 deletions ports/anyrpc/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ vcpkg_from_github(

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ANYRPC_LIB_BUILD_SHARED)

vcpkg_configure_cmake(
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
PREFER_NINJA
DISABLE_PARALLEL_CONFIGURE
OPTIONS
-DBUILD_EXAMPLES=OFF
Expand All @@ -22,7 +21,7 @@ vcpkg_configure_cmake(
-DANYRPC_LIB_BUILD_SHARED=${ANYRPC_LIB_BUILD_SHARED}
)

vcpkg_install_cmake()
vcpkg_cmake_install()

file(INSTALL "${SOURCE_PATH}/license" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
Expand Down
14 changes: 12 additions & 2 deletions ports/anyrpc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"name": "anyrpc",
"version-date": "2021-08-24",
"port-version": 1,
"port-version": 2,
"description": "A multiprotocol remote procedure call system for C++.",
"homepage": "https://github.com/sgieseking/anyrpc"
"homepage": "https://github.com/sgieseking/anyrpc",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
11 changes: 5 additions & 6 deletions ports/argagg/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,17 @@ vcpkg_from_github(
HEAD_REF master
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DARGAGG_BUILD_EXAMPLES=OFF
-DARGAGG_BUILD_TESTS=OFF
-DARGAGG_BUILD_DOCS=OFF
)

vcpkg_install_cmake()
vcpkg_cmake_install()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")

# Handle copyright
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
configure_file("${SOURCE_PATH}/LICENSE" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
14 changes: 12 additions & 2 deletions ports/argagg/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"name": "argagg",
"version-string": "0.4.6",
"port-version": 1,
"description": "A simple C++11 command line argument parser"
"port-version": 2,
"description": "A simple C++11 command line argument parser",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
Loading

0 comments on commit a6cb729

Please sign in to comment.