[openjpeg] Update to 2.5.2, fixes (#36984)

Removes deprecated no-op features.
This commit is contained in:
Kai Pastor 2024-03-02 01:34:41 +01:00 committed by GitHub
parent 5824bacc36
commit 836a2d684d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 102 additions and 129 deletions

View File

@ -1,13 +0,0 @@
diff --git a/src/lib/openjp2/ht_dec.c b/src/lib/openjp2/ht_dec.c
index 1eb4d525f..e2f3afd6a 100644
--- a/src/lib/openjp2/ht_dec.c
+++ b/src/lib/openjp2/ht_dec.c
@@ -69,7 +69,7 @@ static OPJ_BOOL only_cleanup_pass_is_decoded = OPJ_FALSE;
static INLINE
OPJ_UINT32 population_count(OPJ_UINT32 val)
{
-#ifdef OPJ_COMPILER_MSVC
+#if defined(OPJ_COMPILER_MSVC) && (defined(_M_IX86) || defined(_M_AMD64))
return (OPJ_UINT32)__popcnt(val);
#elif (defined OPJ_COMPILER_GNUC)
return (OPJ_UINT32)__builtin_popcount(val);

View File

@ -1,59 +0,0 @@
diff --git a/src/bin/jp2/CMakeLists.txt b/src/bin/jp2/CMakeLists.txt
index 4d4bd952f..e14b5a692 100644
--- a/src/bin/jp2/CMakeLists.txt
+++ b/src/bin/jp2/CMakeLists.txt
@@ -33,14 +33,6 @@ include_directories(
${TIFF_INCLUDE_DIRNAME}
)
-if(WIN32)
- if(BUILD_SHARED_LIBS)
- add_definitions(-DOPJ_EXPORTS)
- else()
- add_definitions(-DOPJ_STATIC)
- endif()
-endif()
-
# Loop over all executables:
foreach(exe opj_decompress opj_compress opj_dump)
add_executable(${exe} ${exe}.c ${common_SRCS})
diff --git a/src/lib/openjp2/CMakeLists.txt b/src/lib/openjp2/CMakeLists.txt
index ea4131a3e..dc63f49dd 100644
--- a/src/lib/openjp2/CMakeLists.txt
+++ b/src/lib/openjp2/CMakeLists.txt
@@ -84,12 +84,12 @@ endif()
# Build the library
if(WIN32)
+ add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS)
else()
- add_definitions(-DOPJ_STATIC)
+ target_compile_definitions(${OPENJPEG_LIBRARY_NAME} PUBLIC OPJ_STATIC)
endif()
- add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME})
else()
if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
diff --git a/src/lib/openjpip/CMakeLists.txt b/src/lib/openjpip/CMakeLists.txt
index b3cb8ce88..fc6a9dde3 100644
--- a/src/lib/openjpip/CMakeLists.txt
+++ b/src/lib/openjpip/CMakeLists.txt
@@ -52,14 +52,14 @@ set(LOCAL_SRCS
)
# Build the library
+add_library(openjpip ${OPENJPIP_SRCS} ${LOCAL_SRCS})
if(WIN32)
if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS)
else()
- add_definitions(-DOPJ_STATIC)
+ target_compile_definitions(openjpip PUBLIC OPJ_STATIC)
endif()
endif()
-add_library(openjpip ${OPENJPIP_SRCS} ${LOCAL_SRCS})
set_target_properties(openjpip
PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
if(NOT ${CMAKE_VERSION} VERSION_LESS "2.8.12")

View File

@ -1,10 +0,0 @@
diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt
index 292fe5a71..bcbe94160 100644
--- a/src/bin/CMakeLists.txt
+++ b/src/bin/CMakeLists.txt
@@ -9,4 +9,4 @@ if(BUILD_JPIP)
endif()
# wx apps:
-add_subdirectory(wx)
+# add_subdirectory(wx)

View File

@ -0,0 +1,22 @@
diff --git a/src/lib/openjpip/CMakeLists.txt b/src/lib/openjpip/CMakeLists.txt
index e9d8193..6584a74 100644
--- a/src/lib/openjpip/CMakeLists.txt
+++ b/src/lib/openjpip/CMakeLists.txt
@@ -52,14 +52,14 @@ set(LOCAL_SRCS
)
# Build the library
+add_library(openjpip ${OPENJPIP_SRCS} ${LOCAL_SRCS})
if(WIN32)
if(BUILD_SHARED_LIBS)
- add_definitions(-DOPJ_EXPORTS)
+ target_compile_definitions(openjpip PRIVATE OPJ_EXPORTS)
else()
- add_definitions(-DOPJ_STATIC)
+ target_compile_definitions(openjpip PUBLIC OPJ_STATIC)
endif()
endif()
-add_library(openjpip ${OPENJPIP_SRCS} ${LOCAL_SRCS})
set_target_properties(openjpip
PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
target_compile_options(openjpip PRIVATE ${OPENJPEG_LIBRARY_COMPILE_OPTIONS})

View File

@ -1,66 +1,61 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO uclouvain/openjpeg
REF a5891555eb49ed7cc26b2901ea680acda136d811 #v2.5.0
SHA512 f388d5770445152cd5ed18c61d2a56a6d2b88c2b56db0d460d09be36f3e6e40cf5be505aa63ac5975e07688be3dfe752080f4939bd792d42c61f4f8ddcaa1f0d
REF "v${VERSION}"
SHA512 24c058b3e0710e689ba7fd6bce8a88353ce64e825b2e5bbf6b00ca3f2a2ec1e9c70a72e0252a5c89d10c537cf84d55af54bf2f16c58ca01db98c2018cf132e1a
HEAD_REF master
PATCHES
arm.patch
no-wx.patch
fix-static.patch
third-party.diff
openjpip-static.diff
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS)
if(NOT VCPKG_TARGET_IS_WINDOWS)
set(feature_tools "tools" BUILD_JPIP_SERVER) # Requires pthread
if("tools" IN_LIST FEATURES)
list(APPEND FEATURE_OPTIONS "-DFCGI_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include/fastcgi")
endif()
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"jpip" BUILD_JPIP
${feature_tools}
"tools" BUILD_VIEWER
"tools" BUILD_CODEC
"tools" BUILD_LUTS_GENERATOR
)
if(NOT VCPKG_TARGET_IS_WINDOWS AND "tools" IN_LIST FEATURES)
list(APPEND FEATURE_OPTIONS
-DBUILD_JPIP_SERVER=ON
"-DFCGI_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include/fastcgi"
)
endif()
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_CODEC:BOOL=OFF
-DBUILD_DOC:BOOL=OFF
-DOPENJPEG_INSTALL_PACKAGE_DIR=share/openjpeg
-DOPENJPEG_INSTALL_INCLUDE_DIR=include
-DEXECUTABLE_OUTPUT_PATH=tools/${PORT}
-DBUILD_PKGCONFIG_FILES=ON
${FEATURE_OPTIONS}
-DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
-DCMAKE_DISABLE_FIND_PACKAGE_Java=ON
-DOPENJPEG_INSTALL_SUBDIR=.
-DOPENJPEG_INSTALL_PACKAGE_DIR=share/openjpeg
${FEATURE_OPTIONS}
MAYBE_UNUSED_VARIABLES
CMAKE_DISABLE_FIND_PACKAGE_Java
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup()
vcpkg_fixup_pkgconfig()
if(VCPKG_TARGET_IS_WINDOWS AND (NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL MinGW))
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libopenjp2.pc" "-lm" "")
endif()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libopenjp2.pc" "-lm" "")
else()
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libopenjp2.pc" "-lm" "-lm -pthread")
endif()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libopenjp2.pc" "-lm" "-lm -pthread")
endif()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
set(TOOL_NAMES)
set(TOOL_NAMES "")
if("tools" IN_LIST FEATURES)
list(APPEND TOOL_NAMES opj_compress opj_decompress opj_dump opj_dec_server opj_jpip_addxml opj_jpip_test opj_jpip_transcode)
endif()
@ -68,16 +63,27 @@ if(TOOL_NAMES)
vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN)
endif()
file(READ "${CURRENT_PACKAGES_DIR}/include/openjpeg.h" OPENJPEG_H)
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
file(WRITE "${CURRENT_PACKAGES_DIR}/include/openjpeg\.h" [[
/* vcpkg VS legacy compatibility */
#include "openjpeg-2.5/openjpeg.h"
]])
file(WRITE "${CURRENT_PACKAGES_DIR}/include/opj_config\.h" [[
/* vcpkg VS legacy compatibility */
#include "openjpeg-2.5/opj_config.h"
]])
endif()
file(READ "${CURRENT_PACKAGES_DIR}/include/openjpeg-2.5/openjpeg\.h" OPENJPEG_H)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
string(REPLACE "defined(OPJ_STATIC)" "1" OPENJPEG_H "${OPENJPEG_H}")
else()
string(REPLACE "defined(OPJ_STATIC)" "0" OPENJPEG_H "${OPENJPEG_H}")
endif()
string(REPLACE "defined(DLL_EXPORT)" "0" OPENJPEG_H "${OPENJPEG_H}")
file(WRITE "${CURRENT_PACKAGES_DIR}/include/openjpeg.h" "${OPENJPEG_H}")
file(WRITE "${CURRENT_PACKAGES_DIR}/include/openjpeg-2.5/openjpeg\.h" "${OPENJPEG_H}")
# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_copy_pdbs()
file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

