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

[vcpkg baseline][gdk-pixbuf] Fix build issues, license, cleanup #27371

Merged
merged 4 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
20 changes: 20 additions & 0 deletions ports/gdk-pixbuf/loaders-cache.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/gdk-pixbuf/meson.build b/gdk-pixbuf/meson.build
index 54ff9dd..27f8512 100644
--- a/gdk-pixbuf/meson.build
+++ b/gdk-pixbuf/meson.build
@@ -348,7 +348,14 @@ foreach bin: gdkpixbuf_bin
set_variable(bin_name.underscorify(), bin)
endforeach

-if not meson.is_cross_build()
+if dynamic_loaders.length() == 0
+ # skip tool invocation
+ cmake = find_program('cmake', required : true)
+ loaders_cache = custom_target('loaders.cache', output: 'loaders.cache', capture: true,
+ command: [ cmake, '-E', 'echo', '# No dynamic loaders enabled at build time' ],
+ build_by_default: true)
+ loaders_dep = declare_dependency(sources: [ loaders_cache ])
+elif not meson.is_cross_build()
# The 'loaders.cache' used for testing, so we don't accidentally
# load the installed cache; we always build it by default
loaders_cache = custom_target('loaders.cache',
53 changes: 15 additions & 38 deletions ports/gdk-pixbuf/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
set(GDK_PIXBUF_VERSION 2.42)
set(GDK_PIXBUF_PATCH 9)

vcpkg_from_gitlab(
GITLAB_URL https://gitlab.gnome.org/
OUT_SOURCE_PATH SOURCE_PATH
REPO GNOME/gdk-pixbuf
REF "${GDK_PIXBUF_VERSION}.${GDK_PIXBUF_PATCH}"
REF "${VERSION}"
SHA512 3406f47b413fe3860df410a0cc0076ce47d10605b39347105690c85616739e67e5dfd0804efcad758614b0c8d1369e410b9efaa704a234bfd19686b82595b9e1
HEAD_REF master
PATCHES
fix_build_error_windows.patch
loaders-cache.patch
)

if(VCPKG_TARGET_IS_WINDOWS)
Expand All @@ -31,48 +29,27 @@ vcpkg_configure_meson(
-Dgio_sniffing=false # Perform file type detection using GIO (Unused on MacOS and Windows)
-Dbuiltin_loaders=all # since it is unclear where loadable plugins should be located;
# Comma-separated list of loaders to build into gdk-pixbuf, or "none", or "all" to build all buildable loaders into gdk-pixbuf
ADDITIONAL_NATIVE_BINARIES glib-compile-resources='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-compile-resources'
glib-genmarshal='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-genmarshal'
glib-mkenums='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-mkenums'
ADDITIONAL_CROSS_BINARIES glib-compile-resources='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-compile-resources'
glib-genmarshal='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-genmarshal'
glib-mkenums='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-mkenums'
)
ADDITIONAL_BINARIES glib-compile-resources='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-compile-resources'
glib-genmarshal='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-genmarshal'
glib-mkenums='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-mkenums'
)
vcpkg_install_meson(ADD_BIN_TO_PATH)

# Fix paths in pc file.
set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gdk-pixbuf-2.0.pc")
if(EXISTS "${_file}")
file(READ "${_file}" _contents)
string(REPLACE [[${bindir}]] "\${prefix}/../tools/${PORT}" _contents "${_contents}")
file(WRITE "${_file}" "${_contents}")
endif()
set(_file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gdk-pixbuf-2.0.pc")
if(EXISTS "${_file}")
file(READ "${_file}" _contents)
string(REPLACE [[${bindir}]] "\${prefix}/tools/${PORT}" _contents "${_contents}")
file(WRITE "${_file}" "${_contents}")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gdk-pixbuf-2.0.pc" [[${bindir}]] "\${prefix}/tools/${PORT}")
if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gdk-pixbuf-2.0.pc" [[${bindir}]] "\${prefix}/../tools/${PORT}")
endif()

vcpkg_fixup_pkgconfig()

set(TOOL_NAMES gdk-pixbuf-csource gdk-pixbuf-pixdata gdk-pixbuf-query-loaders gdk-pixbuf-thumbnailer)

set(TOOL_NAMES gdk-pixbuf-csource gdk-pixbuf-pixdata gdk-pixbuf-query-loaders)
# gdk-pixbuf-thumbnailer is not compiled for cross-compiling
set(IS_NEED_REMOVE_THUMBNAILER ${VCPKG_CROSSCOMPILING})
# This adjusting logic might be place in vcpkg_common_definitions.cmake.
if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)86" OR VCPKG_TARGET_ARCHITECTURE MATCHES "(amd|AMD|x|X)64")
set(IS_NEED_REMOVE_THUMBNAILER false)
endif()
# vcpkg-meson cross-build configuration differs from VCPKG_CROSSCOMPILING
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/gdk-pixbuf-thumbnailer${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
list(APPEND TOOL_NAMES gdk-pixbuf-thumbnailer)
endif()
if(IS_NEED_REMOVE_THUMBNAILER)
list(REMOVE_ITEM TOOL_NAMES gdk-pixbuf-thumbnailer)
endif()

vcpkg_copy_pdbs()
vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN)

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

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

file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
9 changes: 6 additions & 3 deletions ports/gdk-pixbuf/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "gdk-pixbuf",
"version": "2.42.9",
"port-version": 1,
"port-version": 2,
"description": "Image loading library.",
"homepage": "https://gitlab.gnome.org/GNOME/gdk-pixbuf",
"license": "LGPL-2.1-only",
"license": "LGPL-2.1-or-later",
"dependencies": [
"gettext",
"glib",
Expand All @@ -13,7 +13,10 @@
"host": true
},
"libpng",
"tiff",
{
"name": "tiff",
"default-features": false
},
{
"name": "vcpkg-tool-meson",
"host": true
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2550,7 +2550,7 @@
},
"gdk-pixbuf": {
"baseline": "2.42.9",
"port-version": 1
"port-version": 2
},
"gemmlowp": {
"baseline": "2021-09-28",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/gdk-pixbuf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b42054b8e96faa6387ef8df5870276df1b0902e1",
"version": "2.42.9",
"port-version": 2
},
{
"git-tree": "ec4e9442f7771435547892134cde77081fd013d7",
"version": "2.42.9",
Expand Down