Skip to content

Commit

Permalink
[libjpeg-turbo] Update the version to 3.0.0 (#33036)
Browse files Browse the repository at this point in the history
* fix renaming library

* update version

* add usage

* update version

* update line break

* update version

---------

Co-authored-by: Jim wang (BEYONDSOFT CONSULTING INC) <v-wangjim@microsoft.com>
  • Loading branch information
jimwang118 and jimwang118 authored Aug 28, 2023
1 parent a557975 commit 0df2bd3
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 46 deletions.
99 changes: 59 additions & 40 deletions ports/libjpeg-turbo/add-options-for-exes-docs-headers.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c384aae..c9a15a0 100644
index efd101a..9c1c69f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -194,6 +194,12 @@ option(ENABLE_SHARED "Build shared libraries" TRUE)
@@ -222,6 +222,12 @@ option(ENABLE_SHARED "Build shared libraries" TRUE)
boolean_number(ENABLE_SHARED)
option(ENABLE_STATIC "Build static libraries" TRUE)
boolean_number(ENABLE_STATIC)
Expand All @@ -14,50 +14,69 @@ index c384aae..c9a15a0 100644
+boolean_number(INSTALL_HEADERS)
option(REQUIRE_SIMD "Generate a fatal error if SIMD extensions are not available for this platform (default is to fall back to a non-SIMD build)" FALSE)
boolean_number(REQUIRE_SIMD)
option(WITH_12BIT "Encode/decode JPEG images with 12-bit samples (implies WITH_ARITH_DEC=0 WITH_ARITH_ENC=0 WITH_JAVA=0 WITH_SIMD=0 WITH_TURBOJPEG=0 )" FALSE)
@@ -662,6 +668,7 @@ if(WITH_TURBOJPEG)
option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE)
@@ -690,6 +696,7 @@ if(WITH_TURBOJPEG)
LINK_FLAGS "${TJMAPFLAG}${TJMAPFILE}")
endif()

+ if(ENABLE_EXECUTABLES)
add_executable(tjunittest tjunittest.c tjutil.c md5/md5.c md5/md5hl.c)
target_link_libraries(tjunittest turbojpeg)

@@ -673,6 +680,7 @@ if(WITH_TURBOJPEG)
@@ -701,6 +708,7 @@ if(WITH_TURBOJPEG)

add_executable(tjexample tjexample.c)
target_link_libraries(tjexample turbojpeg)
+ endif()
endif()

if(ENABLE_STATIC)
@@ -685,6 +693,7 @@ if(WITH_TURBOJPEG)
@@ -721,6 +729,7 @@ if(WITH_TURBOJPEG)
set_target_properties(turbojpeg-static PROPERTIES OUTPUT_NAME turbojpeg)
endif()

+ if(ENABLE_EXECUTABLES)
add_executable(tjunittest-static tjunittest.c tjutil.c md5/md5.c
md5/md5hl.c)
target_link_libraries(tjunittest-static turbojpeg-static)
@@ -694,6 +703,7 @@ if(WITH_TURBOJPEG)
@@ -730,6 +739,7 @@ if(WITH_TURBOJPEG)
if(UNIX)
target_link_libraries(tjbench-static m)
endif()
+ endif()
endif()
endif()

@@ -708,7 +718,7 @@ else()
set(DJPEG_BMP_SOURCES wrbmp.c wrtarga.c)
endif()