View File

@ -0,0 +1,22 @@
diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt
index b136fff..05ca64a 100644
--- a/thirdparty/CMakeLists.txt
+++ b/thirdparty/CMakeLists.txt
@@ -89,7 +89,7 @@ else(BUILD_THIRDPARTY)
message(STATUS "Your system seems to have a TIFF lib available, we will use it")
set(OPJ_HAVE_TIFF_H 1 PARENT_SCOPE)
set(OPJ_HAVE_LIBTIFF 1 PARENT_SCOPE)
- if(BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS)
+ if("${not_using_vcpkg}")
# Probably incorrect as PC_TIFF_STATIC_LIBRARIES will lack the path to the libraries
# and will only work if they are in system directories
set(TIFF_LIBNAME ${PC_TIFF_STATIC_LIBRARIES} PARENT_SCOPE)
@@ -131,7 +131,7 @@ else(BUILD_THIRDPARTY)
message(STATUS "Your system seems to have a LCMS2 lib available, we will use it")
set(OPJ_HAVE_LCMS2_H 1 PARENT_SCOPE)
set(OPJ_HAVE_LIBLCMS2 1 PARENT_SCOPE)
- if(BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS)
+ if("${not_using_vcpkg}")
# Probably incorrect as PC_LCMS2_STATIC_LIBRARIES will lack the path to the libraries
# and will only work if they are in system directories
set(LCMS_LIBNAME ${PC_LCMS2_STATIC_LIBRARIES} PARENT_SCOPE)

