diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-10-06 14:11:19 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-06 14:11:19 -0700 |
| commit | 1008d3dd7ad3e466f92eff215924e816f0165b61 (patch) | |
| tree | a42558e3033accc0f997fdbc44c9fd6f19277018 | |
| parent | cd4142d3cac144c6f4e558cdfe8403e1987ff833 (diff) | |
| parent | 049ad42779176fba38a79ec4c1344fcd2d058dbc (diff) | |
| download | vcpkg-1008d3dd7ad3e466f92eff215924e816f0165b61.tar.gz vcpkg-1008d3dd7ad3e466f92eff215924e816f0165b61.zip | |
Merge pull request #1929 from glachancecmaisonneuve/mozjpeg
mozjpeg initial port
| -rw-r--r-- | ports/mozjpeg/CONTROL | 3 | ||||
| -rw-r--r-- | ports/mozjpeg/portfile.cmake | 54 |
2 files changed, 57 insertions, 0 deletions
diff --git a/ports/mozjpeg/CONTROL b/ports/mozjpeg/CONTROL new file mode 100644 index 000000000..9e3f19b4c --- /dev/null +++ b/ports/mozjpeg/CONTROL @@ -0,0 +1,3 @@ +Source: mozjpeg +Version: 3.2-1 +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/portfile.cmake b/ports/mozjpeg/portfile.cmake new file mode 100644 index 000000000..52011d394 --- /dev/null +++ b/ports/mozjpeg/portfile.cmake @@ -0,0 +1,54 @@ +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO mozilla/mozjpeg + REF v3.2 + SHA512 d14789827a9f4f78139a3945d3169d37eb891758b5ab40ef19e99ebebb2fb6d7c3a05495de245bba54cfd913b153af352159aa9fc0218127f97819137e0f1ab8 + HEAD_REF master +) + +vcpkg_find_acquire_program(NASM) +get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) +set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}") + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(OPTIONS "-DENABLE_SHARED=FALSE") +else() + set(OPTIONS "-DENABLE_STATIC=FALSE") +endif() + +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" WITH_CRT_DLL) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + ${OPTIONS} + -DWITH_CRT_DLL=${WITH_CRT_DLL} +) + +vcpkg_install_cmake() + +#remove extra debug files +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/doc) +file(GLOB DEBUGEXES ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) +file(REMOVE ${DEBUGEXES}) + +#move exes to tools +file(GLOB EXES ${CURRENT_PACKAGES_DIR}/bin/*.exe) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/mozjpeg) +file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/mozjpeg) +file(REMOVE ${EXES}) + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/mozjpeg) + +#remove empty folders after static build +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/mozjpeg RENAME copyright) +vcpkg_copy_pdbs()
\ No newline at end of file |
