[libvips] new port (#50188)

This commit is contained in:
angelmixu 2026-07-02 01:40:51 +02:00 committed by GitHub
parent 1f5e034808
commit 3b0889cf23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 197 additions and 0 deletions

View File

@ -0,0 +1,95 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libvips/libvips
REF v${VERSION}
SHA512 6861bc7a65137817613448c2e5e44def7845e5537d68e43d245bf3b45eb0fad7ea297bc3864905ae4e33dbf11bc21ec6f76626ff92d15ee1aac6959768fbd256
HEAD_REF master
)
vcpkg_add_to_path("${CURRENT_HOST_INSTALLED_DIR}/tools/glib/")
# Derive Meson feature/boolean options directly from upstream meson_options.txt
# so we can disable any default features, as vcpkg is opt-in as default.
file(STRINGS "${SOURCE_PATH}/meson_options.txt" _meson_option_lines)
set(MESON_FEATURE_OPTIONS)
set(MESON_BOOLEAN_OPTIONS)
set(_current_option_name "")
set(_current_option_type "")
foreach(_line IN LISTS _meson_option_lines)
string(STRIP "${_line}" _line)
if(_line MATCHES "^option\\('([^']+)'")
set(_current_option_name "${CMAKE_MATCH_1}")
set(_current_option_type "")
elseif(NOT _current_option_name STREQUAL "" AND _line MATCHES "^type:[ ]*'([^']+)'")
set(_current_option_type "${CMAKE_MATCH_1}")
if(_current_option_type STREQUAL "feature")
list(APPEND MESON_FEATURE_OPTIONS "${_current_option_name}")
elseif(_current_option_type STREQUAL "boolean")
list(APPEND MESON_BOOLEAN_OPTIONS "${_current_option_name}")
endif()
elseif(NOT _current_option_name STREQUAL "" AND _line STREQUAL ")")
set(_current_option_name "")
set(_current_option_type "")
endif()
endforeach()
if(MESON_FEATURE_OPTIONS STREQUAL "" AND MESON_BOOLEAN_OPTIONS STREQUAL "")
message(FATAL_ERROR "Failed to parse Meson feature options from ${SOURCE_PATH}/meson_options.txt")
endif()
set(OPTIONS)
foreach(meson_option IN LISTS MESON_FEATURE_OPTIONS)
if("${meson_option}" IN_LIST FEATURES)
list(APPEND OPTIONS -D${meson_option}=enabled)
else()
list(APPEND OPTIONS -D${meson_option}=disabled)
endif()
endforeach()
foreach(boolean_option IN LISTS MESON_BOOLEAN_OPTIONS)
if("${boolean_option}" IN_LIST FEATURES)
list(APPEND OPTIONS -D${boolean_option}=true)
else()
list(APPEND OPTIONS -D${boolean_option}=false)
endif()
endforeach()
## until we get libvips v8.19 where fuzz has an option for being disabled,
## we have to avoid fuzz directory from meson.build in order for windows to build
## because MSVC does not support `__attribute__((weak))`
vcpkg_replace_string("${SOURCE_PATH}/meson.build" "subdir('fuzz')" "")
vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${OPTIONS}
)
vcpkg_install_meson()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
## tools are built by default, uncomment this for next libvips version where
## there's a tools option in the FEATURES and MESON OPTIONS file.
## Also, the tools feature should be added in the vcpkg.json file:
## ,
## "tools": {
## "description": "Build tools."
## },
#if("tools" IN_LIST FEATURES)
vcpkg_copy_tools(
TOOL_NAMES
vips
vipsedit
vipsheader
vipsthumbnail
AUTO_CLEAN
)
#endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

89
ports/libvips/vcpkg.json Normal file
View File

@ -0,0 +1,89 @@
{
"name": "libvips",
"version": "8.18.2",
"description": "libvips is a demand-driven, horizontally threaded image processing library.",
"homepage": "https://github.com/libvips/libvips",
"license": "LGPL-2.1-or-later",
"dependencies": [
"expat",
"glib",
{
"name": "glib",
"host": true
},
{
"name": "vcpkg-tool-meson",
"host": true
}
],
"features": {
"cplusplus": {
"description": "Build C++ API."
},
"deprecated": {
"description": "Build deprecated components."
},
"exif": {
"description": "Build with exif support.",
"dependencies": [
"libexif"
]
},
"fontconfig": {
"description": "Build with fontconfig support.",
"dependencies": [
"fontconfig",
"pango"
]
},
"jpeg": {
"description": "Build with jpeg support.",
"dependencies": [
"libjpeg-turbo"
]
},
"lcms": {
"description": "Build with lcms support.",
"dependencies": [
"lcms"
]
},
"pangocairo": {
"description": "Build with pangocairo support.",
"dependencies": [
"cairo",
"pango"
]
},
"png": {
"description": "Build with png support.",
"dependencies": [
"libpng"
]
},
"rsvg": {
"description": "Build with rsvg support.",
"dependencies": [
"librsvg"
]
},
"tiff": {
"description": "Build with tiff support.",
"dependencies": [
"tiff"
]
},
"webp": {
"description": "Build with WebP support.",
"dependencies": [
"libwebp"
]
},
"zlib": {
"description": "Build with zlib support.",
"dependencies": [
"zlib-ng"
]
}
}
}

View File

@ -5896,6 +5896,10 @@
"baseline": "20251119",
"port-version": 0
},
"libvips": {
"baseline": "8.18.2",
"port-version": 0
},
"libvmaf": {
"baseline": "3.2.0",
"port-version": 0

9
versions/l-/libvips.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "6d864e37a2fae385859acfc96bd2e0c05d6b8504",
"version": "8.18.2",
"port-version": 0
}
]
}