Skip to content

Commit

Permalink
[many ports]switch to vcpkg-cmake / vckg-cmake-config part 3 (#29883)
Browse files Browse the repository at this point in the history
* [many ports]switch to vcpkg-cmake / vckg-cmake-config part 3

* version

* typo

* version

* typo

* version

* Fix params

* version

* deprecated vcpkg_extract_source_archive_ex

* version

* fix arguments

* version

* Rename argument

* version

* Deprecate vcpkg_extract_source_archive_ex

* version

---------

Co-authored-by: jyu49 <yu_jack@apple.com>
  • Loading branch information
JackBoosY and jyu49 authored Mar 7, 2023
1 parent 8421fa9 commit 8ead9c2
Show file tree
Hide file tree
Showing 151 changed files with 1,162 additions and 593 deletions.
27 changes: 13 additions & 14 deletions ports/libconfuse/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,34 @@ vcpkg_from_github(
HEAD_REF master
)

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

vcpkg_find_acquire_program(FLEX)
get_filename_component(FLEX_DIR ${FLEX} DIRECTORY)
vcpkg_add_to_path(${FLEX_DIR})
get_filename_component(FLEX_DIR "${FLEX}" DIRECTORY)
vcpkg_add_to_path("${FLEX_DIR}")

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

vcpkg_install_cmake()
vcpkg_cmake_install()

vcpkg_copy_pdbs()

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
vcpkg_replace_string(
${CURRENT_PACKAGES_DIR}/include/confuse.h
"${CURRENT_PACKAGES_DIR}/include/confuse.h"
"ifdef BUILDING_STATIC"
"if 1 // ifdef BUILDING_STATIC"
)
endif()

vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT})
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT})

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

# Handle copyright
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)

vcpkg_fixup_pkgconfig()
configure_file("${SOURCE_PATH}/LICENSE" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)

vcpkg_fixup_pkgconfig()
14 changes: 12 additions & 2 deletions ports/libconfuse/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"name": "libconfuse",
"version-string": "2019-07-14",
"port-version": 2,
"port-version": 3,
"description": "Small configuration file parser library for C",
"homepage": "https://github.com/martinh/libconfuse"
"homepage": "https://github.com/martinh/libconfuse",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
26 changes: 13 additions & 13 deletions ports/libcroco/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ vcpkg_download_distfile(ARCHIVE
SHA512 038a3ac9d160a8cf86a8a88c34367e154ef26ede289c93349332b7bc449a5199b51ea3611cebf3a2416ae23b9e45ecf8f9c6b24ea6d16a5519b796d3c7e272d4
)

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE "${ARCHIVE}"
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
configure_file(${SOURCE_PATH}/config.h.win32 ${SOURCE_PATH}/src/config.h COPYONLY)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
configure_file("${SOURCE_PATH}/config.h.win32" "${SOURCE_PATH}/src/config.h" COPYONLY)
file(READ "${SOURCE_PATH}/src/libcroco.symbols" SYMBOLS)
string(REGEX REPLACE ";[^\n]*\n" "" DEF "EXPORTS\n${SYMBOLS}")
file(WRITE "${SOURCE_PATH}/src/libcroco.def" "${DEF}")

vcpkg_find_acquire_program(PKGCONFIG)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
)

vcpkg_install_cmake()
vcpkg_cmake_install()

vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-libcroco TARGET_PATH share/unofficial-libcroco)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libcroco)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libcroco RENAME copyright)
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

vcpkg_copy_pdbs()
12 changes: 10 additions & 2 deletions ports/libcroco/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
{
"name": "libcroco",
"version": "0.6.13",
"port-version": 3,
"port-version": 4,
"description": "A standalone css2 parsing and manipulation library",
"dependencies": [
"glib",
"libxml2"
"libxml2",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
9 changes: 4 additions & 5 deletions ports/libebur128/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ vcpkg_from_github(
REF v1.2.6
SHA512 ab188c6d32cd14613119258313a8a3fb1167b55501c9f5b6d3ba738d674bc58f24ac3034c23d9730ed8dc3e95a23619bfb81719e4c79807a9a16c1a5b3423582
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS -DENABLE_INTERNAL_QUEUE_H=ON
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
9 changes: 8 additions & 1 deletion ports/libebur128/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"name": "libebur128",
"version-string": "1.2.6",
"port-version": 1,
"description": "A library implementing the EBU R128 audio loudness standard",
"homepage": "https://github.com/jiixyj/libebur128",
"license": "MIT",
"supports": "!(arm & windows)"
"supports": "!(arm & windows)",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
}
]
}
13 changes: 6 additions & 7 deletions ports/libevhtp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
regex EVHTP_DISABLE_REGEX
)

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

vcpkg_install_cmake()
vcpkg_cmake_install()

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

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

