[mozjpeg] Update to latest commit (#11719)

This commit is contained in:
Lily 2020-06-06 03:10:36 +08:00 committed by GitHub
parent f3c92f82d6
commit 2ba3794909
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 132 additions and 95 deletions

View File

@ -1,4 +1,4 @@
Source: mozjpeg Source: mozjpeg
Version: 3.2-3 Version: 2020-06-02
Homepage: https://github.com/mozilla/mozjpeg Homepage: https://github.com/mozilla/mozjpeg
Description: MozJPEG reduces file sizes of JPEG images while retaining quality and compatibility with the vast majority of the world's deployed decoders. It's compatible with libjpeg API and ABI, and can be used as a drop-in replacement for libjpeg. Description: MozJPEG reduces file sizes of JPEG images while retaining quality and compatibility with the vast majority of the world's deployed decoders. It's compatible with libjpeg API and ABI, and can be used as a drop-in replacement for libjpeg.

View File

@ -1,87 +1,126 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac0ebdb..483bf0f 100644 index 51f4714..9ca3463 100644
--- a/CMakeLists.txt --- a/CMakeLists.txt
+++ b/CMakeLists.txt +++ b/CMakeLists.txt
@@ -875,43 +875,51 @@ add_custom_target(installer @@ -1370,21 +1370,28 @@ endif()
cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND}
SOURCES mozjpeg.nsi) set(EXE ${CMAKE_EXECUTABLE_SUFFIX})
+if(CMAKE_BUILD_TYPE STREQUAL "Debug") +if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(REAL_BUILDS_PATH "Debug/") + set(REAL_BUILDS_PATH "Debug/")
+else() +else()
+ set(REAL_BUILDS_PATH "Release/") + set(REAL_BUILDS_PATH "Release/")
+endif() +endif()
+ +
if(WITH_TURBOJPEG) if(WITH_TURBOJPEG)
if(ENABLE_SHARED) if(ENABLE_SHARED)
install(TARGETS turbojpeg tjbench install(TARGETS turbojpeg tjbench
- ARCHIVE DESTINATION lib - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- LIBRARY DESTINATION lib - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- RUNTIME DESTINATION bin) - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ ARCHIVE DESTINATION lib/mozjpeg + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg
+ LIBRARY DESTINATION lib/mozjpeg + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg
+ RUNTIME DESTINATION tools/mozjpeg) + RUNTIME DESTINATION tools/mozjpeg)
endif() if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND
if(ENABLE_STATIC) CMAKE_C_LINKER_SUPPORTS_PDB)
- install(TARGETS turbojpeg-static ARCHIVE DESTINATION lib) install(FILES "$<TARGET_PDB_FILE:turbojpeg>"
+ install(TARGETS turbojpeg-static - DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
+ LIBRARY DESTINATION lib/mozjpeg + DESTINATION ${CMAKE_INSTALL_BINDIR}/mozjpeg OPTIONAL)
+ ARCHIVE DESTINATION lib/mozjpeg) endif()
if(NOT ENABLE_SHARED) endif()
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/tjbench-static.exe if(ENABLE_STATIC)
- DESTINATION bin RENAME tjbench.exe) - install(TARGETS turbojpeg-static ARCHIVE
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/tjbench-static.exe - DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ DESTINATION tools/mozjpeg RENAME tjbench.exe) + install(TARGETS turbojpeg-static
endif() + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg
endif() + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg)
- install(FILES ${CMAKE_SOURCE_DIR}/turbojpeg.h DESTINATION include) if(NOT ENABLE_SHARED)
+ install(FILES ${CMAKE_SOURCE_DIR}/turbojpeg.h DESTINATION include/mozjpeg) if(MSVC_IDE OR XCODE)
endif() set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
@@ -1392,15 +1399,15 @@ if(WITH_TURBOJPEG)
if(ENABLE_STATIC) set(DIR ${CMAKE_CURRENT_BINARY_DIR})
- install(TARGETS jpeg-static ARCHIVE DESTINATION lib) endif()
+ install(TARGETS jpeg-static ARCHIVE DESTINATION lib/mozjpeg) install(PROGRAMS ${DIR}/tjbench-static${EXE}
if(NOT ENABLE_SHARED) - DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE})
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cjpeg-static.exe + DESTINATION tools/mozjpeg RENAME tjbench${EXE})
- DESTINATION bin RENAME cjpeg.exe) endif()
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/djpeg-static.exe endif()
- DESTINATION bin RENAME djpeg.exe) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg.h
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/jpegtran-static.exe - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
- DESTINATION bin RENAME jpegtran.exe) + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mozjpeg)
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/cjpeg-static.exe endif()
+ DESTINATION tools/mozjpeg RENAME cjpeg.exe)
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/djpeg-static.exe if(ENABLE_STATIC)
+ DESTINATION tools/mozjpeg RENAME djpeg.exe) - install(TARGETS jpeg-static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/jpegtran-static.exe + install(TARGETS jpeg-static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg)
+ DESTINATION tools/mozjpeg RENAME jpegtran.exe) if(NOT ENABLE_SHARED)
endif() if(MSVC_IDE OR XCODE)
endif() set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}")
@@ -1408,15 +1415,15 @@ if(ENABLE_STATIC)
-install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION bin) set(DIR ${CMAKE_CURRENT_BINARY_DIR})
+install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION tools/mozjpeg) endif()
install(PROGRAMS ${DIR}/cjpeg-static${EXE}
install(FILES ${CMAKE_SOURCE_DIR}/README.ijg ${CMAKE_SOURCE_DIR}/README-mozilla.txt - DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME cjpeg${EXE})
${CMAKE_SOURCE_DIR}/example.c ${CMAKE_SOURCE_DIR}/libjpeg.txt + DESTINATION tools/mozjpeg RENAME cjpeg${EXE})
${CMAKE_SOURCE_DIR}/structure.txt ${CMAKE_SOURCE_DIR}/usage.txt install(PROGRAMS ${DIR}/djpeg-static${EXE}
${CMAKE_SOURCE_DIR}/wizard.txt - DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE})
- DESTINATION doc) + DESTINATION tools/mozjpeg RENAME djpeg${EXE})
+ DESTINATION share/mozjpeg) install(PROGRAMS ${DIR}/jpegtran-static${EXE}
- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE})
install(FILES ${CMAKE_BINARY_DIR}/jconfig.h ${CMAKE_SOURCE_DIR}/jerror.h + DESTINATION tools/mozjpeg RENAME jpegtran${EXE})
${CMAKE_SOURCE_DIR}/jmorecfg.h ${CMAKE_SOURCE_DIR}/jpeglib.h endif()
- DESTINATION include) endif()
+ DESTINATION include/mozjpeg)
diff --git a/sharedlib/CMakeLists.txt b/sharedlib/CMakeLists.txt -install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
index 268cc14..d067d2a 100644 +install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION tools/mozjpeg)
--- a/sharedlib/CMakeLists.txt
+++ b/sharedlib/CMakeLists.txt install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg
@@ -68,6 +68,6 @@ add_executable(jcstest ../jcstest.c) ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt
target_link_libraries(jcstest jpeg) @@ -1424,10 +1431,10 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg
${CMAKE_CURRENT_SOURCE_DIR}/libjpeg.txt
install(TARGETS jpeg cjpeg djpeg jpegtran ${CMAKE_CURRENT_SOURCE_DIR}/structure.txt
- ARCHIVE DESTINATION lib ${CMAKE_CURRENT_SOURCE_DIR}/usage.txt ${CMAKE_CURRENT_SOURCE_DIR}/wizard.txt
- LIBRARY DESTINATION lib - ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION ${CMAKE_INSTALL_DOCDIR})
- RUNTIME DESTINATION bin) + ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION share/mozjpeg)
+ ARCHIVE DESTINATION lib/mozjpeg if(WITH_JAVA)
+ LIBRARY DESTINATION lib/mozjpeg install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/java/TJExample.java
+ RUNTIME DESTINATION tools/mozjpeg) - DESTINATION ${CMAKE_INSTALL_DOCDIR})
+ DESTINATION share/mozjpeg)
endif()
if(UNIX OR MINGW)
@@ -1439,12 +1446,12 @@ if(UNIX OR MINGW)
endif()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/libjpeg.pc
${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/libturbojpeg.pc
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/mozjpeg)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h
${CMAKE_CURRENT_SOURCE_DIR}/jerror.h ${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h
${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mozjpeg)
include(cmakescripts/BuildPackages.cmake)
diff --git a/sharedlib/CMakeLists.txt b/sharedlib/CMakeLists.txt
index f0a7d87..1e82349 100644
--- a/sharedlib/CMakeLists.txt
+++ b/sharedlib/CMakeLists.txt
@@ -92,11 +92,11 @@ add_executable(jcstest ../jcstest.c)
target_link_libraries(jcstest jpeg)
install(TARGETS jpeg cjpeg djpeg jpegtran
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg
+ RUNTIME DESTINATION tools/mozjpeg)
if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND
CMAKE_C_LINKER_SUPPORTS_PDB)
install(FILES "$<TARGET_PDB_FILE:jpeg>"
- DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
+ DESTINATION ${CMAKE_INSTALL_BINDIR}/mozjpeg OPTIONAL)
endif()

