diff options
| author | glachancecmaisonneuve <glachance@cmaisonneuve.qc.ca> | 2017-10-05 12:15:42 -0400 |
|---|---|---|
| committer | glachancecmaisonneuve <glachance@cmaisonneuve.qc.ca> | 2017-10-05 12:15:42 -0400 |
| commit | 13a225c6ab4c20e7f62c3463be64b3075ffb9c50 (patch) | |
| tree | 54e3858c0af0e86cb05fceed6a03e79a27d5195e | |
| parent | 322e9254c1c4362ea30e1106fb44c087cbbe62e8 (diff) | |
| download | vcpkg-13a225c6ab4c20e7f62c3463be64b3075ffb9c50.tar.gz vcpkg-13a225c6ab4c20e7f62c3463be64b3075ffb9c50.zip | |
mozjpeg initial port
| -rw-r--r-- | ports/mozjpeg/CONTROL | 3 | ||||
| -rw-r--r-- | ports/mozjpeg/portfile.cmake | 49 |
2 files changed, 52 insertions, 0 deletions
diff --git a/ports/mozjpeg/CONTROL b/ports/mozjpeg/CONTROL new file mode 100644 index 000000000..8afc065b3 --- /dev/null +++ b/ports/mozjpeg/CONTROL @@ -0,0 +1,3 @@ +Source: mozjpeg +Version: 3.2 +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..d95f83ff8 --- /dev/null +++ b/ports/mozjpeg/portfile.cmake @@ -0,0 +1,49 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mozjpeg-3.2) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/mozilla/mozjpeg/archive/v3.2.zip" + FILENAME "mozjpeg.zip" + SHA512 a1ba53dea3e04add46616918b5e96f2c8102ef65856596f1794df29c8be27db3d9fb13e7ffc864d23626f98dff5a6b47315903cae9ae41f9905aef2cc91af0c5 +) + +vcpkg_find_acquire_program(NASM) +get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) +set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}") + +vcpkg_extract_source_archive(${ARCHIVE}) + +if (${VCPKG_LIBRARY_LINKAGE} STREQUAL static) + set(OPTIONS "-DENABLE_SHARED=FALSE") +else() + set(OPTIONS "-DENABLE_STATIC=FALSE") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS ${OPTIONS} +) + +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) +file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) +file(REMOVE ${EXES}) + +#remove empty fodlers 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 |
