Merge remote-tracking branch 'origin/master'

This commit is contained in:
Wimok Nupphiboon 2018-04-04 20:09:49 +07:00
commit 30b56c8614
61 changed files with 1017 additions and 102 deletions

View File

@ -1,5 +1,5 @@
Source: abseil
Version: 2018-03-29
Version: 2018-04-02
Description: an open-source collection designed to augment the C++ standard library.
Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google's own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives.
In some cases, Abseil provides pieces missing from the C++ standard; in others, Abseil provides alternatives to the standard for special needs we've found through usage in the Google code base. We denote those cases clearly within the library code we provide you.

View File

@ -7,8 +7,8 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO abseil/abseil-cpp
REF d9b47d7888b39cd113bacacb9edd5023a71cbb3a
SHA512 d5aac7bbe7cdb1419f19eff80487a1d8fa03cde82db760bf9fab464a62ae66251c62f69ff13940db41af1bb287ea9680782773bf1cb19c15d489f711b390d734
REF 7b3c38a0628b9201ce92a6893b96890b64e5daa8
SHA512 6e23d98adabbefcf8054a0ff03fdbc5438efbd957cd4864ab870496468f9891eeb8f73796a37faba7412a4b88b96771fc23f3f0bb89ab6023800beb99e6660d3
HEAD_REF master
)

View File

@ -1,5 +1,5 @@
Source: aws-sdk-cpp
Version: 1.4.24
Version: 1.4.27
Description: AWS SDK for C++
Default-Features: dynamodb, ec2, kms, rds, s3, sns, sqs
# Automatically generated by generateFeatures.ps1

View File

@ -3,8 +3,8 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO aws/aws-sdk-cpp
REF 1.4.24
SHA512 bda259caeeb909884128268f0dfe3ca58ce665be2a0304302f1fd09c4217cbcd34c20119009123aeb80377dfe5144b72cbd98d2acbdc9ffa729c09e380751bf2
REF 1.4.27
SHA512 d714fe12d3701461b897256d824b169ff3242bb412d386a2c1455c0dc1dcedf3add444eab556551fbb69e0339b49c3133c1f820710b5681d25a23237e919ddd0
HEAD_REF master
)

View File

@ -1,3 +1,3 @@
Source: clara
Version: 2018-03-23
Version: 2018-04-02
Description: A simple to use command line parser for C++

View File

@ -2,8 +2,8 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO philsquared/Clara
REF 3ba13ad04a3eebc002320f187475ddcd267288a3
SHA512 d2e73d2ac70f9ad6428f434b101d413453648708d545a1a71f2363b5847e710412b69fdb9ab100eb437f9419cc4c250ce7ca56cfa9132096be9aa471dcb677d0
REF ba5485cb56329db3ea3f5402ef596d3b512b903a
SHA512 8aa66e3e1a2b7c544d9d105ad9f803119791b971cce4dff63ae47b63a08fd422fc75108aeb69300fa9982568d689f506456c6f8ed7287a19b9ed84649fad9315
HEAD_REF master
)
file(INSTALL ${SOURCE_PATH}/single_include/clara.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include)

View File

@ -1,3 +1,3 @@
Source: discord-rpc
Version: 3.1.0
Version: 3.2.0
Description: Rich Presence allows you to leverage the totally overhauled "Now Playing" section in a Discord user's profile to help people play your game together.

View File

@ -3,8 +3,8 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO discordapp/discord-rpc
REF v3.1.0
SHA512 f467ac6428588b45a90eaec0786b7f0d799b5ee9e97528dd69cd1890fb4dd9c887807e845a0a1d75e19e6e1f6cb2d21c8a77d09e95f24d8df0aae04eae17a216
REF v3.2.0
SHA512 83a32db240f30f4429c145dd400eba5b9985ea779e492ffa2be2ba2664d97e4dec1f4416ad0f3e6fc908c3c9b30aebe4a8e293e0ef3c60e01fc6f16b5f9a7c16
HEAD_REF master
)

View File

@ -1,4 +1,4 @@
Source: eastl
Version: 3.08.00
Version: 3.09.00
Description: Electronic Arts Standard Template Library.
It is a C++ template library of containers, algorithms, and iterators useful for runtime and tool development across multiple platforms. It is a fairly extensive and robust implementation of such a library and has an emphasis on high performance above all other considerations.

View File

@ -8,8 +8,8 @@ set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/eastl)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO electronicarts/EASTL
REF 3.08.00
SHA512 dc9510d1b6021fb275049a45d52d25002ac2e9859047c0ba4881aa478b700645e17b4fdbc7cdb43cee86df9155c545d2a29a6c1c5b06df3b8b6b4e150f010ade
REF 3.09.00
SHA512 73b1b6ce0eba65fca049571a44595ff581f0dda01dcaaf3e0deb2d22e62b9b694a321339038c5cc2e6802ba3270675b814b73b59a8cfc8d71e645c60b17bebb6
HEAD_REF master
)

View File

@ -1,4 +1,4 @@
Source: exiv2
Version: 2018-03-29
Version: 2018-04-02
Build-Depends: zlib, expat, libiconv
Description: Image metadata library and tools http://www.exiv2.org

View File

@ -3,8 +3,8 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Exiv2/exiv2
REF 8b7941b7332a3299b3b6061e93f352ef66440666
SHA512 743a9792753915334e86c55112ef876bf0353924b85b0bf33ffb8217606ecb57954eec2d0e904f6e9fd9ea435b96f035bea793cb5040f54169eea0ba0c2fd7e3
REF 07d75cd0e833286ce9e301ea83229f3e283c6191
SHA512 8cf5cb919c12e719d70f2ea71c84835f09f2962095eeb56bb27ef3cd22ad4ea032dfbf9704f9c7393de0a969d3ae0609dafeb619b6c28dca598c8f34a3810b4d
HEAD_REF master
)

View File

@ -1,5 +1,5 @@
Source: folly
Version: 2018.03.19.00-1
Version: 2018.03.19.00-2
Description: An open-source C++ library developed and used at Facebook. The library is UNSTABLE on Windows
Build-Depends: openssl, libevent, double-conversion, glog, gflags, boost-chrono, boost-context, boost-conversion, boost-crc, boost-date-time, boost-filesystem, boost-multi-index, boost-program-options, boost-regex, boost-system, boost-thread
Default-Features: zlib

View File

@ -1,9 +1,10 @@
find_path(LZ4_INCLUDE_DIR lz4.h)
find_package(LZ4_LIBRARY_DEBUG NAMES lz4d)
find_package(LZ4_LIBRARY_RELEASE NAMES lz4)
find_library(LZ4_LIBRARY_DEBUG NAMES lz4d)
find_library(LZ4_LIBRARY_RELEASE NAMES lz4)
select_library_configurations(LZ4_LIBRARY)
include(SelectLibraryConfigurations)
select_library_configurations(LZ4)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(

View File

@ -1,9 +1,10 @@
find_path(SNAPPY_INCLUDE_DIR snappy.h)
find_package(SNAPPY_LIBRARY_DEBUG NAMES snappyd)
find_package(SNAPPY_LIBRARY_RELEASE NAMES snappy)
find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd)
find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy)
select_library_configurations(SNAPPY_LIBRARY)
include(SelectLibraryConfigurations)
select_library_configurations(SNAPPY)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(

View File

@ -0,0 +1,4 @@
Source: google-cloud-cpp
Version: 0.1.0
Build-Depends: grpc, gtest
Description: C++ Client Libraries for Google Cloud Platform APIs.

View File

@ -0,0 +1,44 @@
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
message(STATUS "Warning: Dynamic building not supported yet. Building static.")
set(VCPKG_LIBRARY_LINKAGE static)
endif()
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO GoogleCloudPlatform/google-cloud-cpp
REF v0.1.0
SHA512 3947cc24ca1ed97309f055f17945afe2d6b22ae8f54f86d3395f8c491b7409d4b7bb12206889d04d07f51236e9fd5afd65b904c8c80521a3313588d8069545c2
HEAD_REF master
)
set(GOOGLEAPIS_VERSION 92f10d7033c6fa36e1a5a369ab5aa8bafd564009)
vcpkg_download_distfile(GOOGLEAPIS
URLS "https://github.com/google/googleapis/archive/92f10d7033c6fa36e1a5a369ab5aa8bafd564009.zip"
FILENAME "googleapis-${GOOGLEAPIS_VERSION}.zip"
SHA512 4280ece965a231f6a0bb3ea38a961d15babd9eac517f9b0d57e12f186481bbab6a27e4f0ee03ba3c587c9aa93d3c2e6c95f67f50365c65bb10594f0229279287
)
file(REMOVE_RECURSE ${SOURCE_PATH}/third_party)
vcpkg_extract_source_archive(${GOOGLEAPIS} ${SOURCE_PATH}/third_party)
file(RENAME ${SOURCE_PATH}/third_party/googleapis-${GOOGLEAPIS_VERSION} ${SOURCE_PATH}/third_party/googleapis)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DGOOGLE_CLOUD_CPP_GRPC_PROVIDER=vcpkg
-DGOOGLE_CLOUD_CPP_GMOCK_PROVIDER=vcpkg
)
vcpkg_install_cmake(ADD_BIN_TO_PATH)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/bigtable/client/testing)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake TARGET_PATH share/bigtable_client)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/google-cloud-cpp RENAME copyright)
vcpkg_copy_pdbs()

View File

