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

[tiff] Update to 4.3.0, improvements #18187

Merged
merged 18 commits into from
Jun 9, 2021
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
10 changes: 0 additions & 10 deletions ports/selene/CONTROL

This file was deleted.

25 changes: 14 additions & 11 deletions ports/selene/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
disable_x86_intrinsics_on_arm.patch
tiff-deprecated-typedefs.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "opencv" SELENE_USE_OPENCV)
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"opencv" SELENE_USE_OPENCV
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS ${FEATURE_OPTIONS}
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
)

vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/selene)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/selene)
vcpkg_copy_pdbs()

# Include files should not be duplicated into the /debug/include directory.
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
14 changes: 14 additions & 0 deletions ports/selene/tiff-deprecated-typedefs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/selene/CMakeLists.txt b/selene/CMakeLists.txt
index ab2760c..d1e1e6c 100644
--- a/selene/CMakeLists.txt
+++ b/selene/CMakeLists.txt
@@ -229,6 +229,9 @@ if(TIFF_FOUND)
)

target_compile_options(selene_img_io_tiff PRIVATE ${SELENE_COMPILER_OPTIONS} ${SELENE_IMG_COMPILER_OPTIONS})
+ if(MSVC)
+ target_compile_options(selene_img_io_tiff PRIVATE /wd4996)
+ endif()

target_compile_definitions(selene_img_io_tiff PRIVATE ${SELENE_COMPILER_DEFINITIONS})

32 changes: 32 additions & 0 deletions ports/selene/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "selene",
"version": "0.3.1",
"port-version": 4,
"description": "A C++17 image representation, processing and I/O library.",
"homepage": "https://github.com/kmhofmann/selene",
"dependencies": [
"libjpeg-turbo",
"libpng",
"tiff",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
],
"features": {
"opencv": {
"description": "Enable using OpenCV",
"dependencies": [
{
"name": "opencv",
"default-features": false
}
]
}
}
}
13 changes: 0 additions & 13 deletions ports/tiff/CONTROL

This file was deleted.

97 changes: 36 additions & 61 deletions ports/tiff/cmakelists.patch
Original file line number Diff line number Diff line change
@@ -1,84 +1,59 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 845ddf0..9ccb9b3 100644
index dddbaf6..ee57b7b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -181,9 +181,7 @@ foreach(flag ${test_flags})
endif (${test_c_flag})
endforeach(flag ${test_flags})
@@ -133,16 +133,28 @@ find_package(CMath REQUIRED)
# Release support
include(Release)

-if(MSVC)
- set(CMAKE_DEBUG_POSTFIX "d")
-endif()
+set(CMAKE_DEBUG_POSTFIX "d")

option(ld-version-script "Enable linker version script" ON)
# Check if LD supports linker scripts.
@@ -601,12 +599,15 @@ check_include_file(OpenGL/gl.h HAVE_OPENGL_GL_H)
check_include_file(OpenGL/glu.h HAVE_OPENGL_GLU_H)

# Win32 IO
-set(win32_io FALSE)
-if(WIN32)
- set(win32_io TRUE)
+set(USE_WIN32_FILEIO FALSE CACHE BOOL "")
+if(MSVC)
+ if (NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") #on UWP we use the unix I/O api
+ set(USE_WIN32_FILEIO TRUE CACHE BOOL "" FORCE)
+ add_definitions(-DUSE_WIN32_FILEIO)
+ endif()
+ add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS /wd4996)
endif()

-set(USE_WIN32_FILEIO ${win32_io})

# Orthogonal features

@@ -708,16 +709,28 @@ endif()

#report_values(TIFF_INCLUDES TIFF_LIBRARY_DEPS)
+ add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
+ add_compile_options(/wd4996)
+endif()

+option(BUILD_TOOLS "Build tool executables" ON)
+option(BUILD_DOCS "Build docs" ON)
+option(BUILD_CONTRIB "Build contributed executables" ON)
+option(BUILD_TESTS "Build tests" ON)
+
# Process subdirectories
add_subdirectory(port)
add_subdirectory(libtiff)
-add_subdirectory(tools)
-add_subdirectory(test)
-add_subdirectory(contrib)
-add_subdirectory(build)
-add_subdirectory(man)
-add_subdirectory(html)
-
+if(BUILD_TOOLS)
+ add_subdirectory(tools)
add_subdirectory(tools)
+endif()
+if(BUILD_TESTS)
+ add_subdirectory(test)
add_subdirectory(test)
+endif()
+if(BUILD_CONTRIB)
+ add_subdirectory(contrib)
add_subdirectory(contrib)
add_subdirectory(build)
+endif()
+if(BUILD_DOCS)
+ add_subdirectory(build)
+ add_subdirectory(man)
+ add_subdirectory(html)
add_subdirectory(man)
add_subdirectory(html)
+endif()
#message(STATUS "EXTRA_DIST: ${EXTRA_DIST}")


