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

[libyaml] Export the pkgconfig files #21829

Merged
merged 4 commits into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
15 changes: 15 additions & 0 deletions ports/libyaml/export-pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f81148..8006536 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -158,3 +158,10 @@ install(
FILES ${config_version_file}
DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT Development
)
+
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(exec_prefix ${CMAKE_INSTALL_PREFIX})
+set(includedir ${CMAKE_INSTALL_PREFIX}/include)
+set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
+configure_file(yaml-0.1.pc.in ${PROJECT_BINARY_DIR}/yaml-0.1.pc @ONLY)
+install(FILES ${PROJECT_BINARY_DIR}/yaml-0.1.pc DESTINATION lib/pkgconfig)
21 changes: 13 additions & 8 deletions ports/libyaml/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,26 @@ vcpkg_from_github(
REF 2c891fc7a770e8ba2fec34fc6b545c672beb37e6 # 0.2.5
SHA512 7cdde7b48c937777b851747f7e0b9a74cb7da30173e09305dad931ef83c3fcee3e125e721166690fe6a0987ba897564500530e5518e4b66b1c9b1db8900bf320
HEAD_REF master
PATCHES ${PATCHES}
PATCHES
${PATCHES}
export-pkgconfig.patch
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTING=OFF
-DINSTALL_CMAKE_DIR=share/yaml
)

vcpkg_install_cmake()
vcpkg_cmake_install()

vcpkg_fixup_cmake_targets(CONFIG_PATH share/yaml TARGET_PATH share/yaml)
vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/include/config.h ${CURRENT_PACKAGES_DIR}/debug/share)
vcpkg_cmake_config_fixup(CONFIG_PATH share/yaml)

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

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

configure_file("${SOURCE_PATH}/License" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
14 changes: 12 additions & 2 deletions ports/libyaml/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"name": "libyaml",
"version-string": "0.2.5",
"port-version": 1,
"port-version": 2,
"description": "A C library for parsing and emitting YAML.",
"homepage": "https://github.com/yaml/libyaml"
"homepage": "https://github.com/yaml/libyaml",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4086,7 +4086,7 @@
},
"libyaml": {
"baseline": "0.2.5",
"port-version": 1
"port-version": 2
},
"libyuv": {
"baseline": "2021-04-15",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libyaml.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4f95509b3fdd17f5bd543c680a35bddecd147356",
"version-string": "0.2.5",
"port-version": 2
},
{
"git-tree": "05217bc30337071036997a4d6152165823db9531",
"version-string": "0.2.5",
Expand Down