@ -0,0 +1,13 @@
diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake
index 777b91e..75a13c9 100644
--- a/googletest/cmake/internal_utils.cmake
+++ b/googletest/cmake/internal_utils.cmake
@@ -55,7 +55,7 @@ macro(config_compiler_and_linker)
if (MSVC)
# Newlines inside flags variables break CMake's NMake generator.
# TODO(vladl@google.com): Add -RTCs and -RTCu to debug builds.
- set(cxx_base_flags "-GS -W4 -WX -wd4251 -wd4275 -nologo -J -Zi")
+ set(cxx_base_flags "-GS -W4 -WX -wd4251 -wd4275 -nologo -J")
if (MSVC_VERSION LESS 1400) # 1400 is Visual Studio 2005
# Suppress spurious warnings MSVC 7.1 sometimes issues.
# Forcing value to bool.

View File

@ -1,3 +1,3 @@
Source: gtest
Version: 1.8.0-7
Version: 1.8.0-8
Description: GoogleTest and GoogleMock testing frameworks.

View File

@ -15,6 +15,7 @@ vcpkg_from_github(
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Enable-C-11-features-for-VS2015-fix-appveyor-fail.patch
${CMAKE_CURRENT_LIST_DIR}/0002-Fix-z7-override.patch
)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" GTEST_FORCE_SHARED_CRT)

View File

@ -1,3 +1,3 @@
Source: libuv
Version: 1.19.2
Version: 1.20.0
Description: libuv is a multi-platform support library with a focus on asynchronous I/O.

View File

@ -2,8 +2,8 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libuv/libuv
REF v1.19.2
SHA512 4fa879e34c51ae428ebf72ce80873b8d12994ae1560f9d3577a693653bfd5bd4b4fda7ff457b98b5e60fc82546658300401d6545d677f31d2cd66be3d82e02da
REF v1.20.0
SHA512 382309cb6e54765b956b03357cb754f49d93505ba0e0122a77f33efca07d7b87966c993a5fd9f9503edd1bcd0f49ca42bd9cd9264cce94c847aebca77d237ba0
HEAD_REF v1.x)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

View File

@ -1,3 +1,3 @@
Source: libvpx
Version: 1.6.1-2
Version: 1.7.0
Description: The reference software implementation for the video coding formats VP8 and VP9.

View File

@ -5,8 +5,8 @@ endif()
include(vcpkg_common_functions)
set(LIBVPX_VERSION 1.6.1)
set(LIBVPX_HASH 13b7eb515d026b302b8c484d6f06df067feb5aed4ceac953d85fe84fd684dab07e89ddbf80b4f395c6d9127709422156287e5754f49246050b2e18930adb3970)
set(LIBVPX_VERSION 1.7.0)
set(LIBVPX_HASH 8b3b766b550f8d86907628d7ed88035f9a2612aac21542e0fd5ad35b905eb82cbe1be02a1a24afce7a3bcc4766f62611971f72724761996b392136c40a1e7ff0)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libvpx-${LIBVPX_VERSION})
@ -14,7 +14,7 @@ string(REGEX REPLACE "\\\\" "/" SOURCE_PATH_UNIX ${SOURCE_PATH})
string(REGEX REPLACE "\\\\" "/" CURRENT_PACKAGES_DIR_UNIX ${CURRENT_PACKAGES_DIR})
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/webmproject/libvpx/archive/v${LIBVPX_VERSION}.tar.gz"
URLS "https://github.com/webmproject/libvpx/archive/v${LIBVPX_VERSION}/libvpx-${LIBVPX_VERSION}.tar.gz"
FILENAME "libvpx-${LIBVPX_VERSION}.tar.gz"
SHA512 ${LIBVPX_HASH}
)
@ -23,8 +23,11 @@ vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_find_acquire_program(YASM)
vcpkg_find_acquire_program(PERL)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES make)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils)
get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
message(STATUS "PERL_EXE_PATH ; ${PERL_EXE_PATH}")
set(ENV{PATH} "${YASM_EXE_PATH};${MSYS_ROOT}/usr/bin;$ENV{PATH};${PERL_EXE_PATH}")
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
@ -48,7 +51,7 @@ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm)
set(LIBVPX_ARCH_DIR "ARM")
endif()
set(LIBVPX_TARGET_VS "vs14")
set(LIBVPX_TARGET_VS "vs15")
message(STATUS "Generating makefile")
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET})

3
ports/mhook/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: mhook
Version: 2.5.1-1
Description: A Windows API hooking library.

View File

@ -0,0 +1,21 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO apriorit/mhook
REF 2.5.1
SHA512 914f198417b1e30301a42463af5cfbf9269dc64bcf1be87d3d6d2943fd72b3536f48eb4bfb25a51dd0bbe0f8f099777b2d49c9d58cb2e2eeb517d998917ae976
HEAD_REF master
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)
vcpkg_install_cmake()
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mhook RENAME copyright)
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

View File

@ -0,0 +1,40 @@
--- a/config.h
+++ b/config.h
@@ -16,7 +16,7 @@
# define EPROTO ECONNABORTED
#endif
-#ifdef WIN32
+#ifdef WIN32 || WIN64
# ifndef strcasecmp
# define strcasecmp strcmpi
# endif
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -4,8 +4,8 @@
if (${WITH_THREADING} STREQUAL ON)
add_definitions("-DWITH_THREADING")
if (WIN32)
- set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib)
- set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include)
+ set (PTHREAD_LIBRARIES ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/pthreadsVC2.lib)
+ set (PTHREAD_INCLUDE_DIR ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include)
else (WIN32)
find_library(LIBPTHREAD pthread)
if (LIBPTHREAD)
--- a/lib/net_mosq.h
+++ b/lib/net_mosq.h
@@ -20,7 +20,12 @@
#include <unistd.h>
#else
#include <winsock2.h>
+#if defined(_MSC_VER) && _MSC_VER > 1900
+#undef ssize_t
typedef int ssize_t;
+#else
+typedef int ssize_t;
+#endif
#endif
#include <mosquitto_internal.h>

8
ports/mosquitto/CONTROL Normal file
View File

@ -0,0 +1,8 @@
Source: mosquitto
Version: 1.4.15
Build-Depends: c-ares, libwebsockets, openssl, pthreads
Description: Mosquitto is an open source message broker that implements the MQ Telemetry Transport protocol versions 3.1 and
3.1.1. MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model. This makes it
suitable for "machine to machine" messaging such as with low power sensors or mobile devices such as phones, embedded
computers or microcontrollers like the Arduino. you can see more information from this url
https://mosquitto.org/download/

View File

@ -0,0 +1,68 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a68061..e4197fd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,10 +24,10 @@ endif (WIN32)
add_definitions (-DCMAKE -DVERSION=\"${VERSION}\" -DTIMESTAMP=\"${TIMESTAMP}\")
if (WIN32)
- set (BINDIR .)
- set (SBINDIR .)
+ set (BINDIR bin)
+ set (SBINDIR bin)
set (SYSCONFDIR .)
- set (LIBDIR .)
+ set (LIBDIR lib)
set (INCLUDEDIR include)
set (DATAROOTDIR share)
set (MANDIR man)
@@ -86,10 +86,10 @@ option(WITH_SRV "Include SRV lookup support?" ON)
add_subdirectory(lib)
add_subdirectory(client)
add_subdirectory(src)
-add_subdirectory(man)
+#add_subdirectory(man)
# ========================================
# Install config file
# ========================================
-install(FILES mosquitto.conf aclfile.example pskfile.example pwfile.example DESTINATION "${SYSCONFDIR}")
+#install(FILES mosquitto.conf aclfile.example pskfile.example pwfile.example DESTINATION "${SYSCONFDIR}")
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 1260761..aebd580 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -4,8 +4,8 @@ option(WITH_THREADING "Include client library threading support?" ON)
if (${WITH_THREADING} STREQUAL ON)
add_definitions("-DWITH_THREADING")
if (WIN32)
- set (PTHREAD_LIBRARIES ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/pthreadsVC2.lib)
- set (PTHREAD_INCLUDE_DIR ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include)
+ find_library(PTHREAD_LIBRARIES NAMES pthreadsVC2)
+ find_path(PTHREAD_INCLUDE_DIR pthread.h)
else (WIN32)
find_library(LIBPTHREAD pthread)
if (LIBPTHREAD)
@@ -78,7 +78,7 @@ set_target_properties(libmosquitto PROPERTIES
SOVERSION 1
)
-install(TARGETS libmosquitto RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}")
+install(TARGETS libmosquitto RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}" ARCHIVE DESTINATION "${LIBDIR}")
install(FILES mosquitto.h DESTINATION "${INCLUDEDIR}")
if (UNIX)
diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt
index b80dc18..e91ec77 100644
--- a/lib/cpp/CMakeLists.txt
+++ b/lib/cpp/CMakeLists.txt
@@ -10,7 +10,7 @@ set_target_properties(mosquittopp PROPERTIES
VERSION ${VERSION}
SOVERSION 1
)
-install(TARGETS mosquittopp RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}")
+install(TARGETS mosquittopp RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}" ARCHIVE DESTINATION "${LIBDIR}")
install(FILES mosquittopp.h DESTINATION "${INCLUDEDIR}")
if (UNIX)

View File

@ -0,0 +1,13 @@
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -4,8 +4,8 @@
if (${WITH_THREADING} STREQUAL ON)
add_definitions("-DWITH_THREADING")
if (WIN32)
- set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib)
- set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include)
+ set (PTHREAD_LIBRARIES ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/pthreadsVC2.lib)
+ set (PTHREAD_INCLUDE_DIR ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include)
else (WIN32)
find_library(LIBPTHREAD pthread)
if (LIBPTHREAD)

View File

