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

[tinytiff] add new port #38874

Merged
merged 17 commits into from
May 31, 2024
34 changes: 34 additions & 0 deletions ports/tinytiff/msvc-message-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/src/tinytiffreader.c b/src/tinytiffreader.c
index 82cafee..026083a 100644
--- a/src/tinytiffreader.c
+++ b/src/tinytiffreader.c
@@ -56,7 +56,11 @@

#ifdef TINYTIFF_USE_WINAPI_FOR_FILEIO
# include <windows.h>
-# warning COMPILING TinyTIFFReader with WinAPI
+# ifdef _MSC_VER
+# pragma message(__FILE__ "(): COMPILING TinyTIFFWriter with WinAPI")
+# else
+# warning COMPILING TinyTIFFWriter with WinAPI
+# endif // _MSC_VER
EfesX marked this conversation as resolved.
Show resolved Hide resolved
# define TinyTIFFReader_POSTYPE DWORD
#else
# define TinyTIFFReader_POSTYPE fpos_t
diff --git a/src/tinytiffwriter.c b/src/tinytiffwriter.c
index 416e800..04b9ee4 100644
--- a/src/tinytiffwriter.c
+++ b/src/tinytiffwriter.c
@@ -50,7 +50,11 @@

#ifdef TINYTIFF_USE_WINAPI_FOR_FILEIO
# include <windows.h>
-# warning COMPILING TinyTIFFWriter with WinAPI
+# ifdef _MSC_VER
+# pragma message(__FILE__ "(): COMPILING TinyTIFFWriter with WinAPI")
+# else
+# warning COMPILING TinyTIFFWriter with WinAPI
+# endif // _MSC_VER
# define TinyTIFFWriter_POSTYPE DWORD
#else
# define TinyTIFFWriter_POSTYPE fpos_t
49 changes: 49 additions & 0 deletions ports/tinytiff/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"winapi" TinyTIFF_USE_WINAPI_FOR_FILEIO
EfesX marked this conversation as resolved.
Show resolved Hide resolved
)

if(NOT VCPKG_TARGET_IS_WINDOWS AND TinyTIFF_USE_WINAPI_FOR_FILEIO)
message(FATAL_ERROR "Can't build ${PORT}:${TARGET_TRIPLET} with 'winapi' feature.")
endif()

EfesX marked this conversation as resolved.
Show resolved Hide resolved
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO jkriege2/TinyTIFF
REF ${VERSION}
SHA512 28fb3d1ef1630a4d20da021ccca93f99df8bd29462525be312dfb028239176ca940a43407b2db10488d891a1fbca65d8a59bc6cc097765389f35021e8b423885
HEAD_REF master
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(BUILD_SHARED_LIBS OFF)
else()
set(BUILD_SHARED_LIBS ON)
endif()

EfesX marked this conversation as resolved.
Show resolved Hide resolved
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DTinyTIFF_BUILD_TESTS=OFF
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
EfesX marked this conversation as resolved.
Show resolved Hide resolved
-DTinyTIFF_USE_WINAPI_FOR_FILEIO=${TinyTIFF_USE_WINAPI_FOR_FILEIO}
EfesX marked this conversation as resolved.
Show resolved Hide resolved
PATCHES
# without this patch, the MSVC compiler will crash during the build process
"msvc-message-support.patch"
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/TinyTIFF DO_NOT_DELETE_PARENT_CONFIG_PATH)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/TinyTIFFXX)
EfesX marked this conversation as resolved.
Show resolved Hide resolved

vcpkg_copy_pdbs()

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

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
4 changes: 4 additions & 0 deletions ports/tinytiff/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tinytiff provides CMake targets:

find_package(TinyTIFF REQUIRED)
target_link_libraries(main PRIVATE TinyTIFF::TinyTIFF)
EfesX marked this conversation as resolved.
Show resolved Hide resolved
22 changes: 22 additions & 0 deletions ports/tinytiff/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "tinytiff",
"version": "4.0.0.0",
"description": "Lightweight TIFF reader/writer library",
"homepage": "http://jkriege2.github.io/TinyTIFF/",
EfesX marked this conversation as resolved.
Show resolved Hide resolved
"license": "LGPL-3.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"winapi": {
"description": "Use WIN-API for File-IO"
EfesX marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8744,6 +8744,10 @@
"baseline": "1.1",
"port-version": 6
},
"tinytiff": {
"baseline": "4.0.0.0",
"port-version": 0
},
"tinytoml": {
"baseline": "20180219",
"port-version": 3
Expand Down
9 changes: 9 additions & 0 deletions versions/t-/tinytiff.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "e6ad73dfea0c0f6cd89038c1a0fc3a263c5d36d4",
"version": "4.0.0.0",
"port-version": 0
}
]
}
Loading