[glib] Bump to 2.75.3 (#29644)

* [glib] Update to 2.75.3.

* [glib] Fix intl detection when consumed in CMake.

When consuming glib in CMake through `pkg_check_modules`, libintl
(provided by `gettext`) needs to specified in the pc file as `-lintl`
without any quotation. Otherwise it is not picked up as a dependency
and static linking fails.

Also `vcpkg_fixup_pkgconfig` needs to be called before editing pc files.

* [glib] Cleanup portfile.

* [glib] Update baseline.
This commit is contained in:
Pierre Wendling 2023-02-15 13:00:35 -05:00 committed by GitHub
parent ee71be7ea7
commit f468f46b78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 14 deletions

View File

@ -2,14 +2,14 @@ diff --git a/meson.build b/meson.build
index f44fa2d4e..d465253af 100644
--- a/meson.build
+++ b/meson.build
@@ -2090,9 +2090,9 @@ libz_dep = dependency('zlib')
@@ -2088,9 +2088,9 @@
# proxy-libintl subproject.
# FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
# implementations. This could be extended if issues are found in some platforms.
-libintl_deps = []
-libintl = dependency('intl', required: false)
-libintl = dependency('intl', required: false, allow_fallback: false)
-if libintl.found()
+libintl = dependency('Intl', method:'cmake', required : true)
+libintl = dependency('Intl', method:'cmake', required: true)
+libintl_deps = [libintl]
+if false
# libintl supports different threading APIs, which may not

View File

@ -1,10 +1,8 @@
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
string(REGEX MATCH "^([0-9]*[.][0-9]*)" GLIB_MAJOR_MINOR "${VERSION}")
vcpkg_download_distfile(GLIB_ARCHIVE
URLS "https://download.gnome.org/sources/glib/${GLIB_MAJOR_MINOR}/glib-${VERSION}.tar.xz"
FILENAME "glib-${VERSION}.tar.xz"
SHA512 4338bf3e42ccbf3679f60b917194070040ff94ba3643121e8916180d6949f3b8cc308b6ad73912bebcb53a29920954bcfb2216bacca0503473a897f1fd023981
SHA512 44aa53d0dae69e50c8d5d9adb7c90034c4c2ab5db3c74106c91bfdbdca41bc5523b32b16c33bc65b3c6bf0037bdecb344b80e9708930bde54ac7c618c34ea5a8
)
vcpkg_extract_source_archive(SOURCE_PATH
@ -84,11 +82,27 @@ elseif(VCPKG_TARGET_IS_OSX)
endif()
vcpkg_copy_tools(TOOL_NAMES ${GLIB_TOOLS} AUTO_CLEAN)
vcpkg_fixup_pkgconfig()
if(VCPKG_TARGET_IS_WINDOWS)
set(LIBINTL_NAME "intl.lib")
else()
set(LIBINTL_NAME "libintl")
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
string(APPEND LIBINTL_NAME "${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}")
else()
string(APPEND LIBINTL_NAME "${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}")
endif()
endif()
set(pc_replace_intl_path gio glib gmodule-no-export gobject gthread)
foreach(pc_prefix IN LISTS pc_replace_intl_path)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${pc_prefix}-2.0.pc" "\${prefix}/debug/lib/intl" "-lintl")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${pc_prefix}-2.0.pc" "\"" "")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${pc_prefix}-2.0.pc" "\${prefix}/debug/lib/${LIBINTL_NAME}" "-lintl")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${pc_prefix}-2.0.pc" "\${prefix}/lib/${LIBINTL_NAME}" "-lintl")
if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${pc_prefix}-2.0.pc" "\${prefix}/lib/intl" "-lintl")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${pc_prefix}-2.0.pc" "\"" "")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${pc_prefix}-2.0.pc" "\${prefix}/lib/${LIBINTL_NAME}" "-lintl")
endif()
endforeach()
@ -98,7 +112,6 @@ if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gio-2.0.pc" "\${bindir}" "\${prefix}/../tools/${PORT}")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/glib-2.0.pc" "\${bindir}" "\${prefix}/../tools/${PORT}")
endif()
vcpkg_fixup_pkgconfig()
# Fix python scripts
set(_file "${CURRENT_PACKAGES_DIR}/tools/${PORT}/gdbus-codegen")
@ -117,8 +130,8 @@ file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/share/gdb"
"${CURRENT_PACKAGES_DIR}/debug/lib/gio"
"${CURRENT_PACKAGES_DIR}/lib/gio"
)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/gio" "${CURRENT_PACKAGES_DIR}/lib/gio")
file(INSTALL "${SOURCE_PATH}/LICENSES/LGPL-2.1-or-later.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSES/LGPL-2.1-or-later.txt")

View File

@ -1,6 +1,6 @@
{
"name": "glib",
"version": "2.75.1",
"version": "2.75.3",
"description": "Portable, general-purpose utility library.",
"homepage": "https://developer.gnome.org/glib/",
"license": "LGPL-2.1-or-later",

View File

@ -2757,7 +2757,7 @@
"port-version": 0
},
"glib": {
"baseline": "2.75.1",
"baseline": "2.75.3",
"port-version": 0
},
"glibmm": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "787197c9431b9d1f8a5436aeca0fd1155d26c83b",
"version": "2.75.3",
"port-version": 0
},
{
"git-tree": "8f7840ed02d20169b1610123b0f35463c81c523d",
"version": "2.75.1",