message(STATUS "")
diff --git a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt
index 1cf1b75..4ee29f6 100644
index 90105b2..db5f140 100755
--- a/libtiff/CMakeLists.txt
+++ b/libtiff/CMakeLists.txt
@@ -143,7 +143,7 @@ install(FILES ${tiff_HEADERS} ${nodist_tiff_HEADERS}
DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
@@ -161,7 +161,7 @@ if(CXX_SUPPORT)
set(tiffxx_HEADERS
tiffio.hxx)

- add_library(tiffxx)
+ add_library(tiffxx STATIC)
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
target_sources(tiffxx PRIVATE
${tiffxx_HEADERS}
tif_stream.cxx)
@@ -189,6 +189,7 @@ if(CXX_SUPPORT)

if(CXX_SUPPORT)
- add_library(tiffxx ${tiffxx_SOURCES} ${tiffxx_HEADERS})
+ add_library(tiffxx STATIC ${tiffxx_SOURCES} ${tiffxx_HEADERS})
target_link_libraries(tiffxx tiff)
set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION})
if(NOT CYGWIN)
endif()

+if(NOT CMAKE_CROSSCOMPILING)
add_executable(mkg3states)
target_sources(mkg3states PRIVATE mkg3states.c tif_fax3.h)
target_link_libraries(mkg3states tiff port)
@@ -198,3 +199,4 @@ add_custom_target(faxtable
COMMAND ${CMAKE_COMMAND} -E rm "tif_fax3sm.c"
COMMAND mkg3states -b -c const "tif_fax3sm.c"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
+endif()
84 changes: 84 additions & 0 deletions ports/tiff/fix-pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2188f97..93e6a34 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -124,8 +124,6 @@ include(WindowsSupport)
# Orthogonal features
include(LibraryFeatures)

-# pkg-config support
-include(PkgConfig)

# math.h/libm portability
find_package(CMath REQUIRED)
@@ -156,6 +154,8 @@ add_subdirectory(man)
add_subdirectory(html)
endif()

+# pkg-config support
+include(PkgConfig)

message(STATUS "")
message(STATUS "Libtiff is now configured for ${CMAKE_SYSTEM}")
diff --git a/libtiff-4.pc.in b/libtiff-4.pc.in
index abe75a6..8899725 100644
--- a/libtiff-4.pc.in
+++ b/libtiff-4.pc.in
@@ -5,7 +5,8 @@ includedir=@includedir@

Name: libtiff
Description: Tag Image File Format (TIFF) library.
-Version: @VERSION@
+Version: @LIBTIFF_VERSION_FULL@
Libs: -L${libdir} -ltiff
Libs.private: @tiff_libs_private@
Cflags: -I${includedir}
+Requires.private: @tiff_requires_private@
diff --git a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt
index db5f140..6db71ee 100755
--- a/libtiff/CMakeLists.txt
+++ b/libtiff/CMakeLists.txt
@@ -106,14 +106,19 @@ target_include_directories(tiff
${TIFF_INCLUDES}
)

+set(tiff_libs_private "")
+set(tiff_requires_private "")
+
if(ZIP_SUPPORT)
target_link_libraries(tiff PRIVATE ZLIB::ZLIB)
+ string(APPEND tiff_requires_private " zlib")
endif()
if(ZIP_SUPPORT AND LIBDEFLATE_SUPPORT)
target_link_libraries(tiff PRIVATE Deflate::Deflate)
endif()
if(JPEG_SUPPORT)
target_link_libraries(tiff PRIVATE JPEG::JPEG)
+ string(APPEND tiff_requires_private " libjpeg")
if(JPEG_DUAL_MODE_8_12)
target_include_directories(tiff PRIVATE ${JPEG12_INCLUDE_DIR})
target_link_libraries(tiff PRIVATE ${JPEG12_LIBRARIES})
@@ -127,14 +132,23 @@ if(LERC_SUPPORT)
endif()
if(LZMA_SUPPORT)
target_link_libraries(tiff PRIVATE LibLZMA::LibLZMA)
+ string(APPEND tiff_requires_private " liblzma")
endif()
if(ZSTD_SUPPORT)
target_link_libraries(tiff PRIVATE ZSTD::ZSTD)
+ string(APPEND tiff_requires_private " libzstd")
endif()
if(WEBP_SUPPORT)
target_link_libraries(tiff PRIVATE WebP::WebP)
+ string(APPEND tiff_requires_private " libwebp")
endif()
target_link_libraries(tiff PRIVATE CMath::CMath)
+if(CMath_LIBRARY)
+ string(APPEND tiff_libs_private " -lm")
+endif()
+
+set(tiff_libs_private "${tiff_libs_private}" PARENT_SCOPE)
+set(tiff_requires_private "${tiff_requires_private}" PARENT_SCOPE)

set_target_properties(tiff PROPERTIES SOVERSION ${SO_COMPATVERSION})
if(NOT CYGWIN)
13 changes: 0 additions & 13 deletions ports/tiff/fix-stddef.patch

This file was deleted.

Loading