vcpkg_copy_pdbs()

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_fixup_pkgconfig()
12 changes: 10 additions & 2 deletions ports/libevhtp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
{
"name": "libevhtp",
"version": "1.2.18",
"port-version": 3,
"port-version": 4,
"description": "Libevhtp was created as a replacement API for Libevent's current HTTP API.",
"homepage": "https://github.com/criticalstack/libevhtp",
"supports": "!windows",
"dependencies": [
"libevent"
"libevent",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"openssl": {
Expand Down
15 changes: 7 additions & 8 deletions ports/libftdi/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ vcpkg_download_distfile(ARCHIVE
SHA512 540e5eb201a65936c3dbabff70c251deba1615874b11ff27c5ca16c39d71c150cf61758a68b541135a444fe32ab403b0fba0daf55c587647aaf9b3f400f1dee7
)

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF 0.20
vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE "${ARCHIVE}"
SOURCE_BASE "0.20"
PATCHES
libusb-win32.patch
shared-static.patch
Expand All @@ -16,9 +16,8 @@ vcpkg_extract_source_archive_ex(

file(COPY "${CMAKE_CURRENT_LIST_DIR}/exports.def" DESTINATION "${SOURCE_PATH}/src")

vcpkg_configure_cmake(
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
PREFER_NINJA
OPTIONS
-DDOCUMENTATION=OFF
-DEXAMPLES=OFF
Expand All @@ -33,9 +32,9 @@ vcpkg_configure_cmake(
-DLIB_INSTALL_DIR=lib
)

vcpkg_install_cmake()
vcpkg_cmake_install()

vcpkg_fixup_cmake_targets()
vcpkg_cmake_config_fixup()

vcpkg_fixup_pkgconfig()

Expand Down
12 changes: 10 additions & 2 deletions ports/libftdi/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
{
"name": "libftdi",
"version-string": "0.20",
"port-version": 3,
"port-version": 4,
"description": "FTDI USB driver with bitbang mode (v0.20)",
"dependencies": [
"libusb-win32"
"libusb-win32",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
22 changes: 10 additions & 12 deletions ports/libgta/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,30 @@ vcpkg_download_distfile(ARCHIVE
FILENAME "libgta-${LIBGTA_VERSION}.tar.xz"
SHA512 ${LIBGTA_HASH})

vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${LIBGTA_VERSION}
vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE "${ARCHIVE}"
SOURCE_BASE "${LIBGTA_VERSION}"
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ENABLE_SHARED_LIBS)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC_LIBS)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS -DGTA_BUILD_SHARED_LIB=${ENABLE_SHARED_LIBS}
-DGTA_BUILD_STATIC_LIB=${ENABLE_STATIC_LIBS}
-DGTA_BUILD_DOCUMENTATION=OFF
)

vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin" "${CURRENT_PACKAGES_DIR}/bin")
endif()

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

vcpkg_fixup_pkgconfig()
6 changes: 5 additions & 1 deletion ports/libgta/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"name": "libgta",
"version-string": "1.0.8",
"port-version": 3,
"port-version": 4,
"description": "Libgta is a portable library that implements the Generic Tagged Array (GTA) file format.",
"homepage": "https://download.savannah.nongnu.org/releases/gta",
"dependencies": [
"bzip2",
"liblzma",
{
"name": "vcpkg-cmake",
"host": true
},
"zlib"
]
}
25 changes: 12 additions & 13 deletions ports/libhdfs3/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO erikmuttersbach/libhdfs3
REF 9a60d79812d6dee72455f61bff57a93c3c7d56f5
SHA512 2b635ab979230c251243f01717105872245d7948f75832e58f50a09b0b06d1b366b3c5f3a3253fa538076e9f199003f28d10b9958293144dbc301276073a0633
HEAD_REF apache-rpc-9
OUT_SOURCE_PATH SOURCE_PATH
REPO erikmuttersbach/libhdfs3
REF 9a60d79812d6dee72455f61bff57a93c3c7d56f5
SHA512 2b635ab979230c251243f01717105872245d7948f75832e58f50a09b0b06d1b366b3c5f3a3253fa538076e9f199003f28d10b9958293144dbc301276073a0633
HEAD_REF apache-rpc-9
)

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

vcpkg_install_cmake()
vcpkg_cmake_install()

vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
FILE(INSTALL ${CMAKE_CURRENT_LIST_DIR}/libhdfs3Config.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
FILE(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
FILE(INSTALL "${CMAKE_CURRENT_LIST_DIR}/libhdfs3Config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
FILE(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
8 changes: 6 additions & 2 deletions ports/libhdfs3/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "libhdfs3",
"version-date": "2019-11-05",
"port-version": 3,
"port-version": 4,
"description": "Native Hadoop RPC protocol and HDFS data transfer protocol implementation",
"homepage": "https://github.com/erikmuttersbach/libhdfs3",
"supports": "!windows",
Expand All @@ -12,6 +12,10 @@
"platform": "!windows & !osx"
},
"libxml2",
"protobuf"
"protobuf",
{
"name": "vcpkg-cmake",
"host": true
}
]
}
Loading

0 comments on commit 8ead9c2

Please sign in to comment.