View File

@ -1,10 +1,8 @@
include(vcpkg_common_functions)
vcpkg_from_github( vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH OUT_SOURCE_PATH SOURCE_PATH
REPO mozilla/mozjpeg REPO mozilla/mozjpeg
REF v3.2 REF 6d95c51adf0c314017f541b6cb07e13cc1bce754
SHA512 d14789827a9f4f78139a3945d3169d37eb891758b5ab40ef19e99ebebb2fb6d7c3a05495de245bba54cfd913b153af352159aa9fc0218127f97819137e0f1ab8 SHA512 a21c8b3a561b387933a27befaa1d05a8c63b0e203d72d73071a4c9b57c6b7d57b44836f211c4dcb80eee4b01876f0a0fb4c91a60c3ae867e906e5e4e27165627
HEAD_REF master HEAD_REF master
PATCHES PATCHES
fix-install-error.patch fix-install-error.patch
@ -12,7 +10,7 @@ vcpkg_from_github(
vcpkg_find_acquire_program(NASM) vcpkg_find_acquire_program(NASM)
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}") vcpkg_add_to_path(${NASM_EXE_PATH})
if(VCPKG_LIBRARY_LINKAGE STREQUAL static) if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(ENABLE_STATIC_BUILD ON) set(ENABLE_STATIC_BUILD ON)
@ -39,7 +37,7 @@ vcpkg_install_cmake()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/mozjpeg) vcpkg_copy_tools(${CURRENT_PACKAGES_DIR}/tools/mozjpeg)
#remove empty folders after static build #remove empty folders after static build
if (VCPKG_LIBRARY_LINKAGE STREQUAL static) if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
@ -48,5 +46,5 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
endif() endif()
# Handle copyright # Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/mozjpeg RENAME copyright) file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_copy_pdbs() vcpkg_copy_pdbs()