aboutsummaryrefslogtreecommitdiff
path: root/ports/libjpeg-turbo
diff options
context:
space:
mode:
authorWimok Nupphiboon <wimok.mok@gmail.com>2018-03-24 11:53:55 +0700
committerWimok Nupphiboon <wimok.mok@gmail.com>2018-03-24 11:53:55 +0700
commit663be4bbffd435cf5e5fc62a0774c784c10ddc68 (patch)
treed214f24405fa75d4dad9dfb938a04846d2ca6102 /ports/libjpeg-turbo
parent1e380dde21317e73d1859dad1c64c06eb88cc502 (diff)
parentaa57df6d6ed6d17000522492b66fc93d3f32ab86 (diff)
downloadvcpkg-663be4bbffd435cf5e5fc62a0774c784c10ddc68.tar.gz
vcpkg-663be4bbffd435cf5e5fc62a0774c784c10ddc68.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'ports/libjpeg-turbo')
-rw-r--r--ports/libjpeg-turbo/CONTROL2
-rw-r--r--ports/libjpeg-turbo/linux-cmake.patch26
-rw-r--r--ports/libjpeg-turbo/portfile.cmake16
3 files changed, 41 insertions, 3 deletions
diff --git a/ports/libjpeg-turbo/CONTROL b/ports/libjpeg-turbo/CONTROL
index 2bb119dbc..fa72d68b0 100644
--- a/ports/libjpeg-turbo/CONTROL
+++ b/ports/libjpeg-turbo/CONTROL
@@ -1,3 +1,3 @@
Source: libjpeg-turbo
-Version: 1.5.3
+Version: 1.5.3-1
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.
diff --git a/ports/libjpeg-turbo/linux-cmake.patch b/ports/libjpeg-turbo/linux-cmake.patch
new file mode 100644
index 000000000..48a04279f
--- /dev/null
+++ b/ports/libjpeg-turbo/linux-cmake.patch
@@ -0,0 +1,26 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c29e604..6e467be 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -29,10 +29,6 @@ pad_number(VERSION_MINOR 3)
+ pad_number(VERSION_REVISION 3)
+ set(LIBJPEG_TURBO_VERSION_NUMBER ${VERSION_MAJOR}${VERSION_MINOR}${VERSION_REVISION})
+
+-if(NOT WIN32)
+- message(FATAL_ERROR "Platform not supported by this build system. Use autotools instead.")
+-endif()
+-
+ string(TIMESTAMP BUILD "%Y%m%d")
+
+ # This does nothing except when using MinGW. CMAKE_BUILD_TYPE has no meaning
+@@ -166,8 +162,10 @@ endif()
+
+ if(64BIT)
+ message(STATUS "64-bit build")
++ add_compile_options(-DSIZEOF_SIZE_T=8)
+ else()
+ message(STATUS "32-bit build")
++ add_compile_options(-DSIZEOF_SIZE_T=4)
+ endif()
+
+ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
diff --git a/ports/libjpeg-turbo/portfile.cmake b/ports/libjpeg-turbo/portfile.cmake
index a3c0e65b6..7f6bc4973 100644
--- a/ports/libjpeg-turbo/portfile.cmake
+++ b/ports/libjpeg-turbo/portfile.cmake
@@ -7,12 +7,20 @@ vcpkg_from_github(
HEAD_REF master
)
+vcpkg_download_distfile(GETENV_PATCH
+ URLS "https://github.com/libjpeg-turbo/libjpeg-turbo/commit/bd96b30b74fe166fc94218cfc64a097fafdcc05f.diff"
+ FILENAME "libjpeg-turbo-bd96b30b74fe166fc94218cfc64a097fafdcc05f.diff"
+ SHA512 4cd064521b5e4baba4adf972f9f574f6dd43a2cd3e3ad143ca2cdf0f165024406d4fd2ed094124d0c17c5370394140e82fdd892d3cdc49609acdf8f79db1758c
+)
+
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES "${CMAKE_CURRENT_LIST_DIR}/add-options-for-exes-docs-headers.patch"
+ "${CMAKE_CURRENT_LIST_DIR}/linux-cmake.patch"
+ "${GETENV_PATCH}"
)
-if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
+if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR (VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore"))
set(LIBJPEGTURBO_SIMD -DWITH_SIMD=OFF)
else()
set(LIBJPEGTURBO_SIMD -DWITH_SIMD=ON)
@@ -21,6 +29,10 @@ else()
set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}")
endif()
+if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ set(ENV{_CL_} "-DNO_GETENV -DNO_PUTENV")
+endif()
+
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ENABLE_SHARED)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" WITH_CRT_DLL)
@@ -41,7 +53,7 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
# Rename libraries for static builds
-if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" AND EXISTS "${CURRENT_PACKAGES_DIR}/lib/jpeg-static.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/lib/jpeg.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/turbojpeg-static.lib" "${CURRENT_PACKAGES_DIR}/lib/turbojpeg.lib")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg.lib")