9
ports/openjpeg/usage Normal file
View File

@ -0,0 +1,9 @@
openjpeg provides CMake targets:
find_package(OpenJPEG CONFIG REQUIRED)
target_link_libraries(main PRIVATE openjp2)
openjpeg provides pkg-config modules:
# JPEG2000 library
libopenjp2

View File

@ -1,7 +1,6 @@
{
"name": "openjpeg",
"version": "2.5.0",
"port-version": 1,
"version": "2.5.2",
"description": "OpenJPEG is an open-source JPEG 2000 codec written in C language. It has been developed in order to promote the use of JPEG 2000, a still-image compression standard from the Joint Photographic Experts Group (JPEG). Since April 2015, it is officially recognized by ISO/IEC and ITU-T as a JPEG 2000 Reference Software.",
"homepage": "https://github.com/uclouvain/openjpeg",
"license": "BSD-2-Clause",
@ -16,19 +15,10 @@
}
],
"features": {
"jp3d": {
"description": "(deprecated)"
},
"jpip": {
"description": "Build optional component jpip",
"supports": "!uwp"
},
"jpwl": {
"description": "(deprecated)"
},
"mj2": {
"description": "(deprecated)"
},
"tools": {
"description": "(deprecated)",
"dependencies": [
@ -41,6 +31,7 @@
"platform": "!windows"
},
"lcms",
"libpng",
"tiff",
"zlib"
]

View File

@ -6401,8 +6401,8 @@
"port-version": 0
},
"openjpeg": {
"baseline": "2.5.0",
"port-version": 1
"baseline": "2.5.2",
"port-version": 0
},
"openldap": {
"baseline": "2.5.13",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "68d405b7aadd66ab3c955bcb8832dae786d3ccee",
"version": "2.5.2",
"port-version": 0
},
{
"git-tree": "608f895171abcfb72dd690a0f7121d265d0904b5",
"version": "2.5.0",