@ -0,0 +1,56 @@
include(vcpkg_common_functions)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
message("mosquitto only supports dynamic linkage")
set(VCPKG_LIBRARY_LINKAGE dynamic)
endif()
if(VCPKG_CRT_LINKAGE STREQUAL "static")
message(FATAL_ERROR "mosquitto does not support static CRT linkage")
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO eclipse/mosquitto
REF v1.4.15
SHA512 428ef9434d3fe022232dcde415fe8cd948d237507d512871803a116230f9e011c10fa01313111ced0946f906e8cc7e26d9eee5de6caa7f82590753a4d087f6fd
HEAD_REF master
)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/0001-win64-cmake.patch"
"${CMAKE_CURRENT_LIST_DIR}/cmake.patch"
"${CMAKE_CURRENT_LIST_DIR}/cmake-2.patch"
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DWITH_SRV=OFF
-DWITH_WEBSOCKETS=ON
-DWITH_TLS=ON
-DWITH_TLS_PSK=ON
-DWITH_THREADING=ON
OPTIONS_RELEASE
-DENABLE_DEBUG=OFF
OPTIONS_DEBUG
-DENABLE_DEBUG=ON
)
vcpkg_install_cmake()
# Remove debug/include
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(GLOB EXE ${CURRENT_PACKAGES_DIR}/bin/*.exe)
file(GLOB DEBUG_EXE ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
file(REMOVE ${EXE})
file(REMOVE ${DEBUG_EXE})
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/mosquitto RENAME copyright)
# Copy pdb
vcpkg_copy_pdbs()

View File

@ -1,3 +1,3 @@
Source: nuklear
Version: 2018-03-27
Version: 2018-04-02
Description: This is a minimal state immediate mode graphical user interface toolkit written in ANSI C and licensed under public domain

View File

@ -2,8 +2,8 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO vurtun/nuklear
REF 7e710ff4fb0186c0e462d43b30c82cab12ea1277
SHA512 9f65e2fe2e89521002f7d86e8c5f0947a76724b7e7eb87463832732f38561b0415da98a8411e474467a9e5e1b33189c98f6506cc1baf97dbced66cfe05f2a290
REF 60bd95c926f73b143ec91e66b2fe315ad2a316e1
SHA512 45cf7c5cab105241aec6c2a56a34abf9701eded52bf06d3092e0079949757a6cbb0d684b45952a054451384cd07a77b1763526470ec84835da3d514c614c65ba
HEAD_REF master
)
file(INSTALL ${SOURCE_PATH}/nuklear.h DESTINATION ${CURRENT_PACKAGES_DIR}/include)

View File

@ -1,4 +1,4 @@
Source: openimageio
Version: 1.8.9
Version: 1.8.10
Description: A library for reading and writing images, and a bunch of related classes, utilities, and application
Build-Depends: libjpeg-turbo, tiff, libpng, openexr, boost-thread, boost-smart-ptr, boost-foreach, boost-regex, boost-type-traits, boost-static-assert, boost-unordered, boost-config, boost-algorithm, boost-filesystem, boost-system, boost-thread, boost-asio, boost-random

View File

@ -3,8 +3,8 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO OpenImageIO/oiio
REF Release-1.8.9
SHA512 300eab0d2e7277c46550339d72af59b3ab2232d296b4d46808575015075cdbb9dd911e9b335c0d10bf6d95ebde907240af0f4828d422aca091f82491693dfef3
REF Release-1.8.10
SHA512 8b80019feb6bffd63bdd64e4ddad5a85b42f0ed7c27f7d82475b60b0b4db3945bd70d8d75921dd9ae8830b941d7eef6b89364ee1ab418558b75397a784314949
HEAD_REF master
)

View File

@ -1,3 +1,3 @@
Source: openssl
Version: 1.0.2o
Version: 1.0.2o-1
Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.

View File

@ -155,6 +155,10 @@ file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" _contents)
string(REPLACE "<winsock.h>" "<winsock2.h>" _contents "${_contents}")
file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" "${_contents}")
file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" _contents)
string(REPLACE "# include <windows.h>" "#ifndef _WINSOCKAPI_\n#define _WINSOCKAPI_\n#endif\n# include <windows.h>" _contents "${_contents}")
file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" "${_contents}")
vcpkg_copy_pdbs()
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})

View File

@ -1,4 +1,16 @@
Source: rocksdb
Version: 5.11.3
Version: 5.11.3-3
Description: A library that provides an embeddable, persistent key-value store for fast storage
Default-Features: zlib
Feature: lz4
Build-Depends: lz4
Description: lz4 support in rocksdb
Feature: snappy
Build-Depends: snappy
Description: snappy support in rocksdb
Feature: zlib
Build-Depends: zlib
Description: zlib support in rocksdb

View File

@ -0,0 +1,13 @@
find_path(LZ4_INCLUDE_DIR lz4.h)
find_library(LZ4_LIBRARY_DEBUG NAMES lz4d)
find_library(LZ4_LIBRARY_RELEASE NAMES lz4)
include(SelectLibraryConfigurations)
select_library_configurations(LZ4)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
LZ4 DEFAULT_MSG
LZ4_LIBRARY LZ4_INCLUDE_DIR
)

View File

@ -0,0 +1,13 @@
find_path(SNAPPY_INCLUDE_DIR snappy.h)
find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd)
find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy)
include(SelectLibraryConfigurations)
select_library_configurations(SNAPPY)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
SNAPPY DEFAULT_MSG
SNAPPY_LIBRARY SNAPPY_INCLUDE_DIR
)

View File

@ -17,6 +17,11 @@ vcpkg_apply_patches(
)
file(REMOVE "${SOURCE_PATH}/cmake/modules/Findzlib.cmake")
file(COPY
"${CMAKE_CURRENT_LIST_DIR}/Findlz4.cmake"
"${CMAKE_CURRENT_LIST_DIR}/Findsnappy.cmake"
DESTINATION "${SOURCE_PATH}/cmake/modules"
)
if(VCPKG_CRT_LINKAGE STREQUAL "static")
set(WITH_MD_LIBRARY OFF)
@ -27,14 +32,32 @@ endif()
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ROCKSDB_DISABLE_INSTALL_SHARED_LIB)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ROCKSDB_DISABLE_INSTALL_STATIC_LIB)
set(WITH_LZ4 OFF)
if("lz4" IN_LIST FEATURES)
set(WITH_LZ4 ON)
endif()
set(WITH_SNAPPY OFF)
if("snappy" IN_LIST FEATURES)
set(WITH_SNAPPY ON)
endif()
set(WITH_ZLIB OFF)
if("zlib" IN_LIST FEATURES)
set(WITH_ZLIB ON)
endif()
get_filename_component(ROCKSDB_VERSION "${SOURCE_PATH}" NAME)
string(REPLACE "rocksdb-rocksdb-" "" ROCKSDB_VERSION "${ROCKSDB_VERSION}")
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DWITH_GFLAGS=0
-DWITH_SNAPPY=0
-DWITH_LZ4=0
-DWITH_ZLIB=1
-DWITH_SNAPPY=${WITH_SNAPPY}
-DWITH_LZ4=${WITH_LZ4}
-DWITH_ZLIB=${WITH_ZLIB}
-DWITH_TESTS=OFF
-DROCKSDB_INSTALL_ON_WINDOWS=ON
-DFAIL_ON_WARNINGS=OFF
@ -43,7 +66,7 @@ vcpkg_configure_cmake(
-DCMAKE_DEBUG_POSTFIX=d
-DROCKSDB_DISABLE_INSTALL_SHARED_LIB=${ROCKSDB_DISABLE_INSTALL_SHARED_LIB}
-DROCKSDB_DISABLE_INSTALL_STATIC_LIB=${ROCKSDB_DISABLE_INSTALL_STATIC_LIB}
-DROCKSDB_VERSION=5.11.3
-DROCKSDB_VERSION=${ROCKSDB_VERSION}
-DCURRENT_INSTALLED_DIR=${CURRENT_INSTALLED_DIR}
-DCMAKE_DISABLE_FIND_PACKAGE_TBB=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_NUMA=TRUE

View File

@ -1,4 +1,4 @@
Source: sciter
Version: 4.1.4
Version: 4.1.5
Description: Sciter is an embeddable HTML/CSS/scripting engine.
Maintainer: andrew.fedoniouk@gmail.com, ehysta@gmail.com

View File

@ -12,8 +12,8 @@ include(vcpkg_common_functions)
# header-only library
set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled)
set(SCITER_REVISION eb0d385af8f426788870cc75522379f67854799c)
set(SCITER_SHA b785f370b27f759e0bec370f413c85b21d82a7cb76b3cbaa50c885b713453a325ff7ace042e263fafec7695c50370bb589597a9877816716bae9a4b4479f54fe)
set(SCITER_REVISION 331bf886a39c1a003f61bb0c1a75037ec4c1e9e4)
set(SCITER_SHA b05b7c694fb75a3308a2684ad78587453d70d41dc0609dfec0a40b465bb8982c79867a63a898a09ed54f6fc516d0b014942824da7a642682b86710ffb23c7366)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
set(SCITER_ARCH 64)

View File

@ -1,4 +1,4 @@
Source: tesseract
Version: 3.05.01-2
Version: 3.05.01-3
Description: An OCR Engine that was developed at HP Labs between 1985 and 1995... and now at Google.
Build-Depends: leptonica, icu

View File

@ -17,6 +17,7 @@ vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/use-vcpkg-icu.patch
${CMAKE_CURRENT_LIST_DIR}/ws2-32.patch
)
# The built-in cmake FindICU is better

View File

@ -0,0 +1,12 @@
diff --git a/viewer/svutil.cpp b/viewer/svutil.cpp
index 34a2286..bc2a7e1 100644
--- a/viewer/svutil.cpp
+++ b/viewer/svutil.cpp
@@ -23,6 +23,7 @@
#include <stdio.h>
#ifdef _WIN32
#include <windows.h>
+#pragma comment(lib, "Ws2_32.lib")
struct addrinfo {
struct sockaddr* ai_addr;
int ai_addrlen;

View File

@ -1,4 +1,4 @@
Source: theia
Version: 0.7-d15154a-1
Build-Depends: flann, cereal, ceres, openimageio, glew, freeglut
Version: 0.7-d15154a-2
Build-Depends: flann, cereal, ceres[suitesparse], openimageio, glew, freeglut
Description: An open source library for multiview geometry and structure from motion

391
ports/theia/fix-oiio.patch Normal file
View File

@ -0,0 +1,391 @@
diff --git a/src/theia/image/image.cc b/src/theia/image/image.cc
index df6aba4..5e2b8dc 100644
--- a/src/theia/image/image.cc
+++ b/src/theia/image/image.cc
@@ -60,18 +60,18 @@ FloatImage::FloatImage(const FloatImage& image_to_copy) {
}
FloatImage::FloatImage(const int width, const int height, const int channels) {
- OpenImageIO::ImageSpec image_spec(width, height, channels,
- OpenImageIO::TypeDesc::FLOAT);
+ OIIO_NAMESPACE::ImageSpec image_spec(width, height, channels,
+ OIIO_NAMESPACE::TypeDesc::FLOAT);
image_.reset(image_spec);
}
FloatImage::FloatImage(const int width, const int height, const int channels,
float* buffer)
- : image_(OpenImageIO::ImageSpec(width, height, channels,
- OpenImageIO::TypeDesc::FLOAT),
+ : image_(OIIO_NAMESPACE::ImageSpec(width, height, channels,
+ OIIO_NAMESPACE::TypeDesc::FLOAT),
reinterpret_cast<void*>(buffer)) {}
-FloatImage::FloatImage(const OpenImageIO::ImageBuf& image) {
+FloatImage::FloatImage(const OIIO_NAMESPACE::ImageBuf& image) {
image_.copy(image);
}
@@ -80,11 +80,11 @@ FloatImage& FloatImage::operator=(const FloatImage& image2) {
return *this;
}
-OpenImageIO::ImageBuf& FloatImage::GetOpenImageIOImageBuf() {
+OIIO_NAMESPACE::ImageBuf& FloatImage::GetOpenImageIOImageBuf() {
return image_;
}
-const OpenImageIO::ImageBuf& FloatImage::GetOpenImageIOImageBuf() const {
+const OIIO_NAMESPACE::ImageBuf& FloatImage::GetOpenImageIOImageBuf() const {
return image_;
}
@@ -110,7 +110,7 @@ void FloatImage::SetXY(const int x,
DCHECK_LT(c, Channels());
// Set the ROI to be the precise pixel location in the correct channel.
- OpenImageIO::ImageBuf::Iterator<float> it(image_, x, y, 0);
+ OIIO_NAMESPACE::ImageBuf::Iterator<float> it(image_, x, y, 0);
it[c] = value;
}
@@ -195,9 +195,9 @@ void FloatImage::ConvertToGrayscaleImage() {
// Compute luminance via a weighted sum of R,G,B (assuming Rec709 primaries
// and a linear scale)
const float luma_weights[3] = {.2126, .7152, .0722};
- OpenImageIO::ImageBuf source = image_;
+ OIIO_NAMESPACE::ImageBuf source = image_;
image_.clear();
- OpenImageIO::ImageBufAlgo::channel_sum(image_, source, luma_weights);
+ OIIO_NAMESPACE::ImageBufAlgo::channel_sum(image_, source, luma_weights);
}
void FloatImage::ConvertToRGBImage() {
@@ -207,13 +207,13 @@ void FloatImage::ConvertToRGBImage() {
}
// Copy the single grayscale channel into r, g, and b.
- const OpenImageIO::ImageBuf source(image_);
- OpenImageIO::ImageSpec image_spec(Width(), Height(), 3,
- OpenImageIO::TypeDesc::FLOAT);
+ const OIIO_NAMESPACE::ImageBuf source(image_);
+ OIIO_NAMESPACE::ImageSpec image_spec(Width(), Height(), 3,
+ OIIO_NAMESPACE::TypeDesc::FLOAT);
image_.reset(image_spec);
- OpenImageIO::ImageBufAlgo::paste(image_, 0, 0, 0, 0, source);
- OpenImageIO::ImageBufAlgo::paste(image_, 0, 0, 0, 1, source);
- OpenImageIO::ImageBufAlgo::paste(image_, 0, 0, 0, 2, source);
+ OIIO_NAMESPACE::ImageBufAlgo::paste(image_, 0, 0, 0, 0, source);
+ OIIO_NAMESPACE::ImageBufAlgo::paste(image_, 0, 0, 0, 1, source);
+ OIIO_NAMESPACE::ImageBufAlgo::paste(image_, 0, 0, 0, 2, source);
}
FloatImage FloatImage::AsGrayscaleImage() const {
@@ -238,12 +238,12 @@ FloatImage FloatImage::AsRGBImage() const {
}
void FloatImage::ScalePixels(float scale) {
- OpenImageIO::ImageBufAlgo::mul(image_, image_, scale);
+ OIIO_NAMESPACE::ImageBufAlgo::mul(image_, image_, scale);
}
void FloatImage::Read(const std::string& filename) {
image_.reset(filename);
- image_.read(0, 0, true, OpenImageIO::TypeDesc::FLOAT);
+ image_.read(0, 0, true, OIIO_NAMESPACE::TypeDesc::FLOAT);
}
void FloatImage::Write(const std::string& filename) const {
@@ -259,19 +259,19 @@ const float* FloatImage::Data() const {
FloatImage FloatImage::ComputeGradientX() const {
float sobel_filter_x[9] = {-.125, 0, .125, -.25, 0, .25, -.125, 0, .125};
- OpenImageIO::ImageSpec spec(3, 3, 1, OpenImageIO::TypeDesc::FLOAT);
- OpenImageIO::ImageBuf kernel_x(spec, sobel_filter_x);
- OpenImageIO::ImageBuf gradient_x;
- OpenImageIO::ImageBufAlgo::convolve(gradient_x, image_, kernel_x, false);
+ OIIO_NAMESPACE::ImageSpec spec(3, 3, 1, OIIO_NAMESPACE::TypeDesc::FLOAT);
+ OIIO_NAMESPACE::ImageBuf kernel_x(spec, sobel_filter_x);
+ OIIO_NAMESPACE::ImageBuf gradient_x;
+ OIIO_NAMESPACE::ImageBufAlgo::convolve(gradient_x, image_, kernel_x, false);
return FloatImage(gradient_x);
}
FloatImage FloatImage::ComputeGradientY() const {
float sobel_filter_y[9] = {-.125, -.25, -.125, 0, 0, 0, .125, .25, .125};
- OpenImageIO::ImageSpec spec(3, 3, 1, OpenImageIO::TypeDesc::FLOAT);
- OpenImageIO::ImageBuf kernel_y(spec, sobel_filter_y);
- OpenImageIO::ImageBuf gradient_y;
- OpenImageIO::ImageBufAlgo::convolve(gradient_y, image_, kernel_y, false);
+ OIIO_NAMESPACE::ImageSpec spec(3, 3, 1, OIIO_NAMESPACE::TypeDesc::FLOAT);
+ OIIO_NAMESPACE::ImageBuf kernel_y(spec, sobel_filter_y);
+ OIIO_NAMESPACE::ImageBuf gradient_y;
+ OIIO_NAMESPACE::ImageBufAlgo::convolve(gradient_y, image_, kernel_y, false);
return FloatImage(gradient_y);
}
@@ -280,28 +280,28 @@ FloatImage FloatImage::ComputeGradient() const {
float sobel_filter_x[9] = {-.125, 0, .125, -.25, 0, .25, -.125, 0, .125};
float sobel_filter_y[9] = {-.125, -.25, -.125, 0, 0, 0, .125, .25, .125};
- OpenImageIO::ImageSpec spec(3, 3, 1, OpenImageIO::TypeDesc::FLOAT);
- OpenImageIO::ImageBuf kernel_x(spec, sobel_filter_x);
- OpenImageIO::ImageBuf kernel_y(spec, sobel_filter_y);
+ OIIO_NAMESPACE::ImageSpec spec(3, 3, 1, OIIO_NAMESPACE::TypeDesc::FLOAT);
+ OIIO_NAMESPACE::ImageBuf kernel_x(spec, sobel_filter_x);
+ OIIO_NAMESPACE::ImageBuf kernel_y(spec, sobel_filter_y);
- OpenImageIO::ImageBuf gradient, gradient_x, gradient_y;
- OpenImageIO::ImageBufAlgo::convolve(gradient_x, image_, kernel_x, false);
- OpenImageIO::ImageBufAlgo::abs(gradient_x, gradient_x);
- OpenImageIO::ImageBufAlgo::convolve(gradient_y, image_, kernel_y, false);
- OpenImageIO::ImageBufAlgo::abs(gradient_y, gradient_y);
- OpenImageIO::ImageBufAlgo::add(gradient, gradient_x, gradient_y);
+ OIIO_NAMESPACE::ImageBuf gradient, gradient_x, gradient_y;
+ OIIO_NAMESPACE::ImageBufAlgo::convolve(gradient_x, image_, kernel_x, false);
+ OIIO_NAMESPACE::ImageBufAlgo::abs(gradient_x, gradient_x);
+ OIIO_NAMESPACE::ImageBufAlgo::convolve(gradient_y, image_, kernel_y, false);
+ OIIO_NAMESPACE::ImageBufAlgo::abs(gradient_y, gradient_y);
+ OIIO_NAMESPACE::ImageBufAlgo::add(gradient, gradient_x, gradient_y);
return FloatImage(gradient);
}
void FloatImage::ApproximateGaussianBlur(const double sigma) {
- OpenImageIO::ImageBuf kernel;
- OpenImageIO::ImageBufAlgo::make_kernel(kernel, "gaussian", 5.0f, 5.0f);
- OpenImageIO::ImageBufAlgo::convolve(image_, image_, kernel);
+ OIIO_NAMESPACE::ImageBuf kernel;
+ OIIO_NAMESPACE::ImageBufAlgo::make_kernel(kernel, "gaussian", 5.0f, 5.0f);
+ OIIO_NAMESPACE::ImageBufAlgo::convolve(image_, image_, kernel);
}
void FloatImage::MedianFilter(const int patch_width) {
- CHECK(OpenImageIO::ImageBufAlgo::median_filter(image_, image_, patch_width));
+ CHECK(OIIO_NAMESPACE::ImageBufAlgo::median_filter(image_, image_, patch_width));
}
void FloatImage::Integrate(FloatImage* integral) const {
@@ -327,14 +327,14 @@ void FloatImage::Resize(int new_width, int new_height) {
// If the image has not been initialized then initialize it with the image
// spec. Otherwise resize the image and interpolate pixels accordingly.
if (!image_.initialized()) {
- OpenImageIO::ImageSpec image_spec(new_width, new_height, Channels(),
- OpenImageIO::TypeDesc::FLOAT);
+ OIIO_NAMESPACE::ImageSpec image_spec(new_width, new_height, Channels(),
+ OIIO_NAMESPACE::TypeDesc::FLOAT);
image_.reset(image_spec);
} else {
- OpenImageIO::ROI roi(0, new_width, 0, new_height, 0, 1, 0, Channels());
- OpenImageIO::ImageBuf dst;
- CHECK(OpenImageIO::ImageBufAlgo::resize(dst, image_, nullptr, roi))
- << OpenImageIO::geterror();
+ OIIO_NAMESPACE::ROI roi(0, new_width, 0, new_height, 0, 1, 0, Channels());
+ OIIO_NAMESPACE::ImageBuf dst;
+ CHECK(OIIO_NAMESPACE::ImageBufAlgo::resize(dst, image_, nullptr, roi))
+ << OIIO_NAMESPACE::geterror();
image_.copy(dst);
}
}
diff --git a/src/theia/image/image.h b/src/theia/image/image.h
index e4f22cc..29122d2 100644
--- a/src/theia/image/image.h
+++ b/src/theia/image/image.h
@@ -64,7 +64,7 @@ class FloatImage {
// Copy function. This is a deep copy of the image.
FloatImage(const FloatImage& image_to_copy);
- explicit FloatImage(const OpenImageIO::ImageBuf& image);
+ explicit FloatImage(const OIIO_NAMESPACE::ImageBuf& image);
FloatImage& operator=(const FloatImage& image2);
~FloatImage() {}
@@ -74,8 +74,8 @@ class FloatImage {
// wrapper for all algorithms. Getting a reference to the ImageBuf provides
// efficient access to the image data so that the image processing algorithms
// or other manipulations may be executed on the pixels.
- OpenImageIO::ImageBuf& GetOpenImageIOImageBuf();
- const OpenImageIO::ImageBuf& GetOpenImageIOImageBuf() const;
+ OIIO_NAMESPACE::ImageBuf& GetOpenImageIOImageBuf();
+ const OIIO_NAMESPACE::ImageBuf& GetOpenImageIOImageBuf() const;
// Image information
int Rows() const;
@@ -171,7 +171,7 @@ class FloatImage {
void Resize(double scale);
protected:
- OpenImageIO::ImageBuf image_;
+ OIIO_NAMESPACE::ImageBuf image_;
};
} // namespace theia
diff --git a/src/theia/image/image_test.cc b/src/theia/image/image_test.cc
index 894dc30..340488d 100644
--- a/src/theia/image/image_test.cc
+++ b/src/theia/image/image_test.cc
@@ -53,11 +53,11 @@ RandomNumberGenerator rng(51);
std::string img_filename = THEIA_DATA_DIR + std::string("/") + FLAGS_test_img;
#define ASSERT_IMG_EQ(oiio_img, theia_img, rows, cols) \
- oiio_img.read(0, 0, true, OpenImageIO::TypeDesc::FLOAT); \
+ oiio_img.read(0, 0, true, OIIO_NAMESPACE::TypeDesc::FLOAT); \
ASSERT_EQ(oiio_img.oriented_width(), theia_img.Cols()); \
ASSERT_EQ(oiio_img.oriented_height(), theia_img.Rows()); \
ASSERT_EQ(oiio_img.nchannels(), theia_img.Channels()); \
- OpenImageIO::ImageBuf::ConstIterator<float> it(oiio_img); \
+ OIIO_NAMESPACE::ImageBuf::ConstIterator<float> it(oiio_img); \
for (; !it.done(); ++it) { \
for (int c = 0; c < oiio_img.nchannels(); c++) { \
ASSERT_EQ(it[c], theia_img.GetXY(it.x(), it.y(), c)); \
@@ -89,7 +89,7 @@ float Interpolate(const FloatImage& image,
// Test that inputting the old fashioned way is the same as through our class.
TEST(Image, RGBInput) {
- OpenImageIO::ImageBuf oiio_img(img_filename.c_str());
+ OIIO_NAMESPACE::ImageBuf oiio_img(img_filename.c_str());
oiio_img.read();
FloatImage theia_img(img_filename);
@@ -102,7 +102,7 @@ TEST(Image, RGBInput) {
// Test that width and height methods work.
TEST(Image, RGBColsRows) {
- OpenImageIO::ImageBuf oiio_img(img_filename.c_str());
+ OIIO_NAMESPACE::ImageBuf oiio_img(img_filename.c_str());
FloatImage theia_img(img_filename);
int true_height = oiio_img.oriented_height();
@@ -114,10 +114,10 @@ TEST(Image, RGBColsRows) {
// Test that inputting the old fashioned way is the same as through our class.
TEST(Image, ConvertToGrayscaleImage) {
- OpenImageIO::ImageBuf oiio_img(img_filename.c_str());
- OpenImageIO::ImageBuf gray_img;
+ OIIO_NAMESPACE::ImageBuf oiio_img(img_filename.c_str());
+ OIIO_NAMESPACE::ImageBuf gray_img;
const float luma_weights[3] = {.2126, .7152, .0722};
- OpenImageIO::ImageBufAlgo::channel_sum(gray_img, oiio_img, luma_weights);
+ OIIO_NAMESPACE::ImageBufAlgo::channel_sum(gray_img, oiio_img, luma_weights);
FloatImage theia_img(img_filename);
theia_img.ConvertToGrayscaleImage();
@@ -131,10 +131,10 @@ TEST(Image, ConvertToGrayscaleImage) {
}
TEST(Image, ConvertToRGBImage) {
- OpenImageIO::ImageBuf oiio_img(img_filename.c_str());
- OpenImageIO::ImageBuf gray_img;
+ OIIO_NAMESPACE::ImageBuf oiio_img(img_filename.c_str());
+ OIIO_NAMESPACE::ImageBuf gray_img;
const float luma_weights[3] = {.2126, .7152, .0722};
- OpenImageIO::ImageBufAlgo::channel_sum(gray_img, oiio_img, luma_weights);
+ OIIO_NAMESPACE::ImageBufAlgo::channel_sum(gray_img, oiio_img, luma_weights);
// This should result in an image with the grayscale image copied in each
// channel.
@@ -148,7 +148,7 @@ TEST(Image, ConvertToRGBImage) {
// Check that all channels have equal value and that the value is equal to the
// grayscale image.
- for (OpenImageIO::ImageBuf::ConstIterator<float> it(gray_img);
+ for (OIIO_NAMESPACE::ImageBuf::ConstIterator<float> it(gray_img);
!it.done();
++it) {
ASSERT_EQ(it[0], rgb_img.GetXY(it.x(), it.y(), 0));
diff --git a/src/theia/sfm/exif_reader.cc b/src/theia/sfm/exif_reader.cc
index 48c049a..fea884d 100644
--- a/src/theia/sfm/exif_reader.cc
+++ b/src/theia/sfm/exif_reader.cc
@@ -127,8 +127,8 @@ bool ExifReader::ExtractEXIFMetadata(
CameraIntrinsicsPrior* camera_intrinsics_prior) const {
CHECK_NOTNULL(camera_intrinsics_prior);
- OpenImageIO::ImageBuf image(image_file);
- OpenImageIO::ImageSpec image_spec = image.spec();
+ OIIO_NAMESPACE::ImageBuf image(image_file);
+ OIIO_NAMESPACE::ImageSpec image_spec = image.spec();
// Set the image dimensions.
camera_intrinsics_prior->image_width = image_spec.width;
@@ -154,7 +154,7 @@ bool ExifReader::ExtractEXIFMetadata(
camera_intrinsics_prior->focal_length.is_set = true;
// Set GPS latitude.
- const OpenImageIO::ImageIOParameter* latitude =
+ const OIIO_NAMESPACE::ImageIOParameter* latitude =
image_spec.find_attribute("GPS:Latitude");
if (latitude != nullptr) {
camera_intrinsics_prior->latitude.is_set = true;
@@ -173,7 +173,7 @@ bool ExifReader::ExtractEXIFMetadata(
}
// Set GPS longitude.
- const OpenImageIO::ImageIOParameter* longitude =
+ const OIIO_NAMESPACE::ImageIOParameter* longitude =
image_spec.find_attribute("GPS:Longitude");
if (longitude != nullptr) {
camera_intrinsics_prior->longitude.is_set = true;
@@ -193,7 +193,7 @@ bool ExifReader::ExtractEXIFMetadata(
// Set GSP altitude.
- const OpenImageIO::ImageIOParameter* altitude =
+ const OIIO_NAMESPACE::ImageIOParameter* altitude =
image_spec.find_attribute("GPS:Altitude");
if (altitude != nullptr) {
camera_intrinsics_prior->altitude.is_set = true;
@@ -205,7 +205,7 @@ bool ExifReader::ExtractEXIFMetadata(
}
bool ExifReader::SetFocalLengthFromExif(
- const OpenImageIO::ImageSpec& image_spec,
+ const OIIO_NAMESPACE::ImageSpec& image_spec,
CameraIntrinsicsPrior* camera_intrinsics_prior) const {
static const float kMinFocalLength = 1e-2;
@@ -268,7 +268,7 @@ bool ExifReader::SetFocalLengthFromExif(
}
bool ExifReader::SetFocalLengthFromSensorDatabase(
- const OpenImageIO::ImageSpec& image_spec,
+ const OIIO_NAMESPACE::ImageSpec& image_spec,
CameraIntrinsicsPrior* camera_intrinsics_prior) const {
const int max_image_dimension = std::max(image_spec.width, image_spec.height);
const float exif_focal_length =
diff --git a/src/theia/sfm/exif_reader.h b/src/theia/sfm/exif_reader.h
index 3049cf4..d9d3108 100644
--- a/src/theia/sfm/exif_reader.h
+++ b/src/theia/sfm/exif_reader.h
@@ -74,13 +74,13 @@ class ExifReader {
// Sets the focal length from the focal plane resolution. Returns true if a
// valid focal length is found and false otherwise.
bool SetFocalLengthFromExif(
- const OpenImageIO::ImageSpec& image_spec,
+ const OIIO_NAMESPACE::ImageSpec& image_spec,
CameraIntrinsicsPrior* camera_intrinsics_prior) const;
// Sets the focal length from a look up in the sensor width database. Returns
// true if a valid focal length is found and false otherwise.
bool SetFocalLengthFromSensorDatabase(
- const OpenImageIO::ImageSpec& image_spec,
+ const OIIO_NAMESPACE::ImageSpec& image_spec,
CameraIntrinsicsPrior* camera_intrinsics_prior) const;
std::unordered_map<std::string, double> sensor_width_database_;
diff --git a/src/theia/sfm/undistort_image.cc b/src/theia/sfm/undistort_image.cc
index 95a061d..ae0690e 100644
--- a/src/theia/sfm/undistort_image.cc
+++ b/src/theia/sfm/undistort_image.cc
@@ -160,9 +160,9 @@ void RemoveImageLensDistortion(const Camera& distorted_camera,
// For each pixel in the undistorted image, find the coordinate in the
// distorted image and set the pixel color accordingly.
const int num_channels = distorted_image.Channels();
- OpenImageIO::ImageBuf& undistorted_img =
+ OIIO_NAMESPACE::ImageBuf& undistorted_img =
undistorted_image->GetOpenImageIOImageBuf();
- OpenImageIO::ImageBuf::Iterator<float> undistorted_it(undistorted_img);
+ OIIO_NAMESPACE::ImageBuf::Iterator<float> undistorted_it(undistorted_img);
for (; !undistorted_it.done(); ++undistorted_it) {
Eigen::Vector2d image_point(undistorted_it.x() + 0.5,
undistorted_it.y() + 0.5);

View File

@ -20,6 +20,7 @@ vcpkg_apply_patches(
${CMAKE_CURRENT_LIST_DIR}/fix-vlfeat-static.patch
${CMAKE_CURRENT_LIST_DIR}/fix-glog-error.patch
${CMAKE_CURRENT_LIST_DIR}/fix-find-suitesparse.patch
${CMAKE_CURRENT_LIST_DIR}/fix-oiio.patch
)
vcpkg_configure_cmake(

View File

@ -1,4 +1,4 @@
Source: thrift
Version: 2018-03-29
Version: 2018-04-02
Build-Depends: zlib, libevent, openssl, boost-range, boost-smart-ptr, boost-date-time, boost-locale, boost-scope-exit
Description: Apache Thrift is a software project spanning a variety of programming languages and use cases. Our goal is to make reliable, performant communication and data serialization across languages as efficient and seamless as possible. Originally developed at Facebook, Thrift was open sourced in April 2007 and entered the Apache Incubator in May, 2008. Thrift became an Apache TLP in October, 2010.

View File

@ -15,8 +15,8 @@ vcpkg_find_acquire_program(BISON)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO apache/thrift
REF 930428438c0b6c8f60560cbb7dcad79042badacb
SHA512 b446126a8f697903abbdafcd8cd9a348fc97d34b2a207592cae1801e481b5159f92b7b0296a3531cd8f2a9e223e051f71ea63ce5da2dd2f67364db9bfd84dcf3
REF 3c0edfa875218bd83f6b79a7823380e2adc08ae6
SHA512 8499ae6adf0db725f847f25f1c0b0ccf0abd8b142dd410a8a3c544dfd2fae8bdf1dec86e74eee3b4f78288f53ed5a162214d963513456d9b3be794e157c00a38
HEAD_REF master
)

View File

@ -115,6 +115,7 @@ function(vcpkg_configure_cmake)
vcpkg_find_acquire_program(NINJA)
get_filename_component(NINJA_PATH ${NINJA} DIRECTORY)
set(ENV{PATH} "$ENV{PATH};${NINJA_PATH}")
list(APPEND _csc_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}")
endif()
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)

View File

@ -103,6 +103,39 @@ function(vcpkg_download_distfile VAR)
endif()
# Tries to download the file.
list(GET vcpkg_download_distfile_URLS 0 SAMPLE_URL)
if(${_VCPKG_DOWNLOAD_TOOL} MATCHES "ARIA2" AND NOT ${SAMPLE_URL} MATCHES "aria2")
vcpkg_find_acquire_program("ARIA2")
message(STATUS "Downloading ${vcpkg_download_distfile_FILENAME}...")
execute_process(
COMMAND ${ARIA2} ${vcpkg_download_distfile_URLS}
-o temp/${vcpkg_download_distfile_FILENAME}
-l download-${vcpkg_download_distfile_FILENAME}-detailed.log
OUTPUT_FILE download-${vcpkg_download_distfile_FILENAME}-out.log
ERROR_FILE download-${vcpkg_download_distfile_FILENAME}-err.log
RESULT_VARIABLE error_code
WORKING_DIRECTORY ${DOWNLOADS}
)
if (NOT "${error_code}" STREQUAL "0")
message(STATUS
"Downloading ${vcpkg_download_distfile_FILENAME}... Failed.\n"
" Exit Code: ${error_code}\n"
" See logs for more information:\n"
" ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-out.log\n"
" ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-err.log\n"
" ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-detailed.log\n"
)
set(download_success 0)
else()
message(STATUS "Downloading ${vcpkg_download_distfile_FILENAME}... OK")
file(REMOVE
${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-out.log
${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-err.log
${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-detailed.log
)
set(download_success 1)
endif()
else()
foreach(url IN LISTS vcpkg_download_distfile_URLS)
message(STATUS "Downloading ${url}...")
file(DOWNLOAD ${url} "${download_file_path_part}" STATUS download_status)
@ -116,6 +149,7 @@ function(vcpkg_download_distfile VAR)
break()
endif()
endforeach(url)
endif()
if (NOT download_success)
message(FATAL_ERROR

View File

@ -25,6 +25,7 @@
## - NASM
## - NINJA
## - YASM
## - ARIA2 (Downloader)
##
## Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_acquire_msys.md).
##
@ -105,14 +106,18 @@ function(vcpkg_find_acquire_program VAR)
set(HASH 830cd94ed6518fbe4604a0f5a3322671b4674b87d25a71349c745500d38e85c0fac4f6995242fc5521eb048e3966bb5ec2a96a06b041343ed8da9bba78124f34)
elseif(VAR MATCHES "7Z")
set(PROGNAME 7z)
set(PATHS "${PROGRAM_FILES_PLATFORM_BITNESS}/7-Zip" "${PROGRAM_FILES_32_BIT}/7-Zip" ${DOWNLOADS}/tools/7z/Files/7-Zip)
set(PATHS "${PROGRAM_FILES_PLATFORM_BITNESS}/7-Zip" "${PROGRAM_FILES_32_BIT}/7-Zip" "${DOWNLOADS}/tools/7z/Files/7-Zip")
set(URL "http://7-zip.org/a/7z1604.msi")
set(ARCHIVE "7z1604.msi")
set(HASH 556f95f7566fe23704d136239e4cf5e2a26f939ab43b44145c91b70d031a088d553e5c21301f1242a2295dcde3143b356211f0108c68e65eef8572407618326d)
elseif(VAR MATCHES "NINJA")
set(PROGNAME ninja)
set(SUBDIR "ninja-1.8.2")
set(PATHS ${DOWNLOADS}/tools/ninja/${SUBDIR})
if(CMAKE_HOST_WIN32)
set(PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}")
else()
set(PATHS "${DOWNLOADS}/tools/${SUBDIR}")
endif()
set(BREW_PACKAGE_NAME "ninja")
set(APT_PACKAGE_NAME "ninja-build")
set(URL "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip")
@ -174,6 +179,13 @@ function(vcpkg_find_acquire_program VAR)
set(URL "http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.14.windows.bin.zip")
set(ARCHIVE "doxygen-1.8.14.windows.bin.zip")
set(HASH d0d706501e7112045b1f401f22d12a2c8d9b7728edee9ad1975a17dff914c16494ae48a70beab6f6304643779935843f268c7afed3b9da7d403b5cb11cac0c50)
# Download Tools
elseif(VAR MATCHES "ARIA2")
set(PROGNAME aria2c)
set(PATHS ${DOWNLOADS}/tools/aria2c/aria2-1.33.1-win-32bit-build1)
set(URL "https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip")
set(ARCHIVE "aria2-1.33.1-win-32bit-build1.zip")
set(HASH 2456176ba3d506a07cf0cc4f61f080e1ff8cb4106426d66f354c5bb67a9a8720b5ddb26904275e61b1f623c932355f7dcde4cd17556cc895f11293c23c3a9bf3)
else()
message(FATAL "unknown tool ${VAR} -- unable to acquire.")
endif()

View File

@ -4,8 +4,12 @@ project(vcpkg C CXX)
if(CMAKE_COMPILER_IS_GNUXX OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(GCC 1)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 9.0.0)
message(FATAL_ERROR "Apple clang versions 9 and below do not have support for the C++ Filesystem TS. Please install gcc6 or newer from homebrew (brew install gcc6).")
if(NOT VCPKG_ALLOW_APPLE_CLANG)
message(FATAL_ERROR
"Building the vcpkg tool requires support for the C++ Filesystem TS.
Apple clang versions 9 and below do not have support for it.
Please install gcc6 or newer from homebrew (brew install gcc6).
If you would like to try anyway, set VCPKG_ALLOW_APPLE_CLANG.")
else()
set(CLANG 1)
endif()

View File

@ -57,12 +57,20 @@ namespace vcpkg::Build
RELEASE,
};
enum class DownloadTool
{
BUILT_IN,
ARIA2,
};
const std::string& to_string(DownloadTool tool);
struct BuildPackageOptions
{
UseHeadVersion use_head_version;
AllowDownloads allow_downloads;
CleanBuildtrees clean_buildtrees;
CleanPackages clean_packages;
DownloadTool download_tool;
};
enum class BuildResult

View File

@ -66,6 +66,7 @@ namespace vcpkg
const fs::path& get_7za_exe() const;
const fs::path& get_cmake_exe() const;
const fs::path& get_git_exe() const;
const fs::path& get_ninja_exe() const;
const fs::path& get_nuget_exe() const;
const fs::path& get_ifw_installerbase_exe() const;
const fs::path& get_ifw_binarycreator_exe() const;
@ -84,6 +85,7 @@ namespace vcpkg
Lazy<fs::path> _7za_exe;
Lazy<fs::path> cmake_exe;
Lazy<fs::path> git_exe;
Lazy<fs::path> ninja_exe;
Lazy<fs::path> nuget_exe;
Lazy<fs::path> ifw_installerbase_exe;
Lazy<fs::path> ifw_binarycreator_exe;

View File

@ -165,6 +165,19 @@ namespace vcpkg::Build
}
}
static const std::string NAME_BUILD_IN_DOWNLOAD = "BUILT_IN";
static const std::string NAME_ARIA2_DOWNLOAD = "ARIA2";
const std::string& to_string(DownloadTool tool)
{
switch (tool)
{
case DownloadTool::BUILT_IN: return NAME_BUILD_IN_DOWNLOAD;
case DownloadTool::ARIA2: return NAME_ARIA2_DOWNLOAD;
default: Checks::unreachable(VCPKG_LINE_INFO);
}
}
Optional<LinkageType> to_linkage_type(const std::string& str)
{
if (str == "dynamic") return LinkageType::DYNAMIC;
@ -322,6 +335,12 @@ namespace vcpkg::Build
auto& fs = paths.get_filesystem();
const Triplet& triplet = spec.triplet();
#if !defined(_WIN32)
// TODO: remove when vcpkg.exe is in charge for acquiring tools. Change introduced in vcpkg v0.0.107.
// bootstrap should have already downloaded ninja, but making sure it is present in case it was deleted.
vcpkg::Util::unused(paths.get_ninja_exe());
#endif
const fs::path& cmake_exe_path = paths.get_cmake_exe();
const fs::path& git_exe_path = paths.get_git_exe();
@ -343,7 +362,9 @@ namespace vcpkg::Build
{"VCPKG_PLATFORM_TOOLSET", toolset.version.c_str()},
{"VCPKG_USE_HEAD_VERSION",
Util::Enum::to_bool(config.build_package_options.use_head_version) ? "1" : "0"},
{"_VCPKG_NO_DOWNLOADS", !Util::Enum::to_bool(config.build_package_options.allow_downloads) ? "1" : "0"},
{"_VCPKG_NO_DOWNLOADS",
!Util::Enum::to_bool(config.build_package_options.allow_downloads) ? "1" : "0"},
{"_VCPKG_DOWNLOAD_TOOL", to_string(config.build_package_options.download_tool)},
{"GIT", git_exe_path},
{"FEATURES", Strings::join(";", config.feature_list)},
{"ALL_FEATURES", all_features},

View File

@ -34,6 +34,8 @@ namespace vcpkg::Commands::Edit
static constexpr StringLiteral OPTION_BUILDTREES = "--buildtrees";
static constexpr StringLiteral OPTION_ALL = "--all";
static std::vector<std::string> valid_arguments(const VcpkgPaths& paths)
{
auto sources_and_errors = Paragraphs::try_load_all_ports(paths.get_filesystem(), paths.ports);
@ -42,9 +44,9 @@ namespace vcpkg::Commands::Edit
[](auto&& pgh) -> std::string { return pgh->core_paragraph->name; });
}
static constexpr std::array<CommandSwitch, 1> EDIT_SWITCHES = {{
{OPTION_BUILDTREES, "Open editor into the port-specific buildtree subfolder"},
}};
static constexpr std::array<CommandSwitch, 2> EDIT_SWITCHES = {
{{OPTION_BUILDTREES, "Open editor into the port-specific buildtree subfolder"},
{OPTION_ALL, "Open editor into the port as well as the port-specific buildtree subfolder"}}};
const CommandStructure COMMAND_STRUCTURE = {
Help::create_example_string("edit zlib"),
@ -113,6 +115,15 @@ namespace vcpkg::Commands::Edit
Checks::exit_with_code(VCPKG_LINE_INFO, System::cmd_execute(cmd_line));
}
if (Util::Sets::contains(options.switches, OPTION_ALL))
{
const auto buildtrees_current_dir = paths.buildtrees / port_name;
const auto cmd_line = Strings::format(
R"("%s" "%s" "%s" -n)", env_editor.u8string(), portpath.u8string(), buildtrees_current_dir.u8string());
Checks::exit_with_code(VCPKG_LINE_INFO, System::cmd_execute(cmd_line));
}
const auto cmd_line = Strings::format(
R"("%s" "%s" "%s" -n)",
env_editor.u8string(),

View File

@ -412,13 +412,15 @@ namespace vcpkg::Install
static constexpr StringLiteral OPTION_RECURSE = "--recurse";
static constexpr StringLiteral OPTION_KEEP_GOING = "--keep-going";
static constexpr StringLiteral OPTION_XUNIT = "--x-xunit";
static constexpr StringLiteral OPTION_USE_ARIA2 = "--x-use-aria2";
static constexpr std::array<CommandSwitch, 5> INSTALL_SWITCHES = {{
static constexpr std::array<CommandSwitch, 6> INSTALL_SWITCHES = {{
{OPTION_DRY_RUN, "Do not actually build or install"},
{OPTION_USE_HEAD_VERSION, "Install the libraries on the command line using the latest upstream sources"},
{OPTION_NO_DOWNLOADS, "Do not download new sources"},
{OPTION_RECURSE, "Allow removal of packages as part of installation"},
{OPTION_KEEP_GOING, "Continue installing packages on failure"},
{OPTION_USE_ARIA2, "Use aria2 to perform download tasks"},
}};
static constexpr std::array<CommandSetting, 1> INSTALL_SETTINGS = {{
{OPTION_XUNIT, "File to output results in XUnit format (Internal use)"},
@ -547,16 +549,21 @@ namespace vcpkg::Install
const bool use_head_version = Util::Sets::contains(options.switches, (OPTION_USE_HEAD_VERSION));
const bool no_downloads = Util::Sets::contains(options.switches, (OPTION_NO_DOWNLOADS));
const bool is_recursive = Util::Sets::contains(options.switches, (OPTION_RECURSE));
const bool use_aria2 = Util::Sets::contains(options.switches, (OPTION_USE_ARIA2));
const KeepGoing keep_going = to_keep_going(Util::Sets::contains(options.switches, OPTION_KEEP_GOING));
// create the plan
StatusParagraphs status_db = database_load_check(paths);
Build::DownloadTool download_tool = Build::DownloadTool::BUILT_IN;
if (use_aria2) download_tool = Build::DownloadTool::ARIA2;
const Build::BuildPackageOptions install_plan_options = {
Util::Enum::to_enum<Build::UseHeadVersion>(use_head_version),
Util::Enum::to_enum<Build::AllowDownloads>(!no_downloads),
Build::CleanBuildtrees::NO,
Build::CleanPackages::NO};
Build::CleanPackages::NO,
download_tool};
auto all_ports = Paragraphs::load_all_ports(paths.get_filesystem(), paths.ports);
std::unordered_map<std::string, SourceControlFile> scf_map;

View File

@ -18,9 +18,10 @@ namespace vcpkg
struct ToolData
{
std::array<int, 3> required_version;
fs::path downloaded_exe_path;
fs::path exe_path;
std::string url;
fs::path downloaded_path;
fs::path tool_dir_path;
};
static Optional<std::array<int, 3>> parse_version_string(const std::string& version_as_string)
@ -44,11 +45,11 @@ namespace vcpkg
static ToolData parse_tool_data_from_xml(const VcpkgPaths& paths, const std::string& tool)
{
#if defined(_WIN32)
static constexpr StringLiteral OS_STRING = "";
static constexpr StringLiteral OS_STRING = "windows";
#elif defined(__APPLE__)
static constexpr StringLiteral OS_STRING = R"(os="osx")";
static constexpr StringLiteral OS_STRING = "osx";
#else // assume linux
static constexpr StringLiteral OS_STRING = R"(os="linux")";
static constexpr StringLiteral OS_STRING = "linux";
#endif
static const fs::path XML_PATH = paths.scripts / "vcpkgTools.xml";
@ -79,11 +80,16 @@ namespace vcpkg
Strings::format(R"###(<archiveRelativePath>([\s\S]*?)</archiveRelativePath>)###")};
static const std::regex URL_REGEX{Strings::format(R"###(<url>([\s\S]*?)</url>)###")};
const std::regex tool_regex{
Strings::format(R"###(<tool[\s]+name="%s"[\s]*%s>([\s\S]*?)</tool>)###", tool, OS_STRING)};
std::regex tool_regex{
Strings::format(R"###(<tool[\s]+name="%s"[\s]+os="%s">([\s\S]*?)<\/tool>)###", tool, OS_STRING)};
std::smatch match_tool;
const bool has_match_tool = std::regex_search(XML.cbegin(), XML.cend(), match_tool, tool_regex);
bool has_match_tool = std::regex_search(XML.cbegin(), XML.cend(), match_tool, tool_regex);
if (!has_match_tool && OS_STRING == "windows") // Legacy support. Change introduced in vcpkg v0.0.107.
{
tool_regex = Strings::format(R"###(<tool[\s]+name="%s">([\s\S]*?)<\/tool>)###", tool);
has_match_tool = std::regex_search(XML.cbegin(), XML.cend(), match_tool, tool_regex);
}
Checks::check_exit(VCPKG_LINE_INFO,
has_match_tool,
"Could not find entry for tool [%s] in %s",
@ -109,11 +115,20 @@ namespace vcpkg
tool,
required_version_as_string);
// Legacy support. Change introduced in vcpkg v0.0.107.
#if !defined(_WIN32)
const std::string tool_dir_name = Strings::format("%s-%s", tool, required_version_as_string);
const fs::path tool_dir_path = paths.downloads / "tools" / tool_dir_name;
const fs::path exe_path = tool_dir_path / exe_relative_path;
#else
const fs::path tool_dir_path;
const fs::path exe_path = paths.downloads / exe_relative_path;
#endif
return ToolData{*required_version.get(),
exe_path,
url,
paths.downloads / archive_relative_path.value_or(exe_relative_path)};
paths.downloads / archive_relative_path.value_or(exe_relative_path),
tool_dir_path};
}
static bool exists_and_has_equal_or_greater_version(const std::string& version_cmd,
@ -172,6 +187,36 @@ namespace vcpkg
return data_lines;
}
static void extract_archive(const VcpkgPaths& paths, const fs::path& archive, const fs::path& to_path)
{
Files::Filesystem& fs = paths.get_filesystem();
const fs::path to_path_partial = to_path.u8string() + ".partial";
std::error_code ec;
fs.remove_all(to_path_partial, ec);
fs.create_directories(to_path_partial, ec);
const auto ext = archive.extension();
if (ext == ".gz" && ext.extension() != ".tar")
{
const auto code = System::cmd_execute(
Strings::format(R"(cd '%s' && tar xzf '%s')", to_path_partial.u8string(), archive.u8string()));
Checks::check_exit(VCPKG_LINE_INFO, code == 0, "tar failed while extracting %s", archive.u8string());
}
else if (ext == ".zip")
{
const auto code = System::cmd_execute(
Strings::format(R"(cd '%s' && unzip -qqo '%s')", to_path_partial.u8string(), archive.u8string()));
Checks::check_exit(VCPKG_LINE_INFO, code == 0, "unzip failed while extracting %s", archive.u8string());
}
else
{
Checks::exit_with_message(VCPKG_LINE_INFO, "Unexpected archive extension: %s", ext.u8string());
}
fs.rename(to_path_partial, to_path);
}
static fs::path fetch_tool(const VcpkgPaths& paths, const std::string& tool_name, const ToolData& tool_data)
{
const auto& fs = paths.get_filesystem();
@ -195,7 +240,7 @@ namespace vcpkg
Checks::check_exit(VCPKG_LINE_INFO, tool_path.size() == 1, "Expected tool path, but got %s", output);
const fs::path actual_downloaded_path = Strings::trim(std::string{tool_path.at(0)});
const fs::path& expected_downloaded_path = tool_data.downloaded_exe_path;
const fs::path& expected_downloaded_path = tool_data.exe_path;
std::error_code ec;
const auto eq = fs::stdfs::equivalent(expected_downloaded_path, actual_downloaded_path, ec);
Checks::check_exit(VCPKG_LINE_INFO,
@ -207,20 +252,21 @@ namespace vcpkg
#else
if (!fs.exists(tool_data.downloaded_path))
{
auto code = System::cmd_execute(
Strings::format(R"(curl '%s' --create-dirs --output '%s')", tool_data.url, tool_data.downloaded_path));
auto code = System::cmd_execute(Strings::format(
R"(curl -L '%s' --create-dirs --output '%s')", tool_data.url, tool_data.downloaded_path));
Checks::check_exit(VCPKG_LINE_INFO, code == 0, "curl failed while downloading %s", tool_data.url);
}
auto code = System::cmd_execute(
Strings::format(R"(cd '%s' && tar xzf '%s')", paths.downloads, tool_data.downloaded_path));
Checks::check_exit(VCPKG_LINE_INFO, code == 0, "tar failed while extracting %s", tool_data.downloaded_path);
System::println("Extracting %s...", tool_name);
extract_archive(paths, tool_data.downloaded_path, tool_data.tool_dir_path);
System::println("Extracting %s... done.", tool_name);
Checks::check_exit(VCPKG_LINE_INFO,
fs.exists(tool_data.downloaded_exe_path),
fs.exists(tool_data.exe_path),
"Expected %s to exist after extracting",
tool_data.downloaded_exe_path);
tool_data.exe_path);
return tool_data.downloaded_exe_path;
return tool_data.exe_path;
#endif
}
@ -229,7 +275,7 @@ namespace vcpkg
std::vector<fs::path> candidate_paths;
#if defined(_WIN32) || defined(__APPLE__) || defined(__linux__)
static const ToolData TOOL_DATA = parse_tool_data_from_xml(paths, "cmake");
candidate_paths.push_back(TOOL_DATA.downloaded_exe_path);
candidate_paths.push_back(TOOL_DATA.exe_path);
#else
static const ToolData TOOL_DATA = ToolData{{3, 5, 1}, ""};
#endif
@ -257,22 +303,40 @@ namespace vcpkg
{
#if defined(_WIN32)
static const ToolData TOOL_DATA = parse_tool_data_from_xml(paths, "7zip");
if (!paths.get_filesystem().exists(TOOL_DATA.downloaded_exe_path))
if (!paths.get_filesystem().exists(TOOL_DATA.exe_path))
{
return fetch_tool(paths, "7zip", TOOL_DATA);
}
return TOOL_DATA.downloaded_exe_path;
return TOOL_DATA.exe_path;
#else
Checks::exit_with_message(VCPKG_LINE_INFO, "Cannot download 7zip for non-Windows platforms.");
#endif
}
static fs::path get_ninja_path(const VcpkgPaths& paths)
{
static const ToolData TOOL_DATA = parse_tool_data_from_xml(paths, "ninja");
std::vector<fs::path> candidate_paths;
candidate_paths.push_back(TOOL_DATA.exe_path);
const std::vector<fs::path> from_path = Files::find_from_PATH("ninja");
candidate_paths.insert(candidate_paths.end(), from_path.cbegin(), from_path.cend());
auto path = find_if_has_equal_or_greater_version(candidate_paths, "--version", TOOL_DATA.required_version);
if (const auto p = path.get())
{
return *p;
}
return fetch_tool(paths, "ninja", TOOL_DATA);
}
static fs::path get_nuget_path(const VcpkgPaths& paths)
{
static const ToolData TOOL_DATA = parse_tool_data_from_xml(paths, "nuget");
std::vector<fs::path> candidate_paths;
candidate_paths.push_back(TOOL_DATA.downloaded_exe_path);
candidate_paths.push_back(TOOL_DATA.exe_path);
const std::vector<fs::path> from_path = Files::find_from_PATH("nuget");
candidate_paths.insert(candidate_paths.end(), from_path.cbegin(), from_path.cend());
@ -296,7 +360,7 @@ namespace vcpkg
std::vector<fs::path> candidate_paths;
#if defined(_WIN32)
candidate_paths.push_back(TOOL_DATA.downloaded_exe_path);
candidate_paths.push_back(TOOL_DATA.exe_path);
#endif
const std::vector<fs::path> from_path = Files::find_from_PATH("git");
candidate_paths.insert(candidate_paths.end(), from_path.cbegin(), from_path.cend());
@ -323,7 +387,7 @@ namespace vcpkg
static const std::string VERSION_CHECK_ARGUMENTS = "--framework-version";
std::vector<fs::path> candidate_paths;
candidate_paths.push_back(TOOL_DATA.downloaded_exe_path);
candidate_paths.push_back(TOOL_DATA.exe_path);
// TODO: Uncomment later
// const std::vector<fs::path> from_path = Files::find_from_PATH("installerbase");
// candidate_paths.insert(candidate_paths.end(), from_path.cbegin(), from_path.cend());
@ -433,6 +497,11 @@ namespace vcpkg
return this->git_exe.get_lazy([this]() { return get_git_path(*this); });
}
const fs::path& VcpkgPaths::get_ninja_exe() const
{
return this->ninja_exe.get_lazy([this]() { return get_ninja_path(*this); });
}
const fs::path& VcpkgPaths::get_nuget_exe() const
{
return this->nuget_exe.get_lazy([this]() { return get_nuget_path(*this); });