-if(ENABLE_STATIC)
+if(ENABLE_STATIC AND ENABLE_EXECUTABLES)
add_executable(cjpeg-static cjpeg.c cdjpeg.c rdgif.c rdppm.c rdswitch.c
${CJPEG_BMP_SOURCES})
set_property(TARGET cjpeg-static PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
@@ -724,9 +734,11 @@ if(ENABLE_STATIC)
set_property(TARGET jpegtran-static PROPERTY COMPILE_FLAGS "${USE_SETMODE}")
@@ -748,13 +758,15 @@ if(ENABLE_STATIC)
add_library(cjpeg16-static OBJECT rdgif.c rdppm.c)
set_property(TARGET cjpeg16-static PROPERTY COMPILE_FLAGS
"-DBITS_IN_JSAMPLE=16 -DGIF_SUPPORTED -DPPM_SUPPORTED")
+ if(ENABLE_EXECUTABLES)
add_executable(cjpeg-static cjpeg.c cdjpeg.c rdbmp.c rdgif.c rdppm.c
rdswitch.c rdtarga.c $<TARGET_OBJECTS:cjpeg12-static>
$<TARGET_OBJECTS:cjpeg16-static>)
set_property(TARGET cjpeg-static PROPERTY COMPILE_FLAGS
${CDJPEG_COMPILE_FLAGS})
target_link_libraries(cjpeg-static jpeg-static)
-
+ endif()
+
# Compile a separate version of these source files with 12-bit and 16-bit
# data precision.
add_library(djpeg12-static OBJECT rdcolmap.c wrgif.c wrppm.c)
@@ -763,6 +775,7 @@ if(ENABLE_STATIC)
add_library(djpeg16-static OBJECT wrppm.c)
set_property(TARGET djpeg16-static PROPERTY COMPILE_FLAGS
"-DBITS_IN_JSAMPLE=16 -DPPM_SUPPORTED")
+ if(ENABLE_EXECUTABLES)
add_executable(djpeg-static djpeg.c cdjpeg.c rdcolmap.c rdswitch.c wrbmp.c
wrgif.c wrppm.c wrtarga.c $<TARGET_OBJECTS:djpeg12-static>
$<TARGET_OBJECTS:djpeg16-static>)
@@ -776,11 +789,14 @@ if(ENABLE_STATIC)

add_executable(example-static example.c)
target_link_libraries(example-static jpeg-static)
+ endif()
endif()

+if(ENABLE_EXECUTABLES)
Expand All @@ -68,7 +87,7 @@ index c384aae..c9a15a0 100644


###############################################################################
@@ -1464,8 +1476,10 @@ if(WITH_TURBOJPEG)
@@ -1687,8 +1703,10 @@ if(WITH_TURBOJPEG)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
Expand All @@ -79,7 +98,7 @@ index c384aae..c9a15a0 100644
if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND
CMAKE_C_LINKER_SUPPORTS_PDB)
install(FILES "$<TARGET_PDB_FILE:turbojpeg>"
@@ -1476,7 +1490,7 @@ if(WITH_TURBOJPEG)
@@ -1699,7 +1717,7 @@ if(WITH_TURBOJPEG)
install(TARGETS turbojpeg-static EXPORT ${CMAKE_PROJECT_NAME}Targets
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
Expand All @@ -88,7 +107,7 @@ index c384aae..c9a15a0 100644
if(GENERATOR_IS_MULTI_CONFIG)
set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
else()
@@ -1486,15 +1500,17 @@ if(WITH_TURBOJPEG)
@@ -1709,15 +1727,17 @@ if(WITH_TURBOJPEG)
DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE})
endif()
endif()
Expand All @@ -107,7 +126,7 @@ index c384aae..c9a15a0 100644
if(GENERATOR_IS_MULTI_CONFIG)
set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
else()
@@ -1509,8 +1525,11 @@ if(ENABLE_STATIC)
@@ -1732,8 +1752,11 @@ if(ENABLE_STATIC)
endif()
endif()

Expand All @@ -117,9 +136,9 @@ index c384aae..c9a15a0 100644

