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

[lcms] Update to v2.16 #42187

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
55 changes: 0 additions & 55 deletions ports/lcms/CMakeLists.txt

This file was deleted.

6 changes: 3 additions & 3 deletions ports/lcms/fix-shared-library.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
diff --git a/include/lcms2.h b/include/lcms2.h
index fd4ac7c..a99bdd2 100644
index 7c72047..6306027 100644
--- a/include/lcms2.h
+++ b/include/lcms2.h
@@ -227,6 +227,7 @@ typedef int cmsBool;
@@ -230,6 +230,7 @@ typedef int cmsBool;


// Calling convention -- this is hardly platform and compiler dependent
+#define CMS_DLL
#ifdef CMS_IS_WINDOWS_
#if defined(CMS_IS_WINDOWS_) && !defined(__GNUC__)
# if defined(CMS_DLL) || defined(CMS_DLL_BUILD)
# ifdef __BORLANDC__
11 changes: 11 additions & 0 deletions ports/lcms/lcms-config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if(NOT TARGET lcms::lcms)
include(CMakeFindDependencyMacro)
find_dependency(lcms2 CONFIG)

# Create imported target lcms::lcms
add_library(lcms::lcms INTERFACE IMPORTED)

set_target_properties(lcms::lcms PROPERTIES
INTERFACE_LINK_LIBRARIES "lcms2::lcms2"
)
endif()
25 changes: 25 additions & 0 deletions ports/lcms/lcms2-config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
if(NOT TARGET lcms2::lcms2)
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)

add_library(lcms2::lcms2 UNKNOWN IMPORTED)

set_target_properties(lcms2::lcms2 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
)

find_library(LCMS2_LIBRARY_DEBUG NAMES lcms2 PATHS "${_IMPORT_PREFIX}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH)
if(EXISTS "${LCMS2_LIBRARY_DEBUG}")
set_property(TARGET lcms2::lcms2 APPEND PROPERTY IMPORTED_CONFIGURATIONS "Debug")
set_target_properties(lcms2::lcms2 PROPERTIES IMPORTED_LOCATION_DEBUG "${LCMS2_LIBRARY_DEBUG}")
endif()

find_library(LCMS2_LIBRARY_RELEASE NAMES lcms2 PATHS "${_IMPORT_PREFIX}/" PATH_SUFFIXES lib NO_DEFAULT_PATH)
if(EXISTS "${LCMS2_LIBRARY_RELEASE}")
set_property(TARGET lcms2::lcms2 APPEND PROPERTY IMPORTED_CONFIGURATIONS "Release")
set_target_properties(lcms2::lcms2 PROPERTIES IMPORTED_LOCATION_RELEASE "${LCMS2_LIBRARY_RELEASE}")
endif()

unset(_IMPORT_PREFIX)
endif()
65 changes: 45 additions & 20 deletions ports/lcms/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,36 +1,61 @@
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}

if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(SHARED_LIBRARY_PATCH "fix-shared-library.patch")
endif()

vcpkg_download_distfile(ADD_MISSING_EXPORT_PATCH
URLS https://github.com/mm2/Little-CMS/commit/f7b3c637c20508655f8b49935a4b556d52937b69.diff?full_index=1
FILENAME Add-missing-export.patch
SHA512 4a78f55c07fe5cef5fb9174d466672371283301df89e2825fc47d9fd4c526b291dce11d3896401a3284f4e2093e285c9e5ccbe0011e132576d189e70f66a1325
)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mm2/Little-CMS
REF "lcms${VERSION}"
SHA512 fc45f2ce0bf752313369786b65b92443ef6d9ed7e264e22cfe2a4732b370f6bb6e5573b646d0e8edf1b0bf9b9bc5137c98aed5929ba75acdf157d2764bd838fa
SHA512 c0d857123a0168cb76b5944a20c9e3de1cbe74e2b509fb72a54f74543e9c173474f09d50c495b0a0a295a3c2b47c5fa54a330d057e1a59b5a7e36d3f5a7f81b2
HEAD_REF master
PATCHES
remove_library_directive.patch
${SHARED_LIBRARY_PATCH}
remove-register.patch
${ADD_MISSING_EXPORT_PATCH}
)

file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")

vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
vcpkg_cmake_install()
if("fastfloat" IN_LIST FEATURES)
list(APPEND OPTIONS -Dfastfloat=true)
else()
list(APPEND OPTIONS -Dfastfloat=false)
endif()
if("threaded" IN_LIST FEATURES)
list(APPEND OPTIONS -Dthreaded=true)
else()
list(APPEND OPTIONS -Dthreaded=false)
endif()
if("tools" IN_LIST FEATURES)
list(APPEND OPTIONS -Dutils=true)
else()
list(APPEND OPTIONS -Dutils=false)
endif()

vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(PACKAGE_NAME lcms2)
vcpkg_cmake_config_fixup() # provides old PACKAGE_NAME lcms
vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${OPTIONS}
-Dsamples=false
)
vcpkg_install_meson()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/lcms/lcms-config.cmake" [[
include(CMakeFindDependencyMacro)
find_dependency(lcms2 CONFIG)
include(${CMAKE_CURRENT_LIST_DIR}/lcms-targets.cmake)
]])

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

if("tools" IN_LIST FEATURES)
vcpkg_copy_tools(
TOOL_NAMES jpgicc linkicc psicc tificc transicc
AUTO_CLEAN
)
endif()

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

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/lcms-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/lcms2-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/lcms2")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
13 changes: 0 additions & 13 deletions ports/lcms/remove-register.patch

This file was deleted.

10 changes: 0 additions & 10 deletions ports/lcms/remove_library_directive.patch

This file was deleted.

8 changes: 4 additions & 4 deletions ports/lcms/usage
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The package lcms provides CMake targets:

find_package(lcms2 CONFIG REQUIRED)
target_link_libraries(main PRIVATE lcms2::lcms2)
The package lcms provides CMake targets:
find_package(lcms2 CONFIG REQUIRED)
target_link_libraries(main PRIVATE lcms2::lcms2)
29 changes: 23 additions & 6 deletions ports/lcms/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
{
"name": "lcms",
"version": "2.14",
"version": "2.16",
"description": "Little CMS.",
"homepage": "https://github.com/mm2/Little-CMS",
"license": "MIT",
"dependencies": [
{
"name": "vcpkg-cmake",
"name": "vcpkg-tool-meson",
"host": true
}
],
"features": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"fastfloat": {
"description": "Build the fast float plugin",
"supports": "!(x86 & windows)",
"license": "GPL-3.0-or-later"
},
{
"name": "vcpkg-cmake-config",
"host": true
"threaded": {
"description": "Build the multi threaded plugin",
"license": "GPL-3.0-or-later"
},
"tools": {
"description": "Build the utilities",
"dependencies": [
"libjpeg-turbo",
{
"name": "tiff",
"default-features": false
}
]
}
]
}
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4217,7 +4217,7 @@
"port-version": 6
},
"lcms": {
"baseline": "2.14",
"baseline": "2.16",
"port-version": 0
},
"leaf": {
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/lcms.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "56716c0c80ad895686bca248c062b95ad4f89f8d",
"version": "2.16",
"port-version": 0
},
{
"git-tree": "d5fb3c46f4b60d45e67444591a83d80c08100871",
"version": "2.14",
Expand Down
Loading