[libraw] Update to 0.21.1, revise dependencies (#29647)

* [libraw] Updated port to version 0.21.1

* [freeimage] Updated port to prepare for libraw version 0.21

* Add const in the right position

* Portfile modernization

* [libraw] Revise dependencies

* Add dng-lossy feature

* Update versions

* Add license

* Fix license name

---------

Co-authored-by: Anders Klemets <anderskl@microsoft.com>
This commit is contained in:
Kai Pastor 2023-02-16 22:35:47 +01:00 committed by GitHub
parent 3eafaa76fb
commit 2e3b958ff0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 296 additions and 231 deletions

View File

@ -19,34 +19,38 @@ vcpkg_from_sourceforge(
use-typedef-as-already-declared.patch
use-functions-to-override-libtiff-warning-error-handlers.patch
remove_auto_ptr.patch
rawlib-build-fix.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/FreeImageConfig-static.h DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/FreeImageConfig-dynamic.h DESTINATION ${SOURCE_PATH})
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt"
"${CMAKE_CURRENT_LIST_DIR}/FreeImageConfig-static.h"
"${CMAKE_CURRENT_LIST_DIR}/FreeImageConfig-dynamic.h"
DESTINATION "${SOURCE_PATH}"
)
# This is not strictly necessary, but to make sure
# that no "internal" libraries are used we remove them
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibJPEG)
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibPNG)
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibTIFF4)
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/ZLib)
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibOpenJPEG)
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibJXR)
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibWebP)
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibRawLite)
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/OpenEXR)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_DEBUG
-DINSTALL_HEADERS=OFF
file(REMOVE_RECURSE
"${SOURCE_PATH}/Source/LibJPEG"
"${SOURCE_PATH}/Source/LibPNG"
"${SOURCE_PATH}/Source/LibTIFF4"
"${SOURCE_PATH}/Source/ZLib"
"${SOURCE_PATH}/Source/LibOpenJPEG"
"${SOURCE_PATH}/Source/LibJXR"
"${SOURCE_PATH}/Source/LibWebP"
"${SOURCE_PATH}/Source/LibRawLite"
"${SOURCE_PATH}/Source/OpenEXR"
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_DEBUG
-DINSTALL_HEADERS=OFF
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup()
vcpkg_copy_pdbs()
file(INSTALL ${SOURCE_PATH}/license-fi.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/license-fi.txt")

View File

@ -0,0 +1,31 @@
diff --git a/Source/FreeImage/PluginRAW.cpp b/Source/FreeImage/PluginRAW.cpp
index c7f8758a..a57fd5f1 100644
--- a/Source/FreeImage/PluginRAW.cpp
+++ b/Source/FreeImage/PluginRAW.cpp
@@ -46,6 +46,14 @@ private:
long _eof;
INT64 _fsize;
+ // Minimal change to make version 3.18.0 of FreeImage compile with
+ // LibRaw 0.20 and later versions.
+ // Once the port of FreeImage has been updated to a version greater
+ // than 3.18.0, this patch should be removed as it will not be needed.
+#if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0, 20)
+ LibRaw_abstract_datastream * const substream = nullptr;
+#endif
+
public:
LibRaw_freeimage_datastream(FreeImageIO *io, fi_handle handle) : _io(io), _handle(handle) {
long start_pos = io->tell_proc(handle);
@@ -694,7 +702,11 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// --------------------------------------------
// (-s [0..N-1]) Select one raw image from input file
+#if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0, 20)
+ RawProcessor->imgdata.rawparams.shot_select = 0;
+#else
RawProcessor->imgdata.params.shot_select = 0;
+#endif
// (-w) Use camera white balance, if possible (otherwise, fallback to auto_wb)
RawProcessor->imgdata.params.use_camera_wb = 1;
// (-M) Use any color matrix from the camera metadata. This option only affects Olympus, Leaf, and Phase One cameras.

View File

@ -1,7 +1,7 @@
{
"name": "freeimage",
"version": "3.18.0",
"port-version": 24,
"port-version": 25,
"description": "Support library for graphics image formats",
"homepage": "https://sourceforge.net/projects/freeimage/",
"license": "GPL-2.0-only OR GPL-3.0-only OR FreeImage",
@ -18,6 +18,14 @@
"openexr",
"openjpeg",
"tiff",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
]
}

View File

@ -0,0 +1,102 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e7d5a66..484e76b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,8 +121,14 @@ include(MacroOptionalFindPackage)
# Math library check
+set(PC_LIBS_PRIVATE "")
+set(PC_REQUIRES_PRIVATE "")
if(NOT WIN32)
FIND_LIBRARY(MATH_LIBRARY m)
+ if(MATH_LIBRARY)
+ set(MATH_LIBRARY m)
+ string(APPEND PC_LIBS_PRIVATE " -lm")
+ endif()
endif()
# LCMS version 1 and 2 library check
@@ -133,7 +139,11 @@ set(LCMS_FOUND false)
if(ENABLE_LCMS)
message(STATUS "Check for LCMS2 availability...")
- find_package(LCMS2)
+ find_package(lcms2 CONFIG REQUIRED)
+ set(LCMS2_FOUND 1)
+ set(LCMS2_VERSION 2.14)
+ set(LCMS2_INCLUDE_DIR "")
+ set(LCMS2_LIBRARIES lcms2::lcms2)
if(LCMS2_FOUND AND (LCMS2_VERSION VERSION_EQUAL 2.1 OR LCMS2_VERSION VERSION_GREATER 2.1))
message(STATUS "Found LCMS2 : ${LCMS2_LIBRARIES} ${LCMS2_INCLUDE_DIR}")
include_directories(${LCMS2_INCLUDE_DIR})
@@ -141,6 +151,7 @@ if(ENABLE_LCMS)
# Flag to compile Little CMS version 2 with LibRaw
add_definitions(-DUSE_LCMS2)
set(LCMS_SUPPORT_CAN_BE_COMPILED true)
+ string(APPEND PC_REQUIRES_PRIVATE " lcms2")
else()
message(STATUS "Check for LCMS availability instead LCMS2...")
find_package(LCMS)
@@ -168,6 +179,7 @@ find_package(JPEG)
# Flag to use zlib with LibRaw DNG deflate codec
if(ZLIB_FOUND)
add_definitions(-DUSE_ZLIB)
+ string(APPEND PC_REQUIRES_PRIVATE " zlib")
endif()
# For registration to libraw_config.h
@@ -176,10 +188,11 @@ MACRO_BOOL_TO_01(ZLIB_FOUND LIBRAW_USE_DNGDEFLATECODEC)
# JPEG library check
find_package(JPEG)
if(JPEG_FOUND)
- if (${JPEG_VERSION} LESS 80)
+ if (${JPEG_VERSION} LESS 80 OR NOT CMAKE_REQUIRE_FIND_PACKAGE_JPEG)
set(JPEG8_FOUND FALSE)
else()
set(JPEG8_FOUND TRUE)
+ string(APPEND PC_REQUIRES_PRIVATE " libjpeg")
endif()
endif()
@@ -216,6 +229,7 @@ if(ENABLE_JASPER)
add_definitions(-DUSE_JASPER)
include_directories(${JASPER_INCLUDE_DIR})
set(JASPER_SUPPORT_CAN_BE_COMPILED true)
+ string(APPEND PC_REQUIRES_PRIVATE " jasper")
endif()
endif()
diff --git a/cmake/data/libraw.pc.cmake b/cmake/data/libraw.pc.cmake
index aa6ab21..90e0aae 100644
--- a/cmake/data/libraw.pc.cmake
+++ b/cmake/data/libraw.pc.cmake
@@ -10,3 +10,5 @@ Requires:
Version: @RAW_LIB_VERSION_STRING@
Libs: -L${libdir} -lraw
Cflags: -I${includedir} -I${includedir}/libraw
+Libs.private: @PC_LIBS_PRIVATE@
+Requires.private: @PC_REQUIRES_PRIVATE@
diff --git a/cmake/data/libraw_r.pc.cmake b/cmake/data/libraw_r.pc.cmake
index 4fadc36..4215e86 100644
--- a/cmake/data/libraw_r.pc.cmake
+++ b/cmake/data/libraw_r.pc.cmake
@@ -10,3 +10,5 @@ Requires:
Version: @RAW_LIB_VERSION_STRING@
Libs: -L${libdir} -lraw_r
Cflags: -I${includedir} -I${includedir}/libraw
+Libs.private: @PC_LIBS_PRIVATE@
+Requires.private: @PC_REQUIRES_PRIVATE@
diff --git a/cmake/librawConfig.cmake.in b/cmake/librawConfig.cmake.in
index b1b58d8..9b7baac 100644
--- a/cmake/librawConfig.cmake.in
+++ b/cmake/librawConfig.cmake.in
@@ -13,7 +13,7 @@ endif()
if(@LCMS_SUPPORT_CAN_BE_COMPILED@)
if(@LCMS2_FOUND@)
- find_dependency(LCMS2)
+ find_dependency(lcms2 CONFIG)
elseif(@LCMS_FOUND@)
find_dependency(LCMS)
endif()

View File

@ -1,41 +0,0 @@
--- a/cmake/modules/FindLibRaw.cmake 2016-11-02 07:09:50.000000000 +0100
+++ b/cmake/modules/FindLibRaw.cmake 2019-06-03 22:05:28.759307500 +0200
@@ -31,18 +31,36 @@
PATH_SUFFIXES libraw
)
-FIND_LIBRARY(LibRaw_LIBRARIES NAMES raw
+FIND_LIBRARY(LibRaw_LIBRARY_RELEASE NAMES raw
HINTS
${PC_LIBRAW_LIBDIR}
${PC_LIBRAW_LIBRARY_DIRS}
)
-FIND_LIBRARY(LibRaw_r_LIBRARIES NAMES raw_r
+FIND_LIBRARY(LibRaw_LIBRARY_DEBUG NAMES rawd
+ HINTS
+ ${PC_LIBRAW_LIBDIR}
+ ${PC_LIBRAW_LIBRARY_DIRS}
+ )
+
+INCLUDE(SelectLibraryConfigurations)
+
+select_library_configurations(LibRaw)
+
+FIND_LIBRARY(LibRaw_r_LIBRARY_RELEASE NAMES raw_r
HINTS
${PC_LIBRAW_R_LIBDIR}
${PC_LIBRAW_R_LIBRARY_DIRS}
)
+FIND_LIBRARY(LibRaw_r_LIBRARY_DEBUG NAMES raw_rd
+ HINTS
+ ${PC_LIBRAW_R_LIBDIR}
+ ${PC_LIBRAW_R_LIBRARY_DIRS}
+ )
+
+select_library_configurations(LibRaw_r)
+
IF(LibRaw_INCLUDE_DIR)
FILE(READ ${LibRaw_INCLUDE_DIR}/libraw_version.h _libraw_version_content)

View File

@ -1,36 +1,48 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 47f3869..136549b 100644
index 889fddf..e7d5a66 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -544,7 +544,7 @@ SET_TARGET_PROPERTIES(raw_r PROPERTIES OUTPUT_NAME "raw_r")
# -- Files to install -------------------------------------------------------------------------------------
@@ -588,7 +588,7 @@ if (LIBRAW_INSTALL)
# Configure and install data file for packaging.
include(GNUInstallDirs)
# Configure and install data file for packaging.
-IF(NOT WIN32)
+IF(1)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/data/libraw.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libraw.pc @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libraw.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)
- if(NOT MSVC)
+ if(1)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/data/libraw.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libraw.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libraw.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
@@ -570,8 +570,8 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libraw/libraw.h
# Install Shared binary files.
INSTALL(TARGETS raw
RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib${LIB_SUFFIX}
- ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ LIBRARY DESTINATION lib${LIB_SUFFIX}/manual-link
+ ARCHIVE DESTINATION lib${LIB_SUFFIX}/manual-link
)
@@ -612,7 +612,13 @@ if (LIBRAW_INSTALL)
)
INSTALL(TARGETS raw_r
# Install Shared binary files.
- install(TARGETS raw raw_r
+ install(TARGETS raw
+ EXPORT ${PROJECT_NAME}Targets
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/manual-link
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/manual-link
+ )
+ install(TARGETS raw_r
EXPORT ${PROJECT_NAME}Targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -623,6 +629,7 @@ if (LIBRAW_INSTALL)
if(NOT BUILD_SHARED_LIBS AND "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
message("ClangCl does not support pdb generation with static libraries")
elseif(MSVC)
+ elseif(0)
install(FILES ${PROJECT_BINARY_DIR}/raw.pdb ${PROJECT_BINARY_DIR}/raw_r.pdb
DESTINATION ${CMAKE_INSTALL_LIBDIR}
CONFIGURATIONS Debug RelWithDebInfo
diff --git a/cmake/data/libraw.pc.cmake b/cmake/data/libraw.pc.cmake
index aede5f2..ffeefc2 100644
index 510526f..aa6ab21 100644
--- a/cmake/data/libraw.pc.cmake
+++ b/cmake/data/libraw.pc.cmake
@@ -1,6 +1,6 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
-libdir=${prefix}/lib@LIB_SUFFIX@
+libdir=${prefix}/lib@LIB_SUFFIX@/manual-link
includedir=${prefix}/include/libraw
-libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@/manual-link
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: @PROJECT_NAME@

View File

@ -1,66 +0,0 @@
--- a/cmake/modules/FindLCMS2.cmake 2016-11-02 07:09:50.000000000 +0100
+++ b/cmake/modules/FindLCMS2.cmake 2018-06-02 00:43:27.309100600 +0200
@@ -13,7 +13,6 @@
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying LICENSE file.
-
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if(NOT WIN32)
@@ -29,18 +28,30 @@
PATH_SUFFIXES lcms2 liblcms2
)
-find_library(LCMS2_LIBRARIES NAMES lcms2 liblcms2 lcms-2 liblcms-2
+include(SelectLibraryConfigurations)
+
+find_library(LCMS2_LIBRARY_RELEASE NAMES lcms2 liblcms2 lcms-2 liblcms-2
+ PATHS
+ ${PC_LCMS2_LIBDIR}
+ ${PC_LCMS2_LIBRARY_DIRS}
+ PATH_SUFFIXES lcms2
+)
+
+find_library(LCMS2_LIBRARY_DEBUG NAMES lcms2d liblcms2d lcms-2d liblcms-2d
PATHS
${PC_LCMS2_LIBDIR}
${PC_LCMS2_LIBRARY_DIRS}
PATH_SUFFIXES lcms2
)
-if(LCMS2_INCLUDE_DIR AND LCMS2_LIBRARIES)
+select_library_configurations(LCMS2)
+
+
+if(LCMS2_INCLUDE_DIR AND LCMS2_LIBRARY)
set(LCMS2_FOUND TRUE)
-else(LCMS2_INCLUDE_DIR AND LCMS2_LIBRARIES)
+else(LCMS2_INCLUDE_DIR AND LCMS2_LIBRARY)
set(LCMS2_FOUND FALSE)
-endif(LCMS2_INCLUDE_DIR AND LCMS2_LIBRARIES)
+endif(LCMS2_INCLUDE_DIR AND LCMS2_LIBRARY)
if(LCMS2_FOUND)
file(READ ${LCMS2_INCLUDE_DIR}/lcms2.h LCMS2_VERSION_CONTENT)
@@ -50,11 +61,11 @@
if(NOT LCMS2_FIND_QUIETLY)
string(SUBSTRING ${LCMS2_VERSION} 0 1 LCMS2_MAJOR_VERSION)
string(SUBSTRING ${LCMS2_VERSION} 1 2 LCMS2_MINOR_VERSION)
- message(STATUS "Found lcms version ${LCMS2_MAJOR_VERSION}.${LCMS2_MINOR_VERSION}, ${LCMS2_LIBRARIES}")
+ message(STATUS "Found lcms version ${LCMS2_MAJOR_VERSION}.${LCMS2_MINOR_VERSION}, ${LCMS2_LIBRARY}")
endif(NOT LCMS2_FIND_QUIETLY)
else(LCMS2_VERSION_MATCH)
if(NOT LCMS2_FIND_QUIETLY)
- message(STATUS "Found lcms2 but failed to find version ${LCMS2_LIBRARIES}")
+ message(STATUS "Found lcms2 but failed to find version ${LCMS2_LIBRARY}")
endif(NOT LCMS2_FIND_QUIETLY)
set(LCMS2_VERSION NOTFOUND)
endif(LCMS2_VERSION_MATCH)
@@ -68,5 +79,5 @@
endif(NOT LCMS2_FIND_QUIETLY)
endif(LCMS2_FOUND)
-mark_as_advanced(LCMS2_INCLUDE_DIR LCMS2_LIBRARIES LCMS2_VERSION)
+mark_as_advanced(LCMS2_INCLUDE_DIR LCMS2_LIBRARY LCMS2_VERSION)

View File

@ -1,22 +1,19 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO LibRaw/LibRaw
REF d4f05dd1b9b2d44c8f7e82043cbad3c724db2416
SHA512 5794521f535163afd7815ad005295301c5e0e2f8b2f34ef0a911d9dd1572c1f456b292777548203f9767957a55782b5bc9041c033190d25d1e9b4240d7df32b9
REF "${VERSION}"
SHA512 6cea6d859961d713382a9017107c730c7a8777be85d454bd05f1417a69fda902aa9591151eac5f4bd231ce2a86fc39da56e3a024104101f24d6069197fcabbc7
HEAD_REF master
PATCHES
remove_register_cpp.patch
)
vcpkg_from_github(
OUT_SOURCE_PATH LIBRAW_CMAKE_SOURCE_PATH
REPO LibRaw/LibRaw-cmake
REF a71f3b83ee3dccd7be32f9a2f410df4d9bdbde0a
SHA512 607e6f76bcb57534da4f0c864b7a421f1ed49244468b1b52abe77f65aa599cae80715520b3a951294321b812deffd4f163757c9949f337571aa54f414ccc58a5
REF 6e26c9e73677dc04f9eb236a97c6a4dc225ba7e8
SHA512 8ce13d37c2ace2fbc57f571052a5a5a847b707b3de1b3b9e0c1a46afaca86cabd42ee275600eeadc3127bc2a0d0a4f224caed0b07feffdafea32ad0f42e50379
HEAD_REF master
PATCHES
findlibraw_debug_fix.patch
lcms2_debug_fix.patch
dependencies.patch
# Move the non-thread-safe library to manual-link. This is unfortunately needed
# because otherwise libraries that build on top of libraw have to choose.
fix-install.patch
@ -28,22 +25,25 @@ file(COPY "${LIBRAW_CMAKE_SOURCE_PATH}/cmake" DESTINATION "${SOURCE_PATH}")
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
openmp ENABLE_OPENMP
openmp ENABLE_OPENMP
openmp CMAKE_REQUIRE_FIND_PACKAGE_OpenMP
dng-lossy CMAKE_REQUIRE_FIND_PACKAGE_JPEG
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DINSTALL_CMAKE_MODULE_PATH=share/${PORT}
-DENABLE_EXAMPLES=OFF
-DCMAKE_DEBUG_POSTFIX=d
-DCMAKE_REQUIRE_FIND_PACKAGE_Jasper=1
-DCMAKE_REQUIRE_FIND_PACKAGE_ZLIB=1
MAYBE_UNUSED_VARIABLES
CMAKE_REQUIRE_FIND_PACKAGE_OpenMP
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake")
vcpkg_fixup_pkgconfig()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
@ -56,9 +56,18 @@ else()
)
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
file(COPY "${CURRENT_PACKAGES_DIR}/share/cmake/libraw/FindLibRaw.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/share/cmake"
"${CURRENT_PACKAGES_DIR}/share/doc"
)
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/COPYRIGHT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST
"${SOURCE_PATH}/COPYRIGHT"
"${SOURCE_PATH}/LICENSE.LGPL"
"${SOURCE_PATH}/LICENSE.CDDL"
)

View File

@ -1,31 +0,0 @@
diff --git a/src/libraw_cxx.cpp b/src/libraw_cxx.cpp
index 0abd5329a..5eea00ea9 100644
--- a/src/libraw_cxx.cpp
+++ b/src/libraw_cxx.cpp
@@ -3500,7 +3500,7 @@ int LibRaw::phase_one_subtract_black(ushort *src, ushort *dest)
{
if (!imgdata.rawdata.ph1_cblack || !imgdata.rawdata.ph1_rblack)
{
- register int bl = imgdata.color.phase_one_data.t_black;
+ int bl = imgdata.color.phase_one_data.t_black;
for (int row = 0; row < S.raw_height; row++)
{
checkCancel();
@@ -3514,7 +3514,7 @@ int LibRaw::phase_one_subtract_black(ushort *src, ushort *dest)
}
else
{
- register int bl = imgdata.color.phase_one_data.t_black;
+ int bl = imgdata.color.phase_one_data.t_black;
for (int row = 0; row < S.raw_height; row++)
{
checkCancel();
@@ -6467,7 +6467,7 @@ static void utf2char(utf16_t *str, char *buffer, unsigned bufsz)
static void *lr_memmem(const void *l, size_t l_len, const void *s, size_t s_len)
{
- register char *cur, *last;
+ char *cur, *last;
const char *cl = (const char *)l;
const char *cs = (const char *)s;

View File

@ -1,11 +1,7 @@
The package libraw is compatible with built-in CMake targets:
libraw provides CMake targets:
find_package(LibRaw REQUIRED)
# For non-thread-safe version
target_compile_definitions(main PRIVATE ${LibRaw_DEFINITIONS})
target_include_directories(main PRIVATE ${LibRaw_INCLUDE_DIR})
target_link_libraries(main PRIVATE ${LibRaw_LIBRARIES})
# For thread-safe version
target_compile_definitions(main PRIVATE ${LibRaw_r_DEFINITIONS})
target_include_directories(main PRIVATE ${LibRaw_INCLUDE_DIR})
target_link_libraries(main PRIVATE ${LibRaw_r_LIBRARIES})
find_package(libraw CONFIG REQUIRED)
# non-thread-safe
target_link_libraries(main PRIVATE libraw::raw)
# thread-safe
target_link_libraries(main PRIVATE libraw::raw_r)

View File

@ -1,25 +1,40 @@
set(LIBRAW_PREV_MODULE_PATH ${CMAKE_MODULE_PATH})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
find_library(LibRaw_LIBRARY_RELEASE NAMES raw PATHS "${CMAKE_CURRENT_LIST_DIR}/../../lib/manual-link" NO_DEFAULT_PATH)
find_library(LibRaw_LIBRARY_DEBUG NAMES rawd raw PATHS "${CMAKE_CURRENT_LIST_DIR}/../../debug/lib/manual-link" NO_DEFAULT_PATH)
find_library(LibRaw_r_LIBRARY_RELEASE NAMES raw_r PATHS "${CMAKE_CURRENT_LIST_DIR}/../../lib" NO_DEFAULT_PATH)
find_library(LibRaw_r_LIBRARY_DEBUG NAMES raw_rd raw_r PATHS "${CMAKE_CURRENT_LIST_DIR}/../../debug/lib" NO_DEFAULT_PATH)
set(LIBRAW_PREV_MODULE_PATH "${CMAKE_MODULE_PATH}")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
_find_package(${ARGS})
set(CMAKE_MODULE_PATH ${LIBRAW_PREV_MODULE_PATH})
if (@ENABLE_OPENMP@)
find_package(OpenMP REQUIRED)
if (OpenMP_FOUND)
list(APPEND LibRaw_LIBRARIES gomp)
list(APPEND LibRaw_r_LIBRARIES gomp)
if(NOT LibRaw_r_LIBRARIES STREQUAL "")
if ("@ENABLE_OPENMP@")
find_package(OpenMP REQUIRED)
if (OpenMP_FOUND)
list(APPEND LibRaw_LIBRARIES ${OpenMP_CXX_LIBRARIES})
list(APPEND LibRaw_r_LIBRARIES ${OpenMP_CXX_LIBRARIES})
endif()
endif()
endif()
if (@VCPKG_LIBRARY_LINKAGE@ STREQUAL "static")
find_package(Jasper REQUIRED)
if (Jasper_FOUND)
if ("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
find_package(Jasper REQUIRED)
list(APPEND LibRaw_LIBRARIES ${JASPER_LIBRARIES})
list(APPEND LibRaw_r_LIBRARIES ${JASPER_LIBRARIES})
endif ()
find_package(lcms2 CONFIG REQUIRED)
if (lcms2_FOUND)
list(APPEND LibRaw_LIBRARIES lcms2::lcms2)
list(APPEND LibRaw_r_LIBRARIES lcms2::lcms2)
endif ()
find_package(lcms2 CONFIG REQUIRED)
list(APPEND LibRaw_LIBRARIES lcms2::lcms2)
list(APPEND LibRaw_r_LIBRARIES lcms2::lcms2)
find_package(ZLIB REQUIRED)
list(APPEND LibRaw_LIBRARIES ${ZLIB_LIBRARIES})
list(APPEND LibRaw_r_LIBRARIES ${ZLIB_LIBRARIES})
if("@CMAKE_REQUIRE_FIND_PACKAGE_JPEG@")
find_package(JPEG REQUIRED)
list(APPEND LibRaw_LIBRARIES ${JPEG_LIBRARIES})
list(APPEND LibRaw_r_LIBRARIES ${JPEG_LIBRARIES})
endif()
if("@MATH_LIBRARY@")
list(APPEND LibRaw_LIBRARIES @MATH_LIBRARY@)
list(APPEND LibRaw_r_LIBRARIES @MATH_LIBRARY@)
endif()
endif()
endif()

View File

@ -1,9 +1,9 @@
{
"name": "libraw",
"version-string": "201903",
"port-version": 10,
"version": "0.21.1",
"description": "raw image decoder library",
"homepage": "https://www.libraw.org",
"license": "LGPL-2.1-only OR CDDL-1.0",
"supports": "!uwp",
"dependencies": [
"jasper",
@ -11,9 +11,25 @@
{
"name": "vcpkg-cmake",
"host": true
}
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
],
"features": {
"dng-lossy": {
"description": "DNG lossy codec support",
"dependencies": [
{
"name": "libjpeg-turbo",
"features": [
"jpeg8"
]
}
]
},
"openmp": {
"description": "Build library with OpenMP support"
}

View File

@ -2538,7 +2538,7 @@
},
"freeimage": {
"baseline": "3.18.0",
"port-version": 24
"port-version": 25
},
"freeopcua": {
"baseline": "20190125",
@ -4297,8 +4297,8 @@
"port-version": 0
},
"libraw": {
"baseline": "201903",
"port-version": 10
"baseline": "0.21.1",
"port-version": 0
},
"librdkafka": {
"baseline": "2.0.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "423daf86bc904882a1fa9c68d56d56d7c52ac35f",
"version": "3.18.0",
"port-version": 25
},
{
"git-tree": "b72eaa94f12facf42b2180bf49ff9121d9477eaa",
"version": "3.18.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "fda25697452394dfb723fa576576a76b67b32468",
"version": "0.21.1",
"port-version": 0
},
{
"git-tree": "906477f849ef0c2b348f8ff9f526d2c5a2e19b22",
"version-string": "201903",