+if(INSTALL_DOCS)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg
${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt
${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.c
${CMAKE_CURRENT_SOURCE_DIR}/tjexample.c
@@ -1522,8 +1541,9 @@ if(WITH_JAVA)
@@ -1745,8 +1768,9 @@ if(WITH_JAVA)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/java/TJExample.java
DESTINATION ${CMAKE_INSTALL_DOCDIR})
endif()
Expand All @@ -130,7 +149,7 @@ index c384aae..c9a15a0 100644
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cjpeg.1
${CMAKE_CURRENT_SOURCE_DIR}/djpeg.1 ${CMAKE_CURRENT_SOURCE_DIR}/jpegtran.1
${CMAKE_CURRENT_SOURCE_DIR}/rdjpgcom.1
@@ -1544,10 +1564,12 @@ install(EXPORT ${CMAKE_PROJECT_NAME}Targets
@@ -1767,11 +1791,12 @@ install(EXPORT ${CMAKE_PROJECT_NAME}Targets
NAMESPACE ${CMAKE_PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME})

Expand All @@ -139,30 +158,30 @@ index c384aae..c9a15a0 100644
${CMAKE_CURRENT_SOURCE_DIR}/jerror.h ${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h
${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-
+endif()

include(cmakescripts/BuildPackages.cmake)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmakescripts/cmake_uninstall.cmake.in"
diff --git a/sharedlib/CMakeLists.txt b/sharedlib/CMakeLists.txt
index aea0b9d..069dbe2 100644
index 8e94256..8a16497 100644
--- a/sharedlib/CMakeLists.txt
+++ b/sharedlib/CMakeLists.txt
@@ -76,6 +76,7 @@ else()
set(DJPEG_BMP_SOURCES ../wrbmp.c ../wrtarga.c)
endif()

@@ -76,11 +76,13 @@ set_property(TARGET cjpeg12 PROPERTY COMPILE_FLAGS
add_library(cjpeg16 OBJECT ../rdgif.c ../rdppm.c)
set_property(TARGET cjpeg16 PROPERTY COMPILE_FLAGS
"-DBITS_IN_JSAMPLE=16 -DGIF_SUPPORTED -DPPM_SUPPORTED")
+if(ENABLE_EXECUTABLES)
add_executable(cjpeg ../cjpeg.c ../cdjpeg.c ../rdgif.c ../rdppm.c
../rdswitch.c ${CJPEG_BMP_SOURCES})
set_property(TARGET cjpeg PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
@@ -92,14 +93,17 @@ set_property(TARGET jpegtran PROPERTY COMPILE_FLAGS "${USE_SETMODE}")

add_executable(jcstest ../jcstest.c)
target_link_libraries(jcstest jpeg)
add_executable(cjpeg ../cjpeg.c ../cdjpeg.c ../rdbmp.c ../rdgif.c ../rdppm.c
../rdswitch.c ../rdtarga.c $<TARGET_OBJECTS:cjpeg12>
$<TARGET_OBJECTS:cjpeg16>)
set_property(TARGET cjpeg PROPERTY COMPILE_FLAGS ${CDJPEG_COMPILE_FLAGS})
target_link_libraries(cjpeg jpeg)
+endif()

install(TARGETS jpeg EXPORT ${CMAKE_PROJECT_NAME}Targets
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
# Compile a separate version of these source files with 12-bit and 16-bit data
# precision.
@@ -111,8 +113,10 @@ install(TARGETS jpeg EXPORT ${CMAKE_PROJECT_NAME}Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
Expand Down
2 changes: 1 addition & 1 deletion ports/libjpeg-turbo/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libjpeg-turbo/libjpeg-turbo
REF "${VERSION}"
SHA512 bcd946eed0fb3712eae2485d300d5e2b84596b1c8cfd4e944902bb141125d411b727024f054e2ad6c23855d06a02dcb926696f05cb107869a7b81814d4cfcaeb
SHA512 0efb7ce16333f4f3556b889bdd83b0f91697ce1645cbfb13db0c8a93ef47dd9cb0805c7160edaf946d4d54faf30a33bae90800c189e8b4bd44fcf3ce98179115
HEAD_REF master
PATCHES
add-options-for-exes-docs-headers.patch
Expand Down
2 changes: 1 addition & 1 deletion ports/libjpeg-turbo/usage
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ libjpeg-turbo is compatible with built-in implementation-agnostic CMake targets:
libjpeg-turbo provides CMake targets for the TurboJPEG C API:

find_package(libjpeg-turbo CONFIG REQUIRED)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:libjpeg-turbo::turbojpeg>,libjpeg-turbo::turbojpeg,libjpeg-turbo::turbojpeg-static>)
target_link_libraries(main PRIVATE libjpeg-turbo::jpeg libjpeg-turbo::turbojpeg)
3 changes: 1 addition & 2 deletions ports/libjpeg-turbo/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "libjpeg-turbo",
"version": "2.1.5.1",
"port-version": 2,
"version": "3.0.0",
"description": "libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on x86, x86-64, ARM, and PowerPC systems.",
"homepage": "https://github.com/libjpeg-turbo/libjpeg-turbo",
"license": "BSD-3-Clause",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4249,8 +4249,8 @@
"port-version": 8
},
"libjpeg-turbo": {
"baseline": "2.1.5.1",
"port-version": 2
"baseline": "3.0.0",
"port-version": 0
},
"libjuice": {
"baseline": "1.0.6",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libjpeg-turbo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "3cd08939c6dab1963ac5b309a4205b2f4534fb79",
"version": "3.0.0",
"port-version": 0
},
{
"git-tree": "a54bb2bec4dfc177249e2c10b31a665c249c660c",
"version": "2.1.5.1",
Expand Down

0 comments on commit 0df2bd3

Please sign in to comment.