From 2ba37949098078c155cc4dd4131474ad45db2f82 Mon Sep 17 00:00:00 2001 From: Lily <47812810+LilyWangL@users.noreply.github.com> Date: Sat, 6 Jun 2020 03:10:36 +0800 Subject: [PATCH] [mozjpeg] Update to latest commit (#11719) --- ports/mozjpeg/CONTROL | 2 +- ports/mozjpeg/fix-install-error.patch | 213 +++++++++++++++----------- ports/mozjpeg/portfile.cmake | 12 +- 3 files changed, 132 insertions(+), 95 deletions(-) diff --git a/ports/mozjpeg/CONTROL b/ports/mozjpeg/CONTROL index 2f786a1c21..867ba8bcae 100644 --- a/ports/mozjpeg/CONTROL +++ b/ports/mozjpeg/CONTROL @@ -1,4 +1,4 @@ Source: mozjpeg -Version: 3.2-3 +Version: 2020-06-02 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. diff --git a/ports/mozjpeg/fix-install-error.patch b/ports/mozjpeg/fix-install-error.patch index 677ce9337d..b0ba9ac2d7 100644 --- a/ports/mozjpeg/fix-install-error.patch +++ b/ports/mozjpeg/fix-install-error.patch @@ -1,87 +1,126 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ac0ebdb..483bf0f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -875,43 +875,51 @@ add_custom_target(installer - cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND} - SOURCES mozjpeg.nsi) - -+if(CMAKE_BUILD_TYPE STREQUAL "Debug") -+ set(REAL_BUILDS_PATH "Debug/") -+else() -+ set(REAL_BUILDS_PATH "Release/") -+endif() -+ - if(WITH_TURBOJPEG) - if(ENABLE_SHARED) - install(TARGETS turbojpeg tjbench -- ARCHIVE DESTINATION lib -- LIBRARY DESTINATION lib -- RUNTIME DESTINATION bin) -+ ARCHIVE DESTINATION lib/mozjpeg -+ LIBRARY DESTINATION lib/mozjpeg -+ RUNTIME DESTINATION tools/mozjpeg) - endif() - if(ENABLE_STATIC) -- install(TARGETS turbojpeg-static ARCHIVE DESTINATION lib) -+ install(TARGETS turbojpeg-static -+ LIBRARY DESTINATION lib/mozjpeg -+ ARCHIVE DESTINATION lib/mozjpeg) - if(NOT ENABLE_SHARED) -- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/tjbench-static.exe -- DESTINATION bin RENAME tjbench.exe) -+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/tjbench-static.exe -+ DESTINATION tools/mozjpeg RENAME tjbench.exe) - endif() - endif() -- install(FILES ${CMAKE_SOURCE_DIR}/turbojpeg.h DESTINATION include) -+ install(FILES ${CMAKE_SOURCE_DIR}/turbojpeg.h DESTINATION include/mozjpeg) - endif() - - if(ENABLE_STATIC) -- install(TARGETS jpeg-static ARCHIVE DESTINATION lib) -+ install(TARGETS jpeg-static ARCHIVE DESTINATION lib/mozjpeg) - if(NOT ENABLE_SHARED) -- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cjpeg-static.exe -- DESTINATION bin RENAME cjpeg.exe) -- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/djpeg-static.exe -- DESTINATION bin RENAME djpeg.exe) -- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/jpegtran-static.exe -- DESTINATION bin RENAME jpegtran.exe) -+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/cjpeg-static.exe -+ DESTINATION tools/mozjpeg RENAME cjpeg.exe) -+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/djpeg-static.exe -+ DESTINATION tools/mozjpeg RENAME djpeg.exe) -+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/jpegtran-static.exe -+ DESTINATION tools/mozjpeg RENAME jpegtran.exe) - endif() - endif() - --install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION bin) -+install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION tools/mozjpeg) - - install(FILES ${CMAKE_SOURCE_DIR}/README.ijg ${CMAKE_SOURCE_DIR}/README-mozilla.txt - ${CMAKE_SOURCE_DIR}/example.c ${CMAKE_SOURCE_DIR}/libjpeg.txt - ${CMAKE_SOURCE_DIR}/structure.txt ${CMAKE_SOURCE_DIR}/usage.txt - ${CMAKE_SOURCE_DIR}/wizard.txt -- DESTINATION doc) -+ DESTINATION share/mozjpeg) - - install(FILES ${CMAKE_BINARY_DIR}/jconfig.h ${CMAKE_SOURCE_DIR}/jerror.h - ${CMAKE_SOURCE_DIR}/jmorecfg.h ${CMAKE_SOURCE_DIR}/jpeglib.h -- DESTINATION include) -+ DESTINATION include/mozjpeg) -diff --git a/sharedlib/CMakeLists.txt b/sharedlib/CMakeLists.txt -index 268cc14..d067d2a 100644 ---- a/sharedlib/CMakeLists.txt -+++ b/sharedlib/CMakeLists.txt -@@ -68,6 +68,6 @@ add_executable(jcstest ../jcstest.c) - target_link_libraries(jcstest jpeg) - - install(TARGETS jpeg cjpeg djpeg jpegtran -- ARCHIVE DESTINATION lib -- LIBRARY DESTINATION lib -- RUNTIME DESTINATION bin) -+ ARCHIVE DESTINATION lib/mozjpeg -+ LIBRARY DESTINATION lib/mozjpeg -+ RUNTIME DESTINATION tools/mozjpeg) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 51f4714..9ca3463 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1370,21 +1370,28 @@ endif() + + set(EXE ${CMAKE_EXECUTABLE_SUFFIX}) + ++if(CMAKE_BUILD_TYPE STREQUAL "Debug") ++ set(REAL_BUILDS_PATH "Debug/") ++else() ++ set(REAL_BUILDS_PATH "Release/") ++endif() ++ + if(WITH_TURBOJPEG) + if(ENABLE_SHARED) + install(TARGETS turbojpeg tjbench +- 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 "$" +- DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) ++ DESTINATION ${CMAKE_INSTALL_BINDIR}/mozjpeg OPTIONAL) + endif() + endif() + if(ENABLE_STATIC) +- install(TARGETS turbojpeg-static ARCHIVE +- DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ install(TARGETS turbojpeg-static ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg) + if(NOT ENABLE_SHARED) + if(MSVC_IDE OR XCODE) + set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}") +@@ -1392,15 +1399,15 @@ if(WITH_TURBOJPEG) + set(DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() + install(PROGRAMS ${DIR}/tjbench-static${EXE} +- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE}) ++ DESTINATION tools/mozjpeg RENAME tjbench${EXE}) + endif() + endif() + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg.h +- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mozjpeg) + endif() + + if(ENABLE_STATIC) +- install(TARGETS jpeg-static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ install(TARGETS jpeg-static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg) + if(NOT ENABLE_SHARED) + if(MSVC_IDE OR XCODE) + set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}") +@@ -1408,15 +1415,15 @@ if(ENABLE_STATIC) + set(DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() + install(PROGRAMS ${DIR}/cjpeg-static${EXE} +- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME cjpeg${EXE}) ++ DESTINATION tools/mozjpeg RENAME cjpeg${EXE}) + install(PROGRAMS ${DIR}/djpeg-static${EXE} +- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE}) ++ DESTINATION tools/mozjpeg RENAME djpeg${EXE}) + install(PROGRAMS ${DIR}/jpegtran-static${EXE} +- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE}) ++ DESTINATION tools/mozjpeg RENAME jpegtran${EXE}) + endif() + endif() + +-install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION tools/mozjpeg) + + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg + ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt +@@ -1424,10 +1431,10 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg + ${CMAKE_CURRENT_SOURCE_DIR}/libjpeg.txt + ${CMAKE_CURRENT_SOURCE_DIR}/structure.txt + ${CMAKE_CURRENT_SOURCE_DIR}/usage.txt ${CMAKE_CURRENT_SOURCE_DIR}/wizard.txt +- ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION ${CMAKE_INSTALL_DOCDIR}) ++ ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION share/mozjpeg) + if(WITH_JAVA) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/java/TJExample.java +- 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 "$" +- DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) ++ DESTINATION ${CMAKE_INSTALL_BINDIR}/mozjpeg OPTIONAL) + endif() diff --git a/ports/mozjpeg/portfile.cmake b/ports/mozjpeg/portfile.cmake index d771fd2053..93f9c86e94 100644 --- a/ports/mozjpeg/portfile.cmake +++ b/ports/mozjpeg/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mozilla/mozjpeg - REF v3.2 - SHA512 d14789827a9f4f78139a3945d3169d37eb891758b5ab40ef19e99ebebb2fb6d7c3a05495de245bba54cfd913b153af352159aa9fc0218127f97819137e0f1ab8 + REF 6d95c51adf0c314017f541b6cb07e13cc1bce754 + SHA512 a21c8b3a561b387933a27befaa1d05a8c63b0e203d72d73071a4c9b57c6b7d57b44836f211c4dcb80eee4b01876f0a0fb4c91a60c3ae867e906e5e4e27165627 HEAD_REF master PATCHES fix-install-error.patch @@ -12,7 +10,7 @@ vcpkg_from_github( vcpkg_find_acquire_program(NASM) 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) 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/share) -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/mozjpeg) +vcpkg_copy_tools(${CURRENT_PACKAGES_DIR}/tools/mozjpeg) #remove empty folders after static build if (VCPKG_LIBRARY_LINKAGE STREQUAL static) @@ -48,5 +46,5 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) endif() # 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() \ No newline at end of file