From 6fbd2ad7805fcf996f01c29d9b11d0c5e91a8971 Mon Sep 17 00:00:00 2001 From: Axel Barrot Date: Wed, 14 Dec 2016 15:58:00 +0100 Subject: [PATCH 001/561] support lcms library (http://www.littlecms.com/download.html) --- ports/lcms/CMakeLists.txt | 65 +++++++++++++++++++++++++++++++++++++++ ports/lcms/CONTROL | 4 +++ ports/lcms/portfile.cmake | 31 +++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 ports/lcms/CMakeLists.txt create mode 100644 ports/lcms/CONTROL create mode 100644 ports/lcms/portfile.cmake diff --git a/ports/lcms/CMakeLists.txt b/ports/lcms/CMakeLists.txt new file mode 100644 index 0000000000..8c43a2ea37 --- /dev/null +++ b/ports/lcms/CMakeLists.txt @@ -0,0 +1,65 @@ +cmake_minimum_required(VERSION 3.5) + +project(lcms) + +option(SHARED_LIBRARY "use shared library" ON) + +set(LIBRARY_TYPE STATIC) +if(SHARED_LIBRARY) + set(LIBRARY_TYPE SHARED) +endif(SHARED_LIBRARY) + +set(SRCS +"src/cmstypes.c" +"src/cmsvirt.c" +"src/cmswtpnt.c" +"src/cmsxform.c" +"src/lcms2.def" +"src/lcms2_internal.h" +"src/cmsalpha.c" +"src/cmscam02.c" +"src/cmscgats.c" +"src/cmscnvrt.c" +"src/cmserr.c" +"src/cmsgamma.c" +"src/cmsgmt.c" +"src/cmshalf.c" +"src/cmsintrp.c" +"src/cmsio0.c" +"src/cmsio1.c" +"src/cmslut.c" +"src/cmsmd5.c" +"src/cmsmtrx.c" +"src/cmsnamed.c" +"src/cmsopt.c" +"src/cmspack.c" +"src/cmspcs.c" +"src/cmsplugin.c" +"src/cmsps2.c" +"src/cmssamp.c" +"src/cmssm.c" +) + +include_directories( +"./include" +) + +add_library(lcms ${LIBRARY_TYPE} +${SRCS} +) + +if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) + + install(FILES + "./include/lcms2.h" + "./include/lcms2_plugin.h" + DESTINATION include + ) + +endif(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) + +install(TARGETS lcms EXPORT lcms_EXPORT + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) diff --git a/ports/lcms/CONTROL b/ports/lcms/CONTROL new file mode 100644 index 0000000000..64567fdddd --- /dev/null +++ b/ports/lcms/CONTROL @@ -0,0 +1,4 @@ +Source: lcms +Version: 2.8 +Build-Depends: +Description: Little CMS. \ No newline at end of file diff --git a/ports/lcms/portfile.cmake b/ports/lcms/portfile.cmake new file mode 100644 index 0000000000..5c6926071e --- /dev/null +++ b/ports/lcms/portfile.cmake @@ -0,0 +1,31 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lcms2-2.8) + +vcpkg_download_distfile(ARCHIVE + URLS "https://sourceforge.net/projects/lcms/files/lcms/2.8/lcms2-2.8.tar.gz/download" + #URLS "C:/Users/d3r55d/Downloads/lcms2-2.8.tar.gz" + FILENAME "lcms2-2.8.tar.gz" + SHA512 a9478885b4892c79314a2ef9ab560e6655ac8f2d17abae0805e8b871138bb190e21f0e5c805398449f9dad528dc50baaf9e3cce8b8158eb8ff74179be5733f8f +) +vcpkg_extract_source_archive(${ARCHIVE}) +message(STATUS ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +set(USE_SHARED_LIBRARY OFF) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(USE_SHARED_LIBRARY ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DSHARED_LIBRARY=${USE_SHARED_LIBRARY} + OPTIONS_DEBUG + -DSKIP_INSTALL_HEADERS=ON +) + +vcpkg_install_cmake() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/lcms RENAME copyright) + +vcpkg_copy_pdbs() From 0b62c9ce911a8a86ea7cee9e1c323b61d7b313a6 Mon Sep 17 00:00:00 2001 From: agadoul Date: Thu, 15 Dec 2016 09:12:00 +0100 Subject: [PATCH 002/561] fix warning due to encoding. --- ports/lcms/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/lcms/CMakeLists.txt b/ports/lcms/CMakeLists.txt index 8c43a2ea37..e78b9b6b62 100644 --- a/ports/lcms/CMakeLists.txt +++ b/ports/lcms/CMakeLists.txt @@ -40,6 +40,9 @@ set(SRCS "src/cmssm.c" ) +add_definitions(-DUNICODE -D_UNICODE) +#string(REPLACE "/utf-8" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + include_directories( "./include" ) From 9e34484cbe2e9de1deb16cd2ca4e1faea456aa77 Mon Sep 17 00:00:00 2001 From: agadoul Date: Thu, 15 Dec 2016 13:16:55 +0100 Subject: [PATCH 003/561] uncomment removal of utf-8 flag --- ports/lcms/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/lcms/CMakeLists.txt b/ports/lcms/CMakeLists.txt index e78b9b6b62..85807a0b95 100644 --- a/ports/lcms/CMakeLists.txt +++ b/ports/lcms/CMakeLists.txt @@ -41,7 +41,7 @@ set(SRCS ) add_definitions(-DUNICODE -D_UNICODE) -#string(REPLACE "/utf-8" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +string(REPLACE "/utf-8" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") include_directories( "./include" From 2a8d1510b47e0214000653b311c2836ef33d2595 Mon Sep 17 00:00:00 2001 From: Adam Martin Date: Sun, 1 Jan 2017 10:08:03 -0600 Subject: [PATCH 004/561] [glew] Renames the glew debug output files The FindGlew.cmake that is official as well as several found in a quick search don't look for the debug post-fix variant of the library. This was causing vcpkg to not copy the DLL over on build as it was looking for glew32.dll not glew32d.dll. --- ports/glew/portfile.cmake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index e7cf16cf29..6392633be7 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -57,8 +57,11 @@ message(STATUS "Installing") if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL ${SOURCE_PATH}/bin/Debug/${BUILD_ARCH}/glew32d.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin RENAME glew32.dll + ) + file(INSTALL ${SOURCE_PATH}/bin/Debug/${BUILD_ARCH}/glew32d.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin RENAME glew32.pdb ) file(INSTALL ${SOURCE_PATH}/bin/Release/${BUILD_ARCH}/glew32.dll @@ -67,7 +70,7 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) ) file(INSTALL ${SOURCE_PATH}/lib/Debug/${BUILD_ARCH}/glew32d.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib RENAME glew32.lib ) file(INSTALL ${SOURCE_PATH}/lib/Release/${BUILD_ARCH}/glew32.lib @@ -76,13 +79,11 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) else() file(INSTALL ${SOURCE_PATH}/lib/Debug/${BUILD_ARCH}/glew32sd.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib - RENAME glew32d.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib RENAME glew32.lib ) file(INSTALL ${SOURCE_PATH}/lib/Release/${BUILD_ARCH}/glew32s.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib - RENAME glew32.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib RENAME glew32.lib ) endif() From 044c07ece1aa0e3e46e0c059cb5877b1bc18c76c Mon Sep 17 00:00:00 2001 From: codicodi Date: Mon, 2 Jan 2017 01:31:42 +0100 Subject: [PATCH 005/561] add bzip2 --- ports/bzip2/CMakeLists.txt | 36 +++++++++++++++++++ ports/bzip2/CONTROL | 3 ++ ports/bzip2/auto-define-import-macro.patch | 13 +++++++ ports/bzip2/fix-import-export-macros.patch | 40 ++++++++++++++++++++++ ports/bzip2/portfile.cmake | 35 +++++++++++++++++++ 5 files changed, 127 insertions(+) create mode 100644 ports/bzip2/CMakeLists.txt create mode 100644 ports/bzip2/CONTROL create mode 100644 ports/bzip2/auto-define-import-macro.patch create mode 100644 ports/bzip2/fix-import-export-macros.patch create mode 100644 ports/bzip2/portfile.cmake diff --git a/ports/bzip2/CMakeLists.txt b/ports/bzip2/CMakeLists.txt new file mode 100644 index 0000000000..9f9737da3d --- /dev/null +++ b/ports/bzip2/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.0) +project(bzip2) + +if(CMAKE_BUILD_TYPE STREQUAL Debug) + add_definitions(-DBZ_DEBUG) # enable extra assertions +endif() + +set(LIBBZ2_SOURCES + blocksort.c + huffman.c + crctable.c + randtable.c + compress.c + decompress.c + bzlib.c) + +add_library(libbz2 ${LIBBZ2_SOURCES}) +set_target_properties(libbz2 PROPERTIES ARCHIVE_OUTPUT_NAME bz2) # reqiured for FindBzip2 to work +if(BUILD_SHARED_LIBS) + target_compile_definitions(libbz2 PRIVATE -DBZ_BUILD_DLL) +endif() + +install(TARGETS libbz2 + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) + +if(NOT BZIP2_SKIP_TOOLS) + add_executable(bzip2 bzip2.c ${LIBBZ2_SOURCES}) + add_executable(bzip2recover bzip2recover.c ${LIBBZ2_SOURCES}) + install(TARGETS bzip2 bzip2recover DESTINATION tools) +endif() + +if(NOT BZIP2_SKIP_HEADERS) + install(FILES bzlib.h DESTINATION include) +endif() diff --git a/ports/bzip2/CONTROL b/ports/bzip2/CONTROL new file mode 100644 index 0000000000..365527454a --- /dev/null +++ b/ports/bzip2/CONTROL @@ -0,0 +1,3 @@ +Source: bzip2 +Version: 1.0.6 +Description: High-quality data compressor. diff --git a/ports/bzip2/auto-define-import-macro.patch b/ports/bzip2/auto-define-import-macro.patch new file mode 100644 index 0000000000..81492d3a56 --- /dev/null +++ b/ports/bzip2/auto-define-import-macro.patch @@ -0,0 +1,13 @@ +diff --git a/bzlib.h b/bzlib.h +index e3ba1d6..d3bed44 100644 +--- a/bzlib.h ++++ b/bzlib.h +@@ -26,6 +26,8 @@ + extern "C" { + #endif + ++#define BZ_IMPORT ++ + #define BZ_RUN 0 + #define BZ_FLUSH 1 + #define BZ_FINISH 2 diff --git a/ports/bzip2/fix-import-export-macros.patch b/ports/bzip2/fix-import-export-macros.patch new file mode 100644 index 0000000000..e3ee8494ba --- /dev/null +++ b/ports/bzip2/fix-import-export-macros.patch @@ -0,0 +1,40 @@ +diff --git a/bzlib.h b/bzlib.h +index 8277123..84fbd0a 100644 +--- a/bzlib.h ++++ b/bzlib.h +@@ -65,29 +65,23 @@ typedef + } + bz_stream; + +- +-#ifndef BZ_IMPORT +-#define BZ_EXPORT +-#endif +- + #ifndef BZ_NO_STDIO + /* Need a definitition for FILE */ + #include + #endif + + #ifdef _WIN32 +-# include + # ifdef small + /* windows.h define small to char */ + # undef small + # endif +-# ifdef BZ_EXPORT +-# define BZ_API(func) WINAPI func +-# define BZ_EXTERN extern ++# define BZ_API(func) func ++# if defined(BZ_BUILD_DLL) ++# define BZ_EXTERN __declspec(dllexport) ++# elif defined(BZ_IMPORT) ++# define BZ_EXTERN __declspec(dllimport) + # else +- /* import windows dll dynamically */ +-# define BZ_API(func) (WINAPI * func) +-# define BZ_EXTERN ++# define BZ_EXTERN + # endif + #else + # define BZ_API(func) func diff --git a/ports/bzip2/portfile.cmake b/ports/bzip2/portfile.cmake new file mode 100644 index 0000000000..128cdee78a --- /dev/null +++ b/ports/bzip2/portfile.cmake @@ -0,0 +1,35 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/bzip2-1.0.6) +vcpkg_download_distfile(ARCHIVE + URLS "http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz" + FILENAME "bzip2-1.0.6.tar.gz" + SHA512 00ace5438cfa0c577e5f578d8a808613187eff5217c35164ffe044fbafdfec9e98f4192c02a7d67e01e5a5ccced630583ad1003c37697219b0f147343a3fdd12) + +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/fix-import-export-macros.patch) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DBZIP2_SKIP_HEADERS=ON + -DBZIP2_SKIP_TOOLS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/auto-define-import-macro.patch) +endif() + +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/bzip2) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/bzip2/LICENSE ${CURRENT_PACKAGES_DIR}/share/bzip2/copyright) From 73164f5881b402bde363c0b5ad84436ae2d055cc Mon Sep 17 00:00:00 2001 From: codicodi Date: Mon, 2 Jan 2017 01:35:12 +0100 Subject: [PATCH 006/561] [bzip2] fix indentation --- ports/bzip2/portfile.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/bzip2/portfile.cmake b/ports/bzip2/portfile.cmake index 128cdee78a..67f56b6d8c 100644 --- a/ports/bzip2/portfile.cmake +++ b/ports/bzip2/portfile.cmake @@ -26,9 +26,9 @@ vcpkg_copy_pdbs() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/auto-define-import-macro.patch) + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/auto-define-import-macro.patch) endif() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/bzip2) From cab893dd2055c9286266ada6fced6b3ee7f92613 Mon Sep 17 00:00:00 2001 From: flysha Date: Mon, 2 Jan 2017 23:58:26 +0800 Subject: [PATCH 007/561] [chakracore] upgrade to 1.4.0 --- ports/chakracore/CONTROL | 2 +- ports/chakracore/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/chakracore/CONTROL b/ports/chakracore/CONTROL index 593691bbf7..24300fdfaf 100644 --- a/ports/chakracore/CONTROL +++ b/ports/chakracore/CONTROL @@ -1,3 +1,3 @@ Source: chakracore -Version: 1.3.1 +Version: 1.4.0 Description: Core part of the Chakra Javascript engine \ No newline at end of file diff --git a/ports/chakracore/portfile.cmake b/ports/chakracore/portfile.cmake index 639cf0f65f..d4bec63d20 100644 --- a/ports/chakracore/portfile.cmake +++ b/ports/chakracore/portfile.cmake @@ -4,11 +4,11 @@ endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.3.1) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.4.0) vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://github.com/Microsoft/ChakraCore/archive/v1.3.1.tar.gz" - FILENAME "ChakraCore-1.3.1.tar.gz" - SHA512 52216a03333e44bce235917cfae5ccd6a756056678d9b81c63ec272d9ce5c6afabc673e7910dd3da54fda7927ea62ede980a4371dbb08f6ce4907121c27dbc53 + URLS "https://github.com/Microsoft/ChakraCore/archive/v1.4.0.tar.gz" + FILENAME "ChakraCore-1.4.0.tar.gz" + SHA512 d515d56ff1c5776ca4663e27daa4d1c7ca58c57f097799de756980771b5701e35639eefa4db5921d7327e6607b8920df3b30677eb467123e04536df0d971cebc ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) From 59c34be2526059ebd3e485ee03f2f3d3c86c05b0 Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Tue, 3 Jan 2017 14:06:10 +0100 Subject: [PATCH 008/561] Disable Boost auto-link. Fixes #483. vcpkg always links all installed libraries for the target triplet; Boost's own auto-link feature is therefore redundant. --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 9e2afdf8a1..01d6e9858e 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost -Version: 1.62-9 +Version: 1.62-10 Description: Peer-reviewed portable C++ source libraries Build-Depends: zlib diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 6cc21a091b..3fbd069826 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -108,11 +108,10 @@ file( DESTINATION ${CURRENT_PACKAGES_DIR}/include ) -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp - "\n#define BOOST_ALL_DYN_LINK\n" - ) -endif() +# Disable Boost auto-link. +file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp + "\n#define BOOST_ALL_NO_LIB\n" +) file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost RENAME copyright) message(STATUS "Packaging headers done") From 6f1f66541679955b72c02b21dc2b59b026c7c544 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 3 Jan 2017 13:29:17 -0800 Subject: [PATCH 009/561] [zlib] Update to 1.2.10 --- ports/zlib/CONTROL | 2 +- ports/zlib/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/zlib/CONTROL b/ports/zlib/CONTROL index 4828734801..b12fe9e678 100644 --- a/ports/zlib/CONTROL +++ b/ports/zlib/CONTROL @@ -1,3 +1,3 @@ Source: zlib -Version: 1.2.8 +Version: 1.2.10 Description: A compression library \ No newline at end of file diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index ef891f685e..6deff6c0cc 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -1,9 +1,9 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.8) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.10) vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://zlib.net/zlib128.zip" - FILENAME "zlib128.zip" - SHA512 b0d7e71eca9032910c56fc1de6adbdc4f915bdeafd9a114591fc05701893004ef3363add8ad0e576c956b6be158f2fc339ab393f2dd40e8cc8c2885d641d807b + URLS "http://www.zlib.net/zlib-1.2.10.tar.gz" + FILENAME "zlib1210.zip" + SHA512 5fa71052a418a0f2b345fce28af9941bbd1c6ee276ce506ab3092157f15776ee41f96bb1799657227513b852913f96ac52dae8122a437f34b43933ee48d63ee0 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) From 25a2bf799459b6ee7833398a61e152386f3679df Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 3 Jan 2017 16:35:02 -0800 Subject: [PATCH 010/561] [zlib] Update LICENSE --- ports/zlib/LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/zlib/LICENSE b/ports/zlib/LICENSE index 9b2f94711c..ca5fddfe0d 100644 --- a/ports/zlib/LICENSE +++ b/ports/zlib/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages From 0db465cec2c12ea762b8b756ab92515c466db01b Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Wed, 4 Jan 2017 14:30:23 +0100 Subject: [PATCH 011/561] updated zlib port to version 1.2.10 --- ports/zlib/CONTROL | 2 +- ports/zlib/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/zlib/CONTROL b/ports/zlib/CONTROL index 4828734801..b12fe9e678 100644 --- a/ports/zlib/CONTROL +++ b/ports/zlib/CONTROL @@ -1,3 +1,3 @@ Source: zlib -Version: 1.2.8 +Version: 1.2.10 Description: A compression library \ No newline at end of file diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index ef891f685e..c49f35a00d 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -1,9 +1,9 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.8) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.10) vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://zlib.net/zlib128.zip" - FILENAME "zlib128.zip" - SHA512 b0d7e71eca9032910c56fc1de6adbdc4f915bdeafd9a114591fc05701893004ef3363add8ad0e576c956b6be158f2fc339ab393f2dd40e8cc8c2885d641d807b + URLS "http://zlib.net/zlib1210.zip" + FILENAME "zlib1210.zip" + SHA512 e1f0ffaa1d6d9c322d6fd30dc8fba202272205943b719e5d6525323e6773b4fcdd82885928c3f59b4bf7ca55babda9f379e174632bf3b25dc9067adb89f58409 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) From f8210aa32b5029b7b04742b949311f12336141b0 Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Wed, 4 Jan 2017 15:17:22 +0100 Subject: [PATCH 012/561] [zlib] fixed wrong FILENAME --- ports/zlib/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 6deff6c0cc..81d54fb4b8 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -2,7 +2,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.10) vcpkg_download_distfile(ARCHIVE_FILE URLS "http://www.zlib.net/zlib-1.2.10.tar.gz" - FILENAME "zlib1210.zip" + FILENAME "zlib1210.tar.gz" SHA512 5fa71052a418a0f2b345fce28af9941bbd1c6ee276ce506ab3092157f15776ee41f96bb1799657227513b852913f96ac52dae8122a437f34b43933ee48d63ee0 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) From 6a220edfb8454a4fc1652f82f537518ac620033f Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Wed, 4 Jan 2017 15:17:22 +0100 Subject: [PATCH 013/561] [zlib] fixed wrong FILENAME --- ports/zlib/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 6deff6c0cc..81d54fb4b8 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -2,7 +2,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.10) vcpkg_download_distfile(ARCHIVE_FILE URLS "http://www.zlib.net/zlib-1.2.10.tar.gz" - FILENAME "zlib1210.zip" + FILENAME "zlib1210.tar.gz" SHA512 5fa71052a418a0f2b345fce28af9941bbd1c6ee276ce506ab3092157f15776ee41f96bb1799657227513b852913f96ac52dae8122a437f34b43933ee48d63ee0 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) From 41a68f712a5c4d5000c7bfa37a200c18fef29692 Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 5 Jan 2017 15:09:40 +0800 Subject: [PATCH 014/561] Add dx port. --- ports/dx/CONTROL | 3 +++ ports/dx/portfile.cmake | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 ports/dx/CONTROL create mode 100644 ports/dx/portfile.cmake diff --git a/ports/dx/CONTROL b/ports/dx/CONTROL new file mode 100644 index 0000000000..460e42bdb3 --- /dev/null +++ b/ports/dx/CONTROL @@ -0,0 +1,3 @@ +Source: dx +Version: 1.0.0 +Description: A modern C++ library for DirectX programming \ No newline at end of file diff --git a/ports/dx/portfile.cmake b/ports/dx/portfile.cmake new file mode 100644 index 0000000000..085f30c01f --- /dev/null +++ b/ports/dx/portfile.cmake @@ -0,0 +1,20 @@ +#header-only library +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/dx-1.0.0) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/sdcb/dx/archive/1.0.0.tar.gz" + FILENAME "dx-1.0.0.tar.gz" + SHA512 7d0e0550eb27c3a7d3a9c4b78f29290aaf60c02a7c2fabb6e4769673592bc031f8ed430cd777e02096b9b9a8981c7e05b45448bf5c182704e080e61eaeab62f8 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(INSTALL + ${SOURCE_PATH}/dx.h + ${SOURCE_PATH}/debug.h + ${SOURCE_PATH}/handle.h + DESTINATION ${CURRENT_PACKAGES_DIR}/include/dx +) + +file(INSTALL + ${SOURCE_PATH}/LICENSE + DESTINATION ${CURRENT_PACKAGES_DIR}/share/dx RENAME copyright) \ No newline at end of file From cff21e04f578479cdf163612c1a90ecc68eb479b Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 5 Jan 2017 15:34:06 +0100 Subject: [PATCH 015/561] [freetype] specify dependencies --- ports/freetype/CONTROL | 4 ++-- ports/freetype/portfile.cmake | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/freetype/CONTROL b/ports/freetype/CONTROL index 614017c816..74f7e49863 100644 --- a/ports/freetype/CONTROL +++ b/ports/freetype/CONTROL @@ -1,4 +1,4 @@ Source: freetype -Version: 2.6.3-2 -Build-Depends: zlib +Version: 2.6.3-3 +Build-Depends: zlib, bzip2, libpng Description: A library to render fonts. \ No newline at end of file diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index 8d7bf158f7..2e5e30c787 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -17,6 +17,10 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DCONFIG_INSTALL_PATH=share/freetype + -DWITH_ZLIB=ON + -DWITH_BZip2=ON + -DWITH_PNG=ON + -DWITH_HarfBuzz=OFF ) vcpkg_install_cmake() From 29aedfad6cd82cc2c071dc99fa5d6aac74af8d49 Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Thu, 5 Jan 2017 16:42:52 +0100 Subject: [PATCH 016/561] added first version of SDL2_image library which currently does not link to any external libraries. --- ports/sdl2-image/CMakeLists.txt | 44 +++++++++++++++++++ ports/sdl2-image/CONTROL | 3 ++ .../sdl2-image/correct-sdl-headers-dir.patch | 25 +++++++++++ ports/sdl2-image/portfile.cmake | 36 +++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 ports/sdl2-image/CMakeLists.txt create mode 100644 ports/sdl2-image/CONTROL create mode 100644 ports/sdl2-image/correct-sdl-headers-dir.patch create mode 100644 ports/sdl2-image/portfile.cmake diff --git a/ports/sdl2-image/CMakeLists.txt b/ports/sdl2-image/CMakeLists.txt new file mode 100644 index 0000000000..3167294d35 --- /dev/null +++ b/ports/sdl2-image/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 2.6) +project(SDL2_image) + +find_path(SDL_INCLUDE_DIR SDL2/SDL.h) +find_library(SDL_LIBRARY SDL2) + +include_directories(${SDL_INCLUDE_DIR}) +include_directories(${SDL_INCLUDE_DIR}/SDL2) +include_directories(${CMAKE_SOURCE_DIR}) + +#add_definitions(-DNOCONTROLS -DTHREADED_AUDIO) + +# some c++ code just assumes memset is available + +add_library(SDL2_image + IMG.c + IMG_bmp.c + IMG_gif.c + IMG_jpg.c + IMG_lbm.c + IMG_pcx.c + IMG_png.c + IMG_pnm.c + IMG_tga.c + IMG_tif.c + IMG_webp.c + IMG_xcf.c + IMG_xpm.c + IMG_xv.c + IMG_xxx.c + ) + +target_link_libraries(SDL2_image ${SDL_LIBRARY}) + +install(TARGETS SDL2_image + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) + +install(FILES SDL_image.h DESTINATION include CONFIGURATIONS Release) + + +message(STATUS "Link-time dependencies:") +message(STATUS " " ${SDL_LIBRARY}) diff --git a/ports/sdl2-image/CONTROL b/ports/sdl2-image/CONTROL new file mode 100644 index 0000000000..591550cdc5 --- /dev/null +++ b/ports/sdl2-image/CONTROL @@ -0,0 +1,3 @@ +Source: sdl2-image +Version: +Description: diff --git a/ports/sdl2-image/correct-sdl-headers-dir.patch b/ports/sdl2-image/correct-sdl-headers-dir.patch new file mode 100644 index 0000000000..4addc155db --- /dev/null +++ b/ports/sdl2-image/correct-sdl-headers-dir.patch @@ -0,0 +1,25 @@ +diff --git "a/SDL_image.h" "b/SDL_image.h" +index f654483..1bd4f62 100644 +--- "a/SDL_image.h" ++++ "b/SDL_image.h" +@@ -24,9 +24,9 @@ + #ifndef _SDL_IMAGE_H + #define _SDL_IMAGE_H + +-#include "SDL.h" +-#include "SDL_version.h" +-#include "begin_code.h" ++#include ++#include ++#include + + /* Set up for C function definitions, even when using C++ */ + #ifdef __cplusplus +@@ -140,6 +140,6 @@ extern DECLSPEC int SDLCALL IMG_SavePNG_RW(SDL_Surface *surface, SDL_RWops *dst, + #ifdef __cplusplus + } + #endif +-#include "close_code.h" ++#include + + #endif /* _SDL_IMAGE_H */ diff --git a/ports/sdl2-image/portfile.cmake b/ports/sdl2-image/portfile.cmake new file mode 100644 index 0000000000..f70d237c2f --- /dev/null +++ b/ports/sdl2-image/portfile.cmake @@ -0,0 +1,36 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SDL2_image-2.0.1) +vcpkg_download_distfile(ARCHIVE + URLS "https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.zip" + FILENAME "SDL2_image-2.0.1.zip" + SHA512 37d12f4fae71c586bec73262bddb9207ab2f9a2ca6001d2cbfde646e268a950ba5cd4cff53d75e2da8959ae6da6e9cadc6eca88fa7bd9aa2758395d64c84a307 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/correct-sdl-headers-dir.patch) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2-image) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/sdl2-image/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/sdl2-image/copyright) From d62dda3b030e31f322aaa47b4aeaa0a12fa3201b Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Thu, 5 Jan 2017 16:48:04 +0100 Subject: [PATCH 017/561] forces CMake use zlib version which is installed by vcpkg. --- ports/libpng/portfile.cmake | 6 +++++- ports/libpng/set_zlib_root.patch | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 ports/libpng/set_zlib_root.patch diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index f7be6cca1c..55cbb4bdad 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -9,7 +9,9 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} - PATCHES "${CMAKE_CURRENT_LIST_DIR}/use-abort-on-all-platforms.patch" + PATCHES + "${CMAKE_CURRENT_LIST_DIR}/use-abort-on-all-platforms.patch" + "${CMAKE_CURRENT_LIST_DIR}/set_zlib_root.patch" ) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) @@ -19,6 +21,7 @@ else() set(PNG_STATIC_LIBS ON) set(PNG_SHARED_LIBS OFF) endif() +#message(STATUS ${CURRENT_INSTALL_DIR}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -29,6 +32,7 @@ vcpkg_configure_cmake( -DSKIP_INSTALL_PROGRAMS=ON -DSKIP_INSTALL_EXECUTABLES=ON -DSKIP_INSTALL_FILES=ON + -DINSTALLED_DIR:PATH=${CURRENT_INSTALLED_DIR} OPTIONS_DEBUG -DSKIP_INSTALL_HEADERS=ON ) diff --git a/ports/libpng/set_zlib_root.patch b/ports/libpng/set_zlib_root.patch new file mode 100644 index 0000000000..8fb0296350 --- /dev/null +++ b/ports/libpng/set_zlib_root.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 186b65a..e485fd9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,6 +40,7 @@ set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR}) + set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) + + # needed packages ++set(ZLIB_ROOT ${INSTALLED_DIR}) + find_package(ZLIB REQUIRED) + include_directories(${ZLIB_INCLUDE_DIR}) + From 44c86f56db351da15e5a2b2fcca62656ab8cccbf Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Thu, 5 Jan 2017 19:39:14 +0100 Subject: [PATCH 018/561] Revert "forces CMake use zlib version which is installed by vcpkg." This reverts commit d62dda3b030e31f322aaa47b4aeaa0a12fa3201b. --- ports/libpng/portfile.cmake | 6 +----- ports/libpng/set_zlib_root.patch | 12 ------------ 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 ports/libpng/set_zlib_root.patch diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index 55cbb4bdad..f7be6cca1c 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -9,9 +9,7 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} - PATCHES - "${CMAKE_CURRENT_LIST_DIR}/use-abort-on-all-platforms.patch" - "${CMAKE_CURRENT_LIST_DIR}/set_zlib_root.patch" + PATCHES "${CMAKE_CURRENT_LIST_DIR}/use-abort-on-all-platforms.patch" ) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) @@ -21,7 +19,6 @@ else() set(PNG_STATIC_LIBS ON) set(PNG_SHARED_LIBS OFF) endif() -#message(STATUS ${CURRENT_INSTALL_DIR}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -32,7 +29,6 @@ vcpkg_configure_cmake( -DSKIP_INSTALL_PROGRAMS=ON -DSKIP_INSTALL_EXECUTABLES=ON -DSKIP_INSTALL_FILES=ON - -DINSTALLED_DIR:PATH=${CURRENT_INSTALLED_DIR} OPTIONS_DEBUG -DSKIP_INSTALL_HEADERS=ON ) diff --git a/ports/libpng/set_zlib_root.patch b/ports/libpng/set_zlib_root.patch deleted file mode 100644 index 8fb0296350..0000000000 --- a/ports/libpng/set_zlib_root.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 186b65a..e485fd9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -40,6 +40,7 @@ set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR}) - set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) - - # needed packages -+set(ZLIB_ROOT ${INSTALLED_DIR}) - find_package(ZLIB REQUIRED) - include_directories(${ZLIB_INCLUDE_DIR}) - From f99d143dc3e7cf9b07120256d2801da59653b486 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 5 Jan 2017 21:22:32 +0100 Subject: [PATCH 019/561] add libarchive --- ports/libarchive/CONTROL | 4 + .../auto-define-libarchive-static.patch | 28 ++++ ports/libarchive/fix-buildsystem.patch | 146 ++++++++++++++++++ ports/libarchive/portfile.cmake | 50 ++++++ ports/libarchive/use-memset-not-bzero.patch | 26 ++++ 5 files changed, 254 insertions(+) create mode 100644 ports/libarchive/CONTROL create mode 100644 ports/libarchive/auto-define-libarchive-static.patch create mode 100644 ports/libarchive/fix-buildsystem.patch create mode 100644 ports/libarchive/portfile.cmake create mode 100644 ports/libarchive/use-memset-not-bzero.patch diff --git a/ports/libarchive/CONTROL b/ports/libarchive/CONTROL new file mode 100644 index 0000000000..c035a891ee --- /dev/null +++ b/ports/libarchive/CONTROL @@ -0,0 +1,4 @@ +Source: libarchive +Version: 3.2.2 +Description: Library for reading and writing streaming archives +Build-Depends: zlib, bzip2, libxml2, libiconv, lz4, liblzma, openssl diff --git a/ports/libarchive/auto-define-libarchive-static.patch b/ports/libarchive/auto-define-libarchive-static.patch new file mode 100644 index 0000000000..41c953ebe9 --- /dev/null +++ b/ports/libarchive/auto-define-libarchive-static.patch @@ -0,0 +1,28 @@ +diff --git a/archive.h b/archive.h +index ff401e9..602717e 100644 +--- a/archive.h ++++ b/archive.h +@@ -106,6 +106,9 @@ typedef ssize_t la_ssize_t; + * .lib. The default here assumes you're building a DLL. Only + * libarchive source should ever define __LIBARCHIVE_BUILD. + */ ++ ++#define LIBARCHIVE_STATIC ++ + #if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC) + # ifdef __LIBARCHIVE_BUILD + # ifdef __GNUC__ +diff --git a/archive_entry.h b/archive_entry.h +index 71b1e87..44246b9 100644 +--- a/archive_entry.h ++++ b/archive_entry.h +@@ -85,6 +85,9 @@ typedef int64_t la_int64_t; + * .lib. The default here assumes you're building a DLL. Only + * libarchive source should ever define __LIBARCHIVE_BUILD. + */ ++ ++#define LIBARCHIVE_STATIC ++ + #if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC) + # ifdef __LIBARCHIVE_BUILD + # ifdef __GNUC__ diff --git a/ports/libarchive/fix-buildsystem.patch b/ports/libarchive/fix-buildsystem.patch new file mode 100644 index 0000000000..2568a8c8fe --- /dev/null +++ b/ports/libarchive/fix-buildsystem.patch @@ -0,0 +1,146 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a376fce..2d035a1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -166,7 +166,7 @@ IF (MSVC) + # result of an assignment. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4706") + # /WX option is the same as gcc's -Werror option. +- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /WX") ++ #SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /WX") <- breaks x64-debug + # /Oi option enables built-in functions. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Oi") + ################################################################# +@@ -177,6 +177,7 @@ ENDIF (MSVC) + # Enable CTest/CDash support + include(CTest) + ++OPTION(ENABLE_LZO2 "Enable use of LZO2 library" ON) + OPTION(ENABLE_NETTLE "Enable use of Nettle" ON) + OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON) + OPTION(ENABLE_LZMA "Enable the use of the system found LZMA library if found" ON) +@@ -357,7 +358,7 @@ IF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}") + # The zlib and the bzip2 Setup program have installed programs and DLLs into + # "C:/Program Files/GnuWin32" by default. + # This is convenience setting for Windows. +- SET(CMAKE_PREFIX_PATH ${__GNUWIN32PATH} $(CMAKE_PREFIX_PATH)) ++ #SET(CMAKE_PREFIX_PATH ${__GNUWIN32PATH} $(CMAKE_PREFIX_PATH)) + # + # If you didn't use Setup program or installed into nonstandard path, + # cmake cannot find out your zlib or bzip2 libraries and include files, +@@ -397,11 +398,12 @@ IF(ZLIB_FOUND) + # + # Test if ZLIB_WINAPI macro is needed to use. + # +- TRY_MACRO_FOR_LIBRARY( +- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" +- RUNS +- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" +- ZLIB_WINAPI) ++ SET(ZLIB_WINAPI OFF) # skip following test, it crashes with weird message box ++ #TRY_MACRO_FOR_LIBRARY( ++ # "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" ++ # RUNS ++ # "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" ++ # ZLIB_WINAPI) + IF(ZLIB_WINAPI) + ADD_DEFINITIONS(-DZLIB_WINAPI) + ELSE(ZLIB_WINAPI) +@@ -483,6 +485,7 @@ ENDIF(LZMA_FOUND) + # + # Find LZO2 + # ++IF(ENABLE_LZO2) + IF (LZO2_INCLUDE_DIR) + # Already in cache, be silent + SET(LZO2_FIND_QUIETLY TRUE) +@@ -504,6 +507,7 @@ IF(LZO2_FOUND) + ENDIF(LZO2_FOUND) + MARK_AS_ADVANCED(CLEAR LZO2_INCLUDE_DIR) + MARK_AS_ADVANCED(CLEAR LZO2_LIBRARY) ++ENDIF() + # + # Find LZ4 + # +@@ -923,7 +927,9 @@ IF(ENABLE_ICONV) + CHECK_ICONV("libc" "") + + # If iconv isn't in libc and we have a libiconv, try that. +- FIND_LIBRARY(LIBICONV_PATH NAMES iconv libiconv) ++ FIND_LIBRARY(LIBICONV_PATH1 NAMES iconv libiconv) ++ FIND_LIBRARY(LIBCHARSET_PATH NAMES charset libcharset) ++ SET(LIBICONV_PATH ${LIBICONV_PATH1} ${LIBCHARSET_PATH}) + IF(NOT HAVE_ICONV AND LIBICONV_PATH) + LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBICONV_PATH}) + # Test if a macro is needed for the library. +@@ -1307,9 +1313,13 @@ CHECK_C_SOURCE_COMPILES( + "#include \nint main() { return major(256); }" + MAJOR_IN_SYSMACROS) + ++CMAKE_PUSH_CHECK_STATE() ++set(CMAKE_REQUIRED_INCLUDES ${LZMA_INCLUDE_DIR}) ++set(CMAKE_REQUIRED_LIBRARIES ${LZMA_LIBRARIES}) + CHECK_C_SOURCE_COMPILES( + "#include \n#if LZMA_VERSION < 50020000\n#error unsupported\n#endif\nint main(void){lzma_stream_encoder_mt(0, 0); return 0;}" + HAVE_LZMA_STREAM_ENCODER_MT) ++CMAKE_POP_CHECK_STATE() + + IF(HAVE_STRERROR_R) + SET(HAVE_DECL_STRERROR_R 1) +@@ -1655,12 +1665,12 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) + ADD_DEFINITIONS(-DHAVE_CONFIG_H) + + # Handle generation of the libarchive.pc file for pkg-config +-INCLUDE(CreatePkgConfigFile) ++#INCLUDE(CreatePkgConfigFile) + + # + # Register installation of PDF documents. + # +-IF(WIN32 AND NOT CYGWIN) ++IF(0 AND WIN32 AND NOT CYGWIN) + # + # On Windows platform, It's better that we install PDF documents + # on one's computer. +diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt +index 4cc9a2c..ef304c5 100644 +--- a/libarchive/CMakeLists.txt ++++ b/libarchive/CMakeLists.txt +@@ -191,28 +191,24 @@ IF(WIN32 AND NOT CYGWIN) + ENDIF(WIN32 AND NOT CYGWIN) + + # Libarchive is a shared library +-ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS}) ++ADD_LIBRARY(archive ${libarchive_SOURCES} ${include_HEADERS}) + TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS}) ++IF(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION}) +- +-# archive_static is a static library +-ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS}) +-TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS}) +-SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS +- LIBARCHIVE_STATIC) +-# On Posix systems, libarchive.so and libarchive.a can co-exist. +-IF(NOT WIN32 OR CYGWIN) +- SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive) +-ENDIF(NOT WIN32 OR CYGWIN) ++ELSE() ++SET_TARGET_PROPERTIES(archive PROPERTIES COMPILE_DEFINITIONS LIBARCHIVE_STATIC) ++ENDIF() + + IF(ENABLE_INSTALL) + # How to install the libraries +- INSTALL(TARGETS archive archive_static ++ INSTALL(TARGETS archive + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +- INSTALL_MAN(${libarchive_MANS}) ++ #INSTALL_MAN(${libarchive_MANS}) ++ IF(NOT ARCHIVE_SKIP_HEADERS) + INSTALL(FILES ${include_HEADERS} DESTINATION include) ++ ENDIF() + ENDIF() + + add_subdirectory(test) diff --git a/ports/libarchive/portfile.cmake b/ports/libarchive/portfile.cmake new file mode 100644 index 0000000000..26d1755168 --- /dev/null +++ b/ports/libarchive/portfile.cmake @@ -0,0 +1,50 @@ +# libarchive uses winapi functions not available in WindowsStore +if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) + message(FATAL_ERROR "Error: UWP builds are not supported.") +endif() + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libarchive-3.2.2) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/libarchive/libarchive/archive/v3.2.2.zip" + FILENAME "libarchive-3.2.2.zip" + SHA512 74abe8a66514aa344111f08e08015d2972545f6acf0923ff1ce7267bfc6c195ca562078a11d1c49ca36155c6b782b1f7ad08b71d93cb85fa892373479b0d1182) + +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/fix-buildsystem.patch + ${CMAKE_CURRENT_LIST_DIR}/use-memset-not-bzero.patch) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DENABLE_LZO2=OFF + -DENABLE_NETTLE=OFF + -DENABLE_EXPAT=OFF + -DENABLE_LibGCC=OFF + -DENABLE_CNG=OFF + -DENABLE_TAR=OFF + -DENABLE_CPIO=OFF + -DENABLE_CAT=OFF + -DENABLE_XATTR=OFF + -DENABLE_ACL=OFF + -DENABLE_TEST=OFF + -DPOSIX_REGEX_LIB=NONE + OPTIONS_DEBUG + -DARCHIVE_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/auto-define-libarchive-static.patch) +endif() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libarchive) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libarchive/COPYING ${CURRENT_PACKAGES_DIR}/share/libarchive/copyright) diff --git a/ports/libarchive/use-memset-not-bzero.patch b/ports/libarchive/use-memset-not-bzero.patch new file mode 100644 index 0000000000..d28ab7409a --- /dev/null +++ b/ports/libarchive/use-memset-not-bzero.patch @@ -0,0 +1,26 @@ +diff --git a/libarchive/archive_write_add_filter_xz.c b/libarchive/archive_write_add_filter_xz.c +index 46a6c38..b0f25a6 100644 +--- a/libarchive/archive_write_add_filter_xz.c ++++ b/libarchive/archive_write_add_filter_xz.c +@@ -233,7 +233,7 @@ archive_compressor_xz_init_stream(struct archive_write_filter *f, + if (f->code == ARCHIVE_FILTER_XZ) { + #ifdef HAVE_LZMA_STREAM_ENCODER_MT + if (data->threads != 1) { +- bzero(&mt_options, sizeof(mt_options)); ++ memset(&mt_options, 0, sizeof(mt_options)); + mt_options.threads = data->threads; + mt_options.timeout = 300; + mt_options.filters = data->lzmafilters; +diff --git a/libarchive/archive_write_set_format_xar.c b/libarchive/archive_write_set_format_xar.c +index a2dbc03..15a013c 100644 +--- a/libarchive/archive_write_set_format_xar.c ++++ b/libarchive/archive_write_set_format_xar.c +@@ -2913,7 +2913,7 @@ compression_init_encoder_xz(struct archive *a, + *strm = lzma_init_data; + #ifdef HAVE_LZMA_STREAM_ENCODER_MT + if (threads > 1) { +- bzero(&mt_options, sizeof(mt_options)); ++ memset(&mt_options, 0, sizeof(mt_options)); + mt_options.threads = threads; + mt_options.timeout = 300; + mt_options.filters = lzmafilters; From 0b5e2e9e76e66b566cf4d3f68146fdbdff2bac05 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 12:47:08 -0800 Subject: [PATCH 020/561] Use nested namespace definition --- toolsrc/include/vcpkg_Checks.h | 4 ++-- toolsrc/include/vcpkg_Files.h | 4 ++-- toolsrc/include/vcpkg_Graphs.h | 4 ++-- toolsrc/include/vcpkg_Maps.h | 4 ++-- toolsrc/include/vcpkg_Sets.h | 4 ++-- toolsrc/include/vcpkg_Strings.h | 8 ++++---- toolsrc/include/vcpkg_System.h | 4 ++-- toolsrc/src/vcpkg_Checks.cpp | 4 ++-- toolsrc/src/vcpkg_Files.cpp | 4 ++-- toolsrc/src/vcpkg_Strings.cpp | 8 ++++---- toolsrc/src/vcpkg_System.cpp | 6 +++--- 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/toolsrc/include/vcpkg_Checks.h b/toolsrc/include/vcpkg_Checks.h index 9d9b21ed6b..a58b38ac0d 100644 --- a/toolsrc/include/vcpkg_Checks.h +++ b/toolsrc/include/vcpkg_Checks.h @@ -2,7 +2,7 @@ #include "vcpkg_Strings.h" -namespace vcpkg {namespace Checks +namespace vcpkg::Checks { __declspec(noreturn) void unreachable(); @@ -46,4 +46,4 @@ namespace vcpkg {namespace Checks exit_with_message(Strings::format(errorMessageTemplate, errorMessageArgs...).c_str()); } } -}} +} diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 6c9d0d3657..3f95709462 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -4,7 +4,7 @@ #include "filesystem_fs.h" #include -namespace vcpkg {namespace Files +namespace vcpkg::Files { static const char* FILESYSTEM_INVALID_CHARACTERS = R"(\/:*?"<>|)"; @@ -53,4 +53,4 @@ namespace vcpkg {namespace Files std::vector non_recursive_find_all_files_in_dir(const fs::path& dir); void print_paths(const std::vector& paths); -}} +} diff --git a/toolsrc/include/vcpkg_Graphs.h b/toolsrc/include/vcpkg_Graphs.h index 9444ac45bc..933d9ac677 100644 --- a/toolsrc/include/vcpkg_Graphs.h +++ b/toolsrc/include/vcpkg_Graphs.h @@ -3,7 +3,7 @@ #include #include -namespace vcpkg { namespace Graphs +namespace vcpkg::Graphs { enum class ExplorationStatus { @@ -117,4 +117,4 @@ namespace vcpkg { namespace Graphs private: std::unordered_map> vertices; }; -}} +} diff --git a/toolsrc/include/vcpkg_Maps.h b/toolsrc/include/vcpkg_Maps.h index c67462a392..5e2f92f551 100644 --- a/toolsrc/include/vcpkg_Maps.h +++ b/toolsrc/include/vcpkg_Maps.h @@ -4,7 +4,7 @@ #include #include -namespace vcpkg { namespace Maps +namespace vcpkg::Maps { template std::unordered_set extract_key_set(const std::unordered_map& input_map) @@ -38,4 +38,4 @@ namespace vcpkg { namespace Maps } return key_set; } -}} +} diff --git a/toolsrc/include/vcpkg_Sets.h b/toolsrc/include/vcpkg_Sets.h index 7b330f31c7..6dec95b899 100644 --- a/toolsrc/include/vcpkg_Sets.h +++ b/toolsrc/include/vcpkg_Sets.h @@ -3,7 +3,7 @@ #include "vcpkg_Checks.h" #include -namespace vcpkg { namespace Sets +namespace vcpkg::Sets { template void remove_all(std::unordered_set* input_set, Container remove_these) @@ -14,4 +14,4 @@ namespace vcpkg { namespace Sets input_set->erase(r); } } -}} +} diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index a117a1a81c..28853cb5d5 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -2,7 +2,7 @@ #include -namespace vcpkg {namespace Strings {namespace details +namespace vcpkg::Strings::details { inline const char* to_printf_arg(const std::string& s) { @@ -42,9 +42,9 @@ namespace vcpkg {namespace Strings {namespace details } std::wstring wformat_internal(const wchar_t* fmtstr, ...); -}}} +} -namespace vcpkg {namespace Strings +namespace vcpkg::Strings { template std::string format(const char* fmtstr, const Args&...args) @@ -75,4 +75,4 @@ namespace vcpkg {namespace Strings std::string trimmed(const std::string& s); void trim_all_and_remove_whitespace_strings(std::vector* strings); -}} +} diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index 1101c9b272..c9195163c5 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -3,7 +3,7 @@ #include "vcpkg_Strings.h" #include "filesystem_fs.h" -namespace vcpkg {namespace System +namespace vcpkg::System { fs::path get_exe_path_of_current_process(); @@ -93,4 +93,4 @@ namespace vcpkg {namespace System }; std::wstring wdupenv_str(const wchar_t* varname) noexcept; -}} +} diff --git a/toolsrc/src/vcpkg_Checks.cpp b/toolsrc/src/vcpkg_Checks.cpp index 817ac9e960..46b28e55cd 100644 --- a/toolsrc/src/vcpkg_Checks.cpp +++ b/toolsrc/src/vcpkg_Checks.cpp @@ -3,7 +3,7 @@ #include #include "vcpkg_System.h" -namespace vcpkg {namespace Checks +namespace vcpkg::Checks { void unreachable() { @@ -41,4 +41,4 @@ namespace vcpkg {namespace Checks exit_with_message(errorMessage); } } -}} +} diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 48283e43fd..1d4faa7733 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -3,7 +3,7 @@ #include #include "vcpkg_System.h" -namespace vcpkg {namespace Files +namespace vcpkg::Files { static const std::regex FILESYSTEM_INVALID_CHARACTERS_REGEX = std::regex(R"([\/:*?"<>|])"); @@ -140,4 +140,4 @@ namespace vcpkg {namespace Files } System::println(""); } -}} +} diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 46a4b18559..cf7d3b0eec 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -7,7 +7,7 @@ #include #include -namespace vcpkg {namespace Strings {namespace details +namespace vcpkg::Strings::details { // To disambiguate between two overloads static const auto isspace = [](const char c) @@ -40,9 +40,9 @@ namespace vcpkg {namespace Strings {namespace details return output; } -}}} +} -namespace vcpkg {namespace Strings +namespace vcpkg::Strings { std::wstring utf8_to_utf16(const std::string& s) { @@ -119,4 +119,4 @@ namespace vcpkg {namespace Strings return s == ""; }), strings->end()); } -}} +} diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 43eae34120..405dfd1b80 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -3,7 +3,7 @@ #include #include -namespace vcpkg {namespace System +namespace vcpkg::System { fs::path get_exe_path_of_current_process() { @@ -104,6 +104,6 @@ namespace vcpkg {namespace System double Stopwatch2::microseconds() const { return (reinterpret_cast(&end_time)->QuadPart - - reinterpret_cast(&start_time)->QuadPart) * 1000000.0 / reinterpret_cast(&freq)->QuadPart; + reinterpret_cast(&start_time)->QuadPart) * 1000000.0 / reinterpret_cast(&freq)->QuadPart; } -}} +} From 1565cafb836a8efdb7c39c9c1df1ca4d671f3d90 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 14:09:48 -0800 Subject: [PATCH 021/561] Use nullptr --- toolsrc/src/metrics.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp index 51c7179c82..1806dad874 100644 --- a/toolsrc/src/metrics.cpp +++ b/toolsrc/src/metrics.cpp @@ -237,13 +237,13 @@ true std::wstring GetSQMUser() { - LONG err = NULL; + LONG err; struct RAII_HKEY { - HKEY hkey = NULL; + HKEY hkey = nullptr; ~RAII_HKEY() { - if (hkey != NULL) + if (hkey != nullptr) RegCloseKey(hkey); } } HKCU_SQMClient; @@ -257,7 +257,7 @@ true std::array buffer; DWORD lType = 0; DWORD dwBufferSize = static_cast(buffer.size() * sizeof(wchar_t)); - err = RegQueryValueExW(HKCU_SQMClient.hkey, L"UserId", NULL, &lType, reinterpret_cast(buffer.data()), &dwBufferSize); + err = RegQueryValueExW(HKCU_SQMClient.hkey, L"UserId", nullptr, &lType, reinterpret_cast(buffer.data()), &dwBufferSize); if (err == ERROR_SUCCESS && lType == REG_SZ && dwBufferSize >= sizeof(wchar_t)) { size_t sz = dwBufferSize / sizeof(wchar_t); From 88b5791b0bcaa9cce7f488bbd03042aa65e4417e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 14:14:11 -0800 Subject: [PATCH 022/561] Use Nested Namespace Definition --- toolsrc/include/coff_file_reader.h | 4 ++-- toolsrc/include/post_build_lint.h | 4 ++-- toolsrc/include/vcpkg_Dependencies.h | 4 ++-- toolsrc/include/vcpkg_Environment.h | 4 ++-- toolsrc/include/vcpkg_Input.h | 4 ++-- toolsrc/src/coff_file_reader.cpp | 4 ++-- toolsrc/src/post_build_lint.cpp | 4 ++-- toolsrc/src/vcpkg_Dependencies.cpp | 4 ++-- toolsrc/src/vcpkg_Environment.cpp | 4 ++-- toolsrc/src/vcpkg_Input.cpp | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/toolsrc/include/coff_file_reader.h b/toolsrc/include/coff_file_reader.h index edf6910a5f..24fbf45766 100644 --- a/toolsrc/include/coff_file_reader.h +++ b/toolsrc/include/coff_file_reader.h @@ -3,7 +3,7 @@ #include "MachineType.h" #include "filesystem_fs.h" -namespace vcpkg {namespace COFFFileReader +namespace vcpkg::COFFFileReader { struct dll_info { @@ -18,4 +18,4 @@ namespace vcpkg {namespace COFFFileReader dll_info read_dll(const fs::path& path); lib_info read_lib(const fs::path& path); -}} +} diff --git a/toolsrc/include/post_build_lint.h b/toolsrc/include/post_build_lint.h index a5fb9149fd..215a237aa4 100644 --- a/toolsrc/include/post_build_lint.h +++ b/toolsrc/include/post_build_lint.h @@ -2,7 +2,7 @@ #include "package_spec.h" #include "vcpkg_paths.h" -namespace vcpkg {namespace PostBuildLint +namespace vcpkg::PostBuildLint { void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths); -}} +} diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 3616e6be9e..4da9de6943 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -4,7 +4,7 @@ #include "StatusParagraphs.h" #include "vcpkg_paths.h" -namespace vcpkg {namespace Dependencies +namespace vcpkg::Dependencies { enum class install_plan_type { @@ -27,4 +27,4 @@ namespace vcpkg {namespace Dependencies }; std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); -}} +} diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index 877ac7deb5..1e8624d899 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -1,7 +1,7 @@ #pragma once #include "vcpkg_paths.h" -namespace vcpkg {namespace Environment +namespace vcpkg::Environment { void ensure_nuget_on_path(const vcpkg_paths& paths); @@ -14,4 +14,4 @@ namespace vcpkg {namespace Environment ensure_cmake_on_path(paths); ensure_git_on_path(paths); } -}} +} diff --git a/toolsrc/include/vcpkg_Input.h b/toolsrc/include/vcpkg_Input.h index 5ce90e3b90..3cce334c48 100644 --- a/toolsrc/include/vcpkg_Input.h +++ b/toolsrc/include/vcpkg_Input.h @@ -3,7 +3,7 @@ #include "package_spec.h" #include "vcpkg_paths.h" -namespace vcpkg {namespace Input +namespace vcpkg::Input { package_spec check_and_get_package_spec(const std::string& package_spec_as_string, const triplet& default_target_triplet, const std::string& example_text); @@ -12,4 +12,4 @@ namespace vcpkg {namespace Input void check_triplet(const triplet& t, const vcpkg_paths& paths); void check_triplets(std::vector triplets, const vcpkg_paths& paths); -}} +} diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index 1f30ea70b4..8ce714bbe9 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -6,7 +6,7 @@ using namespace std; -namespace vcpkg { namespace COFFFileReader +namespace vcpkg::COFFFileReader { template static T reinterpret_bytes(const char* data) @@ -306,4 +306,4 @@ namespace vcpkg { namespace COFFFileReader return {std::vector(machine_types.cbegin(), machine_types.cend())}; } -}} +} diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 4f0adf6778..1fca3a2f68 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -7,7 +7,7 @@ #include "BuildInfo.h" #include -namespace vcpkg { namespace PostBuildLint +namespace vcpkg::PostBuildLint { enum class lint_status { @@ -668,4 +668,4 @@ namespace vcpkg { namespace PostBuildLint System::println("-- Performing post-build validation done"); } -}} +} diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index ae7f697fab..f1464a6055 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -9,7 +9,7 @@ #include "vcpkg_Files.h" #include "vcpkg.h" -namespace vcpkg { namespace Dependencies +namespace vcpkg::Dependencies { std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) { @@ -72,4 +72,4 @@ namespace vcpkg { namespace Dependencies } return ret; } -}} +} diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index ed70e68815..c7eec3bd08 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -5,7 +5,7 @@ #include "metrics.h" #include "vcpkg_System.h" -namespace vcpkg {namespace Environment +namespace vcpkg::Environment { static const fs::path default_cmake_installation_dir = "C:/Program Files/CMake/bin"; static const fs::path default_cmake_installation_dir_x86 = "C:/Program Files (x86)/CMake/bin"; @@ -83,4 +83,4 @@ namespace vcpkg {namespace Environment // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned ensure_on_path(nuget_version, L"nuget 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency nuget"); } -}} +} diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp index 29d487fdb8..a8145230c9 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg_Input.cpp @@ -3,7 +3,7 @@ #include "metrics.h" #include "vcpkg_Commands.h" -namespace vcpkg {namespace Input +namespace vcpkg::Input { package_spec check_and_get_package_spec(const std::string& package_spec_as_string, const triplet& default_target_triplet, const std::string& example_text) { @@ -49,4 +49,4 @@ namespace vcpkg {namespace Input check_triplet(spec.target_triplet(), paths); } } -}} +} From 6e29b7b8d4b3a21e46a721f79d184213d1c874a4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 14:21:09 -0800 Subject: [PATCH 023/561] Pass by reference --- toolsrc/include/vcpkg_Input.h | 2 +- toolsrc/src/vcpkg_Input.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/include/vcpkg_Input.h b/toolsrc/include/vcpkg_Input.h index 3cce334c48..96cbeecc3e 100644 --- a/toolsrc/include/vcpkg_Input.h +++ b/toolsrc/include/vcpkg_Input.h @@ -11,5 +11,5 @@ namespace vcpkg::Input void check_triplet(const triplet& t, const vcpkg_paths& paths); - void check_triplets(std::vector triplets, const vcpkg_paths& paths); + void check_triplets(const std::vector& triplets, const vcpkg_paths& paths); } diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp index a8145230c9..365f28cdb2 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg_Input.cpp @@ -42,7 +42,7 @@ namespace vcpkg::Input } } - void check_triplets(std::vector triplets, const vcpkg_paths& paths) + void check_triplets(const std::vector& triplets, const vcpkg_paths& paths) { for (const package_spec& spec : triplets) { From 708e93d82acd4da9c651cc7043dfd32a182ecc11 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 14:25:50 -0800 Subject: [PATCH 024/561] Use Nested Namespace Definition --- toolsrc/include/BuildInfo.h | 4 ++-- toolsrc/include/Paragraphs.h | 4 ++-- toolsrc/include/vcpkg_info.h | 4 ++-- toolsrc/include/vcpkglib_helpers.h | 4 ++-- toolsrc/src/BuildInfo.cpp | 4 ++-- toolsrc/src/Paragraphs.cpp | 4 ++-- toolsrc/src/vcpkg_info.cpp | 4 ++-- toolsrc/src/vcpkglib_helpers.cpp | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 49811d521b..c90ad7a4e6 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -4,7 +4,7 @@ #include "Paragraphs.h" #include -namespace vcpkg { namespace PostBuildLint +namespace vcpkg::PostBuildLint { enum class LinkageType { @@ -126,4 +126,4 @@ namespace vcpkg { namespace PostBuildLint }; BuildInfo read_build_info(const fs::path& filepath); -}} +} diff --git a/toolsrc/include/Paragraphs.h b/toolsrc/include/Paragraphs.h index 9e9fafe497..761b497590 100644 --- a/toolsrc/include/Paragraphs.h +++ b/toolsrc/include/Paragraphs.h @@ -3,8 +3,8 @@ #include "filesystem_fs.h" #include -namespace vcpkg { namespace Paragraphs +namespace vcpkg::Paragraphs { std::vector> get_paragraphs(const fs::path& control_path); std::vector> parse_paragraphs(const std::string& str); -}} +} diff --git a/toolsrc/include/vcpkg_info.h b/toolsrc/include/vcpkg_info.h index 01da063079..5380e01588 100644 --- a/toolsrc/include/vcpkg_info.h +++ b/toolsrc/include/vcpkg_info.h @@ -2,9 +2,9 @@ #include -namespace vcpkg { namespace Info +namespace vcpkg::Info { const std::string& version(); const std::string& email(); -}} +} diff --git a/toolsrc/include/vcpkglib_helpers.h b/toolsrc/include/vcpkglib_helpers.h index 019bb8c398..8a08513f3d 100644 --- a/toolsrc/include/vcpkglib_helpers.h +++ b/toolsrc/include/vcpkglib_helpers.h @@ -2,7 +2,7 @@ #include -namespace vcpkg {namespace details +namespace vcpkg::details { std::string optional_field(const std::unordered_map& fields, const std::string& fieldname); std::string remove_optional_field(std::unordered_map* fields, const std::string& fieldname); @@ -11,4 +11,4 @@ namespace vcpkg {namespace details std::string remove_required_field(std::unordered_map* fields, const std::string& fieldname); std::string shorten_description(const std::string& desc); -}} +} diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index f151a3ea5e..a45dc4b723 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -2,7 +2,7 @@ #include "vcpkg_Checks.h" #include "vcpkglib_helpers.h" -namespace vcpkg { namespace PostBuildLint +namespace vcpkg::PostBuildLint { const ConfigurationType& BuildType::config() const { @@ -161,4 +161,4 @@ namespace vcpkg { namespace PostBuildLint { return this->m_dll_name; } -}} +} diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp index 823b4a85e6..d99ad45cf9 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/Paragraphs.cpp @@ -1,7 +1,7 @@ #include "Paragraphs.h" #include "vcpkg_Files.h" -namespace vcpkg { namespace Paragraphs +namespace vcpkg::Paragraphs { struct Parser { @@ -160,4 +160,4 @@ namespace vcpkg { namespace Paragraphs { return Parser(str.c_str(), str.c_str() + str.size()).get_paragraphs(); } -}} +} diff --git a/toolsrc/src/vcpkg_info.cpp b/toolsrc/src/vcpkg_info.cpp index 25c09d6dab..69bc6a3554 100644 --- a/toolsrc/src/vcpkg_info.cpp +++ b/toolsrc/src/vcpkg_info.cpp @@ -6,7 +6,7 @@ #define VCPKG_VERSION_AS_STRING MACRO_TO_STRING(VCPKG_VERSION)"" // Double quotes needed at the end to prevent blank token -namespace vcpkg { namespace Info +namespace vcpkg::Info { const std::string& version() { @@ -31,4 +31,4 @@ namespace vcpkg { namespace Info static const std::string s_email = R"(vcpkg@microsoft.com)"; return s_email; } -}} +} diff --git a/toolsrc/src/vcpkglib_helpers.cpp b/toolsrc/src/vcpkglib_helpers.cpp index d104bb19d2..fdc287507d 100644 --- a/toolsrc/src/vcpkglib_helpers.cpp +++ b/toolsrc/src/vcpkglib_helpers.cpp @@ -3,7 +3,7 @@ #include #include -namespace vcpkg {namespace details +namespace vcpkg::details { std::string optional_field(const std::unordered_map& fields, const std::string& fieldname) { @@ -53,4 +53,4 @@ namespace vcpkg {namespace details simple_desc.append("..."); return simple_desc; } -}} +} From 64e1bf8de73d18c85776c4cce2f40281f3ebb253 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 14:27:36 -0800 Subject: [PATCH 025/561] Use Nested Namespace Definition --- toolsrc/src/tests_paragraph.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/tests_paragraph.cpp b/toolsrc/src/tests_paragraph.cpp index 6d9e46fcfc..fb20eee824 100644 --- a/toolsrc/src/tests_paragraph.cpp +++ b/toolsrc/src/tests_paragraph.cpp @@ -7,14 +7,14 @@ using namespace Microsoft::VisualStudio::CppUnitTestFramework; -namespace Microsoft { namespace VisualStudio { namespace CppUnitTestFramework +namespace Microsoft::VisualStudio::CppUnitTestFramework { template <> inline std::wstring ToString(const vcpkg::package_spec_parse_result& t) { return ToString(static_cast(t)); } -}}} +} namespace UnitTest1 { From e5f60816cb6a786aa828aa2845522bb81c02cbe6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 22 Dec 2016 16:43:47 -0800 Subject: [PATCH 026/561] Introduce ImmutableSortedVector --- toolsrc/include/ImmutableSortedVector.h | 48 +++++++++++++++++++ toolsrc/include/vcpkg.h | 3 +- toolsrc/src/vcpkg.cpp | 2 +- toolsrc/vcpkgcommon/vcpkgcommon.vcxproj | 1 + .../vcpkgcommon/vcpkgcommon.vcxproj.filters | 3 ++ 5 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 toolsrc/include/ImmutableSortedVector.h diff --git a/toolsrc/include/ImmutableSortedVector.h b/toolsrc/include/ImmutableSortedVector.h new file mode 100644 index 0000000000..681f9fd4d6 --- /dev/null +++ b/toolsrc/include/ImmutableSortedVector.h @@ -0,0 +1,48 @@ +#pragma once + +#include +#include + +// Add more forwarding functions to the delegate std::vector as needed. +namespace vcpkg +{ + template + class ImmutableSortedVector + { + public: + static ImmutableSortedVector create(std::vector vector) + { + ImmutableSortedVector out; + out.delegate = std::move(vector); + if (!std::is_sorted(out.delegate.cbegin(), out.delegate.cend())) + { + std::sort(out.delegate.begin(), out.delegate.end()); + } + + return out; + } + + typename std::vector::const_iterator begin() const + { + return this->delegate.cbegin(); + } + + typename std::vector::const_iterator end() const + { + return this->delegate.cend(); + } + + typename std::vector::const_iterator cbegin() const + { + return this->delegate.cbegin(); + } + + typename std::vector::const_iterator cend() const + { + return this->delegate.cend(); + } + + private: + std::vector delegate; + }; +} diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 75dc40b434..b1653d1977 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -4,6 +4,7 @@ #include "BinaryParagraph.h" #include "StatusParagraphs.h" #include "vcpkg_paths.h" +#include "ImmutableSortedVector.h" namespace vcpkg { @@ -14,7 +15,7 @@ namespace vcpkg struct StatusParagraph_and_associated_files { StatusParagraph pgh; - std::vector files; + ImmutableSortedVector files; }; std::vector get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db); diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 4748aeb54a..eb2184ccbb 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -204,7 +204,7 @@ std::vector vcpkg::get_installed_files(con } ), installed_files_of_current_pgh.end()); - StatusParagraph_and_associated_files pgh_and_files = {*pgh, std::move(installed_files_of_current_pgh)}; + StatusParagraph_and_associated_files pgh_and_files = {*pgh, ImmutableSortedVector::create(std::move(installed_files_of_current_pgh))}; installed_files.push_back(std::move(pgh_and_files)); } diff --git a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj index 218a826adc..c0d1086022 100644 --- a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj +++ b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj @@ -128,6 +128,7 @@ + diff --git a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters index 4d40bfbe2d..bba605c54d 100644 --- a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters +++ b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters @@ -62,5 +62,8 @@ Header Files + + Header Files + \ No newline at end of file From f4c34bb42dd0fe8217d4d54a9a4a2eeecdb0f0f4 Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 5 Jan 2017 23:37:37 +0100 Subject: [PATCH 027/561] vcpkg_apply_patches: add QUIET option --- scripts/cmake/vcpkg_apply_patches.cmake | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index cd3026b6ab..d509e36ecc 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -1,5 +1,26 @@ +#.rst: +# .. command:: vcpkg_apply_patches +# +# Apply a set of patches to a source tree. +# +# :: +# vcpkg_apply_patches(SOURCE_PATH +# PATCHES patch1 [patch ...] +# ) +# +# ``SOURCE_PATH`` +# The source path in which apply the patches. +# ``PATCHES`` +# A list of patches that are applied to the source tree +# ``QUIET`` +# If this option is passed, the warning message when applyng +# a patch failes is not printed. This is convenient for patches +# that are known to fail even on a clean source tree, and for +# which the standard warning message would be confusing for the user. +# + function(vcpkg_apply_patches) - cmake_parse_arguments(_ap "" "SOURCE_PATH" "PATCHES" ${ARGN}) + cmake_parse_arguments(_ap "QUIET" "SOURCE_PATH" "PATCHES" ${ARGN}) find_program(GIT git) set(PATCHNUM 0) @@ -14,7 +35,7 @@ function(vcpkg_apply_patches) RESULT_VARIABLE error_code ) - if(error_code) + if(error_code AND NOT ${_ap_QUIET}) message(STATUS "Applying patch failed. This is expected if this patch was previously applied.") endif() From 1decb1b52c023cc56e475ea05ec533ae65ce3c8a Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 5 Jan 2017 23:38:01 +0100 Subject: [PATCH 028/561] cmake: add qmake-related helpers function --- scripts/cmake/vcpkg_build_qmake.cmake | 36 ++++++++++++++++++ scripts/cmake/vcpkg_common_functions.cmake | 2 + scripts/cmake/vcpkg_configure_qmake.cmake | 44 ++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 scripts/cmake/vcpkg_build_qmake.cmake create mode 100644 scripts/cmake/vcpkg_configure_qmake.cmake diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake new file mode 100644 index 0000000000..2632004236 --- /dev/null +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -0,0 +1,36 @@ +#.rst: +# .. command:: vcpkg_build_qmake +# +# Build a qmake-based project, previously configured using vcpkg_configure_qmake . +# As the CONFIG qmake option is assumed to be "debug_and_release" (the default value on Windows, see [1]), +# both the debug and release libraries are build in the same build tree. +# +# :: +# vcpkg_build_qmake() +# +# +# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html + +function(vcpkg_build_qmake) + vcpkg_find_acquire_program("JOM") + + if(NOT JOM) + BUILD_ERROR("vcpkg_install_qmake: impossible to find jom.") + endif() + + # Make sure that the linker finds the libraries used + set(ENV_LIB_BACKUP ENV{LIB}) + set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/debug/lib;$ENV{LIB}") + + message(STATUS "Package ${TARGET_TRIPLET}") + vcpkg_execute_required_process_repeat( + COUNT 2 + COMMAND ${JOM} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} + LOGNAME package-${TARGET_TRIPLET} + ) + message(STATUS "Package ${TARGET_TRIPLET} done") + + # Restore the original value of ENV{LIB} + set(ENV{LIB} ENV_LIB_BACKUP) +endfunction() diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index f1bbdb9e39..ff1fae953b 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -5,7 +5,9 @@ include(vcpkg_execute_required_process_repeat) include(vcpkg_find_acquire_program) include(vcpkg_build_cmake) include(vcpkg_build_msbuild) +include(vcpkg_build_qmake) include(vcpkg_install_cmake) include(vcpkg_configure_cmake) +include(vcpkg_configure_qmake) include(vcpkg_apply_patches) include(vcpkg_copy_pdbs) diff --git a/scripts/cmake/vcpkg_configure_qmake.cmake b/scripts/cmake/vcpkg_configure_qmake.cmake new file mode 100644 index 0000000000..f51a2f4fbb --- /dev/null +++ b/scripts/cmake/vcpkg_configure_qmake.cmake @@ -0,0 +1,44 @@ +#.rst: +# .. command:: vcpkg_configure_qmake +# +# Configure a qmake-based project. +# It is assume that the qmake project CONFIG variable is +# "debug_and_release" (the default value on Windows, see [1]). +# Using this option, only one Makefile for building both Release and Debug +# libraries is generated, that then can be run using the vcpkg_install_qmake +# command. +# +# :: +# vcpkg_configure_qmake(SOURCE_PATH +# [OPTIONS arg1 [arg2 ...]] +# ) +# +# ``PROJECT_PATH`` +# The path to the *.pro qmake project file. +# ``OPTIONS`` +# The options passed to qmake. +# +# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html + +function(vcpkg_configure_qmake) + cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) + + # Find qmake exectuable + find_program(QMAKE_COMMAND NAMES qmake) + + if(NOT QMAKE_COMMAND) + BUILD_ERROR("vcpkg_configure_qmake: impossible to find qmake.") + endif() + + # Cleanup build directories + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + + message(STATUS "Configuring ${TARGET_TRIPLET}") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + vcpkg_execute_required_process( + COMMAND ${QMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} + LOGNAME config-${TARGET_TRIPLET} + ) + message(STATUS "Configuring ${TARGET_TRIPLET} done") +endfunction() \ No newline at end of file From 3cad0111fbe288da3ee0dd525447125bbf76f707 Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 5 Jan 2017 23:39:00 +0100 Subject: [PATCH 029/561] Add qwt port --- ports/qwt/CONTROL | 4 +++ ports/qwt/build-shared-lib.patch | 13 +++++++ ports/qwt/build-static-lib.patch | 13 +++++++ ports/qwt/portfile.cmake | 61 ++++++++++++++++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 ports/qwt/CONTROL create mode 100644 ports/qwt/build-shared-lib.patch create mode 100644 ports/qwt/build-static-lib.patch create mode 100644 ports/qwt/portfile.cmake diff --git a/ports/qwt/CONTROL b/ports/qwt/CONTROL new file mode 100644 index 0000000000..b457bdeadf --- /dev/null +++ b/ports/qwt/CONTROL @@ -0,0 +1,4 @@ +Source: qwt +Version: 6.1.3 +Description: Qt widgets library for technical applications +Build-Depends: qt5 diff --git a/ports/qwt/build-shared-lib.patch b/ports/qwt/build-shared-lib.patch new file mode 100644 index 0000000000..2a8447d521 --- /dev/null +++ b/ports/qwt/build-shared-lib.patch @@ -0,0 +1,13 @@ +diff --git a/qwtconfig.pri b/qwtconfig.pri +index 756231a..2dc3715 100644 +--- a/qwtconfig.pri ++++ b/qwtconfig.pri +@@ -72,7 +72,7 @@ QWT_INSTALL_FEATURES = $${QWT_INSTALL_PREFIX}/features + # it will be a static library. + ###################################################################### + +-# QWT_CONFIG += QwtDll ++QWT_CONFIG += QwtDll + + ###################################################################### + # QwtPlot enables all classes, that are needed to use the QwtPlot diff --git a/ports/qwt/build-static-lib.patch b/ports/qwt/build-static-lib.patch new file mode 100644 index 0000000000..3e1b462ac6 --- /dev/null +++ b/ports/qwt/build-static-lib.patch @@ -0,0 +1,13 @@ +diff --git a/qwtconfig.pri b/qwtconfig.pri +index 2dc3715..756231a 100644 +--- a/qwtconfig.pri ++++ b/qwtconfig.pri +@@ -72,7 +72,7 @@ QWT_INSTALL_FEATURES = $${QWT_INSTALL_PREFIX}/features + # it will be a static library. + ###################################################################### + +-QWT_CONFIG += QwtDll ++# QWT_CONFIG += QwtDll + + ###################################################################### + # QwtPlot enables all classes, that are needed to use the QwtPlot diff --git a/ports/qwt/portfile.cmake b/ports/qwt/portfile.cmake new file mode 100644 index 0000000000..94cb2af916 --- /dev/null +++ b/ports/qwt/portfile.cmake @@ -0,0 +1,61 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/qwt-6.1.3) +vcpkg_download_distfile(ARCHIVE + URLS "https://sourceforge.net/projects/qwt/files/qwt/6.1.3/qwt-6.1.3.zip" + FILENAME "qwt-6.1.3.zip" + SHA512 8f249e23d50f71d14fca37776ea40d8d6931db14d9602e03a343bfb7a9bf55502202103135b77f583c3890a7924220e8a142a01c448dbde311860d89a3b10fc8 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/build-shared-lib.patch" + QUIET + ) +else() + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/build-static-lib.patch" + QUIET + ) +endif() + +vcpkg_configure_qmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_build_qmake() + +# Install following vcpkg conventions +set(BUILD_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + +file(GLOB HEADER_FILES ${SOURCE_PATH}/src/*.h) +file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +file(INSTALL + ${BUILD_DIR}/lib/qwt.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib +) + +file(INSTALL + ${BUILD_DIR}/lib/qwtd.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(INSTALL + ${BUILD_DIR}/lib/qwt.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/bin + ) + + file(INSTALL + ${BUILD_DIR}/lib/qwtd.dll + ${BUILD_DIR}/lib/qwtd.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + ) +endif() + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/qwt) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/qwt/COPYING ${CURRENT_PACKAGES_DIR}/share/qwt/copyright) From ff10939203b7694f21d8e8e0464f092dff1b4eb0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 15:23:08 -0800 Subject: [PATCH 030/561] Refactor pre-install check --- toolsrc/src/commands_installation.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 8d940bc9d3..c239bf06ca 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -164,9 +164,8 @@ namespace vcpkg return output; } - void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) + static ImmutableSortedVector build_list_of_package_files(const fs::path& package_dir) { - const fs::path package_dir = paths.package_dir(binary_paragraph.spec); const std::vector package_file_paths = Files::recursive_find_all_files_in_dir(package_dir); std::vector package_files; const size_t package_remove_char_count = package_dir.generic_string().size() + 1; // +1 for the slash @@ -176,14 +175,27 @@ namespace vcpkg as_string.erase(0, package_remove_char_count); return std::move(as_string); }); - std::sort(package_files.begin(), package_files.end()); - const std::vector& pgh_and_files = get_installed_files(paths, status_db); - const triplet& triplet = binary_paragraph.spec.target_triplet(); + return ImmutableSortedVector::create(std::move(package_files)); + } + + static ImmutableSortedVector build_list_of_installed_files(const std::vector& pgh_and_files, const triplet& triplet) + { std::vector installed_files = extract_files_in_triplet(pgh_and_files, triplet); const size_t installed_remove_char_count = triplet.canonical_name().size() + 1; // +1 for the slash remove_first_n_chars(&installed_files, installed_remove_char_count); - std::sort(installed_files.begin(), installed_files.end()); // Should already be sorted + + return ImmutableSortedVector::create(std::move(installed_files)); + } + + void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) + { + const fs::path package_dir = paths.package_dir(binary_paragraph.spec); + const triplet& triplet = binary_paragraph.spec.target_triplet(); + const std::vector pgh_and_files = get_installed_files(paths, status_db); + + const ImmutableSortedVector package_files = build_list_of_package_files(package_dir); + const ImmutableSortedVector installed_files = build_list_of_installed_files(pgh_and_files, triplet); std::vector intersection; std::set_intersection(package_files.cbegin(), package_files.cend(), From 37a5504855a83e24eb06ca1b5dd16b3dabd68313 Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Fri, 6 Jan 2017 19:08:31 +0100 Subject: [PATCH 031/561] finished port of sdl2_image - optional dependencies which are installed in vcpkg are automatically linked - unavailable dependencies are marked as dynamically linked and dlls have to be copied manually if respective file formats are used --- ports/sdl2-image/CMakeLists.txt | 81 +++++++++++++++++++++++++++++---- ports/sdl2-image/CONTROL | 6 ++- ports/sdl2-image/FindWEBP.cmake | 51 +++++++++++++++++++++ ports/sdl2-image/portfile.cmake | 5 +- 4 files changed, 132 insertions(+), 11 deletions(-) create mode 100644 ports/sdl2-image/FindWEBP.cmake diff --git a/ports/sdl2-image/CMakeLists.txt b/ports/sdl2-image/CMakeLists.txt index 3167294d35..a77662c0ec 100644 --- a/ports/sdl2-image/CMakeLists.txt +++ b/ports/sdl2-image/CMakeLists.txt @@ -1,16 +1,29 @@ cmake_minimum_required(VERSION 2.6) project(SDL2_image) -find_path(SDL_INCLUDE_DIR SDL2/SDL.h) -find_library(SDL_LIBRARY SDL2) +### configuration ### -include_directories(${SDL_INCLUDE_DIR}) -include_directories(${SDL_INCLUDE_DIR}/SDL2) -include_directories(${CMAKE_SOURCE_DIR}) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") +# enable all file formats which are supported natively +set(SUPPORTED_FORMATS BMP GIF LBM PCX PNM TGA XPM XCF XV) -#add_definitions(-DNOCONTROLS -DTHREADED_AUDIO) +# enable all file formats which are supported through external dependencies +# first try to load them statically (lib file in vcpkg installation) +# if this fails try to make them a dynamic dependency (dll will be loaded at runtime) if possible. vcpkg cannot resolve these dependencies! +# else do not support this file format at all +set(DEPENDENCIES PNG JPEG TIFF WEBP) -# some c++ code just assumes memset is available +# patch library names for preprocessor flags +set(JPEG_FLAG JPG) +set(TIFF_FLAG TIF) + +# names of potentially dynamically loaded libraries +set(JPEG_DYNAMIC \"libjpeg-9.dll\") +set(PNG_DYNAMIC \"libpng16-16.dll\") +set(TIFF_DYNAMIC \"libtiff-5.dll\") +set(WEBP_DYNAMIC \"libwebp-4.dll\") + +### implementation ### add_library(SDL2_image IMG.c @@ -30,15 +43,67 @@ add_library(SDL2_image IMG_xxx.c ) +foreach(FORMAT ${SUPPORTED_FORMATS}) + add_definitions(-DLOAD_${FORMAT}) +endforeach(FORMAT) + +# SDL +find_path(SDL_INCLUDE_DIR SDL2/SDL.h) +find_library(SDL_LIBRARY SDL2) + +include_directories(${SDL_INCLUDE_DIR}) +include_directories(${SDL_INCLUDE_DIR}/SDL2) +include_directories(${CMAKE_SOURCE_DIR}) + target_link_libraries(SDL2_image ${SDL_LIBRARY}) +# external dependencies +foreach(DEPENDENCY ${DEPENDENCIES}) + find_package(${DEPENDENCY}) + + if(NOT DEFINED ${DEPENDENCY}_FLAG) + set(${DEPENDENCY}_FLAG ${DEPENDENCY}) + endif() + + add_definitions(-DLOAD_${${DEPENDENCY}_FLAG}) + if(${DEPENDENCY}_FOUND) + message(STATUS " --> linking statically.") + target_link_libraries(SDL2_image ${${DEPENDENCY}_LIBRARIES}) + elseif(DEFINED ${DEPENDENCY}_DYNAMIC) + message(STATUS " --> linking dynamically.") + add_definitions(-DLOAD_${${DEPENDENCY}_FLAG}_DYNAMIC=${${DEPENDENCY}_DYNAMIC}) + set(RUNTIME_DEPENDENCIES ON) + else() + message(STATUS " --> skipping.") + endif() +endforeach(DEPENDENCY) + +if(DEFINED RUNTIME_DEPENDENCIES) + include_directories(VisualC/external/include) +endif() + + install(TARGETS SDL2_image RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) -install(FILES SDL_image.h DESTINATION include CONFIGURATIONS Release) +install(FILES SDL_image.h DESTINATION include/SDL2_image CONFIGURATIONS Release) message(STATUS "Link-time dependencies:") message(STATUS " " ${SDL_LIBRARY}) +foreach(DEPENDENCY ${DEPENDENCIES}) + if(${DEPENDENCY}_FOUND) + message(STATUS " " ${DEPENDENCY}) + endif() +endforeach(DEPENDENCY) + +if(DEFINED RUNTIME_DEPENDENCIES) + message(STATUS "Run-time dependencies:") + foreach(DEPENDENCY ${DEPENDENCIES}) + if(NOT ${DEPENDENCY}_FOUND AND DEFINED ${DEPENDENCY}_DYNAMIC) + message(STATUS " " ${${DEPENDENCY}_DYNAMIC}) + endif() + endforeach(DEPENDENCY) +endif() \ No newline at end of file diff --git a/ports/sdl2-image/CONTROL b/ports/sdl2-image/CONTROL index 591550cdc5..f9785ba22e 100644 --- a/ports/sdl2-image/CONTROL +++ b/ports/sdl2-image/CONTROL @@ -1,3 +1,5 @@ Source: sdl2-image -Version: -Description: +Version: 2.0.1 +Build-Depends: sdl2 +Description: SDL_image is an image file loading library. It loads images as SDL surfaces and textures, and supports the following formats: BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF, WEBP, XCF, XPM, XV + diff --git a/ports/sdl2-image/FindWEBP.cmake b/ports/sdl2-image/FindWEBP.cmake new file mode 100644 index 0000000000..ddabe71fe9 --- /dev/null +++ b/ports/sdl2-image/FindWEBP.cmake @@ -0,0 +1,51 @@ +# - Try to find WebP. +# Once done, this will define +# +# WEBP_FOUND - system has WebP. +# WEBP_INCLUDE_DIRS - the WebP. include directories +# WEBP_LIBRARIES - link these to use WebP. +# +# Copyright (C) 2012 Raphael Kubo da Costa +# Copyright (C) 2013 Igalia S.L. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS +# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +find_package(PkgConfig) +pkg_check_modules(PC_WEBP QUIET libwebp) + +# Look for the header file. +find_path(WEBP_INCLUDE_DIRS + NAMES webp/decode.h + HINTS ${PC_WEBP_INCLUDEDIR} ${PC_WEBP_INCLUDE_DIRS} +) +mark_as_advanced(WEBP_INCLUDE_DIRS) + +# Look for the library. +find_library( + WEBP_LIBRARIES + NAMES webp + HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS} +) +mark_as_advanced(WEBP_LIBRARIES) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(WEBP DEFAULT_MSG WEBP_INCLUDE_DIRS WEBP_LIBRARIES) \ No newline at end of file diff --git a/ports/sdl2-image/portfile.cmake b/ports/sdl2-image/portfile.cmake index f70d237c2f..4cc6ce74af 100644 --- a/ports/sdl2-image/portfile.cmake +++ b/ports/sdl2-image/portfile.cmake @@ -21,10 +21,11 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/correct-sdl-headers-dir.patch) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindWEBP.cmake DESTINATION ${SOURCE_PATH}/cmake) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1 ) @@ -34,3 +35,5 @@ vcpkg_install_cmake() # Handle copyright file(COPY ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2-image) file(RENAME ${CURRENT_PACKAGES_DIR}/share/sdl2-image/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/sdl2-image/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file From 937c4e26b074d7ddb603e16186e4efe271e8c230 Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Fri, 6 Jan 2017 22:05:22 +0100 Subject: [PATCH 032/561] fixed findWEBP.cmake to select debug version of webp for debug builds. --- ports/sdl2-image/FindWEBP.cmake | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ports/sdl2-image/FindWEBP.cmake b/ports/sdl2-image/FindWEBP.cmake index ddabe71fe9..a748140264 100644 --- a/ports/sdl2-image/FindWEBP.cmake +++ b/ports/sdl2-image/FindWEBP.cmake @@ -7,6 +7,7 @@ # # Copyright (C) 2012 Raphael Kubo da Costa # Copyright (C) 2013 Igalia S.L. +# Copyright (C) 2017 Patrick Bader # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -39,12 +40,16 @@ find_path(WEBP_INCLUDE_DIRS ) mark_as_advanced(WEBP_INCLUDE_DIRS) +if(CMAKE_BUILD_TYPE MATCHES DEBUG) + message("debug mode") +endif(CMAKE_BUILD_TYPE MATCHES DEBUG) + # Look for the library. -find_library( - WEBP_LIBRARIES - NAMES webp - HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS} -) +find_library(WEBP_LIBRARY_RELEASE NAMES webp HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS}) +find_library(WEBP_LIBRARY_DEBUG NAMES webpd HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS}) + +select_library_configurations(WEBP) + mark_as_advanced(WEBP_LIBRARIES) include(FindPackageHandleStandardArgs) From 95ff552b8572fdd0ef8ab01a8d462898ba59580b Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Fri, 6 Jan 2017 23:02:19 +0100 Subject: [PATCH 033/561] [qt5] Avoid printing warnings for problems in applying"confguration patches" The `QUIET` option for `vcpkg_apply_patches` was added in https://github.com/Microsoft/vcpkg/commit/f4c34bb42dd0fe8217d4d54a9a4a2eeecdb0f0f4 . Fixes https://github.com/Microsoft/vcpkg/issues/411 . --- ports/qt5/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index adcec1c8b4..5f0d9f6cb6 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -32,11 +32,13 @@ if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/set-static-qmakespec.patch" + QUIET ) else() vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/set-shared-qmakespec.patch" + QUIET ) endif() From fc8228a79b15db1284af5b4cb508e8bdc9fb8079 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Fri, 6 Jan 2017 23:04:20 +0100 Subject: [PATCH 034/561] [qt5] Fix tabs/spaces mismatch --- ports/qt5/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 5f0d9f6cb6..2b337df02b 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -32,13 +32,13 @@ if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/set-static-qmakespec.patch" - QUIET + QUIET ) else() vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/set-shared-qmakespec.patch" - QUIET + QUIET ) endif() From 2bb72e6637ab016a1fa8625b0a673d5ecd74ae4f Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Fri, 6 Jan 2017 23:20:57 +0100 Subject: [PATCH 035/561] [sdl2-image] added dependencies to CONTROL so they will always be statically linked Replaced FindWEBP.cmake with version from freeimage port --- ports/sdl2-image/CONTROL | 2 +- ports/sdl2-image/FindWEBP.cmake | 56 +++++++-------------------------- 2 files changed, 13 insertions(+), 45 deletions(-) diff --git a/ports/sdl2-image/CONTROL b/ports/sdl2-image/CONTROL index f9785ba22e..04c9f77bbc 100644 --- a/ports/sdl2-image/CONTROL +++ b/ports/sdl2-image/CONTROL @@ -1,5 +1,5 @@ Source: sdl2-image Version: 2.0.1 -Build-Depends: sdl2 +Build-Depends: sdl2, libpng, libjpeg-turbo, tiff, libwebp Description: SDL_image is an image file loading library. It loads images as SDL surfaces and textures, and supports the following formats: BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF, WEBP, XCF, XPM, XV diff --git a/ports/sdl2-image/FindWEBP.cmake b/ports/sdl2-image/FindWEBP.cmake index a748140264..fb3f9caa1c 100644 --- a/ports/sdl2-image/FindWEBP.cmake +++ b/ports/sdl2-image/FindWEBP.cmake @@ -1,56 +1,24 @@ -# - Try to find WebP. -# Once done, this will define +# - Find WEBP +# Find the WEBP library +# This module defines +# WEBP_INCLUDE_DIRS, where to find webp/decode.h +# WEBP_LIBRARIES, the libraries needed to use WEBP # -# WEBP_FOUND - system has WebP. -# WEBP_INCLUDE_DIRS - the WebP. include directories -# WEBP_LIBRARIES - link these to use WebP. -# -# Copyright (C) 2012 Raphael Kubo da Costa -# Copyright (C) 2013 Igalia S.L. -# Copyright (C) 2017 Patrick Bader -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS -# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -find_package(PkgConfig) -pkg_check_modules(PC_WEBP QUIET libwebp) - -# Look for the header file. find_path(WEBP_INCLUDE_DIRS NAMES webp/decode.h - HINTS ${PC_WEBP_INCLUDEDIR} ${PC_WEBP_INCLUDE_DIRS} ) mark_as_advanced(WEBP_INCLUDE_DIRS) -if(CMAKE_BUILD_TYPE MATCHES DEBUG) - message("debug mode") -endif(CMAKE_BUILD_TYPE MATCHES DEBUG) - -# Look for the library. -find_library(WEBP_LIBRARY_RELEASE NAMES webp HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS}) -find_library(WEBP_LIBRARY_DEBUG NAMES webpd HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS}) +find_library( + WEBP_LIBRARIES + NAMES webp +) +find_library(WEBP_LIBRARY_RELEASE NAMES webp PATH_SUFFIXES lib) +find_library(WEBP_LIBRARY_DEBUG NAMES webpd PATH_SUFFIXES lib) +include(SelectLibraryConfigurations) select_library_configurations(WEBP) -mark_as_advanced(WEBP_LIBRARIES) - include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(WEBP DEFAULT_MSG WEBP_INCLUDE_DIRS WEBP_LIBRARIES) \ No newline at end of file From c5dad5306e684972db7456033a7d4b2b920075a3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Jan 2017 14:57:45 -0800 Subject: [PATCH 036/561] [vcpkg_apply_pathces] Fix typo (also trailing whitespace) --- scripts/cmake/vcpkg_apply_patches.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index d509e36ecc..e17d53b087 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -11,11 +11,11 @@ # ``SOURCE_PATH`` # The source path in which apply the patches. # ``PATCHES`` -# A list of patches that are applied to the source tree -# ``QUIET`` -# If this option is passed, the warning message when applyng -# a patch failes is not printed. This is convenient for patches -# that are known to fail even on a clean source tree, and for +# A list of patches that are applied to the source tree +# ``QUIET`` +# If this option is passed, the warning message when applyng +# a patch fails is not printed. This is convenient for patches +# that are known to fail even on a clean source tree, and for # which the standard warning message would be confusing for the user. # From 833fbb2ef1edebad21e2131fd023c9151bf3f7d5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Jan 2017 15:40:37 -0800 Subject: [PATCH 037/561] [libvorbis] Add version --- ports/libvorbis/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libvorbis/CONTROL b/ports/libvorbis/CONTROL index 76181b9e8c..258edc4db0 100644 --- a/ports/libvorbis/CONTROL +++ b/ports/libvorbis/CONTROL @@ -1,4 +1,4 @@ Source: libvorbis -Version: +Version: 1.3.5-143caf4023a90c09a5eb685fdd46fb9b9c36b1ee Description: Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format. Build-Depends: libogg From 3eccec7231da879a18eb16a318e4309e2f921843 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Jan 2017 15:51:53 -0800 Subject: [PATCH 038/561] [spriv-tools] Add version and description --- ports/spirv-tools/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/spirv-tools/CONTROL b/ports/spirv-tools/CONTROL index 0e1a827060..eacc40ff95 100644 --- a/ports/spirv-tools/CONTROL +++ b/ports/spirv-tools/CONTROL @@ -1,3 +1,3 @@ Source: spirv-tools -Version: -Description: +Version: 1.1-f72189c249ba143c6a89a4cf1e7d53337b2ddd40 +Description: API and commands for processing SPIR-V modules From 6947f0aea15e5e422bf4e972d0e3c4554b76f1dc Mon Sep 17 00:00:00 2001 From: sdcb Date: Sat, 7 Jan 2017 15:21:19 +0800 Subject: [PATCH 039/561] [mongo-c-driver] fix static build --- ports/mongo-c-driver/bson.patch | 24 ++++++++++++++++++++++++ ports/mongo-c-driver/portfile.cmake | 7 +++++++ 2 files changed, 31 insertions(+) create mode 100644 ports/mongo-c-driver/bson.patch diff --git a/ports/mongo-c-driver/bson.patch b/ports/mongo-c-driver/bson.patch new file mode 100644 index 0000000000..83291d6992 --- /dev/null +++ b/ports/mongo-c-driver/bson.patch @@ -0,0 +1,24 @@ +diff --git a/build/cmake/FindBSON.cmake b/build/cmake/FindBSON.cmake +index 4ac39ea..d11aa1f 100644 +--- a/build/cmake/FindBSON.cmake ++++ b/build/cmake/FindBSON.cmake +@@ -12,6 +12,7 @@ endif () + find_path(BSON_INCLUDE_DIR + NAMES + libbson-1.0/bson.h ++ bson.h + HINTS + ${BSON_ROOT_DIR} + ${_BSON_INCLUDEDIR} +@@ -19,7 +20,10 @@ find_path(BSON_INCLUDE_DIR + include + ) + +-set(BSON_INCLUDE_DIR "${BSON_INCLUDE_DIR}/libbson-1.0") ++set(BSON_INCLUDE_DIR "${BSON_INCLUDE_DIR}") ++if (NOT EXISTS ${BSON_INCLUDE_DIR}/bson.h) ++ set(BSON_INCLUDE_DIR "${BSON_INCLUDE_DIR}/libbson-1.0") ++endif() + + if(WIN32 AND NOT CYGWIN) + if(MSVC) diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index 833d7393c2..7061faee56 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -8,10 +8,17 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/bson.patch +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR} + -DBSON_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON From aa964e8d847a093b9a39bf973b915f51e7fcf091 Mon Sep 17 00:00:00 2001 From: sdcb Date: Sat, 7 Jan 2017 15:44:29 +0800 Subject: [PATCH 040/561] set BSON_INCLUDE_DIR is not necessary. --- ports/mongo-c-driver/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index 7061faee56..3d551e0841 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -18,7 +18,6 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR} - -DBSON_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON From 07fb014193d725da008742d38dd94362de30afde Mon Sep 17 00:00:00 2001 From: Patrick Bader Date: Sat, 7 Jan 2017 11:51:07 +0100 Subject: [PATCH 041/561] [sdl2-image] changed include directory to SDL2 include directory --- ports/sdl2-image/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/sdl2-image/CMakeLists.txt b/ports/sdl2-image/CMakeLists.txt index a77662c0ec..e742a408dd 100644 --- a/ports/sdl2-image/CMakeLists.txt +++ b/ports/sdl2-image/CMakeLists.txt @@ -88,7 +88,7 @@ install(TARGETS SDL2_image ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) -install(FILES SDL_image.h DESTINATION include/SDL2_image CONFIGURATIONS Release) +install(FILES SDL_image.h DESTINATION include/SDL2 CONFIGURATIONS Release) message(STATUS "Link-time dependencies:") From 1f63deb204b555046d525d6ecb3b265e2774f4ba Mon Sep 17 00:00:00 2001 From: Guillaume Dumont Date: Mon, 19 Dec 2016 20:51:53 -0500 Subject: [PATCH 042/561] LMDB port --- ports/lmdb/CONTROL | 3 + ports/lmdb/cmake/CMakeLists.txt | 80 + ports/lmdb/cmake/cmake/package-config.cmakein | 13 + ports/lmdb/cmake/cmake/runtest.cmake | 3 + ports/lmdb/cmake/lmdb.def | 58 + ports/lmdb/cmake/lmdbd.def | 58 + ...8275d2a410e683bae4ef44881e0f55fa3c4d.patch | 3932 +++++++++++++++++ ports/lmdb/portfile.cmake | 33 + 8 files changed, 4180 insertions(+) create mode 100644 ports/lmdb/CONTROL create mode 100644 ports/lmdb/cmake/CMakeLists.txt create mode 100644 ports/lmdb/cmake/cmake/package-config.cmakein create mode 100644 ports/lmdb/cmake/cmake/runtest.cmake create mode 100644 ports/lmdb/cmake/lmdb.def create mode 100644 ports/lmdb/cmake/lmdbd.def create mode 100644 ports/lmdb/lmdb_45a88275d2a410e683bae4ef44881e0f55fa3c4d.patch create mode 100644 ports/lmdb/portfile.cmake diff --git a/ports/lmdb/CONTROL b/ports/lmdb/CONTROL new file mode 100644 index 0000000000..bda09ee710 --- /dev/null +++ b/ports/lmdb/CONTROL @@ -0,0 +1,3 @@ +Source: lmdb +Version: 0.9.18-1 +Description: LMDB is an extraordinarily fast, memory-efficient database \ No newline at end of file diff --git a/ports/lmdb/cmake/CMakeLists.txt b/ports/lmdb/cmake/CMakeLists.txt new file mode 100644 index 0000000000..6f63384ead --- /dev/null +++ b/ports/lmdb/cmake/CMakeLists.txt @@ -0,0 +1,80 @@ +cmake_minimum_required(VERSION 2.8) + +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/lmdb.h" VERSION_HEADER) +string(REGEX MATCH ".*MDB_VERSION_MAJOR[ \t]+([0-9])" MAJOR_VERSION_MATCH "${VERSION_HEADER}") +set(LMDB_MAJOR_VERSION ${CMAKE_MATCH_1}) +string(REGEX MATCH ".*MDB_VERSION_MINOR[ \t]+([0-9])" MINOR_VERSION_MATCH "${VERSION_HEADER}") +set(LMDB_MINOR_VERSION ${CMAKE_MATCH_1}) +string(REGEX MATCH ".*MDB_VERSION_PATCH[ \t]+([0-9]+)" PATCH_VERSION_MATCH "${VERSION_HEADER}") +set(LMDB_PATCH_VERSION ${CMAKE_MATCH_1}) + +set(LMDB_VERSION "${LMDB_MAJOR_VERSION}.${LMDB_MINOR_VERSION}.${LMDB_PATCH_VERSION}") + +project(lmdb) + +option(LMDB_BUILD_TOOLS "Build lmdb tools" OFF) +option(LMDB_BUILD_TESTS "Build lmdb tests" OFF) +option(LMDB_INSTALL_HEADERS "Install LMDB header files" ON) +set(LMDB_INCLUDE_INSTALL_DIR include CACHE PATH "Install directory for headers") +set(LMDB_LIBRARY_INSTALL_DIR lib CACHE PATH "Install directory for library") +set(LMDB_RUNTIME_INSTALL_DIR bin CACHE PATH "Install directory for binaries/dlls") +set(LMDB_CONFIG_INSTALL_DIR share/lmdb CACHE PATH "Install directory for cmake config files") + + +if(BUILD_SHARED_LIBS) +set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /DEF:${CMAKE_CURRENT_SOURCE_DIR}/lmdbd.def") +set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /DEF:${CMAKE_CURRENT_SOURCE_DIR}/lmdb.def") +endif() + +set(SRCS lmdb mdb.c lmdb.h midl.c midl.h ) +add_library(lmdb ${SRCS}) +set_target_properties(lmdb PROPERTIES DEBUG_POSTFIX d) +target_link_libraries(lmdb PRIVATE ntdll.lib) + +install(TARGETS lmdb DESTINATION lib + EXPORT lmdb-targets + RUNTIME DESTINATION ${LMDB_RUNTIME_INSTALL_DIR} + LIBRARY DESTINATION ${LMDB_LIBRARY_INSTALL_DIR} + ARCHIVE DESTINATION ${LMDB_LIBRARY_INSTALL_DIR} + ) + +if(LMDB_INSTALL_HEADERS) + install(FILES lmdb.h midl.h DESTINATION ${LMDB_INCLUDE_INSTALL_DIR}) +endif() + +include(CMakePackageConfigHelpers) + +set(INSTALL_INCLUDE_DIR ${LMDB_INCLUDE_INSTALL_DIR}) +configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/package-config.cmakein ${CMAKE_CURRENT_BINARY_DIR}/lmdb-config.cmake + INSTALL_DESTINATION ${LMDB_CONFIG_INSTALL_DIR} + PATH_VARS INSTALL_INCLUDE_DIR + ) + +write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/lmdb-config-version.cmake VERSION ${LMDB_VERSION} COMPATIBILITY SameMajorVersion ) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lmdb-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/lmdb-config-version.cmake + DESTINATION ${LMDB_CONFIG_INSTALL_DIR} ) + + +install(EXPORT lmdb-targets DESTINATION ${LMDB_CONFIG_INSTALL_DIR}) + +if(LMDB_BUILD_TOOLS) + # don't build mdb_dump/load/stat since they will + # not build on windows + foreach(_tool mdb_copy) + add_executable(${_tool} ${_tool}.c) + target_link_libraries(${_tool} lmdb) + endforeach() +endif() + +if(LMDB_BUILD_TESTS) + enable_testing() + # don't use mtest6 since it will only build in static + # build + foreach(_test mtest mtest2 mtest3 mtest4 mtest5) + add_executable(${_test} ${_test}.c) + target_link_libraries(${_test} lmdb) + add_test(NAME ${_test} + COMMAND ${CMAKE_COMMAND} -DTEST=$ ++#include ++#include + + #ifdef __cplusplus + extern "C" { +@@ -172,6 +180,32 @@ typedef int mdb_mode_t; + typedef mode_t mdb_mode_t; + #endif + ++#ifdef _WIN32 ++# define MDB_FMT_Z "I" ++#else ++# define MDB_FMT_Z "z" /**< printf/scanf format modifier for size_t */ ++#endif ++ ++#ifndef MDB_VL32 ++/** Unsigned type used for mapsize, entry counts and page/transaction IDs. ++ * ++ * It is normally size_t, hence the name. Defining MDB_VL32 makes it ++ * uint64_t, but do not try this unless you know what you are doing. ++ */ ++typedef size_t mdb_size_t; ++# define MDB_SIZE_MAX SIZE_MAX /**< max #mdb_size_t */ ++/** #mdb_size_t printf formats, \b t = one of [diouxX] without quotes */ ++# define MDB_PRIy(t) MDB_FMT_Z #t ++/** #mdb_size_t scanf formats, \b t = one of [dioux] without quotes */ ++# define MDB_SCNy(t) MDB_FMT_Z #t ++#else ++typedef uint64_t mdb_size_t; ++# define MDB_SIZE_MAX UINT64_MAX ++# define MDB_PRIy(t) PRI##t##64 ++# define MDB_SCNy(t) SCN##t##64 ++# define mdb_env_create mdb_env_create_vl32 /**< Prevent mixing with non-VL32 builds */ ++#endif ++ + /** An abstraction for a file handle. + * On POSIX systems file handles are small integers. On Windows + * they're opaque pointers. +@@ -194,7 +228,7 @@ typedef int mdb_filehandle_t; + /** Library minor version */ + #define MDB_VERSION_MINOR 9 + /** Library patch version */ +-#define MDB_VERSION_PATCH 18 ++#define MDB_VERSION_PATCH 70 + + /** Combine args a,b,c into a single integer for easy version comparisons */ + #define MDB_VERINT(a,b,c) (((a) << 24) | ((b) << 16) | (c)) +@@ -204,7 +238,7 @@ typedef int mdb_filehandle_t; + MDB_VERINT(MDB_VERSION_MAJOR,MDB_VERSION_MINOR,MDB_VERSION_PATCH) + + /** The release date of this library version */ +-#define MDB_VERSION_DATE "February 5, 2016" ++#define MDB_VERSION_DATE "December 19, 2015" + + /** A stringifier for the version info */ + #define MDB_VERSTR(a,b,c,d) "LMDB " #a "." #b "." #c ": (" d ")" +@@ -306,7 +340,8 @@ typedef void (MDB_rel_func)(MDB_val *item, void *oldptr, void *newptr, void *rel + #define MDB_REVERSEKEY 0x02 + /** use sorted duplicates */ + #define MDB_DUPSORT 0x04 +- /** numeric keys in native byte order: either unsigned int or size_t. ++ /** numeric keys in native byte order, either unsigned int or #mdb_size_t. ++ * (lmdb expects 32-bit int <= size_t <= 32/64-bit mdb_size_t.) + * The keys must all be of the same size. */ + #define MDB_INTEGERKEY 0x08 + /** with #MDB_DUPSORT, sorted dup items have fixed size */ +@@ -383,7 +418,9 @@ typedef enum MDB_cursor_op { + MDB_PREV_NODUP, /**< Position at last data item of previous key */ + MDB_SET, /**< Position at specified key */ + MDB_SET_KEY, /**< Position at specified key, return key + data */ +- MDB_SET_RANGE /**< Position at first key greater than or equal to specified key. */ ++ MDB_SET_RANGE, /**< Position at first key greater than or equal to specified key. */ ++ MDB_PREV_MULTIPLE /**< Position at previous page and return key and up to ++ a page of duplicate data items. Only for #MDB_DUPFIXED */ + } MDB_cursor_op; + + /** @defgroup errors Return Codes +@@ -440,8 +477,10 @@ typedef enum MDB_cursor_op { + #define MDB_BAD_VALSIZE (-30781) + /** The specified DBI was changed unexpectedly */ + #define MDB_BAD_DBI (-30780) ++ /** Unexpected problem - txn should abort */ ++#define MDB_PROBLEM (-30779) + /** The last defined error code */ +-#define MDB_LAST_ERRCODE MDB_BAD_DBI ++#define MDB_LAST_ERRCODE MDB_PROBLEM + /** @} */ + + /** @brief Statistics for a database in the environment */ +@@ -449,18 +488,18 @@ typedef struct MDB_stat { + unsigned int ms_psize; /**< Size of a database page. + This is currently the same for all databases. */ + unsigned int ms_depth; /**< Depth (height) of the B-tree */ +- size_t ms_branch_pages; /**< Number of internal (non-leaf) pages */ +- size_t ms_leaf_pages; /**< Number of leaf pages */ +- size_t ms_overflow_pages; /**< Number of overflow pages */ +- size_t ms_entries; /**< Number of data items */ ++ mdb_size_t ms_branch_pages; /**< Number of internal (non-leaf) pages */ ++ mdb_size_t ms_leaf_pages; /**< Number of leaf pages */ ++ mdb_size_t ms_overflow_pages; /**< Number of overflow pages */ ++ mdb_size_t ms_entries; /**< Number of data items */ + } MDB_stat; + + /** @brief Information about the environment */ + typedef struct MDB_envinfo { + void *me_mapaddr; /**< Address of map, if fixed */ +- size_t me_mapsize; /**< Size of the data memory map */ +- size_t me_last_pgno; /**< ID of the last used page */ +- size_t me_last_txnid; /**< ID of the last committed transaction */ ++ mdb_size_t me_mapsize; /**< Size of the data memory map */ ++ mdb_size_t me_last_pgno; /**< ID of the last used page */ ++ mdb_size_t me_last_txnid; /**< ID of the last committed transaction */ + unsigned int me_maxreaders; /**< max reader slots in the environment */ + unsigned int me_numreaders; /**< max reader slots used in the environment */ + } MDB_envinfo; +@@ -672,6 +711,7 @@ int mdb_env_copyfd(MDB_env *env, mdb_filehandle_t fd); + *
  • #MDB_CP_COMPACT - Perform compaction while copying: omit free + * pages and sequentially renumber all pages in output. This option + * consumes more CPU and runs more slowly than the default. ++ * Currently it fails if the environment has suffered a page leak. + * + * @return A non-zero error value on failure and 0 on success. + */ +@@ -829,7 +869,7 @@ int mdb_env_get_fd(MDB_env *env, mdb_filehandle_t *fd); + * an active write transaction. + * + */ +-int mdb_env_set_mapsize(MDB_env *env, size_t size); ++int mdb_env_set_mapsize(MDB_env *env, mdb_size_t size); + + /** @brief Set the maximum number of threads/reader slots for the environment. + * +@@ -942,6 +982,10 @@ int mdb_env_set_assert(MDB_env *env, MDB_assert_func *func); + *
      + *
    • #MDB_RDONLY + * This transaction will not perform any write operations. ++ *
    • #MDB_NOSYNC ++ * Don't flush system buffers to disk when committing this transaction. ++ *
    • #MDB_NOMETASYNC ++ * Flush system buffers but omit metadata flush when committing this transaction. + *
    + * @param[out] txn Address where the new #MDB_txn handle will be stored + * @return A non-zero error value on failure and 0 on success. Some possible +@@ -974,7 +1018,7 @@ MDB_env *mdb_txn_env(MDB_txn *txn); + * @param[in] txn A transaction handle returned by #mdb_txn_begin() + * @return A transaction ID, valid if input is an active transaction. + */ +-size_t mdb_txn_id(MDB_txn *txn); ++mdb_size_t mdb_txn_id(MDB_txn *txn); + + /** @brief Commit all the operations of a transaction into the database. + * +@@ -1084,7 +1128,8 @@ int mdb_txn_renew(MDB_txn *txn); + * keys must be unique and may have only a single data item. + *
  • #MDB_INTEGERKEY + * Keys are binary integers in native byte order, either unsigned int +- * or size_t, and will be sorted as such. ++ * or #mdb_size_t, and will be sorted as such. ++ * (lmdb expects 32-bit int <= size_t <= 32/64-bit mdb_size_t.) + * The keys must all be of the same size. + *
  • #MDB_DUPFIXED + * This flag may only be used in combination with #MDB_DUPSORT. This option +@@ -1524,7 +1569,7 @@ int mdb_cursor_del(MDB_cursor *cursor, unsigned int flags); + *
  • EINVAL - cursor is not initialized, or an invalid parameter was specified. + * + */ +-int mdb_cursor_count(MDB_cursor *cursor, size_t *countp); ++int mdb_cursor_count(MDB_cursor *cursor, mdb_size_t *countp); + + /** @brief Compare two data items according to a particular database. + * +diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c +index d2e81e4..0110402 100644 +--- a/libraries/liblmdb/mdb.c ++++ b/libraries/liblmdb/mdb.c +@@ -35,9 +35,42 @@ + #ifndef _GNU_SOURCE + #define _GNU_SOURCE 1 + #endif ++#if defined(MDB_VL32) || defined(__WIN64__) ++#define _FILE_OFFSET_BITS 64 ++#endif + #ifdef _WIN32 + #include + #include ++ ++/* We use native NT APIs to setup the memory map, so that we can ++ * let the DB file grow incrementally instead of always preallocating ++ * the full size. These APIs are defined in and ++ * but those headers are meant for driver-level development and ++ * conflict with the regular user-level headers, so we explicitly ++ * declare them here. Using these APIs also means we must link to ++ * ntdll.dll, which is not linked by default in user code. ++ */ ++NTSTATUS WINAPI ++NtCreateSection(OUT PHANDLE sh, IN ACCESS_MASK acc, ++ IN void * oa OPTIONAL, ++ IN PLARGE_INTEGER ms OPTIONAL, ++ IN ULONG pp, IN ULONG aa, IN HANDLE fh OPTIONAL); ++ ++typedef enum _SECTION_INHERIT { ++ ViewShare = 1, ++ ViewUnmap = 2 ++} SECTION_INHERIT; ++ ++NTSTATUS WINAPI ++NtMapViewOfSection(IN PHANDLE sh, IN HANDLE ph, ++ IN OUT PVOID *addr, IN ULONG_PTR zbits, ++ IN SIZE_T cs, IN OUT PLARGE_INTEGER off OPTIONAL, ++ IN OUT PSIZE_T vs, IN SECTION_INHERIT ih, ++ IN ULONG at, IN ULONG pp); ++ ++NTSTATUS WINAPI ++NtClose(HANDLE h); ++ + /** getpid() returns int; MinGW defines pid_t but MinGW64 typedefs it + * as int64 which is wrong. MSVC doesn't define it at all, so just + * don't use it. +@@ -116,7 +149,9 @@ typedef SSIZE_T ssize_t; + #endif + + #if defined(__APPLE__) || defined (BSD) +-# define MDB_USE_POSIX_SEM 1 ++# if !(defined(MDB_USE_POSIX_MUTEX) || defined(MDB_USE_POSIX_SEM)) ++# define MDB_USE_SYSV_SEM 1 ++# endif + # define MDB_FDATASYNC fsync + #elif defined(ANDROID) + # define MDB_FDATASYNC fsync +@@ -127,12 +162,22 @@ typedef SSIZE_T ssize_t; + #ifdef MDB_USE_POSIX_SEM + # define MDB_USE_HASH 1 + #include ++#elif defined(MDB_USE_SYSV_SEM) ++#include ++#include ++#ifdef _SEM_SEMUN_UNDEFINED ++union semun { ++ int val; ++ struct semid_ds *buf; ++ unsigned short *array; ++}; ++#endif /* _SEM_SEMUN_UNDEFINED */ + #else + #define MDB_USE_POSIX_MUTEX 1 +-#endif +-#endif ++#endif /* MDB_USE_POSIX_SEM */ ++#endif /* !_WIN32 */ + +-#if defined(_WIN32) + defined(MDB_USE_POSIX_SEM) \ ++#if defined(_WIN32) + defined(MDB_USE_POSIX_SEM) + defined(MDB_USE_SYSV_SEM) \ + + defined(MDB_USE_POSIX_MUTEX) != 1 + # error "Ambiguous shared-lock implementation" + #endif +@@ -183,7 +228,7 @@ typedef SSIZE_T ssize_t; + + #if (BYTE_ORDER == LITTLE_ENDIAN) == (BYTE_ORDER == BIG_ENDIAN) + # error "Unknown or unsupported endianness (BYTE_ORDER)" +-#elif (-6 & 5) || CHAR_BIT != 8 || UINT_MAX < 0xffffffff || ULONG_MAX % 0xFFFF ++#elif (-6 & 5) || CHAR_BIT!=8 || UINT_MAX!=0xffffffff || MDB_SIZE_MAX%UINT_MAX + # error "Two's complement, reasonably sized integer types, please" + #endif + +@@ -234,6 +279,8 @@ typedef SSIZE_T ssize_t; + #define MDB_NO_ROOT (MDB_LAST_ERRCODE + 10) + #ifdef _WIN32 + #define MDB_OWNERDEAD ((int) WAIT_ABANDONED) ++#elif defined MDB_USE_SYSV_SEM ++#define MDB_OWNERDEAD (MDB_LAST_ERRCODE + 11) + #elif defined(MDB_USE_POSIX_MUTEX) && defined(EOWNERDEAD) + #define MDB_OWNERDEAD EOWNERDEAD /**< #LOCK_MUTEX0() result if dead owner */ + #endif +@@ -256,16 +303,20 @@ typedef SSIZE_T ssize_t; + # define MDB_USE_ROBUST 0 + # else + # define MDB_USE_ROBUST 1 ++# endif ++#endif /* !MDB_USE_ROBUST */ ++ ++#if defined(MDB_USE_POSIX_MUTEX) && (MDB_USE_ROBUST) + /* glibc < 2.12 only provided _np API */ +-# if defined(__GLIBC__) && GLIBC_VER < 0x02000c ++# if (defined(__GLIBC__) && GLIBC_VER < 0x02000c) || \ ++ (defined(PTHREAD_MUTEX_ROBUST_NP) && !defined(PTHREAD_MUTEX_ROBUST)) + # define PTHREAD_MUTEX_ROBUST PTHREAD_MUTEX_ROBUST_NP + # define pthread_mutexattr_setrobust(attr, flag) pthread_mutexattr_setrobust_np(attr, flag) + # define pthread_mutex_consistent(mutex) pthread_mutex_consistent_np(mutex) + # endif +-# endif +-#endif /* MDB_USE_ROBUST */ ++#endif /* MDB_USE_POSIX_MUTEX && MDB_USE_ROBUST */ + +-#if defined(MDB_OWNERDEAD) && MDB_USE_ROBUST ++#if defined(MDB_OWNERDEAD) && (MDB_USE_ROBUST) + #define MDB_ROBUST_SUPPORTED 1 + #endif + +@@ -288,8 +339,10 @@ typedef HANDLE mdb_mutex_t, mdb_mutexref_t; + #define pthread_mutex_lock(x) WaitForSingleObject(*x, INFINITE) + #define pthread_cond_signal(x) SetEvent(*x) + #define pthread_cond_wait(cond,mutex) do{SignalObjectAndWait(*mutex, *cond, INFINITE, FALSE); WaitForSingleObject(*mutex, INFINITE);}while(0) +-#define THREAD_CREATE(thr,start,arg) thr=CreateThread(NULL,0,start,arg,0,NULL) +-#define THREAD_FINISH(thr) WaitForSingleObject(thr, INFINITE) ++#define THREAD_CREATE(thr,start,arg) \ ++ (((thr) = CreateThread(NULL, 0, start, arg, 0, NULL)) ? 0 : ErrCode()) ++#define THREAD_FINISH(thr) \ ++ (WaitForSingleObject(thr, INFINITE) ? ErrCode() : 0) + #define LOCK_MUTEX0(mutex) WaitForSingleObject(mutex, INFINITE) + #define UNLOCK_MUTEX(mutex) ReleaseMutex(mutex) + #define mdb_mutex_consistent(mutex) 0 +@@ -305,12 +358,10 @@ typedef HANDLE mdb_mutex_t, mdb_mutexref_t; + #else + #define MDB_PROCESS_QUERY_LIMITED_INFORMATION 0x1000 + #endif +-#define Z "I" + #else + #define THREAD_RET void * + #define THREAD_CREATE(thr,start,arg) pthread_create(&thr,NULL,start,arg) + #define THREAD_FINISH(thr) pthread_join(thr,NULL) +-#define Z "z" /**< printf format modifier for size_t */ + + /** For MDB_LOCK_FORMAT: True if readers take a pid lock in the lockfile */ + #define MDB_PIDLOCK 1 +@@ -329,12 +380,46 @@ mdb_sem_wait(sem_t *sem) + return rc; + } + ++#elif defined MDB_USE_SYSV_SEM ++ ++typedef struct mdb_mutex { ++ int semid; ++ int semnum; ++ int *locked; ++} mdb_mutex_t[1], *mdb_mutexref_t; ++ ++#define LOCK_MUTEX0(mutex) mdb_sem_wait(mutex) ++#define UNLOCK_MUTEX(mutex) do { \ ++ struct sembuf sb = { 0, 1, SEM_UNDO }; \ ++ sb.sem_num = (mutex)->semnum; \ ++ *(mutex)->locked = 0; \ ++ semop((mutex)->semid, &sb, 1); \ ++} while(0) ++ ++static int ++mdb_sem_wait(mdb_mutexref_t sem) ++{ ++ int rc, *locked = sem->locked; ++ struct sembuf sb = { 0, -1, SEM_UNDO }; ++ sb.sem_num = sem->semnum; ++ do { ++ if (!semop(sem->semid, &sb, 1)) { ++ rc = *locked ? MDB_OWNERDEAD : MDB_SUCCESS; ++ *locked = 1; ++ break; ++ } ++ } while ((rc = errno) == EINTR); ++ return rc; ++} ++ ++#define mdb_mutex_consistent(mutex) 0 ++ + #else /* MDB_USE_POSIX_MUTEX: */ + /** Shared mutex/semaphore as it is stored (mdb_mutex_t), and as + * local variables keep it (mdb_mutexref_t). + * +- * When #mdb_mutexref_t is a pointer declaration and #mdb_mutex_t is +- * not, then it is array[size 1] so it can be assigned to a pointer. ++ * An mdb_mutex_t can be assigned to an mdb_mutexref_t. They can ++ * be the same, or an array[size 1] and a pointer. + * @{ + */ + typedef pthread_mutex_t mdb_mutex_t[1], *mdb_mutexref_t; +@@ -349,7 +434,7 @@ typedef pthread_mutex_t mdb_mutex_t[1], *mdb_mutexref_t; + /** Mark mutex-protected data as repaired, after death of previous owner. + */ + #define mdb_mutex_consistent(mutex) pthread_mutex_consistent(mutex) +-#endif /* MDB_USE_POSIX_SEM */ ++#endif /* MDB_USE_POSIX_SEM || MDB_USE_SYSV_SEM */ + + /** Get the error code for the last failed system function. + */ +@@ -374,12 +459,24 @@ typedef pthread_mutex_t mdb_mutex_t[1], *mdb_mutexref_t; + #define GET_PAGESIZE(x) ((x) = sysconf(_SC_PAGE_SIZE)) + #endif + ++#define Z MDB_FMT_Z /**< printf/scanf format modifier for size_t */ ++#define Yu MDB_PRIy(u) /**< printf format for #mdb_size_t */ ++#define Yd MDB_PRIy(d) /**< printf format for "signed #mdb_size_t" */ ++ + #if defined(_WIN32) || defined(MDB_USE_POSIX_SEM) + #define MNAME_LEN 32 ++#elif defined(MDB_USE_SYSV_SEM) ++#define MNAME_LEN (sizeof(int)) + #else + #define MNAME_LEN (sizeof(pthread_mutex_t)) + #endif + ++#ifdef MDB_USE_SYSV_SEM ++#define SYSV_SEM_FLAG 1 /**< SysV sems in lockfile format */ ++#else ++#define SYSV_SEM_FLAG 0 ++#endif ++ + /** @} */ + + #ifdef MDB_ROBUST_SUPPORTED +@@ -521,7 +618,7 @@ static txnid_t mdb_debug_start; + /** The version number for a database's datafile format. */ + #define MDB_DATA_VERSION ((MDB_DEVEL) ? 999 : 1) + /** The version number for a database's lockfile format. */ +-#define MDB_LOCK_VERSION 1 ++#define MDB_LOCK_VERSION ((MDB_DEVEL) ? 999 : 1) + + /** @brief The max size of a key we can write, or 0 for computed max. + * +@@ -712,6 +809,9 @@ typedef struct MDB_txbody { + uint32_t mtb_format; + #if defined(_WIN32) || defined(MDB_USE_POSIX_SEM) + char mtb_rmname[MNAME_LEN]; ++#elif defined(MDB_USE_SYSV_SEM) ++ int mtb_semid; ++ int mtb_rlocked; + #else + /** Mutex protecting access to this table. + * This is the reader table lock used with LOCK_MUTEX(). +@@ -740,12 +840,19 @@ typedef struct MDB_txninfo { + #define mti_rmname mt1.mtb.mtb_rmname + #define mti_txnid mt1.mtb.mtb_txnid + #define mti_numreaders mt1.mtb.mtb_numreaders ++#ifdef MDB_USE_SYSV_SEM ++#define mti_semid mt1.mtb.mtb_semid ++#define mti_rlocked mt1.mtb.mtb_rlocked ++#endif + char pad[(sizeof(MDB_txbody)+CACHELINE-1) & ~(CACHELINE-1)]; + } mt1; + union { + #if defined(_WIN32) || defined(MDB_USE_POSIX_SEM) + char mt2_wmname[MNAME_LEN]; + #define mti_wmname mt2.mt2_wmname ++#elif defined MDB_USE_SYSV_SEM ++ int mt2_wlocked; ++#define mti_wlocked mt2.mt2_wlocked + #else + mdb_mutex_t mt2_wmutex; + #define mti_wmutex mt2.mt2_wmutex +@@ -760,12 +867,27 @@ typedef struct MDB_txninfo { + ((uint32_t) \ + ((MDB_LOCK_VERSION) \ + /* Flags which describe functionality */ \ ++ + (SYSV_SEM_FLAG << 18) \ + + (((MDB_PIDLOCK) != 0) << 16))) + /** @} */ + +-/** Common header for all page types. +- * Overflow records occupy a number of contiguous pages with no +- * headers on any page after the first. ++/** Common header for all page types. The page type depends on #mp_flags. ++ * ++ * #P_BRANCH and #P_LEAF pages have unsorted '#MDB_node's at the end, with ++ * sorted #mp_ptrs[] entries referring to them. Exception: #P_LEAF2 pages ++ * omit mp_ptrs and pack sorted #MDB_DUPFIXED values after the page header. ++ * ++ * #P_OVERFLOW records occupy one or more contiguous pages where only the ++ * first has a page header. They hold the real data of #F_BIGDATA nodes. ++ * ++ * #P_SUBP sub-pages are small leaf "pages" with duplicate data. ++ * A node with flag #F_DUPDATA but not #F_SUBDATA contains a sub-page. ++ * (Duplicate data can also go in sub-databases, which use normal pages.) ++ * ++ * #P_META pages contain #MDB_meta, the start point of an LMDB snapshot. ++ * ++ * Each non-metapage up to #MDB_meta.%mm_last_pg is reachable exactly once ++ * in the snapshot: Either used by a database or listed in a freeDB record. + */ + typedef struct MDB_page { + #define mp_pgno mp_p.p_pgno +@@ -774,7 +896,7 @@ typedef struct MDB_page { + pgno_t p_pgno; /**< page number */ + struct MDB_page *p_next; /**< for in-memory list of freed pages */ + } mp_p; +- uint16_t mp_pad; ++ uint16_t mp_pad; /**< key size if this is a LEAF2 page */ + /** @defgroup mdb_page Page Flags + * @ingroup internal + * Flags for the page headers. +@@ -841,7 +963,9 @@ typedef struct MDB_page { + /** The number of overflow pages needed to store the given size. */ + #define OVPAGES(size, psize) ((PAGEHDRSZ-1 + (size)) / (psize) + 1) + +- /** Link in #MDB_txn.%mt_loose_pgs list */ ++ /** Link in #MDB_txn.%mt_loose_pgs list. ++ * Kept outside the page header, which is needed when reusing the page. ++ */ + #define NEXT_LOOSE_PAGE(p) (*(MDB_page **)((p) + 2)) + + /** Header for a single key/data pair within a page. +@@ -924,7 +1048,7 @@ typedef struct MDB_node { + #ifdef MISALIGNED_OK + #define COPY_PGNO(dst,src) dst = src + #else +-#if SIZE_MAX > 4294967295UL ++#if MDB_SIZE_MAX > 0xffffffffU + #define COPY_PGNO(dst,src) do { \ + unsigned short *s, *d; \ + s = (unsigned short *)&(src); \ +@@ -965,13 +1089,13 @@ typedef struct MDB_db { + pgno_t md_branch_pages; /**< number of internal pages */ + pgno_t md_leaf_pages; /**< number of leaf pages */ + pgno_t md_overflow_pages; /**< number of overflow pages */ +- size_t md_entries; /**< number of data items */ ++ mdb_size_t md_entries; /**< number of data items */ + pgno_t md_root; /**< the root page of this tree */ + } MDB_db; + +- /** mdb_dbi_open flags */ + #define MDB_VALID 0x8000 /**< DB handle is valid, for me_dbflags */ + #define PERSISTENT_FLAGS (0xffff & ~(MDB_VALID)) ++ /** #mdb_dbi_open() flags */ + #define VALID_FLAGS (MDB_REVERSEKEY|MDB_DUPSORT|MDB_INTEGERKEY|MDB_DUPFIXED|\ + MDB_INTEGERDUP|MDB_REVERSEDUP|MDB_CREATE) + +@@ -995,14 +1119,25 @@ typedef struct MDB_meta { + uint32_t mm_magic; + /** Version number of this file. Must be set to #MDB_DATA_VERSION. */ + uint32_t mm_version; ++#ifdef MDB_VL32 ++ union { /* always zero since we don't support fixed mapping in MDB_VL32 */ ++ MDB_ID mmun_ull; ++ void *mmun_address; ++ } mm_un; ++#define mm_address mm_un.mmun_address ++#else + void *mm_address; /**< address for fixed mapping */ +- size_t mm_mapsize; /**< size of mmap region */ ++#endif ++ pgno_t mm_mapsize; /**< size of mmap region */ + MDB_db mm_dbs[CORE_DBS]; /**< first is free space, 2nd is main db */ + /** The size of pages used in this DB */ + #define mm_psize mm_dbs[FREE_DBI].md_pad + /** Any persistent environment flags. @ref mdb_env */ + #define mm_flags mm_dbs[FREE_DBI].md_flags +- pgno_t mm_last_pg; /**< last used page in file */ ++ /** Last used page in the datafile. ++ * Actually the file may be shorter if the freeDB lists the final pages. ++ */ ++ pgno_t mm_last_pg; + volatile txnid_t mm_txnid; /**< txnid that committed this page */ + } MDB_meta; + +@@ -1039,6 +1174,9 @@ struct MDB_txn { + /** Nested txn under this txn, set together with flag #MDB_TXN_HAS_CHILD */ + MDB_txn *mt_child; + pgno_t mt_next_pgno; /**< next unallocated page */ ++#ifdef MDB_VL32 ++ pgno_t mt_last_pgno; /**< last written page */ ++#endif + /** The ID of this transaction. IDs are integers incrementing from 1. + * Only committed write transactions increment the ID. If a transaction + * aborts, the ID may be re-used by the next writer. +@@ -1052,7 +1190,7 @@ struct MDB_txn { + * in this transaction, linked through #NEXT_LOOSE_PAGE(page). + */ + MDB_page *mt_loose_pgs; +- /* #Number of loose pages (#mt_loose_pgs) */ ++ /** Number of loose pages (#mt_loose_pgs) */ + int mt_loose_count; + /** The sorted list of dirty pages we temporarily wrote to disk + * because the dirty list was full. page numbers in here are +@@ -1085,6 +1223,19 @@ struct MDB_txn { + MDB_cursor **mt_cursors; + /** Array of flags for each DB */ + unsigned char *mt_dbflags; ++#ifdef MDB_VL32 ++ /** List of read-only pages (actually chunks) */ ++ MDB_ID3L mt_rpages; ++ /** We map chunks of 16 pages. Even though Windows uses 4KB pages, all ++ * mappings must begin on 64KB boundaries. So we round off all pgnos to ++ * a chunk boundary. We do the same on Linux for symmetry, and also to ++ * reduce the frequency of mmap/munmap calls. ++ */ ++#define MDB_RPAGE_CHUNK 16 ++#define MDB_TRPAGE_SIZE 4096 /**< size of #mt_rpages array of chunks */ ++#define MDB_TRPAGE_MAX (MDB_TRPAGE_SIZE-1) /**< maximum chunk index */ ++ unsigned int mt_rpcheck; /**< threshold for reclaiming unref'd chunks */ ++#endif + /** Number of DB records in use, or 0 when the txn is finished. + * This number only ever increments until the txn finishes; we + * don't decrement it when individual DB handles are closed. +@@ -1096,7 +1247,9 @@ struct MDB_txn { + * @{ + */ + /** #mdb_txn_begin() flags */ +-#define MDB_TXN_BEGIN_FLAGS MDB_RDONLY ++#define MDB_TXN_BEGIN_FLAGS (MDB_NOMETASYNC|MDB_NOSYNC|MDB_RDONLY) ++#define MDB_TXN_NOMETASYNC MDB_NOMETASYNC /**< don't sync meta for this txn on commit */ ++#define MDB_TXN_NOSYNC MDB_NOSYNC /**< don't sync this txn on commit */ + #define MDB_TXN_RDONLY MDB_RDONLY /**< read-only transaction */ + /* internal txn flags */ + #define MDB_TXN_WRITEMAP MDB_WRITEMAP /**< copy of #MDB_env flag in writers */ +@@ -1162,10 +1315,24 @@ struct MDB_cursor { + #define C_SUB 0x04 /**< Cursor is a sub-cursor */ + #define C_DEL 0x08 /**< last op was a cursor_del */ + #define C_UNTRACK 0x40 /**< Un-track cursor when closing */ ++#define C_WRITEMAP MDB_TXN_WRITEMAP /**< Copy of txn flag */ ++/** Read-only cursor into the txn's original snapshot in the map. ++ * Set for read-only txns, and in #mdb_page_alloc() for #FREE_DBI when ++ * #MDB_DEVEL & 2. Only implements code which is necessary for this. ++ */ ++#define C_ORIG_RDONLY MDB_TXN_RDONLY + /** @} */ + unsigned int mc_flags; /**< @ref mdb_cursor */ + MDB_page *mc_pg[CURSOR_STACK]; /**< stack of pushed pages */ + indx_t mc_ki[CURSOR_STACK]; /**< stack of page indices */ ++#ifdef MDB_VL32 ++ MDB_page *mc_ovpg; /**< a referenced overflow page */ ++# define MC_OVPG(mc) ((mc)->mc_ovpg) ++# define MC_SET_OVPG(mc, pg) ((mc)->mc_ovpg = (pg)) ++#else ++# define MC_OVPG(mc) ((MDB_page *)0) ++# define MC_SET_OVPG(mc, pg) ((void)0) ++#endif + }; + + /** Context for sorted-dup records. +@@ -1195,6 +1362,9 @@ struct MDB_env { + HANDLE me_fd; /**< The main data file */ + HANDLE me_lfd; /**< The lock file */ + HANDLE me_mfd; /**< just for writing the meta pages */ ++#if defined(MDB_VL32) && defined(_WIN32) ++ HANDLE me_fmh; /**< File Mapping handle */ ++#endif + /** Failed to update the meta page. Probably an I/O error. */ + #define MDB_FATAL_ERROR 0x80000000U + /** Some fields are initialized. */ +@@ -1219,7 +1389,7 @@ struct MDB_env { + void *me_pbuf; /**< scratch area for DUPSORT put() */ + MDB_txn *me_txn; /**< current write transaction */ + MDB_txn *me_txn0; /**< prealloc'd write transaction */ +- size_t me_mapsize; /**< size of the data memory map */ ++ mdb_size_t me_mapsize; /**< size of the data memory map */ + off_t me_size; /**< current file size */ + pgno_t me_maxpg; /**< me_mapsize / me_psize */ + MDB_dbx *me_dbxs; /**< array of static DB info */ +@@ -1253,6 +1423,13 @@ struct MDB_env { + mdb_mutex_t me_rmutex; + mdb_mutex_t me_wmutex; + #endif ++#ifdef MDB_VL32 ++ MDB_ID3L me_rpages; /**< like #mt_rpages, but global to env */ ++ pthread_mutex_t me_rpmutex; /**< control access to #me_rpages */ ++#define MDB_ERPAGE_SIZE 16384 ++#define MDB_ERPAGE_MAX (MDB_ERPAGE_SIZE-1) ++ unsigned int me_rpcheck; ++#endif + void *me_userctx; /**< User-settable context */ + MDB_assert_func *me_assert_func; /**< Callback for assertion failures */ + }; +@@ -1298,7 +1475,7 @@ enum { + #define MDB_END_SLOT MDB_NOTLS /**< release any reader slot if #MDB_NOTLS */ + static void mdb_txn_end(MDB_txn *txn, unsigned mode); + +-static int mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **mp, int *lvl); ++static int mdb_page_get(MDB_cursor *mc, pgno_t pgno, MDB_page **mp, int *lvl); + static int mdb_page_search_root(MDB_cursor *mc, + MDB_val *key, int modify); + #define MDB_PS_MODIFY 1 +@@ -1327,7 +1504,7 @@ static int mdb_node_add(MDB_cursor *mc, indx_t indx, + static void mdb_node_del(MDB_cursor *mc, int ksize); + static void mdb_node_shrink(MDB_page *mp, indx_t indx); + static int mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft); +-static int mdb_node_read(MDB_txn *txn, MDB_node *leaf, MDB_val *data); ++static int mdb_node_read(MDB_cursor *mc, MDB_node *leaf, MDB_val *data); + static size_t mdb_leaf_size(MDB_env *env, MDB_val *key, MDB_val *data); + static size_t mdb_branch_size(MDB_env *env, MDB_val *key); + +@@ -1360,13 +1537,18 @@ static int mdb_reader_check0(MDB_env *env, int rlocked, int *dead); + static MDB_cmp_func mdb_cmp_memn, mdb_cmp_memnr, mdb_cmp_int, mdb_cmp_cint, mdb_cmp_long; + /** @endcond */ + +-/** Compare two items pointing at size_t's of unknown alignment. */ ++/** Compare two items pointing at '#mdb_size_t's of unknown alignment. */ + #ifdef MISALIGNED_OK + # define mdb_cmp_clong mdb_cmp_long + #else + # define mdb_cmp_clong mdb_cmp_cint + #endif + ++/** True if we need #mdb_cmp_clong() instead of \b cmp for #MDB_INTEGERDUP */ ++#define NEED_CMP_CLONG(cmp, ksize) \ ++ (UINT_MAX < MDB_SIZE_MAX && \ ++ (cmp) == mdb_cmp_int && (ksize) == sizeof(mdb_size_t)) ++ + #ifdef _WIN32 + static SECURITY_DESCRIPTOR mdb_null_sd; + static SECURITY_ATTRIBUTES mdb_all_sa; +@@ -1407,6 +1589,7 @@ static char *const mdb_errstr[] = { + "MDB_BAD_TXN: Transaction must abort, has a child, or is invalid", + "MDB_BAD_VALSIZE: Unsupported size of key/DB name/data, or wrong DUPFIXED size", + "MDB_BAD_DBI: The specified DBI handle was closed/changed unexpectedly", ++ "MDB_PROBLEM: Unexpected problem - txn should abort", + }; + + char * +@@ -1417,8 +1600,9 @@ mdb_strerror(int err) + * This works as long as no function between the call to mdb_strerror + * and the actual use of the message uses more than 4K of stack. + */ +- char pad[4096]; +- char buf[1024], *ptr = buf; ++#define MSGSIZE 1024 ++#define PADSIZE 4096 ++ char buf[MSGSIZE+PADSIZE], *ptr = buf; + #endif + int i; + if (!err) +@@ -1450,7 +1634,7 @@ mdb_strerror(int err) + buf[0] = 0; + FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, +- NULL, err, 0, ptr, sizeof(buf), (va_list *)pad); ++ NULL, err, 0, ptr, MSGSIZE, (va_list *)buf+MSGSIZE); + return ptr; + #else + return strerror(err); +@@ -1550,20 +1734,20 @@ mdb_page_list(MDB_page *mp) + case P_LEAF|P_LEAF2: type = "LEAF2 page"; break; + case P_LEAF|P_LEAF2|P_SUBP: type = "LEAF2 sub-page"; break; + case P_OVERFLOW: +- fprintf(stderr, "Overflow page %"Z"u pages %u%s\n", ++ fprintf(stderr, "Overflow page %"Yu" pages %u%s\n", + pgno, mp->mp_pages, state); + return; + case P_META: +- fprintf(stderr, "Meta-page %"Z"u txnid %"Z"u\n", ++ fprintf(stderr, "Meta-page %"Yu" txnid %"Yu"\n", + pgno, ((MDB_meta *)METADATA(mp))->mm_txnid); + return; + default: +- fprintf(stderr, "Bad page %"Z"u flags 0x%u\n", pgno, mp->mp_flags); ++ fprintf(stderr, "Bad page %"Yu" flags 0x%X\n", pgno, mp->mp_flags); + return; + } + + nkeys = NUMKEYS(mp); +- fprintf(stderr, "%s %"Z"u numkeys %d%s\n", type, pgno, nkeys, state); ++ fprintf(stderr, "%s %"Yu" numkeys %d%s\n", type, pgno, nkeys, state); + + for (i=0; imn_data; + nsize = NODESIZE + key.mv_size; + if (IS_BRANCH(mp)) { +- fprintf(stderr, "key %d: page %"Z"u, %s\n", i, NODEPGNO(node), ++ fprintf(stderr, "key %d: page %"Yu", %s\n", i, NODEPGNO(node), + DKEY(&key)); + total += nsize; + } else { +@@ -1674,7 +1858,7 @@ static void mdb_audit(MDB_txn *txn) + } + } + if (freecount + count + NUM_METAS != txn->mt_next_pgno) { +- fprintf(stderr, "audit: %lu freecount: %lu count: %lu total: %lu next_pgno: %lu\n", ++ fprintf(stderr, "audit: %"Yu" freecount: %"Yu" count: %"Yu" total: %"Yu" next_pgno: %"Yu"\n", + txn->mt_txnid, freecount, count+NUM_METAS, + freecount+count+NUM_METAS, txn->mt_next_pgno); + } +@@ -1691,10 +1875,8 @@ int + mdb_dcmp(MDB_txn *txn, MDB_dbi dbi, const MDB_val *a, const MDB_val *b) + { + MDB_cmp_func *dcmp = txn->mt_dbxs[dbi].md_dcmp; +-#if UINT_MAX < SIZE_MAX +- if (dcmp == mdb_cmp_int && a->mv_size == sizeof(size_t)) ++ if (NEED_CMP_CLONG(dcmp, a->mv_size)) + dcmp = mdb_cmp_clong; +-#endif + return dcmp(a, b); + } + +@@ -1774,6 +1956,51 @@ mdb_dlist_free(MDB_txn *txn) + dl[0].mid = 0; + } + ++#ifdef MDB_VL32 ++static void ++mdb_page_unref(MDB_txn *txn, MDB_page *mp) ++{ ++ pgno_t pgno; ++ MDB_ID3L tl = txn->mt_rpages; ++ unsigned x, rem; ++ if (mp->mp_flags & (P_SUBP|P_DIRTY)) ++ return; ++ rem = mp->mp_pgno & (MDB_RPAGE_CHUNK-1); ++ pgno = mp->mp_pgno ^ rem; ++ x = mdb_mid3l_search(tl, pgno); ++ if (x != tl[0].mid && tl[x+1].mid == mp->mp_pgno) ++ x++; ++ if (tl[x].mref) ++ tl[x].mref--; ++} ++#define MDB_PAGE_UNREF(txn, mp) mdb_page_unref(txn, mp) ++ ++static void ++mdb_cursor_unref(MDB_cursor *mc) ++{ ++ int i; ++ if (!mc->mc_snum || !mc->mc_pg[0] || IS_SUBP(mc->mc_pg[0])) ++ return; ++ for (i=0; imc_snum; i++) ++ mdb_page_unref(mc->mc_txn, mc->mc_pg[i]); ++ if (mc->mc_ovpg) { ++ mdb_page_unref(mc->mc_txn, mc->mc_ovpg); ++ mc->mc_ovpg = 0; ++ } ++ mc->mc_snum = mc->mc_top = 0; ++ mc->mc_pg[0] = NULL; ++ mc->mc_flags &= ~C_INITIALIZED; ++} ++#define MDB_CURSOR_UNREF(mc, force) \ ++ (((force) || ((mc)->mc_flags & C_INITIALIZED)) \ ++ ? mdb_cursor_unref(mc) \ ++ : (void)0) ++ ++#else ++#define MDB_PAGE_UNREF(txn, mp) ++#define MDB_CURSOR_UNREF(mc, force) ((void)0) ++#endif /* MDB_VL32 */ ++ + /** Loosen or free a single page. + * Saves single pages to a list for future reuse + * in this same txn. It has been pulled from the freeDB +@@ -1803,7 +2030,7 @@ mdb_page_loose(MDB_cursor *mc, MDB_page *mp) + if (mp != dl[x].mptr) { /* bad cursor? */ + mc->mc_flags &= ~(C_INITIALIZED|C_EOF); + txn->mt_flags |= MDB_TXN_ERROR; +- return MDB_CORRUPTED; ++ return MDB_PROBLEM; + } + /* ok, it's ours */ + loose = 1; +@@ -1815,8 +2042,7 @@ mdb_page_loose(MDB_cursor *mc, MDB_page *mp) + } + } + if (loose) { +- DPRINTF(("loosen db %d page %"Z"u", DDBI(mc), +- mp->mp_pgno)); ++ DPRINTF(("loosen db %d page %"Yu, DDBI(mc), mp->mp_pgno)); + NEXT_LOOSE_PAGE(mp) = txn->mt_loose_pgs; + txn->mt_loose_pgs = mp; + txn->mt_loose_count++; +@@ -1842,7 +2068,7 @@ mdb_pages_xkeep(MDB_cursor *mc, unsigned pflags, int all) + { + enum { Mask = P_SUBP|P_DIRTY|P_LOOSE|P_KEEP }; + MDB_txn *txn = mc->mc_txn; +- MDB_cursor *m3; ++ MDB_cursor *m3, *m0 = mc; + MDB_xcursor *mx; + MDB_page *dp, *mp; + MDB_node *leaf; +@@ -1885,7 +2111,7 @@ mdb_pages_xkeep(MDB_cursor *mc, unsigned pflags, int all) + pgno_t pgno = txn->mt_dbs[i].md_root; + if (pgno == P_INVALID) + continue; +- if ((rc = mdb_page_get(txn, pgno, &dp, &level)) != MDB_SUCCESS) ++ if ((rc = mdb_page_get(m0, pgno, &dp, &level)) != MDB_SUCCESS) + break; + if ((dp->mp_flags & Mask) == pflags && level <= 1) + dp->mp_flags ^= P_KEEP; +@@ -2074,6 +2300,8 @@ mdb_page_dirty(MDB_txn *txn, MDB_page *mp) + * Do not modify the freedB, just merge freeDB records into me_pghead[] + * and move me_pglast to say which records were consumed. Only this + * function can create me_pghead and move me_pglast/mt_next_pgno. ++ * When #MDB_DEVEL & 2, it is not affected by #mdb_freelist_save(): it ++ * then uses the transaction's original snapshot of the freeDB. + * @param[in] mc cursor A cursor handle identifying the transaction and + * database for which we are allocating. + * @param[in] num the number of pages to allocate. +@@ -2111,8 +2339,7 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) + np = txn->mt_loose_pgs; + txn->mt_loose_pgs = NEXT_LOOSE_PAGE(np); + txn->mt_loose_count--; +- DPRINTF(("db %d use loose page %"Z"u", DDBI(mc), +- np->mp_pgno)); ++ DPRINTF(("db %d use loose page %"Yu, DDBI(mc), np->mp_pgno)); + *mp = np; + return MDB_SUCCESS; + } +@@ -2149,6 +2376,14 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) + last = env->me_pglast; + oldest = env->me_pgoldest; + mdb_cursor_init(&m2, txn, FREE_DBI, NULL); ++#if (MDB_DEVEL) & 2 /* "& 2" so MDB_DEVEL=1 won't hide bugs breaking freeDB */ ++ /* Use original snapshot. TODO: Should need less care in code ++ * which modifies the database. Maybe we can delete some code? ++ */ ++ m2.mc_flags |= C_ORIG_RDONLY; ++ m2.mc_db = &env->me_metas[(txn->mt_txnid-1) & 1]->mm_dbs[FREE_DBI]; ++ m2.mc_dbflag = (unsigned char *)""; /* probably unnecessary */ ++#endif + if (last) { + op = MDB_SET_RANGE; + key.mv_data = &last; /* will look up last+1 */ +@@ -2189,7 +2424,7 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) + } + np = m2.mc_pg[m2.mc_top]; + leaf = NODEPTR(np, m2.mc_ki[m2.mc_top]); +- if ((rc = mdb_node_read(txn, leaf, &data)) != MDB_SUCCESS) ++ if ((rc = mdb_node_read(&m2, leaf, &data)) != MDB_SUCCESS) + return rc; + + idl = (MDB_ID *) data.mv_data; +@@ -2206,10 +2441,10 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) + } + env->me_pglast = last; + #if (MDB_DEBUG) > 1 +- DPRINTF(("IDL read txn %"Z"u root %"Z"u num %u", ++ DPRINTF(("IDL read txn %"Yu" root %"Yu" num %u", + last, txn->mt_dbs[FREE_DBI].md_root, i)); + for (j = i; j; j--) +- DPRINTF(("IDL %"Z"u", idl[j])); ++ DPRINTF(("IDL %"Yu, idl[j])); + #endif + /* Merge in descending sorted order */ + mdb_midl_xmerge(mop, idl); +@@ -2224,6 +2459,20 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) + rc = MDB_MAP_FULL; + goto fail; + } ++#if defined(_WIN32) && !defined(MDB_VL32) ++ if (!(env->me_flags & MDB_RDONLY)) { ++ void *p; ++ p = (MDB_page *)(env->me_map + env->me_psize * pgno); ++ p = VirtualAlloc(p, env->me_psize * num, MEM_COMMIT, ++ (env->me_flags & MDB_WRITEMAP) ? PAGE_READWRITE: ++ PAGE_READONLY); ++ if (!p) { ++ DPUTS("VirtualAlloc failed"); ++ rc = ErrCode(); ++ goto fail; ++ } ++ } ++#endif + + search_done: + if (env->me_flags & MDB_WRITEMAP) { +@@ -2365,7 +2614,7 @@ mdb_page_touch(MDB_cursor *mc) + (rc = mdb_page_alloc(mc, 1, &np))) + goto fail; + pgno = np->mp_pgno; +- DPRINTF(("touched db %d page %"Z"u -> %"Z"u", DDBI(mc), ++ DPRINTF(("touched db %d page %"Yu" -> %"Yu, DDBI(mc), + mp->mp_pgno, pgno)); + mdb_cassert(mc, mp->mp_pgno != pgno); + mdb_midl_xappend(txn->mt_free_pgs, mp->mp_pgno); +@@ -2389,7 +2638,7 @@ mdb_page_touch(MDB_cursor *mc) + if (mp != dl[x].mptr) { /* bad cursor? */ + mc->mc_flags &= ~(C_INITIALIZED|C_EOF); + txn->mt_flags |= MDB_TXN_ERROR; +- return MDB_CORRUPTED; ++ return MDB_PROBLEM; + } + return 0; + } +@@ -2439,6 +2688,7 @@ done: + } + } + } ++ MDB_PAGE_UNREF(mc->mc_txn, mp); + return 0; + + fail: +@@ -2447,7 +2697,7 @@ fail: + } + + int +-mdb_env_sync(MDB_env *env, int force) ++mdb_env_sync0(MDB_env *env, int force, pgno_t numpgs) + { + int rc = 0; + if (env->me_flags & MDB_RDONLY) +@@ -2456,7 +2706,7 @@ mdb_env_sync(MDB_env *env, int force) + if (env->me_flags & MDB_WRITEMAP) { + int flags = ((env->me_flags & MDB_MAPASYNC) && !force) + ? MS_ASYNC : MS_SYNC; +- if (MDB_MSYNC(env->me_map, env->me_mapsize, flags)) ++ if (MDB_MSYNC(env->me_map, env->me_psize * numpgs, flags)) + rc = ErrCode(); + #ifdef _WIN32 + else if (flags == MS_SYNC && MDB_FDATASYNC(env->me_fd)) +@@ -2476,6 +2726,13 @@ mdb_env_sync(MDB_env *env, int force) + return rc; + } + ++int ++mdb_env_sync(MDB_env *env, int force) ++{ ++ MDB_meta *m = mdb_env_pick_meta(env); ++ return mdb_env_sync0(env, force, m->mm_last_pg+1); ++} ++ + /** Back up parent txn's cursors, then grab the originals for tracking */ + static int + mdb_cursor_shadow(MDB_txn *src, MDB_txn *dst) +@@ -2720,6 +2977,9 @@ mdb_txn_renew0(MDB_txn *txn) + + /* Moved to here to avoid a data race in read TXNs */ + txn->mt_next_pgno = meta->mm_last_pg+1; ++#ifdef MDB_VL32 ++ txn->mt_last_pgno = txn->mt_next_pgno - 1; ++#endif + + txn->mt_flags = flags; + +@@ -2755,7 +3015,7 @@ mdb_txn_renew(MDB_txn *txn) + + rc = mdb_txn_renew0(txn); + if (rc == MDB_SUCCESS) { +- DPRINTF(("renew txn %"Z"u%c %p on mdbenv %p, root page %"Z"u", ++ DPRINTF(("renew txn %"Yu"%c %p on mdbenv %p, root page %"Yu, + txn->mt_txnid, (txn->mt_flags & MDB_TXN_RDONLY) ? 'r' : 'w', + (void *)txn, (void *)txn->mt_env, txn->mt_dbs[MAIN_DBI].md_root)); + } +@@ -2798,6 +3058,17 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret) + DPRINTF(("calloc: %s", strerror(errno))); + return ENOMEM; + } ++#ifdef MDB_VL32 ++ if (!parent) { ++ txn->mt_rpages = malloc(MDB_TRPAGE_SIZE * sizeof(MDB_ID3)); ++ if (!txn->mt_rpages) { ++ free(txn); ++ return ENOMEM; ++ } ++ txn->mt_rpages[0].mid = 0; ++ txn->mt_rpcheck = MDB_TRPAGE_SIZE/2; ++ } ++#endif + txn->mt_dbxs = env->me_dbxs; /* static */ + txn->mt_dbs = (MDB_db *) ((char *)txn + tsize); + txn->mt_dbflags = (unsigned char *)txn + size - env->me_maxdbs; +@@ -2825,6 +3096,9 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret) + parent->mt_child = txn; + txn->mt_parent = parent; + txn->mt_numdbs = parent->mt_numdbs; ++#ifdef MDB_VL32 ++ txn->mt_rpages = parent->mt_rpages; ++#endif + memcpy(txn->mt_dbs, parent->mt_dbs, txn->mt_numdbs * sizeof(MDB_db)); + /* Copy parent's mt_dbflags, but clear DB_NEW */ + for (i=0; imt_numdbs; i++) +@@ -2850,12 +3124,16 @@ renew: + rc = mdb_txn_renew0(txn); + } + if (rc) { +- if (txn != env->me_txn0) ++ if (txn != env->me_txn0) { ++#ifdef MDB_VL32 ++ free(txn->mt_rpages); ++#endif + free(txn); ++ } + } else { + txn->mt_flags |= flags; /* could not change txn=me_txn0 earlier */ + *ret = txn; +- DPRINTF(("begin txn %"Z"u%c %p on mdbenv %p, root page %"Z"u", ++ DPRINTF(("begin txn %"Yu"%c %p on mdbenv %p, root page %"Yu, + txn->mt_txnid, (flags & MDB_RDONLY) ? 'r' : 'w', + (void *) txn, (void *) env, txn->mt_dbs[MAIN_DBI].md_root)); + } +@@ -2870,7 +3148,7 @@ mdb_txn_env(MDB_txn *txn) + return txn->mt_env; + } + +-size_t ++mdb_size_t + mdb_txn_id(MDB_txn *txn) + { + if(!txn) return 0; +@@ -2922,7 +3200,7 @@ mdb_txn_end(MDB_txn *txn, unsigned mode) + /* Export or close DBI handles opened in this txn */ + mdb_dbis_update(txn, mode & MDB_END_UPDATE); + +- DPRINTF(("%s txn %"Z"u%c %p on mdbenv %p, root page %"Z"u", ++ DPRINTF(("%s txn %"Yu"%c %p on mdbenv %p, root page %"Yu, + names[mode & MDB_END_OPMASK], + txn->mt_txnid, (txn->mt_flags & MDB_TXN_RDONLY) ? 'r' : 'w', + (void *) txn, (void *)env, txn->mt_dbs[MAIN_DBI].md_root)); +@@ -2976,7 +3254,31 @@ mdb_txn_end(MDB_txn *txn, unsigned mode) + + mdb_midl_free(pghead); + } +- ++#ifdef MDB_VL32 ++ if (!txn->mt_parent) { ++ MDB_ID3L el = env->me_rpages, tl = txn->mt_rpages; ++ unsigned i, x, n = tl[0].mid; ++ pthread_mutex_lock(&env->me_rpmutex); ++ for (i = 1; i <= n; i++) { ++ if (tl[i].mid & (MDB_RPAGE_CHUNK-1)) { ++ /* tmp overflow pages that we didn't share in env */ ++ munmap(tl[i].mptr, tl[i].mcnt * env->me_psize); ++ } else { ++ x = mdb_mid3l_search(el, tl[i].mid); ++ if (tl[i].mptr == el[x].mptr) { ++ el[x].mref--; ++ } else { ++ /* another tmp overflow page */ ++ munmap(tl[i].mptr, tl[i].mcnt * env->me_psize); ++ } ++ } ++ } ++ pthread_mutex_unlock(&env->me_rpmutex); ++ tl[0].mid = 0; ++ if (mode & MDB_END_FREE) ++ free(tl); ++ } ++#endif + if (mode & MDB_END_FREE) + free(txn); + } +@@ -3008,6 +3310,9 @@ mdb_txn_abort(MDB_txn *txn) + + /** Save the freelist as of this transaction to the freeDB. + * This changes the freelist. Keep trying until it stabilizes. ++ * ++ * When (MDB_DEVEL) & 2, the changes do not affect #mdb_page_alloc(), ++ * it then uses the transaction's original snapshot of the freeDB. + */ + static int + mdb_freelist_save(MDB_txn *txn) +@@ -3096,10 +3401,10 @@ mdb_freelist_save(MDB_txn *txn) + #if (MDB_DEBUG) > 1 + { + unsigned int i = free_pgs[0]; +- DPRINTF(("IDL write txn %"Z"u root %"Z"u num %u", ++ DPRINTF(("IDL write txn %"Yu" root %"Yu" num %u", + txn->mt_txnid, txn->mt_dbs[FREE_DBI].md_root, i)); + for (; i; i--) +- DPRINTF(("IDL %"Z"u", free_pgs[i])); ++ DPRINTF(("IDL %"Yu, free_pgs[i])); + } + #endif + continue; +@@ -3210,15 +3515,16 @@ mdb_page_flush(MDB_txn *txn, int keep) + MDB_ID2L dl = txn->mt_u.dirty_list; + unsigned psize = env->me_psize, j; + int i, pagecount = dl[0].mid, rc; +- size_t size = 0, pos = 0; ++ size_t size = 0; ++ off_t pos = 0; + pgno_t pgno = 0; + MDB_page *dp = NULL; + #ifdef _WIN32 + OVERLAPPED ov; + #else + struct iovec iov[MDB_COMMIT_PAGES]; +- ssize_t wpos = 0, wsize = 0, wres; +- size_t next_pos = 1; /* impossible pos, so pos != next_pos */ ++ ssize_t wsize = 0, wres; ++ off_t wpos = 0, next_pos = 1; /* impossible pos, so pos != next_pos */ + int n = 0; + #endif + +@@ -3266,7 +3572,7 @@ mdb_page_flush(MDB_txn *txn, int keep) + * the write offset, to at least save the overhead of a Seek + * system call. + */ +- DPRINTF(("committing page %"Z"u", pgno)); ++ DPRINTF(("committing page %"Yu, pgno)); + memset(&ov, 0, sizeof(ov)); + ov.Offset = pos & 0xffffffff; + ov.OffsetHigh = pos >> 16 >> 16; +@@ -3317,7 +3623,7 @@ retry_seek: + wpos = pos; + wsize = 0; + } +- DPRINTF(("committing page %"Z"u", pgno)); ++ DPRINTF(("committing page %"Yu, pgno)); + next_pos = pos + size; + iov[n].iov_len = size; + iov[n].iov_base = (char *)dp; +@@ -3325,6 +3631,10 @@ retry_seek: + n++; + #endif /* _WIN32 */ + } ++#ifdef MDB_VL32 ++ if (pgno > txn->mt_last_pgno) ++ txn->mt_last_pgno = pgno; ++#endif + + /* MIPS has cache coherency issues, this is a no-op everywhere else + * Note: for any size >= on-chip cache size, entire on-chip cache is +@@ -3526,7 +3836,7 @@ mdb_txn_commit(MDB_txn *txn) + !(txn->mt_flags & (MDB_TXN_DIRTY|MDB_TXN_SPILLS))) + goto done; + +- DPRINTF(("committing txn %"Z"u %p on mdbenv %p, root page %"Z"u", ++ DPRINTF(("committing txn %"Yu" %p on mdbenv %p, root page %"Yu, + txn->mt_txnid, (void*)txn, (void*)env, txn->mt_dbs[MAIN_DBI].md_root)); + + /* Update DB root pointers */ +@@ -3564,9 +3874,12 @@ mdb_txn_commit(MDB_txn *txn) + mdb_audit(txn); + #endif + +- if ((rc = mdb_page_flush(txn, 0)) || +- (rc = mdb_env_sync(env, 0)) || +- (rc = mdb_env_write_meta(txn))) ++ if ((rc = mdb_page_flush(txn, 0))) ++ goto fail; ++ if (!F_ISSET(txn->mt_flags, MDB_TXN_NOSYNC) && ++ (rc = mdb_env_sync0(env, 0, txn->mt_next_pgno))) ++ goto fail; ++ if ((rc = mdb_env_write_meta(txn))) + goto fail; + end_mode = MDB_END_COMMITTED|MDB_END_UPDATE; + +@@ -3621,7 +3934,7 @@ mdb_env_read_header(MDB_env *env, MDB_meta *meta) + p = (MDB_page *)&pbuf; + + if (!F_ISSET(p->mp_flags, P_META)) { +- DPRINTF(("page %"Z"u not a meta page", p->mp_pgno)); ++ DPRINTF(("page %"Yu" not a meta page", p->mp_pgno)); + return MDB_INVALID; + } + +@@ -3691,7 +4004,6 @@ mdb_env_init_meta(MDB_env *env, MDB_meta *meta) + p = calloc(NUM_METAS, psize); + if (!p) + return ENOMEM; +- + p->mp_pgno = 0; + p->mp_flags = P_META; + *(MDB_meta *)METADATA(p) = *meta; +@@ -3722,7 +4034,7 @@ mdb_env_write_meta(MDB_txn *txn) + MDB_env *env; + MDB_meta meta, metab, *mp; + unsigned flags; +- size_t mapsize; ++ mdb_size_t mapsize; + off_t off; + int rc, len, toggle; + char *ptr; +@@ -3734,11 +4046,11 @@ mdb_env_write_meta(MDB_txn *txn) + #endif + + toggle = txn->mt_txnid & 1; +- DPRINTF(("writing meta page %d for root page %"Z"u", ++ DPRINTF(("writing meta page %d for root page %"Yu, + toggle, txn->mt_dbs[MAIN_DBI].md_root)); + + env = txn->mt_env; +- flags = env->me_flags; ++ flags = txn->mt_flags | env->me_flags; + mp = env->me_metas[toggle]; + mapsize = env->me_metas[toggle ^ 1]->mm_mapsize; + /* Persist any increases of mapsize config */ +@@ -3867,6 +4179,9 @@ mdb_env_create(MDB_env **env) + #ifdef MDB_USE_POSIX_SEM + e->me_rmutex = SEM_FAILED; + e->me_wmutex = SEM_FAILED; ++#elif defined MDB_USE_SYSV_SEM ++ e->me_rmutex->semid = -1; ++ e->me_wmutex->semid = -1; + #endif + e->me_pid = getpid(); + GET_PAGESIZE(e->me_os_psize); +@@ -3875,6 +4190,19 @@ mdb_env_create(MDB_env **env) + return MDB_SUCCESS; + } + ++#ifdef _WIN32 ++/** @brief Map a result from an NTAPI call to WIN32. */ ++static DWORD ++mdb_nt2win32(NTSTATUS st) ++{ ++ OVERLAPPED o = {0}; ++ DWORD br; ++ o.Internal = st; ++ GetOverlappedResult(NULL, &o, &br, FALSE); ++ return GetLastError(); ++} ++#endif ++ + static int ESECT + mdb_env_map(MDB_env *env, void *addr) + { +@@ -3882,42 +4210,51 @@ mdb_env_map(MDB_env *env, void *addr) + unsigned int flags = env->me_flags; + #ifdef _WIN32 + int rc; ++ int access = SECTION_MAP_READ; + HANDLE mh; +- LONG sizelo, sizehi; +- size_t msize; ++ void *map; ++ SIZE_T msize; ++ ULONG pageprot = PAGE_READONLY, secprot, alloctype; + ++ if (flags & MDB_WRITEMAP) { ++ access |= SECTION_MAP_WRITE; ++ pageprot = PAGE_READWRITE; ++ } + if (flags & MDB_RDONLY) { +- /* Don't set explicit map size, use whatever exists */ ++ secprot = PAGE_READONLY; + msize = 0; +- sizelo = 0; +- sizehi = 0; ++ alloctype = 0; + } else { ++ secprot = PAGE_READWRITE; + msize = env->me_mapsize; +- sizelo = msize & 0xffffffff; +- sizehi = msize >> 16 >> 16; /* only needed on Win64 */ +- +- /* Windows won't create mappings for zero length files. +- * and won't map more than the file size. +- * Just set the maxsize right now. +- */ +- if (SetFilePointer(env->me_fd, sizelo, &sizehi, 0) != (DWORD)sizelo +- || !SetEndOfFile(env->me_fd) +- || SetFilePointer(env->me_fd, 0, NULL, 0) != 0) +- return ErrCode(); ++ alloctype = MEM_RESERVE; + } + +- mh = CreateFileMapping(env->me_fd, NULL, flags & MDB_WRITEMAP ? +- PAGE_READWRITE : PAGE_READONLY, +- sizehi, sizelo, NULL); +- if (!mh) +- return ErrCode(); +- env->me_map = MapViewOfFileEx(mh, flags & MDB_WRITEMAP ? +- FILE_MAP_WRITE : FILE_MAP_READ, +- 0, 0, msize, addr); +- rc = env->me_map ? 0 : ErrCode(); +- CloseHandle(mh); ++ rc = NtCreateSection(&mh, access, NULL, NULL, secprot, SEC_RESERVE, env->me_fd); + if (rc) +- return rc; ++ return mdb_nt2win32(rc); ++ map = addr; ++#ifdef MDB_VL32 ++ msize = NUM_METAS * env->me_psize; ++#endif ++ rc = NtMapViewOfSection(mh, GetCurrentProcess(), &map, 0, 0, NULL, &msize, ViewUnmap, alloctype, pageprot); ++#ifdef MDB_VL32 ++ env->me_fmh = mh; ++#else ++ NtClose(mh); ++#endif ++ if (rc) ++ return mdb_nt2win32(rc); ++ env->me_map = map; ++#else ++#ifdef MDB_VL32 ++ (void) flags; ++ env->me_map = mmap(addr, NUM_METAS * env->me_psize, PROT_READ, MAP_SHARED, ++ env->me_fd, 0); ++ if (env->me_map == MAP_FAILED) { ++ env->me_map = NULL; ++ return ErrCode(); ++ } + #else + int prot = PROT_READ; + if (flags & MDB_WRITEMAP) { +@@ -3951,6 +4288,7 @@ mdb_env_map(MDB_env *env, void *addr) + */ + if (addr && env->me_map != addr) + return EBUSY; /* TODO: Make a new MDB_* error code? */ ++#endif + + p = (MDB_page *)env->me_map; + env->me_metas[0] = METADATA(p); +@@ -3960,15 +4298,17 @@ mdb_env_map(MDB_env *env, void *addr) + } + + int ESECT +-mdb_env_set_mapsize(MDB_env *env, size_t size) ++mdb_env_set_mapsize(MDB_env *env, mdb_size_t size) + { + /* If env is already open, caller is responsible for making + * sure there are no active txns. + */ + if (env->me_map) { +- int rc; + MDB_meta *meta; ++#ifndef MDB_VL32 + void *old; ++ int rc; ++#endif + if (env->me_txn) + return EINVAL; + meta = mdb_env_pick_meta(env); +@@ -3976,16 +4316,21 @@ mdb_env_set_mapsize(MDB_env *env, size_t size) + size = meta->mm_mapsize; + { + /* Silently round up to minimum if the size is too small */ +- size_t minsize = (meta->mm_last_pg + 1) * env->me_psize; ++ mdb_size_t minsize = (meta->mm_last_pg + 1) * env->me_psize; + if (size < minsize) + size = minsize; + } ++#ifndef MDB_VL32 ++ /* For MDB_VL32 this bit is a noop since we dynamically remap ++ * chunks of the DB anyway. ++ */ + munmap(env->me_map, env->me_mapsize); + env->me_mapsize = size; + old = (env->me_flags & MDB_FIXEDMAP) ? env->me_map : NULL; + rc = mdb_env_map(env, old); + if (rc) + return rc; ++#endif /* !MDB_VL32 */ + } + env->me_mapsize = size; + if (env->me_psize) +@@ -4021,7 +4366,7 @@ mdb_env_get_maxreaders(MDB_env *env, unsigned int *readers) + } + + static int ESECT +-mdb_fsize(HANDLE fd, size_t *size) ++mdb_fsize(HANDLE fd, mdb_size_t *size) + { + #ifdef _WIN32 + LARGE_INTEGER fsize; +@@ -4135,7 +4480,7 @@ mdb_env_open2(MDB_env *env) + /* Make sure mapsize >= committed data size. Even when using + * mm_mapsize, which could be broken in old files (ITS#7789). + */ +- size_t minsize = (meta.mm_last_pg + 1) * meta.mm_psize; ++ mdb_size_t minsize = (meta.mm_last_pg + 1) * meta.mm_psize; + if (env->me_mapsize < minsize) + env->me_mapsize = minsize; + } +@@ -4154,6 +4499,18 @@ mdb_env_open2(MDB_env *env) + return rc; + newenv = 0; + } ++#ifdef _WIN32 ++ /* For FIXEDMAP, make sure the file is non-empty before we attempt to map it */ ++ if (newenv) { ++ char dummy = 0; ++ DWORD len; ++ rc = WriteFile(env->me_fd, &dummy, 1, &len, NULL); ++ if (!rc) { ++ rc = ErrCode(); ++ return rc; ++ } ++ } ++#endif + + rc = mdb_env_map(env, (flags & MDB_FIXEDMAP) ? meta.mm_address : NULL); + if (rc) +@@ -4183,13 +4540,13 @@ mdb_env_open2(MDB_env *env) + + DPRINTF(("opened database version %u, pagesize %u", + meta->mm_version, env->me_psize)); +- DPRINTF(("using meta page %d", (int) (meta->mm_txnid & 1))); +- DPRINTF(("depth: %u", db->md_depth)); +- DPRINTF(("entries: %"Z"u", db->md_entries)); +- DPRINTF(("branch pages: %"Z"u", db->md_branch_pages)); +- DPRINTF(("leaf pages: %"Z"u", db->md_leaf_pages)); +- DPRINTF(("overflow pages: %"Z"u", db->md_overflow_pages)); +- DPRINTF(("root: %"Z"u", db->md_root)); ++ DPRINTF(("using meta page %d", (int) (meta->mm_txnid & 1))); ++ DPRINTF(("depth: %u", db->md_depth)); ++ DPRINTF(("entries: %"Yu, db->md_entries)); ++ DPRINTF(("branch pages: %"Yu, db->md_branch_pages)); ++ DPRINTF(("leaf pages: %"Yu, db->md_leaf_pages)); ++ DPRINTF(("overflow pages: %"Yu, db->md_overflow_pages)); ++ DPRINTF(("root: %"Yu, db->md_root)); + } + #endif + +@@ -4465,6 +4822,10 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) + # define MDB_CLOEXEC 0 + #endif + #endif ++#ifdef MDB_USE_SYSV_SEM ++ int semid; ++ union semun semu; ++#endif + int rc; + off_t size, rsize; + +@@ -4616,19 +4977,42 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) + env->me_wmutex = sem_open(env->me_txns->mti_wmname, + O_CREAT|O_EXCL, mode, 1); + if (env->me_wmutex == SEM_FAILED) goto fail_errno; ++#elif defined(MDB_USE_SYSV_SEM) ++ unsigned short vals[2] = {1, 1}; ++ key_t key = ftok(lpath, 'M'); ++ if (key == -1) ++ goto fail_errno; ++ semid = semget(key, 2, (mode & 0777) | IPC_CREAT); ++ if (semid < 0) ++ goto fail_errno; ++ semu.array = vals; ++ if (semctl(semid, 0, SETALL, semu) < 0) ++ goto fail_errno; ++ env->me_txns->mti_semid = semid; ++ env->me_txns->mti_rlocked = 0; ++ env->me_txns->mti_wlocked = 0; + #else /* MDB_USE_POSIX_MUTEX: */ + pthread_mutexattr_t mattr; + +- if ((rc = pthread_mutexattr_init(&mattr)) +- || (rc = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED)) ++ /* Solaris needs this before initing a robust mutex. Otherwise ++ * it may skip the init and return EBUSY "seems someone already ++ * inited" or EINVAL "it was inited differently". ++ */ ++ memset(env->me_txns->mti_rmutex, 0, sizeof(*env->me_txns->mti_rmutex)); ++ memset(env->me_txns->mti_wmutex, 0, sizeof(*env->me_txns->mti_wmutex)); ++ ++ if ((rc = pthread_mutexattr_init(&mattr)) != 0) ++ goto fail; ++ rc = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED); + #ifdef MDB_ROBUST_SUPPORTED +- || (rc = pthread_mutexattr_setrobust(&mattr, PTHREAD_MUTEX_ROBUST)) ++ if (!rc) rc = pthread_mutexattr_setrobust(&mattr, PTHREAD_MUTEX_ROBUST); + #endif +- || (rc = pthread_mutex_init(env->me_txns->mti_rmutex, &mattr)) +- || (rc = pthread_mutex_init(env->me_txns->mti_wmutex, &mattr))) +- goto fail; ++ if (!rc) rc = pthread_mutex_init(env->me_txns->mti_rmutex, &mattr); ++ if (!rc) rc = pthread_mutex_init(env->me_txns->mti_wmutex, &mattr); + pthread_mutexattr_destroy(&mattr); +-#endif /* _WIN32 || MDB_USE_POSIX_SEM */ ++ if (rc) ++ goto fail; ++#endif /* _WIN32 || ... */ + + env->me_txns->mti_magic = MDB_MAGIC; + env->me_txns->mti_format = MDB_LOCK_FORMAT; +@@ -4636,6 +5020,9 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) + env->me_txns->mti_numreaders = 0; + + } else { ++#ifdef MDB_USE_SYSV_SEM ++ struct semid_ds buf; ++#endif + if (env->me_txns->mti_magic != MDB_MAGIC) { + DPUTS("lock region has invalid magic"); + rc = MDB_INVALID; +@@ -4661,8 +5048,33 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) + if (env->me_rmutex == SEM_FAILED) goto fail_errno; + env->me_wmutex = sem_open(env->me_txns->mti_wmname, 0); + if (env->me_wmutex == SEM_FAILED) goto fail_errno; ++#elif defined(MDB_USE_SYSV_SEM) ++ semid = env->me_txns->mti_semid; ++ semu.buf = &buf; ++ /* check for read access */ ++ if (semctl(semid, 0, IPC_STAT, semu) < 0) ++ goto fail_errno; ++ /* check for write access */ ++ if (semctl(semid, 0, IPC_SET, semu) < 0) ++ goto fail_errno; + #endif + } ++#ifdef MDB_USE_SYSV_SEM ++ env->me_rmutex->semid = semid; ++ env->me_wmutex->semid = semid; ++ env->me_rmutex->semnum = 0; ++ env->me_wmutex->semnum = 1; ++ env->me_rmutex->locked = &env->me_txns->mti_rlocked; ++ env->me_wmutex->locked = &env->me_txns->mti_wlocked; ++#endif ++#ifdef MDB_VL32 ++#ifdef _WIN32 ++ env->me_rpmutex = CreateMutex(NULL, FALSE, NULL); ++#else ++ pthread_mutex_init(&env->me_rpmutex, NULL); ++#endif ++#endif ++ + return MDB_SUCCESS; + + fail_errno: +@@ -4701,6 +5113,17 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode + if (env->me_fd!=INVALID_HANDLE_VALUE || (flags & ~(CHANGEABLE|CHANGELESS))) + return EINVAL; + ++#ifdef MDB_VL32 ++ if (flags & MDB_WRITEMAP) { ++ /* silently ignore WRITEMAP in 32 bit mode */ ++ flags ^= MDB_WRITEMAP; ++ } ++ if (flags & MDB_FIXEDMAP) { ++ /* cannot support FIXEDMAP */ ++ return EINVAL; ++ } ++#endif ++ + len = strlen(path); + if (flags & MDB_NOSUBDIR) { + rc = len + sizeof(LOCKSUFF) + len + 1; +@@ -4730,6 +5153,17 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode + (env->me_dirty_list = calloc(MDB_IDL_UM_SIZE, sizeof(MDB_ID2))))) + rc = ENOMEM; + } ++#ifdef MDB_VL32 ++ if (!rc) { ++ env->me_rpages = malloc(MDB_ERPAGE_SIZE * sizeof(MDB_ID3)); ++ if (!env->me_rpages) { ++ rc = ENOMEM; ++ goto leave; ++ } ++ env->me_rpages[0].mid = 0; ++ env->me_rpcheck = MDB_ERPAGE_SIZE/2; ++ } ++#endif + env->me_flags = flags |= MDB_ENV_ACTIVE; + if (rc) + goto leave; +@@ -4828,6 +5262,16 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode + txn->mt_dbiseqs = (unsigned int *)(txn->mt_cursors + env->me_maxdbs); + txn->mt_dbflags = (unsigned char *)(txn->mt_dbiseqs + env->me_maxdbs); + txn->mt_env = env; ++#ifdef MDB_VL32 ++ txn->mt_rpages = malloc(MDB_TRPAGE_SIZE * sizeof(MDB_ID3)); ++ if (!txn->mt_rpages) { ++ free(txn); ++ rc = ENOMEM; ++ goto leave; ++ } ++ txn->mt_rpages[0].mid = 0; ++ txn->mt_rpcheck = MDB_TRPAGE_SIZE/2; ++#endif + txn->mt_dbxs = env->me_dbxs; + txn->mt_flags = MDB_TXN_FINISHED; + env->me_txn0 = txn; +@@ -4866,6 +5310,15 @@ mdb_env_close0(MDB_env *env, int excl) + free(env->me_dbflags); + free(env->me_path); + free(env->me_dirty_list); ++#ifdef MDB_VL32 ++ if (env->me_txn0 && env->me_txn0->mt_rpages) ++ free(env->me_txn0->mt_rpages); ++ { unsigned int x; ++ for (x=1; x<=env->me_rpages[0].mid; x++) ++ munmap(env->me_rpages[x].mptr, env->me_rpages[x].mcnt * env->me_psize); ++ } ++ free(env->me_rpages); ++#endif + free(env->me_txn0); + mdb_midl_free(env->me_free_pgs); + +@@ -4883,7 +5336,11 @@ mdb_env_close0(MDB_env *env, int excl) + } + + if (env->me_map) { ++#ifdef MDB_VL32 ++ munmap(env->me_map, NUM_METAS*env->me_psize); ++#else + munmap(env->me_map, env->me_mapsize); ++#endif + } + if (env->me_mfd != env->me_fd && env->me_mfd != INVALID_HANDLE_VALUE) + (void) close(env->me_mfd); +@@ -4924,6 +5381,16 @@ mdb_env_close0(MDB_env *env, int excl) + sem_unlink(env->me_txns->mti_wmname); + } + } ++#elif defined(MDB_USE_SYSV_SEM) ++ if (env->me_rmutex->semid != -1) { ++ /* If we have the filelock: If we are the ++ * only remaining user, clean up semaphores. ++ */ ++ if (excl == 0) ++ mdb_env_excl_lock(env, &excl); ++ if (excl > 0) ++ semctl(env->me_rmutex->semid, 0, IPC_RMID); ++ } + #endif + munmap((void *)env->me_txns, (env->me_maxreaders-1)*sizeof(MDB_reader)+sizeof(MDB_txninfo)); + } +@@ -4938,6 +5405,14 @@ mdb_env_close0(MDB_env *env, int excl) + #endif + (void) close(env->me_lfd); + } ++#ifdef MDB_VL32 ++#ifdef _WIN32 ++ if (env->me_fmh) CloseHandle(env->me_fmh); ++ if (env->me_rpmutex) CloseHandle(env->me_rpmutex); ++#else ++ pthread_mutex_destroy(&env->me_rpmutex); ++#endif ++#endif + + env->me_flags &= ~(MDB_ENV_ACTIVE|MDB_ENV_TXKEY); + } +@@ -4961,18 +5436,18 @@ mdb_env_close(MDB_env *env) + free(env); + } + +-/** Compare two items pointing at aligned size_t's */ ++/** Compare two items pointing at aligned #mdb_size_t's */ + static int + mdb_cmp_long(const MDB_val *a, const MDB_val *b) + { +- return (*(size_t *)a->mv_data < *(size_t *)b->mv_data) ? -1 : +- *(size_t *)a->mv_data > *(size_t *)b->mv_data; ++ return (*(mdb_size_t *)a->mv_data < *(mdb_size_t *)b->mv_data) ? -1 : ++ *(mdb_size_t *)a->mv_data > *(mdb_size_t *)b->mv_data; + } + + /** Compare two items pointing at aligned unsigned int's. + * + * This is also set as #MDB_INTEGERDUP|#MDB_DUPFIXED's #MDB_dbx.%md_dcmp, +- * but #mdb_cmp_clong() is called instead if the data type is size_t. ++ * but #mdb_cmp_clong() is called instead if the data type is #mdb_size_t. + */ + static int + mdb_cmp_int(const MDB_val *a, const MDB_val *b) +@@ -5077,7 +5552,7 @@ mdb_node_search(MDB_cursor *mc, MDB_val *key, int *exactp) + + nkeys = NUMKEYS(mp); + +- DPRINTF(("searching %u keys in %s %spage %"Z"u", ++ DPRINTF(("searching %u keys in %s %spage %"Yu, + nkeys, IS_LEAF(mp) ? "leaf" : "branch", IS_SUBP(mp) ? "sub-" : "", + mdb_dbg_pgno(mp))); + +@@ -5089,7 +5564,7 @@ mdb_node_search(MDB_cursor *mc, MDB_val *key, int *exactp) + * alignment is guaranteed. Use faster mdb_cmp_int. + */ + if (cmp == mdb_cmp_cint && IS_BRANCH(mp)) { +- if (NODEPTR(mp, 1)->mn_ksize == sizeof(size_t)) ++ if (NODEPTR(mp, 1)->mn_ksize == sizeof(mdb_size_t)) + cmp = mdb_cmp_long; + else + cmp = mdb_cmp_int; +@@ -5125,7 +5600,7 @@ mdb_node_search(MDB_cursor *mc, MDB_val *key, int *exactp) + DPRINTF(("found leaf index %u [%s], rc = %i", + i, DKEY(&nodekey), rc)); + else +- DPRINTF(("found branch index %u [%s -> %"Z"u], rc = %i", ++ DPRINTF(("found branch index %u [%s -> %"Yu"], rc = %i", + i, DKEY(&nodekey), NODEPGNO(node), rc)); + #endif + if (rc == 0) +@@ -5173,7 +5648,7 @@ static void + mdb_cursor_pop(MDB_cursor *mc) + { + if (mc->mc_snum) { +- DPRINTF(("popping page %"Z"u off db %d cursor %p", ++ DPRINTF(("popping page %"Yu" off db %d cursor %p", + mc->mc_pg[mc->mc_top]->mp_pgno, DDBI(mc), (void *) mc)); + + mc->mc_snum--; +@@ -5189,7 +5664,7 @@ mdb_cursor_pop(MDB_cursor *mc) + static int + mdb_cursor_push(MDB_cursor *mc, MDB_page *mp) + { +- DPRINTF(("pushing page %"Z"u on db %d cursor %p", mp->mp_pgno, ++ DPRINTF(("pushing page %"Yu" on db %d cursor %p", mp->mp_pgno, + DDBI(mc), (void *) mc)); + + if (mc->mc_snum >= CURSOR_STACK) { +@@ -5204,21 +5679,309 @@ mdb_cursor_push(MDB_cursor *mc, MDB_page *mp) + return MDB_SUCCESS; + } + +-/** Find the address of the page corresponding to a given page number. ++#ifdef MDB_VL32 ++/** Map a read-only page. ++ * There are two levels of tracking in use, a per-txn list and a per-env list. ++ * ref'ing and unref'ing the per-txn list is faster since it requires no ++ * locking. Pages are cached in the per-env list for global reuse, and a lock ++ * is required. Pages are not immediately unmapped when their refcnt goes to ++ * zero; they hang around in case they will be reused again soon. ++ * ++ * When the per-txn list gets full, all pages with refcnt=0 are purged from the ++ * list and their refcnts in the per-env list are decremented. ++ * ++ * When the per-env list gets full, all pages with refcnt=0 are purged from the ++ * list and their pages are unmapped. ++ * ++ * @note "full" means the list has reached its respective rpcheck threshold. ++ * This threshold slowly raises if no pages could be purged on a given check, ++ * and returns to its original value when enough pages were purged. ++ * ++ * If purging doesn't free any slots, filling the per-txn list will return ++ * MDB_TXN_FULL, and filling the per-env list returns MDB_MAP_FULL. ++ * ++ * Reference tracking in a txn is imperfect, pages can linger with non-zero ++ * refcnt even without active references. It was deemed to be too invasive ++ * to add unrefs in every required location. However, all pages are unref'd ++ * at the end of the transaction. This guarantees that no stale references ++ * linger in the per-env list. ++ * ++ * Usually we map chunks of 16 pages at a time, but if an overflow page begins ++ * at the tail of the chunk we extend the chunk to include the entire overflow ++ * page. Unfortunately, pages can be turned into overflow pages after their ++ * chunk was already mapped. In that case we must remap the chunk if the ++ * overflow page is referenced. If the chunk's refcnt is 0 we can just remap ++ * it, otherwise we temporarily map a new chunk just for the overflow page. ++ * ++ * @note this chunk handling means we cannot guarantee that a data item ++ * returned from the DB will stay alive for the duration of the transaction: ++ * We unref pages as soon as a cursor moves away from the page ++ * A subsequent op may cause a purge, which may unmap any unref'd chunks ++ * The caller must copy the data if it must be used later in the same txn. ++ * ++ * Also - our reference counting revolves around cursors, but overflow pages ++ * aren't pointed to by a cursor's page stack. We have to remember them ++ * explicitly, in the added mc_ovpg field. A single cursor can only hold a ++ * reference to one overflow page at a time. ++ * + * @param[in] txn the transaction for this access. + * @param[in] pgno the page number for the page to retrieve. + * @param[out] ret address of a pointer where the page's address will be stored. +- * @param[out] lvl dirty_list inheritance level of found page. 1=current txn, 0=mapped page. + * @return 0 on success, non-zero on failure. + */ + static int +-mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl) ++mdb_rpage_get(MDB_txn *txn, pgno_t pg0, MDB_page **ret) + { + MDB_env *env = txn->mt_env; ++ MDB_page *p; ++ MDB_ID3L tl = txn->mt_rpages; ++ MDB_ID3L el = env->me_rpages; ++ MDB_ID3 id3; ++ unsigned x, rem; ++ pgno_t pgno; ++ int rc, retries = 1; ++#ifdef _WIN32 ++ LARGE_INTEGER off; ++ SIZE_T len; ++#define SET_OFF(off,val) off.QuadPart = val ++#define MAP(rc,env,addr,len,off) \ ++ addr = NULL; \ ++ rc = NtMapViewOfSection(env->me_fmh, GetCurrentProcess(), &addr, 0, \ ++ len, &off, &len, ViewUnmap, (env->me_flags & MDB_RDONLY) ? 0 : MEM_RESERVE, PAGE_READONLY); \ ++ if (rc) rc = mdb_nt2win32(rc) ++#else ++ off_t off; ++ size_t len; ++#define SET_OFF(off,val) off = val ++#define MAP(rc,env,addr,len,off) \ ++ addr = mmap(NULL, len, PROT_READ, MAP_SHARED, env->me_fd, off); \ ++ rc = (addr == MAP_FAILED) ? errno : 0 ++#endif ++ ++ /* remember the offset of the actual page number, so we can ++ * return the correct pointer at the end. ++ */ ++ rem = pg0 & (MDB_RPAGE_CHUNK-1); ++ pgno = pg0 ^ rem; ++ ++ id3.mid = 0; ++ x = mdb_mid3l_search(tl, pgno); ++ if (x <= tl[0].mid && tl[x].mid == pgno) { ++ if (x != tl[0].mid && tl[x+1].mid == pg0) ++ x++; ++ /* check for overflow size */ ++ p = (MDB_page *)((char *)tl[x].mptr + rem * env->me_psize); ++ if (IS_OVERFLOW(p) && p->mp_pages + rem > tl[x].mcnt) { ++ id3.mcnt = p->mp_pages + rem; ++ len = id3.mcnt * env->me_psize; ++ SET_OFF(off, pgno * env->me_psize); ++ MAP(rc, env, id3.mptr, len, off); ++ if (rc) ++ return rc; ++ /* check for local-only page */ ++ if (rem) { ++ mdb_tassert(txn, tl[x].mid != pg0); ++ /* hope there's room to insert this locally. ++ * setting mid here tells later code to just insert ++ * this id3 instead of searching for a match. ++ */ ++ id3.mid = pg0; ++ goto notlocal; ++ } else { ++ /* ignore the mapping we got from env, use new one */ ++ tl[x].mptr = id3.mptr; ++ tl[x].mcnt = id3.mcnt; ++ /* if no active ref, see if we can replace in env */ ++ if (!tl[x].mref) { ++ unsigned i; ++ pthread_mutex_lock(&env->me_rpmutex); ++ i = mdb_mid3l_search(el, tl[x].mid); ++ if (el[i].mref == 1) { ++ /* just us, replace it */ ++ munmap(el[i].mptr, el[i].mcnt * env->me_psize); ++ el[i].mptr = tl[x].mptr; ++ el[i].mcnt = tl[x].mcnt; ++ } else { ++ /* there are others, remove ourself */ ++ el[i].mref--; ++ } ++ pthread_mutex_unlock(&env->me_rpmutex); ++ } ++ } ++ } ++ id3.mptr = tl[x].mptr; ++ id3.mcnt = tl[x].mcnt; ++ tl[x].mref++; ++ goto ok; ++ } ++ ++notlocal: ++ if (tl[0].mid >= MDB_TRPAGE_MAX - txn->mt_rpcheck) { ++ unsigned i, y; ++ /* purge unref'd pages from our list and unref in env */ ++ pthread_mutex_lock(&env->me_rpmutex); ++retry: ++ y = 0; ++ for (i=1; i<=tl[0].mid; i++) { ++ if (!tl[i].mref) { ++ if (!y) y = i; ++ /* tmp overflow pages don't go to env */ ++ if (tl[i].mid & (MDB_RPAGE_CHUNK-1)) { ++ munmap(tl[i].mptr, tl[i].mcnt * env->me_psize); ++ continue; ++ } ++ x = mdb_mid3l_search(el, tl[i].mid); ++ el[x].mref--; ++ } ++ } ++ pthread_mutex_unlock(&env->me_rpmutex); ++ if (!y) { ++ /* we didn't find any unref'd chunks. ++ * if we're out of room, fail. ++ */ ++ if (tl[0].mid >= MDB_TRPAGE_MAX) ++ return MDB_TXN_FULL; ++ /* otherwise, raise threshold for next time around ++ * and let this go. ++ */ ++ txn->mt_rpcheck /= 2; ++ } else { ++ /* we found some unused; consolidate the list */ ++ for (i=y+1; i<= tl[0].mid; i++) ++ if (tl[i].mref) ++ tl[y++] = tl[i]; ++ tl[0].mid = y-1; ++ /* decrease the check threshold toward its original value */ ++ if (!txn->mt_rpcheck) ++ txn->mt_rpcheck = 1; ++ while (txn->mt_rpcheck < tl[0].mid && txn->mt_rpcheck < MDB_TRPAGE_SIZE/2) ++ txn->mt_rpcheck *= 2; ++ } ++ } ++ if (tl[0].mid < MDB_TRPAGE_SIZE) { ++ id3.mref = 1; ++ if (id3.mid) ++ goto found; ++ /* don't map past last written page in read-only envs */ ++ if ((env->me_flags & MDB_RDONLY) && pgno + MDB_RPAGE_CHUNK-1 > txn->mt_last_pgno) ++ id3.mcnt = txn->mt_last_pgno + 1 - pgno; ++ else ++ id3.mcnt = MDB_RPAGE_CHUNK; ++ len = id3.mcnt * env->me_psize; ++ id3.mid = pgno; ++ ++ /* search for page in env */ ++ pthread_mutex_lock(&env->me_rpmutex); ++ x = mdb_mid3l_search(el, pgno); ++ if (x <= el[0].mid && el[x].mid == pgno) { ++ id3.mptr = el[x].mptr; ++ id3.mcnt = el[x].mcnt; ++ /* check for overflow size */ ++ p = (MDB_page *)((char *)id3.mptr + rem * env->me_psize); ++ if (IS_OVERFLOW(p) && p->mp_pages + rem > id3.mcnt) { ++ id3.mcnt = p->mp_pages + rem; ++ len = id3.mcnt * env->me_psize; ++ SET_OFF(off, pgno * env->me_psize); ++ MAP(rc, env, id3.mptr, len, off); ++ if (rc) ++ goto fail; ++ if (!el[x].mref) { ++ munmap(el[x].mptr, env->me_psize * el[x].mcnt); ++ el[x].mptr = id3.mptr; ++ el[x].mcnt = id3.mcnt; ++ } else { ++ id3.mid = pg0; ++ pthread_mutex_unlock(&env->me_rpmutex); ++ goto found; ++ } ++ } ++ el[x].mref++; ++ pthread_mutex_unlock(&env->me_rpmutex); ++ goto found; ++ } ++ if (el[0].mid >= MDB_ERPAGE_MAX - env->me_rpcheck) { ++ /* purge unref'd pages */ ++ unsigned i, y = 0; ++ for (i=1; i<=el[0].mid; i++) { ++ if (!el[i].mref) { ++ if (!y) y = i; ++ munmap(el[i].mptr, env->me_psize * el[i].mcnt); ++ } ++ } ++ if (!y) { ++ if (retries) { ++ /* see if we can unref some local pages */ ++ retries--; ++ id3.mid = 0; ++ goto retry; ++ } ++ if (el[0].mid >= MDB_ERPAGE_MAX) { ++ pthread_mutex_unlock(&env->me_rpmutex); ++ return MDB_MAP_FULL; ++ } ++ env->me_rpcheck /= 2; ++ } else { ++ for (i=y+1; i<= el[0].mid; i++) ++ if (el[i].mref) ++ el[y++] = el[i]; ++ el[0].mid = y-1; ++ if (!env->me_rpcheck) ++ env->me_rpcheck = 1; ++ while (env->me_rpcheck < el[0].mid && env->me_rpcheck < MDB_ERPAGE_SIZE/2) ++ env->me_rpcheck *= 2; ++ } ++ } ++ SET_OFF(off, pgno * env->me_psize); ++ MAP(rc, env, id3.mptr, len, off); ++ if (rc) { ++fail: ++ pthread_mutex_unlock(&env->me_rpmutex); ++ return rc; ++ } ++ /* check for overflow size */ ++ p = (MDB_page *)((char *)id3.mptr + rem * env->me_psize); ++ if (IS_OVERFLOW(p) && p->mp_pages + rem > id3.mcnt) { ++ id3.mcnt = p->mp_pages + rem; ++ munmap(id3.mptr, len); ++ len = id3.mcnt * env->me_psize; ++ MAP(rc, env, id3.mptr, len, off); ++ if (rc) ++ goto fail; ++ } ++ mdb_mid3l_insert(el, &id3); ++ pthread_mutex_unlock(&env->me_rpmutex); ++found: ++ mdb_mid3l_insert(tl, &id3); ++ } else { ++ return MDB_TXN_FULL; ++ } ++ok: ++ p = (MDB_page *)((char *)id3.mptr + rem * env->me_psize); ++#if MDB_DEBUG /* we don't need this check any more */ ++ if (IS_OVERFLOW(p)) { ++ mdb_tassert(txn, p->mp_pages + rem <= id3.mcnt); ++ } ++#endif ++ *ret = p; ++ return MDB_SUCCESS; ++} ++#endif ++ ++/** Find the address of the page corresponding to a given page number. ++ * @param[in] mc the cursor accessing the page. ++ * @param[in] pgno the page number for the page to retrieve. ++ * @param[out] ret address of a pointer where the page's address will be stored. ++ * @param[out] lvl dirty_list inheritance level of found page. 1=current txn, 0=mapped page. ++ * @return 0 on success, non-zero on failure. ++ */ ++static int ++mdb_page_get(MDB_cursor *mc, pgno_t pgno, MDB_page **ret, int *lvl) ++{ ++ MDB_txn *txn = mc->mc_txn; + MDB_page *p = NULL; + int level; + +- if (! (txn->mt_flags & (MDB_TXN_RDONLY|MDB_TXN_WRITEMAP))) { ++ if (! (mc->mc_flags & (C_ORIG_RDONLY|C_WRITEMAP))) { + MDB_txn *tx2 = txn; + level = 1; + do { +@@ -5233,8 +5996,7 @@ mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl) + MDB_ID pn = pgno << 1; + x = mdb_midl_search(tx2->mt_spill_pgs, pn); + if (x <= tx2->mt_spill_pgs[0] && tx2->mt_spill_pgs[x] == pn) { +- p = (MDB_page *)(env->me_map + env->me_psize * pgno); +- goto done; ++ goto mapped; + } + } + if (dl[0].mid) { +@@ -5248,15 +6010,26 @@ mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl) + } while ((tx2 = tx2->mt_parent) != NULL); + } + +- if (pgno < txn->mt_next_pgno) { +- level = 0; +- p = (MDB_page *)(env->me_map + env->me_psize * pgno); +- } else { +- DPRINTF(("page %"Z"u not found", pgno)); ++ if (pgno >= txn->mt_next_pgno) { ++ DPRINTF(("page %"Yu" not found", pgno)); + txn->mt_flags |= MDB_TXN_ERROR; + return MDB_PAGE_NOTFOUND; + } + ++ level = 0; ++ ++mapped: ++ { ++#ifdef MDB_VL32 ++ int rc = mdb_rpage_get(txn, pgno, &p); ++ if (rc) ++ return rc; ++#else ++ MDB_env *env = txn->mt_env; ++ p = (MDB_page *)(env->me_map + env->me_psize * pgno); ++#endif ++ } ++ + done: + *ret = p; + if (lvl) +@@ -5278,13 +6051,13 @@ mdb_page_search_root(MDB_cursor *mc, MDB_val *key, int flags) + MDB_node *node; + indx_t i; + +- DPRINTF(("branch page %"Z"u has %u keys", mp->mp_pgno, NUMKEYS(mp))); ++ DPRINTF(("branch page %"Yu" has %u keys", mp->mp_pgno, NUMKEYS(mp))); + /* Don't assert on branch pages in the FreeDB. We can get here + * while in the process of rebalancing a FreeDB branch page; we must + * let that proceed. ITS#8336 + */ + mdb_cassert(mc, !mc->mc_dbi || NUMKEYS(mp) > 1); +- DPRINTF(("found index 0 to page %"Z"u", NODEPGNO(NODEPTR(mp, 0)))); ++ DPRINTF(("found index 0 to page %"Yu, NODEPGNO(NODEPTR(mp, 0)))); + + if (flags & (MDB_PS_FIRST|MDB_PS_LAST)) { + i = 0; +@@ -5308,7 +6081,7 @@ mdb_page_search_root(MDB_cursor *mc, MDB_val *key, int flags) + mdb_cassert(mc, i < NUMKEYS(mp)); + node = NODEPTR(mp, i); + +- if ((rc = mdb_page_get(mc->mc_txn, NODEPGNO(node), &mp, NULL)) != 0) ++ if ((rc = mdb_page_get(mc, NODEPGNO(node), &mp, NULL)) != 0) + return rc; + + mc->mc_ki[mc->mc_top] = i; +@@ -5329,7 +6102,7 @@ mdb_page_search_root(MDB_cursor *mc, MDB_val *key, int flags) + return MDB_CORRUPTED; + } + +- DPRINTF(("found leaf page %"Z"u for key [%s]", mp->mp_pgno, ++ DPRINTF(("found leaf page %"Yu" for key [%s]", mp->mp_pgno, + key ? DKEY(key) : "null")); + mc->mc_flags |= C_INITIALIZED; + mc->mc_flags &= ~C_EOF; +@@ -5350,7 +6123,7 @@ mdb_page_search_lowest(MDB_cursor *mc) + MDB_node *node = NODEPTR(mp, 0); + int rc; + +- if ((rc = mdb_page_get(mc->mc_txn, NODEPGNO(node), &mp, NULL)) != 0) ++ if ((rc = mdb_page_get(mc, NODEPGNO(node), &mp, NULL)) != 0) + return rc; + + mc->mc_ki[mc->mc_top] = 0; +@@ -5402,7 +6175,7 @@ mdb_page_search(MDB_cursor *mc, MDB_val *key, int flags) + return MDB_NOTFOUND; + if ((leaf->mn_flags & (F_DUPDATA|F_SUBDATA)) != F_SUBDATA) + return MDB_INCOMPATIBLE; /* not a named DB */ +- rc = mdb_node_read(mc->mc_txn, leaf, &data); ++ rc = mdb_node_read(&mc2, leaf, &data); + if (rc) + return rc; + memcpy(&flags, ((char *) data.mv_data + offsetof(MDB_db, md_flags)), +@@ -5425,14 +6198,26 @@ mdb_page_search(MDB_cursor *mc, MDB_val *key, int flags) + } + + mdb_cassert(mc, root > 1); +- if (!mc->mc_pg[0] || mc->mc_pg[0]->mp_pgno != root) +- if ((rc = mdb_page_get(mc->mc_txn, root, &mc->mc_pg[0], NULL)) != 0) ++ if (!mc->mc_pg[0] || mc->mc_pg[0]->mp_pgno != root) { ++#ifdef MDB_VL32 ++ if (mc->mc_pg[0]) ++ MDB_PAGE_UNREF(mc->mc_txn, mc->mc_pg[0]); ++#endif ++ if ((rc = mdb_page_get(mc, root, &mc->mc_pg[0], NULL)) != 0) + return rc; ++ } + ++#ifdef MDB_VL32 ++ { ++ int i; ++ for (i=1; imc_snum; i++) ++ MDB_PAGE_UNREF(mc->mc_txn, mc->mc_pg[i]); ++ } ++#endif + mc->mc_snum = 1; + mc->mc_top = 0; + +- DPRINTF(("db %d root page %"Z"u has flags 0x%X", ++ DPRINTF(("db %d root page %"Yu" has flags 0x%X", + DDBI(mc), root, mc->mc_pg[0]->mp_flags)); + + if (flags & MDB_PS_MODIFY) { +@@ -5457,7 +6242,7 @@ mdb_ovpage_free(MDB_cursor *mc, MDB_page *mp) + MDB_ID pn = pg << 1; + int rc; + +- DPRINTF(("free ov page %"Z"u (%d)", pg, ovpages)); ++ DPRINTF(("free ov page %"Yu" (%d)", pg, ovpages)); + /* If the page is dirty or on the spill list we just acquired it, + * so we should give it back to our current free list, if any. + * Otherwise put it onto the list of pages we freed in this txn. +@@ -5498,7 +6283,7 @@ mdb_ovpage_free(MDB_cursor *mc, MDB_page *mp) + j = ++(dl[0].mid); + dl[j] = ix; /* Unsorted. OK when MDB_TXN_ERROR. */ + txn->mt_flags |= MDB_TXN_ERROR; +- return MDB_CORRUPTED; ++ return MDB_PROBLEM; + } + } + txn->mt_dirty_room++; +@@ -5523,18 +6308,22 @@ release: + } + + /** Return the data associated with a given node. +- * @param[in] txn The transaction for this operation. ++ * @param[in] mc The cursor for this operation. + * @param[in] leaf The node being read. + * @param[out] data Updated to point to the node's data. + * @return 0 on success, non-zero on failure. + */ + static int +-mdb_node_read(MDB_txn *txn, MDB_node *leaf, MDB_val *data) ++mdb_node_read(MDB_cursor *mc, MDB_node *leaf, MDB_val *data) + { + MDB_page *omp; /* overflow page */ + pgno_t pgno; + int rc; + ++ if (MC_OVPG(mc)) { ++ MDB_PAGE_UNREF(mc->mc_txn, MC_OVPG(mc)); ++ MC_SET_OVPG(mc, NULL); ++ } + if (!F_ISSET(leaf->mn_flags, F_BIGDATA)) { + data->mv_size = NODEDSZ(leaf); + data->mv_data = NODEDATA(leaf); +@@ -5545,11 +6334,12 @@ mdb_node_read(MDB_txn *txn, MDB_node *leaf, MDB_val *data) + */ + data->mv_size = NODEDSZ(leaf); + memcpy(&pgno, NODEDATA(leaf), sizeof(pgno)); +- if ((rc = mdb_page_get(txn, pgno, &omp, NULL)) != 0) { +- DPRINTF(("read overflow page %"Z"u failed", pgno)); ++ if ((rc = mdb_page_get(mc, pgno, &omp, NULL)) != 0) { ++ DPRINTF(("read overflow page %"Yu" failed", pgno)); + return rc; + } + data->mv_data = METADATA(omp); ++ MC_SET_OVPG(mc, omp); + + return MDB_SUCCESS; + } +@@ -5560,7 +6350,7 @@ mdb_get(MDB_txn *txn, MDB_dbi dbi, + { + MDB_cursor mc; + MDB_xcursor mx; +- int exact = 0; ++ int exact = 0, rc; + DKBUF; + + DPRINTF(("===> get db %u key [%s]", dbi, DKEY(key))); +@@ -5572,7 +6362,12 @@ mdb_get(MDB_txn *txn, MDB_dbi dbi, + return MDB_BAD_TXN; + + mdb_cursor_init(&mc, txn, dbi, &mx); +- return mdb_cursor_set(&mc, key, data, MDB_SET, &exact); ++ rc = mdb_cursor_set(&mc, key, data, MDB_SET, &exact); ++ /* unref all the pages when MDB_VL32 - caller must copy the data ++ * before doing anything else ++ */ ++ MDB_CURSOR_UNREF(&mc, 1); ++ return rc; + } + + /** Find a sibling for a page. +@@ -5589,13 +6384,19 @@ mdb_cursor_sibling(MDB_cursor *mc, int move_right) + int rc; + MDB_node *indx; + MDB_page *mp; ++#ifdef MDB_VL32 ++ MDB_page *op; ++#endif + + if (mc->mc_snum < 2) { + return MDB_NOTFOUND; /* root has no siblings */ + } + ++#ifdef MDB_VL32 ++ op = mc->mc_pg[mc->mc_top]; ++#endif + mdb_cursor_pop(mc); +- DPRINTF(("parent page is page %"Z"u, index %u", ++ DPRINTF(("parent page is page %"Yu", index %u", + mc->mc_pg[mc->mc_top]->mp_pgno, mc->mc_ki[mc->mc_top])); + + if (move_right ? (mc->mc_ki[mc->mc_top] + 1u >= NUMKEYS(mc->mc_pg[mc->mc_top])) +@@ -5618,8 +6419,10 @@ mdb_cursor_sibling(MDB_cursor *mc, int move_right) + } + mdb_cassert(mc, IS_BRANCH(mc->mc_pg[mc->mc_top])); + ++ MDB_PAGE_UNREF(mc->mc_txn, op); ++ + indx = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]); +- if ((rc = mdb_page_get(mc->mc_txn, NODEPGNO(indx), &mp, NULL)) != 0) { ++ if ((rc = mdb_page_get(mc, NODEPGNO(indx), &mp, NULL)) != 0) { + /* mc will be inconsistent if caller does mc_snum++ as above */ + mc->mc_flags &= ~(C_INITIALIZED|C_EOF); + return rc; +@@ -5640,11 +6443,12 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + MDB_node *leaf; + int rc; + +- if (mc->mc_flags & C_EOF) { ++ if ((mc->mc_flags & C_EOF) || ++ ((mc->mc_flags & C_DEL) && op == MDB_NEXT_DUP)) { + return MDB_NOTFOUND; + } +- +- mdb_cassert(mc, mc->mc_flags & C_INITIALIZED); ++ if (!(mc->mc_flags & C_INITIALIZED)) ++ return mdb_cursor_first(mc, key, data); + + mp = mc->mc_pg[mc->mc_top]; + +@@ -5659,6 +6463,9 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + return rc; + } + } ++ else { ++ MDB_CURSOR_UNREF(&mc->mc_xcursor->mx_cursor, 0); ++ } + } else { + mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); + if (op == MDB_NEXT_DUP) +@@ -5666,7 +6473,7 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + } + } + +- DPRINTF(("cursor_next: top page is %"Z"u in cursor %p", ++ DPRINTF(("cursor_next: top page is %"Yu" in cursor %p", + mdb_dbg_pgno(mp), (void *) mc)); + if (mc->mc_flags & C_DEL) { + mc->mc_flags ^= C_DEL; +@@ -5680,12 +6487,12 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + return rc; + } + mp = mc->mc_pg[mc->mc_top]; +- DPRINTF(("next page is %"Z"u, key index %u", mp->mp_pgno, mc->mc_ki[mc->mc_top])); ++ DPRINTF(("next page is %"Yu", key index %u", mp->mp_pgno, mc->mc_ki[mc->mc_top])); + } else + mc->mc_ki[mc->mc_top]++; + + skip: +- DPRINTF(("==> cursor points to page %"Z"u with %u keys, key index %u", ++ DPRINTF(("==> cursor points to page %"Yu" with %u keys, key index %u", + mdb_dbg_pgno(mp), NUMKEYS(mp), mc->mc_ki[mc->mc_top])); + + if (IS_LEAF2(mp)) { +@@ -5701,7 +6508,7 @@ skip: + mdb_xcursor_init1(mc, leaf); + } + if (data) { +- if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS) ++ if ((rc = mdb_node_read(mc, leaf, data)) != MDB_SUCCESS) + return rc; + + if (F_ISSET(leaf->mn_flags, F_DUPDATA)) { +@@ -5723,7 +6530,12 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + MDB_node *leaf; + int rc; + +- mdb_cassert(mc, mc->mc_flags & C_INITIALIZED); ++ if (!(mc->mc_flags & C_INITIALIZED)) { ++ rc = mdb_cursor_last(mc, key, data); ++ if (rc) ++ return rc; ++ mc->mc_ki[mc->mc_top]++; ++ } + + mp = mc->mc_pg[mc->mc_top]; + +@@ -5740,6 +6552,9 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + return rc; + } + } ++ else { ++ MDB_CURSOR_UNREF(&mc->mc_xcursor->mx_cursor, 0); ++ } + } else { + mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); + if (op == MDB_PREV_DUP) +@@ -5747,7 +6562,7 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + } + } + +- DPRINTF(("cursor_prev: top page is %"Z"u in cursor %p", ++ DPRINTF(("cursor_prev: top page is %"Yu" in cursor %p", + mdb_dbg_pgno(mp), (void *) mc)); + + mc->mc_flags &= ~(C_EOF|C_DEL); +@@ -5759,11 +6574,13 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + } + mp = mc->mc_pg[mc->mc_top]; + mc->mc_ki[mc->mc_top] = NUMKEYS(mp) - 1; +- DPRINTF(("prev page is %"Z"u, key index %u", mp->mp_pgno, mc->mc_ki[mc->mc_top])); ++ DPRINTF(("prev page is %"Yu", key index %u", mp->mp_pgno, mc->mc_ki[mc->mc_top])); + } else + mc->mc_ki[mc->mc_top]--; + +- DPRINTF(("==> cursor points to page %"Z"u with %u keys, key index %u", ++ mc->mc_flags &= ~C_EOF; ++ ++ DPRINTF(("==> cursor points to page %"Yu" with %u keys, key index %u", + mdb_dbg_pgno(mp), NUMKEYS(mp), mc->mc_ki[mc->mc_top])); + + if (IS_LEAF2(mp)) { +@@ -5779,7 +6596,7 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) + mdb_xcursor_init1(mc, leaf); + } + if (data) { +- if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS) ++ if ((rc = mdb_node_read(mc, leaf, data)) != MDB_SUCCESS) + return rc; + + if (F_ISSET(leaf->mn_flags, F_DUPDATA)) { +@@ -5806,8 +6623,10 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data, + if (key->mv_size == 0) + return MDB_BAD_VALSIZE; + +- if (mc->mc_xcursor) ++ if (mc->mc_xcursor) { ++ MDB_CURSOR_UNREF(&mc->mc_xcursor->mx_cursor, 0); + mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); ++ } + + /* See if we're already on the right page */ + if (mc->mc_flags & C_INITIALIZED) { +@@ -5873,6 +6692,7 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data, + } + } + rc = 0; ++ mc->mc_flags &= ~C_EOF; + goto set2; + } + } +@@ -5961,25 +6781,23 @@ set1: + } else if (op == MDB_GET_BOTH || op == MDB_GET_BOTH_RANGE) { + MDB_val olddata; + MDB_cmp_func *dcmp; +- if ((rc = mdb_node_read(mc->mc_txn, leaf, &olddata)) != MDB_SUCCESS) ++ if ((rc = mdb_node_read(mc, leaf, &olddata)) != MDB_SUCCESS) + return rc; + dcmp = mc->mc_dbx->md_dcmp; +-#if UINT_MAX < SIZE_MAX +- if (dcmp == mdb_cmp_int && olddata.mv_size == sizeof(size_t)) ++ if (NEED_CMP_CLONG(dcmp, olddata.mv_size)) + dcmp = mdb_cmp_clong; +-#endif + rc = dcmp(data, &olddata); + if (rc) { + if (op == MDB_GET_BOTH || rc > 0) + return MDB_NOTFOUND; + rc = 0; +- *data = olddata; + } ++ *data = olddata; + + } else { + if (mc->mc_xcursor) + mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); +- if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS) ++ if ((rc = mdb_node_read(mc, leaf, data)) != MDB_SUCCESS) + return rc; + } + } +@@ -5999,8 +6817,10 @@ mdb_cursor_first(MDB_cursor *mc, MDB_val *key, MDB_val *data) + int rc; + MDB_node *leaf; + +- if (mc->mc_xcursor) ++ if (mc->mc_xcursor) { ++ MDB_CURSOR_UNREF(&mc->mc_xcursor->mx_cursor, 0); + mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); ++ } + + if (!(mc->mc_flags & C_INITIALIZED) || mc->mc_top) { + rc = mdb_page_search(mc, NULL, MDB_PS_FIRST); +@@ -6028,7 +6848,7 @@ mdb_cursor_first(MDB_cursor *mc, MDB_val *key, MDB_val *data) + if (rc) + return rc; + } else { +- if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS) ++ if ((rc = mdb_node_read(mc, leaf, data)) != MDB_SUCCESS) + return rc; + } + } +@@ -6043,8 +6863,10 @@ mdb_cursor_last(MDB_cursor *mc, MDB_val *key, MDB_val *data) + int rc; + MDB_node *leaf; + +- if (mc->mc_xcursor) ++ if (mc->mc_xcursor) { ++ MDB_CURSOR_UNREF(&mc->mc_xcursor->mx_cursor, 0); + mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); ++ } + + if (!(mc->mc_flags & C_EOF)) { + +@@ -6073,7 +6895,7 @@ mdb_cursor_last(MDB_cursor *mc, MDB_val *key, MDB_val *data) + if (rc) + return rc; + } else { +- if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS) ++ if ((rc = mdb_node_read(mc, leaf, data)) != MDB_SUCCESS) + return rc; + } + } +@@ -6119,7 +6941,7 @@ mdb_cursor_get(MDB_cursor *mc, MDB_val *key, MDB_val *data, + if (F_ISSET(leaf->mn_flags, F_DUPDATA)) { + rc = mdb_cursor_get(&mc->mc_xcursor->mx_cursor, data, NULL, MDB_GET_CURRENT); + } else { +- rc = mdb_node_read(mc->mc_txn, leaf, data); ++ rc = mdb_node_read(mc, leaf, data); + } + } + } +@@ -6169,10 +6991,7 @@ mdb_cursor_get(MDB_cursor *mc, MDB_val *key, MDB_val *data, + rc = MDB_INCOMPATIBLE; + break; + } +- if (!(mc->mc_flags & C_INITIALIZED)) +- rc = mdb_cursor_first(mc, key, data); +- else +- rc = mdb_cursor_next(mc, key, data, MDB_NEXT_DUP); ++ rc = mdb_cursor_next(mc, key, data, MDB_NEXT_DUP); + if (rc == MDB_SUCCESS) { + if (mc->mc_xcursor->mx_cursor.mc_flags & C_INITIALIZED) { + MDB_cursor *mx; +@@ -6187,24 +7006,38 @@ fetchm: + } + } + break; ++ case MDB_PREV_MULTIPLE: ++ if (data == NULL) { ++ rc = EINVAL; ++ break; ++ } ++ if (!(mc->mc_db->md_flags & MDB_DUPFIXED)) { ++ rc = MDB_INCOMPATIBLE; ++ break; ++ } ++ if (!(mc->mc_flags & C_INITIALIZED)) ++ rc = mdb_cursor_last(mc, key, data); ++ else ++ rc = MDB_SUCCESS; ++ if (rc == MDB_SUCCESS) { ++ MDB_cursor *mx = &mc->mc_xcursor->mx_cursor; ++ if (mx->mc_flags & C_INITIALIZED) { ++ rc = mdb_cursor_sibling(mx, 0); ++ if (rc == MDB_SUCCESS) ++ goto fetchm; ++ } else { ++ rc = MDB_NOTFOUND; ++ } ++ } ++ break; + case MDB_NEXT: + case MDB_NEXT_DUP: + case MDB_NEXT_NODUP: +- if (!(mc->mc_flags & C_INITIALIZED)) +- rc = mdb_cursor_first(mc, key, data); +- else +- rc = mdb_cursor_next(mc, key, data, op); ++ rc = mdb_cursor_next(mc, key, data, op); + break; + case MDB_PREV: + case MDB_PREV_DUP: + case MDB_PREV_NODUP: +- if (!(mc->mc_flags & C_INITIALIZED)) { +- rc = mdb_cursor_last(mc, key, data); +- if (rc) +- break; +- mc->mc_flags |= C_INITIALIZED; +- mc->mc_ki[mc->mc_top]++; +- } + rc = mdb_cursor_prev(mc, key, data, op); + break; + case MDB_FIRST: +@@ -6225,7 +7058,7 @@ fetchm: + MDB_node *leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]); + if (!F_ISSET(leaf->mn_flags, F_DUPDATA)) { + MDB_GET_KEY(leaf, key); +- rc = mdb_node_read(mc->mc_txn, leaf, data); ++ rc = mdb_node_read(mc, leaf, data); + break; + } + } +@@ -6487,10 +7320,8 @@ more: + if (flags == MDB_CURRENT) + goto current; + dcmp = mc->mc_dbx->md_dcmp; +-#if UINT_MAX < SIZE_MAX +- if (dcmp == mdb_cmp_int && olddata.mv_size == sizeof(size_t)) ++ if (NEED_CMP_CLONG(dcmp, olddata.mv_size)) + dcmp = mdb_cmp_clong; +-#endif + /* does data match? */ + if (!dcmp(data, &olddata)) { + if (flags & (MDB_NODUPDATA|MDB_APPENDDUP)) +@@ -6609,7 +7440,7 @@ current: + int level, ovpages, dpages = OVPAGES(data->mv_size, env->me_psize); + + memcpy(&pg, olddata.mv_data, sizeof(pg)); +- if ((rc2 = mdb_page_get(mc->mc_txn, pg, &omp, &level)) != 0) ++ if ((rc2 = mdb_page_get(mc, pg, &omp, &level)) != 0) + return rc2; + ovpages = omp->mp_pages; + +@@ -6641,8 +7472,13 @@ current: + /* Note - this page is already counted in parent's dirty_room */ + rc2 = mdb_mid2l_insert(mc->mc_txn->mt_u.dirty_list, &id2); + mdb_cassert(mc, rc2 == 0); ++ /* Currently we make the page look as with put() in the ++ * parent txn, in case the user peeks at MDB_RESERVEd ++ * or unused parts. Some users treat ovpages specially. ++ */ + if (!(flags & MDB_RESERVE)) { +- /* Copy end of page, adjusting alignment so ++ /* Skip the part where LMDB will put *data. ++ * Copy end of page, adjusting alignment so + * compiler may copy words instead of bytes. + */ + off = (PAGEHDRSZ + data->mv_size) & -sizeof(size_t); +@@ -6728,7 +7564,7 @@ new_sub: + */ + if (do_sub) { + int xflags, new_dupdata; +- size_t ecount; ++ mdb_size_t ecount; + put_sub: + xdata.mv_size = 0; + xdata.mv_data = ""; +@@ -6810,7 +7646,7 @@ put_sub: + return rc; + bad_sub: + if (rc == MDB_KEYEXIST) /* should not happen, we deleted that item */ +- rc = MDB_CORRUPTED; ++ rc = MDB_PROBLEM; + } + mc->mc_txn->mt_flags |= MDB_TXN_ERROR; + return rc; +@@ -6910,7 +7746,7 @@ mdb_cursor_del(MDB_cursor *mc, unsigned int flags) + pgno_t pg; + + memcpy(&pg, NODEDATA(leaf), sizeof(pg)); +- if ((rc = mdb_page_get(mc->mc_txn, pg, &omp, NULL)) || ++ if ((rc = mdb_page_get(mc, pg, &omp, NULL)) || + (rc = mdb_ovpage_free(mc, omp))) + goto fail; + } +@@ -6939,7 +7775,7 @@ mdb_page_new(MDB_cursor *mc, uint32_t flags, int num, MDB_page **mp) + + if ((rc = mdb_page_alloc(mc, num, &np))) + return rc; +- DPRINTF(("allocated new mpage %"Z"u, page size %u", ++ DPRINTF(("allocated new mpage %"Yu", page size %u", + np->mp_pgno, mc->mc_txn->mt_env->me_psize)); + np->mp_flags = flags | P_DIRTY; + np->mp_lower = (PAGEHDRSZ-PAGEBASE); +@@ -7039,7 +7875,7 @@ mdb_node_add(MDB_cursor *mc, indx_t indx, + + mdb_cassert(mc, mp->mp_upper >= mp->mp_lower); + +- DPRINTF(("add to %s %spage %"Z"u index %i, data size %"Z"u key size %"Z"u [%s]", ++ DPRINTF(("add to %s %spage %"Yu" index %i, data size %"Z"u key size %"Z"u [%s]", + IS_LEAF(mp) ? "leaf" : "branch", + IS_SUBP(mp) ? "sub-" : "", + mdb_dbg_pgno(mp), indx, data ? data->mv_size : 0, +@@ -7080,7 +7916,7 @@ mdb_node_add(MDB_cursor *mc, indx_t indx, + goto full; + if ((rc = mdb_page_new(mc, P_OVERFLOW, ovpages, &ofp))) + return rc; +- DPRINTF(("allocated overflow page %"Z"u", ofp->mp_pgno)); ++ DPRINTF(("allocated overflow page %"Yu, ofp->mp_pgno)); + flags |= F_BIGDATA; + goto update; + } else { +@@ -7137,7 +7973,7 @@ update: + return MDB_SUCCESS; + + full: +- DPRINTF(("not enough room in page %"Z"u, got %u ptrs", ++ DPRINTF(("not enough room in page %"Yu", got %u ptrs", + mdb_dbg_pgno(mp), NUMKEYS(mp))); + DPRINTF(("upper-lower = %u - %u = %"Z"d", mp->mp_upper,mp->mp_lower,room)); + DPRINTF(("node size = %"Z"u", node_size)); +@@ -7160,7 +7996,7 @@ mdb_node_del(MDB_cursor *mc, int ksize) + MDB_node *node; + char *base; + +- DPRINTF(("delete node %u on %s page %"Z"u", indx, ++ DPRINTF(("delete node %u on %s page %"Yu, indx, + IS_LEAF(mp) ? "leaf" : "branch", mdb_dbg_pgno(mp))); + numkeys = NUMKEYS(mp); + mdb_cassert(mc, indx < numkeys); +@@ -7269,7 +8105,8 @@ mdb_xcursor_init0(MDB_cursor *mc) + mx->mx_cursor.mc_dbflag = &mx->mx_dbflag; + mx->mx_cursor.mc_snum = 0; + mx->mx_cursor.mc_top = 0; +- mx->mx_cursor.mc_flags = C_SUB; ++ MC_SET_OVPG(&mx->mx_cursor, NULL); ++ mx->mx_cursor.mc_flags = C_SUB | (mc->mc_flags & (C_ORIG_RDONLY|C_WRITEMAP)); + mx->mx_dbx.md_name.mv_size = 0; + mx->mx_dbx.md_name.mv_data = NULL; + mx->mx_dbx.md_cmp = mc->mc_dbx->md_dcmp; +@@ -7288,12 +8125,12 @@ mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node) + { + MDB_xcursor *mx = mc->mc_xcursor; + ++ mx->mx_cursor.mc_flags &= C_SUB|C_ORIG_RDONLY|C_WRITEMAP; + if (node->mn_flags & F_SUBDATA) { + memcpy(&mx->mx_db, NODEDATA(node), sizeof(MDB_db)); + mx->mx_cursor.mc_pg[0] = 0; + mx->mx_cursor.mc_snum = 0; + mx->mx_cursor.mc_top = 0; +- mx->mx_cursor.mc_flags = C_SUB; + } else { + MDB_page *fp = NODEDATA(node); + mx->mx_db.md_pad = 0; +@@ -7306,7 +8143,7 @@ mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node) + COPY_PGNO(mx->mx_db.md_root, fp->mp_pgno); + mx->mx_cursor.mc_snum = 1; + mx->mx_cursor.mc_top = 0; +- mx->mx_cursor.mc_flags = C_INITIALIZED|C_SUB; ++ mx->mx_cursor.mc_flags |= C_INITIALIZED; + mx->mx_cursor.mc_pg[0] = fp; + mx->mx_cursor.mc_ki[0] = 0; + if (mc->mc_db->md_flags & MDB_DUPFIXED) { +@@ -7316,13 +8153,11 @@ mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node) + mx->mx_db.md_flags |= MDB_INTEGERKEY; + } + } +- DPRINTF(("Sub-db -%u root page %"Z"u", mx->mx_cursor.mc_dbi, ++ DPRINTF(("Sub-db -%u root page %"Yu, mx->mx_cursor.mc_dbi, + mx->mx_db.md_root)); + mx->mx_dbflag = DB_VALID|DB_USRVALID|DB_DIRTY; /* DB_DIRTY guides mdb_cursor_touch */ +-#if UINT_MAX < SIZE_MAX +- if (mx->mx_dbx.md_cmp == mdb_cmp_int && mx->mx_db.md_pad == sizeof(size_t)) ++ if (NEED_CMP_CLONG(mx->mx_dbx.md_cmp, mx->mx_db.md_pad)) + mx->mx_dbx.md_cmp = mdb_cmp_clong; +-#endif + } + + +@@ -7345,7 +8180,7 @@ mdb_xcursor_init2(MDB_cursor *mc, MDB_xcursor *src_mx, int new_dupdata) + mx->mx_cursor.mc_flags |= C_INITIALIZED; + mx->mx_cursor.mc_ki[0] = 0; + mx->mx_dbflag = DB_VALID|DB_USRVALID|DB_DIRTY; /* DB_DIRTY guides mdb_cursor_touch */ +-#if UINT_MAX < SIZE_MAX ++#if UINT_MAX < MDB_SIZE_MAX /* matches mdb_xcursor_init1:NEED_CMP_CLONG() */ + mx->mx_dbx.md_cmp = src_mx->mx_dbx.md_cmp; + #endif + } else if (!(mx->mx_cursor.mc_flags & C_INITIALIZED)) { +@@ -7353,7 +8188,7 @@ mdb_xcursor_init2(MDB_cursor *mc, MDB_xcursor *src_mx, int new_dupdata) + } + mx->mx_db = src_mx->mx_db; + mx->mx_cursor.mc_pg[0] = src_mx->mx_cursor.mc_pg[0]; +- DPRINTF(("Sub-db -%u root page %"Z"u", mx->mx_cursor.mc_dbi, ++ DPRINTF(("Sub-db -%u root page %"Yu, mx->mx_cursor.mc_dbi, + mx->mx_db.md_root)); + } + +@@ -7372,7 +8207,8 @@ mdb_cursor_init(MDB_cursor *mc, MDB_txn *txn, MDB_dbi dbi, MDB_xcursor *mx) + mc->mc_top = 0; + mc->mc_pg[0] = 0; + mc->mc_ki[0] = 0; +- mc->mc_flags = 0; ++ MC_SET_OVPG(mc, NULL); ++ mc->mc_flags = txn->mt_flags & (C_ORIG_RDONLY|C_WRITEMAP); + if (txn->mt_dbs[dbi].md_flags & MDB_DUPSORT) { + mdb_tassert(txn, mx != NULL); + mc->mc_xcursor = mx; +@@ -7437,7 +8273,7 @@ mdb_cursor_renew(MDB_txn *txn, MDB_cursor *mc) + + /* Return the count of duplicate data items for the current key */ + int +-mdb_cursor_count(MDB_cursor *mc, size_t *countp) ++mdb_cursor_count(MDB_cursor *mc, mdb_size_t *countp) + { + MDB_node *leaf; + +@@ -7471,6 +8307,9 @@ mdb_cursor_count(MDB_cursor *mc, size_t *countp) + void + mdb_cursor_close(MDB_cursor *mc) + { ++ if (mc) { ++ MDB_CURSOR_UNREF(mc, 0); ++ } + if (mc && !mc->mc_backup) { + /* remove from txn, if tracked */ + if ((mc->mc_flags & C_UNTRACK) && mc->mc_txn->mt_cursors) { +@@ -7522,7 +8361,7 @@ mdb_update_key(MDB_cursor *mc, MDB_val *key) + char kbuf2[DKBUF_MAXKEYSIZE*2+1]; + k2.mv_data = NODEKEY(node); + k2.mv_size = node->mn_ksize; +- DPRINTF(("update key %u (ofs %u) [%s] to [%s] on page %"Z"u", ++ DPRINTF(("update key %u (ofs %u) [%s] to [%s] on page %"Yu, + indx, ptr, + mdb_dkey(&k2, kbuf2), + DKEY(key), +@@ -7670,7 +8509,7 @@ mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft) + return rc; + } + +- DPRINTF(("moving %s node %u [%s] on page %"Z"u to node %u on page %"Z"u", ++ DPRINTF(("moving %s node %u [%s] on page %"Yu" to node %u on page %"Yu, + IS_LEAF(csrc->mc_pg[csrc->mc_top]) ? "leaf" : "branch", + csrc->mc_ki[csrc->mc_top], + DKEY(&key), +@@ -7764,7 +8603,7 @@ mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft) + key.mv_size = NODEKSZ(srcnode); + key.mv_data = NODEKEY(srcnode); + } +- DPRINTF(("update separator for source page %"Z"u to [%s]", ++ DPRINTF(("update separator for source page %"Yu" to [%s]", + csrc->mc_pg[csrc->mc_top]->mp_pgno, DKEY(&key))); + mdb_cursor_copy(csrc, &mn); + mn.mc_snum--; +@@ -7795,7 +8634,7 @@ mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft) + key.mv_size = NODEKSZ(srcnode); + key.mv_data = NODEKEY(srcnode); + } +- DPRINTF(("update separator for destination page %"Z"u to [%s]", ++ DPRINTF(("update separator for destination page %"Yu" to [%s]", + cdst->mc_pg[cdst->mc_top]->mp_pgno, DKEY(&key))); + mdb_cursor_copy(cdst, &mn); + mn.mc_snum--; +@@ -7841,7 +8680,7 @@ mdb_page_merge(MDB_cursor *csrc, MDB_cursor *cdst) + psrc = csrc->mc_pg[csrc->mc_top]; + pdst = cdst->mc_pg[cdst->mc_top]; + +- DPRINTF(("merging page %"Z"u into %"Z"u", psrc->mp_pgno, pdst->mp_pgno)); ++ DPRINTF(("merging page %"Yu" into %"Yu, psrc->mp_pgno, pdst->mp_pgno)); + + mdb_cassert(csrc, csrc->mc_snum > 1); /* can't merge root page */ + mdb_cassert(csrc, cdst->mc_snum > 1); +@@ -7898,7 +8737,7 @@ mdb_page_merge(MDB_cursor *csrc, MDB_cursor *cdst) + } + } + +- DPRINTF(("dst page %"Z"u now has %u keys (%.1f%% filled)", ++ DPRINTF(("dst page %"Yu" now has %u keys (%.1f%% filled)", + pdst->mp_pgno, NUMKEYS(pdst), + (float)PAGEFILL(cdst->mc_txn->mt_env, pdst) / 10)); + +@@ -7986,6 +8825,7 @@ mdb_cursor_copy(const MDB_cursor *csrc, MDB_cursor *cdst) + cdst->mc_snum = csrc->mc_snum; + cdst->mc_top = csrc->mc_top; + cdst->mc_flags = csrc->mc_flags; ++ MC_SET_OVPG(cdst, MC_OVPG(csrc)); + + for (i=0; imc_snum; i++) { + cdst->mc_pg[i] = csrc->mc_pg[i]; +@@ -8014,14 +8854,14 @@ mdb_rebalance(MDB_cursor *mc) + minkeys = 1; + thresh = FILL_THRESHOLD; + } +- DPRINTF(("rebalancing %s page %"Z"u (has %u keys, %.1f%% full)", ++ DPRINTF(("rebalancing %s page %"Yu" (has %u keys, %.1f%% full)", + IS_LEAF(mc->mc_pg[mc->mc_top]) ? "leaf" : "branch", + mdb_dbg_pgno(mc->mc_pg[mc->mc_top]), NUMKEYS(mc->mc_pg[mc->mc_top]), + (float)PAGEFILL(mc->mc_txn->mt_env, mc->mc_pg[mc->mc_top]) / 10)); + + if (PAGEFILL(mc->mc_txn->mt_env, mc->mc_pg[mc->mc_top]) >= thresh && + NUMKEYS(mc->mc_pg[mc->mc_top]) >= minkeys) { +- DPRINTF(("no need to rebalance page %"Z"u, above fill threshold", ++ DPRINTF(("no need to rebalance page %"Yu", above fill threshold", + mdb_dbg_pgno(mc->mc_pg[mc->mc_top]))); + return MDB_SUCCESS; + } +@@ -8069,7 +8909,7 @@ mdb_rebalance(MDB_cursor *mc) + if (rc) + return rc; + mc->mc_db->md_root = NODEPGNO(NODEPTR(mp, 0)); +- rc = mdb_page_get(mc->mc_txn,mc->mc_db->md_root,&mc->mc_pg[0],NULL); ++ rc = mdb_page_get(mc, mc->mc_db->md_root, &mc->mc_pg[0], NULL); + if (rc) + return rc; + mc->mc_db->md_depth--; +@@ -8130,7 +8970,7 @@ mdb_rebalance(MDB_cursor *mc) + DPUTS("reading right neighbor"); + mn.mc_ki[ptop]++; + node = NODEPTR(mc->mc_pg[ptop], mn.mc_ki[ptop]); +- rc = mdb_page_get(mc->mc_txn,NODEPGNO(node),&mn.mc_pg[mn.mc_top],NULL); ++ rc = mdb_page_get(mc, NODEPGNO(node), &mn.mc_pg[mn.mc_top], NULL); + if (rc) + return rc; + mn.mc_ki[mn.mc_top] = 0; +@@ -8142,7 +8982,7 @@ mdb_rebalance(MDB_cursor *mc) + DPUTS("reading left neighbor"); + mn.mc_ki[ptop]--; + node = NODEPTR(mc->mc_pg[ptop], mn.mc_ki[ptop]); +- rc = mdb_page_get(mc->mc_txn,NODEPGNO(node),&mn.mc_pg[mn.mc_top],NULL); ++ rc = mdb_page_get(mc, NODEPGNO(node), &mn.mc_pg[mn.mc_top], NULL); + if (rc) + return rc; + mn.mc_ki[mn.mc_top] = NUMKEYS(mn.mc_pg[mn.mc_top]) - 1; +@@ -8150,7 +8990,7 @@ mdb_rebalance(MDB_cursor *mc) + fromleft = 1; + } + +- DPRINTF(("found neighbor page %"Z"u (%u keys, %.1f%% full)", ++ DPRINTF(("found neighbor page %"Yu" (%u keys, %.1f%% full)", + mn.mc_pg[mn.mc_top]->mp_pgno, NUMKEYS(mn.mc_pg[mn.mc_top]), + (float)PAGEFILL(mc->mc_txn->mt_env, mn.mc_pg[mn.mc_top]) / 10)); + +@@ -8207,8 +9047,6 @@ mdb_cursor_del0(MDB_cursor *mc) + if (m3->mc_pg[mc->mc_top] == mp) { + if (m3->mc_ki[mc->mc_top] == ki) { + m3->mc_flags |= C_DEL; +- if (mc->mc_db->md_flags & MDB_DUPSORT) +- m3->mc_xcursor->mx_cursor.mc_flags &= ~C_INITIALIZED; + } else if (m3->mc_ki[mc->mc_top] > ki) { + m3->mc_ki[mc->mc_top]--; + } +@@ -8242,11 +9080,21 @@ mdb_cursor_del0(MDB_cursor *mc) + continue; + if (m3->mc_pg[mc->mc_top] == mp) { + /* if m3 points past last node in page, find next sibling */ +- if (m3->mc_ki[mc->mc_top] >= nkeys) { +- rc = mdb_cursor_sibling(m3, 1); +- if (rc == MDB_NOTFOUND) { +- m3->mc_flags |= C_EOF; +- rc = MDB_SUCCESS; ++ if (m3->mc_ki[mc->mc_top] >= mc->mc_ki[mc->mc_top]) { ++ if (m3->mc_ki[mc->mc_top] >= nkeys) { ++ rc = mdb_cursor_sibling(m3, 1); ++ if (rc == MDB_NOTFOUND) { ++ m3->mc_flags |= C_EOF; ++ rc = MDB_SUCCESS; ++ continue; ++ } ++ } ++ if (mc->mc_db->md_flags & MDB_DUPSORT) { ++ MDB_node *node = NODEPTR(m3->mc_pg[m3->mc_top], m3->mc_ki[m3->mc_top]); ++ if (node->mn_flags & F_DUPDATA) { ++ mdb_xcursor_init1(m3, node); ++ m3->mc_xcursor->mx_cursor.mc_flags |= C_DEL; ++ } + } + } + } +@@ -8352,7 +9200,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno + newindx = mc->mc_ki[mc->mc_top]; + nkeys = NUMKEYS(mp); + +- DPRINTF(("-----> splitting %s page %"Z"u and adding [%s] at index %i/%i", ++ DPRINTF(("-----> splitting %s page %"Yu" and adding [%s] at index %i/%i", + IS_LEAF(mp) ? "leaf" : "branch", mp->mp_pgno, + DKEY(newkey), mc->mc_ki[mc->mc_top], nkeys)); + +@@ -8360,7 +9208,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno + if ((rc = mdb_page_new(mc, mp->mp_flags, 1, &rp))) + return rc; + rp->mp_pad = mp->mp_pad; +- DPRINTF(("new right sibling: page %"Z"u", rp->mp_pgno)); ++ DPRINTF(("new right sibling: page %"Yu, rp->mp_pgno)); + + /* Usually when splitting the root page, the cursor + * height is 1. But when called from mdb_update_key, +@@ -8378,7 +9226,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno + mc->mc_pg[0] = pp; + mc->mc_ki[0] = 0; + mc->mc_db->md_root = pp->mp_pgno; +- DPRINTF(("root split! new root = %"Z"u", pp->mp_pgno)); ++ DPRINTF(("root split! new root = %"Yu, pp->mp_pgno)); + new_root = mc->mc_db->md_depth++; + + /* Add left (implicit) pointer. */ +@@ -8395,7 +9243,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno + ptop = 0; + } else { + ptop = mc->mc_top-1; +- DPRINTF(("parent branch page is %"Z"u", mc->mc_pg[ptop]->mp_pgno)); ++ DPRINTF(("parent branch page is %"Yu, mc->mc_pg[ptop]->mp_pgno)); + } + + mdb_cursor_copy(mc, &mn); +@@ -8776,11 +9624,12 @@ mdb_put(MDB_txn *txn, MDB_dbi dbi, + #ifndef MDB_WBUF + #define MDB_WBUF (1024*1024) + #endif ++#define MDB_EOF 0x10 /**< #mdb_env_copyfd1() is done reading */ + +- /** State needed for a compacting copy. */ ++ /** State needed for a double-buffering compacting copy. */ + typedef struct mdb_copy { + pthread_mutex_t mc_mutex; +- pthread_cond_t mc_cond; ++ pthread_cond_t mc_cond; /**< Condition variable for #mc_new */ + char *mc_wbuf[2]; + char *mc_over[2]; + MDB_env *mc_env; +@@ -8789,10 +9638,9 @@ typedef struct mdb_copy { + int mc_olen[2]; + pgno_t mc_next_pgno; + HANDLE mc_fd; +- int mc_status; +- volatile int mc_new; +- int mc_toggle; +- ++ int mc_toggle; /**< Buffer number in provider */ ++ int mc_new; /**< (0-2 buffers to write) | (#MDB_EOF at end) */ ++ volatile int mc_error; /**< Error code, never cleared if set */ + } mdb_copy; + + /** Dedicated writer thread for compacting copy. */ +@@ -8811,20 +9659,16 @@ mdb_env_copythr(void *arg) + #endif + + pthread_mutex_lock(&my->mc_mutex); +- my->mc_new = 0; +- pthread_cond_signal(&my->mc_cond); + for(;;) { + while (!my->mc_new) + pthread_cond_wait(&my->mc_cond, &my->mc_mutex); +- if (my->mc_new < 0) { +- my->mc_new = 0; ++ if (my->mc_new == 0 + MDB_EOF) /* 0 buffers, just EOF */ + break; +- } +- my->mc_new = 0; + wsize = my->mc_wlen[toggle]; + ptr = my->mc_wbuf[toggle]; + again: +- while (wsize > 0) { ++ rc = MDB_SUCCESS; ++ while (wsize > 0 && !my->mc_error) { + DO_WRITE(rc, my->mc_fd, ptr, wsize, len); + if (!rc) { + rc = ErrCode(); +@@ -8840,8 +9684,7 @@ again: + } + } + if (rc) { +- my->mc_status = rc; +- break; ++ my->mc_error = rc; + } + /* If there's an overflow page tail, write it too */ + if (my->mc_olen[toggle]) { +@@ -8852,39 +9695,41 @@ again: + } + my->mc_wlen[toggle] = 0; + toggle ^= 1; ++ /* Return the empty buffer to provider */ ++ my->mc_new--; + pthread_cond_signal(&my->mc_cond); + } +- pthread_cond_signal(&my->mc_cond); + pthread_mutex_unlock(&my->mc_mutex); + return (THREAD_RET)0; + #undef DO_WRITE + } + +- /** Tell the writer thread there's a buffer ready to write */ ++ /** Give buffer and/or #MDB_EOF to writer thread, await unused buffer. ++ * ++ * @param[in] my control structure. ++ * @param[in] adjust (1 to hand off 1 buffer) | (MDB_EOF when ending). ++ */ + static int ESECT +-mdb_env_cthr_toggle(mdb_copy *my, int st) ++mdb_env_cthr_toggle(mdb_copy *my, int adjust) + { +- int toggle = my->mc_toggle ^ 1; + pthread_mutex_lock(&my->mc_mutex); +- if (my->mc_status) { +- pthread_mutex_unlock(&my->mc_mutex); +- return my->mc_status; +- } +- while (my->mc_new == 1) +- pthread_cond_wait(&my->mc_cond, &my->mc_mutex); +- my->mc_new = st; +- my->mc_toggle = toggle; ++ my->mc_new += adjust; + pthread_cond_signal(&my->mc_cond); ++ while (my->mc_new & 2) /* both buffers in use */ ++ pthread_cond_wait(&my->mc_cond, &my->mc_mutex); + pthread_mutex_unlock(&my->mc_mutex); +- return 0; ++ ++ my->mc_toggle ^= (adjust & 1); ++ /* Both threads reset mc_wlen, to be safe from threading errors */ ++ my->mc_wlen[my->mc_toggle] = 0; ++ return my->mc_error; + } + + /** Depth-first tree traversal for compacting copy. */ + static int ESECT + mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) + { +- MDB_cursor mc; +- MDB_txn *txn = my->mc_txn; ++ MDB_cursor mc = {0}; + MDB_node *ni; + MDB_page *mo, *mp, *leaf; + char *buf, *ptr; +@@ -8896,10 +9741,10 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) + return MDB_SUCCESS; + + mc.mc_snum = 1; +- mc.mc_top = 0; +- mc.mc_txn = txn; ++ mc.mc_txn = my->mc_txn; ++ mc.mc_flags = my->mc_txn->mt_flags & (C_ORIG_RDONLY|C_WRITEMAP); + +- rc = mdb_page_get(my->mc_txn, *pg, &mc.mc_pg[0], NULL); ++ rc = mdb_page_get(&mc, *pg, &mc.mc_pg[0], NULL); + if (rc) + return rc; + rc = mdb_page_search_root(&mc, NULL, MDB_PS_FIRST); +@@ -8943,7 +9788,8 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) + } + + memcpy(&pg, NODEDATA(ni), sizeof(pg)); +- rc = mdb_page_get(txn, pg, &omp, NULL); ++ memcpy(NODEDATA(ni), &my->mc_next_pgno, sizeof(pgno_t)); ++ rc = mdb_page_get(&mc, pg, &omp, NULL); + if (rc) + goto done; + if (my->mc_wlen[toggle] >= MDB_WBUF) { +@@ -8965,7 +9811,6 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) + goto done; + toggle = my->mc_toggle; + } +- memcpy(NODEDATA(ni), &mo->mp_pgno, sizeof(pgno_t)); + } else if (ni->mn_flags & F_SUBDATA) { + MDB_db db; + +@@ -8994,7 +9839,7 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) + again: + ni = NODEPTR(mp, mc.mc_ki[mc.mc_top]); + pg = NODEPGNO(ni); +- rc = mdb_page_get(txn, pg, &mp, NULL); ++ rc = mdb_page_get(&mc, pg, &mp, NULL); + if (rc) + goto done; + mc.mc_top++; +@@ -9043,47 +9888,56 @@ mdb_env_copyfd1(MDB_env *env, HANDLE fd) + { + MDB_meta *mm; + MDB_page *mp; +- mdb_copy my; ++ mdb_copy my = {0}; + MDB_txn *txn = NULL; + pthread_t thr; +- int rc; ++ pgno_t root, new_root; ++ int rc = MDB_SUCCESS; + + #ifdef _WIN32 +- my.mc_mutex = CreateMutex(NULL, FALSE, NULL); +- my.mc_cond = CreateEvent(NULL, FALSE, FALSE, NULL); ++ if (!(my.mc_mutex = CreateMutex(NULL, FALSE, NULL)) || ++ !(my.mc_cond = CreateEvent(NULL, FALSE, FALSE, NULL))) { ++ rc = ErrCode(); ++ goto done; ++ } + my.mc_wbuf[0] = _aligned_malloc(MDB_WBUF*2, env->me_os_psize); +- if (my.mc_wbuf[0] == NULL) +- return errno; ++ if (my.mc_wbuf[0] == NULL) { ++ /* _aligned_malloc() sets errno, but we use Windows error codes */ ++ rc = ERROR_NOT_ENOUGH_MEMORY; ++ goto done; ++ } + #else +- pthread_mutex_init(&my.mc_mutex, NULL); +- pthread_cond_init(&my.mc_cond, NULL); ++ if ((rc = pthread_mutex_init(&my.mc_mutex, NULL)) != 0) ++ return rc; ++ if ((rc = pthread_cond_init(&my.mc_cond, NULL)) != 0) ++ goto done2; + #ifdef HAVE_MEMALIGN + my.mc_wbuf[0] = memalign(env->me_os_psize, MDB_WBUF*2); +- if (my.mc_wbuf[0] == NULL) +- return errno; ++ if (my.mc_wbuf[0] == NULL) { ++ rc = errno; ++ goto done; ++ } + #else +- rc = posix_memalign((void **)&my.mc_wbuf[0], env->me_os_psize, MDB_WBUF*2); +- if (rc) +- return rc; ++ { ++ void *p; ++ if ((rc = posix_memalign(&p, env->me_os_psize, MDB_WBUF*2)) != 0) ++ goto done; ++ my.mc_wbuf[0] = p; ++ } + #endif + #endif + memset(my.mc_wbuf[0], 0, MDB_WBUF*2); + my.mc_wbuf[1] = my.mc_wbuf[0] + MDB_WBUF; +- my.mc_wlen[0] = 0; +- my.mc_wlen[1] = 0; +- my.mc_olen[0] = 0; +- my.mc_olen[1] = 0; + my.mc_next_pgno = NUM_METAS; +- my.mc_status = 0; +- my.mc_new = 1; +- my.mc_toggle = 0; + my.mc_env = env; + my.mc_fd = fd; +- THREAD_CREATE(thr, mdb_env_copythr, &my); ++ rc = THREAD_CREATE(thr, mdb_env_copythr, &my); ++ if (rc) ++ goto done; + + rc = mdb_txn_begin(env, NULL, MDB_RDONLY, &txn); + if (rc) +- return rc; ++ goto finish; + + mp = (MDB_page *)my.mc_wbuf[0]; + memset(mp, 0, NUM_METAS * env->me_psize); +@@ -9099,57 +9953,64 @@ mdb_env_copyfd1(MDB_env *env, HANDLE fd) + *(MDB_meta *)METADATA(mp) = *mm; + mm = (MDB_meta *)METADATA(mp); + +- /* Count the number of free pages, subtract from lastpg to find +- * number of active pages +- */ +- { ++ /* Set metapage 1 with current main DB */ ++ root = new_root = txn->mt_dbs[MAIN_DBI].md_root; ++ if (root != P_INVALID) { ++ /* Count free pages + freeDB pages. Subtract from last_pg ++ * to find the new last_pg, which also becomes the new root. ++ */ + MDB_ID freecount = 0; + MDB_cursor mc; + MDB_val key, data; + mdb_cursor_init(&mc, txn, FREE_DBI, NULL); + while ((rc = mdb_cursor_get(&mc, &key, &data, MDB_NEXT)) == 0) + freecount += *(MDB_ID *)data.mv_data; ++ if (rc != MDB_NOTFOUND) ++ goto finish; + freecount += txn->mt_dbs[FREE_DBI].md_branch_pages + + txn->mt_dbs[FREE_DBI].md_leaf_pages + + txn->mt_dbs[FREE_DBI].md_overflow_pages; + +- /* Set metapage 1 */ +- mm->mm_last_pg = txn->mt_next_pgno - freecount - 1; ++ new_root = txn->mt_next_pgno - 1 - freecount; ++ mm->mm_last_pg = new_root; + mm->mm_dbs[MAIN_DBI] = txn->mt_dbs[MAIN_DBI]; +- if (mm->mm_last_pg > NUM_METAS-1) { +- mm->mm_dbs[MAIN_DBI].md_root = mm->mm_last_pg; +- mm->mm_txnid = 1; +- } else { +- mm->mm_dbs[MAIN_DBI].md_root = P_INVALID; +- } ++ mm->mm_dbs[MAIN_DBI].md_root = new_root; ++ } else { ++ /* When the DB is empty, handle it specially to ++ * fix any breakage like page leaks from ITS#8174. ++ */ ++ mm->mm_dbs[MAIN_DBI].md_flags = txn->mt_dbs[MAIN_DBI].md_flags; ++ } ++ if (root != P_INVALID || mm->mm_dbs[MAIN_DBI].md_flags) { ++ mm->mm_txnid = 1; /* use metapage 1 */ + } ++ + my.mc_wlen[0] = env->me_psize * NUM_METAS; + my.mc_txn = txn; +- pthread_mutex_lock(&my.mc_mutex); +- while(my.mc_new) +- pthread_cond_wait(&my.mc_cond, &my.mc_mutex); +- pthread_mutex_unlock(&my.mc_mutex); +- rc = mdb_env_cwalk(&my, &txn->mt_dbs[MAIN_DBI].md_root, 0); +- if (rc == MDB_SUCCESS && my.mc_wlen[my.mc_toggle]) +- rc = mdb_env_cthr_toggle(&my, 1); +- mdb_env_cthr_toggle(&my, -1); +- pthread_mutex_lock(&my.mc_mutex); +- while(my.mc_new) +- pthread_cond_wait(&my.mc_cond, &my.mc_mutex); +- pthread_mutex_unlock(&my.mc_mutex); +- THREAD_FINISH(thr); ++ rc = mdb_env_cwalk(&my, &root, 0); ++ if (rc == MDB_SUCCESS && root != new_root) { ++ rc = MDB_INCOMPATIBLE; /* page leak or corrupt DB */ ++ } + ++finish: ++ if (rc) ++ my.mc_error = rc; ++ mdb_env_cthr_toggle(&my, 1 | MDB_EOF); ++ rc = THREAD_FINISH(thr); + mdb_txn_abort(txn); ++ ++done: + #ifdef _WIN32 +- CloseHandle(my.mc_cond); +- CloseHandle(my.mc_mutex); +- _aligned_free(my.mc_wbuf[0]); ++ if (my.mc_wbuf[0]) _aligned_free(my.mc_wbuf[0]); ++ if (my.mc_cond) CloseHandle(my.mc_cond); ++ if (my.mc_mutex) CloseHandle(my.mc_mutex); + #else ++ free(my.mc_wbuf[0]); + pthread_cond_destroy(&my.mc_cond); ++done2: + pthread_mutex_destroy(&my.mc_mutex); +- free(my.mc_wbuf[0]); + #endif +- return rc; ++ return rc ? rc : my.mc_error; + } + + /** Copy environment as-is. */ +@@ -9159,7 +10020,7 @@ mdb_env_copyfd0(MDB_env *env, HANDLE fd) + MDB_txn *txn = NULL; + mdb_mutexref_t wmutex = NULL; + int rc; +- size_t wsize, w3; ++ mdb_size_t wsize, w3; + char *ptr; + #ifdef _WIN32 + DWORD len, w2; +@@ -9220,7 +10081,7 @@ mdb_env_copyfd0(MDB_env *env, HANDLE fd) + + w3 = txn->mt_next_pgno * env->me_psize; + { +- size_t fsize = 0; ++ mdb_size_t fsize = 0; + if ((rc = mdb_fsize(env->me_fd, &fsize))) + goto leave; + if (w3 > fsize) +@@ -9659,11 +10520,19 @@ mdb_drop0(MDB_cursor *mc, int subs) + + /* DUPSORT sub-DBs have no ovpages/DBs. Omit scanning leaves. + * This also avoids any P_LEAF2 pages, which have no nodes. ++ * Also if the DB doesn't have sub-DBs and has no overflow ++ * pages, omit scanning leaves. + */ +- if (mc->mc_flags & C_SUB) ++ if ((mc->mc_flags & C_SUB) || ++ (!subs && !mc->mc_db->md_overflow_pages)) + mdb_cursor_pop(mc); + + mdb_cursor_copy(mc, &mx); ++#ifdef MDB_VL32 ++ /* bump refcount for mx's pages */ ++ for (i=0; imc_snum; i++) ++ mdb_page_get(&mx, mc->mc_pg[i]->mp_pgno, &mx.mc_pg[i], NULL); ++#endif + while (mc->mc_snum > 0) { + MDB_page *mp = mc->mc_pg[mc->mc_top]; + unsigned n = NUMKEYS(mp); +@@ -9674,7 +10543,7 @@ mdb_drop0(MDB_cursor *mc, int subs) + MDB_page *omp; + pgno_t pg; + memcpy(&pg, NODEDATA(ni), sizeof(pg)); +- rc = mdb_page_get(txn, pg, &omp, NULL); ++ rc = mdb_page_get(mc, pg, &omp, NULL); + if (rc != 0) + goto done; + mdb_cassert(mc, IS_OVERFLOW(omp)); +@@ -9682,6 +10551,9 @@ mdb_drop0(MDB_cursor *mc, int subs) + pg, omp->mp_pages); + if (rc) + goto done; ++ mc->mc_db->md_overflow_pages -= omp->mp_pages; ++ if (!mc->mc_db->md_overflow_pages && !subs) ++ break; + } else if (subs && (ni->mn_flags & F_SUBDATA)) { + mdb_xcursor_init1(mc, ni); + rc = mdb_drop0(&mc->mc_xcursor->mx_cursor, 0); +@@ -9689,6 +10561,8 @@ mdb_drop0(MDB_cursor *mc, int subs) + goto done; + } + } ++ if (!subs && !mc->mc_db->md_overflow_pages) ++ goto pop; + } else { + if ((rc = mdb_midl_need(&txn->mt_free_pgs, n)) != 0) + goto done; +@@ -9710,6 +10584,7 @@ mdb_drop0(MDB_cursor *mc, int subs) + /* no more siblings, go back to beginning + * of previous level. + */ ++pop: + mdb_cursor_pop(mc); + mc->mc_ki[0] = 0; + for (i=1; imc_snum; i++) { +@@ -9723,6 +10598,8 @@ mdb_drop0(MDB_cursor *mc, int subs) + done: + if (rc) + txn->mt_flags |= MDB_TXN_ERROR; ++ /* drop refcount for mx's pages */ ++ MDB_CURSOR_UNREF(&mx, 0); + } else if (rc == MDB_NOTFOUND) { + rc = MDB_SUCCESS; + } +@@ -9842,7 +10719,7 @@ mdb_reader_list(MDB_env *env, MDB_msg_func *func, void *ctx) + if (mr[i].mr_pid) { + txnid_t txnid = mr[i].mr_txnid; + sprintf(buf, txnid == (txnid_t)-1 ? +- "%10d %"Z"x -\n" : "%10d %"Z"x %"Z"u\n", ++ "%10d %"Z"x -\n" : "%10d %"Z"x %"Yu"\n", + (int)mr[i].mr_pid, (size_t)mr[i].mr_tid, txnid); + if (first) { + first = 0; +@@ -9947,7 +10824,7 @@ mdb_reader_check0(MDB_env *env, int rlocked, int *dead) + } + for (; j + #include "lmdb.h" + +-#ifdef _WIN32 +-#define Z "I" +-#else +-#define Z "z" +-#endif ++#define Yu MDB_PRIy(u) + + #define PRINT 1 + static int mode; +@@ -115,7 +111,7 @@ static int dumpit(MDB_txn *txn, MDB_dbi dbi, char *name) + if (name) + printf("database=%s\n", name); + printf("type=btree\n"); +- printf("mapsize=%" Z "u\n", info.me_mapsize); ++ printf("mapsize=%"Yu"\n", info.me_mapsize); + if (info.me_mapaddr) + printf("mapaddr=%p\n", info.me_mapaddr); + printf("maxreaders=%u\n", info.me_maxreaders); +diff --git a/libraries/liblmdb/mdb_load.c b/libraries/liblmdb/mdb_load.c +index 053cc88..73dfe8c 100644 +--- a/libraries/liblmdb/mdb_load.c ++++ b/libraries/liblmdb/mdb_load.c +@@ -25,7 +25,7 @@ static int mode; + + static char *subname = NULL; + +-static size_t lineno; ++static mdb_size_t lineno; + static int version; + + static int flags; +@@ -38,11 +38,7 @@ static MDB_envinfo info; + + static MDB_val kbuf, dbuf; + +-#ifdef _WIN32 +-#define Z "I" +-#else +-#define Z "z" +-#endif ++#define Yu MDB_PRIy(u) + + #define STRLENOF(s) (sizeof(s)-1) + +@@ -73,7 +69,7 @@ static void readhdr(void) + if (!strncmp(dbuf.mv_data, "VERSION=", STRLENOF("VERSION="))) { + version=atoi((char *)dbuf.mv_data+STRLENOF("VERSION=")); + if (version > 3) { +- fprintf(stderr, "%s: line %" Z "d: unsupported VERSION %d\n", ++ fprintf(stderr, "%s: line %"Yu": unsupported VERSION %d\n", + prog, lineno, version); + exit(EXIT_FAILURE); + } +@@ -83,7 +79,7 @@ static void readhdr(void) + if (!strncmp((char *)dbuf.mv_data+STRLENOF("FORMAT="), "print", STRLENOF("print"))) + mode |= PRINT; + else if (strncmp((char *)dbuf.mv_data+STRLENOF("FORMAT="), "bytevalue", STRLENOF("bytevalue"))) { +- fprintf(stderr, "%s: line %" Z "d: unsupported FORMAT %s\n", ++ fprintf(stderr, "%s: line %"Yu": unsupported FORMAT %s\n", + prog, lineno, (char *)dbuf.mv_data+STRLENOF("FORMAT=")); + exit(EXIT_FAILURE); + } +@@ -94,7 +90,7 @@ static void readhdr(void) + subname = strdup((char *)dbuf.mv_data+STRLENOF("database=")); + } else if (!strncmp(dbuf.mv_data, "type=", STRLENOF("type="))) { + if (strncmp((char *)dbuf.mv_data+STRLENOF("type="), "btree", STRLENOF("btree"))) { +- fprintf(stderr, "%s: line %" Z "d: unsupported type %s\n", ++ fprintf(stderr, "%s: line %"Yu": unsupported type %s\n", + prog, lineno, (char *)dbuf.mv_data+STRLENOF("type=")); + exit(EXIT_FAILURE); + } +@@ -104,7 +100,7 @@ static void readhdr(void) + if (ptr) *ptr = '\0'; + i = sscanf((char *)dbuf.mv_data+STRLENOF("mapaddr="), "%p", &info.me_mapaddr); + if (i != 1) { +- fprintf(stderr, "%s: line %" Z "d: invalid mapaddr %s\n", ++ fprintf(stderr, "%s: line %"Yu": invalid mapaddr %s\n", + prog, lineno, (char *)dbuf.mv_data+STRLENOF("mapaddr=")); + exit(EXIT_FAILURE); + } +@@ -112,9 +108,10 @@ static void readhdr(void) + int i; + ptr = memchr(dbuf.mv_data, '\n', dbuf.mv_size); + if (ptr) *ptr = '\0'; +- i = sscanf((char *)dbuf.mv_data+STRLENOF("mapsize="), "%" Z "u", &info.me_mapsize); ++ i = sscanf((char *)dbuf.mv_data+STRLENOF("mapsize="), ++ "%" MDB_SCNy(u), &info.me_mapsize); + if (i != 1) { +- fprintf(stderr, "%s: line %" Z "d: invalid mapsize %s\n", ++ fprintf(stderr, "%s: line %"Yu": invalid mapsize %s\n", + prog, lineno, (char *)dbuf.mv_data+STRLENOF("mapsize=")); + exit(EXIT_FAILURE); + } +@@ -124,7 +121,7 @@ static void readhdr(void) + if (ptr) *ptr = '\0'; + i = sscanf((char *)dbuf.mv_data+STRLENOF("maxreaders="), "%u", &info.me_maxreaders); + if (i != 1) { +- fprintf(stderr, "%s: line %" Z "d: invalid maxreaders %s\n", ++ fprintf(stderr, "%s: line %"Yu": invalid maxreaders %s\n", + prog, lineno, (char *)dbuf.mv_data+STRLENOF("maxreaders=")); + exit(EXIT_FAILURE); + } +@@ -140,12 +137,12 @@ static void readhdr(void) + if (!dbflags[i].bit) { + ptr = memchr(dbuf.mv_data, '=', dbuf.mv_size); + if (!ptr) { +- fprintf(stderr, "%s: line %" Z "d: unexpected format\n", ++ fprintf(stderr, "%s: line %"Yu": unexpected format\n", + prog, lineno); + exit(EXIT_FAILURE); + } else { + *ptr = '\0'; +- fprintf(stderr, "%s: line %" Z "d: unrecognized keyword ignored: %s\n", ++ fprintf(stderr, "%s: line %"Yu": unrecognized keyword ignored: %s\n", + prog, lineno, (char *)dbuf.mv_data); + } + } +@@ -155,7 +152,7 @@ static void readhdr(void) + + static void badend(void) + { +- fprintf(stderr, "%s: line %" Z "d: unexpected end of input\n", ++ fprintf(stderr, "%s: line %"Yu": unexpected end of input\n", + prog, lineno); + } + +@@ -213,7 +210,7 @@ badend: + buf->mv_data = realloc(buf->mv_data, buf->mv_size*2); + if (!buf->mv_data) { + Eof = 1; +- fprintf(stderr, "%s: line %" Z "d: out of memory, line too long\n", ++ fprintf(stderr, "%s: line %"Yu": out of memory, line too long\n", + prog, lineno); + return EOF; + } +@@ -405,7 +402,7 @@ int main(int argc, char *argv[]) + + rc = readline(&data, &dbuf); + if (rc) { +- fprintf(stderr, "%s: line %" Z "d: failed to read key value\n", prog, lineno); ++ fprintf(stderr, "%s: line %"Yu": failed to read key value\n", prog, lineno); + goto txn_abort; + } + +@@ -420,7 +417,7 @@ int main(int argc, char *argv[]) + if (batch == 100) { + rc = mdb_txn_commit(txn); + if (rc) { +- fprintf(stderr, "%s: line %" Z "d: txn_commit: %s\n", ++ fprintf(stderr, "%s: line %"Yu": txn_commit: %s\n", + prog, lineno, mdb_strerror(rc)); + goto env_close; + } +@@ -440,7 +437,7 @@ int main(int argc, char *argv[]) + rc = mdb_txn_commit(txn); + txn = NULL; + if (rc) { +- fprintf(stderr, "%s: line %" Z "d: txn_commit: %s\n", ++ fprintf(stderr, "%s: line %"Yu": txn_commit: %s\n", + prog, lineno, mdb_strerror(rc)); + goto env_close; + } +diff --git a/libraries/liblmdb/mdb_stat.c b/libraries/liblmdb/mdb_stat.c +index a5cda2f..0343a65 100644 +--- a/libraries/liblmdb/mdb_stat.c ++++ b/libraries/liblmdb/mdb_stat.c +@@ -17,11 +17,8 @@ + #include + #include "lmdb.h" + +-#ifdef _WIN32 +-#define Z "I" +-#else +-#define Z "z" +-#endif ++#define Z MDB_FMT_Z ++#define Yu MDB_PRIy(u) + + static void prstat(MDB_stat *ms) + { +@@ -29,10 +26,10 @@ static void prstat(MDB_stat *ms) + printf(" Page size: %u\n", ms->ms_psize); + #endif + printf(" Tree depth: %u\n", ms->ms_depth); +- printf(" Branch pages: %"Z"u\n", ms->ms_branch_pages); +- printf(" Leaf pages: %"Z"u\n", ms->ms_leaf_pages); +- printf(" Overflow pages: %"Z"u\n", ms->ms_overflow_pages); +- printf(" Entries: %"Z"u\n", ms->ms_entries); ++ printf(" Branch pages: %"Yu"\n", ms->ms_branch_pages); ++ printf(" Leaf pages: %"Yu"\n", ms->ms_leaf_pages); ++ printf(" Overflow pages: %"Yu"\n", ms->ms_overflow_pages); ++ printf(" Entries: %"Yu"\n", ms->ms_entries); + } + + static void usage(char *prog) +@@ -125,11 +122,11 @@ int main(int argc, char *argv[]) + (void)mdb_env_info(env, &mei); + printf("Environment Info\n"); + printf(" Map address: %p\n", mei.me_mapaddr); +- printf(" Map size: %"Z"u\n", mei.me_mapsize); ++ printf(" Map size: %"Yu"\n", mei.me_mapsize); + printf(" Page size: %u\n", mst.ms_psize); +- printf(" Max pages: %"Z"u\n", mei.me_mapsize / mst.ms_psize); +- printf(" Number of pages used: %"Z"u\n", mei.me_last_pgno+1); +- printf(" Last transaction ID: %"Z"u\n", mei.me_last_txnid); ++ printf(" Max pages: %"Yu"\n", mei.me_mapsize / mst.ms_psize); ++ printf(" Number of pages used: %"Yu"\n", mei.me_last_pgno+1); ++ printf(" Last transaction ID: %"Yu"\n", mei.me_last_txnid); + printf(" Max readers: %u\n", mei.me_maxreaders); + printf(" Number of readers used: %u\n", mei.me_numreaders); + } +@@ -156,7 +153,7 @@ int main(int argc, char *argv[]) + if (freinfo) { + MDB_cursor *cursor; + MDB_val key, data; +- size_t pages = 0, *iptr; ++ mdb_size_t pages = 0, *iptr; + + printf("Freelist Status\n"); + dbi = 0; +@@ -176,7 +173,7 @@ int main(int argc, char *argv[]) + pages += *iptr; + if (freinfo > 1) { + char *bad = ""; +- size_t pg, prev; ++ mdb_size_t pg, prev; + ssize_t i, j, span = 0; + j = *iptr++; + for (i = j, prev = 1; --i >= 0; ) { +@@ -187,20 +184,20 @@ int main(int argc, char *argv[]) + pg += span; + for (; i >= span && iptr[i-span] == pg; span++, pg++) ; + } +- printf(" Transaction %"Z"u, %"Z"d pages, maxspan %"Z"d%s\n", +- *(size_t *)key.mv_data, j, span, bad); ++ printf(" Transaction %"Yu", %"Z"d pages, maxspan %"Z"d%s\n", ++ *(mdb_size_t *)key.mv_data, j, span, bad); + if (freinfo > 2) { + for (--j; j >= 0; ) { + pg = iptr[j]; + for (span=1; --j >= 0 && iptr[j] == pg+span; span++) ; +- printf(span>1 ? " %9"Z"u[%"Z"d]\n" : " %9"Z"u\n", ++ printf(span>1 ? " %9"Yu"[%"Z"d]\n" : " %9"Yu"\n", + pg, span); + } + } + } + } + mdb_cursor_close(cursor); +- printf(" Free pages: %"Z"u\n", pages); ++ printf(" Free pages: %"Yu"\n", pages); + } + + rc = mdb_open(txn, subname, 0, &dbi); +diff --git a/libraries/liblmdb/midl.c b/libraries/liblmdb/midl.c +index 5c6d841..9748d8d 100644 +--- a/libraries/liblmdb/midl.c ++++ b/libraries/liblmdb/midl.c +@@ -3,7 +3,7 @@ + /* $OpenLDAP$ */ + /* This work is part of OpenLDAP Software . + * +- * Copyright 2000-2015 The OpenLDAP Foundation. ++ * Copyright 2000-2016 The OpenLDAP Foundation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -354,5 +354,67 @@ int mdb_mid2l_append( MDB_ID2L ids, MDB_ID2 *id ) + return 0; + } + ++#ifdef MDB_VL32 ++unsigned mdb_mid3l_search( MDB_ID3L ids, MDB_ID id ) ++{ ++ /* ++ * binary search of id in ids ++ * if found, returns position of id ++ * if not found, returns first position greater than id ++ */ ++ unsigned base = 0; ++ unsigned cursor = 1; ++ int val = 0; ++ unsigned n = (unsigned)ids[0].mid; ++ ++ while( 0 < n ) { ++ unsigned pivot = n >> 1; ++ cursor = base + pivot + 1; ++ val = CMP( id, ids[cursor].mid ); ++ ++ if( val < 0 ) { ++ n = pivot; ++ ++ } else if ( val > 0 ) { ++ base = cursor; ++ n -= pivot + 1; ++ ++ } else { ++ return cursor; ++ } ++ } ++ ++ if( val > 0 ) { ++ ++cursor; ++ } ++ return cursor; ++} ++ ++int mdb_mid3l_insert( MDB_ID3L ids, MDB_ID3 *id ) ++{ ++ unsigned x, i; ++ ++ x = mdb_mid3l_search( ids, id->mid ); ++ ++ if( x < 1 ) { ++ /* internal error */ ++ return -2; ++ } ++ ++ if ( x <= ids[0].mid && ids[x].mid == id->mid ) { ++ /* duplicate */ ++ return -1; ++ } ++ ++ /* insert id */ ++ ids[0].mid++; ++ for (i=(unsigned)ids[0].mid; i>x; i--) ++ ids[i] = ids[i-1]; ++ ids[x] = *id; ++ ++ return 0; ++} ++#endif /* MDB_VL32 */ ++ + /** @} */ + /** @} */ +diff --git a/libraries/liblmdb/midl.h b/libraries/liblmdb/midl.h +index 2331e78..dc532c4 100644 +--- a/libraries/liblmdb/midl.h ++++ b/libraries/liblmdb/midl.h +@@ -11,7 +11,7 @@ + /* $OpenLDAP$ */ + /* This work is part of OpenLDAP Software . + * +- * Copyright 2000-2015 The OpenLDAP Foundation. ++ * Copyright 2000-2016 The OpenLDAP Foundation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -26,7 +26,7 @@ + #ifndef _MDB_MIDL_H_ + #define _MDB_MIDL_H_ + +-#include ++#include "lmdb.h" + + #ifdef __cplusplus + extern "C" { +@@ -42,7 +42,7 @@ extern "C" { + /** A generic unsigned ID number. These were entryIDs in back-bdb. + * Preferably it should have the same size as a pointer. + */ +-typedef size_t MDB_ID; ++typedef mdb_size_t MDB_ID; + + /** An IDL is an ID List, a sorted array of IDs. The first + * element of the array is a counter for how many actual +@@ -55,7 +55,11 @@ typedef MDB_ID *MDB_IDL; + /* IDL sizes - likely should be even bigger + * limiting factors: sizeof(ID), thread stack size + */ ++#ifdef MDB_VL32 ++#define MDB_IDL_LOGN 14 /* DB_SIZE is 2^14, UM_SIZE is 2^15 */ ++#else + #define MDB_IDL_LOGN 16 /* DB_SIZE is 2^16, UM_SIZE is 2^17 */ ++#endif + #define MDB_IDL_DB_SIZE (1< Date: Mon, 9 Jan 2017 15:54:05 -0800 Subject: [PATCH 043/561] added patch to enable uwp builds --- ports/tiff/fix-uwp.patch | 25 +++++++++++++++++++++++++ ports/tiff/portfile.cmake | 1 + 2 files changed, 26 insertions(+) create mode 100644 ports/tiff/fix-uwp.patch diff --git a/ports/tiff/fix-uwp.patch b/ports/tiff/fix-uwp.patch new file mode 100644 index 0000000000..6fce8d573e --- /dev/null +++ b/ports/tiff/fix-uwp.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 439e26a..05416d8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -187,6 +187,7 @@ endforeach(flag ${test_flags}) + + if(MSVC) + set(CMAKE_DEBUG_POSTFIX "d") ++ add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) + endif() + + option(ld-version-script "Enable linker version script" ON) +diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c +index a0dc68b..3c4e101 100644 +--- a/libtiff/tif_dirread.c ++++ b/libtiff/tif_dirread.c +@@ -3690,7 +3690,7 @@ TIFFReadDirectory(TIFF* tif) + case TIFFTAG_SMAXSAMPLEVALUE: + { + +- double *data; ++ double *data = NULL; + enum TIFFReadDirEntryErr err; + uint32 saved_flags; + int m; diff --git a/ports/tiff/portfile.cmake b/ports/tiff/portfile.cmake index 345024fe0b..281d681b99 100644 --- a/ports/tiff/portfile.cmake +++ b/ports/tiff/portfile.cmake @@ -10,6 +10,7 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/add-component-options.patch + ${CMAKE_CURRENT_LIST_DIR}/fix-uwp.patch ) vcpkg_configure_cmake( From 02964007d6f74dd10db2cb0e05676f03a53c8451 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Mon, 9 Jan 2017 19:57:31 -0800 Subject: [PATCH 044/561] added support for uwp builds --- ports/freetype/0003-Fix-UWP.patch | 63 +++++++++++++++++++++++++++++++ ports/freetype/portfile.cmake | 1 + 2 files changed, 64 insertions(+) create mode 100644 ports/freetype/0003-Fix-UWP.patch diff --git a/ports/freetype/0003-Fix-UWP.patch b/ports/freetype/0003-Fix-UWP.patch new file mode 100644 index 0000000000..253f91e6a1 --- /dev/null +++ b/ports/freetype/0003-Fix-UWP.patch @@ -0,0 +1,63 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 744b2d5..d114b9b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -312,6 +312,9 @@ else () + set(BASE_SRCS ${BASE_SRCS} src/base/ftdebug.c) + endif () + ++if(MSVC) ++ add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS) ++endif() + + if (BUILD_FRAMEWORK) + set(BASE_SRCS +diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h +index 4666d48..382a915 100644 +--- a/include/freetype/freetype.h ++++ b/include/freetype/freetype.h +@@ -845,6 +845,9 @@ FT_BEGIN_HEADER + /*************************************************************************/ + /*************************************************************************/ + ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++#define generic GenericFromFreeTypeLibrary ++#endif + + /*************************************************************************/ + /* */ +@@ -1777,6 +1780,10 @@ FT_BEGIN_HEADER + + } FT_GlyphSlotRec; + ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++#undef generic ++#endif ++ + + /*************************************************************************/ + /*************************************************************************/ +diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c +index fa05347..ae2754b 100644 +--- a/src/base/ftobjs.c ++++ b/src/base/ftobjs.c +@@ -457,6 +457,9 @@ + return error; + } + ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++#define generic GenericFromFreeTypeLibrary ++#endif + + /* documentation is in ftobjs.h */ + +@@ -971,6 +974,9 @@ + FT_FREE( face ); + } + ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++#undef generic ++#endif + + static void + Destroy_Driver( FT_Driver driver ) diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index 2e5e30c787..360345f1c3 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -11,6 +11,7 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Support-Windows-DLLs-via-CMAKE_WINDOWS_EXPORT_ALL_SY.patch ${CMAKE_CURRENT_LIST_DIR}/0002-Add-CONFIG_INSTALL_PATH-option.patch + ${CMAKE_CURRENT_LIST_DIR}/0003-Fix-UWP.patch ) vcpkg_configure_cmake( From df3c619b69dc5fbdbb686d01a5db6e4097f9ca61 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 10 Jan 2017 12:04:17 +0100 Subject: [PATCH 045/561] add libsigcpp --- ports/libsigcpp/CMakeLists.txt | 57 +++++++++++++++++++++++ ports/libsigcpp/CONTROL | 3 ++ ports/libsigcpp/dont-import-symbols.patch | 13 ++++++ ports/libsigcpp/portfile.cmake | 28 +++++++++++ 4 files changed, 101 insertions(+) create mode 100644 ports/libsigcpp/CMakeLists.txt create mode 100644 ports/libsigcpp/CONTROL create mode 100644 ports/libsigcpp/dont-import-symbols.patch create mode 100644 ports/libsigcpp/portfile.cmake diff --git a/ports/libsigcpp/CMakeLists.txt b/ports/libsigcpp/CMakeLists.txt new file mode 100644 index 0000000000..4c44c860d6 --- /dev/null +++ b/ports/libsigcpp/CMakeLists.txt @@ -0,0 +1,57 @@ +cmake_minimum_required(VERSION 3.0) +project(libsigc++) + +set(SIGCPP_API_VERSION 2.0) + +add_definitions(-DSIGC_BUILD) + +include_directories(./MSVC_Net2013) # config file for windows is there +include_directories(.) + +set(SICGPP_SOURCES + sigc++/connection.cc + sigc++/signal_base.cc + sigc++/trackable.cc + sigc++/adaptors/lambda/lambda.cc + sigc++/functors/slot_base.cc) + +add_library(sigc ${SICGPP_SOURCES}) +set_target_properties(sigc PROPERTIES OUTPUT_NAME sigc-${SIGCPP_API_VERSION}) +install(TARGETS sigc RUNTIME DESTINATION bin ARCHIVE DESTINATION lib) + +if(NOT SIGCPP_SKIP_HEADERS) + install(FILES MSVC_Net2013/sigc++config.h DESTINATION include) + install(FILES sigc++/sigc++.h DESTINATION include/sigc++) + install(FILES sigc++/bind.h DESTINATION include/sigc++) + install(FILES sigc++/bind_return.h DESTINATION include/sigc++) + install(FILES sigc++/connection.h DESTINATION include/sigc++) + install(FILES sigc++/limit_reference.h DESTINATION include/sigc++) + install(FILES sigc++/reference_wrapper.h DESTINATION include/sigc++) + install(FILES sigc++/retype_return.h DESTINATION include/sigc++) + install(FILES sigc++/signal.h DESTINATION include/sigc++) + install(FILES sigc++/signal_base.h DESTINATION include/sigc++) + install(FILES sigc++/slot.h DESTINATION include/sigc++) + install(FILES sigc++/trackable.h DESTINATION include/sigc++) + install(FILES sigc++/type_traits.h DESTINATION include/sigc++) + install(FILES sigc++/visit_each.h DESTINATION include/sigc++) + install(FILES sigc++/adaptors/adaptors.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/adaptor_trait.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/bind.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/bind_return.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/bound_argument.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/compose.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/deduce_result_type.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/exception_catch.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/hide.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/retype.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/retype_return.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/track_obj.h DESTINATION include/sigc++/adaptors) + install(FILES sigc++/adaptors/lambda/base.h DESTINATION include/sigc++/adaptors/lambda) + install(FILES sigc++/adaptors/lambda/select.h DESTINATION include/sigc++/adaptors/lambda) + install(FILES sigc++/functors/functors.h DESTINATION include/sigc++/functors) + install(FILES sigc++/functors/functor_trait.h DESTINATION include/sigc++/functors) + install(FILES sigc++/functors/mem_fun.h DESTINATION include/sigc++/functors) + install(FILES sigc++/functors/ptr_fun.h DESTINATION include/sigc++/functors) + install(FILES sigc++/functors/slot.h DESTINATION include/sigc++/functors) + install(FILES sigc++/functors/slot_base.h DESTINATION include/sigc++/functors) +endif() diff --git a/ports/libsigcpp/CONTROL b/ports/libsigcpp/CONTROL new file mode 100644 index 0000000000..02b2e4b836 --- /dev/null +++ b/ports/libsigcpp/CONTROL @@ -0,0 +1,3 @@ +Source: libsigcpp +Version: 2.10 +Description: Typesafe callback framework for C++ diff --git a/ports/libsigcpp/dont-import-symbols.patch b/ports/libsigcpp/dont-import-symbols.patch new file mode 100644 index 0000000000..b031d3bafa --- /dev/null +++ b/ports/libsigcpp/dont-import-symbols.patch @@ -0,0 +1,13 @@ +diff --git a/sigc++config.h b/sigc++config.h +index e212700..8d7366e 100644 +--- a/sigc++config.h ++++ b/sigc++config.h +@@ -72,6 +72,8 @@ + + #endif /* !SIGC_MSC */ + ++#undef SIGC_DLL ++ + #ifdef SIGC_DLL + # if defined(SIGC_BUILD) && defined(_WINDLL) + # define SIGC_API __declspec(dllexport) diff --git a/ports/libsigcpp/portfile.cmake b/ports/libsigcpp/portfile.cmake new file mode 100644 index 0000000000..c98a267176 --- /dev/null +++ b/ports/libsigcpp/portfile.cmake @@ -0,0 +1,28 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libsigc++-2.10.0) +vcpkg_download_distfile(ARCHIVE + URLS "http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.10/libsigc++-2.10.0.tar.xz" + FILENAME "libsigc++-2.10.0.tar.xz" + SHA512 5b96df21d6bd6ba41520c7219e77695a86aabc60b7259262c7a9f4b8475ce0e2fd8dc37bcf7c17e24e818ff28c262d682b964c83e215b51bdbe000f3f58794ae) + +vcpkg_extract_source_archive(${ARCHIVE}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DSIGCPP_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/dont-import-symbols.patch) +endif() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libsigcpp) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libsigcpp/COPYING ${CURRENT_PACKAGES_DIR}/share/libsigcpp/copyright) From 19cf1282d965f1625dc0c3713c0668fafb61abbc Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 10 Jan 2017 12:08:29 +0100 Subject: [PATCH 046/561] [libisigc++] tabs to spaces --- ports/libsigcpp/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/libsigcpp/CMakeLists.txt b/ports/libsigcpp/CMakeLists.txt index 4c44c860d6..7a669a24e2 100644 --- a/ports/libsigcpp/CMakeLists.txt +++ b/ports/libsigcpp/CMakeLists.txt @@ -10,10 +10,10 @@ include_directories(.) set(SICGPP_SOURCES sigc++/connection.cc - sigc++/signal_base.cc - sigc++/trackable.cc - sigc++/adaptors/lambda/lambda.cc - sigc++/functors/slot_base.cc) + sigc++/signal_base.cc + sigc++/trackable.cc + sigc++/adaptors/lambda/lambda.cc + sigc++/functors/slot_base.cc) add_library(sigc ${SICGPP_SOURCES}) set_target_properties(sigc PROPERTIES OUTPUT_NAME sigc-${SIGCPP_API_VERSION}) From f5fb72819614a8c4cb21f67bf887acfc414fc213 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 10 Jan 2017 15:28:45 +0100 Subject: [PATCH 047/561] add libffi --- ports/libffi/CMakeLists.txt | 78 +++++++ ports/libffi/CONTROL | 3 + ports/libffi/auto-define-static-macro.patch | 14 ++ ports/libffi/export-global-data.patch | 35 ++++ ports/libffi/fficonfig.h | 220 ++++++++++++++++++++ ports/libffi/portfile.cmake | 38 ++++ 6 files changed, 388 insertions(+) create mode 100644 ports/libffi/CMakeLists.txt create mode 100644 ports/libffi/CONTROL create mode 100644 ports/libffi/auto-define-static-macro.patch create mode 100644 ports/libffi/export-global-data.patch create mode 100644 ports/libffi/fficonfig.h create mode 100644 ports/libffi/portfile.cmake diff --git a/ports/libffi/CMakeLists.txt b/ports/libffi/CMakeLists.txt new file mode 100644 index 0000000000..79e9e671d5 --- /dev/null +++ b/ports/libffi/CMakeLists.txt @@ -0,0 +1,78 @@ +cmake_minimum_required(VERSION 3.0) +project(libffi) + +# config variables for ffi.h.in +set(VERSION 3.1) +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(TARGET X86_WIN32) +else() + set(TARGET X86_WIN64) +endif() +set(HAVE_LONG_DOUBLE 0) +set(HAVE_LONG_DOUBLE_VARIANT 0) +set(FFI_EXEC_TRAMPOLINE_TABLE 0) + +# mimic layout of original buildsystem +configure_file(include/ffi.h.in ${CMAKE_BINARY_DIR}/include/ffi.h) +file(COPY ${FFI_CONFIG_FILE} DESTINATION ${CMAKE_BINARY_DIR}) +file(COPY src/x86/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include) + +include_directories(${CMAKE_BINARY_DIR}/include) +include_directories(${CMAKE_BINARY_DIR}) +include_directories(include) + +add_definitions(-DHAVE_CONFIG_H) +add_definitions(-DFFI_BUILDING) +if(BUILD_SHARED_LIBS) + add_definitions(-DFFI_EXPORT_DATA) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(ARCH_ASM_NAME win32) + set(ARCH_ASSEMBLER ml /safeseh) +else() + set(ARCH_ASM_NAME win64) + set(ARCH_ASSEMBLER ml64) +endif() + +execute_process( + COMMAND cl /nologo /EP /I. /Iinclude ${CMAKE_SOURCE_DIR}/src/x86/${ARCH_ASM_NAME}.S + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + OUTPUT_FILE ${ARCH_ASM_NAME}.asm) + +# Produced *.asm file could be just added to sources. +# It works in x64 mode, but for some strange reason MASM returns error code when in x86, +# (even though it didn't report any errors and correctly generated object file) +# which in turn causes MSBUILD to stop. +execute_process( + COMMAND ${ARCH_ASSEMBLER} /c /Zi ${ARCH_ASM_NAME}.asm + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + +set(FFI_SOURCES + ${CMAKE_BINARY_DIR}/${ARCH_ASM_NAME}.obj + src/x86/ffi.c + src/closures.c + src/java_raw_api.c + src/prep_cif.c + src/raw_api.c + src/types.c) + +if(CMAKE_BUILD_TYPE STREQUAL Debug) + list(APPEND FFI_SOURCES src/debug.c) + add_definitions(-DFFI_DEBUG) +endif() + +add_library(libffi ${FFI_SOURCES}) + +install(TARGETS libffi + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) + +if(NOT FFI_SKIP_HEADERS) + install(FILES + ${CMAKE_BINARY_DIR}/include/ffi.h + ${CMAKE_BINARY_DIR}/include/ffitarget.h + DESTINATION include) +endif() diff --git a/ports/libffi/CONTROL b/ports/libffi/CONTROL new file mode 100644 index 0000000000..59f4edd5a5 --- /dev/null +++ b/ports/libffi/CONTROL @@ -0,0 +1,3 @@ +Source: libffi +Version: 3.2.1 +Description: Portable, high level programming interface to various calling conventions diff --git a/ports/libffi/auto-define-static-macro.patch b/ports/libffi/auto-define-static-macro.patch new file mode 100644 index 0000000000..468a2fc36b --- /dev/null +++ b/ports/libffi/auto-define-static-macro.patch @@ -0,0 +1,14 @@ +diff --git a/ffi.h b/ffi.h +index 8d5eac2..0b0c2f6 100644 +--- a/ffi.h ++++ b/ffi.h +@@ -174,6 +174,9 @@ typedef struct _ffi_type + /* of the library, but don't worry about that. Besides, */ + /* as a workaround, they can define FFI_BUILDING if they */ + /* *know* they are going to link with the static library. */ ++ ++#define FFI_BUILDING ++ + #if defined _MSC_VER && !defined FFI_BUILDING + #define FFI_EXTERN extern __declspec(dllimport) + #else diff --git a/ports/libffi/export-global-data.patch b/ports/libffi/export-global-data.patch new file mode 100644 index 0000000000..9d965f6477 --- /dev/null +++ b/ports/libffi/export-global-data.patch @@ -0,0 +1,35 @@ +diff --git a/src/types.c b/src/types.c +index 0de5994..46c8d18 100644 +--- a/src/types.c ++++ b/src/types.c +@@ -31,6 +31,12 @@ + #include + #include + ++#ifdef FFI_EXPORT_DATA ++#define FFI_EXPORT __declspec(dllexport) ++#else ++#define FFI_EXPORT ++#endif ++ + /* Type definitions */ + + #define FFI_TYPEDEF(name, type, id) \ +@@ -38,7 +44,7 @@ struct struct_align_##name { \ + char c; \ + type x; \ + }; \ +-const ffi_type ffi_type_##name = { \ ++FFI_EXPORT const ffi_type ffi_type_##name = { \ + sizeof(type), \ + offsetof(struct struct_align_##name, x), \ + id, NULL \ +@@ -56,7 +62,7 @@ ffi_type ffi_type_##name = { \ + } + + /* Size and alignment are fake here. They must not be 0. */ +-const ffi_type ffi_type_void = { ++FFI_EXPORT const ffi_type ffi_type_void = { + 1, 1, FFI_TYPE_VOID, NULL + }; + diff --git a/ports/libffi/fficonfig.h b/ports/libffi/fficonfig.h new file mode 100644 index 0000000000..b5cd2368fe --- /dev/null +++ b/ports/libffi/fficonfig.h @@ -0,0 +1,220 @@ +/* fficonfig.h. Generated from fficonfig.h.in by configure. */ +/* fficonfig.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to the flags needed for the .section .eh_frame directive. */ +/* #undef EH_FRAME_FLAGS */ + +/* Define this if you want extra debugging. */ +/* #undef FFI_DEBUG */ + +/* Cannot use PROT_EXEC on this target, so, we revert to alternative means */ +/* #undef FFI_EXEC_TRAMPOLINE_TABLE */ + +/* Define this if you want to enable pax emulated trampolines */ +/* #undef FFI_MMAP_EXEC_EMUTRAMP_PAX */ + +/* Cannot use malloc on this target, so, we revert to alternative means */ +/* #undef FFI_MMAP_EXEC_WRIT */ + +/* Define this if you do not want support for the raw API. */ +/* #undef FFI_NO_RAW_API */ + +/* Define this if you do not want support for aggregate types. */ +/* #undef FFI_NO_STRUCTS */ + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +/* #undef HAVE_ALLOCA_H */ + +/* Define if your assembler supports .ascii. */ +#ifndef _WIN64 +#define HAVE_AS_ASCII_PSEUDO_OP 1 +#endif + +/* Define if your assembler supports .cfi_* directives. */ +/* #undef HAVE_AS_CFI_PSEUDO_OP */ + +/* Define if your assembler supports .register. */ +/* #undef HAVE_AS_REGISTER_PSEUDO_OP */ + +/* Define if your assembler and linker support unaligned PC relative relocs. + */ +/* #undef HAVE_AS_SPARC_UA_PCREL */ + +/* Define if your assembler supports .string. */ +#ifndef _WIN64 +#define HAVE_AS_STRING_PSEUDO_OP 1 +#endif + +/* Define if your assembler supports unwind section type. */ +/* #undef HAVE_AS_X86_64_UNWIND_SECTION_TYPE */ + +/* Define if your assembler supports PC relative relocs. */ +#ifndef _WIN64 +#define HAVE_AS_X86_PCREL 1 +#endif + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define if __attribute__((visibility("hidden"))) is supported. */ +/* #undef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if you have the long double type and it is bigger than a double */ +/* #undef HAVE_LONG_DOUBLE */ + +/* Define if you support more than one size of the long double type */ +/* #undef HAVE_LONG_DOUBLE_VARIANT */ + +/* Define to 1 if you have the `memcpy' function. */ +/* #undef HAVE_MEMCPY */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mmap' function. */ +/* #undef HAVE_MMAP */ + +/* Define if mmap with MAP_ANON(YMOUS) works. */ +/* #undef HAVE_MMAP_ANON */ + +/* Define if mmap of /dev/zero works. */ +/* #undef HAVE_MMAP_DEV_ZERO */ + +/* Define if read-only mmap of a plain file works. */ +/* #undef HAVE_MMAP_FILE */ + +/* Define if .eh_frame sections should be read-only. */ +/* #undef HAVE_RO_EH_FRAME */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MMAN_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libffi" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "http://github.com/atgreen/libffi/issues" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libffi" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libffi 3.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libffi" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "3.1" + +/* The size of `double', as computed by sizeof. */ +#define SIZEOF_DOUBLE 8 + +/* The size of `long double', as computed by sizeof. */ +#define SIZEOF_LONG_DOUBLE 8 + +/* The size of `size_t', as computed by sizeof. */ +#ifndef _WIN64 +#define SIZEOF_SIZE_T 4 +#else +#define SIZEOF_SIZE_T 8 +#endif + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if symbols are underscored. */ +#ifndef _WIN64 +#define SYMBOL_UNDERSCORE 1 +#endif + +/* Define this if you are using Purify and want to suppress spurious messages. + */ +/* #undef USING_PURIFY */ + +/* Version number of package */ +#define VERSION "3.1" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + + +#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE +#ifdef LIBFFI_ASM +#define FFI_HIDDEN(name) .hidden name +#else +#define FFI_HIDDEN __attribute__ ((visibility ("hidden"))) +#endif +#else +#ifdef LIBFFI_ASM +#define FFI_HIDDEN(name) +#else +#define FFI_HIDDEN +#endif +#endif + diff --git a/ports/libffi/portfile.cmake b/ports/libffi/portfile.cmake new file mode 100644 index 0000000000..2639aa1bae --- /dev/null +++ b/ports/libffi/portfile.cmake @@ -0,0 +1,38 @@ +if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL x86 AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + message(FATAL_ERROR "Architecture not supported") +endif() + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libffi-3.1) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/libffi/libffi/archive/v3.1.zip" + FILENAME "libffi-3.1.zip" + SHA512 a5d4cc638262aecec29e70333119f561588a737fd8f353e18d9bf1bfa7b38eb6aba371778119ea8d35339b458815105d5b110063295b6588a8761b24dac77a7c) + +vcpkg_extract_source_archive(${ARCHIVE}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/export-global-data.patch) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DFFI_CONFIG_FILE=${CMAKE_CURRENT_LIST_DIR}/fficonfig.h + OPTIONS_DEBUG + -DFFI_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/auto-define-static-macro.patch) +endif() + +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libffi) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libffi/LICENSE ${CURRENT_PACKAGES_DIR}/share/libffi/copyright) From 54918bc63af0e776d3419a402338ab156ea6f279 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 10 Jan 2017 15:40:47 +0100 Subject: [PATCH 048/561] correct version --- ports/libffi/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libffi/CONTROL b/ports/libffi/CONTROL index 59f4edd5a5..83725f49c0 100644 --- a/ports/libffi/CONTROL +++ b/ports/libffi/CONTROL @@ -1,3 +1,3 @@ Source: libffi -Version: 3.2.1 +Version: 3.1 Description: Portable, high level programming interface to various calling conventions From 0ec8e0448ffa97c4e6fbaa05529966df379effb1 Mon Sep 17 00:00:00 2001 From: codicodi Date: Wed, 11 Jan 2017 00:54:32 +0100 Subject: [PATCH 049/561] [pixman] enable dynamic build --- ports/pixman/portfile.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/pixman/portfile.cmake b/ports/pixman/portfile.cmake index b4029a26bb..ac6de80f0b 100644 --- a/ports/pixman/portfile.cmake +++ b/ports/pixman/portfile.cmake @@ -5,10 +5,6 @@ # CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - message(STATUS "Warning: Dynamic building not supported. Building static.") # pixman does not export any symbols. - set(VCPKG_LIBRARY_LINKAGE static) -endif() include(vcpkg_common_functions) @@ -27,6 +23,7 @@ file(RENAME ${SOURCE_PATH}/pixman/CMakeLists_pixman.txt ${SOURCE_PATH}/pixman/CM vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON ) vcpkg_install_cmake() From 31aae963efa05229ef70339f5df46ac712204062 Mon Sep 17 00:00:00 2001 From: codicodi Date: Wed, 11 Jan 2017 00:55:10 +0100 Subject: [PATCH 050/561] [pixman] bump version --- ports/pixman/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/pixman/CONTROL b/ports/pixman/CONTROL index 564c814666..3603242d00 100644 --- a/ports/pixman/CONTROL +++ b/ports/pixman/CONTROL @@ -1,3 +1,3 @@ Source: pixman -Version: 0.34.0 +Version: 0.34.0-1 Description: Pixman is a low-level software library for pixel manipulation, providing features such as image compositing and trapezoid rasterization. From 4f5f52ff470e83fa041ac4c6797bfa4e61ed2501 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 10 Jan 2017 16:02:53 -0800 Subject: [PATCH 051/561] Fix error message when looking for PYTHON2 --- ports/fmt/portfile.cmake | 4 ++-- scripts/cmake/vcpkg_find_acquire_program.cmake | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index 3470dbedbe..3ea33e7790 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -31,8 +31,8 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE ${CURRENT_PACKAGES_DIR}/include/fmt/format.cc) -file(REMOVE ${CURRENT_PACKAGES_DIR}/include/fmt/ostream.cc) +#file(REMOVE ${CURRENT_PACKAGES_DIR}/include/fmt/format.cc) +#file(REMOVE ${CURRENT_PACKAGES_DIR}/include/fmt/ostream.cc) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/share/fmt/fmt-targets-debug.cmake ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake) file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake FMT_DEBUG_MODULE) string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" FMT_DEBUG_MODULE "${FMT_DEBUG_MODULE}") diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index b192bc5d78..83e41fe3b6 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -46,8 +46,7 @@ function(vcpkg_find_acquire_program VAR) endif() endif() if(PYTHON2 MATCHES "NOTFOUND") - message(FATAL_ERROR "libuv uses the GYP build system, which requires Python 2.7.\n" - "Python 2.7 was not found in the path or by searching inside C:\\Python27.\n" + message(FATAL_ERROR "Python 2.7 was not found in the path or by searching inside C:\\Python27.\n" "There is no portable redistributable for Python 2.7, so you will need to install the MSI located at:\n" " https://www.python.org/ftp/python/2.7.11/python-2.7.11.amd64.msi\n" ) From b966acc5c2572fff68b763024d9b96a2087aad29 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 10 Jan 2017 17:05:58 -0800 Subject: [PATCH 052/561] Update CHANGELOG and bump version to v0.0.66 --- CHANGELOG.md | 40 ++++++++++++++++++++++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 464d5c3e7f..c052325a95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,43 @@ +vcpkg (0.0.66) +-------------- + * Add ports: + - antlr4 4.6 + - bzip2 1.0.6 + - dx 1.0.0 + - gli 0.8.2 + - libarchive 3.2.2 + - libffi 3.1 + - liblzma 5.2.2 + - libmodplug 0.8.8.5-bb25b05 + - libsigcpp 2.10 + - lmdb 0.9.18-1 + - lz4 1.7.4.2 + - ogre 1.9.0 + - qwt 6.1.3 + - smpeg2 2.0.0 + - spirv-tools 1.1-f72189c249ba143c6a89a4cf1e7d53337b2ddd40 + * Update ports: + - aws-sdk-cpp 1.0.34-1 -> 1.0.47 + - azure-storage-cpp 2.5.0 -> 2.6.0 + - boost 1.62-8 -> 1.62-9 + - chakracore 1.3.1 -> 1.4.0 + - freetype 2.6.3-2 -> 2.6.3-3 + - icu 58.1 -> 58.2-1 + - libbson 1.5.0-rc6 -> 1.5.1 + - libvorbis -> 1.3.5-143caf4023a90c09a5eb685fdd46fb9b9c36b1ee + - lua 5.3.3-1 -> 5.3.3-2 + - mongo-c-driver 1.5.0-rc6 -> 1.5.1 + - pixman 0.34.0 -> 0.34.0-1 + - qt5 5.7-1 -> 5.7.1-2 + - sdl2 2.0.5 -> 2.0.5-2 + - zlib 1.2.8 -> 1.2.10 + * Improvements in pre-install checks: + - Refactor file-exists-check. Improved clarity and performance. + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team TUE, 10 Jan 2017 17:15:00 -0800 + + vcpkg (0.0.65) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 1c65f15d94..475a4440c7 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.65" \ No newline at end of file +"0.0.66" \ No newline at end of file From 07a46c8f49f86d0dd3cd312e1447ba22e79197d6 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Tue, 10 Jan 2017 17:39:13 -0800 Subject: [PATCH 053/561] added support for uwp builds --- ports/libssh2/0001-Fix-UWP.patch | 48 ++++++++++++++++++++++++++++++++ ports/libssh2/portfile.cmake | 4 +++ 2 files changed, 52 insertions(+) create mode 100644 ports/libssh2/0001-Fix-UWP.patch diff --git a/ports/libssh2/0001-Fix-UWP.patch b/ports/libssh2/0001-Fix-UWP.patch new file mode 100644 index 0000000000..270dd7b903 --- /dev/null +++ b/ports/libssh2/0001-Fix-UWP.patch @@ -0,0 +1,48 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 6401acf..64de3e9 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -349,7 +349,7 @@ target_include_directories(libssh2 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + # Check for the OS. + # Daniel's note: this should not be necessary and we need to work to + # get this removed. +-if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") ++if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows" OR ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore") + target_compile_definitions(libssh2 PRIVATE LIBSSH2_WIN32) + elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + target_compile_definitions(libssh2 PRIVATE LIBSSH2_DARWIN) +diff --git a/src/agent.c b/src/agent.c +index c2ba422..f1799f8 100644 +--- a/src/agent.c ++++ b/src/agent.c +@@ -51,6 +51,10 @@ + #include "userauth.h" + #include "session.h" + ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++#define IS_UWP 1 ++#endif /* #if defined(WINAPI_FAMILY) */ ++ + /* Requests from client to agent for protocol 1 key operations */ + #define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1 + #define SSH_AGENTC_RSA_CHALLENGE 3 +@@ -254,7 +258,7 @@ struct agent_ops agent_ops_unix = { + }; + #endif /* PF_UNIX */ + +-#ifdef WIN32 ++#if defined(WIN32) && !defined(IS_UWP) + /* Code to talk to Pageant was taken from PuTTY. + * + * Portions copyright Robert de Bath, Joris van Rantwijk, Delian +@@ -362,8 +366,8 @@ static struct { + const char *name; + struct agent_ops *ops; + } supported_backends[] = { +-#ifdef WIN32 +- {"Pageant", &agent_ops_pageant}, ++#if defined(WIN32) && !defined(IS_UWP) ++ {"Pageant", &agent_ops_pageant}, + #endif /* WIN32 */ + #ifdef PF_UNIX + {"Unix", &agent_ops_unix}, diff --git a/ports/libssh2/portfile.cmake b/ports/libssh2/portfile.cmake index 9b4cc77dd2..2e3ee50090 100644 --- a/ports/libssh2/portfile.cmake +++ b/ports/libssh2/portfile.cmake @@ -7,6 +7,10 @@ vcpkg_download_distfile(ARCHIVE_FILE ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-UWP.patch +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS From 1911fa818225ac02affefd6e85a0626628fcf3e3 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 11 Jan 2017 11:37:19 +0100 Subject: [PATCH 054/561] Acquire 7z Since 7zip is distribute as installer only (no archive) we use msiexec to extract the installer without installing it. msiexec should be available on all windows computers (located in C:/Windows/system32) --- .../cmake/vcpkg_find_acquire_program.cmake | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 83e41fe3b6..df2f30af51 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -57,6 +57,12 @@ function(vcpkg_find_acquire_program VAR) set(URL "http://download.qt.io/official_releases/jom/jom_1_1_1.zip") set(ARCHIVE "jom_1_1_1.zip") set(HASH 23a26dc7e29979bec5dcd3bfcabf76397b93ace64f5d46f2254d6420158bac5eff1c1a8454e3427e7a2fe2c233c5f2cffc87b376772399e12e40b51be2c065f4) + elseif(VAR MATCHES "7Z") + set(PROGNAME 7z) + set(PATHS ${DOWNLOADS}/tools/7z/Files/7-Zip) + set(URL "http://7-zip.org/a/7z1604.msi") + set(ARCHIVE "7z1604.msi") + set(HASH 556f95f7566fe23704d136239e4cf5e2a26f939ab43b44145c91b70d031a088d553e5c21301f1242a2295dcde3143b356211f0108c68e65eef8572407618326d) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() @@ -71,10 +77,21 @@ function(vcpkg_find_acquire_program VAR) if(DEFINED NOEXTRACT) file(COPY ${DOWNLOADS}/${ARCHIVE} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}) else() - execute_process( - COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE} - WORKING_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME} - ) + get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} EXT) + string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION) + if(${ARCHIVE_EXTENSION} STREQUAL ".msi") + file(TO_NATIVE_PATH "${DOWNLOADS}/${ARCHIVE}" ARCHIVE_NATIVE_PATH) + file(TO_NATIVE_PATH "${DOWNLOADS}/tools/${PROGNAME}" DESTINATION_NATIVE_PATH) + execute_process( + COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH} + WORKING_DIRECTORY ${DOWNLOADS} + ) + else() + execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE} + WORKING_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME} + ) + endif() endif() find_program(${VAR} ${PROGNAME} PATHS ${PATHS}) From 2581afcbb301cc4a57b9d508abe0a1073363d9d9 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 11 Jan 2017 11:54:00 +0100 Subject: [PATCH 055/561] Added msmpi port --- ports/msmpi/CONTROL | 3 ++ ports/msmpi/portfile.cmake | 93 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 ports/msmpi/CONTROL create mode 100644 ports/msmpi/portfile.cmake diff --git a/ports/msmpi/CONTROL b/ports/msmpi/CONTROL new file mode 100644 index 0000000000..3d55547a29 --- /dev/null +++ b/ports/msmpi/CONTROL @@ -0,0 +1,3 @@ +Source: msmpi +Version: 7.1 +Description: Microsoft MPI diff --git a/ports/msmpi/portfile.cmake b/ports/msmpi/portfile.cmake new file mode 100644 index 0000000000..0cb1701ce5 --- /dev/null +++ b/ports/msmpi/portfile.cmake @@ -0,0 +1,93 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/msmpi-7.1) + +vcpkg_find_acquire_program(7Z) + +vcpkg_download_distfile(SDK_ARCHIVE + URLS "https://download.microsoft.com/download/E/8/A/E8A080AF-040D-43FF-97B4-065D4F220301/msmpisdk.msi" + FILENAME "msmpisdk-7.1.msi" + SHA512 e3b479189e0effc83c030c74ac6e6762f577cfa94bffb2b35192aab3329b5cfad7933c353c0304754e6b097912b81dbfd4d4b52a5fe5563bd4f3578cd1cf71d7 +) +vcpkg_download_distfile(REDIST_ARCHIVE + URLS "https://download.microsoft.com/download/E/8/A/E8A080AF-040D-43FF-97B4-065D4F220301/MSMpiSetup.exe" + FILENAME "MSMpiSetup-7.1.exe" + SHA512 f75c448e49b1ab4f5e60c958f0c7c1766e06665d65d2bdec42578aa77fb9d5fdc0215cee6ec51909e77d13451490bfff1c324bf9eb4311cb886b98a6ad469a2d +) + +file(TO_NATIVE_PATH "${SDK_ARCHIVE}" SDK_ARCHIVE) +file(TO_NATIVE_PATH "${SOURCE_PATH}/sdk" SDK_SOURCE_DIR) + +vcpkg_execute_required_process( + COMMAND msiexec /a ${SDK_ARCHIVE} /qn TARGETDIR=${SDK_SOURCE_DIR} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} + LOGNAME extract-sdk +) + +vcpkg_execute_required_process( + COMMAND ${7Z} e -o${SOURCE_PATH}/redist -aoa ${REDIST_ARCHIVE} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} + LOGNAME extract-redist +) + +set(SOURCE_INCLUDE_PATH "${SOURCE_PATH}/sdk/PFiles/Microsoft SDKs/MPI/Include") +set(SOURCE_LIB_PATH "${SOURCE_PATH}/sdk/PFiles/Microsoft SDKs/MPI/Lib") +set(SOURCE_BIN_PATH "${SOURCE_PATH}/redist") + +# Install include files +file(INSTALL + "${SOURCE_INCLUDE_PATH}/mpi.h" + "${SOURCE_INCLUDE_PATH}/mpif.h" + "${SOURCE_INCLUDE_PATH}/mpi.f90" + "${SOURCE_INCLUDE_PATH}/${TRIPLET_SYSTEM_ARCH}/mpifptr.h" + DESTINATION + ${CURRENT_PACKAGES_DIR}/include +) + +# NOTE: we do not install the dlls here since they are not architecture independent (x86 only) +# and they seam not to be required by neither mpiexec nor programs build against msmpi.lib + +# Install release libraries and tools +file(INSTALL + "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpi.lib" + "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifec.lib" + "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifmc.lib" + DESTINATION + ${CURRENT_PACKAGES_DIR}/lib +) +# file(INSTALL +# "${SOURCE_BIN_PATH}/msmpi.dll" +# "${SOURCE_BIN_PATH}/msmpires.dll" +# DESTINATION +# ${CURRENT_PACKAGES_DIR}/bin +# ) + +# Install debug libraries +# NOTE: since the binary distribution does not include any debug libraries we simply install the release libraries +file(INSTALL + "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpi.lib" + "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifec.lib" + "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifmc.lib" + DESTINATION + ${CURRENT_PACKAGES_DIR}/debug/lib +) +# file(INSTALL +# "${SOURCE_BIN_PATH}/msmpi.dll" +# "${SOURCE_BIN_PATH}/msmpires.dll" +# DESTINATION +# ${CURRENT_PACKAGES_DIR}/debug/bin +# ) + +# Install tools +file(INSTALL + "${SOURCE_BIN_PATH}/mpiexec.exe" + "${SOURCE_BIN_PATH}/msmpilaunchsvc.exe" + "${SOURCE_BIN_PATH}/smpd.exe" + "${SOURCE_BIN_PATH}/mpitrace.man" + DESTINATION + ${CURRENT_PACKAGES_DIR}/tools +) + +# Handle copyright +file(COPY "${SOURCE_PATH}/sdk/PFiles/Microsoft SDKs/MPI/License/license_sdk.rtf" DESTINATION ${CURRENT_PACKAGES_DIR}/share/msmpi) +#TODO: convert RTF to simple text?! +file(RENAME ${CURRENT_PACKAGES_DIR}/share/msmpi/license_sdk.rtf ${CURRENT_PACKAGES_DIR}/share/msmpi/copyright) From 4bf2b196bff38decfacc921a61b8ff4f0a9d5efd Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 11 Jan 2017 12:01:37 +0100 Subject: [PATCH 056/561] Add port for metis --- ports/metis/CONTROL | 3 ++ ports/metis/disable-programs.patch | 8 ++++ ports/metis/enable-install.patch | 15 ++++++ ports/metis/fix-gklib-vs14-math.patch | 11 +++++ ports/metis/fix-metis-vs14-math.patch | 11 +++++ .../fix-runtime-install-destination.patch | 10 ++++ ports/metis/portfile.cmake | 47 +++++++++++++++++++ 7 files changed, 105 insertions(+) create mode 100644 ports/metis/CONTROL create mode 100644 ports/metis/disable-programs.patch create mode 100644 ports/metis/enable-install.patch create mode 100644 ports/metis/fix-gklib-vs14-math.patch create mode 100644 ports/metis/fix-metis-vs14-math.patch create mode 100644 ports/metis/fix-runtime-install-destination.patch create mode 100644 ports/metis/portfile.cmake diff --git a/ports/metis/CONTROL b/ports/metis/CONTROL new file mode 100644 index 0000000000..cc604ce8f5 --- /dev/null +++ b/ports/metis/CONTROL @@ -0,0 +1,3 @@ +Source: metis +Version: 5.1.0 +Description: Serial Graph Partitioning and Fill-reducing Matrix Ordering diff --git a/ports/metis/disable-programs.patch b/ports/metis/disable-programs.patch new file mode 100644 index 0000000000..0c23be5537 --- /dev/null +++ b/ports/metis/disable-programs.patch @@ -0,0 +1,8 @@ +--- a/CMakeLists.txt Wed Dec 21 18:24:22 2016 ++++ b/CMakeLists.txt Wed Dec 21 18:24:26 2016 +@@ -20,4 +20,4 @@ + # Recursively look for CMakeLists.txt in subdirs. + add_subdirectory("include") + add_subdirectory("libmetis") +-add_subdirectory("programs") ++# add_subdirectory("programs") diff --git a/ports/metis/enable-install.patch b/ports/metis/enable-install.patch new file mode 100644 index 0000000000..9f36623add --- /dev/null +++ b/ports/metis/enable-install.patch @@ -0,0 +1,15 @@ +--- a/CMakeLists.txt Sat Mar 30 17:24:45 2013 ++++ b/CMakeLists.txt Wed Dec 21 18:23:43 2016 +@@ -4,11 +4,7 @@ + set(GKLIB_PATH "GKlib" CACHE PATH "path to GKlib") + set(SHARED FALSE CACHE BOOL "build a shared library") + +-if(MSVC) +- set(METIS_INSTALL FALSE) +-else() +- set(METIS_INSTALL TRUE) +-endif() ++set(METIS_INSTALL TRUE) + + # Configure libmetis library. + if(SHARED) diff --git a/ports/metis/fix-gklib-vs14-math.patch b/ports/metis/fix-gklib-vs14-math.patch new file mode 100644 index 0000000000..e83a682306 --- /dev/null +++ b/ports/metis/fix-gklib-vs14-math.patch @@ -0,0 +1,11 @@ +--- a/GKlib/gk_arch.h Wed Dec 21 18:34:18 2016 ++++ b/GKlib/gk_arch.h Wed Dec 21 18:30:49 2016 +@@ -58,7 +58,7 @@ + #define PTRDIFF_MAX INT64_MAX + #endif + +-#ifdef __MSC__ ++#if defined(__MSC__) && (_MSC_VER < 1900) + /* MSC does not have rint() function */ + #define rint(x) ((int)((x)+0.5)) + diff --git a/ports/metis/fix-metis-vs14-math.patch b/ports/metis/fix-metis-vs14-math.patch new file mode 100644 index 0000000000..a296213e8c --- /dev/null +++ b/ports/metis/fix-metis-vs14-math.patch @@ -0,0 +1,11 @@ +--- a/libmetis/metislib.h Sat Mar 30 17:24:45 2013 ++++ b/libmetis/metislib.h Wed Dec 21 18:30:59 2016 +@@ -31,7 +31,7 @@ + #include + + +-#if defined(COMPILER_MSC) ++#if defined(COMPILER_MSC) && (_MSC_VER < 1900) + #if defined(rint) + #undef rint + #endif diff --git a/ports/metis/fix-runtime-install-destination.patch b/ports/metis/fix-runtime-install-destination.patch new file mode 100644 index 0000000000..8d9147e5f9 --- /dev/null +++ b/ports/metis/fix-runtime-install-destination.patch @@ -0,0 +1,10 @@ +--- a/libmetis/CMakeLists.txt Sat Mar 30 17:24:45 2013 ++++ b/libmetis/CMakeLists.txt Wed Dec 21 17:41:37 2016 +@@ -11,6 +11,6 @@ + if(METIS_INSTALL) + install(TARGETS metis + LIBRARY DESTINATION lib +- RUNTIME DESTINATION lib ++ RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib) + endif() diff --git a/ports/metis/portfile.cmake b/ports/metis/portfile.cmake new file mode 100644 index 0000000000..c53adde4e3 --- /dev/null +++ b/ports/metis/portfile.cmake @@ -0,0 +1,47 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/metis-5.1.0) +vcpkg_download_distfile(ARCHIVE + URLS "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz" + FILENAME "metis-5.1.0.tar.gz" + SHA512 deea47749d13bd06fbeaf98a53c6c0b61603ddc17a43dae81d72c8015576f6495fd83c11b0ef68d024879ed5415c14ebdbd87ce49c181bdac680573bea8bdb25 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/enable-install.patch + ${CMAKE_CURRENT_LIST_DIR}/disable-programs.patch + ${CMAKE_CURRENT_LIST_DIR}/fix-runtime-install-destination.patch + ${CMAKE_CURRENT_LIST_DIR}/fix-metis-vs14-math.patch + ${CMAKE_CURRENT_LIST_DIR}/fix-gklib-vs14-math.patch +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(OPTIONS -DSHARED=ON -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON) +else() + set(OPTIONS -DSHARED=OFF) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + ${OPTIONS} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/metis) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/metis/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/metis/copyright) From 7197fbb53830b5feaeef6a7d4499191d4ad085f8 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 11 Jan 2017 12:04:38 +0100 Subject: [PATCH 057/561] Add port for parmetis --- ports/parmetis/CONTROL | 4 ++ ports/parmetis/fix-gklib-vs14-math.patch | 11 +++++ .../parmetis/fix-libparmetis-cmakelist.patch | 15 ++++++ ports/parmetis/fix-metis-vs14-math.patch | 11 +++++ ports/parmetis/fix-root-cmakelist.patch | 29 ++++++++++++ ports/parmetis/portfile.cmake | 46 +++++++++++++++++++ 6 files changed, 116 insertions(+) create mode 100644 ports/parmetis/CONTROL create mode 100644 ports/parmetis/fix-gklib-vs14-math.patch create mode 100644 ports/parmetis/fix-libparmetis-cmakelist.patch create mode 100644 ports/parmetis/fix-metis-vs14-math.patch create mode 100644 ports/parmetis/fix-root-cmakelist.patch create mode 100644 ports/parmetis/portfile.cmake diff --git a/ports/parmetis/CONTROL b/ports/parmetis/CONTROL new file mode 100644 index 0000000000..86a367cbd1 --- /dev/null +++ b/ports/parmetis/CONTROL @@ -0,0 +1,4 @@ +Source: parmetis +Version: 4.0.3 +Description: Parallel Graph Partitioning and Fill-reducing Matrix Ordering +Build-Depends: metis, msmpi diff --git a/ports/parmetis/fix-gklib-vs14-math.patch b/ports/parmetis/fix-gklib-vs14-math.patch new file mode 100644 index 0000000000..059890e36f --- /dev/null +++ b/ports/parmetis/fix-gklib-vs14-math.patch @@ -0,0 +1,11 @@ +--- a/metis/GKlib/gk_arch.h Wed Dec 21 18:34:18 2016 ++++ b/metis/GKlib/gk_arch.h Wed Dec 21 18:30:49 2016 +@@ -58,7 +58,7 @@ + #define PTRDIFF_MAX INT64_MAX + #endif + +-#ifdef __MSC__ ++#if defined(__MSC__) && (_MSC_VER < 1900) + /* MSC does not have rint() function */ + #define rint(x) ((int)((x)+0.5)) + diff --git a/ports/parmetis/fix-libparmetis-cmakelist.patch b/ports/parmetis/fix-libparmetis-cmakelist.patch new file mode 100644 index 0000000000..6cdd7be622 --- /dev/null +++ b/ports/parmetis/fix-libparmetis-cmakelist.patch @@ -0,0 +1,15 @@ +--- a/libparmetis/CMakeLists.txt Sat Mar 30 17:24:50 2013 ++++ b/libparmetis/CMakeLists.txt Wed Dec 21 19:40:28 2016 +@@ -5,10 +5,10 @@ + # Create libparmetis + add_library(parmetis ${ParMETIS_LIBRARY_TYPE} ${parmetis_sources}) + # Link with metis and MPI libraries. +-target_link_libraries(parmetis metis ${MPI_LIBRARIES}) ++target_link_libraries(parmetis ${METIS_LIBRARY} ${MPI_LIBRARIES}) + set_target_properties(parmetis PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}") + + install(TARGETS parmetis + LIBRARY DESTINATION lib +- RUNTIME DESTINATION lib ++ RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib) diff --git a/ports/parmetis/fix-metis-vs14-math.patch b/ports/parmetis/fix-metis-vs14-math.patch new file mode 100644 index 0000000000..ddf10052a7 --- /dev/null +++ b/ports/parmetis/fix-metis-vs14-math.patch @@ -0,0 +1,11 @@ +--- a/metis/libmetis/metislib.h Sat Mar 30 17:24:45 2013 ++++ b/metis/libmetis/metislib.h Wed Dec 21 18:30:59 2016 +@@ -31,7 +31,7 @@ + #include + + +-#if defined(COMPILER_MSC) ++#if defined(COMPILER_MSC) && (_MSC_VER < 1900) + #if defined(rint) + #undef rint + #endif diff --git a/ports/parmetis/fix-root-cmakelist.patch b/ports/parmetis/fix-root-cmakelist.patch new file mode 100644 index 0000000000..914bf9189c --- /dev/null +++ b/ports/parmetis/fix-root-cmakelist.patch @@ -0,0 +1,29 @@ +--- a/CMakeLists.txt Sat Mar 30 17:24:50 2013 ++++ b/CMakeLists.txt Wed Dec 21 19:38:12 2016 +@@ -16,6 +16,9 @@ + # endif() + # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_COMPILE_FLAGS}") + ++find_package(MPI REQUIRED) ++find_library(METIS_LIBRARY NAMES metis) ++ + # Prepare libraries. + if(SHARED) + set(ParMETIS_LIBRARY_TYPE SHARED) +@@ -30,13 +33,13 @@ + include_directories(include) + include_directories(${MPI_INCLUDE_PATH}) + include_directories(${GKLIB_PATH}) +-include_directories(${METIS_PATH}/include) ++# include_directories(${METIS_PATH}/include) + + # List of directories that cmake will look for CMakeLists.txt +-add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis) ++# add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis) + add_subdirectory(include) + add_subdirectory(libparmetis) +-add_subdirectory(programs) ++# add_subdirectory(programs) + + # This is for testing during development and is not being distributed + #add_subdirectory(test) diff --git a/ports/parmetis/portfile.cmake b/ports/parmetis/portfile.cmake new file mode 100644 index 0000000000..c6022ad473 --- /dev/null +++ b/ports/parmetis/portfile.cmake @@ -0,0 +1,46 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/parmetis-4.0.3) +vcpkg_download_distfile(ARCHIVE + URLS "http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/parmetis-4.0.3.tar.gz" + FILENAME "parmetis-4.0.3.tar.gz" + SHA512 454a91921ca35c981df11c9846a11963ff8fd8407a25179453af33f8fe69493f6dd7f2a0b8feed9a7d3f121e45b715749dd7a94873eaac2bae4cad1e535ca132 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/fix-metis-vs14-math.patch + ${CMAKE_CURRENT_LIST_DIR}/fix-gklib-vs14-math.patch + ${CMAKE_CURRENT_LIST_DIR}/fix-root-cmakelist.patch + ${CMAKE_CURRENT_LIST_DIR}/fix-libparmetis-cmakelist.patch +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(ADDITIONAL_OPTIONS -DSHARED=ON -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON) +else() + set(ADDITIONAL_OPTIONS -DSHARED=OFF) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + ${ADDITIONAL_OPTIONS} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/parmetis) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/parmetis/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/parmetis/copyright) From 86b117028b292f9577c160443601e589151cf550 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 11 Jan 2017 12:13:19 +0100 Subject: [PATCH 058/561] Add port for szip --- ports/szip/CONTROL | 3 +++ ports/szip/portfile.cmake | 42 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 ports/szip/CONTROL create mode 100644 ports/szip/portfile.cmake diff --git a/ports/szip/CONTROL b/ports/szip/CONTROL new file mode 100644 index 0000000000..cabcb582b0 --- /dev/null +++ b/ports/szip/CONTROL @@ -0,0 +1,3 @@ +Source: szip +Version: 2.1 +Description: Szip compression software, providing lossless compression of scientific data diff --git a/ports/szip/portfile.cmake b/ports/szip/portfile.cmake new file mode 100644 index 0000000000..9204771c7c --- /dev/null +++ b/ports/szip/portfile.cmake @@ -0,0 +1,42 @@ +include(vcpkg_common_functions) + +# set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/szip-2.1) +# vcpkg_download_distfile(ARCHIVE +# URLS "https://support.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz" +# FILENAME "szip-2.1.tar.gz" +# SHA512 ea91b877bb061fe6c96988a3c4b705e101a6950e34e9be53d6a57455c6a625be0afa60f4a3cfdd09649205b9f8586cc25ea60fe07a8131579acf3826b35fb749 +# ) +# vcpkg_extract_source_archive(${ARCHIVE}) + +# NOTE: We use Szip from the HDF5 cmake package dir, because it includes a lot of fixes for the CMake build files + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/CMake-hdf5-1.10.0-patch1) +vcpkg_download_distfile(ARCHIVE + URLS "http://hdf4.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.0-patch1/src/CMake-hdf5-1.10.0-patch1.zip" + FILENAME "CMake-hdf5-1.10.0-patch1.zip" + SHA512 ec2edb43438661323be5998ecf64c4dd537ddc7451e31f89390260d16883e60a1ccc1bf745bcb809af22f2bf7157d50331a33910b8ebf5c59cd50693dfb2ef8f +) +vcpkg_extract_source_archive(${ARCHIVE}) +set(ARCHIVE ${SOURCE_PATH}/SZip.tar.gz) +vcpkg_extract_source_archive(${ARCHIVE}) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/Szip) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=1 + -DSZIP_INSTALL_DATA_DIR=share/szip/data + -DSZIP_INSTALL_CMAKE_DIR=share/szip +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(RENAME ${CURRENT_PACKAGES_DIR}/share/szip/data/COPYING ${CURRENT_PACKAGES_DIR}/share/szip/copyright) + +file(READ ${CURRENT_PACKAGES_DIR}/debug/share/szip/szip-targets-debug.cmake SZIP_TARGETS_DEBUG_MODULE) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" SZIP_TARGETS_DEBUG_MODULE "${SZIP_TARGETS_DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/szip/szip-targets-debug.cmake "${SZIP_TARGETS_DEBUG_MODULE}") + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) From fda4bb11ce8403ab05f30bc6965c76f9621cff7a Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 11 Jan 2017 12:18:49 +0100 Subject: [PATCH 059/561] Add port for hdf5 --- ports/hdf5/CONTROL | 4 ++++ ports/hdf5/portfile.cmake | 44 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 ports/hdf5/CONTROL create mode 100644 ports/hdf5/portfile.cmake diff --git a/ports/hdf5/CONTROL b/ports/hdf5/CONTROL new file mode 100644 index 0000000000..46049af870 --- /dev/null +++ b/ports/hdf5/CONTROL @@ -0,0 +1,4 @@ +Source: hdf5 +Version: 1.8.18 +Description: HDF5 is a data model, library, and file format for storing and managing data +Build-Depends: zlib, szip, msmpi \ No newline at end of file diff --git a/ports/hdf5/portfile.cmake b/ports/hdf5/portfile.cmake new file mode 100644 index 0000000000..a09f758b67 --- /dev/null +++ b/ports/hdf5/portfile.cmake @@ -0,0 +1,44 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/hdf5-1.8.18) +vcpkg_download_distfile(ARCHIVE + URLS "https://support.hdfgroup.org/ftp/HDF5/current18/src/hdf5-1.8.18.tar.bz2" + FILENAME "hdf5-1.8.18.tar.bz2" + SHA512 01f6d14bdd3be2ced9c63cc9e1820cd7ea11db649ff9f3a3055c18c4b0fffe777fd23baad536e3bce31c4d76fe17db64a3972762e1bb4d232927c1ca140e72b2 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=1 + -DBUILD_TESTING=OFF + -DHDF5_BUILD_EXAMPLES=OFF + -DHDF5_BUILD_TOOLS=OFF + -DHDF5_BUILD_CPP_LIB=OFF + -DHDF5_ENABLE_PARALLEL=ON + -DHDF5_ENABLE_Z_LIB_SUPPORT=ON + -DHDF5_ENABLE_SZIP_SUPPORT=ON + -DHDF5_ENABLE_SZIP_ENCODING=ON + -DHDF5_INSTALL_DATA_DIR=share/hdf5/data + -DHDF5_INSTALL_CMAKE_DIR=share/hdf5 +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(RENAME ${CURRENT_PACKAGES_DIR}/share/hdf5/data/COPYING ${CURRENT_PACKAGES_DIR}/share/hdf5/copyright) + +file(READ ${CURRENT_PACKAGES_DIR}/debug/share/hdf5/hdf5-targets-debug.cmake HDF5_TARGETS_DEBUG_MODULE) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" HDF5_TARGETS_DEBUG_MODULE "${HDF5_TARGETS_DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/hdf5/hdf5-targets-debug.cmake "${HDF5_TARGETS_DEBUG_MODULE}") + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) From f88b7d667cc9760f3506dbcf0d985d58165afc5a Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 11 Jan 2017 22:15:08 +0800 Subject: [PATCH 060/561] add DirectXTex --- ports/directxtex/CONTROL | 3 ++ ports/directxtex/portfile.cmake | 59 +++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 ports/directxtex/CONTROL create mode 100644 ports/directxtex/portfile.cmake diff --git a/ports/directxtex/CONTROL b/ports/directxtex/CONTROL new file mode 100644 index 0000000000..b11daa8d49 --- /dev/null +++ b/ports/directxtex/CONTROL @@ -0,0 +1,3 @@ +Source: directxtex +Version: dec2016 +Description: DirectXTex texture processing library \ No newline at end of file diff --git a/ports/directxtex/portfile.cmake b/ports/directxtex/portfile.cmake new file mode 100644 index 0000000000..befee008c9 --- /dev/null +++ b/ports/directxtex/portfile.cmake @@ -0,0 +1,59 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# +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) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/directxtex-dec2016) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Microsoft/DirectXTex/archive/dec2016.tar.gz" + FILENAME "directxtex-dec2016.tar.gz" + SHA512 87797340c40a98a7b11b6eb7da17d0b93bc01ba48deed50e99ce74e0e33387cac2ec18f2f14d0148c2a79f97ca98d6b2a228dad2f16010b6dcf03c0d24a79d20 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") + SET(BUILD_ARCH "Win32") +ELSE() + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +ENDIF() + +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/DirectXTex_Desktop_2015.sln + PLATFORM ${BUILD_ARCH} +) + +file(INSTALL + ${SOURCE_PATH}/DirectXTex/DirectXTex.h + ${SOURCE_PATH}/DirectXTex/DirectXTex.inl + DESTINATION ${CURRENT_PACKAGES_DIR}/include +) +file(INSTALL + ${SOURCE_PATH}/DirectXTex/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXTex.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(INSTALL + ${SOURCE_PATH}/DirectXTex/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXTex.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + +set(TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools) +file(MAKE_DIRECTORY ${TOOL_PATH}) +file(INSTALL + ${SOURCE_PATH}/Texdiag/Bin/Desktop_2015/${BUILD_ARCH}/Release/texdiag.exe + DESTINATION ${TOOL_PATH}) +file(INSTALL + ${SOURCE_PATH}/Texconv/Bin/Desktop_2015/${BUILD_ARCH}/Release/Texconv.exe + DESTINATION ${TOOL_PATH}) +file(INSTALL + ${SOURCE_PATH}/Texassemble/Bin/Desktop_2015/${BUILD_ARCH}/Release/Texassemble.exe + DESTINATION ${TOOL_PATH}) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/DirectXTex) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/DirectXTex/LICENSE ${CURRENT_PACKAGES_DIR}/share/DirectXTex/copyright) From 09c8abf7abd669ebd330660a50186e41a1839214 Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 11 Jan 2017 22:42:37 +0800 Subject: [PATCH 061/561] add DirectXMesh --- ports/directxmesh/CONTROL | 3 ++ ports/directxmesh/portfile.cmake | 48 ++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 ports/directxmesh/CONTROL create mode 100644 ports/directxmesh/portfile.cmake diff --git a/ports/directxmesh/CONTROL b/ports/directxmesh/CONTROL new file mode 100644 index 0000000000..13401f80d5 --- /dev/null +++ b/ports/directxmesh/CONTROL @@ -0,0 +1,3 @@ +Source: directxmesh +Version: oct2016 +Description: DirectXMesh geometry processing library \ No newline at end of file diff --git a/ports/directxmesh/portfile.cmake b/ports/directxmesh/portfile.cmake new file mode 100644 index 0000000000..45ed111ee9 --- /dev/null +++ b/ports/directxmesh/portfile.cmake @@ -0,0 +1,48 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DirectXMesh-oct2016) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Microsoft/DirectXMesh/archive/oct2016.tar.gz" + FILENAME "DirectXMesh-oct2016.tar.gz" + SHA512 8aaf9749766afd23709ce6c6f8d74b008fe9f96789e4d97cb387633dad34b4132ef28dfe028d13c779ea366428d53076a881c0d63c4f0c2c74d552293c8d6bf1 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") + SET(BUILD_ARCH "Win32") +ELSE() + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +ENDIF() + +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/DirectXMesh_Desktop_2015.sln + PLATFORM ${BUILD_ARCH} +) + +file(INSTALL + ${SOURCE_PATH}/DirectXMesh/DirectXMesh.h + ${SOURCE_PATH}/DirectXMesh/DirectXMesh.inl + DESTINATION ${CURRENT_PACKAGES_DIR}/include +) +file(INSTALL + ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXMesh.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(INSTALL + ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXMesh.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + +set(TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools) +file(INSTALL + ${SOURCE_PATH}/Meshconvert/Bin/Desktop_2015/${BUILD_ARCH}/Release/Meshconvert.exe + DESTINATION ${TOOL_PATH}) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/directxmesh) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/directxmesh/LICENSE ${CURRENT_PACKAGES_DIR}/share/directxmesh/copyright) From 2eadcd75add69718b9e63779b0701b5bc8e05ffe Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 11 Jan 2017 22:50:55 +0800 Subject: [PATCH 062/561] [directxtk] upgrade to dec2016 --- ports/directxtk/CONTROL | 2 +- ports/directxtk/portfile.cmake | 8 ++++---- ports/directxtk12/CONTROL | 2 +- ports/directxtk12/portfile.cmake | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ports/directxtk/CONTROL b/ports/directxtk/CONTROL index b5e0bcb7d2..8a3da81a6e 100644 --- a/ports/directxtk/CONTROL +++ b/ports/directxtk/CONTROL @@ -1,3 +1,3 @@ Source: directxtk -Version: oct2016-1 +Version: dec2016 Description: A collection of helper classes for writing DirectX 11.x code in C++. diff --git a/ports/directxtk/portfile.cmake b/ports/directxtk/portfile.cmake index c14b7c6aa3..08f8a45371 100644 --- a/ports/directxtk/portfile.cmake +++ b/ports/directxtk/portfile.cmake @@ -4,11 +4,11 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DirectXTK-oct2016) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DirectXTK-dec2016) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/Microsoft/DirectXTK/archive/oct2016.tar.gz" - FILENAME "oct2016.tar.gz" - SHA512 b44ee28518ca65d38a3c915881ef79533b48b07d3738b616f1935d7c00a26d5e48b2292cde6acc34e933f85ba2a6362c585c60b2bbc704745d43cef53769a112 + URLS "https://github.com/Microsoft/DirectXTK/archive/dec2016.tar.gz" + FILENAME "DirectXTK-dec2016.tar.gz" + SHA512 efb8a98d0872bf1835b274ba88615e88c4a58ab753c5ebef5a407c54d5f9a2197d1521f14651c60ea16c047918db6f54bf2ac58a6eb7330490b9bae619e8dad3 ) vcpkg_extract_source_archive(${ARCHIVE}) diff --git a/ports/directxtk12/CONTROL b/ports/directxtk12/CONTROL index dd9ca5620e..60393a1d94 100644 --- a/ports/directxtk12/CONTROL +++ b/ports/directxtk12/CONTROL @@ -1,3 +1,3 @@ Source: directxtk12 -Version: oct2016 +Version: dec2016 Description: A collection of helper classes for writing DirectX 12 code in C++. diff --git a/ports/directxtk12/portfile.cmake b/ports/directxtk12/portfile.cmake index 19372a3b16..e6f2fb4d8b 100644 --- a/ports/directxtk12/portfile.cmake +++ b/ports/directxtk12/portfile.cmake @@ -4,11 +4,11 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DirectXTK12-oct2016) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DirectXTK12-dec2016) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/Microsoft/DirectXTK12/archive/oct2016.tar.gz" - FILENAME "DirectXTK12-oct2016.tar.gz" - SHA512 f33af80dc018c1fda117eeef66bd08046b48572806d879651187cbed9d5ceb402b1798ecc0e1089b54ddb879e5355b45f2b67e3be99fbe270c5216a945a9924b + URLS "https://github.com/Microsoft/DirectXTK12/archive/dec2016.tar.gz" + FILENAME "DirectXTK12-dec2016.tar.gz" + SHA512 7c98fbf1d7ef96807a38d396a87dacdc60fdcd7e461210d246cc424789c4c5c5fb1390db958c1bd1f77da8af756a9eae36813e5da6bbb0ea1432ff4004f1d010 ) vcpkg_extract_source_archive(${ARCHIVE}) From c104c8966f7bf2fa6576d25cc3631894008c94e1 Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 11 Jan 2017 23:09:29 +0800 Subject: [PATCH 063/561] add uvatlas --- ports/uvatlas/CONTROL | 4 +++ ports/uvatlas/portfile.cmake | 56 ++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 ports/uvatlas/CONTROL create mode 100644 ports/uvatlas/portfile.cmake diff --git a/ports/uvatlas/CONTROL b/ports/uvatlas/CONTROL new file mode 100644 index 0000000000..0e842d8fb1 --- /dev/null +++ b/ports/uvatlas/CONTROL @@ -0,0 +1,4 @@ +Source: uvatlas +Version: sept2016 +Description: UVAtlas isochart texture atlas +Build-Depends: directxtex, directxmesh \ No newline at end of file diff --git a/ports/uvatlas/portfile.cmake b/ports/uvatlas/portfile.cmake new file mode 100644 index 0000000000..9f4bc53085 --- /dev/null +++ b/ports/uvatlas/portfile.cmake @@ -0,0 +1,56 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +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) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/UVAtlas-sept2016) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Microsoft/UVAtlas/archive/sept2016.tar.gz" + FILENAME "UVAtlas-sept2016.tar.gz" + SHA512 326af26c151620cd5082daf3913cf3fbe7bca7d1aaf5cc44cacff54319ffe79b728c24519187c3f9393a846430d0fb9493ffe9473f87d220f5c9ae7dab73f69f +) +vcpkg_extract_source_archive(${ARCHIVE}) + +IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") + SET(BUILD_ARCH "Win32") +ELSE() + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +ENDIF() + +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/UVAtlas/UVAtlas_2015.sln + PLATFORM ${BUILD_ARCH} +) +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/UVAtlasTool/UVAtlasTool_2015.sln + PLATFORM ${BUILD_ARCH} +) + +file(INSTALL + ${SOURCE_PATH}/Inc/ + DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(INSTALL + ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Release/UVAtlas.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(INSTALL + ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(INSTALL + ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(INSTALL + ${SOURCE_PATH}/UVAtlasTool/Bin/Desktop_2015/${BUILD_ARCH}/Release/UVAtlasTool.exe + DESTINATION ${CURRENT_PACKAGES_DIR}/tools) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/uvatlas) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/uvatlas/LICENSE ${CURRENT_PACKAGES_DIR}/share/uvatlas/copyright) From 719e9c7446a3fb40974c8686e5def4d5e544babc Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Wed, 11 Jan 2017 07:42:54 -0800 Subject: [PATCH 064/561] added missing store parameter to vcvarsall for uwp builds --- ports/openssl/setVSvars.bat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/openssl/setVSvars.bat b/ports/openssl/setVSvars.bat index 23259821e0..e6ebc0a7d1 100644 --- a/ports/openssl/setVSvars.bat +++ b/ports/openssl/setVSvars.bat @@ -3,7 +3,7 @@ call:set_%1 exit /b :set_universal10.0Win32 call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86 + call "%_VS14VC%vcvarsall" x86 store set _VCPlatform=x86 set _VCLibPlat= call:setEnv @@ -11,7 +11,7 @@ exit /b :set_universal10.0x64 call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x64 + call "%_VS14VC%vcvarsall" x64 store set _VCPlatform=x64 set _VCLibPlat=amd64 call:setEnv @@ -19,7 +19,7 @@ exit /b :set_universal10.0arm call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86_arm + call "%_VS14VC%vcvarsall" x86_arm store set _VCPlatform=ARM set _VCLibPlat=ARM call:setEnv @@ -27,7 +27,7 @@ exit /b :set_universal10.0arm64 call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86_arm64 + call "%_VS14VC%vcvarsall" x86_arm64 store set _VCPlatform=ARM64 set _VCLibPlat=ARM64 call:setEnv From 00679b66e3d9fd49afd19a88418426fb50c39b08 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Wed, 11 Jan 2017 10:59:45 -0800 Subject: [PATCH 065/561] added support for building uwp versions --- ports/curl/0002_fix_uwp.patch | 92 +++++++++++++++++++++++++++++++++++ ports/curl/portfile.cmake | 46 ++++++++++++++---- 2 files changed, 128 insertions(+), 10 deletions(-) create mode 100644 ports/curl/0002_fix_uwp.patch diff --git a/ports/curl/0002_fix_uwp.patch b/ports/curl/0002_fix_uwp.patch new file mode 100644 index 0000000000..a96f678388 --- /dev/null +++ b/ports/curl/0002_fix_uwp.patch @@ -0,0 +1,92 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ed3f38a..d6480b7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1010,7 +1010,9 @@ include(CMake/OtherTests.cmake) + add_definitions(-DHAVE_CONFIG_H) + + # For windows, do not allow the compiler to use default target (Vista). +-if(WIN32) ++if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") ++ add_definitions(-D_WIN32_WINNT=0x0A00 -DHAVE_STRUCT_POLLFD -D_WINSOCK_DEPRECATED_NO_WARNINGS) ++elseif(WIN32) + add_definitions(-D_WIN32_WINNT=0x0501) + endif(WIN32) + +diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c +index 2591fd8..4380b7c 100644 +--- a/lib/curl_gethostname.c ++++ b/lib/curl_gethostname.c +@@ -21,6 +21,7 @@ + ***************************************************************************/ + + #include "curl_setup.h" ++#include "curl/curl.h" + + #include "curl_gethostname.h" + +@@ -64,7 +65,7 @@ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) { + #ifdef DEBUGBUILD + + /* Override host name when environment variable CURL_GETHOSTNAME is set */ +- const char *force_hostname = getenv("CURL_GETHOSTNAME"); ++ const char *force_hostname = curl_getenv("CURL_GETHOSTNAME"); + if(force_hostname) { + strncpy(name, force_hostname, namelen); + err = 0; +diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c +index 812a073..3c322ed 100644 +--- a/lib/curl_ntlm_core.c ++++ b/lib/curl_ntlm_core.c +@@ -696,7 +696,7 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, + + /* Calculate the timestamp */ + #ifdef DEBUGBUILD +- char *force_timestamp = getenv("CURL_FORCETIME"); ++ char *force_timestamp = curl_getenv("CURL_FORCETIME"); + if(force_timestamp) + tw = CURL_OFF_T_C(11644473600) * 10000000; + else +diff --git a/lib/ftp.c b/lib/ftp.c +index b231731..d50779f 100644 +--- a/lib/ftp.c ++++ b/lib/ftp.c +@@ -3250,7 +3250,7 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status, + ssize_t nread; + int ftpcode; + CURLcode result = CURLE_OK; +- char *path; ++ char *path = NULL; + const char *path_to_use = data->state.path; + + if(!ftp) +diff --git a/lib/smb.c b/lib/smb.c +index 7cb0c96..2f43d3c 100644 +--- a/lib/smb.c ++++ b/lib/smb.c +@@ -32,8 +32,12 @@ + + #ifdef HAVE_PROCESS_H + #include ++#if defined(CURL_WINDOWS_APP) ++#define getpid GetCurrentProcessId ++#else + #define getpid _getpid + #endif ++#endif + + #include "smb.h" + #include "urldata.h" +diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c +index 56a8823..4032e7e 100644 +--- a/lib/vtls/vtls.c ++++ b/lib/vtls/vtls.c +@@ -197,7 +197,7 @@ unsigned int Curl_rand(struct Curl_easy *data) + static bool seeded = FALSE; + + #ifdef CURLDEBUG +- char *force_entropy = getenv("CURL_ENTROPY"); ++ char *force_entropy = curl_getenv("CURL_ENTROPY"); + if(force_entropy) { + if(!seeded) { + size_t elen = strlen(force_entropy); diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index 01c76718b6..e8fc658c0c 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -13,22 +13,48 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch ) +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0002_fix_uwp.patch +) +endif() + if (VCPKG_CRT_LINKAGE STREQUAL dynamic) SET(CURL_STATICLIB OFF) else() SET(CURL_STATICLIB ON) endif() -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DBUILD_TESTING=OFF - -DBUILD_CURL_EXE=OFF - -DENABLE_MANUAL=OFF - -DCURL_STATICLIB=${CURL_STATICLIB} - OPTIONS_DEBUG - -DENABLE_DEBUG=ON -) +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_TESTING=OFF + -DBUILD_CURL_EXE=OFF + -DENABLE_MANUAL=OFF + -DUSE_WIN32_LDAP=OFF + -DCURL_DISABLE_TELNET=ON + -DENABLE_IPV6=OFF + -DENABLE_UNIX_SOCKETS=OFF + -DCMAKE_USE_OPENSSL=ON + -DCURL_STATICLIB=${CURL_STATICLIB} + OPTIONS_DEBUG + -DENABLE_DEBUG=ON + ) +else() + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_TESTING=OFF + -DBUILD_CURL_EXE=OFF + -DENABLE_MANUAL=OFF + -DCURL_STATICLIB=${CURL_STATICLIB} + OPTIONS_DEBUG + -DENABLE_DEBUG=ON + ) +endif() vcpkg_install_cmake() From 275a59dd9dc9b6ec324ac9eb5460193bfd53b736 Mon Sep 17 00:00:00 2001 From: codicodi Date: Wed, 11 Jan 2017 21:20:53 +0100 Subject: [PATCH 066/561] Add glib --- ports/glib/CMakeLists.txt | 161 +++++++++++ ports/glib/CONTROL | 4 + ports/glib/cmake/install_headers.cmake | 255 ++++++++++++++++++ ports/glib/portfile.cmake | 32 +++ ports/glib/use-libiconv-on-windows.patch | 14 + scripts/cmake/vcpkg_common_functions.cmake | 1 + .../cmake/vcpkg_copy_tool_dependencies.cmake | 16 ++ 7 files changed, 483 insertions(+) create mode 100644 ports/glib/CMakeLists.txt create mode 100644 ports/glib/CONTROL create mode 100644 ports/glib/cmake/install_headers.cmake create mode 100644 ports/glib/portfile.cmake create mode 100644 ports/glib/use-libiconv-on-windows.patch create mode 100644 scripts/cmake/vcpkg_copy_tool_dependencies.cmake diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt new file mode 100644 index 0000000000..79d460bab0 --- /dev/null +++ b/ports/glib/CMakeLists.txt @@ -0,0 +1,161 @@ +cmake_minimum_required(VERSION 3.0) +project(glib) + +set(GLIB_VERSION 2.50.2) +set(GLIB_DLL_SUFFIX 2) +set(GLIB_LIB_SUFFIX 2.0) + +if(CMAKE_BUILD_TYPE STREQUAL Debug) + add_definitions(-DG_ENABLE_DEBUG) +endif() + +if(BUILD_SHARED_LIBS) + set(GLIB_EXPORT_MACRO DLL_EXPORT) +endif() + +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) + +# find dependencies + +# zlib +find_package(ZLIB REQUIRED) +# pcre +find_path(PCRE_INCLUDE_DIR pcre.h) +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(PCRE_SUFFIX d) +endif() +find_library(PCRE_LIBRARY pcre${PCRE_SUFFIX}) +# libiconv +find_path(ICONV_INCLUDE_DIR iconv.h) +find_library(ICONV_LIBRARY NAMES iconv libiconv) +# libffi +find_path(FFI_INCLUDE_DIR ffi.h) +find_library(FFI_LIBRARY NAMES ffi libffi) +# libintl(gettext) +find_path(LIBINTL_INCLUDE_DIR libintl.h) +find_library(LIBINTL_LIBRARY NAMES intl libintl) + +#prepare config files +configure_file(config.h.win32 ${CMAKE_SOURCE_DIR}/config.h COPYONLY) +configure_file(glib/glibconfig.h.win32 ${CMAKE_SOURCE_DIR}/glib/glibconfig.h COPYONLY) +configure_file(gmodule/gmoduleconf.h.win32 ${CMAKE_SOURCE_DIR}/gmodule/gmoduleconf.h COPYONLY) +configure_file(gio/gnetworking.h.win32 ${CMAKE_SOURCE_DIR}/gio/gnetworking.h COPYONLY) +add_definitions(-DHAVE_CONFIG_H) + +include_directories(. ./glib) + +# This macro purposely doesn't find nodes with sources that have additional properties set +# Most of such files in glib are PCRE sources which we don't use anyway +macro(extract_vcproj_sources VC_PROJECT OUT_VAR) + file(READ ${VC_PROJECT} ${VC_PROJECT}-CONTENTS) + STRING(REPLACE "\n" ";" ${VC_PROJECT}-CONTENTS "${${VC_PROJECT}-CONTENTS}") # split by lines + foreach(LINE ${${VC_PROJECT}-CONTENTS}) + if(LINE MATCHES "") + string(REPLACE "" "" LINE ${LINE}) + string(STRIP ${LINE} LINE) + file(TO_CMAKE_PATH ${LINE} LINE) + list(APPEND ${OUT_VAR} ${LINE}) + endif() + endforeach() +endmacro() + +# main module +extract_vcproj_sources(build/win32/vs14/glib.vcxproj GLIB_SOURCES) +list(APPEND GLIB_SOURCES glib/libcharset/localcharset.c) # modified internal version with prefixed symbols +add_library(glib ${GLIB_SOURCES}) +target_compile_definitions(glib PRIVATE USE_SYSTEM_PCRE ${GLIB_EXPORT_MACRO} GLIB_COMPILATION G_LOG_DOMAIN="GLib" LIBDIR) +target_link_libraries(glib ws2_32 winmm ${PCRE_LIBRARY} ${ICONV_LIBRARY} ${LIBINTL_LIBRARY}) +target_include_directories(glib PRIVATE ${PCRE_INCLUDE_DIR} ${ICONV_INCLUDE_DIR}) +target_include_directories(glib PUBLIC ${LIBINTL_INCLUDE_DIR}) +list(APPEND GLIB_TARGETS glib) + +# gthread +add_library(gthread gthread/gthread-impl.c) +target_compile_definitions(gthread PRIVATE G_LOG_DOMAIN="GThread") +target_link_libraries(gthread glib ${LIBINTL_LIBRARY}) +target_include_directories(gthread PRIVATE ${LIBINTL_INCLUDE_DIR}) +list(APPEND GLIB_TARGETS gthread) + +# gobject +extract_vcproj_sources(build/win32/vs14/gobject.vcxproj GOBJECT_SOURCES) +add_library(gobject ${GOBJECT_SOURCES}) +target_compile_definitions(gobject PRIVATE GOBJECT_COMPILATION ${GLIB_EXPORT_MACRO} G_LOG_DOMAIN="GLib-GObject") +target_link_libraries(gobject gthread glib ${FFI_LIBRARY}) +target_include_directories(gobject PRIVATE ${FFI_INCLUDE_DIR}) +list(APPEND GLIB_TARGETS gobject) + +# gmodule +add_library(gmodule gmodule/gmodule.c) +target_compile_definitions(gmodule PRIVATE G_LOG_DOMAIN="GModule") +target_link_libraries(gmodule glib ${LIBINTL_LIBRARY}) +target_include_directories(gmodule PRIVATE ${LIBINTL_INCLUDE_DIR}) +list(APPEND GLIB_TARGETS gmodule) + +# gio +extract_vcproj_sources(build/win32/vs14/gio.vcxproj GIO_SOURCES) +add_library(gio ${GIO_SOURCES}) +target_compile_definitions(gio PRIVATE GIO_COMPILATION ${GLIB_EXPORT_MACRO} G_LOG_DOMAIN="GLib-GIO") +target_link_libraries(gio glib gmodule gobject ws2_32 shlwapi dnsapi iphlpapi ${ZLIB_LIBRARIES}) +target_include_directories(gio PRIVATE ./gio ./gmodule ${ZLIB_INCLUDE_DIRS}) +list(APPEND GLIB_TARGETS gio) + +foreach(GTARGET ${GLIB_TARGETS}) + set_target_properties(${GTARGET} PROPERTIES + OUTPUT_NAME ${GTARGET}-${GLIB_DLL_SUFFIX} + ARCHIVE_OUTPUT_NAME ${GTARGET}-${GLIB_LIB_SUFFIX}) +endforeach() + +macro(add_glib_tool TOOL_NAME) + add_executable(${TOOL_NAME} ${ARGN}) + target_link_libraries(${TOOL_NAME} glib) + target_compile_definitions(${TOOL_NAME} PRIVATE GLIB_COMPILATION) + list(APPEND GLIB_TOOLS ${TOOL_NAME}) +endmacro() + +macro(add_gio_tool TOOL_NAME) + add_executable(${TOOL_NAME} ${ARGN}) + target_link_libraries(${TOOL_NAME} glib gio gobject gmodule) + target_include_directories(${TOOL_NAME} PRIVATE ./gmodule ./gio) + target_compile_definitions(${TOOL_NAME} PRIVATE GIO_COMPILATION) + list(APPEND GLIB_TOOLS ${TOOL_NAME}) +endmacro() + +if(NOT GLIB_SKIP_TOOLS) + configure_file(gobject/glib-mkenums.in ${CMAKE_SOURCE_DIR}/gobject/glib-mkenums @ONLY) # uses GLIB_VERSION + install(FILES gobject/glib-mkenums DESTINATION tools) + + add_gio_tool(gdbus gio/gdbus-tool.c) + add_gio_tool(gio-querymodules gio/gio-querymodules.c) + file(GLOB GIO_TOOL_SOURCES gio/gio-tool*.c) + add_gio_tool(gio-tool ${GIO_TOOL_SOURCES}) + set_target_properties(gio-tool PROPERTIES OUTPUT_NAME gio) + add_gio_tool(glib-compile-resources gio/glib-compile-resources.c gio/gvdb/gvdb-builder.c) + add_gio_tool(glib-compile-schemas gio/glib-compile-schemas.c gio/gvdb/gvdb-builder.c) + add_gio_tool(gresource gio/gresource-tool.c) + add_gio_tool(gsettings gio/gsettings-tool.c) + + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(WIN win32) + else() + set(WIN win64) + endif() + + add_glib_tool(glib-genmarshal gobject/glib-genmarshal.c) + add_glib_tool(gspawn-${WIN}-helper WIN32 glib/gspawn-win32-helper.c) + add_glib_tool(gspawn-${WIN}-helper-console glib/gspawn-win32-helper-console.c) + + install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools) +endif() + +install(TARGETS ${GLIB_TARGETS} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) +if(NOT GLIB_SKIP_HEADERS) + include(install_headers) +endif() + +message(STATUS "Link-time dependencies:") +message(STATUS " " ${ZLIB_LIBRARIES}) +message(STATUS " " ${PCRE_LIBRARY}) +message(STATUS " " ${ICONV_LIBRARY}) +message(STATUS " " ${FFI_LIBRARY}) +message(STATUS " " ${LIBINTL_LIBRARY}) diff --git a/ports/glib/CONTROL b/ports/glib/CONTROL new file mode 100644 index 0000000000..984d7576a6 --- /dev/null +++ b/ports/glib/CONTROL @@ -0,0 +1,4 @@ +Source: glib +Version: 2.50.2 +Description: Portable, general-purpose utility library. +Build-Depends: zlib, pcre, libffi, gettext, libiconv diff --git a/ports/glib/cmake/install_headers.cmake b/ports/glib/cmake/install_headers.cmake new file mode 100644 index 0000000000..e94a12e49a --- /dev/null +++ b/ports/glib/cmake/install_headers.cmake @@ -0,0 +1,255 @@ +# generated from glib-install.props +install(FILES glib/glib.h DESTINATION include) +install(FILES glib/glibconfig.h DESTINATION include) +install(FILES glib/glib.h DESTINATION include) +install(FILES glib/glib-object.h DESTINATION include) +install(FILES glib/deprecated/gallocator.h DESTINATION include/glib/deprecated) +install(FILES glib/deprecated/gcache.h DESTINATION include/glib/deprecated) +install(FILES glib/deprecated/gcompletion.h DESTINATION include/glib/deprecated) +install(FILES glib/deprecated/gmain.h DESTINATION include/glib/deprecated) +install(FILES glib/deprecated/grel.h DESTINATION include/glib/deprecated) +install(FILES glib/deprecated/gthread.h DESTINATION include/glib/deprecated) +install(FILES glib/glib-autocleanups.h DESTINATION include/glib) +install(FILES glib/galloca.h DESTINATION include/glib) +install(FILES glib/garray.h DESTINATION include/glib) +install(FILES glib/gasyncqueue.h DESTINATION include/glib) +install(FILES glib/gatomic.h DESTINATION include/glib) +install(FILES glib/gbacktrace.h DESTINATION include/glib) +install(FILES glib/gbase64.h DESTINATION include/glib) +install(FILES glib/gbitlock.h DESTINATION include/glib) +install(FILES glib/gbookmarkfile.h DESTINATION include/glib) +install(FILES glib/gbytes.h DESTINATION include/glib) +install(FILES glib/gcharset.h DESTINATION include/glib) +install(FILES glib/gchecksum.h DESTINATION include/glib) +install(FILES glib/gconvert.h DESTINATION include/glib) +install(FILES glib/gdataset.h DESTINATION include/glib) +install(FILES glib/gdate.h DESTINATION include/glib) +install(FILES glib/gdatetime.h DESTINATION include/glib) +install(FILES glib/gdir.h DESTINATION include/glib) +install(FILES glib/genviron.h DESTINATION include/glib) +install(FILES glib/gerror.h DESTINATION include/glib) +install(FILES glib/gfileutils.h DESTINATION include/glib) +install(FILES glib/ggettext.h DESTINATION include/glib) +install(FILES glib/ghash.h DESTINATION include/glib) +install(FILES glib/ghmac.h DESTINATION include/glib) +install(FILES glib/ghook.h DESTINATION include/glib) +install(FILES glib/ghostutils.h DESTINATION include/glib) +install(FILES glib/gi18n.h DESTINATION include/glib) +install(FILES glib/gi18n-lib.h DESTINATION include/glib) +install(FILES glib/giochannel.h DESTINATION include/glib) +install(FILES glib/gkeyfile.h DESTINATION include/glib) +install(FILES glib/glist.h DESTINATION include/glib) +install(FILES glib/gmacros.h DESTINATION include/glib) +install(FILES glib/gmain.h DESTINATION include/glib) +install(FILES glib/gmappedfile.h DESTINATION include/glib) +install(FILES glib/gmarkup.h DESTINATION include/glib) +install(FILES glib/gmem.h DESTINATION include/glib) +install(FILES glib/gmessages.h DESTINATION include/glib) +install(FILES glib/gnode.h DESTINATION include/glib) +install(FILES glib/goption.h DESTINATION include/glib) +install(FILES glib/gpattern.h DESTINATION include/glib) +install(FILES glib/gpoll.h DESTINATION include/glib) +install(FILES glib/gprimes.h DESTINATION include/glib) +install(FILES glib/gqsort.h DESTINATION include/glib) +install(FILES glib/gquark.h DESTINATION include/glib) +install(FILES glib/gqueue.h DESTINATION include/glib) +install(FILES glib/grand.h DESTINATION include/glib) +install(FILES glib/gregex.h DESTINATION include/glib) +install(FILES glib/gscanner.h DESTINATION include/glib) +install(FILES glib/gsequence.h DESTINATION include/glib) +install(FILES glib/gshell.h DESTINATION include/glib) +install(FILES glib/gslice.h DESTINATION include/glib) +install(FILES glib/gslist.h DESTINATION include/glib) +install(FILES glib/gspawn.h DESTINATION include/glib) +install(FILES glib/gstdio.h DESTINATION include/glib) +install(FILES glib/gstrfuncs.h DESTINATION include/glib) +install(FILES glib/gtestutils.h DESTINATION include/glib) +install(FILES glib/gstring.h DESTINATION include/glib) +install(FILES glib/gstringchunk.h DESTINATION include/glib) +install(FILES glib/gthread.h DESTINATION include/glib) +install(FILES glib/gthreadpool.h DESTINATION include/glib) +install(FILES glib/gtimer.h DESTINATION include/glib) +install(FILES glib/gtimezone.h DESTINATION include/glib) +install(FILES glib/gtrashstack.h DESTINATION include/glib) +install(FILES glib/gtree.h DESTINATION include/glib) +install(FILES glib/gtypes.h DESTINATION include/glib) +install(FILES glib/gunicode.h DESTINATION include/glib) +install(FILES glib/gurifuncs.h DESTINATION include/glib) +install(FILES glib/gutils.h DESTINATION include/glib) +install(FILES glib/gvarianttype.h DESTINATION include/glib) +install(FILES glib/gvariant.h DESTINATION include/glib) +install(FILES glib/gversion.h DESTINATION include/glib) +install(FILES glib/gversionmacros.h DESTINATION include/glib) +install(FILES glib/gwin32.h DESTINATION include/glib) +install(FILES glib/gprintf.h DESTINATION include/glib) +install(FILES gmodule/gmodule.h DESTINATION include) +install(FILES gobject/gobject-autocleanups.h DESTINATION include/gobject) +install(FILES gobject/glib-types.h DESTINATION include/gobject) +install(FILES gobject/gbinding.h DESTINATION include/gobject) +install(FILES gobject/gboxed.h DESTINATION include/gobject) +install(FILES gobject/gclosure.h DESTINATION include/gobject) +install(FILES gobject/genums.h DESTINATION include/gobject) +install(FILES gobject/gmarshal.h DESTINATION include/gobject) +install(FILES gobject/gobject.h DESTINATION include/gobject) +install(FILES gobject/gparam.h DESTINATION include/gobject) +install(FILES gobject/gparamspecs.h DESTINATION include/gobject) +install(FILES gobject/gsignal.h DESTINATION include/gobject) +install(FILES gobject/gsourceclosure.h DESTINATION include/gobject) +install(FILES gobject/gtype.h DESTINATION include/gobject) +install(FILES gobject/gtypemodule.h DESTINATION include/gobject) +install(FILES gobject/gtypeplugin.h DESTINATION include/gobject) +install(FILES gobject/gvalue.h DESTINATION include/gobject) +install(FILES gobject/gvaluearray.h DESTINATION include/gobject) +install(FILES gobject/gvaluecollector.h DESTINATION include/gobject) +install(FILES gobject/gvaluetypes.h DESTINATION include/gobject) +install(FILES gobject/gobjectnotifyqueue.c DESTINATION include/gobject) +install(FILES gio/gappinfo.h DESTINATION include/gio) +install(FILES gio/gasyncinitable.h DESTINATION include/gio) +install(FILES gio/gasyncresult.h DESTINATION include/gio) +install(FILES gio/gbufferedinputstream.h DESTINATION include/gio) +install(FILES gio/gbufferedoutputstream.h DESTINATION include/gio) +install(FILES gio/gbytesicon.h DESTINATION include/gio) +install(FILES gio/gcancellable.h DESTINATION include/gio) +install(FILES gio/gcontenttype.h DESTINATION include/gio) +install(FILES gio/gcharsetconverter.h DESTINATION include/gio) +install(FILES gio/gconverter.h DESTINATION include/gio) +install(FILES gio/gconverterinputstream.h DESTINATION include/gio) +install(FILES gio/gconverteroutputstream.h DESTINATION include/gio) +install(FILES gio/gdatagrambased.h DESTINATION include/gio) +install(FILES gio/gdatainputstream.h DESTINATION include/gio) +install(FILES gio/gdataoutputstream.h DESTINATION include/gio) +install(FILES gio/gdrive.h DESTINATION include/gio) +install(FILES gio/gemblem.h DESTINATION include/gio) +install(FILES gio/gemblemedicon.h DESTINATION include/gio) +install(FILES gio/gfile.h DESTINATION include/gio) +install(FILES gio/gfileattribute.h DESTINATION include/gio) +install(FILES gio/gfileenumerator.h DESTINATION include/gio) +install(FILES gio/gfileicon.h DESTINATION include/gio) +install(FILES gio/gfileinfo.h DESTINATION include/gio) +install(FILES gio/gfileinputstream.h DESTINATION include/gio) +install(FILES gio/gfilemonitor.h DESTINATION include/gio) +install(FILES gio/gfilenamecompleter.h DESTINATION include/gio) +install(FILES gio/gfileoutputstream.h DESTINATION include/gio) +install(FILES gio/gfileiostream.h DESTINATION include/gio) +install(FILES gio/gfilterinputstream.h DESTINATION include/gio) +install(FILES gio/gfilteroutputstream.h DESTINATION include/gio) +install(FILES gio/gicon.h DESTINATION include/gio) +install(FILES gio/ginetaddress.h DESTINATION include/gio) +install(FILES gio/ginetaddressmask.h DESTINATION include/gio) +install(FILES gio/ginetsocketaddress.h DESTINATION include/gio) +install(FILES gio/ginputstream.h DESTINATION include/gio) +install(FILES gio/ginitable.h DESTINATION include/gio) +install(FILES gio/gio.h DESTINATION include/gio) +install(FILES gio/gio-autocleanups.h DESTINATION include/gio) +install(FILES gio/giotypes.h DESTINATION include/gio) +install(FILES gio/gioenums.h DESTINATION include/gio) +install(FILES gio/gioerror.h DESTINATION include/gio) +install(FILES gio/giomodule.h DESTINATION include/gio) +install(FILES gio/gioscheduler.h DESTINATION include/gio) +install(FILES gio/giostream.h DESTINATION include/gio) +install(FILES gio/gloadableicon.h DESTINATION include/gio) +install(FILES gio/gmount.h DESTINATION include/gio) +install(FILES gio/gmemoryinputstream.h DESTINATION include/gio) +install(FILES gio/gmemoryoutputstream.h DESTINATION include/gio) +install(FILES gio/gmountoperation.h DESTINATION include/gio) +install(FILES gio/gnativevolumemonitor.h DESTINATION include/gio) +install(FILES gio/gnetworkaddress.h DESTINATION include/gio) +install(FILES gio/gnetworkmonitor.h DESTINATION include/gio) +install(FILES gio/gnetworkservice.h DESTINATION include/gio) +install(FILES gio/goutputstream.h DESTINATION include/gio) +install(FILES gio/gpermission.h DESTINATION include/gio) +install(FILES gio/gpollableinputstream.h DESTINATION include/gio) +install(FILES gio/gpollableoutputstream.h DESTINATION include/gio) +install(FILES gio/gpollableutils.h DESTINATION include/gio) +install(FILES gio/gproxyaddress.h DESTINATION include/gio) +install(FILES gio/gproxy.h DESTINATION include/gio) +install(FILES gio/gproxyaddressenumerator.h DESTINATION include/gio) +install(FILES gio/gproxyresolver.h DESTINATION include/gio) +install(FILES gio/gresolver.h DESTINATION include/gio) +install(FILES gio/gresource.h DESTINATION include/gio) +install(FILES gio/gseekable.h DESTINATION include/gio) +install(FILES gio/gsimpleasyncresult.h DESTINATION include/gio) +install(FILES gio/gsimpleiostream.h DESTINATION include/gio) +install(FILES gio/gsimplepermission.h DESTINATION include/gio) +install(FILES gio/gsocket.h DESTINATION include/gio) +install(FILES gio/gsocketaddress.h DESTINATION include/gio) +install(FILES gio/gsocketaddressenumerator.h DESTINATION include/gio) +install(FILES gio/gsocketclient.h DESTINATION include/gio) +install(FILES gio/gsocketconnectable.h DESTINATION include/gio) +install(FILES gio/gsocketconnection.h DESTINATION include/gio) +install(FILES gio/gsocketcontrolmessage.h DESTINATION include/gio) +install(FILES gio/gsocketlistener.h DESTINATION include/gio) +install(FILES gio/gsocketservice.h DESTINATION include/gio) +install(FILES gio/gsrvtarget.h DESTINATION include/gio) +install(FILES gio/gsimpleproxyresolver.h DESTINATION include/gio) +install(FILES gio/gtask.h DESTINATION include/gio) +install(FILES gio/gsubprocess.h DESTINATION include/gio) +install(FILES gio/gsubprocesslauncher.h DESTINATION include/gio) +install(FILES gio/gtcpconnection.h DESTINATION include/gio) +install(FILES gio/gtcpwrapperconnection.h DESTINATION include/gio) +install(FILES gio/gthreadedsocketservice.h DESTINATION include/gio) +install(FILES gio/gthemedicon.h DESTINATION include/gio) +install(FILES gio/gtlsbackend.h DESTINATION include/gio) +install(FILES gio/gtlscertificate.h DESTINATION include/gio) +install(FILES gio/gtlsclientconnection.h DESTINATION include/gio) +install(FILES gio/gtlsconnection.h DESTINATION include/gio) +install(FILES gio/gtlsdatabase.h DESTINATION include/gio) +install(FILES gio/gtlsfiledatabase.h DESTINATION include/gio) +install(FILES gio/gtlsinteraction.h DESTINATION include/gio) +install(FILES gio/gtlspassword.h DESTINATION include/gio) +install(FILES gio/gtlsserverconnection.h DESTINATION include/gio) +install(FILES gio/gdtlsconnection.h DESTINATION include/gio) +install(FILES gio/gdtlsclientconnection.h DESTINATION include/gio) +install(FILES gio/gdtlsserverconnection.h DESTINATION include/gio) +install(FILES gio/gvfs.h DESTINATION include/gio) +install(FILES gio/gvolume.h DESTINATION include/gio) +install(FILES gio/gvolumemonitor.h DESTINATION include/gio) +install(FILES gio/gzlibcompressor.h DESTINATION include/gio) +install(FILES gio/gzlibdecompressor.h DESTINATION include/gio) +install(FILES gio/glistmodel.h DESTINATION include/gio) +install(FILES gio/gliststore.h DESTINATION include/gio) +install(FILES gio/gapplication.h DESTINATION include/gio) +install(FILES gio/gapplicationcommandline.h DESTINATION include/gio) +install(FILES gio/gactiongroup.h DESTINATION include/gio) +install(FILES gio/gactionmap.h DESTINATION include/gio) +install(FILES gio/gsimpleactiongroup.h DESTINATION include/gio) +install(FILES gio/gremoteactiongroup.h DESTINATION include/gio) +install(FILES gio/gactiongroupexporter.h DESTINATION include/gio) +install(FILES gio/gdbusactiongroup.h DESTINATION include/gio) +install(FILES gio/gaction.h DESTINATION include/gio) +install(FILES gio/gpropertyaction.h DESTINATION include/gio) +install(FILES gio/gsimpleaction.h DESTINATION include/gio) +install(FILES gio/gmenumodel.h DESTINATION include/gio) +install(FILES gio/gmenu.h DESTINATION include/gio) +install(FILES gio/gmenuexporter.h DESTINATION include/gio) +install(FILES gio/gdbusmenumodel.h DESTINATION include/gio) +install(FILES gio/gnotification.h DESTINATION include/gio) +install(FILES gio/gsettingsbackend.h DESTINATION include/gio) +install(FILES gio/gsettingsschema.h DESTINATION include/gio) +install(FILES gio/gsettings.h DESTINATION include/gio) +install(FILES gio/gdbusauthobserver.h DESTINATION include/gio) +install(FILES gio/gcredentials.h DESTINATION include/gio) +install(FILES gio/gdbusutils.h DESTINATION include/gio) +install(FILES gio/gdbuserror.h DESTINATION include/gio) +install(FILES gio/gdbusaddress.h DESTINATION include/gio) +install(FILES gio/gdbusconnection.h DESTINATION include/gio) +install(FILES gio/gdbusmessage.h DESTINATION include/gio) +install(FILES gio/gdbusnameowning.h DESTINATION include/gio) +install(FILES gio/gdbusnamewatching.h DESTINATION include/gio) +install(FILES gio/gdbusproxy.h DESTINATION include/gio) +install(FILES gio/gdbusintrospection.h DESTINATION include/gio) +install(FILES gio/gdbusmethodinvocation.h DESTINATION include/gio) +install(FILES gio/gdbusserver.h DESTINATION include/gio) +install(FILES gio/gdbusinterface.h DESTINATION include/gio) +install(FILES gio/gdbusinterfaceskeleton.h DESTINATION include/gio) +install(FILES gio/gdbusobject.h DESTINATION include/gio) +install(FILES gio/gdbusobjectskeleton.h DESTINATION include/gio) +install(FILES gio/gdbusobjectproxy.h DESTINATION include/gio) +install(FILES gio/gdbusobjectmanager.h DESTINATION include/gio) +install(FILES gio/gdbusobjectmanagerclient.h DESTINATION include/gio) +install(FILES gio/gdbusobjectmanagerserver.h DESTINATION include/gio) +install(FILES gio/gtestdbus.h DESTINATION include/gio) +install(FILES gio/gioenumtypes.h DESTINATION include/gio) +install(FILES gio/gnetworking.h DESTINATION include/gio) +install(FILES gio/gwin32inputstream.h DESTINATION include/gio) +install(FILES gio/gwin32outputstream.h DESTINATION include/gio) diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake new file mode 100644 index 0000000000..c835d8482e --- /dev/null +++ b/ports/glib/portfile.cmake @@ -0,0 +1,32 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glib-2.50.2) +vcpkg_download_distfile(ARCHIVE + URLS "https://ftp.gnome.org/pub/gnome/sources/glib/2.50/glib-2.50.2.tar.xz" + FILENAME "glib-2.50.2.tar.xz" + SHA512 63d7b5ece8d7d15b10e06ef10a8e0a4446f30a8d9c97daa3352ec00dfef622728bd42ed24cbf67e553166a0f9e29a3e3d024d1d085b9804fd67608db438b6771) + +vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/use-libiconv-on-windows.patch) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH}) +file(REMOVE_RECURSE ${SOURCE_PATH}/glib/pcre) +file(REMOVE ${SOURCE_PATH}/glib/win_iconv.c) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DGLIB_SKIP_HEADERS=ON + -DGLIB_SKIP_TOOLS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_copy_tool_dependencies() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glib) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/glib/COPYING ${CURRENT_PACKAGES_DIR}/share/glib/copyright) + diff --git a/ports/glib/use-libiconv-on-windows.patch b/ports/glib/use-libiconv-on-windows.patch new file mode 100644 index 0000000000..927de0bb1d --- /dev/null +++ b/ports/glib/use-libiconv-on-windows.patch @@ -0,0 +1,14 @@ +diff --git a/glib/gconvert.c b/glib/gconvert.c +index 3deac78..134ded9 100644 +--- a/glib/gconvert.c ++++ b/glib/gconvert.c +@@ -30,7 +30,8 @@ + #include + + #ifdef G_OS_WIN32 +-#include "win_iconv.c" ++#define USE_LIBICONV_GNU ++#include + #endif + + #ifdef G_PLATFORM_WIN32 diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index ff1fae953b..6e60bf2bc3 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -11,3 +11,4 @@ include(vcpkg_configure_cmake) include(vcpkg_configure_qmake) include(vcpkg_apply_patches) include(vcpkg_copy_pdbs) +include(vcpkg_copy_tool_dependencies) diff --git a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake new file mode 100644 index 0000000000..d8de15207a --- /dev/null +++ b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake @@ -0,0 +1,16 @@ +# Copy dlls for all tools in ${CURRENT_PACKAGES_DIR}/tools + +function(vcpkg_copy_tool_dependencies) + macro(search_for_dependencies PATH_TO_SEARCH) + file(GLOB TOOLS ${CURRENT_PACKAGES_DIR}/tools/*.exe ${CURRENT_PACKAGES_DIR}/tools/*.dll) + foreach(TOOL ${TOOLS}) + execute_process(COMMAND powershell -noprofile -executionpolicy UnRestricted -nologo + -file ${VCPKG_ROOT_DIR}/scripts/buildsystems/msbuild/applocal.ps1 + -targetBinary ${TOOL} + -installedDir ${PATH_TO_SEARCH} + OUTPUT_VARIABLE OUT) + endforeach() + endmacro() + search_for_dependencies(${CURRENT_PACKAGES_DIR}/bin) + search_for_dependencies(${CURRENT_INSTALLED_DIR}/bin) +endfunction() From 912278d22d497ce344e78cb128ba4930c2ee7f55 Mon Sep 17 00:00:00 2001 From: codicodi Date: Wed, 11 Jan 2017 21:36:21 +0100 Subject: [PATCH 067/561] [glib] check settings --- ports/glib/portfile.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake index c835d8482e..d1777de1d3 100644 --- a/ports/glib/portfile.cmake +++ b/ports/glib/portfile.cmake @@ -1,3 +1,13 @@ + # Glib uses winapi functions not available in WindowsStore +if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) + message(FATAL_ERROR "Error: UWP builds are currently not supported.") +endif() + +# Glib relies on DllMain +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glib-2.50.2) From f4622dce99378894b71c07e7fe989480981b5d56 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 11 Jan 2017 20:54:25 -0800 Subject: [PATCH 068/561] [7zip] Also consider the system version, if available --- scripts/cmake/vcpkg_find_acquire_program.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index df2f30af51..ab0cf1587b 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -59,7 +59,7 @@ function(vcpkg_find_acquire_program VAR) set(HASH 23a26dc7e29979bec5dcd3bfcabf76397b93ace64f5d46f2254d6420158bac5eff1c1a8454e3427e7a2fe2c233c5f2cffc87b376772399e12e40b51be2c065f4) elseif(VAR MATCHES "7Z") set(PROGNAME 7z) - set(PATHS ${DOWNLOADS}/tools/7z/Files/7-Zip) + set(PATHS "C:/Program Files/7-Zip" ${DOWNLOADS}/tools/7z/Files/7-Zip) set(URL "http://7-zip.org/a/7z1604.msi") set(ARCHIVE "7z1604.msi") set(HASH 556f95f7566fe23704d136239e4cf5e2a26f939ab43b44145c91b70d031a088d553e5c21301f1242a2295dcde3143b356211f0108c68e65eef8572407618326d) From 8adfa34b08ac923adde20b7ea193a3e86004ab08 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Thu, 12 Jan 2017 11:03:02 +0100 Subject: [PATCH 069/561] Add port for VTK --- ports/vtk/CONTROL | 4 + ports/vtk/netcdf-use-hdf5-definitions.patch | 10 +++ ports/vtk/portfile.cmake | 79 +++++++++++++++++++ ...ransfer-3rd-party-module-definitions.patch | 26 ++++++ ports/vtk/transfer-hdf5-definitions.patch | 10 +++ 5 files changed, 129 insertions(+) create mode 100644 ports/vtk/CONTROL create mode 100644 ports/vtk/netcdf-use-hdf5-definitions.patch create mode 100644 ports/vtk/portfile.cmake create mode 100644 ports/vtk/transfer-3rd-party-module-definitions.patch create mode 100644 ports/vtk/transfer-hdf5-definitions.patch diff --git a/ports/vtk/CONTROL b/ports/vtk/CONTROL new file mode 100644 index 0000000000..d963451ce0 --- /dev/null +++ b/ports/vtk/CONTROL @@ -0,0 +1,4 @@ +Source: vtk +Version: 7.1.0 +Description: Software system for 3D computer graphics, image processing, and visualization +Build-Depends: zlib, libpng, tiff, libxml2, jsoncpp, glew, freetype, expat, hdf5, qt5, msmpi diff --git a/ports/vtk/netcdf-use-hdf5-definitions.patch b/ports/vtk/netcdf-use-hdf5-definitions.patch new file mode 100644 index 0000000000..a6a3528ca0 --- /dev/null +++ b/ports/vtk/netcdf-use-hdf5-definitions.patch @@ -0,0 +1,10 @@ +--- a/ThirdParty/netcdf/vtknetcdf/CMakeLists.txt Mon Nov 14 17:59:47 2016 ++++ b/ThirdParty/netcdf/vtknetcdf/CMakeLists.txt Thu Jan 05 21:15:28 2017 +@@ -330,6 +330,7 @@ + ${netcdf_dispatch_SOURCES} + ${netcdf_liblib_SOURCES}) + target_link_libraries(vtkNetCDF ${vtkhdf5_LIBRARIES}) ++target_compile_definitions(vtkNetCDF PRIVATE ${vtkhdf5_DEFINITIONS}) + + if (UNIX) + # link against the math library. diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake new file mode 100644 index 0000000000..e1a6e772b9 --- /dev/null +++ b/ports/vtk/portfile.cmake @@ -0,0 +1,79 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/VTK-7.1.0) +vcpkg_download_distfile(ARCHIVE + URLS "http://www.vtk.org/files/release/7.1/VTK-7.1.0.tar.gz" + FILENAME "VTK-7.1.0.tar.gz" + SHA512 83f0c9291cd2bc517a4bc449ad28a1d77e7ece169e846c7beab0b1140b9ef4b7bad30e3fa6e5a59826a707df78e2e336e07fa8bd30cf7498096ee80feef16534 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/transfer-3rd-party-module-definitions.patch + ${CMAKE_CURRENT_LIST_DIR}/transfer-hdf5-definitions.patch + ${CMAKE_CURRENT_LIST_DIR}/netcdf-use-hdf5-definitions.patch +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + # HACK: The FindHDF5.cmake script does not seam to detect the HDF5_DEFINITIONS correctly + # if HDF5 has been built without the tools, so we set the BUILT_AS_DYNAMIC_LIB=1 flag + # here explicitly because we now it has been build as dynamic in the current case. + list(APPEND ADDITIONAL_OPTIONS "-DHDF5_DEFINITIONS=-DH5_BUILT_AS_DYNAMIC_LIB=1") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_TESTING=OFF + -DVTK_Group_MPI=ON + -DVTK_Group_Qt=ON + -DVTK_QT_VERSION=5 + -DVTK_BUILD_QT_DESIGNER_PLUGIN=OFF + # -DVTK_WRAP_PYTHON=ON + # -DVTK_PYTHON_VERSION=3 + -DVTK_USE_SYSTEM_EXPAT=ON + -DVTK_USE_SYSTEM_FREETYPE=ON + # -DVTK_USE_SYSTEM_GL2PS=ON + -DVTK_USE_SYSTEM_GLEW=ON + -DVTK_USE_SYSTEM_HDF5=ON + -DVTK_USE_SYSTEM_JSONCPP=ON + # -DVTK_USE_SYSTEM_LIBPROJ4=ON + # -DVTK_USE_SYSTEM_LIBRARIES=ON + -DVTK_USE_SYSTEM_LIBXML2=ON + # -DVTK_USE_SYSTEM_NETCDF=ON + # -DVTK_USE_SYSTEM_OGGTHEORA=ON + -DVTK_USE_SYSTEM_PNG=ON + -DVTK_USE_SYSTEM_TIFF=ON + -DVTK_USE_SYSTEM_ZLIB=ON + -DVTK_INSTALL_DATA_DIR=share/vtk/data + -DVTK_INSTALL_DOC_DIR=share/vtk/doc + -DVTK_INSTALL_PACKAGE_DIR=share/vtk + ${ADDITIONAL_OPTIONS} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(READ ${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-release.cmake VTK_TARGETS_RELEASE_MODULE) +string(REPLACE "list\(APPEND _IMPORT_CHECK_FILES_FOR_vtkEncodeString" "#list(APPEND _IMPORT_CHECK_FILES_FOR_vtkEncodeString" VTK_TARGETS_RELEASE_MODULE "${VTK_TARGETS_RELEASE_MODULE}") +string(REPLACE "list\(APPEND _IMPORT_CHECK_FILES_FOR_vtkHashSource" "#list(APPEND _IMPORT_CHECK_FILES_FOR_vtkHashSource" VTK_TARGETS_RELEASE_MODULE "${VTK_TARGETS_RELEASE_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-release.cmake "${VTK_TARGETS_RELEASE_MODULE}") + +file(READ ${CURRENT_PACKAGES_DIR}/debug/share/vtk/VTKTargets-debug.cmake VTK_TARGETS_DEBUG_MODULE) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" VTK_TARGETS_DEBUG_MODULE "${VTK_TARGETS_DEBUG_MODULE}") +string(REPLACE "list\(APPEND _IMPORT_CHECK_FILES_FOR_vtkEncodeString" "#list(APPEND _IMPORT_CHECK_FILES_FOR_vtkEncodeString" VTK_TARGETS_DEBUG_MODULE "${VTK_TARGETS_DEBUG_MODULE}") +string(REPLACE "list\(APPEND _IMPORT_CHECK_FILES_FOR_vtkHashSource" "#list(APPEND _IMPORT_CHECK_FILES_FOR_vtkHashSource" VTK_TARGETS_DEBUG_MODULE "${VTK_TARGETS_DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-debug.cmake "${VTK_TARGETS_DEBUG_MODULE}") + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/vtkEncodeString-7.1.exe) +file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/vtkHashSource-7.1.exe) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vtkEncodeString-7.1.exe) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vtkHashSource-7.1.exe) + +# Handle copyright +file(COPY ${SOURCE_PATH}/Copyright.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/vtk) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/vtk/Copyright.txt ${CURRENT_PACKAGES_DIR}/share/vtk/copyright) diff --git a/ports/vtk/transfer-3rd-party-module-definitions.patch b/ports/vtk/transfer-3rd-party-module-definitions.patch new file mode 100644 index 0000000000..7b402892fa --- /dev/null +++ b/ports/vtk/transfer-3rd-party-module-definitions.patch @@ -0,0 +1,26 @@ +--- a/CMake/vtkModuleMacros.cmake Mon Nov 14 17:59:47 2016 ++++ b/CMake/vtkModuleMacros.cmake Thu Jan 05 21:36:06 2017 +@@ -665,6 +665,9 @@ + if(${dep}_LIBRARY_DIRS) + link_directories(${${dep}_LIBRARY_DIRS}) + endif() ++ if(${dep}_DEFINITIONS) ++ target_compile_definitions(${vtk-module} PRIVATE ${${dep}_DEFINITIONS}) ++ endif() + vtk_module_link_libraries(${vtk-module} LINK_PRIVATE ${${dep}_LIBRARIES}) + if(_help_vs7 AND ${dep}_LIBRARIES) + add_dependencies(${vtk-module} ${${dep}_LIBRARIES}) +@@ -870,6 +873,13 @@ + set(vtk${_lower}_LIBRARIES "${${_pkg}_LIBRARIES}") + else() + set(vtk${_lower}_LIBRARIES "${${_upper}_LIBRARIES}") ++ endif() ++ if(${_pkg}_DEFINITIONS) ++ set(vtk${_lower}_DEFINITIONS ${${_pkg}_DEFINITIONS}) ++ elseif(${_upper}_DEFINITIONS) ++ set(vtk${_lower}_DEFINITIONS ${${_upper}_DEFINITIONS}) ++ else() ++ set(vtk${_lower}_DEFINITIONS ${${_upper}_DEFINITIONS}) + endif() + + #a workaround for bad FindHDF5 behavior in which deb or opt can diff --git a/ports/vtk/transfer-hdf5-definitions.patch b/ports/vtk/transfer-hdf5-definitions.patch new file mode 100644 index 0000000000..6184fdf7ad --- /dev/null +++ b/ports/vtk/transfer-hdf5-definitions.patch @@ -0,0 +1,10 @@ +--- a/ThirdParty/hdf5/module.cmake Mon Nov 14 17:59:47 2016 ++++ b/ThirdParty/hdf5/module.cmake Thu Jan 05 21:23:20 2017 +@@ -5,6 +5,7 @@ + endif() + if(VTK_USE_SYSTEM_HDF5) + set(vtkhdf5_LIBRARIES ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES}) ++ set(vtkhdf5_DEFINITIONS ${HDF5_DEFINITIONS}) + endif() + vtk_module(vtkhdf5 + EXCLUDE_FROM_WRAPPING From 8e57be16161fca1da94cc9faacb3d4bfaef2c6ec Mon Sep 17 00:00:00 2001 From: ab Date: Thu, 12 Jan 2017 12:28:08 +0100 Subject: [PATCH 070/561] On release set HTTP_PARSER_STRICT to zero. This was done to match the http-parser makefile i.e. building in release mode strict parse is disabled (which is faster) else (in debug) strict parser is used. --- ports/http-parser/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ports/http-parser/CMakeLists.txt b/ports/http-parser/CMakeLists.txt index 6e9067a043..d959fff799 100644 --- a/ports/http-parser/CMakeLists.txt +++ b/ports/http-parser/CMakeLists.txt @@ -5,13 +5,17 @@ if (BUILD_SHARED_LIBS) SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() +if(CMAKE_BUILD_TYPE MATCHES "Release") + add_definitions(-DHTTP_PARSER_STRICT=0) +endif() + add_library(http_parser http_parser.c http_parser.h) install(TARGETS http_parser - RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" - ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" + RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" + ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" ) if (NOT SKIP_INSTALL_HEADERS) - install(FILES http_parser.h DESTINATION "${CMAKE_INSTALL_PREFIX}/include") + install(FILES http_parser.h DESTINATION "${CMAKE_INSTALL_PREFIX}/include") endif() \ No newline at end of file From 2f92128e7fa4a56ed0f0e84ed55c344a9b193ab0 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Thu, 12 Jan 2017 09:20:32 -0800 Subject: [PATCH 071/561] added support to build uwp versions --- ports/libwebsockets/0001-Fix-UWP.patch | 91 ++++++++++++++++++++++++++ ports/libwebsockets/portfile.cmake | 8 +++ 2 files changed, 99 insertions(+) create mode 100644 ports/libwebsockets/0001-Fix-UWP.patch diff --git a/ports/libwebsockets/0001-Fix-UWP.patch b/ports/libwebsockets/0001-Fix-UWP.patch new file mode 100644 index 0000000000..8996c4e0ed --- /dev/null +++ b/ports/libwebsockets/0001-Fix-UWP.patch @@ -0,0 +1,91 @@ +diff --git a/lib/lws-plat-win.c b/lib/lws-plat-win.c +index dd3e95a..eb1690a 100644 +--- a/lib/lws-plat-win.c ++++ b/lib/lws-plat-win.c +@@ -155,7 +155,7 @@ lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi) + { + struct lws_context_per_thread *pt = &context->pt[tsi]; + WSANETWORKEVENTS networkevents; +- struct lws_pollfd *pfd; ++ struct lws_pollfd *pfd = NULL; + struct lws *wsi; + unsigned int i; + DWORD ev; +@@ -493,6 +493,7 @@ lws_plat_inet_ntop(int af, const void *src, char *dst, int cnt) + return ok ? dst : NULL; + } + ++#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) + static lws_filefd_type + _lws_plat_file_open(struct lws *wsi, const char *filename, + unsigned long *filelen, int flags) +@@ -516,6 +517,35 @@ _lws_plat_file_open(struct lws *wsi, const char *filename, + + return ret; + } ++#else ++static lws_filefd_type ++_lws_plat_file_open(struct lws *wsi, const char *filename, ++ unsigned long *filelen, int flags) ++{ ++ HANDLE ret; ++ WCHAR buf[MAX_PATH]; ++ ++ (void)wsi; ++ MultiByteToWideChar(CP_UTF8, 0, filename, -1, buf, ARRAY_SIZE(buf)); ++ if ((flags & 7) == _O_RDONLY) { ++ ret = CreateFile2(buf, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, NULL); ++ } ++ else { ++ lwsl_err("%s: open for write not implemented\n", __func__); ++ *filelen = 0; ++ return LWS_INVALID_FILE; ++ } ++ ++ if (ret != LWS_INVALID_FILE) ++ { ++ struct stat info; ++ int result = stat(filename, &info); ++ *filelen = result != 0 ? -1 : (long)(info.st_size); ++ } ++ ++ return ret; ++} ++#endif + + static int + _lws_plat_file_close(struct lws *wsi, lws_filefd_type fd) +diff --git a/lib/private-libwebsockets.h b/lib/private-libwebsockets.h +index 23f8f4d..bc32aef 100644 +--- a/lib/private-libwebsockets.h ++++ b/lib/private-libwebsockets.h +@@ -48,12 +48,25 @@ + #endif + + #if defined(WIN32) || defined(_WIN32) ++ ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++ #ifndef WINVER ++ #define WINVER 0x0602 ++ #define _WIN32_WINNT WINVER ++ #endif ++ ++ #define getenv(x) NULL ++ #define _WINSOCK_DEPRECATED_NO_WARNINGS ++#else ++ + #if (WINVER < 0x0501) +-#undef WINVER +-#undef _WIN32_WINNT +-#define WINVER 0x0501 +-#define _WIN32_WINNT WINVER ++ #undef WINVER ++ #undef _WIN32_WINNT ++ #define WINVER 0x0501 ++ #define _WIN32_WINNT WINVER ++ #endif + #endif ++ + #define LWS_NO_DAEMONIZE + #define LWS_ERRNO WSAGetLastError() + #define LWS_EAGAIN WSAEWOULDBLOCK diff --git a/ports/libwebsockets/portfile.cmake b/ports/libwebsockets/portfile.cmake index 27088bf87d..370350d56a 100644 --- a/ports/libwebsockets/portfile.cmake +++ b/ports/libwebsockets/portfile.cmake @@ -11,6 +11,14 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-UWP.patch +) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS From e4b1551988487059fcc0081bd86aaf7353044312 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Thu, 12 Jan 2017 12:12:45 -0800 Subject: [PATCH 072/561] apply patch to all builds, not just uwp --- ports/libwebsockets/portfile.cmake | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ports/libwebsockets/portfile.cmake b/ports/libwebsockets/portfile.cmake index 370350d56a..43502a52a8 100644 --- a/ports/libwebsockets/portfile.cmake +++ b/ports/libwebsockets/portfile.cmake @@ -11,13 +11,11 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-UWP.patch +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-UWP.patch ) -endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} From 30429e68db721f542abf153293b49822c107870e Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Thu, 12 Jan 2017 12:35:24 -0800 Subject: [PATCH 073/561] apply uwp patch to all builds --- ports/curl/portfile.cmake | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index e8fc658c0c..35bfbd592c 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -11,16 +11,9 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch + ${CMAKE_CURRENT_LIST_DIR}/0002_fix_uwp.patch ) -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/0002_fix_uwp.patch -) -endif() - if (VCPKG_CRT_LINKAGE STREQUAL dynamic) SET(CURL_STATICLIB OFF) else() From 41eba85b32193ed3e75d9c6b48c5fdccfdf000a7 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 12 Jan 2017 16:48:51 -0800 Subject: [PATCH 074/561] [tiff] Bump version for change due to UWP support. --- ports/tiff/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/tiff/CONTROL b/ports/tiff/CONTROL index 65e3d37da6..0c82029fb9 100644 --- a/ports/tiff/CONTROL +++ b/ports/tiff/CONTROL @@ -1,4 +1,4 @@ Source: tiff -Version: 4.0.6-1 +Version: 4.0.6-2 Build-Depends: zlib Description: A library that supports the manipulation of TIFF image files \ No newline at end of file From 5082ea5464f6f816be4fd96270a6faa142b10fb0 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 12 Jan 2017 17:09:45 -0800 Subject: [PATCH 075/561] [freetype] Bump version to match source changes for uwp --- ports/freetype/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/freetype/CONTROL b/ports/freetype/CONTROL index 74f7e49863..866033e3c1 100644 --- a/ports/freetype/CONTROL +++ b/ports/freetype/CONTROL @@ -1,4 +1,4 @@ Source: freetype -Version: 2.6.3-3 +Version: 2.6.3-4 Build-Depends: zlib, bzip2, libpng Description: A library to render fonts. \ No newline at end of file From 963cc56a8cec42a6ed185d78d6a5585272ba2d63 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 12 Jan 2017 17:26:04 -0800 Subject: [PATCH 076/561] [libssh2] Bump version to match source code change for uwp support --- ports/libssh2/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libssh2/CONTROL b/ports/libssh2/CONTROL index d66030b71e..715ffa0bd8 100644 --- a/ports/libssh2/CONTROL +++ b/ports/libssh2/CONTROL @@ -1,4 +1,4 @@ Source: libssh2 -Version: 1.8.0 +Version: 1.8.0-1 Build-Depends: zlib, openssl Description: The SSH library \ No newline at end of file From 6a4ec92a90849e7cc343bbc8673ce0f063ffd939 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:03:21 -0800 Subject: [PATCH 077/561] Place build & build_external commands into separate files --- toolsrc/include/vcpkg_Commands.h | 6 + toolsrc/src/commands_build.cpp | 130 ++++++++++++++++++++++ toolsrc/src/commands_build_external.cpp | 32 ++++++ toolsrc/src/commands_edit.cpp | 2 +- toolsrc/src/commands_installation.cpp | 141 +----------------------- toolsrc/vcpkg/vcpkg.vcxproj | 2 + toolsrc/vcpkg/vcpkg.vcxproj.filters | 6 + 7 files changed, 178 insertions(+), 141 deletions(-) create mode 100644 toolsrc/src/commands_build.cpp create mode 100644 toolsrc/src/commands_build_external.cpp diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index fd427fd40d..213d31adac 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -5,6 +5,12 @@ namespace vcpkg { + // + namespace Commands::details + { + void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); + } + extern const char*const INTEGRATE_COMMAND_HELPSTRING; void print_usage(); diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp new file mode 100644 index 0000000000..9f37e25f9b --- /dev/null +++ b/toolsrc/src/commands_build.cpp @@ -0,0 +1,130 @@ +#include "vcpkg_Commands.h" +#include "StatusParagraphs.h" +#include "vcpkg.h" +#include "vcpkg_Input.h" +#include "post_build_lint.h" +#include "vcpkg_Dependencies.h" +#include "vcpkg_System.h" +#include "vcpkg_Environment.h" +#include "metrics.h" +#include "vcpkg_info.h" +#include + +namespace vcpkg +{ + using Dependencies::package_spec_with_install_plan; + using Dependencies::install_plan_type; + + static const std::string OPTION_CHECKS_ONLY = "--checks-only"; + + static void create_binary_control_file(const vcpkg_paths& paths, const SourceParagraph& source_paragraph, const triplet& target_triplet) + { + const BinaryParagraph bpgh = BinaryParagraph(source_paragraph, target_triplet); + const fs::path binary_control_file = paths.packages / bpgh.dir() / "CONTROL"; + std::ofstream(binary_control_file) << bpgh; + } + + namespace Commands::details + { + void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) + { + Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_internal()"); + const triplet& target_triplet = spec.target_triplet(); + + const fs::path ports_cmake_script_path = paths.ports_cmake; + const std::wstring command = Strings::wformat(LR"("%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", + Strings::utf8_to_utf16(target_triplet.architecture()), + Strings::utf8_to_utf16(source_paragraph.name), + Strings::utf8_to_utf16(target_triplet.canonical_name()), + port_dir.generic_wstring(), + ports_cmake_script_path.generic_wstring()); + + System::Stopwatch2 timer; + timer.start(); + int return_code = System::cmd_execute(command); + timer.stop(); + TrackMetric("buildtimeus-" + to_string(spec), timer.microseconds()); + + if (return_code != 0) + { + System::println(System::color::error, "Error: building package %s failed", to_string(spec)); + System::println("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" + "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" + " Package: %s\n" + " Vcpkg version: %s\n" + "\n" + "Additionally, attach any relevant sections from the log files above." + , to_string(spec), Info::version()); + TrackProperty("error", "build failed"); + TrackProperty("build_error", to_string(spec)); + exit(EXIT_FAILURE); + } + + PostBuildLint::perform_all_checks(spec, paths); + + create_binary_control_file(paths, source_paragraph, target_triplet); + + // const fs::path port_buildtrees_dir = paths.buildtrees / spec.name; + // delete_directory(port_buildtrees_dir); + } + } + void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + { + static const std::string example = create_example_string("build zlib:x64-windows"); + + // Installing multiple packages leads to unintuitive behavior if one of them depends on another. + // Allowing only 1 package for now. + + args.check_exact_arg_count(1, example); + + StatusParagraphs status_db = database_load_check(paths); + + const package_spec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example); + Input::check_triplet(spec.target_triplet(), paths); + + const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_CHECKS_ONLY}); + if (options.find(OPTION_CHECKS_ONLY) != options.end()) + { + PostBuildLint::perform_all_checks(spec, paths); + exit(EXIT_SUCCESS); + } + + // Explicitly load and use the portfile's build dependencies when resolving the build command (instead of a cached package's dependencies). + const expected maybe_spgh = try_load_port(paths, spec.name()); + Checks::check_exit(!maybe_spgh.error_code(), "Could not find package named %s: %s", spec, maybe_spgh.error_code().message()); + const SourceParagraph& spgh = *maybe_spgh.get(); + + const std::vector first_level_deps = filter_dependencies(spgh.depends, spec.target_triplet()); + + std::vector first_level_deps_specs; + for (const std::string& dep : first_level_deps) + { + first_level_deps_specs.push_back(package_spec::from_name_and_triplet(dep, spec.target_triplet()).get_or_throw()); + } + + std::vector unmet_dependencies = Dependencies::create_install_plan(paths, first_level_deps_specs, status_db); + unmet_dependencies.erase( + std::remove_if(unmet_dependencies.begin(), unmet_dependencies.end(), [](const package_spec_with_install_plan& p) + { + return p.plan.type == install_plan_type::ALREADY_INSTALLED; + }), + unmet_dependencies.end()); + + if (!unmet_dependencies.empty()) + { + System::println(System::color::error, "The build command requires all dependencies to be already installed."); + System::println("The following dependencies are missing:"); + System::println(""); + for (const package_spec_with_install_plan& p : unmet_dependencies) + { + System::println(" %s", to_string(p.spec)); + } + System::println(""); + exit(EXIT_FAILURE); + } + + Environment::ensure_utilities_on_path(paths); + Commands::details::build_internal(spgh, spec, paths, paths.port_dir(spec)); + exit(EXIT_SUCCESS); + } +} diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp new file mode 100644 index 0000000000..d34981e041 --- /dev/null +++ b/toolsrc/src/commands_build_external.cpp @@ -0,0 +1,32 @@ +#include "vcpkg_Commands.h" +#include "vcpkg_System.h" +#include "vcpkg_Environment.h" +#include "vcpkg_Input.h" +#include "vcpkg.h" + +namespace vcpkg +{ + void build_external_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + { + static const std::string example = create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); + args.check_exact_arg_count(2, example); + + expected maybe_current_spec = package_spec::from_string(args.command_arguments[0], default_target_triplet); + if (auto spec = maybe_current_spec.get()) + { + Input::check_triplet(spec->target_triplet(), paths); + Environment::ensure_utilities_on_path(paths); + const fs::path port_dir = args.command_arguments.at(1); + const expected maybe_spgh = try_load_port(port_dir); + if (auto spgh = maybe_spgh.get()) + { + Commands::details::build_internal(*spgh, *spec, paths, port_dir); + exit(EXIT_SUCCESS); + } + } + + System::println(System::color::error, "Error: %s: %s", maybe_current_spec.error_code().message(), args.command_arguments[0]); + print_example(Strings::format("%s zlib:x64-windows", args.command)); + exit(EXIT_FAILURE); + } +} diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index fbf4eab620..f7c489f2b0 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -27,7 +27,7 @@ namespace vcpkg } } - std::wstring cmdLine = Strings::wformat(LR"("%s" "%s" "%s")", env_EDITOR, portpath.native(), (portpath / "portfile.cmake").native()); + std::wstring cmdLine = Strings::wformat(LR"("%s" "%s" "%s" -n)", env_EDITOR, portpath.native(), (portpath / "portfile.cmake").native()); exit(System::cmd_execute(cmdLine)); } } diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index c239bf06ca..f448529304 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -1,72 +1,17 @@ #include "vcpkg_Commands.h" #include "vcpkg.h" -#include #include "vcpkg_Environment.h" #include "metrics.h" #include "vcpkg_Files.h" -#include "post_build_lint.h" #include "vcpkg_System.h" #include "vcpkg_Dependencies.h" #include "vcpkg_Input.h" -#include "vcpkg_Maps.h" -#include "vcpkg_info.h" namespace vcpkg { using Dependencies::package_spec_with_install_plan; using Dependencies::install_plan_type; - static const std::string OPTION_CHECKS_ONLY = "--checks-only"; - - static void create_binary_control_file(const vcpkg_paths& paths, const SourceParagraph& source_paragraph, const triplet& target_triplet) - { - const BinaryParagraph bpgh = BinaryParagraph(source_paragraph, target_triplet); - const fs::path binary_control_file = paths.packages / bpgh.dir() / "CONTROL"; - std::ofstream(binary_control_file) << bpgh; - } - - static void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) - { - Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_internal()"); - const triplet& target_triplet = spec.target_triplet(); - - const fs::path ports_cmake_script_path = paths.ports_cmake; - const std::wstring command = Strings::wformat(LR"("%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", - Strings::utf8_to_utf16(target_triplet.architecture()), - Strings::utf8_to_utf16(source_paragraph.name), - Strings::utf8_to_utf16(target_triplet.canonical_name()), - port_dir.generic_wstring(), - ports_cmake_script_path.generic_wstring()); - - System::Stopwatch2 timer; - timer.start(); - int return_code = System::cmd_execute(command); - timer.stop(); - TrackMetric("buildtimeus-" + to_string(spec), timer.microseconds()); - - if (return_code != 0) - { - System::println(System::color::error, "Error: building package %s failed", to_string(spec)); - System::println("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" - "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" - " Package: %s\n" - " Vcpkg version: %s\n" - "\n" - "Additionally, attach any relevant sections from the log files above." - , to_string(spec), Info::version()); - TrackProperty("error", "build failed"); - TrackProperty("build_error", to_string(spec)); - exit(EXIT_FAILURE); - } - - PostBuildLint::perform_all_checks(spec, paths); - - create_binary_control_file(paths, source_paragraph, target_triplet); - - // const fs::path port_buildtrees_dir = paths.buildtrees / spec.name; - // delete_directory(port_buildtrees_dir); - } - static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryParagraph& bpgh) { std::vector output; @@ -271,7 +216,7 @@ namespace vcpkg } else if (action.plan.type == install_plan_type::BUILD_AND_INSTALL) { - build_internal(*action.plan.spgh, action.spec, paths, paths.port_dir(action.spec)); + Commands::details::build_internal(*action.plan.spgh, action.spec, paths, paths.port_dir(action.spec)); const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); install_package(paths, bpgh, status_db); System::println(System::color::success, "Package %s is installed", action.spec); @@ -293,88 +238,4 @@ namespace vcpkg exit(EXIT_SUCCESS); } - - void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) - { - static const std::string example = create_example_string("build zlib:x64-windows"); - - // Installing multiple packages leads to unintuitive behavior if one of them depends on another. - // Allowing only 1 package for now. - - args.check_exact_arg_count(1, example); - - StatusParagraphs status_db = database_load_check(paths); - - const package_spec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example); - Input::check_triplet(spec.target_triplet(), paths); - - const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_CHECKS_ONLY}); - if (options.find(OPTION_CHECKS_ONLY) != options.end()) - { - PostBuildLint::perform_all_checks(spec, paths); - exit(EXIT_SUCCESS); - } - - // Explicitly load and use the portfile's build dependencies when resolving the build command (instead of a cached package's dependencies). - const expected maybe_spgh = try_load_port(paths, spec.name()); - Checks::check_exit(!maybe_spgh.error_code(), "Could not find package named %s: %s", spec, maybe_spgh.error_code().message()); - const SourceParagraph& spgh = *maybe_spgh.get(); - - const std::vector first_level_deps = filter_dependencies(spgh.depends, spec.target_triplet()); - - std::vector first_level_deps_specs; - for (const std::string& dep : first_level_deps) - { - first_level_deps_specs.push_back(package_spec::from_name_and_triplet(dep, spec.target_triplet()).get_or_throw()); - } - - std::vector unmet_dependencies = Dependencies::create_install_plan(paths, first_level_deps_specs, status_db); - unmet_dependencies.erase( - std::remove_if(unmet_dependencies.begin(), unmet_dependencies.end(), [](const package_spec_with_install_plan& p) - { - return p.plan.type == install_plan_type::ALREADY_INSTALLED; - }), - unmet_dependencies.end()); - - if (!unmet_dependencies.empty()) - { - System::println(System::color::error, "The build command requires all dependencies to be already installed."); - System::println("The following dependencies are missing:"); - System::println(""); - for (const package_spec_with_install_plan& p : unmet_dependencies) - { - System::println(" %s", to_string(p.spec)); - } - System::println(""); - exit(EXIT_FAILURE); - } - - Environment::ensure_utilities_on_path(paths); - build_internal(spgh, spec, paths, paths.port_dir(spec)); - exit(EXIT_SUCCESS); - } - - void build_external_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) - { - static const std::string example = create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); - args.check_exact_arg_count(2, example); - - expected maybe_current_spec = package_spec::from_string(args.command_arguments[0], default_target_triplet); - if (auto spec = maybe_current_spec.get()) - { - Input::check_triplet(spec->target_triplet(), paths); - Environment::ensure_utilities_on_path(paths); - const fs::path port_dir = args.command_arguments.at(1); - const expected maybe_spgh = try_load_port(port_dir); - if (auto spgh = maybe_spgh.get()) - { - build_internal(*spgh, *spec, paths, port_dir); - exit(EXIT_SUCCESS); - } - } - - System::println(System::color::error, "Error: %s: %s", maybe_current_spec.error_code().message(), args.command_arguments[0]); - print_example(Strings::format("%s zlib:x64-windows", args.command)); - exit(EXIT_FAILURE); - } } diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 7fab309d3e..3b1ae0934a 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -130,6 +130,8 @@ + + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index cfbb17a22a..16b8132445 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -84,6 +84,12 @@ Source Files + + Source Files + + + Source Files + From 30587111d362bc8c2e0b700549d0fe7d62b9193d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:04:32 -0800 Subject: [PATCH 078/561] Rename commands_installation to commands_install Names should match the command --- .../src/{commands_installation.cpp => commands_install.cpp} | 0 toolsrc/vcpkg/vcpkg.vcxproj | 2 +- toolsrc/vcpkg/vcpkg.vcxproj.filters | 6 +++--- 3 files changed, 4 insertions(+), 4 deletions(-) rename toolsrc/src/{commands_installation.cpp => commands_install.cpp} (100%) diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_install.cpp similarity index 100% rename from toolsrc/src/commands_installation.cpp rename to toolsrc/src/commands_install.cpp diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 3b1ae0934a..7179e38edc 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -147,7 +147,7 @@ - + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 16b8132445..16d2f209d0 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -27,9 +27,6 @@ Source Files - - Source Files - Source Files @@ -90,6 +87,9 @@ Source Files + + Source Files + From 4c51e65d5004311c7c7ba0687e7dba934ba986c1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:05:20 -0800 Subject: [PATCH 079/561] Rename commands_integration.cpp to commands_integrate.cpp Filename should match the command name --- .../{commands_integration.cpp => commands_integrate.cpp} | 0 toolsrc/vcpkg/vcpkg.vcxproj | 2 +- toolsrc/vcpkg/vcpkg.vcxproj.filters | 6 +++--- 3 files changed, 4 insertions(+), 4 deletions(-) rename toolsrc/src/{commands_integration.cpp => commands_integrate.cpp} (100%) diff --git a/toolsrc/src/commands_integration.cpp b/toolsrc/src/commands_integrate.cpp similarity index 100% rename from toolsrc/src/commands_integration.cpp rename to toolsrc/src/commands_integrate.cpp diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 7179e38edc..0179852ef6 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -148,7 +148,7 @@ - + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 16d2f209d0..4a9bd40289 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -24,9 +24,6 @@ Source Files - - Source Files - Source Files @@ -90,6 +87,9 @@ Source Files + + Source Files + From df2a05e8546281135c6ea12430734d74371bcf46 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:35:33 -0800 Subject: [PATCH 080/561] Introduce Command namespace. Refactoring --- toolsrc/include/vcpkg_Commands.h | 32 +++---- toolsrc/src/commands_available_commands.cpp | 44 ++++++++++ toolsrc/src/commands_build.cpp | 84 +++++++++---------- toolsrc/src/commands_build_external.cpp | 8 +- toolsrc/src/commands_cache.cpp | 4 +- toolsrc/src/commands_create.cpp | 4 +- toolsrc/src/commands_edit.cpp | 4 +- toolsrc/src/commands_hash.cpp | 4 +- toolsrc/src/commands_help.cpp | 8 +- ...ommands_other.cpp => commands_helpers.cpp} | 50 +---------- toolsrc/src/commands_import.cpp | 4 +- toolsrc/src/commands_install.cpp | 6 +- toolsrc/src/commands_integrate.cpp | 2 +- toolsrc/src/commands_list.cpp | 4 +- toolsrc/src/commands_owns.cpp | 4 +- toolsrc/src/commands_portsdiff.cpp | 4 +- toolsrc/src/commands_remove.cpp | 4 +- toolsrc/src/commands_search.cpp | 5 +- toolsrc/src/commands_update.cpp | 2 +- toolsrc/src/main.cpp | 10 +-- toolsrc/src/vcpkg_Input.cpp | 2 +- toolsrc/src/vcpkg_cmd_arguments.cpp | 6 +- toolsrc/vcpkg/vcpkg.vcxproj | 3 +- toolsrc/vcpkg/vcpkg.vcxproj.filters | 9 +- 24 files changed, 153 insertions(+), 154 deletions(-) create mode 100644 toolsrc/src/commands_available_commands.cpp rename toolsrc/src/{commands_other.cpp => commands_helpers.cpp} (60%) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 213d31adac..6b4941cc12 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -3,21 +3,17 @@ #include "vcpkg_cmd_arguments.h" #include "vcpkg_paths.h" -namespace vcpkg +namespace vcpkg::Commands { - // - namespace Commands::details - { - void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); - } - extern const char*const INTEGRATE_COMMAND_HELPSTRING; - void print_usage(); - void print_example(const std::string& command_and_arguments); - std::string create_example_string(const std::string& command_and_arguments); + using command_type_a = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + using command_type_b = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + using command_type_c = void(*)(const vcpkg_cmd_arguments& args); + void update_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); void build_external_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); void install_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); @@ -30,7 +26,6 @@ namespace vcpkg void list_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); void import_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); void owns_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void internal_test_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); void cache_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); @@ -45,10 +40,6 @@ namespace vcpkg void contact_command(const vcpkg_cmd_arguments& args); void hash_command(const vcpkg_cmd_arguments& args); - using command_type_a = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); - using command_type_b = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - using command_type_c = void(*)(const vcpkg_cmd_arguments& args); - template struct package_name_and_function { @@ -61,7 +52,7 @@ namespace vcpkg const std::vector>& get_available_commands_type_c(); template - T find_command(const std::string& command_name, const std::vector> available_commands) + T find(const std::string& command_name, const std::vector> available_commands) { for (const package_name_and_function& cmd : available_commands) { @@ -75,3 +66,12 @@ namespace vcpkg return nullptr; } } + +namespace vcpkg::Commands::Helpers +{ + void print_usage(); + + void print_example(const std::string& command_and_arguments); + + std::string create_example_string(const std::string& command_and_arguments); +} diff --git a/toolsrc/src/commands_available_commands.cpp b/toolsrc/src/commands_available_commands.cpp new file mode 100644 index 0000000000..f78416aeda --- /dev/null +++ b/toolsrc/src/commands_available_commands.cpp @@ -0,0 +1,44 @@ +#include "vcpkg_Commands.h" + +namespace vcpkg::Commands +{ + const std::vector>& get_available_commands_type_a() + { + static std::vector> t = { + {"install", install_command}, + {"remove", remove_command}, + {"build", build_command}, + {"build_external", build_external_command} + }; + return t; + } + + const std::vector>& get_available_commands_type_b() + { + static std::vector> t = { + {"/?", help_command}, + {"help", help_command}, + {"search", search_command}, + {"list", list_command}, + {"integrate", integrate_command}, + {"owns", owns_command}, + {"update", update_command}, + {"edit", edit_command}, + {"create", create_command}, + {"import", import_command}, + {"cache", cache_command}, + {"portsdiff", portsdiff_command} + }; + return t; + } + + const std::vector>& get_available_commands_type_c() + { + static std::vector> t = { + {"version", &version_command}, + {"contact", &contact_command}, + {"hash", &hash_command}, + }; + return t; + } +} diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 9f37e25f9b..178643d8e3 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -10,7 +10,7 @@ #include "vcpkg_info.h" #include -namespace vcpkg +namespace vcpkg::Commands { using Dependencies::package_spec_with_install_plan; using Dependencies::install_plan_type; @@ -24,53 +24,51 @@ namespace vcpkg std::ofstream(binary_control_file) << bpgh; } - namespace Commands::details + void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) { - void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) + Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_internal()"); + const triplet& target_triplet = spec.target_triplet(); + + const fs::path ports_cmake_script_path = paths.ports_cmake; + const std::wstring command = Strings::wformat(LR"("%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", + Strings::utf8_to_utf16(target_triplet.architecture()), + Strings::utf8_to_utf16(source_paragraph.name), + Strings::utf8_to_utf16(target_triplet.canonical_name()), + port_dir.generic_wstring(), + ports_cmake_script_path.generic_wstring()); + + System::Stopwatch2 timer; + timer.start(); + int return_code = System::cmd_execute(command); + timer.stop(); + TrackMetric("buildtimeus-" + to_string(spec), timer.microseconds()); + + if (return_code != 0) { - Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_internal()"); - const triplet& target_triplet = spec.target_triplet(); - - const fs::path ports_cmake_script_path = paths.ports_cmake; - const std::wstring command = Strings::wformat(LR"("%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", - Strings::utf8_to_utf16(target_triplet.architecture()), - Strings::utf8_to_utf16(source_paragraph.name), - Strings::utf8_to_utf16(target_triplet.canonical_name()), - port_dir.generic_wstring(), - ports_cmake_script_path.generic_wstring()); - - System::Stopwatch2 timer; - timer.start(); - int return_code = System::cmd_execute(command); - timer.stop(); - TrackMetric("buildtimeus-" + to_string(spec), timer.microseconds()); - - if (return_code != 0) - { - System::println(System::color::error, "Error: building package %s failed", to_string(spec)); - System::println("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" - "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" - " Package: %s\n" - " Vcpkg version: %s\n" - "\n" - "Additionally, attach any relevant sections from the log files above." - , to_string(spec), Info::version()); - TrackProperty("error", "build failed"); - TrackProperty("build_error", to_string(spec)); - exit(EXIT_FAILURE); - } - - PostBuildLint::perform_all_checks(spec, paths); - - create_binary_control_file(paths, source_paragraph, target_triplet); - - // const fs::path port_buildtrees_dir = paths.buildtrees / spec.name; - // delete_directory(port_buildtrees_dir); + System::println(System::color::error, "Error: building package %s failed", to_string(spec)); + System::println("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" + "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" + " Package: %s\n" + " Vcpkg version: %s\n" + "\n" + "Additionally, attach any relevant sections from the log files above." + , to_string(spec), Info::version()); + TrackProperty("error", "build failed"); + TrackProperty("build_error", to_string(spec)); + exit(EXIT_FAILURE); } + + PostBuildLint::perform_all_checks(spec, paths); + + create_binary_control_file(paths, source_paragraph, target_triplet); + + // const fs::path port_buildtrees_dir = paths.buildtrees / spec.name; + // delete_directory(port_buildtrees_dir); } + void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = create_example_string("build zlib:x64-windows"); + static const std::string example = Helpers::create_example_string("build zlib:x64-windows"); // Installing multiple packages leads to unintuitive behavior if one of them depends on another. // Allowing only 1 package for now. @@ -124,7 +122,7 @@ namespace vcpkg } Environment::ensure_utilities_on_path(paths); - Commands::details::build_internal(spgh, spec, paths, paths.port_dir(spec)); + Commands::build_internal(spgh, spec, paths, paths.port_dir(spec)); exit(EXIT_SUCCESS); } } diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index d34981e041..5ed52ad974 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -4,11 +4,11 @@ #include "vcpkg_Input.h" #include "vcpkg.h" -namespace vcpkg +namespace vcpkg::Commands { void build_external_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); + static const std::string example = Commands::Helpers::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); args.check_exact_arg_count(2, example); expected maybe_current_spec = package_spec::from_string(args.command_arguments[0], default_target_triplet); @@ -20,13 +20,13 @@ namespace vcpkg const expected maybe_spgh = try_load_port(port_dir); if (auto spgh = maybe_spgh.get()) { - Commands::details::build_internal(*spgh, *spec, paths, port_dir); + Commands::build_internal(*spgh, *spec, paths, port_dir); exit(EXIT_SUCCESS); } } System::println(System::color::error, "Error: %s: %s", maybe_current_spec.error_code().message(), args.command_arguments[0]); - print_example(Strings::format("%s zlib:x64-windows", args.command)); + Commands::Helpers::print_example(Strings::format("%s zlib:x64-windows", args.command)); exit(EXIT_FAILURE); } } diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/commands_cache.cpp index 1a10b93cf4..3d2916418c 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/commands_cache.cpp @@ -4,7 +4,7 @@ #include "Paragraphs.h" #include "BinaryParagraph.h" -namespace vcpkg +namespace vcpkg::Commands { static std::vector read_all_binary_paragraphs(const vcpkg_paths& paths) { @@ -37,7 +37,7 @@ namespace vcpkg void cache_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { static const std::string example = Strings::format( - "The argument should be a substring to search for, or no argument to display all cached libraries.\n%s", create_example_string("cache png")); + "The argument should be a substring to search for, or no argument to display all cached libraries.\n%s", Commands::Helpers::create_example_string("cache png")); args.check_max_arg_count(1, example); const std::vector binary_paragraphs = read_all_binary_paragraphs(paths); diff --git a/toolsrc/src/commands_create.cpp b/toolsrc/src/commands_create.cpp index ad00cd6764..2fcd85dba5 100644 --- a/toolsrc/src/commands_create.cpp +++ b/toolsrc/src/commands_create.cpp @@ -4,11 +4,11 @@ #include "vcpkg_Files.h" #include "vcpkg_Input.h" -namespace vcpkg +namespace vcpkg::Commands { void create_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = create_example_string(R"###(create zlib2 http://zlib.net/zlib128.zip "zlib128-2.zip")###"); + static const std::string example = Commands::Helpers::create_example_string(R"###(create zlib2 http://zlib.net/zlib128.zip "zlib128-2.zip")###"); args.check_max_arg_count(3, example); args.check_min_arg_count(2, example); diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index f7c489f2b0..090837a19c 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -2,11 +2,11 @@ #include "vcpkg_System.h" #include "vcpkg_Input.h" -namespace vcpkg +namespace vcpkg::Commands { void edit_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = create_example_string("edit zlib"); + static const std::string example = Commands::Helpers::create_example_string("edit zlib"); args.check_exact_arg_count(1, example); const std::string port_name = args.command_arguments.at(0); diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index 0e3e8a77ce..c6827e07a0 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -1,7 +1,7 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -namespace vcpkg +namespace vcpkg::Commands { static void do_file_hash(fs::path const& path, std::wstring const& hashType) { @@ -26,7 +26,7 @@ namespace vcpkg void hash_command(const vcpkg_cmd_arguments& args) { static const std::string example = Strings::format( - "The argument should be a file path\n%s", create_example_string("hash boost_1_62_0.tar.bz2")); + "The argument should be a file path\n%s", Commands::Helpers::create_example_string("hash boost_1_62_0.tar.bz2")); args.check_min_arg_count(1, example); args.check_max_arg_count(2, example); diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/commands_help.cpp index fd02d948ec..5baec62c76 100644 --- a/toolsrc/src/commands_help.cpp +++ b/toolsrc/src/commands_help.cpp @@ -2,7 +2,7 @@ #include "vcpkg_System.h" #include "vcpkg_info.h" -namespace vcpkg +namespace vcpkg::Commands { void version_command(const vcpkg_cmd_arguments& args) { @@ -19,18 +19,18 @@ namespace vcpkg args.check_max_arg_count(1); if (args.command_arguments.empty()) { - print_usage(); + Commands::Helpers::print_usage(); exit(EXIT_SUCCESS); } const auto& topic = args.command_arguments[0]; if (topic == "triplet") { - help_topic_valid_triplet(paths); + Commands::help_topic_valid_triplet(paths); } else { System::println(System::color::error, "Error: unknown topic %s", topic); - print_usage(); + Commands::Helpers::print_usage(); exit(EXIT_FAILURE); } exit(EXIT_SUCCESS); diff --git a/toolsrc/src/commands_other.cpp b/toolsrc/src/commands_helpers.cpp similarity index 60% rename from toolsrc/src/commands_other.cpp rename to toolsrc/src/commands_helpers.cpp index 6df3251003..5d6e519ab3 100644 --- a/toolsrc/src/commands_other.cpp +++ b/toolsrc/src/commands_helpers.cpp @@ -1,7 +1,7 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -namespace vcpkg +namespace vcpkg::Commands::Helpers { void print_usage() { @@ -52,52 +52,4 @@ namespace vcpkg { System::println(create_example_string(command_and_arguments)); } - - void internal_test_command(const vcpkg_cmd_arguments& /*args*/, const vcpkg_paths& /*paths*/) - { - // auto data = FormatEventData("test"); - // Track(data); - exit(EXIT_SUCCESS); - } - - const std::vector>& get_available_commands_type_a() - { - static std::vector> t = { - {"install", install_command}, - {"remove", remove_command}, - {"build", build_command}, - {"build_external", build_external_command} - }; - return t; - } - - const std::vector>& get_available_commands_type_b() - { - static std::vector> t = { - {"/?", help_command}, - {"help", help_command}, - {"search", search_command}, - {"list", list_command}, - {"integrate", integrate_command}, - {"owns", owns_command}, - {"update", update_command}, - {"edit", edit_command}, - {"create", create_command}, - {"import", import_command}, - {"cache", cache_command}, - {"internal_test", internal_test_command}, - {"portsdiff", portsdiff_command} - }; - return t; - } - - const std::vector>& get_available_commands_type_c() - { - static std::vector> t = { - {"version", &version_command}, - {"contact", &contact_command}, - {"hash", &hash_command}, - }; - return t; - } } diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp index 3832f0e7b6..c2c871414b 100644 --- a/toolsrc/src/commands_import.cpp +++ b/toolsrc/src/commands_import.cpp @@ -4,7 +4,7 @@ #include "vcpkg_Files.h" #include -namespace vcpkg +namespace vcpkg::Commands { struct Binaries { @@ -77,7 +77,7 @@ namespace vcpkg void import_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = create_example_string(R"(import C:\path\to\CONTROLfile C:\path\to\includedir C:\path\to\projectdir)"); + static const std::string example = Commands::Helpers::create_example_string(R"(import C:\path\to\CONTROLfile C:\path\to\includedir C:\path\to\projectdir)"); args.check_exact_arg_count(3, example); const fs::path control_file_path(args.command_arguments[0]); diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index f448529304..ff5ddb0e7e 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -7,7 +7,7 @@ #include "vcpkg_Dependencies.h" #include "vcpkg_Input.h" -namespace vcpkg +namespace vcpkg::Commands { using Dependencies::package_spec_with_install_plan; using Dependencies::install_plan_type; @@ -185,7 +185,7 @@ namespace vcpkg void install_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = create_example_string("install zlib zlib:x64-windows curl boost"); + static const std::string example = Commands::Helpers::create_example_string("install zlib zlib:x64-windows curl boost"); args.check_min_arg_count(1, example); StatusParagraphs status_db = database_load_check(paths); @@ -216,7 +216,7 @@ namespace vcpkg } else if (action.plan.type == install_plan_type::BUILD_AND_INSTALL) { - Commands::details::build_internal(*action.plan.spgh, action.spec, paths, paths.port_dir(action.spec)); + Commands::build_internal(*action.plan.spgh, action.spec, paths, paths.port_dir(action.spec)); const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); install_package(paths, bpgh, status_db); System::println(System::color::success, "Package %s is installed", action.spec); diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index e7e5b2d8d7..323735f6df 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -10,7 +10,7 @@ #include "vcpkg_System.h" #include "vcpkg_Files.h" -namespace vcpkg +namespace vcpkg::Commands { static const std::array old_system_target_files = { "C:/Program Files (x86)/MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.nuget.targets", diff --git a/toolsrc/src/commands_list.cpp b/toolsrc/src/commands_list.cpp index cc51232e9d..3e71f9c923 100644 --- a/toolsrc/src/commands_list.cpp +++ b/toolsrc/src/commands_list.cpp @@ -3,7 +3,7 @@ #include "vcpkg_System.h" #include "vcpkglib_helpers.h" -namespace vcpkg +namespace vcpkg::Commands { static void do_print(const StatusParagraph& pgh) { @@ -16,7 +16,7 @@ namespace vcpkg void list_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { static const std::string example = Strings::format( - "The argument should be a substring to search for, or no argument to display all installed libraries.\n%s", create_example_string("list png")); + "The argument should be a substring to search for, or no argument to display all installed libraries.\n%s", Commands::Helpers::create_example_string("list png")); args.check_max_arg_count(1, example); const StatusParagraphs status_paragraphs = database_load_check(paths); diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp index 62dac57ebc..e7719fe68b 100644 --- a/toolsrc/src/commands_owns.cpp +++ b/toolsrc/src/commands_owns.cpp @@ -2,7 +2,7 @@ #include "vcpkg_System.h" #include "vcpkg.h" -namespace vcpkg +namespace vcpkg::Commands { static void search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db) { @@ -23,7 +23,7 @@ namespace vcpkg void owns_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Strings::format("The argument should be a pattern to search for. %s", create_example_string("owns zlib.dll")); + static const std::string example = Strings::format("The argument should be a pattern to search for. %s", Commands::Helpers::create_example_string("owns zlib.dll")); args.check_exact_arg_count(1, example); StatusParagraphs status_db = database_load_check(paths); diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 46c6c90c7c..4794dee2bb 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -10,7 +10,7 @@ #include "SourceParagraph.h" #include "vcpkg_Environment.h" -namespace vcpkg +namespace vcpkg::Commands { static void do_print_name_and_version(const std::vector& ports_to_print, const std::map& names_and_versions) { @@ -99,7 +99,7 @@ namespace vcpkg void portsdiff_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Strings::format("The argument should be a branch/tag/hash to checkout.\n%s", create_example_string("portsdiff mybranchname")); + static const std::string example = Strings::format("The argument should be a branch/tag/hash to checkout.\n%s", Commands::Helpers::create_example_string("portsdiff mybranchname")); args.check_min_arg_count(1, example); args.check_max_arg_count(2, example); diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 445213fc26..16e8687e71 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -4,7 +4,7 @@ #include "vcpkg_Input.h" #include -namespace vcpkg +namespace vcpkg::Commands { static const std::string OPTION_PURGE = "--purge"; @@ -168,7 +168,7 @@ namespace vcpkg void remove_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = create_example_string("remove zlib zlib:x64-windows curl boost"); + static const std::string example = Commands::Helpers::create_example_string("remove zlib zlib:x64-windows curl boost"); args.check_min_arg_count(1, example); const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_PURGE}); diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index a4714477ed..cc3e3fe266 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -4,7 +4,7 @@ #include "vcpkglib_helpers.h" #include "SourceParagraph.h" -namespace vcpkg +namespace vcpkg::Commands { static std::vector read_all_source_paragraphs(const vcpkg_paths& paths) { @@ -42,7 +42,8 @@ namespace vcpkg void search_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Strings::format("The argument should be a substring to search for, or no argument to display all libraries.\n%s", create_example_string("search png")); + static const std::string example = Strings::format("The argument should be a substring to search for, or no argument to display all libraries.\n%s", + Commands::Helpers::create_example_string("search png")); args.check_max_arg_count(1, example); const std::vector source_paragraphs = read_all_source_paragraphs(paths); diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index a4ab7c6e76..9a480f3f54 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -5,7 +5,7 @@ #include "Paragraphs.h" #include "vcpkg_info.h" -namespace vcpkg +namespace vcpkg::Commands { void update_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { diff --git a/toolsrc/src/main.cpp b/toolsrc/src/main.cpp index 7703c541f7..8490dc81b6 100644 --- a/toolsrc/src/main.cpp +++ b/toolsrc/src/main.cpp @@ -21,7 +21,7 @@ bool g_debugging = false; void invalid_command(const std::string& cmd) { System::println(System::color::error, "invalid command: %s", cmd); - print_usage(); + Commands::Helpers::print_usage(); exit(EXIT_FAILURE); } @@ -30,11 +30,11 @@ static void inner(const vcpkg_cmd_arguments& args) TrackProperty("command", args.command); if (args.command.empty()) { - print_usage(); + Commands::Helpers::print_usage(); exit(EXIT_FAILURE); } - if (auto command_function = find_command(args.command, get_available_commands_type_c())) + if (auto command_function = Commands::find(args.command, Commands::get_available_commands_type_c())) { return command_function(args); } @@ -66,7 +66,7 @@ static void inner(const vcpkg_cmd_arguments& args) int exit_code = _wchdir(paths.root.c_str()); Checks::check_exit(exit_code == 0, "Changing the working dir failed"); - if (auto command_function = find_command(args.command, get_available_commands_type_b())) + if (auto command_function = Commands::find(args.command, Commands::get_available_commands_type_b())) { return command_function(args, paths); } @@ -91,7 +91,7 @@ static void inner(const vcpkg_cmd_arguments& args) Input::check_triplet(default_target_triplet, paths); - if (auto command_function = find_command(args.command, get_available_commands_type_a())) + if (auto command_function = Commands::find(args.command, Commands::get_available_commands_type_a())) { return command_function(args, paths, default_target_triplet); } diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp index 365f28cdb2..0c36291b4d 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg_Input.cpp @@ -37,7 +37,7 @@ namespace vcpkg::Input { System::println(System::color::error, "Error: invalid triplet: %s", t.canonical_name()); TrackProperty("error", "invalid triplet: " + t.canonical_name()); - help_topic_valid_triplet(paths); + Commands::help_topic_valid_triplet(paths); exit(EXIT_FAILURE); } } diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index a3648668ff..ac55e931a2 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -18,7 +18,7 @@ namespace vcpkg { System::println(System::color::error, "Error: expected value after %s", option_name); TrackProperty("error", "error option name"); - print_usage(); + Commands::Helpers::print_usage(); exit(EXIT_FAILURE); } @@ -26,7 +26,7 @@ namespace vcpkg { System::println(System::color::error, "Error: %s specified multiple times", option_name); TrackProperty("error", "error option specified multiple times"); - print_usage(); + Commands::Helpers::print_usage(); exit(EXIT_FAILURE); } @@ -42,7 +42,7 @@ namespace vcpkg { System::println(System::color::error, "Error: conflicting values specified for --%s", option_name); TrackProperty("error", "error conflicting switches"); - print_usage(); + Commands::Helpers::print_usage(); exit(EXIT_FAILURE); } option_field = new_setting; diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 0179852ef6..0b6e2b7522 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -130,6 +130,7 @@ + @@ -144,7 +145,7 @@ - + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 4a9bd40289..df8c48f8b9 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -18,9 +18,6 @@ Source Files - - Source Files - Source Files @@ -90,6 +87,12 @@ Source Files + + Source Files + + + Source Files + From 8e1ed2c9a95fa5b9e0bb0a9849a6e20878696f8c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:41:50 -0800 Subject: [PATCH 081/561] Place contact and version commands in different cpp files --- toolsrc/src/commands_contact.cpp | 13 +++++++++++++ toolsrc/src/commands_help.cpp | 18 ------------------ toolsrc/src/commands_version.cpp | 16 ++++++++++++++++ toolsrc/vcpkg/vcpkg.vcxproj | 2 ++ toolsrc/vcpkg/vcpkg.vcxproj.filters | 6 ++++++ 5 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 toolsrc/src/commands_contact.cpp create mode 100644 toolsrc/src/commands_version.cpp diff --git a/toolsrc/src/commands_contact.cpp b/toolsrc/src/commands_contact.cpp new file mode 100644 index 0000000000..5bd1c1a670 --- /dev/null +++ b/toolsrc/src/commands_contact.cpp @@ -0,0 +1,13 @@ +#include "vcpkg_Commands.h" +#include "vcpkg_System.h" +#include "vcpkg_info.h" + +namespace vcpkg::Commands +{ + void contact_command(const vcpkg_cmd_arguments& args) + { + args.check_exact_arg_count(0); + System::println("Send an email to %s with any feedback.", Info::email()); + exit(EXIT_SUCCESS); + } +} diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/commands_help.cpp index 5baec62c76..a0881e64db 100644 --- a/toolsrc/src/commands_help.cpp +++ b/toolsrc/src/commands_help.cpp @@ -1,19 +1,8 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -#include "vcpkg_info.h" namespace vcpkg::Commands { - void version_command(const vcpkg_cmd_arguments& args) - { - args.check_exact_arg_count(0); - System::println("Vcpkg package management program version %s\n" - "\n" - "See LICENSE.txt for license information.", Info::version() - ); - exit(EXIT_SUCCESS); - } - void help_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { args.check_max_arg_count(1); @@ -36,13 +25,6 @@ namespace vcpkg::Commands exit(EXIT_SUCCESS); } - void contact_command(const vcpkg_cmd_arguments& args) - { - args.check_exact_arg_count(0); - System::println("Send an email to %s with any feedback.", Info::email()); - exit(EXIT_SUCCESS); - } - void help_topic_valid_triplet(const vcpkg_paths& paths) { System::println("Available architecture triplets:"); diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/commands_version.cpp new file mode 100644 index 0000000000..03cce32d4d --- /dev/null +++ b/toolsrc/src/commands_version.cpp @@ -0,0 +1,16 @@ +#include "vcpkg_Commands.h" +#include "vcpkg_System.h" +#include "vcpkg_info.h" + +namespace vcpkg::Commands +{ + void version_command(const vcpkg_cmd_arguments& args) + { + args.check_exact_arg_count(0); + System::println("Vcpkg package management program version %s\n" + "\n" + "See LICENSE.txt for license information.", Info::version() + ); + exit(EXIT_SUCCESS); + } +} diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 0b6e2b7522..79d3489107 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -134,6 +134,7 @@ + @@ -144,6 +145,7 @@ + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index df8c48f8b9..71b0635ab8 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -93,6 +93,12 @@ Source Files + + Source Files + + + Source Files + From 678721b9a8efc550aee9e5293f1c39a4522428fa Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Thu, 12 Jan 2017 21:25:10 -0800 Subject: [PATCH 082/561] added missing free calls after curl_getenv --- ports/curl/0002_fix_uwp.patch | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/ports/curl/0002_fix_uwp.patch b/ports/curl/0002_fix_uwp.patch index a96f678388..5cd0678cf2 100644 --- a/ports/curl/0002_fix_uwp.patch +++ b/ports/curl/0002_fix_uwp.patch @@ -14,7 +14,7 @@ index ed3f38a..d6480b7 100644 endif(WIN32) diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c -index 2591fd8..4380b7c 100644 +index 2591fd8..cef38ac 100644 --- a/lib/curl_gethostname.c +++ b/lib/curl_gethostname.c @@ -21,6 +21,7 @@ @@ -25,28 +25,37 @@ index 2591fd8..4380b7c 100644 #include "curl_gethostname.h" -@@ -64,7 +65,7 @@ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) { +@@ -64,9 +65,10 @@ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) { #ifdef DEBUGBUILD /* Override host name when environment variable CURL_GETHOSTNAME is set */ - const char *force_hostname = getenv("CURL_GETHOSTNAME"); -+ const char *force_hostname = curl_getenv("CURL_GETHOSTNAME"); ++ char *force_hostname = curl_getenv("CURL_GETHOSTNAME"); if(force_hostname) { strncpy(name, force_hostname, namelen); ++ free(force_hostname); err = 0; + } + else { diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c -index 812a073..3c322ed 100644 +index 812a073..02c8416 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c -@@ -696,7 +696,7 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, +@@ -696,9 +696,12 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, /* Calculate the timestamp */ #ifdef DEBUGBUILD - char *force_timestamp = getenv("CURL_FORCETIME"); +- if(force_timestamp) + char *force_timestamp = curl_getenv("CURL_FORCETIME"); - if(force_timestamp) ++ if (force_timestamp) ++ { tw = CURL_OFF_T_C(11644473600) * 10000000; ++ free(force_timestamp); ++ } else + #endif + tw = ((curl_off_t)time(NULL) + CURL_OFF_T_C(11644473600)) * 10000000; diff --git a/lib/ftp.c b/lib/ftp.c index b231731..d50779f 100644 --- a/lib/ftp.c @@ -78,7 +87,7 @@ index 7cb0c96..2f43d3c 100644 #include "smb.h" #include "urldata.h" diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c -index 56a8823..4032e7e 100644 +index 56a8823..5a895ed 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -197,7 +197,7 @@ unsigned int Curl_rand(struct Curl_easy *data) @@ -90,3 +99,11 @@ index 56a8823..4032e7e 100644 if(force_entropy) { if(!seeded) { size_t elen = strlen(force_entropy); +@@ -208,6 +208,7 @@ unsigned int Curl_rand(struct Curl_easy *data) + } + else + randseed++; ++ free(force_entropy); + return randseed; + } + #endif From 04bd4b305c3ad306af38811ac464d26941e02b77 Mon Sep 17 00:00:00 2001 From: sdflysha Date: Fri, 13 Jan 2017 13:53:37 +0800 Subject: [PATCH 083/561] [directxmesh] specify static only library --- ports/directxmesh/portfile.cmake | 40 ++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/ports/directxmesh/portfile.cmake b/ports/directxmesh/portfile.cmake index 45ed111ee9..925111ca10 100644 --- a/ports/directxmesh/portfile.cmake +++ b/ports/directxmesh/portfile.cmake @@ -5,6 +5,10 @@ # CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # +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) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DirectXMesh-oct2016) @@ -15,32 +19,32 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") - SET(BUILD_ARCH "Win32") -ELSE() - SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") + SET(BUILD_ARCH "Win32") +ELSE() + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) ENDIF() -vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/DirectXMesh_Desktop_2015.sln - PLATFORM ${BUILD_ARCH} +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/DirectXMesh_Desktop_2015.sln + PLATFORM ${BUILD_ARCH} ) -file(INSTALL - ${SOURCE_PATH}/DirectXMesh/DirectXMesh.h - ${SOURCE_PATH}/DirectXMesh/DirectXMesh.inl - DESTINATION ${CURRENT_PACKAGES_DIR}/include +file(INSTALL + ${SOURCE_PATH}/DirectXMesh/DirectXMesh.h + ${SOURCE_PATH}/DirectXMesh/DirectXMesh.inl + DESTINATION ${CURRENT_PACKAGES_DIR}/include ) -file(INSTALL - ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXMesh.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(INSTALL - ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXMesh.lib +file(INSTALL + ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXMesh.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(INSTALL + ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXMesh.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) set(TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools) -file(INSTALL - ${SOURCE_PATH}/Meshconvert/Bin/Desktop_2015/${BUILD_ARCH}/Release/Meshconvert.exe +file(INSTALL + ${SOURCE_PATH}/Meshconvert/Bin/Desktop_2015/${BUILD_ARCH}/Release/Meshconvert.exe DESTINATION ${TOOL_PATH}) # Handle copyright From cc8851144a871931b93d84bd962364159ad1c424 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 22:03:57 -0800 Subject: [PATCH 084/561] Reorganize commands, each in its own namespace Additionally, functions related to a command can now live in the same namespace --- toolsrc/include/vcpkg_Commands.h | 123 +++++++++++++++----- toolsrc/src/commands_available_commands.cpp | 38 +++--- toolsrc/src/commands_build.cpp | 10 +- toolsrc/src/commands_build_external.cpp | 10 +- toolsrc/src/commands_cache.cpp | 6 +- toolsrc/src/commands_contact.cpp | 4 +- toolsrc/src/commands_create.cpp | 6 +- toolsrc/src/commands_edit.cpp | 6 +- toolsrc/src/commands_hash.cpp | 6 +- toolsrc/src/commands_help.cpp | 96 +++++++++++---- toolsrc/src/commands_helpers.cpp | 48 -------- toolsrc/src/commands_import.cpp | 6 +- toolsrc/src/commands_install.cpp | 8 +- toolsrc/src/commands_integrate.cpp | 4 +- toolsrc/src/commands_list.cpp | 6 +- toolsrc/src/commands_owns.cpp | 6 +- toolsrc/src/commands_portsdiff.cpp | 6 +- toolsrc/src/commands_remove.cpp | 6 +- toolsrc/src/commands_search.cpp | 6 +- toolsrc/src/commands_update.cpp | 4 +- toolsrc/src/commands_version.cpp | 4 +- toolsrc/src/main.cpp | 4 +- toolsrc/src/vcpkg_Input.cpp | 2 +- toolsrc/src/vcpkg_cmd_arguments.cpp | 6 +- toolsrc/vcpkg/vcpkg.vcxproj | 1 - toolsrc/vcpkg/vcpkg.vcxproj.filters | 3 - 26 files changed, 242 insertions(+), 183 deletions(-) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 6b4941cc12..8d772b255f 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -5,40 +5,110 @@ namespace vcpkg::Commands { - extern const char*const INTEGRATE_COMMAND_HELPSTRING; - using command_type_a = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); using command_type_b = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); using command_type_c = void(*)(const vcpkg_cmd_arguments& args); - void update_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Build + { + void build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } - void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); - void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); - void build_external_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); - void install_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); - void remove_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + namespace BuildExternal + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } - void edit_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void create_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Install + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } - void search_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void list_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void import_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void owns_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Remove + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } - void cache_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Update + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } - void integrate_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Create + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } - void portsdiff_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Edit + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } - void help_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void help_topic_valid_triplet(const vcpkg_paths& paths); + namespace Search + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } - void version_command(const vcpkg_cmd_arguments& args); - void contact_command(const vcpkg_cmd_arguments& args); - void hash_command(const vcpkg_cmd_arguments& args); + namespace List + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Import + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Owns + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Cache + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Integrate + { + extern const char*const INTEGRATE_COMMAND_HELPSTRING; + + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace PortsDiff + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Help + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + + void help_topic_valid_triplet(const vcpkg_paths& paths); + + void print_usage(); + + void print_example(const std::string& command_and_arguments); + + std::string create_example_string(const std::string& command_and_arguments); + } + + namespace Version + { + void perform_and_exit(const vcpkg_cmd_arguments& args); + } + + namespace Contact + { + void perform_and_exit(const vcpkg_cmd_arguments& args); + } + + namespace Hash + { + void perform_and_exit(const vcpkg_cmd_arguments& args); + } template struct package_name_and_function @@ -66,12 +136,3 @@ namespace vcpkg::Commands return nullptr; } } - -namespace vcpkg::Commands::Helpers -{ - void print_usage(); - - void print_example(const std::string& command_and_arguments); - - std::string create_example_string(const std::string& command_and_arguments); -} diff --git a/toolsrc/src/commands_available_commands.cpp b/toolsrc/src/commands_available_commands.cpp index f78416aeda..48239587d5 100644 --- a/toolsrc/src/commands_available_commands.cpp +++ b/toolsrc/src/commands_available_commands.cpp @@ -5,10 +5,10 @@ namespace vcpkg::Commands const std::vector>& get_available_commands_type_a() { static std::vector> t = { - {"install", install_command}, - {"remove", remove_command}, - {"build", build_command}, - {"build_external", build_external_command} + {"install", &Install::perform_and_exit}, + {"remove", &Remove::perform_and_exit}, + {"build", &Build::perform_and_exit}, + {"build_external", &BuildExternal::perform_and_exit} }; return t; } @@ -16,18 +16,18 @@ namespace vcpkg::Commands const std::vector>& get_available_commands_type_b() { static std::vector> t = { - {"/?", help_command}, - {"help", help_command}, - {"search", search_command}, - {"list", list_command}, - {"integrate", integrate_command}, - {"owns", owns_command}, - {"update", update_command}, - {"edit", edit_command}, - {"create", create_command}, - {"import", import_command}, - {"cache", cache_command}, - {"portsdiff", portsdiff_command} + {"/?", &Help::perform_and_exit}, + {"help", &Help::perform_and_exit}, + {"search", &Search::perform_and_exit}, + {"list", &List::perform_and_exit}, + {"integrate", &Integrate::perform_and_exit}, + {"owns", &Owns::perform_and_exit}, + {"update", &Update::perform_and_exit}, + {"edit", &Edit::perform_and_exit}, + {"create", &Create::perform_and_exit}, + {"import", &Import::perform_and_exit}, + {"cache", &Cache::perform_and_exit}, + {"portsdiff", &PortsDiff::perform_and_exit} }; return t; } @@ -35,9 +35,9 @@ namespace vcpkg::Commands const std::vector>& get_available_commands_type_c() { static std::vector> t = { - {"version", &version_command}, - {"contact", &contact_command}, - {"hash", &hash_command}, + {"version", &Version::perform_and_exit}, + {"contact", &Contact::perform_and_exit}, + {"hash", &Hash::perform_and_exit}, }; return t; } diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 178643d8e3..72ebb264b6 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -10,7 +10,7 @@ #include "vcpkg_info.h" #include -namespace vcpkg::Commands +namespace vcpkg::Commands::Build { using Dependencies::package_spec_with_install_plan; using Dependencies::install_plan_type; @@ -24,7 +24,7 @@ namespace vcpkg::Commands std::ofstream(binary_control_file) << bpgh; } - void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) + void build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) { Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_internal()"); const triplet& target_triplet = spec.target_triplet(); @@ -66,9 +66,9 @@ namespace vcpkg::Commands // delete_directory(port_buildtrees_dir); } - void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = Helpers::create_example_string("build zlib:x64-windows"); + static const std::string example = Commands::Help::create_example_string("build zlib:x64-windows"); // Installing multiple packages leads to unintuitive behavior if one of them depends on another. // Allowing only 1 package for now. @@ -122,7 +122,7 @@ namespace vcpkg::Commands } Environment::ensure_utilities_on_path(paths); - Commands::build_internal(spgh, spec, paths, paths.port_dir(spec)); + build_package(spgh, spec, paths, paths.port_dir(spec)); exit(EXIT_SUCCESS); } } diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index 5ed52ad974..09a9256d78 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -4,11 +4,11 @@ #include "vcpkg_Input.h" #include "vcpkg.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::BuildExternal { - void build_external_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = Commands::Helpers::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); + static const std::string example = Commands::Help::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); args.check_exact_arg_count(2, example); expected maybe_current_spec = package_spec::from_string(args.command_arguments[0], default_target_triplet); @@ -20,13 +20,13 @@ namespace vcpkg::Commands const expected maybe_spgh = try_load_port(port_dir); if (auto spgh = maybe_spgh.get()) { - Commands::build_internal(*spgh, *spec, paths, port_dir); + Commands::Build::build_package(*spgh, *spec, paths, port_dir); exit(EXIT_SUCCESS); } } System::println(System::color::error, "Error: %s: %s", maybe_current_spec.error_code().message(), args.command_arguments[0]); - Commands::Helpers::print_example(Strings::format("%s zlib:x64-windows", args.command)); + Commands::Help::print_example(Strings::format("%s zlib:x64-windows", args.command)); exit(EXIT_FAILURE); } } diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/commands_cache.cpp index 3d2916418c..63bf322605 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/commands_cache.cpp @@ -4,7 +4,7 @@ #include "Paragraphs.h" #include "BinaryParagraph.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Cache { static std::vector read_all_binary_paragraphs(const vcpkg_paths& paths) { @@ -34,10 +34,10 @@ namespace vcpkg::Commands return output; } - void cache_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { static const std::string example = Strings::format( - "The argument should be a substring to search for, or no argument to display all cached libraries.\n%s", Commands::Helpers::create_example_string("cache png")); + "The argument should be a substring to search for, or no argument to display all cached libraries.\n%s", Commands::Help::create_example_string("cache png")); args.check_max_arg_count(1, example); const std::vector binary_paragraphs = read_all_binary_paragraphs(paths); diff --git a/toolsrc/src/commands_contact.cpp b/toolsrc/src/commands_contact.cpp index 5bd1c1a670..3e3ebc2b43 100644 --- a/toolsrc/src/commands_contact.cpp +++ b/toolsrc/src/commands_contact.cpp @@ -2,9 +2,9 @@ #include "vcpkg_System.h" #include "vcpkg_info.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Contact { - void contact_command(const vcpkg_cmd_arguments& args) + void perform_and_exit(const vcpkg_cmd_arguments& args) { args.check_exact_arg_count(0); System::println("Send an email to %s with any feedback.", Info::email()); diff --git a/toolsrc/src/commands_create.cpp b/toolsrc/src/commands_create.cpp index 2fcd85dba5..d842d3fab6 100644 --- a/toolsrc/src/commands_create.cpp +++ b/toolsrc/src/commands_create.cpp @@ -4,11 +4,11 @@ #include "vcpkg_Files.h" #include "vcpkg_Input.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Create { - void create_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Commands::Helpers::create_example_string(R"###(create zlib2 http://zlib.net/zlib128.zip "zlib128-2.zip")###"); + static const std::string example = Commands::Help::create_example_string(R"###(create zlib2 http://zlib.net/zlib128.zip "zlib128-2.zip")###"); args.check_max_arg_count(3, example); args.check_min_arg_count(2, example); diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index 090837a19c..a4981cf80f 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -2,11 +2,11 @@ #include "vcpkg_System.h" #include "vcpkg_Input.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Edit { - void edit_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Commands::Helpers::create_example_string("edit zlib"); + static const std::string example = Commands::Help::create_example_string("edit zlib"); args.check_exact_arg_count(1, example); const std::string port_name = args.command_arguments.at(0); diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index c6827e07a0..7048fb0d98 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -1,7 +1,7 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Hash { static void do_file_hash(fs::path const& path, std::wstring const& hashType) { @@ -23,10 +23,10 @@ namespace vcpkg::Commands System::println(hash); } - void hash_command(const vcpkg_cmd_arguments& args) + void perform_and_exit(const vcpkg_cmd_arguments& args) { static const std::string example = Strings::format( - "The argument should be a file path\n%s", Commands::Helpers::create_example_string("hash boost_1_62_0.tar.bz2")); + "The argument should be a file path\n%s", Commands::Help::create_example_string("hash boost_1_62_0.tar.bz2")); args.check_min_arg_count(1, example); args.check_max_arg_count(2, example); diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/commands_help.cpp index a0881e64db..e4769752c0 100644 --- a/toolsrc/src/commands_help.cpp +++ b/toolsrc/src/commands_help.cpp @@ -1,30 +1,8 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Help { - void help_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) - { - args.check_max_arg_count(1); - if (args.command_arguments.empty()) - { - Commands::Helpers::print_usage(); - exit(EXIT_SUCCESS); - } - const auto& topic = args.command_arguments[0]; - if (topic == "triplet") - { - Commands::help_topic_valid_triplet(paths); - } - else - { - System::println(System::color::error, "Error: unknown topic %s", topic); - Commands::Helpers::print_usage(); - exit(EXIT_FAILURE); - } - exit(EXIT_SUCCESS); - } - void help_topic_valid_triplet(const vcpkg_paths& paths) { System::println("Available architecture triplets:"); @@ -34,4 +12,76 @@ namespace vcpkg::Commands System::println(" %s", it->path().stem().filename().string()); } } + + void print_usage() + { + System::println( + "Commands:\n" + " vcpkg search [pat] Search for packages available to be built\n" + " vcpkg install Install a package\n" + " vcpkg remove Uninstall a package. \n" + " vcpkg remove --purge Uninstall and delete a package. \n" + " vcpkg list List installed packages\n" + " vcpkg update Display list of packages for updating\n" + " vcpkg hash [alg] Hash a file by specific algorithm, default SHA512\n" + "\n" + "%s" // Integration help + "\n" + " vcpkg edit Open up a port for editing (uses %%EDITOR%%, default 'code')\n" + " vcpkg import Import a pre-built library\n" + " vcpkg create \n" + " [archivename] Create a new package\n" + " vcpkg owns Search for files in installed packages\n" + " vcpkg cache List cached compiled packages\n" + " vcpkg version Display version information\n" + " vcpkg contact Display contact information to send feedback\n" + "\n" + //"internal commands:\n" + //" --check-build-deps \n" + //" --create-binary-control \n" + //"\n" + "Options:\n" + " --triplet Specify the target architecture triplet.\n" + " (default: %%VCPKG_DEFAULT_TRIPLET%%, see 'vcpkg help triplet')\n" + "\n" + " --vcpkg-root Specify the vcpkg root directory\n" + " (default: %%VCPKG_ROOT%%)\n" + "\n" + "For more help (including examples) see the accompanying README.md." + , Integrate::INTEGRATE_COMMAND_HELPSTRING); + } + + std::string create_example_string(const std::string& command_and_arguments) + { + std::string cs = Strings::format("Example:\n" + " vcpkg %s", command_and_arguments); + return cs; + } + + void print_example(const std::string& command_and_arguments) + { + System::println(create_example_string(command_and_arguments)); + } + + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + { + args.check_max_arg_count(1); + if (args.command_arguments.empty()) + { + print_usage(); + exit(EXIT_SUCCESS); + } + const auto& topic = args.command_arguments[0]; + if (topic == "triplet") + { + help_topic_valid_triplet(paths); + } + else + { + System::println(System::color::error, "Error: unknown topic %s", topic); + print_usage(); + exit(EXIT_FAILURE); + } + exit(EXIT_SUCCESS); + } } diff --git a/toolsrc/src/commands_helpers.cpp b/toolsrc/src/commands_helpers.cpp index 5d6e519ab3..0c7ce15bbe 100644 --- a/toolsrc/src/commands_helpers.cpp +++ b/toolsrc/src/commands_helpers.cpp @@ -3,53 +3,5 @@ namespace vcpkg::Commands::Helpers { - void print_usage() - { - System::println( - "Commands:\n" - " vcpkg search [pat] Search for packages available to be built\n" - " vcpkg install Install a package\n" - " vcpkg remove Uninstall a package. \n" - " vcpkg remove --purge Uninstall and delete a package. \n" - " vcpkg list List installed packages\n" - " vcpkg update Display list of packages for updating\n" - " vcpkg hash [alg] Hash a file by specific algorithm, default SHA512\n" - "\n" - "%s" // Integration help - "\n" - " vcpkg edit Open up a port for editing (uses %%EDITOR%%, default 'code')\n" - " vcpkg import Import a pre-built library\n" - " vcpkg create \n" - " [archivename] Create a new package\n" - " vcpkg owns Search for files in installed packages\n" - " vcpkg cache List cached compiled packages\n" - " vcpkg version Display version information\n" - " vcpkg contact Display contact information to send feedback\n" - "\n" - //"internal commands:\n" - //" --check-build-deps \n" - //" --create-binary-control \n" - //"\n" - "Options:\n" - " --triplet Specify the target architecture triplet.\n" - " (default: %%VCPKG_DEFAULT_TRIPLET%%, see 'vcpkg help triplet')\n" - "\n" - " --vcpkg-root Specify the vcpkg root directory\n" - " (default: %%VCPKG_ROOT%%)\n" - "\n" - "For more help (including examples) see the accompanying README.md." - , INTEGRATE_COMMAND_HELPSTRING); - } - std::string create_example_string(const std::string& command_and_arguments) - { - std::string cs = Strings::format("Example:\n" - " vcpkg %s", command_and_arguments); - return cs; - } - - void print_example(const std::string& command_and_arguments) - { - System::println(create_example_string(command_and_arguments)); - } } diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp index c2c871414b..14e83e75f3 100644 --- a/toolsrc/src/commands_import.cpp +++ b/toolsrc/src/commands_import.cpp @@ -4,7 +4,7 @@ #include "vcpkg_Files.h" #include -namespace vcpkg::Commands +namespace vcpkg::Commands::Import { struct Binaries { @@ -75,9 +75,9 @@ namespace vcpkg::Commands std::ofstream(control_file_path) << control_file_data; } - void import_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Commands::Helpers::create_example_string(R"(import C:\path\to\CONTROLfile C:\path\to\includedir C:\path\to\projectdir)"); + static const std::string example = Commands::Help::create_example_string(R"(import C:\path\to\CONTROLfile C:\path\to\includedir C:\path\to\projectdir)"); args.check_exact_arg_count(3, example); const fs::path control_file_path(args.command_arguments[0]); diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index ff5ddb0e7e..ff517d9b1c 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -7,7 +7,7 @@ #include "vcpkg_Dependencies.h" #include "vcpkg_Input.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Install { using Dependencies::package_spec_with_install_plan; using Dependencies::install_plan_type; @@ -183,9 +183,9 @@ namespace vcpkg::Commands status_db.insert(std::make_unique(spgh)); } - void install_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = Commands::Helpers::create_example_string("install zlib zlib:x64-windows curl boost"); + static const std::string example = Commands::Help::create_example_string("install zlib zlib:x64-windows curl boost"); args.check_min_arg_count(1, example); StatusParagraphs status_db = database_load_check(paths); @@ -216,7 +216,7 @@ namespace vcpkg::Commands } else if (action.plan.type == install_plan_type::BUILD_AND_INSTALL) { - Commands::build_internal(*action.plan.spgh, action.spec, paths, paths.port_dir(action.spec)); + Commands::Build::build_package(*action.plan.spgh, action.spec, paths, paths.port_dir(action.spec)); const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); install_package(paths, bpgh, status_db); System::println(System::color::success, "Package %s is installed", action.spec); diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 323735f6df..2bd5027ec0 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -10,7 +10,7 @@ #include "vcpkg_System.h" #include "vcpkg_Files.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Integrate { static const std::array old_system_target_files = { "C:/Program Files (x86)/MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.nuget.targets", @@ -293,7 +293,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console " vcpkg integrate remove Remove user-wide integration\n" " vcpkg integrate project Generate a referencing nuget package for individual VS project use\n"; - void integrate_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { static const std::string example = Strings::format("Commands:\n" "%s", INTEGRATE_COMMAND_HELPSTRING); diff --git a/toolsrc/src/commands_list.cpp b/toolsrc/src/commands_list.cpp index 3e71f9c923..d9c4a52f23 100644 --- a/toolsrc/src/commands_list.cpp +++ b/toolsrc/src/commands_list.cpp @@ -3,7 +3,7 @@ #include "vcpkg_System.h" #include "vcpkglib_helpers.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::List { static void do_print(const StatusParagraph& pgh) { @@ -13,10 +13,10 @@ namespace vcpkg::Commands details::shorten_description(pgh.package.description)); } - void list_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { static const std::string example = Strings::format( - "The argument should be a substring to search for, or no argument to display all installed libraries.\n%s", Commands::Helpers::create_example_string("list png")); + "The argument should be a substring to search for, or no argument to display all installed libraries.\n%s", Commands::Help::create_example_string("list png")); args.check_max_arg_count(1, example); const StatusParagraphs status_paragraphs = database_load_check(paths); diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp index e7719fe68b..bb1a7eb9ff 100644 --- a/toolsrc/src/commands_owns.cpp +++ b/toolsrc/src/commands_owns.cpp @@ -2,7 +2,7 @@ #include "vcpkg_System.h" #include "vcpkg.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Owns { static void search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db) { @@ -21,9 +21,9 @@ namespace vcpkg::Commands } } - void owns_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Strings::format("The argument should be a pattern to search for. %s", Commands::Helpers::create_example_string("owns zlib.dll")); + static const std::string example = Strings::format("The argument should be a pattern to search for. %s", Commands::Help::create_example_string("owns zlib.dll")); args.check_exact_arg_count(1, example); StatusParagraphs status_db = database_load_check(paths); diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 4794dee2bb..1665d7c471 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -10,7 +10,7 @@ #include "SourceParagraph.h" #include "vcpkg_Environment.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::PortsDiff { static void do_print_name_and_version(const std::vector& ports_to_print, const std::map& names_and_versions) { @@ -97,9 +97,9 @@ namespace vcpkg::Commands Checks::check_exit(output.output == VALID_COMMIT_OUTPUT, "Invalid commit id %s", Strings::utf16_to_utf8(git_commit_id)); } - void portsdiff_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Strings::format("The argument should be a branch/tag/hash to checkout.\n%s", Commands::Helpers::create_example_string("portsdiff mybranchname")); + static const std::string example = Strings::format("The argument should be a branch/tag/hash to checkout.\n%s", Commands::Help::create_example_string("portsdiff mybranchname")); args.check_min_arg_count(1, example); args.check_max_arg_count(2, example); diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 16e8687e71..23d981fc1d 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -4,7 +4,7 @@ #include "vcpkg_Input.h" #include -namespace vcpkg::Commands +namespace vcpkg::Commands::Remove { static const std::string OPTION_PURGE = "--purge"; @@ -166,9 +166,9 @@ namespace vcpkg::Commands System::println(System::color::success, "Package %s was successfully removed", pkg.package.displayname()); } - void remove_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { - static const std::string example = Commands::Helpers::create_example_string("remove zlib zlib:x64-windows curl boost"); + static const std::string example = Commands::Help::create_example_string("remove zlib zlib:x64-windows curl boost"); args.check_min_arg_count(1, example); const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_PURGE}); diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index cc3e3fe266..3f197b06b6 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -4,7 +4,7 @@ #include "vcpkglib_helpers.h" #include "SourceParagraph.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Search { static std::vector read_all_source_paragraphs(const vcpkg_paths& paths) { @@ -40,10 +40,10 @@ namespace vcpkg::Commands details::shorten_description(source_paragraph.description)); } - void search_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { static const std::string example = Strings::format("The argument should be a substring to search for, or no argument to display all libraries.\n%s", - Commands::Helpers::create_example_string("search png")); + Commands::Help::create_example_string("search png")); args.check_max_arg_count(1, example); const std::vector source_paragraphs = read_all_source_paragraphs(paths); diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index 9a480f3f54..12b4dad506 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -5,9 +5,9 @@ #include "Paragraphs.h" #include "vcpkg_info.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Update { - void update_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { args.check_exact_arg_count(0); System::println("Using local portfile versions. To update the local portfiles, use `git pull`."); diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/commands_version.cpp index 03cce32d4d..e982516013 100644 --- a/toolsrc/src/commands_version.cpp +++ b/toolsrc/src/commands_version.cpp @@ -2,9 +2,9 @@ #include "vcpkg_System.h" #include "vcpkg_info.h" -namespace vcpkg::Commands +namespace vcpkg::Commands::Version { - void version_command(const vcpkg_cmd_arguments& args) + void perform_and_exit(const vcpkg_cmd_arguments& args) { args.check_exact_arg_count(0); System::println("Vcpkg package management program version %s\n" diff --git a/toolsrc/src/main.cpp b/toolsrc/src/main.cpp index 8490dc81b6..08e65391f4 100644 --- a/toolsrc/src/main.cpp +++ b/toolsrc/src/main.cpp @@ -21,7 +21,7 @@ bool g_debugging = false; void invalid_command(const std::string& cmd) { System::println(System::color::error, "invalid command: %s", cmd); - Commands::Helpers::print_usage(); + Commands::Help::print_usage(); exit(EXIT_FAILURE); } @@ -30,7 +30,7 @@ static void inner(const vcpkg_cmd_arguments& args) TrackProperty("command", args.command); if (args.command.empty()) { - Commands::Helpers::print_usage(); + Commands::Help::print_usage(); exit(EXIT_FAILURE); } diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp index 0c36291b4d..bf7ccd3467 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg_Input.cpp @@ -37,7 +37,7 @@ namespace vcpkg::Input { System::println(System::color::error, "Error: invalid triplet: %s", t.canonical_name()); TrackProperty("error", "invalid triplet: " + t.canonical_name()); - Commands::help_topic_valid_triplet(paths); + Commands::Help::help_topic_valid_triplet(paths); exit(EXIT_FAILURE); } } diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index ac55e931a2..aa1c359650 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -18,7 +18,7 @@ namespace vcpkg { System::println(System::color::error, "Error: expected value after %s", option_name); TrackProperty("error", "error option name"); - Commands::Helpers::print_usage(); + Commands::Help::print_usage(); exit(EXIT_FAILURE); } @@ -26,7 +26,7 @@ namespace vcpkg { System::println(System::color::error, "Error: %s specified multiple times", option_name); TrackProperty("error", "error option specified multiple times"); - Commands::Helpers::print_usage(); + Commands::Help::print_usage(); exit(EXIT_FAILURE); } @@ -42,7 +42,7 @@ namespace vcpkg { System::println(System::color::error, "Error: conflicting values specified for --%s", option_name); TrackProperty("error", "error conflicting switches"); - Commands::Helpers::print_usage(); + Commands::Help::print_usage(); exit(EXIT_FAILURE); } option_field = new_setting; diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 79d3489107..bcec048f59 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -147,7 +147,6 @@ - diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 71b0635ab8..1f43777b83 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -87,9 +87,6 @@ Source Files - - Source Files - Source Files From bad99afb013e852199d1daa52733a23b34cb2f63 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Fri, 13 Jan 2017 09:49:09 +0100 Subject: [PATCH 085/561] Added patch to disable building the static library when BUILD_SHARED_LIB is enabled --- .../disable-static-lib-in-shared-build.patch | 39 +++++++++++++++++++ ports/szip/portfile.cmake | 6 +++ 2 files changed, 45 insertions(+) create mode 100644 ports/szip/disable-static-lib-in-shared-build.patch diff --git a/ports/szip/disable-static-lib-in-shared-build.patch b/ports/szip/disable-static-lib-in-shared-build.patch new file mode 100644 index 0000000000..f06e6dcf63 --- /dev/null +++ b/ports/szip/disable-static-lib-in-shared-build.patch @@ -0,0 +1,39 @@ +--- a/src/CMakeLists.txt Mon Aug 03 17:10:33 2015 ++++ b/src/CMakeLists.txt Fri Jan 13 09:38:07 2017 +@@ -22,20 +22,22 @@ + ${SZIP_SRC_SOURCE_DIR}/szlib.h + ) + +-add_library (${SZIP_LIB_TARGET} STATIC ${SZIP_SRCS} ${SZIP_PUBLIC_HEADERS}) +-#set_target_properties (${SZIP_LIB_TARGET} +-# PROPERTIES +-# LINK_FLAGS "-version-info 2:0:0" +-#) +-TARGET_C_PROPERTIES (${SZIP_LIB_TARGET} STATIC " " " ") +-target_link_libraries (${SZIP_LIB_TARGET} ${LINK_LIBS}) +-set_target_properties(${SZIP_LIB_TARGET} PROPERTIES +- PUBLIC_HEADER "${SZIP_PUBLIC_HEADERS}" +- INTERFACE_INCLUDE_DIRECTORIES "$/include>" +-) +-set_global_variable (SZIP_LIBRARIES_TO_EXPORT ${SZIP_LIB_TARGET}) +-SZIP_SET_LIB_OPTIONS (${SZIP_LIB_TARGET} ${SZIP_LIB_NAME} STATIC) +-set (install_targets ${SZIP_LIB_TARGET}) ++if (NOT BUILD_SHARED_LIBS) ++ add_library (${SZIP_LIB_TARGET} STATIC ${SZIP_SRCS} ${SZIP_PUBLIC_HEADERS}) ++ #set_target_properties (${SZIP_LIB_TARGET} ++ # PROPERTIES ++ # LINK_FLAGS "-version-info 2:0:0" ++ #) ++ TARGET_C_PROPERTIES (${SZIP_LIB_TARGET} STATIC " " " ") ++ target_link_libraries (${SZIP_LIB_TARGET} ${LINK_LIBS}) ++ set_target_properties(${SZIP_LIB_TARGET} PROPERTIES ++ PUBLIC_HEADER "${SZIP_PUBLIC_HEADERS}" ++ INTERFACE_INCLUDE_DIRECTORIES "$/include>" ++ ) ++ set_global_variable (SZIP_LIBRARIES_TO_EXPORT ${SZIP_LIB_TARGET}) ++ SZIP_SET_LIB_OPTIONS (${SZIP_LIB_TARGET} ${SZIP_LIB_NAME} STATIC) ++ set (install_targets ${SZIP_LIB_TARGET}) ++endif() + + if (BUILD_SHARED_LIBS) + add_library (${SZIP_LIBSH_TARGET} SHARED ${SZIP_SRCS} ${SZIP_PUBLIC_HEADERS}) diff --git a/ports/szip/portfile.cmake b/ports/szip/portfile.cmake index 9204771c7c..06040cedc3 100644 --- a/ports/szip/portfile.cmake +++ b/ports/szip/portfile.cmake @@ -21,6 +21,12 @@ set(ARCHIVE ${SOURCE_PATH}/SZip.tar.gz) vcpkg_extract_source_archive(${ARCHIVE}) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/Szip) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/disable-static-lib-in-shared-build.patch +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS From fe2c0a3a78f4904288ce958ded767160d1de260c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 13 Jan 2017 02:09:08 -0800 Subject: [PATCH 086/561] [edit command] Now checks that port exists before opening --- toolsrc/src/commands_edit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index a4981cf80f..3297b52956 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -11,6 +11,7 @@ namespace vcpkg::Commands::Edit const std::string port_name = args.command_arguments.at(0); const fs::path portpath = paths.ports / port_name; + Checks::check_exit(fs::is_directory(portpath), "Could not find port named %s", port_name); // Find editor std::wstring env_EDITOR = System::wdupenv_str(L"EDITOR"); From e11e62e8f38783efd5be55e890b78f7c47dc3c94 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 13 Jan 2017 02:21:16 -0800 Subject: [PATCH 087/561] Identation consistency --- ports/directxmesh/portfile.cmake | 22 +++++++++++----------- ports/directxtex/portfile.cmake | 30 +++++++++++++++--------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ports/directxmesh/portfile.cmake b/ports/directxmesh/portfile.cmake index 925111ca10..184784d485 100644 --- a/ports/directxmesh/portfile.cmake +++ b/ports/directxmesh/portfile.cmake @@ -20,32 +20,32 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") - SET(BUILD_ARCH "Win32") + SET(BUILD_ARCH "Win32") ELSE() - SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) ENDIF() vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/DirectXMesh_Desktop_2015.sln - PLATFORM ${BUILD_ARCH} + PLATFORM ${BUILD_ARCH} ) file(INSTALL - ${SOURCE_PATH}/DirectXMesh/DirectXMesh.h - ${SOURCE_PATH}/DirectXMesh/DirectXMesh.inl + ${SOURCE_PATH}/DirectXMesh/DirectXMesh.h + ${SOURCE_PATH}/DirectXMesh/DirectXMesh.inl DESTINATION ${CURRENT_PACKAGES_DIR}/include ) file(INSTALL - ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXMesh.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXMesh.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) file(INSTALL - ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXMesh.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + ${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXMesh.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) set(TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools) file(INSTALL - ${SOURCE_PATH}/Meshconvert/Bin/Desktop_2015/${BUILD_ARCH}/Release/Meshconvert.exe - DESTINATION ${TOOL_PATH}) + ${SOURCE_PATH}/Meshconvert/Bin/Desktop_2015/${BUILD_ARCH}/Release/Meshconvert.exe + DESTINATION ${TOOL_PATH}) # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/directxmesh) diff --git a/ports/directxtex/portfile.cmake b/ports/directxtex/portfile.cmake index befee008c9..70bb166584 100644 --- a/ports/directxtex/portfile.cmake +++ b/ports/directxtex/portfile.cmake @@ -20,39 +20,39 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") - SET(BUILD_ARCH "Win32") + SET(BUILD_ARCH "Win32") ELSE() - SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) ENDIF() vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/DirectXTex_Desktop_2015.sln - PLATFORM ${BUILD_ARCH} + PLATFORM ${BUILD_ARCH} ) file(INSTALL - ${SOURCE_PATH}/DirectXTex/DirectXTex.h - ${SOURCE_PATH}/DirectXTex/DirectXTex.inl + ${SOURCE_PATH}/DirectXTex/DirectXTex.h + ${SOURCE_PATH}/DirectXTex/DirectXTex.inl DESTINATION ${CURRENT_PACKAGES_DIR}/include ) file(INSTALL - ${SOURCE_PATH}/DirectXTex/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXTex.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + ${SOURCE_PATH}/DirectXTex/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXTex.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) file(INSTALL - ${SOURCE_PATH}/DirectXTex/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXTex.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + ${SOURCE_PATH}/DirectXTex/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXTex.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) set(TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools) file(MAKE_DIRECTORY ${TOOL_PATH}) file(INSTALL - ${SOURCE_PATH}/Texdiag/Bin/Desktop_2015/${BUILD_ARCH}/Release/texdiag.exe - DESTINATION ${TOOL_PATH}) + ${SOURCE_PATH}/Texdiag/Bin/Desktop_2015/${BUILD_ARCH}/Release/texdiag.exe + DESTINATION ${TOOL_PATH}) file(INSTALL - ${SOURCE_PATH}/Texconv/Bin/Desktop_2015/${BUILD_ARCH}/Release/Texconv.exe - DESTINATION ${TOOL_PATH}) + ${SOURCE_PATH}/Texconv/Bin/Desktop_2015/${BUILD_ARCH}/Release/Texconv.exe + DESTINATION ${TOOL_PATH}) file(INSTALL - ${SOURCE_PATH}/Texassemble/Bin/Desktop_2015/${BUILD_ARCH}/Release/Texassemble.exe - DESTINATION ${TOOL_PATH}) + ${SOURCE_PATH}/Texassemble/Bin/Desktop_2015/${BUILD_ARCH}/Release/Texassemble.exe + DESTINATION ${TOOL_PATH}) # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/DirectXTex) From f7d192c20697eba44aac11c6992efe61698c534b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 15:07:30 -0800 Subject: [PATCH 088/561] [openssl] Bump version to correspond with source change for uwp support --- ports/openssl/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/openssl/CONTROL b/ports/openssl/CONTROL index cb7bc74932..ca4aae2e65 100644 --- a/ports/openssl/CONTROL +++ b/ports/openssl/CONTROL @@ -1,3 +1,3 @@ Source: openssl -Version: 1.0.2j-1 +Version: 1.0.2j-2 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. \ No newline at end of file From 278e6b9ad1443673ef47a104cb5aa73ff4350866 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 15:38:14 -0800 Subject: [PATCH 089/561] [curl] Bump version to correspond with source code change for uwp support. --- ports/curl/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/curl/CONTROL b/ports/curl/CONTROL index e18ea2f67e..9ae7e7e52a 100644 --- a/ports/curl/CONTROL +++ b/ports/curl/CONTROL @@ -1,4 +1,4 @@ Source: curl -Version: 7.51.0-2 +Version: 7.51.0-3 Build-Depends: zlib, openssl, libssh2 Description: A library for transferring data with URLs From bf47d0d386d5490936917ab5bf37d801f6681cc1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 16:01:52 -0800 Subject: [PATCH 090/561] [http-parser] Bump version to reflect build change adding HTTP_PARSER_STRICT=0 --- ports/http-parser/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/http-parser/CONTROL b/ports/http-parser/CONTROL index 41d234d26c..605f3354cd 100644 --- a/ports/http-parser/CONTROL +++ b/ports/http-parser/CONTROL @@ -1,3 +1,3 @@ Source: http-parser -Version: 2.7.1 +Version: 2.7.1-1 Description: HTTP Parser. \ No newline at end of file From b415c1377976884d7ed9ac6f54630f4ec7921918 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 16:06:30 -0800 Subject: [PATCH 091/561] [libwebsockets] Bump version to correspond to source code change for uwp support. --- ports/libwebsockets/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libwebsockets/CONTROL b/ports/libwebsockets/CONTROL index 866c0ccbc1..61a9cc4492 100644 --- a/ports/libwebsockets/CONTROL +++ b/ports/libwebsockets/CONTROL @@ -1,4 +1,4 @@ Source: libwebsockets -Version: 2.0.0 +Version: 2.0.0-1 Build-Depends: zlib, openssl Description: Libwebsockets is a lightweight pure C library built to use minimal CPU and memory resources, and provide fast throughput in both directions as client or server. \ No newline at end of file From ccd3e399f023129a39bb9a402324676a9391a970 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 14 Jan 2017 02:15:34 +0100 Subject: [PATCH 092/561] [glib] use win_iconv and add subdir for tools --- ports/glib/CMakeLists.txt | 4 ++-- ports/glib/portfile.cmake | 7 +------ ports/glib/use-libiconv-on-windows.patch | 14 -------------- scripts/cmake/vcpkg_copy_tool_dependencies.cmake | 6 +++--- 4 files changed, 6 insertions(+), 25 deletions(-) delete mode 100644 ports/glib/use-libiconv-on-windows.patch diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt index 79d460bab0..1cf65d0a72 100644 --- a/ports/glib/CMakeLists.txt +++ b/ports/glib/CMakeLists.txt @@ -123,7 +123,7 @@ endmacro() if(NOT GLIB_SKIP_TOOLS) configure_file(gobject/glib-mkenums.in ${CMAKE_SOURCE_DIR}/gobject/glib-mkenums @ONLY) # uses GLIB_VERSION - install(FILES gobject/glib-mkenums DESTINATION tools) + install(FILES gobject/glib-mkenums DESTINATION tools/glib) add_gio_tool(gdbus gio/gdbus-tool.c) add_gio_tool(gio-querymodules gio/gio-querymodules.c) @@ -145,7 +145,7 @@ if(NOT GLIB_SKIP_TOOLS) add_glib_tool(gspawn-${WIN}-helper WIN32 glib/gspawn-win32-helper.c) add_glib_tool(gspawn-${WIN}-helper-console glib/gspawn-win32-helper-console.c) - install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools) + install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools/glib) endif() install(TARGETS ${GLIB_TARGETS} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake index d1777de1d3..b438b2e617 100644 --- a/ports/glib/portfile.cmake +++ b/ports/glib/portfile.cmake @@ -17,15 +17,10 @@ vcpkg_download_distfile(ARCHIVE SHA512 63d7b5ece8d7d15b10e06ef10a8e0a4446f30a8d9c97daa3352ec00dfef622728bd42ed24cbf67e553166a0f9e29a3e3d024d1d085b9804fd67608db438b6771) vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/use-libiconv-on-windows.patch) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH}) file(REMOVE_RECURSE ${SOURCE_PATH}/glib/pcre) -file(REMOVE ${SOURCE_PATH}/glib/win_iconv.c) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -35,7 +30,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_copy_tool_dependencies() +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/glib) file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glib) file(RENAME ${CURRENT_PACKAGES_DIR}/share/glib/COPYING ${CURRENT_PACKAGES_DIR}/share/glib/copyright) diff --git a/ports/glib/use-libiconv-on-windows.patch b/ports/glib/use-libiconv-on-windows.patch deleted file mode 100644 index 927de0bb1d..0000000000 --- a/ports/glib/use-libiconv-on-windows.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/glib/gconvert.c b/glib/gconvert.c -index 3deac78..134ded9 100644 ---- a/glib/gconvert.c -+++ b/glib/gconvert.c -@@ -30,7 +30,8 @@ - #include - - #ifdef G_OS_WIN32 --#include "win_iconv.c" -+#define USE_LIBICONV_GNU -+#include - #endif - - #ifdef G_PLATFORM_WIN32 diff --git a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake index d8de15207a..32c3eba0da 100644 --- a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake +++ b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake @@ -1,8 +1,8 @@ -# Copy dlls for all tools in ${CURRENT_PACKAGES_DIR}/tools +# Copy dlls for all tools in TOOL_DIR -function(vcpkg_copy_tool_dependencies) +function(vcpkg_copy_tool_dependencies TOOL_DIR) macro(search_for_dependencies PATH_TO_SEARCH) - file(GLOB TOOLS ${CURRENT_PACKAGES_DIR}/tools/*.exe ${CURRENT_PACKAGES_DIR}/tools/*.dll) + file(GLOB TOOLS ${TOOL_DIR}/*.exe ${TOOL_DIR}/*.dll) foreach(TOOL ${TOOLS}) execute_process(COMMAND powershell -noprofile -executionpolicy UnRestricted -nologo -file ${VCPKG_ROOT_DIR}/scripts/buildsystems/msbuild/applocal.ps1 From 6a3b19b9e04d304ef9e07a9d99d3abbd17552993 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 14 Jan 2017 02:20:44 +0100 Subject: [PATCH 093/561] [glib] hunt down every mention of libiconv --- ports/glib/CMakeLists.txt | 8 ++------ ports/glib/CONTROL | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt index 1cf65d0a72..d0358a9905 100644 --- a/ports/glib/CMakeLists.txt +++ b/ports/glib/CMakeLists.txt @@ -25,9 +25,6 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug) set(PCRE_SUFFIX d) endif() find_library(PCRE_LIBRARY pcre${PCRE_SUFFIX}) -# libiconv -find_path(ICONV_INCLUDE_DIR iconv.h) -find_library(ICONV_LIBRARY NAMES iconv libiconv) # libffi find_path(FFI_INCLUDE_DIR ffi.h) find_library(FFI_LIBRARY NAMES ffi libffi) @@ -65,8 +62,8 @@ extract_vcproj_sources(build/win32/vs14/glib.vcxproj GLIB_SOURCES) list(APPEND GLIB_SOURCES glib/libcharset/localcharset.c) # modified internal version with prefixed symbols add_library(glib ${GLIB_SOURCES}) target_compile_definitions(glib PRIVATE USE_SYSTEM_PCRE ${GLIB_EXPORT_MACRO} GLIB_COMPILATION G_LOG_DOMAIN="GLib" LIBDIR) -target_link_libraries(glib ws2_32 winmm ${PCRE_LIBRARY} ${ICONV_LIBRARY} ${LIBINTL_LIBRARY}) -target_include_directories(glib PRIVATE ${PCRE_INCLUDE_DIR} ${ICONV_INCLUDE_DIR}) +target_link_libraries(glib ws2_32 winmm ${PCRE_LIBRARY} ${LIBINTL_LIBRARY}) +target_include_directories(glib PRIVATE ${PCRE_INCLUDE_DIR}) target_include_directories(glib PUBLIC ${LIBINTL_INCLUDE_DIR}) list(APPEND GLIB_TARGETS glib) @@ -156,6 +153,5 @@ endif() message(STATUS "Link-time dependencies:") message(STATUS " " ${ZLIB_LIBRARIES}) message(STATUS " " ${PCRE_LIBRARY}) -message(STATUS " " ${ICONV_LIBRARY}) message(STATUS " " ${FFI_LIBRARY}) message(STATUS " " ${LIBINTL_LIBRARY}) diff --git a/ports/glib/CONTROL b/ports/glib/CONTROL index 984d7576a6..219abc6242 100644 --- a/ports/glib/CONTROL +++ b/ports/glib/CONTROL @@ -1,4 +1,4 @@ Source: glib Version: 2.50.2 Description: Portable, general-purpose utility library. -Build-Depends: zlib, pcre, libffi, gettext, libiconv +Build-Depends: zlib, pcre, libffi, gettext From 2bc4064b1e99b31bd550982011e251f97d5a0aef Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 13 Jan 2017 17:30:48 -0800 Subject: [PATCH 094/561] [vcpkg_build_cmake] Add option to specify the 64-bit toolset --- scripts/cmake/vcpkg_build_cmake.cmake | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 8ba4b9faea..eb50222ba4 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -1,7 +1,16 @@ function(vcpkg_build_cmake) + cmake_parse_arguments(_bc "MSVC_64_TOOLSET" "" "" ${ARGN}) + + set(MSVC_EXTRA_ARGS) + + # Specifies the architecture of the toolset, NOT the architecture of the produced binary + if (_bc_MSVC_64_TOOLSET) + list(APPEND MSVC_EXTRA_ARGS "/p:PreferredToolArchitecture=x64") + endif() + message(STATUS "Build ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true /m + COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true /m ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel ) @@ -9,7 +18,7 @@ function(vcpkg_build_cmake) message(STATUS "Build ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug -- /p:VCPkgLocalAppDataDisabled=true /m + COMMAND ${CMAKE_COMMAND} --build . --config Debug -- /p:VCPkgLocalAppDataDisabled=true /m ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg ) From da09df713fe7b68d432108802447eb534a7dd555 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 17:39:12 -0800 Subject: [PATCH 095/561] [vcpkg integration] Explicitly skip empty entries instead of recursing. Fixes #460. --- scripts/buildsystems/msbuild/applocal.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index ddb4a07f95..46981fad5b 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -7,6 +7,9 @@ function resolve($targetBinary) { $a = $(dumpbin /DEPENDENTS $targetBinary | ? { $_ -match "^ [^ ].*\.dll" } | % { $_ -replace "^ ","" }) $a | % { + if ([string]::IsNullOrEmpty($_)) { + continue + } if (Test-Path "$installedDir\$_") { if (Test-Path "$targetBinaryDir\$_") { Write-Verbose "$_ is already present" From c5636c4692f1e4f257bf5e6fbcf89a93d4cd60a0 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 13 Jan 2017 17:54:13 -0800 Subject: [PATCH 096/561] [glew] Avoid renaming DLLs, because LIBs reference them by name. Prefer using vcpkg_copy_pdbs(). --- ports/glew/CONTROL | 2 +- ports/glew/portfile.cmake | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/ports/glew/CONTROL b/ports/glew/CONTROL index 13eb3262e3..21051a4754 100644 --- a/ports/glew/CONTROL +++ b/ports/glew/CONTROL @@ -1,3 +1,3 @@ Source: glew -Version: 2.0.0 +Version: 2.0.0-1 Description: The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library. \ No newline at end of file diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index 6392633be7..c975ca099e 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -57,15 +57,10 @@ message(STATUS "Installing") if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL ${SOURCE_PATH}/bin/Debug/${BUILD_ARCH}/glew32d.dll - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin RENAME glew32.dll - ) - file(INSTALL - ${SOURCE_PATH}/bin/Debug/${BUILD_ARCH}/glew32d.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin RENAME glew32.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin ) file(INSTALL ${SOURCE_PATH}/bin/Release/${BUILD_ARCH}/glew32.dll - ${SOURCE_PATH}/bin/Release/${BUILD_ARCH}/glew32.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/bin ) file(INSTALL From 74784355e56df89b5deaf886a546289fcd5eabf9 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 14 Jan 2017 02:55:04 +0100 Subject: [PATCH 097/561] [grpc] build statically and preserve debug libs --- ports/grpc/CONTROL | 2 +- ports/grpc/portfile.cmake | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ports/grpc/CONTROL b/ports/grpc/CONTROL index ece5b96ce4..b9d19da4c0 100644 --- a/ports/grpc/CONTROL +++ b/ports/grpc/CONTROL @@ -1,4 +1,4 @@ Source: grpc -Version: 1.1.0-dev-1674f65 +Version: 1.1.0-dev-1674f65-1 Build-Depends: zlib, openssl, protobuf Description: An RPC library and framework \ No newline at end of file diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index a54af6e556..ffd71d1375 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -1,6 +1,6 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) +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) find_program(GIT git) @@ -55,7 +55,9 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/gRPC/gRPCTargets-debug.cmake file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) vcpkg_copy_pdbs() From 5e1c18cd56db66c0a1f4f2816bc7938d47c1376d Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 14 Jan 2017 02:55:32 +0100 Subject: [PATCH 098/561] Revert "[glib] hunt down every mention of libiconv" This reverts commit 6a3b19b9e04d304ef9e07a9d99d3abbd17552993. --- ports/glib/CMakeLists.txt | 8 ++++++-- ports/glib/CONTROL | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt index d0358a9905..1cf65d0a72 100644 --- a/ports/glib/CMakeLists.txt +++ b/ports/glib/CMakeLists.txt @@ -25,6 +25,9 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug) set(PCRE_SUFFIX d) endif() find_library(PCRE_LIBRARY pcre${PCRE_SUFFIX}) +# libiconv +find_path(ICONV_INCLUDE_DIR iconv.h) +find_library(ICONV_LIBRARY NAMES iconv libiconv) # libffi find_path(FFI_INCLUDE_DIR ffi.h) find_library(FFI_LIBRARY NAMES ffi libffi) @@ -62,8 +65,8 @@ extract_vcproj_sources(build/win32/vs14/glib.vcxproj GLIB_SOURCES) list(APPEND GLIB_SOURCES glib/libcharset/localcharset.c) # modified internal version with prefixed symbols add_library(glib ${GLIB_SOURCES}) target_compile_definitions(glib PRIVATE USE_SYSTEM_PCRE ${GLIB_EXPORT_MACRO} GLIB_COMPILATION G_LOG_DOMAIN="GLib" LIBDIR) -target_link_libraries(glib ws2_32 winmm ${PCRE_LIBRARY} ${LIBINTL_LIBRARY}) -target_include_directories(glib PRIVATE ${PCRE_INCLUDE_DIR}) +target_link_libraries(glib ws2_32 winmm ${PCRE_LIBRARY} ${ICONV_LIBRARY} ${LIBINTL_LIBRARY}) +target_include_directories(glib PRIVATE ${PCRE_INCLUDE_DIR} ${ICONV_INCLUDE_DIR}) target_include_directories(glib PUBLIC ${LIBINTL_INCLUDE_DIR}) list(APPEND GLIB_TARGETS glib) @@ -153,5 +156,6 @@ endif() message(STATUS "Link-time dependencies:") message(STATUS " " ${ZLIB_LIBRARIES}) message(STATUS " " ${PCRE_LIBRARY}) +message(STATUS " " ${ICONV_LIBRARY}) message(STATUS " " ${FFI_LIBRARY}) message(STATUS " " ${LIBINTL_LIBRARY}) diff --git a/ports/glib/CONTROL b/ports/glib/CONTROL index 219abc6242..984d7576a6 100644 --- a/ports/glib/CONTROL +++ b/ports/glib/CONTROL @@ -1,4 +1,4 @@ Source: glib Version: 2.50.2 Description: Portable, general-purpose utility library. -Build-Depends: zlib, pcre, libffi, gettext +Build-Depends: zlib, pcre, libffi, gettext, libiconv From eb7ccc1223f568d6d2df21b27eb890be93bc8186 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 14 Jan 2017 02:55:41 +0100 Subject: [PATCH 099/561] Revert "[glib] use win_iconv and add subdir for tools" This reverts commit ccd3e399f023129a39bb9a402324676a9391a970. --- ports/glib/CMakeLists.txt | 4 ++-- ports/glib/portfile.cmake | 7 ++++++- ports/glib/use-libiconv-on-windows.patch | 14 ++++++++++++++ scripts/cmake/vcpkg_copy_tool_dependencies.cmake | 6 +++--- 4 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 ports/glib/use-libiconv-on-windows.patch diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt index 1cf65d0a72..79d460bab0 100644 --- a/ports/glib/CMakeLists.txt +++ b/ports/glib/CMakeLists.txt @@ -123,7 +123,7 @@ endmacro() if(NOT GLIB_SKIP_TOOLS) configure_file(gobject/glib-mkenums.in ${CMAKE_SOURCE_DIR}/gobject/glib-mkenums @ONLY) # uses GLIB_VERSION - install(FILES gobject/glib-mkenums DESTINATION tools/glib) + install(FILES gobject/glib-mkenums DESTINATION tools) add_gio_tool(gdbus gio/gdbus-tool.c) add_gio_tool(gio-querymodules gio/gio-querymodules.c) @@ -145,7 +145,7 @@ if(NOT GLIB_SKIP_TOOLS) add_glib_tool(gspawn-${WIN}-helper WIN32 glib/gspawn-win32-helper.c) add_glib_tool(gspawn-${WIN}-helper-console glib/gspawn-win32-helper-console.c) - install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools/glib) + install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools) endif() install(TARGETS ${GLIB_TARGETS} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake index b438b2e617..d1777de1d3 100644 --- a/ports/glib/portfile.cmake +++ b/ports/glib/portfile.cmake @@ -17,10 +17,15 @@ vcpkg_download_distfile(ARCHIVE SHA512 63d7b5ece8d7d15b10e06ef10a8e0a4446f30a8d9c97daa3352ec00dfef622728bd42ed24cbf67e553166a0f9e29a3e3d024d1d085b9804fd67608db438b6771) vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/use-libiconv-on-windows.patch) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH}) file(REMOVE_RECURSE ${SOURCE_PATH}/glib/pcre) +file(REMOVE ${SOURCE_PATH}/glib/win_iconv.c) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -30,7 +35,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/glib) +vcpkg_copy_tool_dependencies() file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glib) file(RENAME ${CURRENT_PACKAGES_DIR}/share/glib/COPYING ${CURRENT_PACKAGES_DIR}/share/glib/copyright) diff --git a/ports/glib/use-libiconv-on-windows.patch b/ports/glib/use-libiconv-on-windows.patch new file mode 100644 index 0000000000..927de0bb1d --- /dev/null +++ b/ports/glib/use-libiconv-on-windows.patch @@ -0,0 +1,14 @@ +diff --git a/glib/gconvert.c b/glib/gconvert.c +index 3deac78..134ded9 100644 +--- a/glib/gconvert.c ++++ b/glib/gconvert.c +@@ -30,7 +30,8 @@ + #include + + #ifdef G_OS_WIN32 +-#include "win_iconv.c" ++#define USE_LIBICONV_GNU ++#include + #endif + + #ifdef G_PLATFORM_WIN32 diff --git a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake index 32c3eba0da..d8de15207a 100644 --- a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake +++ b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake @@ -1,8 +1,8 @@ -# Copy dlls for all tools in TOOL_DIR +# Copy dlls for all tools in ${CURRENT_PACKAGES_DIR}/tools -function(vcpkg_copy_tool_dependencies TOOL_DIR) +function(vcpkg_copy_tool_dependencies) macro(search_for_dependencies PATH_TO_SEARCH) - file(GLOB TOOLS ${TOOL_DIR}/*.exe ${TOOL_DIR}/*.dll) + file(GLOB TOOLS ${CURRENT_PACKAGES_DIR}/tools/*.exe ${CURRENT_PACKAGES_DIR}/tools/*.dll) foreach(TOOL ${TOOLS}) execute_process(COMMAND powershell -noprofile -executionpolicy UnRestricted -nologo -file ${VCPKG_ROOT_DIR}/scripts/buildsystems/msbuild/applocal.ps1 From f5a0a64e44b885fae8d17b811ee3d3f623ffac3e Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 14 Jan 2017 02:59:41 +0100 Subject: [PATCH 100/561] [glib] tooools --- ports/glib/CMakeLists.txt | 4 ++-- ports/glib/portfile.cmake | 2 +- scripts/cmake/vcpkg_copy_tool_dependencies.cmake | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt index 79d460bab0..1cf65d0a72 100644 --- a/ports/glib/CMakeLists.txt +++ b/ports/glib/CMakeLists.txt @@ -123,7 +123,7 @@ endmacro() if(NOT GLIB_SKIP_TOOLS) configure_file(gobject/glib-mkenums.in ${CMAKE_SOURCE_DIR}/gobject/glib-mkenums @ONLY) # uses GLIB_VERSION - install(FILES gobject/glib-mkenums DESTINATION tools) + install(FILES gobject/glib-mkenums DESTINATION tools/glib) add_gio_tool(gdbus gio/gdbus-tool.c) add_gio_tool(gio-querymodules gio/gio-querymodules.c) @@ -145,7 +145,7 @@ if(NOT GLIB_SKIP_TOOLS) add_glib_tool(gspawn-${WIN}-helper WIN32 glib/gspawn-win32-helper.c) add_glib_tool(gspawn-${WIN}-helper-console glib/gspawn-win32-helper-console.c) - install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools) + install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools/glib) endif() install(TARGETS ${GLIB_TARGETS} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) diff --git a/ports/glib/portfile.cmake b/ports/glib/portfile.cmake index d1777de1d3..71f1f366cb 100644 --- a/ports/glib/portfile.cmake +++ b/ports/glib/portfile.cmake @@ -35,7 +35,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_copy_tool_dependencies() +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/glib) file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glib) file(RENAME ${CURRENT_PACKAGES_DIR}/share/glib/COPYING ${CURRENT_PACKAGES_DIR}/share/glib/copyright) diff --git a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake index d8de15207a..432e3c12a3 100644 --- a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake +++ b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake @@ -1,8 +1,8 @@ -# Copy dlls for all tools in ${CURRENT_PACKAGES_DIR}/tools +# Copy dlls for all tools in TOOL_DIR -function(vcpkg_copy_tool_dependencies) +function(vcpkg_copy_tool_dependencies TOOL_DIR) macro(search_for_dependencies PATH_TO_SEARCH) - file(GLOB TOOLS ${CURRENT_PACKAGES_DIR}/tools/*.exe ${CURRENT_PACKAGES_DIR}/tools/*.dll) + file(GLOB TOOLS ${TOOL_DIR}/*.exe ${TOOL_DIR}/*.dll) foreach(TOOL ${TOOLS}) execute_process(COMMAND powershell -noprofile -executionpolicy UnRestricted -nologo -file ${VCPKG_ROOT_DIR}/scripts/buildsystems/msbuild/applocal.ps1 From bae23861132c5e746f7450a12fedd5f2b0e6b67c Mon Sep 17 00:00:00 2001 From: sdcb Date: Sat, 14 Jan 2017 11:09:21 +0800 Subject: [PATCH 101/561] fix UVAtlas build, I dropped the uvatlas tool. --- ports/uvatlas/CONTROL | 3 +- ports/uvatlas/portfile.cmake | 54 +++++++++++++++++------------------- 2 files changed, 26 insertions(+), 31 deletions(-) diff --git a/ports/uvatlas/CONTROL b/ports/uvatlas/CONTROL index 0e842d8fb1..7fad35659f 100644 --- a/ports/uvatlas/CONTROL +++ b/ports/uvatlas/CONTROL @@ -1,4 +1,3 @@ Source: uvatlas Version: sept2016 -Description: UVAtlas isochart texture atlas -Build-Depends: directxtex, directxmesh \ No newline at end of file +Description: UVAtlas isochart texture atlas \ No newline at end of file diff --git a/ports/uvatlas/portfile.cmake b/ports/uvatlas/portfile.cmake index 9f4bc53085..7777429966 100644 --- a/ports/uvatlas/portfile.cmake +++ b/ports/uvatlas/portfile.cmake @@ -6,9 +6,9 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - message(STATUS "Warning: Dynamic building not supported yet. Building static.") - set(VCPKG_LIBRARY_LINKAGE static) +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) @@ -20,37 +20,33 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") - SET(BUILD_ARCH "Win32") -ELSE() - SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) -ENDIF() - -vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/UVAtlas/UVAtlas_2015.sln - PLATFORM ${BUILD_ARCH} -) -vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/UVAtlasTool/UVAtlasTool_2015.sln - PLATFORM ${BUILD_ARCH} +IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") + SET(BUILD_ARCH "Win32") +ELSE() + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +ENDIF() + +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/UVAtlas/UVAtlas_2015.sln + PLATFORM ${BUILD_ARCH} ) -file(INSTALL - ${SOURCE_PATH}/Inc/ +file(INSTALL + ${SOURCE_PATH}/UVAtlas/Inc/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(INSTALL - ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Release/UVAtlas.lib +file(INSTALL + ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Release/UVAtlas.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(INSTALL - ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib +file(INSTALL + ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(INSTALL - ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib +file(INSTALL + ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(INSTALL - ${SOURCE_PATH}/UVAtlasTool/Bin/Desktop_2015/${BUILD_ARCH}/Release/UVAtlasTool.exe - DESTINATION ${CURRENT_PACKAGES_DIR}/tools) # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/uvatlas) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/uvatlas/LICENSE ${CURRENT_PACKAGES_DIR}/share/uvatlas/copyright) +file(COPY ${SOURCE_PATH}/MIT.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/uvatlas) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/uvatlas/MIT.txt ${CURRENT_PACKAGES_DIR}/share/uvatlas/copyright) + +message(STATUS "Installing done, uvatlastool.exe can be downloaded at: ") +message(STATUS " https://github.com/Microsoft/UVAtlas/releases/download/sept2016/uvatlastool.exe") \ No newline at end of file From fd0adc561dd93c2cdf0762eeefa0438537a6760a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 13 Jan 2017 19:09:42 -0800 Subject: [PATCH 102/561] [vcpkg_build/install_cmake] Add option to disable parallel building --- scripts/cmake/vcpkg_build_cmake.cmake | 10 +++++++--- scripts/cmake/vcpkg_install_cmake.cmake | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index eb50222ba4..6d7cfe6434 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -1,5 +1,5 @@ function(vcpkg_build_cmake) - cmake_parse_arguments(_bc "MSVC_64_TOOLSET" "" "" ${ARGN}) + cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) set(MSVC_EXTRA_ARGS) @@ -8,9 +8,13 @@ function(vcpkg_build_cmake) list(APPEND MSVC_EXTRA_ARGS "/p:PreferredToolArchitecture=x64") endif() + if (NOT _bc_DISABLE_PARALLEL) + list(APPEND MSVC_EXTRA_ARGS "/m") + endif() + message(STATUS "Build ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true /m ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel ) @@ -18,7 +22,7 @@ function(vcpkg_build_cmake) message(STATUS "Build ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug -- /p:VCPkgLocalAppDataDisabled=true /m ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Debug -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/cmake/vcpkg_install_cmake.cmake b/scripts/cmake/vcpkg_install_cmake.cmake index 30aff0fe1d..f29f3ce5db 100644 --- a/scripts/cmake/vcpkg_install_cmake.cmake +++ b/scripts/cmake/vcpkg_install_cmake.cmake @@ -1,7 +1,20 @@ function(vcpkg_install_cmake) + cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) + + set(MSVC_EXTRA_ARGS) + + # Specifies the architecture of the toolset, NOT the architecture of the produced binary + if (_bc_MSVC_64_TOOLSET) + list(APPEND MSVC_EXTRA_ARGS "/p:PreferredToolArchitecture=x64") + endif() + + if (NOT _bc_DISABLE_PARALLEL) + list(APPEND MSVC_EXTRA_ARGS "/m") + endif() + message(STATUS "Package ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release --target install -- /m + COMMAND ${CMAKE_COMMAND} --build . --config Release --target install -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME package-${TARGET_TRIPLET}-rel ) @@ -9,7 +22,7 @@ function(vcpkg_install_cmake) message(STATUS "Package ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug --target install -- /m + COMMAND ${CMAKE_COMMAND} --build . --config Debug --target install -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME package-${TARGET_TRIPLET}-dbg ) From 0600d2b842a28dcffc24aec21600b9f2df7549fc Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 14 Jan 2017 18:29:00 +0100 Subject: [PATCH 103/561] [glib] install gdbus-codegen tool It is required to build gtk+ --- ports/glib/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/glib/CMakeLists.txt b/ports/glib/CMakeLists.txt index 1cf65d0a72..341ab1a62b 100644 --- a/ports/glib/CMakeLists.txt +++ b/ports/glib/CMakeLists.txt @@ -125,6 +125,11 @@ if(NOT GLIB_SKIP_TOOLS) configure_file(gobject/glib-mkenums.in ${CMAKE_SOURCE_DIR}/gobject/glib-mkenums @ONLY) # uses GLIB_VERSION install(FILES gobject/glib-mkenums DESTINATION tools/glib) + configure_file(gio/gdbus-2.0/codegen/gdbus-codegen.in ${CMAKE_SOURCE_DIR}/gio/gdbus-2.0/codegen/gdbus-codegen COPYONLY) + install(FILES gio/gdbus-2.0/codegen/gdbus-codegen DESTINATION tools/glib) + file(GLOB CODEGEN_SOURCES gio/gdbus-2.0/codegen/*.py) + install(FILES ${CODEGEN_SOURCES} DESTINATION tools/glib/codegen) + add_gio_tool(gdbus gio/gdbus-tool.c) add_gio_tool(gio-querymodules gio/gio-querymodules.c) file(GLOB GIO_TOOL_SOURCES gio/gio-tool*.c) From b2619d58c67842e5dd23eb4fea974c35270ab9dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20W=C3=B6lk?= Date: Sat, 14 Jan 2017 23:56:34 +0100 Subject: [PATCH 104/561] Create CONTROL file --- ports/cereal/CONTROL | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 ports/cereal/CONTROL diff --git a/ports/cereal/CONTROL b/ports/cereal/CONTROL new file mode 100644 index 0000000000..3c598a735b --- /dev/null +++ b/ports/cereal/CONTROL @@ -0,0 +1,3 @@ +Source: cereal +Version: 1.2.1 +Description: a header-only C++11 serialization library (built in support for binary, XML and JSon) From 23c6f5f2a7d7a1f7a6a131c39837929d170edc23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20W=C3=B6lk?= Date: Sat, 14 Jan 2017 23:57:15 +0100 Subject: [PATCH 105/561] Create portfile.cmake for cereal --- ports/cereal/portfile.cmake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 ports/cereal/portfile.cmake diff --git a/ports/cereal/portfile.cmake b/ports/cereal/portfile.cmake new file mode 100644 index 0000000000..ccdf13fd43 --- /dev/null +++ b/ports/cereal/portfile.cmake @@ -0,0 +1,18 @@ +#header-only library +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cereal-1.2.1) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/USCiLab/cereal/archive/v1.2.1.tar.gz" + FILENAME "cereal-1.2.1.tar.gz" + SHA512 f0050f27433a4b544e7785aa94fc7b14a57eed6d542e25d3d0fda4d27cf55ea55e796be2138bf80809c96c392436513fe42764b3a456938395bf7f7177dd1c73 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cereal) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/cereal/LICENSE ${CURRENT_PACKAGES_DIR}/share/cereal/copyright) + +# Copy the cereal header files +execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory + ${SOURCE_PATH}/include/cereal/ + ${CURRENT_PACKAGES_DIR}/include/cereal) From 6d42e93c17b2ca7bf3d58be892e05afd1750b59d Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Sun, 15 Jan 2017 19:55:34 +0100 Subject: [PATCH 106/561] Use ACE 6.4.1, the latest micro release * ports/ace/portfile.cmake: --- ports/ace/portfile.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/ace/portfile.cmake b/ports/ace/portfile.cmake index 8301fb2320..7c5d0e14a8 100644 --- a/ports/ace/portfile.cmake +++ b/ports/ace/portfile.cmake @@ -5,9 +5,9 @@ endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ACE_wrappers/ace) vcpkg_download_distfile(ARCHIVE - URLS "http://download.dre.vanderbilt.edu/previous_versions/ACE-6.4.0.zip" - FILENAME "ACE-6.4.0.zip" - SHA512 3543291332b96cf06a966dedda617169e8db051cebbbc4f05cdc2c2c9e7908174f8ed67bc152bbcd57541279d3addb1138f1fc092468e856c2bb04ee6ad2b95a + URLS "http://download.dre.vanderbilt.edu/previous_versions/ACE-6.4.1.zip" + FILENAME "ACE-6.4.1.zip" + SHA512 ef914e02d5107a08bf9f60b4e9b16002cd4a7d2ec7b53fcf30d1563fd8684b963d17c54a8b7cb5efecb24ac291d8dc0002adb7c54dd190abebf35a2db0f5937c ) vcpkg_extract_source_archive(${ARCHIVE}) From 8310c5af0a37bca24429d09cbd693b041efc76c2 Mon Sep 17 00:00:00 2001 From: Scott Date: Sun, 15 Jan 2017 12:08:53 -0800 Subject: [PATCH 107/561] FLTK Port --- ports/fltk/CONTROL | 4 ++ ports/fltk/findlibsfix.patch | 51 ++++++++++++++++ ports/fltk/portfile.cmake | 112 +++++++++++++++++++++++++++++++++++ 3 files changed, 167 insertions(+) create mode 100644 ports/fltk/CONTROL create mode 100644 ports/fltk/findlibsfix.patch create mode 100644 ports/fltk/portfile.cmake diff --git a/ports/fltk/CONTROL b/ports/fltk/CONTROL new file mode 100644 index 0000000000..4f85195505 --- /dev/null +++ b/ports/fltk/CONTROL @@ -0,0 +1,4 @@ +Source: fltk +Version: 1.3.4-1 +Description: FLTK (pronounced fulltick) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL and its built-in GLUT emulation. +Build-Depends: zlib, libpng, libjpeg-turbo \ No newline at end of file diff --git a/ports/fltk/findlibsfix.patch b/ports/fltk/findlibsfix.patch new file mode 100644 index 0000000000..6c2a7158a2 --- /dev/null +++ b/ports/fltk/findlibsfix.patch @@ -0,0 +1,51 @@ +diff --git a/CMake/resources.cmake b/CMake/resources.cmake +index 37c0c08..b1f52d1 100644 +--- a/CMake/resources.cmake ++++ b/CMake/resources.cmake +@@ -26,10 +26,10 @@ find_file(HAVE_DLFCN_H dlfcn.h) + find_file(HAVE_FREETYPE_H freetype.h PATH_SUFFIXES freetype2 freetype2/freetype) + find_file(HAVE_GL_GL_H GL/gl.h) + find_file(HAVE_GL_GLU_H GL/glu.h) +-find_file(HAVE_LIBPNG_PNG_H libpng/png.h) ++#find_file(HAVE_LIBPNG_PNG_H libpng/png.h) + find_file(HAVE_LOCALE_H locale.h) + find_file(HAVE_OPENGL_GLU_H OpenGL/glu.h) +-find_file(HAVE_PNG_H png.h) ++#find_file(HAVE_PNG_H png.h) + find_file(HAVE_PTHREAD_H pthread.h) + find_file(HAVE_STDIO_H stdio.h) + find_file(HAVE_STRINGS_H strings.h) +@@ -38,6 +38,17 @@ find_file(HAVE_SYS_STDTYPES_H sys/stdtypes.h) + find_file(HAVE_X11_XREGION_H X11/Xregion.h) + find_path(HAVE_XDBE_H Xdbe.h PATH_SUFFIXES X11/extensions extensions) + ++find_package(PNG REQUIRED) ++if(PNG_FOUND) ++ set(LIB_png ${PNG_LIBRARIES}) ++ set(HAVE_PNG_H ${PNG_FOUND}) ++ ++endif() ++find_package(ZLIB REQUIRED) ++if(ZLIB_FOUND) ++ set(LIB_zlib ${ZLIB_LIBRARIES}) ++endif() ++ + if (MSVC) + message(STATUS "Note: The following three headers should all be found!") + message(STATUS "HAVE_GL_GL_H = '${HAVE_GL_GL_H}'") +@@ -92,12 +103,12 @@ find_library(LIB_freetype freetype) + find_library(LIB_GL GL) + find_library(LIB_MesaGL MesaGL) + find_library(LIB_jpeg jpeg) +-find_library(LIB_png png) +-find_library(LIB_zlib z) ++#find_library(LIB_png png) ++#find_library(LIB_zlib z) + + mark_as_advanced(LIB_CAIRO LIB_dl LIB_fontconfig LIB_freetype) + mark_as_advanced(LIB_GL LIB_MesaGL) +-mark_as_advanced(LIB_jpeg LIB_png LIB_zlib) ++mark_as_advanced(LIB_jpeg) + + ####################################################################### + # functions diff --git a/ports/fltk/portfile.cmake b/ports/fltk/portfile.cmake new file mode 100644 index 0000000000..a06b833109 --- /dev/null +++ b/ports/fltk/portfile.cmake @@ -0,0 +1,112 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/fltk-1.3.4-1) +vcpkg_download_distfile(ARCHIVE + URLS "http://fltk.org/pub/fltk/1.3.4/fltk-1.3.4-1-source.tar.gz" + FILENAME "fltk.tar.gz" + SHA512 0be1c8e6bb7a8c7ef484941a73868d5e40b90e97a8e5dc747bac2be53a350621975406ecfd4a9bcee8eeb7afd886e75bf7a6d6478fd6c56d16e54059f22f0891 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/fltk-1.3.4-1 + PATCHES "${CMAKE_CURRENT_LIST_DIR}/findlibsfix.patch" +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(BUILD_SHARED ON) +else() + set(BUILD_SHARED OFF) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DOPTION_BUILD_EXAMPLES=OFF + -DOPTION_BUILD_SHARED_LIBS=${BUILD_SHARED} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/CMAKE + ${CURRENT_PACKAGES_DIR}/debug/CMAKE + ${CURRENT_PACKAGES_DIR}/debug/include +) +file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fluid.exe) +file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fltk-config) + +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fluid.exe) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk-config) +vcpkg_copy_pdbs() + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_forms_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_forms.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_gl_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_gl.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_images_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_images.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk.dll) + + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_forms_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_forms.pdb) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_gl_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_gl.pdb) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_images_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_images.pdb) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk.pdb) + + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_formsd.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_gld.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_imagesd.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltkd.lib) + + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_forms_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_formsd.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gl_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gld.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_images_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_imagesd.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltkd.lib) + + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_forms_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk_forms.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_gl_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk_gl.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_images_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk_images.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk.dll) + + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_forms_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk_forms.pdb) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_gl_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk_gl.pdb) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_images_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk_images.pdb) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk.pdb) + + + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_forms.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_gl.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_images.lib) + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk.lib) + + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_forms_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk_forms.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_gl_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk_gl.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_images_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk_images.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk.lib) + +else() + file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/bin + ${CURRENT_PACKAGES_DIR}/bin + ) + + +endif() + +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_formsd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_forms.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gld.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gl.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_imagesd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_images.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltkd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk.lib) + + + +file(INSTALL + ${SOURCE_PATH}/COPYING + DESTINATION ${CURRENT_PACKAGES_DIR}/share/fltk + RENAME copyright +) From 2e7f683fde5958bc752b6ee56e436c650ca85a5d Mon Sep 17 00:00:00 2001 From: sdcb Date: Mon, 16 Jan 2017 12:24:26 +0800 Subject: [PATCH 108/561] [uvatlas] do not install the debug lib twice --- ports/uvatlas/portfile.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/ports/uvatlas/portfile.cmake b/ports/uvatlas/portfile.cmake index 7777429966..22b04326cc 100644 --- a/ports/uvatlas/portfile.cmake +++ b/ports/uvatlas/portfile.cmake @@ -40,9 +40,6 @@ file(INSTALL file(INSTALL ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(INSTALL - ${SOURCE_PATH}/UVAtlas/Bin/Desktop_2015/${BUILD_ARCH}/Debug/UVAtlas.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) # Handle copyright file(COPY ${SOURCE_PATH}/MIT.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/uvatlas) From 4ace533ad7fd7fe81e72bcb6926f2f6136137b11 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 16 Jan 2017 18:36:47 -0800 Subject: [PATCH 109/561] [protobuf] Attempt to make build more consistent --- ports/protobuf/portfile.cmake | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index fa77483815..5853c1e4ac 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -23,9 +23,21 @@ vcpkg_configure_cmake( -DCMAKE_INSTALL_CMAKEDIR=share/protobuf ) -vcpkg_install_cmake() +# Using 64-bit toolset to avoid occassional Linker Out-of-Memory issues. +vcpkg_install_cmake(MSVC_64_TOOLSET) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# It appears that at this point the build hasn't actually finished. There is probably +# a process spawned by the build, therefore we need to wait a bit. + +function(protobuf_try_remove_recurse_wait PATH_TO_REMOVE) + file(REMOVE_RECURSE ${PATH_TO_REMOVE}) + if (EXISTS "${PATH_TO_REMOVE}") + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 5) + file(REMOVE_RECURSE ${PATH_TO_REMOVE}) + endif() +endfunction() + +protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/include) file(READ ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake RELEASE_MODULE) string(REPLACE "\${_IMPORT_PREFIX}/bin/protoc.exe" "\${_IMPORT_PREFIX}/tools/protoc.exe" RELEASE_MODULE "${RELEASE_MODULE}") @@ -36,11 +48,9 @@ string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" DEBUG_MODULE "${D string(REPLACE "\${_IMPORT_PREFIX}/debug/bin/protoc.exe" "\${_IMPORT_PREFIX}/tools/protoc.exe" DEBUG_MODULE "${DEBUG_MODULE}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-debug.cmake "${DEBUG_MODULE}") -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - -file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/protoc.exe) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/protoc.exe) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/share) +protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/bin) +protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/bin) file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.0.2/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/protobuf RENAME copyright) file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.0.2-win32/bin/protoc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) From 52ca9608e0603aaba42289e0a27bf8f2d21913b3 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Tue, 17 Jan 2017 10:33:42 +0100 Subject: [PATCH 110/561] Use ACE 6.4.2 which got released January 17th 2017 * ports/ace/CONTROL: * ports/ace/portfile.cmake: --- ports/ace/CONTROL | 2 +- ports/ace/portfile.cmake | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/ace/CONTROL b/ports/ace/CONTROL index 352d2b74a3..9cc7ae1165 100644 --- a/ports/ace/CONTROL +++ b/ports/ace/CONTROL @@ -1,3 +1,3 @@ Source: ace -Version: 6.4.0 +Version: 6.4.2 Description: The ADAPTIVE Communication Environment diff --git a/ports/ace/portfile.cmake b/ports/ace/portfile.cmake index 7c5d0e14a8..a06016abdd 100644 --- a/ports/ace/portfile.cmake +++ b/ports/ace/portfile.cmake @@ -5,9 +5,9 @@ endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ACE_wrappers/ace) vcpkg_download_distfile(ARCHIVE - URLS "http://download.dre.vanderbilt.edu/previous_versions/ACE-6.4.1.zip" - FILENAME "ACE-6.4.1.zip" - SHA512 ef914e02d5107a08bf9f60b4e9b16002cd4a7d2ec7b53fcf30d1563fd8684b963d17c54a8b7cb5efecb24ac291d8dc0002adb7c54dd190abebf35a2db0f5937c + URLS "http://download.dre.vanderbilt.edu/previous_versions/ACE-6.4.2.zip" + FILENAME "ACE-6.4.2.zip" + SHA512 587872ef1fb197829a085f4449d7beb2f161a782a2a552d26324154ae85fd463092e3c2a4dd0c6d93079ae798cc43269117ea069855b0af6804b49cad0a8c2ca ) vcpkg_extract_source_archive(${ARCHIVE}) From bc874e3db23709c54e0c32c31d9d72ff263edbcb Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Mon, 16 Jan 2017 14:43:57 +0100 Subject: [PATCH 111/561] Fix Boost dynamic build. Some of the Boost libraries build differently depending on whether BOOST_X_DYN_LINK is defined, so this symbol must be present in the dynamic build, and removing it as part of disabling auto-link was wrong. Reverts half of 5a3881a0. --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 01d6e9858e..0abbac659d 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost -Version: 1.62-10 +Version: 1.62-11 Description: Peer-reviewed portable C++ source libraries Build-Depends: zlib diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 3fbd069826..0e25f34bcd 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -113,6 +113,12 @@ file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp "\n#define BOOST_ALL_NO_LIB\n" ) +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp + "\n#define BOOST_ALL_DYN_LINK\n" + ) +endif() + file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost RENAME copyright) message(STATUS "Packaging headers done") From 97a2b5a793c439a8961f1c51dca4117d1cbd1cc2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Jan 2017 14:45:20 -0800 Subject: [PATCH 112/561] [zlib] Update to 1.2.11 --- ports/zlib/CONTROL | 2 +- ports/zlib/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/zlib/CONTROL b/ports/zlib/CONTROL index b12fe9e678..def1ef6bef 100644 --- a/ports/zlib/CONTROL +++ b/ports/zlib/CONTROL @@ -1,3 +1,3 @@ Source: zlib -Version: 1.2.10 +Version: 1.2.11 Description: A compression library \ No newline at end of file diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 81d54fb4b8..26857f187b 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -1,9 +1,9 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.10) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.11) vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://www.zlib.net/zlib-1.2.10.tar.gz" - FILENAME "zlib1210.tar.gz" - SHA512 5fa71052a418a0f2b345fce28af9941bbd1c6ee276ce506ab3092157f15776ee41f96bb1799657227513b852913f96ac52dae8122a437f34b43933ee48d63ee0 + URLS "http://www.zlib.net/zlib-1.2.11.tar.gz" + FILENAME "zlib1211.tar.gz" + SHA512 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) From 0d50c6704ddc563f459b901297bbb909adaa6e51 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Jan 2017 15:34:31 -0800 Subject: [PATCH 113/561] [zlib] Add sourceforge mirror --- ports/zlib/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 26857f187b..0d53d9e89b 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zlib-1.2.11) vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://www.zlib.net/zlib-1.2.11.tar.gz" + URLS "http://www.zlib.net/zlib-1.2.11.tar.gz" "https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz" FILENAME "zlib1211.tar.gz" SHA512 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae ) From 4d9a9d44feea07998878b741daebf110bb86574a Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 18 Jan 2017 22:20:32 +0800 Subject: [PATCH 114/561] [dx] upgrade to 1.0.1 --- ports/dx/CONTROL | 2 +- ports/dx/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/dx/CONTROL b/ports/dx/CONTROL index 460e42bdb3..ac226a66af 100644 --- a/ports/dx/CONTROL +++ b/ports/dx/CONTROL @@ -1,3 +1,3 @@ Source: dx -Version: 1.0.0 +Version: 1.0.1 Description: A modern C++ library for DirectX programming \ No newline at end of file diff --git a/ports/dx/portfile.cmake b/ports/dx/portfile.cmake index 085f30c01f..d607e5ed0c 100644 --- a/ports/dx/portfile.cmake +++ b/ports/dx/portfile.cmake @@ -1,10 +1,10 @@ #header-only library include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/dx-1.0.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/dx-1.0.1) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/sdcb/dx/archive/1.0.0.tar.gz" - FILENAME "dx-1.0.0.tar.gz" - SHA512 7d0e0550eb27c3a7d3a9c4b78f29290aaf60c02a7c2fabb6e4769673592bc031f8ed430cd777e02096b9b9a8981c7e05b45448bf5c182704e080e61eaeab62f8 + URLS "https://github.com/sdcb/dx/archive/v1.0.1.tar.gz" + FILENAME "dx-1.0.1.tar.gz" + SHA512 b40eb4daf774bfdb394b207bb29652fbf44361f5d8f9b60509c7a3215cd403dbf0c10454979c0c2e97d839496ef20940070a42837375993cd67d58afacc990e0 ) vcpkg_extract_source_archive(${ARCHIVE}) From 93f400baf957c7553e31dbec44990899450562f1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 18 Jan 2017 13:47:14 -0800 Subject: [PATCH 115/561] Update CHANGELOG and bump version to v0.0.67 --- CHANGELOG.md | 34 ++++++++++++++++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c052325a95..103417bada 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,37 @@ +vcpkg (0.0.67) +-------------- + * Add ports: + - cereal 1.2.1 + - directxmesh oct2016 + - directxtex dec2016 + - metis 5.1.0 + - sdl2-image 2.0.1 + - szip 2.1 + * Update ports: + - ace 6.4.0 -> 6.4.2 + - boost 1.62-9 -> 1.62-11 + - curl 7.51.0-2 -> 7.51.0-3 + - directxtk oct2016-1 -> dec2016 + - directxtk12 oct2016 -> dec2016 + - freetype 2.6.3-3 -> 2.6.3-4 + - glew 2.0.0 -> 2.0.0-1 + - grpc 1.1.0-dev-1674f65 -> 1.1.0-dev-1674f65-1 + - http-parser 2.7.1 -> 2.7.1-1 + - libssh2 1.8.0 -> 1.8.0-1 + - libwebsockets 2.0.0 -> 2.0.0-1 + - openssl 1.0.2j-1 -> 1.0.2j-2 + - tiff 4.0.6-1 -> 4.0.6-2 + - zlib 1.2.10 -> 1.2.11 + * Add 7z to `vcpkg_find_acquire_program.cmake` + * Enhance `vcpkg_build_cmake.cmake` and `vcpkg_install_cmake.cmake`: + - Add option to disable parallel building (it is enabled by default) + - Add option to use the 64-bit toolset (for the 32-bit builds; output binaries are still 32-bit) + * Fix bug in `applocal.ps1` that would infinitely recurse when there were no depenndencies + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team WED, 18 Jan 2017 13:45:00 -0800 + + vcpkg (0.0.66) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 475a4440c7..8afb66b095 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.66" \ No newline at end of file +"0.0.67" \ No newline at end of file From ff40fcaf95a6da48d46ecffc886d6b5d724d004b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 18 Jan 2017 14:29:01 -0800 Subject: [PATCH 116/561] [pcre] Update to 8.39. Add sourceforge mirror --- ports/pcre/portfile.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index 8fd6c88190..87f4ec7cbe 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -7,11 +7,11 @@ # include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pcre-8.38) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pcre-8.39) vcpkg_download_distfile(ARCHIVE - URLS "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.zip" - FILENAME "pcre-8.38.zip" - SHA512 82f1c2bdd0a6cc086e3734621ac7a2773cb28f42cf5e400b9bbe8c16655465d9367bce82c6db69577c40ec137b30f1b2443a8d91998a514f81e1c2210828a113 + URLS "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.zip" "https://downloads.sourceforge.net/project/pcre/pcre/8.39/pcre-8.39.zip" + FILENAME "pcre-8.39.zip" + SHA512 14e6336fe603b7110ba9d54a92af8449bbd4a82fe33d14bc912a048336fc90686464354141316c7890e80e7501af88f657cb7247de6717674e80ba044a279a00 ) vcpkg_extract_source_archive(${ARCHIVE}) From 9e2fd15455023960aa9ad5fef6fd98f95e7da79f Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Thu, 19 Jan 2017 06:31:42 +0100 Subject: [PATCH 117/561] Do not simply rename "license_sdk.rtf" to "copyright" --- ports/msmpi/portfile.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/msmpi/portfile.cmake b/ports/msmpi/portfile.cmake index 0cb1701ce5..9fc169a286 100644 --- a/ports/msmpi/portfile.cmake +++ b/ports/msmpi/portfile.cmake @@ -89,5 +89,4 @@ file(INSTALL # Handle copyright file(COPY "${SOURCE_PATH}/sdk/PFiles/Microsoft SDKs/MPI/License/license_sdk.rtf" DESTINATION ${CURRENT_PACKAGES_DIR}/share/msmpi) -#TODO: convert RTF to simple text?! -file(RENAME ${CURRENT_PACKAGES_DIR}/share/msmpi/license_sdk.rtf ${CURRENT_PACKAGES_DIR}/share/msmpi/copyright) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/msmpi/copyright "See the accompanying license_sdk.rtf") From 083dfc4d9cebd816b870186d10fbf591c1f13807 Mon Sep 17 00:00:00 2001 From: Olaf Date: Thu, 19 Jan 2017 14:23:52 +0100 Subject: [PATCH 118/561] Package lzo --- ports/lzo/CONTROL | 3 +++ ports/lzo/portfile.cmake | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 ports/lzo/CONTROL create mode 100644 ports/lzo/portfile.cmake diff --git a/ports/lzo/CONTROL b/ports/lzo/CONTROL new file mode 100644 index 0000000000..afc3540d2f --- /dev/null +++ b/ports/lzo/CONTROL @@ -0,0 +1,3 @@ +Source: lzo +Version: 2.09 +Description: Lossless data compression library diff --git a/ports/lzo/portfile.cmake b/ports/lzo/portfile.cmake new file mode 100644 index 0000000000..a8a91e5e50 --- /dev/null +++ b/ports/lzo/portfile.cmake @@ -0,0 +1,32 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lzo-2.09) +vcpkg_download_distfile(ARCHIVE + URLS "http://www.oberhumer.com/opensource/lzo/download/lzo-2.09.tar.gz" + FILENAME "lzo-2.09.tar.gz" + SHA512 7c64e5e7d2050d75ac8c59d613f6f7230b74746b1d207666755b07450053c8b73980f12f8a1ec59d2af0bada02beec126aaacb675b8088b5fe65e97ff7e6bfc7 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +# Handle copyright +file(COPY ${CURRENT_BUILDTREES_DIR}/src/lzo-2.09/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/lzo) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/lzo/COPYING ${CURRENT_PACKAGES_DIR}/share/lzo/copyright) From d4c63a8a5c9744a1a0bd14b14075b4f4664032bc Mon Sep 17 00:00:00 2001 From: Olaf van der Spek Date: Thu, 19 Jan 2017 14:36:45 +0100 Subject: [PATCH 119/561] Replace cpprest by sqlite3 --- docs/EXAMPLES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/EXAMPLES.md b/docs/EXAMPLES.md index 7862ba3541..6302dab07e 100644 --- a/docs/EXAMPLES.md +++ b/docs/EXAMPLES.md @@ -64,7 +64,7 @@ Package sqlite3:x86-windows is installed ``` In addition to installing, `vcpkg` caches a pristine copy of the built library inside the `packages\` directory -- in this case, `packages\sqlite3_x86-windows`. This allows you to quickly uninstall and reinstall the library in the future using the `remove` and `install` commands. -We can check that cpprestsdk was successfully installed for x86 windows desktop by running the `list` command. +We can check that sqlite3 was successfully installed for x86 windows desktop by running the `list` command. ``` PS D:\src\vcpkg> .\vcpkg list sqlite3:x86-windows 3.15.0 SQLite is a software library that implements a se... @@ -72,7 +72,7 @@ sqlite3:x86-windows 3.15.0 SQLite is a software library that i To install for other architectures and platforms such as Universal Windows Platform or x64 Desktop, you can suffix the package name with `:`. ``` -PS D:\src\vcpkg> .\vcpkg install cpprestsdk:x86-uwp zlib:x64-windows +PS D:\src\vcpkg> .\vcpkg install sqlite3:x86-uwp zlib:x64-windows ``` See `vcpkg help triplet` for all supported targets. From 882004a819bb943e970128fd30f456e9aab68eaa Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 19 Jan 2017 18:06:42 +0100 Subject: [PATCH 120/561] add-fontconfig --- ports/fontconfig/CMakeLists.txt | 80 ++++++ ports/fontconfig/CONTROL | 4 + ports/fontconfig/include/config.h | 267 ++++++++++++++++++ ports/fontconfig/include/fcaliastail.h | 1 + ports/fontconfig/include/fcftaliastail.h | 1 + ports/fontconfig/include/fcobjshash.h | 328 +++++++++++++++++++++++ ports/fontconfig/include/fcstdint.h | 8 + ports/fontconfig/include/unistd.h | 21 ++ ports/fontconfig/portfile.cmake | 34 +++ 9 files changed, 744 insertions(+) create mode 100644 ports/fontconfig/CMakeLists.txt create mode 100644 ports/fontconfig/CONTROL create mode 100644 ports/fontconfig/include/config.h create mode 100644 ports/fontconfig/include/fcaliastail.h create mode 100644 ports/fontconfig/include/fcftaliastail.h create mode 100644 ports/fontconfig/include/fcobjshash.h create mode 100644 ports/fontconfig/include/fcstdint.h create mode 100644 ports/fontconfig/include/unistd.h create mode 100644 ports/fontconfig/portfile.cmake diff --git a/ports/fontconfig/CMakeLists.txt b/ports/fontconfig/CMakeLists.txt new file mode 100644 index 0000000000..f8412ac949 --- /dev/null +++ b/ports/fontconfig/CMakeLists.txt @@ -0,0 +1,80 @@ +cmake_minimum_required(VERSION 3.0) +project(fontconfig) + +add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS) +add_definitions(-FI${FC_INCLUDE_DIR}/config.h) + +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(LIB_SUFFIX d) +endif() + +# find dependencies +find_path(ICONV_INCLUDE_DIR iconv.h) +find_library(ICONV_LIBRARY NAMES iconv libiconv) +find_path(FREETYPE_INCLUDE_DIR ft2build.h) +find_library(FREETYPE_LIBRARY freetype${LIB_SUFFIX}) +find_path(EXPAT_INCLUDE_DIR expat.h) +find_library(EXPAT_LIBRARY expat) + +add_library(fontconfig + src/fcatomic.c + src/fcblanks.c + src/fccache.c + src/fccfg.c + src/fccharset.c + src/fccompat.c + src/fcdbg.c + src/fcdefault.c + src/fcdir.c + src/fcformat.c + src/fcfreetype.c + src/fcfs.c + src/fcinit.c + src/fclang.c + src/fclist.c + src/fcmatch.c + src/fcmatrix.c + src/fcname.c + src/fcobjs.c + src/fcpat.c + src/fcrange.c + src/fcserialize.c + src/fcstat.c + src/fcstr.c + src/fcweight.c + src/fcxml.c + src/ftglue.c) + +target_include_directories(fontconfig PRIVATE . + ${FC_INCLUDE_DIR} + ${FREETYPE_INCLUDE_DIR} + ${EXPAT_INCLUDE_DIR} + ${ICONV_INCLUDE_DIR}) + +target_link_libraries(fontconfig + ${FREETYPE_LIBRARY} + ${ICONV_LIBRARY} + ${EXPAT_LIBRARY}) + +install(TARGETS fontconfig + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + +if(NOT FC_SKIP_HEADERS) + install(FILES + fontconfig/fontconfig.h + fontconfig/fcfreetype.h + fontconfig/fcprivate.h + DESTINATION include/fontconfig) +endif() + +if(NOT FC_SKIP_TOOLS) + set(FC_DEFAULT_FONTS WINDOWSFONTDIR) + set(FC_FONTPATH) + set(FC_CACHEDIR WINDOWSTEMPDIR_FONTCONFIG_CACHE) + set(CONFIGDIR ./fonts/conf.d) + configure_file(fonts.conf.in ${CMAKE_SOURCE_DIR}/fonts.conf @ONLY) + install(FILES fonts.conf DESTINATION tools/fontconfig/fonts) + install(DIRECTORY conf.d DESTINATION tools/fontconfig/fonts FILES_MATCHING PATTERN "*.conf") +endif() diff --git a/ports/fontconfig/CONTROL b/ports/fontconfig/CONTROL new file mode 100644 index 0000000000..ecb371f15d --- /dev/null +++ b/ports/fontconfig/CONTROL @@ -0,0 +1,4 @@ +Source: fontconfig +Version: 2.12.1 +Description: Library for configuring and customizing font access. +Build-Depends: freetype, expat, libiconv diff --git a/ports/fontconfig/include/config.h b/ports/fontconfig/include/config.h new file mode 100644 index 0000000000..8f21dda010 --- /dev/null +++ b/ports/fontconfig/include/config.h @@ -0,0 +1,267 @@ + +#define FC_CACHEDIR "./" + +/* The normal alignment of `double', in bytes. */ +#define ALIGNOF_DOUBLE 8 + +/* Use libxml2 instead of Expat */ +/* #undef ENABLE_LIBXML2 */ + +/* Additional font directories */ +#define FC_ADD_FONTS "yes" + +/* Architecture prefix to use for cache file names */ +/* #undef FC_ARCHITECTURE */ + +/* System font directory */ +#define FC_DEFAULT_FONTS "c:/windows/fonts" + +/* Define to nothing if C supports flexible array members, and to 1 if it does + not. That way, with a declaration like `struct s { int n; double + d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99 + compilers. When computing the size of such an object, don't use 'sizeof + (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)' + instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with + MSVC and with C++ compilers. */ +#define FLEXIBLE_ARRAY_MEMBER /**/ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +/* #undef HAVE_DOPRNT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `fstatfs' function. */ +/* #undef HAVE_FSTATFS */ + +/* Define to 1 if you have the `fstatvfs' function. */ +/* #undef HAVE_FSTATVFS */ + +/* FT_Bitmap_Size structure includes y_ppem field */ +#define HAVE_FT_BITMAP_SIZE_Y_PPEM 1 + +/* Define to 1 if you have the `FT_Get_BDF_Property' function. */ +#define HAVE_FT_GET_BDF_PROPERTY 1 + +/* Define to 1 if you have the `FT_Get_Next_Char' function. */ +#define HAVE_FT_GET_NEXT_CHAR 1 + +/* Define to 1 if you have the `FT_Get_PS_Font_Info' function. */ +#define HAVE_FT_GET_PS_FONT_INFO 1 + +/* Define to 1 if you have the `FT_Get_X11_Font_Format' function. */ +#define HAVE_FT_GET_X11_FONT_FORMAT 1 + +/* Define to 1 if you have the `FT_Has_PS_Glyph_Names' function. */ +#define HAVE_FT_HAS_PS_GLYPH_NAMES 1 + +/* Define to 1 if you have the `FT_Select_Size' function. */ +#define HAVE_FT_SELECT_SIZE 1 + +/* Define to 1 if you have the `getexecname' function. */ +/* #undef HAVE_GETEXECNAME */ + +/* Define to 1 if you have the `getopt' function. */ +#define HAVE_GETOPT 1 + +/* Define to 1 if you have the `getopt_long' function. */ +#define HAVE_GETOPT_LONG 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getprogname' function. */ +/* #undef HAVE_GETPROGNAME */ + +/* Have Intel __sync_* atomic primitives */ +#define HAVE_INTEL_ATOMIC_PRIMITIVES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `link' function. */ +/* #undef HAVE_LINK */ + +/* Define to 1 if you have the `lrand48' function. */ +/* #undef HAVE_LRAND48 */ + +/* Define to 1 if you have the `lstat' function. */ +/* #undef HAVE_LSTAT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkdtemp' function. */ +/* #undef HAVE_MKDTEMP */ + +/* Define to 1 if you have the `mkostemp' function. */ +/* #undef HAVE_MKOSTEMP */ + +/* Define to 1 if you have the `mkstemp' function. */ +/* #undef HAVE_MKSTEMP */ + +/* Define to 1 if you have a working `mmap' system call. */ +/* #undef HAVE_MMAP */ + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the 'posix_fadvise' function. */ +/* #undef HAVE_POSIX_FADVISE */ + +/* Have POSIX threads */ +/* #undef HAVE_PTHREAD */ + +/* Have PTHREAD_PRIO_INHERIT. */ +/* #undef HAVE_PTHREAD_PRIO_INHERIT */ + +/* Define to 1 if you have the `rand' function. */ +#define HAVE_RAND 1 + +/* Define to 1 if you have the `random' function. */ +/* #undef HAVE_RANDOM */ + +/* Define to 1 if you have the `random_r' function. */ +/* #undef HAVE_RANDOM_R */ + +/* Define to 1 if you have the `rand_r' function. */ +/* #undef HAVE_RAND_R */ + +/* Define to 1 if you have the `readlink' function. */ +/* #undef HAVE_READLINK */ + +/* Define to 1 if you have the 'scandir' function. */ +/* #undef HAVE_SCANDIR */ + +/* Define to 1 if you have the 'scandir' function with int (* compar)(const + void *, const void *) */ +/* #undef HAVE_SCANDIR_VOID_P */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SCHED_H */ + +/* Have sched_yield */ +/* #undef HAVE_SCHED_YIELD */ + +/* Have Solaris __machine_*_barrier and atomic_* operations */ +/* #undef HAVE_SOLARIS_ATOMIC_OPS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if `d_type' is a member of `struct dirent'. */ +/* #undef HAVE_STRUCT_DIRENT_D_TYPE */ + +/* Define to 1 if `st_mtim' is a member of `struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_MTIM */ + +/* Define to 1 if `f_flags' is a member of `struct statfs'. */ +/* #undef HAVE_STRUCT_STATFS_F_FLAGS */ + +/* Define to 1 if `f_fstypename' is a member of `struct statfs'. */ +/* #undef HAVE_STRUCT_STATFS_F_FSTYPENAME */ + +/* Define to 1 if `f_basetype' is a member of `struct statvfs'. */ +/* #undef HAVE_STRUCT_STATVFS_F_BASETYPE */ + +/* Define to 1 if `f_fstypename' is a member of `struct statvfs'. */ +/* #undef HAVE_STRUCT_STATVFS_F_FSTYPENAME */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MOUNT_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_PARAM_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_STATFS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_VFS_H */ + +/* Define to 1 if `usLowerOpticalPointSize' is a member of `TT_OS2'. */ +/* #undef HAVE_TT_OS2_USLOWEROPTICALPOINTSIZE */ + +/* Define to 1 if `usUpperOpticalPointSize' is a member of `TT_OS2'. */ +/* #undef HAVE_TT_OS2_USUPPEROPTICALPOINTSIZE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Can use #warning in C files */ +#define HAVE_WARNING_CPP_DIRECTIVE 1 + +/* Use xmlparse.h instead of expat.h */ +/* #undef HAVE_XMLPARSE_H */ + +/* Define to 1 if you have the `XML_SetDoctypeDeclHandler' function. */ +#define HAVE_XML_SETDOCTYPEDECLHANDLER 1 + +/* Define to 1 if you have the `_mktemp_s' function. */ +#define HAVE__MKTEMP_S 1 + +/* Define to necessary symbol if this constant + uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* The size of `char', as computed by sizeof. */ +#define SIZEOF_CHAR 1 + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of `void*', as computed by sizeof. */ +/* The size of `void *', as computed by sizeof. */ +#if defined(_WIN64) +#define SIZEOF_VOIDP 8 +#define SIZEOF_VOID_P 8 +#else +#define SIZEOF_VOIDP 4 +#define SIZEOF_VOID_P 4 +#endif + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Use iconv. */ +#define USE_ICONV 1 \ No newline at end of file diff --git a/ports/fontconfig/include/fcaliastail.h b/ports/fontconfig/include/fcaliastail.h new file mode 100644 index 0000000000..a9eae81f2a --- /dev/null +++ b/ports/fontconfig/include/fcaliastail.h @@ -0,0 +1 @@ +/* intentionally empty */ diff --git a/ports/fontconfig/include/fcftaliastail.h b/ports/fontconfig/include/fcftaliastail.h new file mode 100644 index 0000000000..a9eae81f2a --- /dev/null +++ b/ports/fontconfig/include/fcftaliastail.h @@ -0,0 +1 @@ +/* intentionally empty */ diff --git a/ports/fontconfig/include/fcobjshash.h b/ports/fontconfig/include/fcobjshash.h new file mode 100644 index 0000000000..1fe860a2f2 --- /dev/null +++ b/ports/fontconfig/include/fcobjshash.h @@ -0,0 +1,328 @@ +/* ANSI-C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -m 100 src/fcobjshash.gperf */ +/* Computed positions: -k'2-3' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to ." +#endif + +#line 1 "src/fcobjshash.gperf" + +#line 13 "src/fcobjshash.gperf" +struct FcObjectTypeInfo { +int name; +int id; +}; +#include +/* maximum key range = 56, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +FcObjectTypeHash (register const char *str, register unsigned int len) +{ + static const unsigned char asso_values[] = + { + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 21, 30, 3, + 36, 45, 60, 3, 15, 0, 60, 60, 0, 9, + 9, 0, 21, 60, 0, 0, 15, 0, 60, 60, + 0, 15, 24, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60 + }; + return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[1]]; +} + +struct FcObjectTypeNamePool_t + { + char FcObjectTypeNamePool_str4[sizeof("file")]; + char FcObjectTypeNamePool_str5[sizeof("color")]; + char FcObjectTypeNamePool_str7[sizeof("foundry")]; + char FcObjectTypeNamePool_str8[sizeof("fullname")]; + char FcObjectTypeNamePool_str9[sizeof("pixelsize")]; + char FcObjectTypeNamePool_str10[sizeof("prgname")]; + char FcObjectTypeNamePool_str12[sizeof("fullnamelang")]; + char FcObjectTypeNamePool_str13[sizeof("globaladvance")]; + char FcObjectTypeNamePool_str14[sizeof("postscriptname")]; + char FcObjectTypeNamePool_str16[sizeof("hinting")]; + char FcObjectTypeNamePool_str17[sizeof("minspace")]; + char FcObjectTypeNamePool_str18[sizeof("hintstyle")]; + char FcObjectTypeNamePool_str19[sizeof("fontformat")]; + char FcObjectTypeNamePool_str20[sizeof("fontversion")]; + char FcObjectTypeNamePool_str21[sizeof("fontfeatures")]; + char FcObjectTypeNamePool_str22[sizeof("outline")]; + char FcObjectTypeNamePool_str23[sizeof("autohint")]; + char FcObjectTypeNamePool_str24[sizeof("dpi")]; + char FcObjectTypeNamePool_str25[sizeof("hash")]; + char FcObjectTypeNamePool_str26[sizeof("slant")]; + char FcObjectTypeNamePool_str27[sizeof("aspect")]; + char FcObjectTypeNamePool_str28[sizeof("size")]; + char FcObjectTypeNamePool_str29[sizeof("scale")]; + char FcObjectTypeNamePool_str30[sizeof("symbol")]; + char FcObjectTypeNamePool_str31[sizeof("rasterizer")]; + char FcObjectTypeNamePool_str32[sizeof("scalable")]; + char FcObjectTypeNamePool_str33[sizeof("antialias")]; + char FcObjectTypeNamePool_str34[sizeof("lang")]; + char FcObjectTypeNamePool_str35[sizeof("style")]; + char FcObjectTypeNamePool_str36[sizeof("family")]; + char FcObjectTypeNamePool_str37[sizeof("rgba")]; + char FcObjectTypeNamePool_str38[sizeof("namelang")]; + char FcObjectTypeNamePool_str39[sizeof("stylelang")]; + char FcObjectTypeNamePool_str40[sizeof("familylang")]; + char FcObjectTypeNamePool_str41[sizeof("width")]; + char FcObjectTypeNamePool_str42[sizeof("matrix")]; + char FcObjectTypeNamePool_str43[sizeof("charset")]; + char FcObjectTypeNamePool_str45[sizeof("charwidth")]; + char FcObjectTypeNamePool_str46[sizeof("charheight")]; + char FcObjectTypeNamePool_str47[sizeof("embolden")]; + char FcObjectTypeNamePool_str48[sizeof("lcdfilter")]; + char FcObjectTypeNamePool_str49[sizeof("spacing")]; + char FcObjectTypeNamePool_str50[sizeof("index")]; + char FcObjectTypeNamePool_str51[sizeof("weight")]; + char FcObjectTypeNamePool_str52[sizeof("capability")]; + char FcObjectTypeNamePool_str53[sizeof("embeddedbitmap")]; + char FcObjectTypeNamePool_str58[sizeof("decorative")]; + char FcObjectTypeNamePool_str59[sizeof("verticallayout")]; + }; +static const struct FcObjectTypeNamePool_t FcObjectTypeNamePool_contents = + { + "file", + "color", + "foundry", + "fullname", + "pixelsize", + "prgname", + "fullnamelang", + "globaladvance", + "postscriptname", + "hinting", + "minspace", + "hintstyle", + "fontformat", + "fontversion", + "fontfeatures", + "outline", + "autohint", + "dpi", + "hash", + "slant", + "aspect", + "size", + "scale", + "symbol", + "rasterizer", + "scalable", + "antialias", + "lang", + "style", + "family", + "rgba", + "namelang", + "stylelang", + "familylang", + "width", + "matrix", + "charset", + "charwidth", + "charheight", + "embolden", + "lcdfilter", + "spacing", + "index", + "weight", + "capability", + "embeddedbitmap", + "decorative", + "verticallayout" + }; +#define FcObjectTypeNamePool ((const char *) &FcObjectTypeNamePool_contents) +#ifdef __GNUC__ +__inline +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const struct FcObjectTypeInfo * +FcObjectTypeLookup (register const char *str, register unsigned int len) +{ + enum + { + TOTAL_KEYWORDS = 48, + MIN_WORD_LENGTH = 3, + MAX_WORD_LENGTH = 14, + MIN_HASH_VALUE = 4, + MAX_HASH_VALUE = 59 + }; + + static const struct FcObjectTypeInfo wordlist[] = + { + {-1}, {-1}, {-1}, {-1}, +#line 38 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str4,FC_FILE_OBJECT}, +#line 64 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str5,FC_COLOR_OBJECT}, + {-1}, +#line 31 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str7,FC_FOUNDRY_OBJECT}, +#line 22 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str8,FC_FULLNAME_OBJECT}, +#line 29 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str9,FC_PIXEL_SIZE_OBJECT}, +#line 61 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str10,FC_PRGNAME_OBJECT}, + {-1}, +#line 23 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str12,FC_FULLNAMELANG_OBJECT}, +#line 37 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str13,FC_GLOBAL_ADVANCE_OBJECT}, +#line 63 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str14,FC_POSTSCRIPT_NAME_OBJECT}, + {-1}, +#line 34 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str16,FC_HINTING_OBJECT}, +#line 46 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str17,FC_MINSPACE_OBJECT}, +#line 33 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str18,FC_HINT_STYLE_OBJECT}, +#line 54 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str19,FC_FONTFORMAT_OBJECT}, +#line 52 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str20,FC_FONTVERSION_OBJECT}, +#line 60 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str21,FC_FONT_FEATURES_OBJECT}, +#line 41 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str22,FC_OUTLINE_OBJECT}, +#line 36 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str23,FC_AUTOHINT_OBJECT}, +#line 43 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str24,FC_DPI_OBJECT}, +#line 62 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str25,FC_HASH_OBJECT}, +#line 24 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str26,FC_SLANT_OBJECT}, +#line 28 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str27,FC_ASPECT_OBJECT}, +#line 27 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str28,FC_SIZE_OBJECT}, +#line 45 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str29,FC_SCALE_OBJECT}, +#line 65 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str30,FC_SYMBOL_OBJECT}, +#line 40 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str31,FC_RASTERIZER_OBJECT}, +#line 42 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str32,FC_SCALABLE_OBJECT}, +#line 32 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str33,FC_ANTIALIAS_OBJECT}, +#line 51 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str34,FC_LANG_OBJECT}, +#line 20 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str35,FC_STYLE_OBJECT}, +#line 18 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str36,FC_FAMILY_OBJECT}, +#line 44 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str37,FC_RGBA_OBJECT}, +#line 59 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str38,FC_NAMELANG_OBJECT}, +#line 21 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str39,FC_STYLELANG_OBJECT}, +#line 19 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str40,FC_FAMILYLANG_OBJECT}, +#line 26 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str41,FC_WIDTH_OBJECT}, +#line 49 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str42,FC_MATRIX_OBJECT}, +#line 50 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str43,FC_CHARSET_OBJECT}, + {-1}, +#line 47 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str45,FC_CHAR_WIDTH_OBJECT}, +#line 48 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str46,FC_CHAR_HEIGHT_OBJECT}, +#line 55 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str47,FC_EMBOLDEN_OBJECT}, +#line 58 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str48,FC_LCD_FILTER_OBJECT}, +#line 30 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str49,FC_SPACING_OBJECT}, +#line 39 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str50,FC_INDEX_OBJECT}, +#line 25 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str51,FC_WEIGHT_OBJECT}, +#line 53 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str52,FC_CAPABILITY_OBJECT}, +#line 56 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str53,FC_EMBEDDED_BITMAP_OBJECT}, + {-1}, {-1}, {-1}, {-1}, +#line 57 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str58,FC_DECORATIVE_OBJECT}, +#line 35 "src/fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str59,FC_VERTICAL_LAYOUT_OBJECT} + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = FcObjectTypeHash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = wordlist[key].name; + if (o >= 0) + { + register const char *s = o + FcObjectTypeNamePool; + + if (*str == *s && !strcmp (str + 1, s + 1)) + return &wordlist[key]; + } + } + } + return 0; +} diff --git a/ports/fontconfig/include/fcstdint.h b/ports/fontconfig/include/fcstdint.h new file mode 100644 index 0000000000..1a8be6ef08 --- /dev/null +++ b/ports/fontconfig/include/fcstdint.h @@ -0,0 +1,8 @@ +#ifndef _FONTCONFIG_SRC_FCSTDINT_H +#define _FONTCONFIG_SRC_FCSTDINT_H 1 +#ifndef _GENERATED_STDINT_H +#define _GENERATED_STDINT_H "fontconfig 2.12.1" +#define _STDINT_HAVE_STDINT_H 1 +#include +#endif +#endif diff --git a/ports/fontconfig/include/unistd.h b/ports/fontconfig/include/unistd.h new file mode 100644 index 0000000000..7d04abe292 --- /dev/null +++ b/ports/fontconfig/include/unistd.h @@ -0,0 +1,21 @@ +/* Minimal unistd.h, just to get fontconfig to compile */ +#ifndef UNISTD_H +#define UNISTD_H + +#include + +#ifndef R_OK +#define R_OK 4 +#endif + +#ifndef W_OK +#define W_OK 2 +#endif + +#ifndef F_OK +#define F_OK 0 +#endif + +typedef int mode_t; + +#endif \ No newline at end of file diff --git a/ports/fontconfig/portfile.cmake b/ports/fontconfig/portfile.cmake new file mode 100644 index 0000000000..06bff2aa01 --- /dev/null +++ b/ports/fontconfig/portfile.cmake @@ -0,0 +1,34 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/fontconfig-2.12.1) +vcpkg_download_distfile(ARCHIVE + URLS "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.12.1.tar.gz" + FILENAME "fontconfig-2.12.1.tar.gz" + SHA512 0959a80522e09551e49ec7b2383b7dfb319d4e1c058ad0b55bb35d3f675acbb7ff08c9c30a8798b731070687f84dd3d2ff7e28aafac6ecfa9d3f85c5847c0955) + +# Download single-header implementation of dirent API for Windows. +vcpkg_download_distfile(DIRENT_H + URLS "https://raw.githubusercontent.com/tronkko/dirent/8b1db5092479a73d47eafd3de739b27e876e6bf3/include/dirent.h" + FILENAME "fontconfig-dirent.h" + SHA512 dc9e63fd9cf4ccffdc052f92933633ef9d09dfcfe3b1d15f1f32c99349babd36a62d02283e3d8ba7766d92817be015eb211f11efc4fa52cc90d532a34d1ae785) + + +vcpkg_extract_source_archive(${ARCHIVE}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${DIRENT_H} DESTINATION ${SOURCE_PATH}) +file(RENAME ${SOURCE_PATH}/fontconfig-dirent.h ${SOURCE_PATH}/dirent.h) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON + -DFC_INCLUDE_DIR=${CMAKE_CURRENT_LIST_DIR}/include + OPTIONS_DEBUG + -DFC_SKIP_TOOLS=ON + -DFC_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fontconfig) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/fontconfig/COPYING ${CURRENT_PACKAGES_DIR}/share/fontconfig/copyright) From 942ce23ca866e4f4982469453755656681e9109c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 19 Jan 2017 16:12:07 -0800 Subject: [PATCH 121/561] [PRIVACY] fix typo in privacy document. Fixes #566. --- docs/PRIVACY.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/PRIVACY.md b/docs/PRIVACY.md index f50c2938fa..ad345c8092 100644 --- a/docs/PRIVACY.md +++ b/docs/PRIVACY.md @@ -5,14 +5,14 @@ ## Do you collect telemetry data? What is it used for? We do collect telemetry data from usage of "vcpkg.exe". We explicitly ONLY collect information from invocations of the tool itself; we do NOT add any tracking information into the produced libraries. -We use this information to understand the usage the issue and what we can do to improve the tool. +We use this information to understand usage issues and to guide tool improvements. ## What telemetry is collected? We collect the command line used, the time of invocation, and how long the command took. Some commands also add additional calculated information (such as the full set of libraries to install). We generate a completely random UUID on first use and attach it to each event. For this preview, we do not offer a mechanism to disable this data collection since it is critical for improving the product. In the full release, you will be able to opt-out with a simple configuration. For more information about how Microsoft protects your privacy, see https://privacy.microsoft.com/en-us/privacy. -Here is an example of an event for the command line "vcpkg install zlib": +Here is an example of an event for the command line `vcpkg install zlib`: ``` [{ "ver": 1, @@ -40,7 +40,7 @@ Here is an example of an event for the command line "vcpkg install zlib": } }] ``` -In the source code (included in every release), you can search for calls to the functions "TrackProperty" and "TrackMetric" to see every specific data point we collect. +In the source code (included in `toolsrc\`), you can search for calls to the functions `TrackProperty()` and `TrackMetric()` to see every specific data point we collect. ## Is the data stored on my system? From 030ed271179ac57479d4bfec2e64b9457486d4c5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 19 Jan 2017 17:38:56 -0800 Subject: [PATCH 122/561] Fix integration when $(Platform) is empty --- scripts/buildsystems/msbuild/vcpkg.targets | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 0c748c1d6e..912cf6b8e2 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -9,6 +9,16 @@ x86-uwp + + true + x86-windows + + + + true + x86-uwp + + true x64-windows From 1c9ea008be82d00a1f7d7f3762e122d09bd3f41e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 19 Jan 2017 18:55:07 -0800 Subject: [PATCH 123/561] [fltk] Avoid renaming DLLs -- they are referred to by name in LIBs. --- ports/fltk/portfile.cmake | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/ports/fltk/portfile.cmake b/ports/fltk/portfile.cmake index a06b833109..848096dced 100644 --- a/ports/fltk/portfile.cmake +++ b/ports/fltk/portfile.cmake @@ -48,16 +48,6 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk-config) vcpkg_copy_pdbs() if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_forms_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_forms.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_gl_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_gl.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_images_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_images.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_SHAREDd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fltk.dll) - - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_forms_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_forms.pdb) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_gl_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_gl.pdb) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_images_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_images.pdb) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/libfltk_SHAREDd.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/fltk.pdb) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_formsd.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_gld.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_imagesd.lib) @@ -68,17 +58,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_images_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_imagesd.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltkd.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_forms_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk_forms.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_gl_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk_gl.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_images_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk_images.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_SHARED.dll ${CURRENT_PACKAGES_DIR}/bin/fltk.dll) - - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_forms_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk_forms.pdb) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_gl_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk_gl.pdb) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_images_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk_images.pdb) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/libfltk_SHARED.pdb ${CURRENT_PACKAGES_DIR}/bin/fltk.pdb) - - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_forms.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_gl.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_images.lib) From 28bd54e0d04fce52577a563956e853f96c060566 Mon Sep 17 00:00:00 2001 From: sdcb Date: Fri, 20 Jan 2017 15:19:23 +0800 Subject: [PATCH 124/561] [libmysql] upgrade to 5.7.17 1. upgraded upstream mysql version to 5.7.17 2. simplified the patch size from 12K to 2K 3. enabled static build 4. switched mysql.h file to mysql/mysql.h --- ports/libmysql/0001_cmake.patch | 378 --------------------------- ports/libmysql/CONTROL | 4 +- ports/libmysql/boost_and_build.patch | 44 ++++ ports/libmysql/portfile.cmake | 148 ++++++----- 4 files changed, 125 insertions(+), 449 deletions(-) delete mode 100644 ports/libmysql/0001_cmake.patch create mode 100644 ports/libmysql/boost_and_build.patch diff --git a/ports/libmysql/0001_cmake.patch b/ports/libmysql/0001_cmake.patch deleted file mode 100644 index 9defe7fc19..0000000000 --- a/ports/libmysql/0001_cmake.patch +++ /dev/null @@ -1,378 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 44842d3..e89eed9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -118,7 +118,7 @@ IF(DEFINED MYSQL_PROJECT_NAME) - SET(MYSQL_PROJECT_NAME ${MYSQL_PROJECT_NAME} CACHE STRING - ${MYSQL_PROJECT_NAME_DOCSTRING} FORCE) - ELSE() -- SET(MYSQL_PROJECT_NAME "MySQL" CACHE STRING -+ SET(MYSQL_PROJECT_NAME "LibMySQL" CACHE STRING - ${MYSQL_PROJECT_NAME_DOCSTRING} FORCE) - MARK_AS_ADVANCED(MYSQL_PROJECT_NAME) - ENDIF() -@@ -132,6 +132,9 @@ IF(CMAKE_BUILD_TYPE MATCHES "Debug" OR WITH_DEBUG) - ENDIF() - ENDIF() - -+OPTION(FORCE_UNSUPPORTED_COMPILER "Disable compiler version checks" ON) -+MARK_AS_ADVANCED(FORCE_UNSUPPORTED_COMPILER) -+ - OPTION(WITH_DEFAULT_COMPILER_OPTIONS - "Use flags from cmake/build_configurations/compiler_options.cmake" - ON) -@@ -193,46 +196,30 @@ ENDIF() - INCLUDE(character_sets) - INCLUDE(cpu_info) - INCLUDE(zlib) --INCLUDE(lz4) --INCLUDE(libevent) - INCLUDE(ssl) --INCLUDE(readline) --INCLUDE(protobuf) - INCLUDE(mysql_version) - INCLUDE(libutils) - INCLUDE(dtrace) --INCLUDE(plugin) - INCLUDE(install_macros) - INCLUDE(install_layout) - INCLUDE(mysql_add_executable) - - # Handle options --IF(EXISTS ${CMAKE_SOURCE_DIR}/rapid) -- OPTION(WITH_RAPID -- "Build additonal code(plugins) that is located in rapid directory" ON) --ELSE() -- OPTION(WITH_RAPID -- "Build additonal code(plugins) that is located in rapid directory" OFF) --ENDIF() - OPTION(DISABLE_SHARED - "Don't build shared libraries, compile code as position-dependent" OFF) -+MARK_AS_ADVANCED(DISABLE_SHARED) - IF(DISABLE_SHARED) - SET(WITHOUT_DYNAMIC_PLUGINS 1) - ENDIF() - OPTION(ENABLED_PROFILING "Enable profiling" ON) --OPTION(WITHOUT_SERVER OFF) -+SET(WITHOUT_SERVER ON) - IF(UNIX) - OPTION(WITH_VALGRIND "Valgrind instrumentation" OFF) - ENDIF() - IF(WIN32) - OPTION(WITH_MSCRT_DEBUG "MS Visual Studio Debug CRT instrumentation" OFF) - ENDIF() --IF(NOT WITHOUT_SERVER) -- OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON) --ENDIF() --OPTION(FORCE_UNSUPPORTED_COMPILER "Disable compiler version checks" OFF) --MARK_AS_ADVANCED(WITHOUT_SERVER DISABLE_SHARED FORCE_UNSUPPORTED_COMPILER) -- -+OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" OFF) - - include(CheckCSourceCompiles) - include(CheckCXXSourceCompiles) -@@ -452,18 +439,8 @@ ELSE() - SET(DEFAULT_TMPDIR "\"${TMPDIR}\"") - ENDIF() - --INCLUDE(cmake/boost.cmake) -- --IF (CMAKE_SYSTEM_NAME MATCHES "Linux") -- OPTION(WITH_SYSTEMD "Enable installation of systemd support files" OFF) -- IF (WITH_SYSTEMD) -- INCLUDE(cmake/systemd.cmake) -- ENDIF() --ELSE() -- IF (WITH_SYSTEMD) -- MESSAGE(FATAL_ERROR "Installation of systemd support files not supported") -- ENDIF() --ENDIF() -+# Boost is not needed to build libmysql (yet) -+#INCLUDE(cmake/boost.cmake) - - # Run platform tests - INCLUDE(configure.cmake) -@@ -479,76 +456,6 @@ INCLUDE_DIRECTORIES( - MYSQL_CHECK_ZLIB_WITH_COMPRESS() - # Add bundled yassl/taocrypt or system openssl. - MYSQL_CHECK_SSL() --# Add system/bundled editline. --MYSQL_CHECK_EDITLINE() --# Add libevent --MYSQL_CHECK_LIBEVENT() --# Add lz4 library --MYSQL_CHECK_LZ4() --# Add protoc and libprotobuf --IF(NOT WITHOUT_SERVER) -- MYSQL_CHECK_PROTOBUF() --ENDIF() -- --# Check for SYS_thread_selfid system call --CHECK_C_SOURCE_COMPILES(" --#include --#include --#include --int main(int ac, char **av) --{ -- unsigned long long tid = syscall(SYS_thread_selfid); -- return (tid != 0 ? 0 : 1); --}" --HAVE_SYS_THREAD_SELFID) -- --# Check for gettid() system call --CHECK_C_SOURCE_COMPILES(" --#include --#include --#include --int main(int ac, char **av) --{ -- unsigned long long tid = syscall(SYS_gettid); -- return (tid != 0 ? 0 : 1); --}" --HAVE_SYS_GETTID) -- --IF(CMAKE_SYSTEM_NAME MATCHES "Linux") -- # Check for pthread_setname_np -- CHECK_C_SOURCE_COMPILES(" -- #include -- int main(int ac, char **av) -- { -- const char *thread_name= 0; -- int ret = pthread_setname_np(pthread_self(), thread_name); -- return ret; -- }" -- HAVE_PTHREAD_SETNAME_NP) --ENDIF() -- --# Check for pthread_getthreadid_np() --CHECK_C_SOURCE_COMPILES(" --#include --int main(int ac, char **av) --{ -- unsigned long long tid = pthread_getthreadid_np(); -- return (tid != 0 ? 0 : 1); --}" --HAVE_PTHREAD_GETTHREADID_NP) -- --# Check for pthread_self() returning an integer type --CHECK_C_SOURCE_COMPILES(" --#include --#include --int main(int ac, char **av) --{ -- unsigned long long tid = pthread_self(); -- return (tid != 0 ? 0 : 1); --}" --HAVE_INTEGER_PTHREAD_SELF --FAIL_REGEX "warning: incompatible pointer to integer conversion" --) - - # - # Setup maintainer mode options by the end. Platform checks are -@@ -563,18 +470,15 @@ OPTION(MYSQL_MAINTAINER_MODE - - INCLUDE(maintainer) - --IF(WITH_UNIT_TESTS) -+IF(0) #WITH_UNIT_TESTS) - ENABLE_TESTING() - ENDIF() - --IF(NOT WITHOUT_SERVER) -+IF(0) #NOT WITHOUT_SERVER) - SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "") - SET (MYSQLD_STATIC_EMBEDDED_PLUGIN_LIBS "" CACHE INTERNAL "") - # Add storage engines and plugins. - CONFIGURE_PLUGINS() --ELSE() -- # We may still want Cluster client libraries, use -DWITH_NDBCLUSTER=1 -- ADD_SUBDIRECTORY(storage/ndb) - ENDIF() - - ADD_SUBDIRECTORY(include) -@@ -588,61 +492,18 @@ ADD_SUBDIRECTORY(libmysql) - ADD_SUBDIRECTORY(libbinlogevents) - ADD_SUBDIRECTORY(libbinlogstandalone) - --IF(WITH_UNIT_TESTS) -- # Visual Studio 11 needs this extra flag in order to compile gmock. -- IF(WIN32) -- ADD_DEFINITIONS( /D _VARIADIC_MAX=10 ) -- ENDIF() -- # libc++ doesn't have tuple in tr1 -- IF(HAVE_LLVM_LIBCPP) -- ADD_DEFINITIONS(-DGTEST_USE_OWN_TR1_TUPLE=1) -- ENDIF() - -- ADD_SUBDIRECTORY(unittest) -- ADD_SUBDIRECTORY(unittest/examples) -- ADD_SUBDIRECTORY(unittest/mytap) -- ADD_SUBDIRECTORY(unittest/mytap/t) -- IF(WITH_RAPID AND EXISTS ${CMAKE_SOURCE_DIR}/rapid/unittest/gunit) -- ADD_SUBDIRECTORY(rapid/unittest/gunit) -- ENDIF() --ENDIF() - -+SET(WITH_INNOBASE_STORAGE_ENGINE 0) - ADD_SUBDIRECTORY(extra) --ADD_SUBDIRECTORY(client) - ADD_SUBDIRECTORY(sql/share) --ADD_SUBDIRECTORY(libservices) -- --IF(UNIX) -- ADD_SUBDIRECTORY(man) --ENDIF() -- --IF(NOT WITHOUT_SERVER) -- ADD_SUBDIRECTORY(testclients) -- ADD_SUBDIRECTORY(sql) -- OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF) -- IF(WITH_EMBEDDED_SERVER) -- ADD_SUBDIRECTORY(libmysqld) -- ADD_SUBDIRECTORY(libmysqld/examples) -- ENDIF(WITH_EMBEDDED_SERVER) --ENDIF() -- --# scripts/mysql_config depends on client and server targets loaded above. --# It is referenced by some of the directories below, so we insert it here. - ADD_SUBDIRECTORY(scripts) -+ADD_SUBDIRECTORY(support-files) - --IF(NOT WITHOUT_SERVER) -- ADD_SUBDIRECTORY(mysql-test) -- ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess) -- ADD_SUBDIRECTORY(support-files) -- IF(EXISTS ${CMAKE_SOURCE_DIR}/internal/CMakeLists.txt) -- ADD_SUBDIRECTORY(internal) -- ENDIF() -- ADD_SUBDIRECTORY(packaging/rpm-oel) -- ADD_SUBDIRECTORY(packaging/rpm-fedora) -- ADD_SUBDIRECTORY(packaging/rpm-sles) -- ADD_SUBDIRECTORY(packaging/rpm-docker) -- ADD_SUBDIRECTORY(packaging/deb-in) --ENDIF() -+# -+# Directory where error message database is generated (GenError target) -+# -+FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/sql/share) - - INCLUDE(cmake/abi_check.cmake) - INCLUDE(cmake/tags.cmake) -@@ -680,11 +541,7 @@ ELSE() - SET(CPACK_GENERATOR "TGZ") - ENDIF() - ADD_SUBDIRECTORY(packaging/WiX) --ADD_SUBDIRECTORY(packaging/solaris) - --IF(UNIX) -- INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL COMPONENT Info) --ENDIF() - # - # RPM installs documentation directly from the source tree - # -diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt -index 3adf988..9e0ba30 100644 ---- a/extra/CMakeLists.txt -+++ b/extra/CMakeLists.txt -@@ -70,87 +70,4 @@ ADD_DEFINITIONS(-DMUTEX_EVENT) - COPY_OPENSSL_DLLS(copy_openssl_extra) - IF (WIN32 AND WITH_SSL_PATH AND HAVE_CRYPTO_DLL) - ADD_DEPENDENCIES(GenError copy_openssl_extra) --ENDIF() -- -- --MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.c) --TARGET_LINK_LIBRARIES(my_print_defaults mysys mysys_ssl) --SET_TARGET_PROPERTIES(my_print_defaults PROPERTIES LINKER_LANGUAGE CXX) -- --MYSQL_ADD_EXECUTABLE(perror perror.c) --ADD_DEPENDENCIES(perror GenError) --TARGET_LINK_LIBRARIES(perror mysys mysys_ssl) --SET_TARGET_PROPERTIES(perror PROPERTIES LINKER_LANGUAGE CXX) -- --MYSQL_ADD_EXECUTABLE(resolveip resolveip.c) --TARGET_LINK_LIBRARIES(resolveip mysys mysys_ssl) --SET_TARGET_PROPERTIES(resolveip PROPERTIES LINKER_LANGUAGE CXX) --IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") -- INCLUDE(CheckFunctionExists) -- INCLUDE(CheckLibraryExists) -- MY_SEARCH_LIBS(inet_aton "nsl;socket;resolv" SOLARIS_NSL) -- TARGET_LINK_LIBRARIES(resolveip ${SOLARIS_NSL}) --ENDIF() -- -- --MYSQL_ADD_EXECUTABLE(replace replace.c) --TARGET_LINK_LIBRARIES(replace mysys) -- --MYSQL_ADD_EXECUTABLE(lz4_decompress lz4_decompress.cc) --TARGET_LINK_LIBRARIES(lz4_decompress ${LZ4_LIBRARY}) -- --MYSQL_ADD_EXECUTABLE(zlib_decompress zlib_decompress.cc) --TARGET_LINK_LIBRARIES(zlib_decompress ${ZLIB_LIBRARY}) -- --IF(WITH_INNOBASE_STORAGE_ENGINE) -- -- IF(LZ4_INCLUDE_DIR AND LZ4_LIBRARY) -- ADD_DEFINITIONS(-DHAVE_LZ4=1) -- INCLUDE_DIRECTORIES(${LZ4_INCLUDE_DIR}) -- ENDIF() -- -- # Add path to the InnoDB headers -- INCLUDE_DIRECTORIES( -- ${CMAKE_SOURCE_DIR}/storage/innobase/include -- ${CMAKE_SOURCE_DIR}/sql -- ) -- # We use the InnoDB code directly in case the code changes. -- ADD_DEFINITIONS("-DUNIV_INNOCHECKSUM") -- SET(INNOBASE_SOURCES -- ../storage/innobase/buf/buf0checksum.cc -- ../storage/innobase/ut/ut0crc32.cc -- ../storage/innobase/ut/ut0ut.cc -- ../storage/innobase/buf/buf0buf.cc -- ../storage/innobase/page/page0zip.cc -- ../storage/innobase/os/os0file.cc -- ) -- -- # Avoid generating Hardware Capabilities due to crc32 instructions -- IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND -- CMAKE_SYSTEM_PROCESSOR MATCHES "i386") -- INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake) -- MY_CHECK_CXX_COMPILER_FLAG("-Wa,-nH" HAVE_WA_NH) -- IF(HAVE_WA_NH) -- ADD_COMPILE_FLAGS( -- ../storage/innobase/ut/ut0crc32.cc -- COMPILE_FLAGS "-Wa,-nH" -- ) -- ENDIF() -- ENDIF() -- -- MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.cc ${INNOBASE_SOURCES}) -- TARGET_LINK_LIBRARIES(innochecksum mysys mysys_ssl ${LZ4_LIBRARY}) -- ADD_DEPENDENCIES(innochecksum GenError) --ENDIF() -- --IF(UNIX) -- MYSQL_ADD_EXECUTABLE(resolve_stack_dump resolve_stack_dump.cc) -- TARGET_LINK_LIBRARIES(resolve_stack_dump mysys mysys_ssl) --ENDIF() -- --# In published release builds on Solaris, we need to bundle gcc source. --# PB2 will take care of putting it in extra/ when needed --IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/gcc-4.8.1.tar.bz2) -- INSTALL(FILES gcc-4.8.1.tar.bz2 -- DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Development) --ENDIF() -+ENDIF() -\ No newline at end of file -diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h -index 8b7a554..4353037 100644 ---- a/mysys/mysys_priv.h -+++ b/mysys/mysys_priv.h -@@ -18,6 +18,7 @@ - - #include "my_global.h" - #include "mysql/psi/mysql_thread.h" -+#include "my_sys.h" - - #ifdef HAVE_PSI_INTERFACE - diff --git a/ports/libmysql/CONTROL b/ports/libmysql/CONTROL index 504f14bbba..4e5564972d 100644 --- a/ports/libmysql/CONTROL +++ b/ports/libmysql/CONTROL @@ -1,3 +1,3 @@ -Source: libmysql -Version: 5.7.16 +Source: libmysql +Version: 5.7.17 Description: A MySQL client library for C development. \ No newline at end of file diff --git a/ports/libmysql/boost_and_build.patch b/ports/libmysql/boost_and_build.patch new file mode 100644 index 0000000000..7fce8ffc5f --- /dev/null +++ b/ports/libmysql/boost_and_build.patch @@ -0,0 +1,44 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 44842d3..e34ab24 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -452,7 +452,7 @@ ELSE() + SET(DEFAULT_TMPDIR "\"${TMPDIR}\"") + ENDIF() + +-INCLUDE(cmake/boost.cmake) ++#INCLUDE(cmake/boost.cmake) + + IF (CMAKE_SYSTEM_NAME MATCHES "Linux") + OPTION(WITH_SYSTEMD "Enable installation of systemd support files" OFF) +diff --git a/client/dump/CMakeLists.txt b/client/dump/CMakeLists.txt +index bae2ce7..4e11516 100644 +--- a/client/dump/CMakeLists.txt ++++ b/client/dump/CMakeLists.txt +@@ -21,12 +21,12 @@ INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/dump + ) + +-IF (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") ++#IF (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") + IF (WITHOUT_SERVER) + MESSAGE(STATUS "Not building mysqlpump") + RETURN() + ENDIF() +-ENDIF() ++#ENDIF() + + # Prevent Boost from including external precompiled Boost libraries, use + # threading (not implemented for older Solaris Studio compilers) +diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h +index 8b7a554..4353037 100644 +--- a/mysys/mysys_priv.h ++++ b/mysys/mysys_priv.h +@@ -18,6 +18,7 @@ + + #include "my_global.h" + #include "mysql/psi/mysql_thread.h" ++#include "my_sys.h" + + #ifdef HAVE_PSI_INTERFACE + diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index 48412ccc74..2a7f7f33d0 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -1,70 +1,80 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mysql-server-mysql-5.7.16) - -if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql.h") - message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.") -endif() - -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/mysql/mysql-server/archive/mysql-5.7.16.tar.gz" - FILENAME "mysql-server-mysql-5.7.16.tar.gz" - SHA512 30a3c55ebb15f18ededf814b66c108f18b2ced9c39e08319cdc9559ccf38d494ad9322098f2b04418ddf557e46d9d727be0e514be0ae982ac4f5186aa295b9c6 -) -vcpkg_extract_source_archive(${ARCHIVE}) - -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} -) - -vcpkg_install_cmake() - -# delete debug headers -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/include) - -# delete useless vcruntime/scripts/bin/msg file -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/share - ${CURRENT_PACKAGES_DIR}/debug/share - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/bin - ${CURRENT_PACKAGES_DIR}/lib/debug) - -file(MAKE_DIRECTORY - ${CURRENT_PACKAGES_DIR}/share - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/bin) - -# remove misc files -file(REMOVE - ${CURRENT_PACKAGES_DIR}/COPYING - ${CURRENT_PACKAGES_DIR}/my-default.ini - ${CURRENT_PACKAGES_DIR}/README - ${CURRENT_PACKAGES_DIR}/debug/COPYING - ${CURRENT_PACKAGES_DIR}/debug/my-default.ini - ${CURRENT_PACKAGES_DIR}/debug/README) - -# remove mysqlclient.lib -file(REMOVE - ${CURRENT_PACKAGES_DIR}/lib/mysqlclient.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/mysqlclient.lib) - -# correct the dll directory -file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/bin/libmysql.dll) -file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.dll) -file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/bin/libmysql.pdb) -file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.pdb) - -# copy license -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmysql) +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mysql-server-mysql-5.7.17) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/mysql/mysql-server/archive/mysql-5.7.17.tar.gz" + FILENAME "mysql-server-mysql-5.7.17.tar.gz" + SHA512 511027f28f0705f59a08ec369b1ebe5d9a77eb839d545898631f1ebbcb6b4b800f5b88511d3ae5d231c04e09a2d7b2b2d178264d36aeb2bc602cc1b0b248cfba +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/boost_and_build.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DWITHOUT_SERVER=ON + -DWITH_UNIT_TESTS=OFF + -DENABLED_PROFILING=OFF +) + +vcpkg_install_cmake() + +# delete debug headers +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include) + +# switch mysql into /mysql +file(RENAME ${CURRENT_PACKAGES_DIR}/include ${CURRENT_PACKAGES_DIR}/include2) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/include) +file(RENAME ${CURRENT_PACKAGES_DIR}/include2 ${CURRENT_PACKAGES_DIR}/include/mysql) + +## delete useless vcruntime/scripts/bin/msg file +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/share + ${CURRENT_PACKAGES_DIR}/debug/share + ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/debug/bin + ${CURRENT_PACKAGES_DIR}/docs + ${CURRENT_PACKAGES_DIR}/debug/docs + ${CURRENT_PACKAGES_DIR}/lib/debug) + +# remove misc files +file(REMOVE + ${CURRENT_PACKAGES_DIR}/COPYING + ${CURRENT_PACKAGES_DIR}/README + ${CURRENT_PACKAGES_DIR}/debug/COPYING + ${CURRENT_PACKAGES_DIR}/debug/README) + +# remove not-related libs +file (REMOVE + ${CURRENT_PACKAGES_DIR}/lib/mysqlservices.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mysqlservices.lib) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE + ${CURRENT_PACKAGES_DIR}/lib/libmysql.lib + ${CURRENT_PACKAGES_DIR}/lib/libmysql.dll + ${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb + ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.dll + ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.pdb) +else() + file(REMOVE + ${CURRENT_PACKAGES_DIR}/lib/mysqlclient.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mysqlclient.lib) + + # correct the dll directory + file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/bin/libmysql.dll) + file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/bin/libmysql.pdb) + file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.dll) + file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.pdb) +endif() + +# copy license +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmysql) file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmysql/COPYING ${CURRENT_PACKAGES_DIR}/share/libmysql/copyright) \ No newline at end of file From ce9741f71b079dad944e177daf984160bb9ce1bb Mon Sep 17 00:00:00 2001 From: sdcb Date: Fri, 20 Jan 2017 17:06:11 +0800 Subject: [PATCH 125/561] [libmariadb] upgrade to 2.3.2 1. upgrade package to 2.3.2 2. enable static build support 3. do not block with libmysql --- ports/libmariadb/CONTROL | 4 +- ports/libmariadb/portfile.cmake | 140 ++++++++++++++------------------ 2 files changed, 65 insertions(+), 79 deletions(-) diff --git a/ports/libmariadb/CONTROL b/ports/libmariadb/CONTROL index b91da0740f..a42f79ee5f 100644 --- a/ports/libmariadb/CONTROL +++ b/ports/libmariadb/CONTROL @@ -1,3 +1,3 @@ -Source: libmariadb -Version: 2.3.1 +Source: libmariadb +Version: 2.3.2 Description: The MariaDB Connector/C is used to connect applications developed in C/C++ to MariaDB and MySQL databases. \ No newline at end of file diff --git a/ports/libmariadb/portfile.cmake b/ports/libmariadb/portfile.cmake index e6ccfa5084..ebca3d7f3b 100644 --- a/ports/libmariadb/portfile.cmake +++ b/ports/libmariadb/portfile.cmake @@ -1,77 +1,63 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mariadb-connector-c-2.3.1) - -if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql.h") - message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.") -endif() - -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/MariaDB/mariadb-connector-c/archive/v2.3.1.tar.gz" - FILENAME "mariadb-connector-c-2.3.1.tar.gz" - SHA512 d82f8348201d41dce6820c952a0503a5154c4e9c06feb471fe451a6fb968e5cff04423a64183cbb8e159a1b4e7265c12b5b7aef912f633395d9f1b0436fbfd2d -) -vcpkg_extract_source_archive(${ARCHIVE}) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} -) - -vcpkg_install_cmake() - -# remove debug header -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -# fix libmariadb lib & dll directory. -file(MAKE_DIRECTORY - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/bin) -file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/mariadb/libmariadb.dll - ${CURRENT_PACKAGES_DIR}/bin/libmariadb.dll) -file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/libmariadb.dll - ${CURRENT_PACKAGES_DIR}/debug/bin/libmariadb.dll) -file(RENAME - ${CURRENT_PACKAGES_DIR}/lib/mariadb/libmariadb.lib - ${CURRENT_PACKAGES_DIR}/lib/libmariadb.lib) -file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/libmariadb.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/libmariadb.lib) -file(REMOVE - ${CURRENT_PACKAGES_DIR}/lib/mariadb/mariadbclient.lib - ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/mariadbclient.lib) - -# remove plugin folder -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/lib/plugin - ${CURRENT_PACKAGES_DIR}/debug/lib/plugin - ${CURRENT_PACKAGES_DIR}/lib/mariadb - ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb) - -# copy & remove header files -file(GLOB HEADER_FILES ${CURRENT_PACKAGES_DIR}/include/mariadb/*) -file(COPY ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/mariadb) -file(REMOVE - ${CURRENT_PACKAGES_DIR}/include/config-win.h - ${CURRENT_PACKAGES_DIR}/include/dbug.h - ${CURRENT_PACKAGES_DIR}/include/errmsg.h - ${CURRENT_PACKAGES_DIR}/include/getopt.h - ${CURRENT_PACKAGES_DIR}/include/hash.h - ${CURRENT_PACKAGES_DIR}/include/ma_common.h - ${CURRENT_PACKAGES_DIR}/include/ma_dyncol.h - ${CURRENT_PACKAGES_DIR}/include/sha1.h - ${CURRENT_PACKAGES_DIR}/include/thr_alarm.h - ${CURRENT_PACKAGES_DIR}/include/violite.h - ${CURRENT_PACKAGES_DIR}/include/mysql_version.h.in - ${CURRENT_PACKAGES_DIR}/include/my_config.h.in - ${CURRENT_PACKAGES_DIR}/include/CMakeLists.txt - ${CURRENT_PACKAGES_DIR}/include/Makefile.am) - -# copy license file -file(COPY ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmariadb) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmariadb/COPYING.LIB ${CURRENT_PACKAGES_DIR}/share/libmariadb/copyright) \ No newline at end of file +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mariadb-connector-c-2.3.2) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/MariaDB/mariadb-connector-c/archive/v2.3.2.tar.gz" + FILENAME "mariadb-connector-c-2.3.2.tar.gz" + SHA512 f5574756ffce69e3dd15b7f7c14cfd0b4d69e3203ae4b383f05a110918916279ba7c0b9149d0dcb9ec93bbfc0927dfaf88bb40979ba1de710ce148d1fbe033af +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} +) + +vcpkg_install_cmake() + +# remove debug header +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# fix libmariadb lib & dll directory. +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mariadb/mariadbclient.lib + ${CURRENT_PACKAGES_DIR}/lib/mariadbclient.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/mariadbclient.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadbclient.lib) +else() + file(MAKE_DIRECTORY + ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/debug/bin) + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mariadb/libmariadb.dll + ${CURRENT_PACKAGES_DIR}/bin/libmariadb.dll) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/libmariadb.dll + ${CURRENT_PACKAGES_DIR}/debug/bin/libmariadb.dll) + file(RENAME + ${CURRENT_PACKAGES_DIR}/lib/mariadb/libmariadb.lib + ${CURRENT_PACKAGES_DIR}/lib/libmariadb.lib) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb/libmariadb.lib + ${CURRENT_PACKAGES_DIR}/debug/lib/libmariadb.lib) +endif() + +# remove plugin folder +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/lib/plugin + ${CURRENT_PACKAGES_DIR}/debug/lib/plugin + ${CURRENT_PACKAGES_DIR}/lib/mariadb + ${CURRENT_PACKAGES_DIR}/debug/lib/mariadb) + +# copy & remove header files +file(GLOB HEADER_FILES ${CURRENT_PACKAGES_DIR}/include/mariadb/*) +file(REMOVE + ${CURRENT_PACKAGES_DIR}/include/mariadb/my_config.h.in + ${CURRENT_PACKAGES_DIR}/include/mariadb/mysql_version.h.in + ${CURRENT_PACKAGES_DIR}/include/mariadb/CMakeLists.txt + ${CURRENT_PACKAGES_DIR}/include/mariadb/Makefile.am) + +# copy license file +file(COPY ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmariadb) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libmariadb/COPYING.LIB ${CURRENT_PACKAGES_DIR}/share/libmariadb/copyright) From 1380525e5f92fb0ff576a98343238389dfdd7fad Mon Sep 17 00:00:00 2001 From: codicodi Date: Fri, 20 Jan 2017 13:38:56 +0100 Subject: [PATCH 126/561] [fontconfig] install additional license --- ports/fontconfig/portfile.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ports/fontconfig/portfile.cmake b/ports/fontconfig/portfile.cmake index 06bff2aa01..8755ad7338 100644 --- a/ports/fontconfig/portfile.cmake +++ b/ports/fontconfig/portfile.cmake @@ -6,12 +6,15 @@ vcpkg_download_distfile(ARCHIVE FILENAME "fontconfig-2.12.1.tar.gz" SHA512 0959a80522e09551e49ec7b2383b7dfb319d4e1c058ad0b55bb35d3f675acbb7ff08c9c30a8798b731070687f84dd3d2ff7e28aafac6ecfa9d3f85c5847c0955) -# Download single-header implementation of dirent API for Windows. +# Download single-header implementation of dirent API for Windows and it's license vcpkg_download_distfile(DIRENT_H URLS "https://raw.githubusercontent.com/tronkko/dirent/8b1db5092479a73d47eafd3de739b27e876e6bf3/include/dirent.h" FILENAME "fontconfig-dirent.h" SHA512 dc9e63fd9cf4ccffdc052f92933633ef9d09dfcfe3b1d15f1f32c99349babd36a62d02283e3d8ba7766d92817be015eb211f11efc4fa52cc90d532a34d1ae785) - +vcpkg_download_distfile(DIRENT_LICENSE + URLS "https://raw.githubusercontent.com/tronkko/dirent/8b1db5092479a73d47eafd3de739b27e876e6bf3/LICENSE" + FILENAME "fontconfig-dirent-license" + SHA512 58c294f80b679252dbee9687ff6bda660fe1ed6f94506e1b9edc19358de98b274b25b3697bdcd34becb28a4f186c6d321a16ab616164e2fb378b37357fc71e4f) vcpkg_extract_source_archive(${ARCHIVE}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -32,3 +35,5 @@ vcpkg_copy_pdbs() file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fontconfig) file(RENAME ${CURRENT_PACKAGES_DIR}/share/fontconfig/COPYING ${CURRENT_PACKAGES_DIR}/share/fontconfig/copyright) +file(COPY ${DIRENT_LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/fontconfig) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/fontconfig/fontconfig-dirent-license ${CURRENT_PACKAGES_DIR}/share/fontconfig/dirent-for-vs-copyright) From a5b381f1789014db0b9030dddbf82c94799fecca Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 20 Jan 2017 14:38:14 -0800 Subject: [PATCH 127/561] [libmysql] Create bin\ and debug\bin\ directories (also make identation consistent) --- ports/libmysql/portfile.cmake | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index 2a7f7f33d0..592482544f 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -2,20 +2,20 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mysql-server-mysql-5.7.17) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/mysql/mysql-server/archive/mysql-5.7.17.tar.gz" - FILENAME "mysql-server-mysql-5.7.17.tar.gz" - SHA512 511027f28f0705f59a08ec369b1ebe5d9a77eb839d545898631f1ebbcb6b4b800f5b88511d3ae5d231c04e09a2d7b2b2d178264d36aeb2bc602cc1b0b248cfba + URLS "https://github.com/mysql/mysql-server/archive/mysql-5.7.17.tar.gz" + FILENAME "mysql-server-mysql-5.7.17.tar.gz" + SHA512 511027f28f0705f59a08ec369b1ebe5d9a77eb839d545898631f1ebbcb6b4b800f5b88511d3ae5d231c04e09a2d7b2b2d178264d36aeb2bc602cc1b0b248cfba ) vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES + SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/boost_and_build.patch ) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH ${SOURCE_PATH} OPTIONS -DWITHOUT_SERVER=ON -DWITH_UNIT_TESTS=OFF @@ -51,12 +51,12 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/README) # remove not-related libs -file (REMOVE - ${CURRENT_PACKAGES_DIR}/lib/mysqlservices.lib +file (REMOVE + ${CURRENT_PACKAGES_DIR}/lib/mysqlservices.lib ${CURRENT_PACKAGES_DIR}/debug/lib/mysqlservices.lib) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libmysql.lib ${CURRENT_PACKAGES_DIR}/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb @@ -67,8 +67,10 @@ else() file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mysqlclient.lib ${CURRENT_PACKAGES_DIR}/debug/lib/mysqlclient.lib) - + # correct the dll directory + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/bin/libmysql.dll) file (RENAME ${CURRENT_PACKAGES_DIR}/lib/libmysql.pdb ${CURRENT_PACKAGES_DIR}/bin/libmysql.pdb) file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libmysql.dll ${CURRENT_PACKAGES_DIR}/debug/bin/libmysql.dll) From 83dcda1e11ae12c9e56c7e4664f6d7f64f961ee6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 20 Jan 2017 14:47:06 -0800 Subject: [PATCH 128/561] [lzo] Fix compiler error. Add support for non-static triplets. --- ports/lzo/do-not-declare-setargv.patch | 17 +++++++++++++++++ ports/lzo/portfile.cmake | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 ports/lzo/do-not-declare-setargv.patch diff --git a/ports/lzo/do-not-declare-setargv.patch b/ports/lzo/do-not-declare-setargv.patch new file mode 100644 index 0000000000..48ae315142 --- /dev/null +++ b/ports/lzo/do-not-declare-setargv.patch @@ -0,0 +1,17 @@ +diff --git a/src/lzo_supp.h b/src/lzo_supp.h +index 87307f9..f94a6b0 100644 +--- a/src/lzo_supp.h ++++ b/src/lzo_supp.h +@@ -3643,9 +3643,9 @@ LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); } + #endif + #if (LZO_OS_WIN32 || LZO_OS_WIN64) + #if (LZO_CC_INTELC || LZO_CC_MSC) +-LZO_EXTERN_C int __lzo_cdecl __setargv(void); +-LZO_EXTERN_C int __lzo_cdecl _setargv(void); +-LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); } ++// LZO_EXTERN_C int __lzo_cdecl __setargv(void); ++// LZO_EXTERN_C int __lzo_cdecl _setargv(void); ++// LZO_EXTERN_C int __lzo_cdecl _setargv(void) { return __setargv(); } + #endif + #endif + #if (LZO_OS_EMX) diff --git a/ports/lzo/portfile.cmake b/ports/lzo/portfile.cmake index a8a91e5e50..227ef7ee05 100644 --- a/ports/lzo/portfile.cmake +++ b/ports/lzo/portfile.cmake @@ -15,8 +15,24 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/do-not-declare-setargv.patch" +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(ENABLE_STATIC ON) + set(ENABLE_SHARED OFF) +else() + set(ENABLE_STATIC OFF) + set(ENABLE_SHARED ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DENABLE_STATIC=${ENABLE_STATIC} + -DENABLE_SHARED=${ENABLE_SHARED} # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1 From ed8e7ca79dad5b7bcf716efe25d975571e8e8c05 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 20 Jan 2017 17:03:11 -0800 Subject: [PATCH 129/561] [lzo] Disable dynamic builds again due to library not having appropriate dllexport annotations. --- ports/lzo/portfile.cmake | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/ports/lzo/portfile.cmake b/ports/lzo/portfile.cmake index 227ef7ee05..6df36269ce 100644 --- a/ports/lzo/portfile.cmake +++ b/ports/lzo/portfile.cmake @@ -6,6 +6,11 @@ # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} # +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) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lzo-2.09) vcpkg_download_distfile(ARCHIVE @@ -20,19 +25,8 @@ vcpkg_apply_patches( PATCHES "${CMAKE_CURRENT_LIST_DIR}/do-not-declare-setargv.patch" ) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - set(ENABLE_STATIC ON) - set(ENABLE_SHARED OFF) -else() - set(ENABLE_STATIC OFF) - set(ENABLE_SHARED ON) -endif() - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DENABLE_STATIC=${ENABLE_STATIC} - -DENABLE_SHARED=${ENABLE_SHARED} # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1 @@ -40,6 +34,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +vcpkg_copy_pdbs() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) From 919d8ea1ec449e17262c86838b2e74c44b695dea Mon Sep 17 00:00:00 2001 From: flysha Date: Mon, 23 Jan 2017 21:49:13 +0800 Subject: [PATCH 130/561] [mpir] enable static build --- ports/mpir/CONTROL | 4 +- ports/mpir/portfile.cmake | 126 ++++++++++++++++++++++---------------- 2 files changed, 75 insertions(+), 55 deletions(-) diff --git a/ports/mpir/CONTROL b/ports/mpir/CONTROL index 6d8646f93e..0a1f1601ba 100644 --- a/ports/mpir/CONTROL +++ b/ports/mpir/CONTROL @@ -1,3 +1,3 @@ -Source: mpir -Version: 2.7.2 +Source: mpir +Version: 2.7.2-1 Description: Multiple Precision Integers and Rationals. \ No newline at end of file diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index a3a704407a..a57c53328a 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -1,53 +1,73 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpir-2.7.2) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://mpir.org/mpir-2.7.2.tar.lz" - FILENAME "mpir-2.7.2.tar.lz" - SHA512 2635c167ddbba99364ec741373768e0675d34f94fad8912d5433b95e6fbfdb0510f5e94a707acc42048254bc658c52c6671bb0c0dac31267c4b82b00c3e74efa -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) - -vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/build.vc14/dll_mpir_gc/dll_mpir_gc.vcxproj -) - -IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") - SET(BUILD_ARCH "Win32") -ELSE() - SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) -ENDIF() - -file(INSTALL - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/gmp.h - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/gmpxx.h - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.h - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpirxx.h - DESTINATION ${CURRENT_PACKAGES_DIR}/include -) -file(INSTALL - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.dll - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin -) -file(INSTALL - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.dll - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/bin -) -file(INSTALL - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib -) -file(INSTALL - ${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib -) - -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpir RENAME copyright) - -vcpkg_copy_pdbs() -message(STATUS "Installing done") +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpir-2.7.2) +vcpkg_download_distfile(ARCHIVE_FILE + URLS "http://mpir.org/mpir-2.7.2.tar.bz2" + FILENAME "mpir-2.7.2.tar.bz2" + SHA512 8436a0123201f9e30130ea340331c5a6445dddb58ce1f6c6a3a8303c310ac5b3c279c83b5c520a757cba82c2b14e92da44583e0eec287090cf69cbb29d516a9c +) +vcpkg_extract_source_archive(${ARCHIVE_FILE}) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/build.vc14/dll_mpir_gc/dll_mpir_gc.vcxproj + ) +else() + vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/build.vc14/lib_mpir_gc/lib_mpir_gc.vcxproj + ) +endif() + +IF (TRIPLET_SYSTEM_ARCH MATCHES "x86") + SET(BUILD_ARCH "Win32") +ELSE() + SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +ENDIF() + +if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file(INSTALL + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/gmp.h + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/gmpxx.h + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.h + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpirxx.h + DESTINATION ${CURRENT_PACKAGES_DIR}/include + ) + file(INSTALL + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.dll + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin + ) + file(INSTALL + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.dll + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/bin + ) + file(INSTALL + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + ) + file(INSTALL + ${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + ) + file(INSTALL ${SOURCE_PATH}/COPYING.lib DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpir RENAME copyright) + vcpkg_copy_pdbs() +else() + file(INSTALL + ${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/gmp.h + ${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/gmpxx.h + ${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/mpir.h + ${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/mpirxx.h + DESTINATION ${CURRENT_PACKAGES_DIR}/include + ) + file(INSTALL + ${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/mpir.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + ) + file(INSTALL + ${SOURCE_PATH}/lib/${BUILD_ARCH}/Release/mpir.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib + ) + file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpir RENAME copyright) +endif() + +message(STATUS "Installing done") From bb639bfa9c0b21fd7fa5dac3531657a03fbb2b7b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 12:53:18 -0800 Subject: [PATCH 131/561] [VS2017] Add powershell script to enumerator VS2017 instances --- .../findVisualStudioInstallationInstances.ps1 | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 scripts/findVisualStudioInstallationInstances.ps1 diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 new file mode 100644 index 0000000000..1cb78fa9e2 --- /dev/null +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -0,0 +1,41 @@ +[CmdletBinding()] +param( + +) + +Import-Module BitsTransfer + +$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition +$vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root + +$downloadsDir = "$vcpkgRootDir\downloads" + +& $scriptsDir\fetchDependency.ps1 "nuget" +$nugetexe = "$downloadsDir\nuget.exe" +$nugetPackageDir = "$downloadsDir\nuget-packages" + +$SetupAPIVersion = "1.3.269-rc" +$url = "https://api.nuget.org/packages/microsoft.visualstudio.setup.configuration.native.$SetupAPIVersion.nupkg" +$downloadName = "microsoft.visualstudio.setup.configuration.native.$SetupAPIVersion.nupkg" +$downloadPath = "$downloadsDir\$downloadName" + +if (!(Test-Path $downloadPath)) +{ + Start-BitsTransfer -Source $url -Destination $downloadPath #-ErrorAction SilentlyContinue +} + +$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Pre -Source $downloadsDir -OutputDirectory $nugetPackageDir 2>&1 + +$SetupConsoleExe = "$nugetPackageDir\Microsoft.VisualStudio.Setup.Configuration.Native.$SetupAPIVersion\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Console.exe" + +if (!(Test-Path $SetupConsoleExe)) +{ + throw $nugetOutput +} + +$consoleOutput = & $SetupConsoleExe 2>&1 + +$key = "InstallationPath = " +$paths = $consoleOutput | Select-String -SimpleMatch $key +$paths = $paths -replace $key, "" +return $paths \ No newline at end of file From e6c127511e213a136cd01a40ced59a2b12015428 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 12:54:03 -0800 Subject: [PATCH 132/561] [VS2017] Add powershell script to find any MSBuild with C++ support --- .../findAnyMSBuildWithCppPlatformToolset.ps1 | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 scripts/findAnyMSBuildWithCppPlatformToolset.ps1 diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 new file mode 100644 index 0000000000..1be4a4e6d2 --- /dev/null +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -0,0 +1,32 @@ +[CmdletBinding()] +param( + +) + +$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition + +# VS2017 +$VisualStudio2017InstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 +foreach ($instance in $VisualStudio2017InstallationInstances) +{ + $VCFolder= "$instance\VC\Tools\MSVC\" + + if (Test-Path $VCFolder) + { + return "$instance\MSBuild\15.0\Bin\MSBuild.exe","v141" + } +} + +# VS2015 +$CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}" +foreach ($ProgramFiles in $CandidateProgramFiles) +{ + $clExe= "$ProgramFiles\Microsoft Visual Studio 14.0\\VC\bin\cl.exe" + + if (Test-Path $clExe) + { + return "$ProgramFiles\MSBuild\14.0\Bin\MSBuild.exe","v140" + } +} + +throw "Could not find MSBuild with C++ support. VS2015 or above with C++ support need to be installed." \ No newline at end of file From 58aeb684429f107715a1b60500f8e24ea5a95f3c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 12:54:33 -0800 Subject: [PATCH 133/561] [VS2017] Enable building vcpkg itself with VS2017 --- scripts/bootstrap.ps1 | 5 ++++- toolsrc/vcpkg/vcpkg.vcxproj | 5 +---- toolsrc/vcpkgcommon/vcpkgcommon.vcxproj | 5 +---- toolsrc/vcpkglib/vcpkglib.vcxproj | 5 +---- toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj | 5 +---- toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj | 5 +---- toolsrc/vcpkgtest/vcpkgtest.vcxproj | 5 +---- 7 files changed, 10 insertions(+), 25 deletions(-) diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index bcb570b398..a37ed99aad 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -23,7 +23,10 @@ if (!(Test-Path $vcpkgSourcesPath)) try{ pushd $vcpkgSourcesPath - cmd /c "$env:VS140COMNTOOLS..\..\VC\vcvarsall.bat" x86 "&" msbuild "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /m + $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 + $msbuildExe = $msbuildExeWithPlatformToolset[0] + $platformToolset = $msbuildExeWithPlatformToolset[1] + & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /m Write-Verbose("Placing vcpkg.exe in the correct location") diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index bcec048f59..15673e0487 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -22,31 +22,28 @@ {34671B80-54F9-46F5-8310-AC429C11D4FB} vcpkg 8.1 + v140 Application true - v140 MultiByte Application false - v140 true MultiByte Application true - v140 MultiByte Application false - v140 true MultiByte diff --git a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj index c0d1086022..2504a0227d 100644 --- a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj +++ b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj @@ -22,31 +22,28 @@ {7129F242-F20C-43E7-BBEC-4E15B71890B2} vcpkgcommon 8.1 + v140 StaticLibrary true - v140 MultiByte StaticLibrary false - v140 true MultiByte StaticLibrary true - v140 MultiByte StaticLibrary false - v140 true MultiByte diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 10cc329358..561b224772 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -22,31 +22,28 @@ {B98C92B7-2874-4537-9D46-D14E5C237F04} vcpkglib 8.1 + v140 StaticLibrary true - v140 MultiByte StaticLibrary false - v140 true MultiByte StaticLibrary true - v140 MultiByte StaticLibrary false - v140 true MultiByte diff --git a/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj b/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj index 7b7fe89edd..66cf522325 100644 --- a/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj +++ b/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj @@ -22,31 +22,28 @@ {7226078C-1D2A-4123-9EF1-8DF2B722B8F1} vcpkgmetrics 8.1 + v140 StaticLibrary true - v140 MultiByte StaticLibrary false - v140 true MultiByte StaticLibrary true - v140 MultiByte StaticLibrary false - v140 true MultiByte diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index 1e2a850877..dc666c19ed 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -22,31 +22,28 @@ {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE} vcpkgmetricsuploader 8.1 + v140 Application true - v140 MultiByte Application false - v140 true MultiByte Application true - v140 MultiByte Application false - v140 true MultiByte diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index d14f86745a..a68d77b461 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -38,19 +38,18 @@ Win32Proj vcpkgtest 8.1 + v140 DynamicLibrary true - v140 Unicode false DynamicLibrary false - v140 true Unicode false @@ -58,14 +57,12 @@ DynamicLibrary true - v140 Unicode false DynamicLibrary false - v140 true Unicode false From 6d3ab4579d50f74cbe43373fa16ba875a97a8717 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:12:43 -0800 Subject: [PATCH 134/561] [vcpkg_paths] Add "scripts" entry --- toolsrc/include/vcpkg_paths.h | 1 + toolsrc/src/vcpkg_paths.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/toolsrc/include/vcpkg_paths.h b/toolsrc/include/vcpkg_paths.h index a2932070d5..ba6defb9f2 100644 --- a/toolsrc/include/vcpkg_paths.h +++ b/toolsrc/include/vcpkg_paths.h @@ -24,6 +24,7 @@ namespace vcpkg fs::path ports; fs::path installed; fs::path triplets; + fs::path scripts; fs::path buildsystems; fs::path buildsystems_msbuild_targets; diff --git a/toolsrc/src/vcpkg_paths.cpp b/toolsrc/src/vcpkg_paths.cpp index b7e716307d..39e4c8986a 100644 --- a/toolsrc/src/vcpkg_paths.cpp +++ b/toolsrc/src/vcpkg_paths.cpp @@ -31,8 +31,9 @@ namespace vcpkg paths.ports = paths.root / "ports"; paths.installed = paths.root / "installed"; paths.triplets = paths.root / "triplets"; + paths.scripts = paths.root / "scripts"; - paths.buildsystems = paths.root / "scripts" / "buildsystems"; + paths.buildsystems = paths.scripts / "buildsystems"; paths.buildsystems_msbuild_targets = paths.buildsystems / "msbuild" / "vcpkg.targets"; paths.vcpkg_dir = paths.installed / "vcpkg"; @@ -40,7 +41,7 @@ namespace vcpkg paths.vcpkg_dir_info = paths.vcpkg_dir / "info"; paths.vcpkg_dir_updates = paths.vcpkg_dir / "updates"; - paths.ports_cmake = paths.root / "scripts" / "ports.cmake"; + paths.ports_cmake = paths.scripts / "ports.cmake"; return paths; } From 3a6571a0191df8ff000384937a6254f378ca23cf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:13:12 -0800 Subject: [PATCH 135/561] Add Strings::split() function --- toolsrc/include/vcpkg_Strings.h | 2 ++ toolsrc/src/vcpkg_Strings.cpp | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 28853cb5d5..cb5d2334cc 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -75,4 +75,6 @@ namespace vcpkg::Strings std::string trimmed(const std::string& s); void trim_all_and_remove_whitespace_strings(std::vector* strings); + + std::vector split(const std::string& s, const std::string& delimiter); } diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index cf7d3b0eec..16477a45ca 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -119,4 +119,25 @@ namespace vcpkg::Strings return s == ""; }), strings->end()); } + + std::vector split(const std::string& s, const std::string& delimiter) + { + std::vector output; + + size_t i = 0; + size_t pos = s.find(delimiter); + while (pos != std::string::npos) + { + output.push_back(s.substr(i, pos - i)); + i = ++pos; + pos = s.find(delimiter, pos); + + if (pos == std::string::npos) + { + output.push_back(s.substr(i, s.length())); + } + } + + return output; + } } From 79a00367390dd974170b3abb5ad357d3db8ff5e3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:15:26 -0800 Subject: [PATCH 136/561] [VS2017] Add function do get dumpbin.exe --- toolsrc/include/vcpkg_Environment.h | 2 ++ toolsrc/src/vcpkg_Environment.cpp | 50 +++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index 1e8624d899..64b2315b91 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -14,4 +14,6 @@ namespace vcpkg::Environment ensure_cmake_on_path(paths); ensure_git_on_path(paths); } + + const fs::path& get_dumpbin_exe(const vcpkg_paths& paths); } diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index c7eec3bd08..1cbd60341d 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -4,6 +4,7 @@ #include "vcpkg_Commands.h" #include "metrics.h" #include "vcpkg_System.h" +#include "vcpkg_Strings.h" namespace vcpkg::Environment { @@ -83,4 +84,53 @@ namespace vcpkg::Environment // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned ensure_on_path(nuget_version, L"nuget 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency nuget"); } + + static std::vector get_VS2017_installation_instances(const vcpkg_paths& paths) + { + const fs::path script = paths.scripts / "findVisualStudioInstallationInstances.ps1"; + const std::wstring cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s", script.native()); + System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd); + Checks::check_exit(ec_data.exit_code == 0, "Could not run script to detect VS 2017 instances"); + return Strings::split(ec_data.output, "\n"); + } + + static fs::path find_dumpbin_exe(const vcpkg_paths& paths) + { + const std::vector vs2017_installation_instances = get_VS2017_installation_instances(paths); + std::vector paths_examined; + + // VS2017 + for (const std::string& instance : vs2017_installation_instances) + { + const fs::path dumpbin_path = Strings::format(R"(%s\VC\Tools\MSVC\14.10.24911\bin\HostX86\x86\dumpbin.exe)", instance); + paths_examined.push_back(dumpbin_path); + if (fs::exists(dumpbin_path)) + { + return dumpbin_path; + } + } + + // VS2015 + const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // TODO: Check why this requires parent_path() call + const fs::path vs2015_dumpbin_exe = vs2015_cmntools.parent_path().parent_path() / "VC" / "bin" / "dumpbin.exe"; + paths_examined.push_back(vs2015_dumpbin_exe); + if (fs::exists(vs2015_dumpbin_exe)) + { + return vs2015_dumpbin_exe; + } + + System::println(System::color::error, "Could not detect dumpbin.exe."); + System::println("The following paths were examined:"); + for (const fs::path& path : paths_examined) + { + System::println(path.generic_string()); + } + exit(EXIT_FAILURE); + } + + const fs::path& get_dumpbin_exe(const vcpkg_paths& paths) + { + static const fs::path dumpbin_exe = find_dumpbin_exe(paths); + return dumpbin_exe; + } } From 9194f36a6c3ac873ca13a4be11745968ae1e263e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:24:31 -0800 Subject: [PATCH 137/561] [VS2017] Use Environment::get_dumpbin_exe() --- toolsrc/src/post_build_lint.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 1fca3a2f68..af76b79635 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -3,6 +3,7 @@ #include "vcpkg_Files.h" #include #include "vcpkg_System.h" +#include "vcpkg_Environment.h" #include "coff_file_reader.h" #include "BuildInfo.h" #include @@ -15,8 +16,6 @@ namespace vcpkg::PostBuildLint ERROR_DETECTED = 1 }; - static const fs::path DUMPBIN_EXE = R"(%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe)"; - static lint_status check_for_files_in_include_directory(const fs::path& package_dir) { const fs::path include_dir = package_dir / "include"; @@ -185,12 +184,12 @@ namespace vcpkg::PostBuildLint return lint_status::SUCCESS; } - static lint_status check_exports_of_dlls(const std::vector& dlls) + static lint_status check_exports_of_dlls(const std::vector& dlls, const fs::path& dumpbin_exe) { std::vector dlls_with_no_exports; for (const fs::path& dll : dlls) { - const std::wstring cmd_line = Strings::wformat(LR"("%s" /exports "%s")", DUMPBIN_EXE.native(), dll.native()); + const std::wstring cmd_line = Strings::wformat(LR"("%s" /exports "%s")", dumpbin_exe.native(), dll.native()); System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); @@ -211,7 +210,7 @@ namespace vcpkg::PostBuildLint return lint_status::SUCCESS; } - static lint_status check_uwp_bit_of_dlls(const std::string& expected_system_name, const std::vector& dlls) + static lint_status check_uwp_bit_of_dlls(const std::string& expected_system_name, const std::vector& dlls, const fs::path dumpbin_exe) { if (expected_system_name != "uwp") { @@ -221,7 +220,7 @@ namespace vcpkg::PostBuildLint std::vector dlls_with_improper_uwp_bit; for (const fs::path& dll : dlls) { - const std::wstring cmd_line = Strings::wformat(LR"("%s" /headers "%s")", DUMPBIN_EXE.native(), dll.native()); + const std::wstring cmd_line = Strings::wformat(LR"("%s" /headers "%s")", dumpbin_exe.native(), dll.native()); System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); @@ -459,7 +458,7 @@ namespace vcpkg::PostBuildLint BuildType build_type; }; - static lint_status check_crt_linkage_of_libs(const BuildType& expected_build_type, const std::vector& libs) + static lint_status check_crt_linkage_of_libs(const BuildType& expected_build_type, const std::vector& libs, const fs::path dumpbin_exe) { std::vector bad_build_types = BuildType::values(); bad_build_types.erase(std::remove(bad_build_types.begin(), bad_build_types.end(), expected_build_type), bad_build_types.end()); @@ -468,7 +467,7 @@ namespace vcpkg::PostBuildLint for (const fs::path& lib : libs) { - const std::wstring cmd_line = Strings::wformat(LR"("%s" /directives "%s")", DUMPBIN_EXE.native(), lib.native()); + const std::wstring cmd_line = Strings::wformat(LR"("%s" /directives "%s")", dumpbin_exe.native(), lib.native()); System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); @@ -505,7 +504,7 @@ namespace vcpkg::PostBuildLint OutdatedDynamicCrt outdated_crt; }; - static lint_status check_outdated_crt_linkage_of_dlls(const std::vector& dlls) + static lint_status check_outdated_crt_linkage_of_dlls(const std::vector& dlls, const fs::path dumpbin_exe) { const std::vector& outdated_crts = OutdatedDynamicCrt::values(); @@ -513,7 +512,7 @@ namespace vcpkg::PostBuildLint for (const fs::path& dll : dlls) { - const std::wstring cmd_line = Strings::wformat(LR"("%s" /dependents "%s")", DUMPBIN_EXE.native(), dll.native()); + const std::wstring cmd_line = Strings::wformat(LR"("%s" /dependents "%s")", dumpbin_exe.native(), dll.native()); System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); @@ -575,6 +574,8 @@ namespace vcpkg::PostBuildLint void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths) { + const fs::path dumpbin_exe = Environment::get_dumpbin_exe(paths); + System::println("-- Performing post-build validation"); BuildInfo build_info = read_build_info(paths.build_info_file_path(spec)); @@ -623,11 +624,11 @@ namespace vcpkg::PostBuildLint dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); - error_count += check_exports_of_dlls(dlls); - error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls); + error_count += check_exports_of_dlls(dlls, dumpbin_exe); + error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); - error_count += check_outdated_crt_linkage_of_dlls(dlls); + error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); break; } case LinkageType::STATIC: @@ -638,8 +639,8 @@ namespace vcpkg::PostBuildLint error_count += check_bin_folders_are_not_present_in_static_build(package_dir); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); break; } case LinkageType::UNKNOWN: From 50d5e12390636137fedc1472872a4ae777bf1b2c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:30:04 -0800 Subject: [PATCH 138/561] [VS2017] Extract function that detects the VS2015 instance, when no VS2017 is found --- toolsrc/src/vcpkg_Environment.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 1cbd60341d..00f7206e37 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -94,6 +94,13 @@ namespace vcpkg::Environment return Strings::split(ec_data.output, "\n"); } + static const fs::path& get_VS2015_installation_instance() + { + static const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // TODO: Check why this requires parent_path() call + static const fs::path vs2015_path = vs2015_cmntools.parent_path().parent_path(); + return vs2015_path; + } + static fs::path find_dumpbin_exe(const vcpkg_paths& paths) { const std::vector vs2017_installation_instances = get_VS2017_installation_instances(paths); @@ -111,8 +118,7 @@ namespace vcpkg::Environment } // VS2015 - const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // TODO: Check why this requires parent_path() call - const fs::path vs2015_dumpbin_exe = vs2015_cmntools.parent_path().parent_path() / "VC" / "bin" / "dumpbin.exe"; + const fs::path vs2015_dumpbin_exe = get_VS2015_installation_instance() / "VC" / "bin" / "dumpbin.exe"; paths_examined.push_back(vs2015_dumpbin_exe); if (fs::exists(vs2015_dumpbin_exe)) { From 691f337bb3e56487911615a14cd06c86c029eb4b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:48:54 -0800 Subject: [PATCH 139/561] [VS2017] Don't depend on a specific MSVC dir name --- toolsrc/src/vcpkg_Environment.cpp | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 00f7206e37..0f4d4b60a3 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -5,6 +5,7 @@ #include "metrics.h" #include "vcpkg_System.h" #include "vcpkg_Strings.h" +#include "vcpkg_Files.h" namespace vcpkg::Environment { @@ -109,11 +110,29 @@ namespace vcpkg::Environment // VS2017 for (const std::string& instance : vs2017_installation_instances) { - const fs::path dumpbin_path = Strings::format(R"(%s\VC\Tools\MSVC\14.10.24911\bin\HostX86\x86\dumpbin.exe)", instance); - paths_examined.push_back(dumpbin_path); - if (fs::exists(dumpbin_path)) + const fs::path msvc_path = Strings::format(R"(%s\VC\Tools\MSVC)", instance); + std::vector msvc_subdirectories; + Files::non_recursive_find_matching_paths_in_dir(msvc_path, [&](const fs::path& current) { - return dumpbin_path; + return fs::is_directory(current); + }, &msvc_subdirectories); + + Checks::check_exit(!msvc_subdirectories.empty(), "No subdirectories were found in %s", msvc_path.generic_string()); + + // Sort them so that latest comes first + std::sort(msvc_subdirectories.begin(), msvc_subdirectories.end(), [&](const fs::path& left, const fs::path& right) + { + return left.filename() > right.filename(); + }); + + for (const fs::path& subdir : msvc_subdirectories) + { + const fs::path dumpbin_path = Strings::format(R"(%s\bin\HostX86\x86\dumpbin.exe)", subdir.generic_string()); + paths_examined.push_back(dumpbin_path); + if (fs::exists(dumpbin_path)) + { + return dumpbin_path; + } } } From c1aca5d4adfe0fedd4636ffb488c6f22bbb33f81 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:02:02 -0800 Subject: [PATCH 140/561] Build path throuh fs::path APIs instead of Strings::format() --- toolsrc/src/vcpkg_Environment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 0f4d4b60a3..f6bcd3088c 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -127,7 +127,7 @@ namespace vcpkg::Environment for (const fs::path& subdir : msvc_subdirectories) { - const fs::path dumpbin_path = Strings::format(R"(%s\bin\HostX86\x86\dumpbin.exe)", subdir.generic_string()); + const fs::path dumpbin_path = subdir / "bin" / "HostX86" / "x86" / "dumpbin.exe"; paths_examined.push_back(dumpbin_path); if (fs::exists(dumpbin_path)) { From a532b949073a14303cf3092d6b8d83a9e4ee8577 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:04:43 -0800 Subject: [PATCH 141/561] Formatting --- toolsrc/src/vcpkg_Environment.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index f6bcd3088c..3efcfb872f 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -113,17 +113,17 @@ namespace vcpkg::Environment const fs::path msvc_path = Strings::format(R"(%s\VC\Tools\MSVC)", instance); std::vector msvc_subdirectories; Files::non_recursive_find_matching_paths_in_dir(msvc_path, [&](const fs::path& current) - { - return fs::is_directory(current); - }, &msvc_subdirectories); + { + return fs::is_directory(current); + }, &msvc_subdirectories); Checks::check_exit(!msvc_subdirectories.empty(), "No subdirectories were found in %s", msvc_path.generic_string()); // Sort them so that latest comes first std::sort(msvc_subdirectories.begin(), msvc_subdirectories.end(), [&](const fs::path& left, const fs::path& right) - { - return left.filename() > right.filename(); - }); + { + return left.filename() > right.filename(); + }); for (const fs::path& subdir : msvc_subdirectories) { From e0e3f6ac21d074b0c043e9d6a2aff769930f07a7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:15:30 -0800 Subject: [PATCH 142/561] [VS2017] Add function to get vcvarsall.bat --- toolsrc/include/vcpkg_Environment.h | 2 ++ toolsrc/src/vcpkg_Environment.cpp | 39 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index 64b2315b91..9161f7ce53 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -16,4 +16,6 @@ namespace vcpkg::Environment } const fs::path& get_dumpbin_exe(const vcpkg_paths& paths); + + const fs::path& get_vcvarsall_bat(const vcpkg_paths& paths); } diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 3efcfb872f..54541bd456 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -158,4 +158,43 @@ namespace vcpkg::Environment static const fs::path dumpbin_exe = find_dumpbin_exe(paths); return dumpbin_exe; } + + static fs::path find_vcvarsall_bat(const vcpkg_paths& paths) + { + const std::vector vs2017_installation_instances = get_VS2017_installation_instances(paths); + std::vector paths_examined; + + // VS2017 + for (const fs::path& instance : vs2017_installation_instances) + { + const fs::path vcvarsall_bat = instance / "VC" / "Auxiliary" / "Build" / "vcvarsall.bat"; + paths_examined.push_back(vcvarsall_bat); + if (fs::exists(vcvarsall_bat)) + { + return vcvarsall_bat; + } + } + + // VS2015 + const fs::path vs2015_vcvarsall_bat = get_VS2015_installation_instance() / "VC" / "vcvarsall.bat"; + paths_examined.push_back(vs2015_vcvarsall_bat); + if (fs::exists(vs2015_vcvarsall_bat)) + { + return vs2015_vcvarsall_bat; + } + + System::println(System::color::error, "Could not detect vccarsall.bat."); + System::println("The following paths were examined:"); + for (const fs::path& path : paths_examined) + { + System::println(path.generic_string()); + } + exit(EXIT_FAILURE); + } + + const fs::path& get_vcvarsall_bat(const vcpkg_paths& paths) + { + static const fs::path vcvarsall_bat = find_vcvarsall_bat(paths); + return vcvarsall_bat; + } } From 127fbe20263302ee2d877dcfedcf853d0415ce2f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:16:19 -0800 Subject: [PATCH 143/561] [VS2017] Use Environment::get_vcvarsall_bat() --- toolsrc/src/commands_build.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 72ebb264b6..af1b3dc246 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -30,7 +30,9 @@ namespace vcpkg::Commands::Build const triplet& target_triplet = spec.target_triplet(); const fs::path ports_cmake_script_path = paths.ports_cmake; - const std::wstring command = Strings::wformat(LR"("%%VS140COMNTOOLS%%..\..\VC\vcvarsall.bat" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", + const fs::path vcvarsall_bat = Environment::get_vcvarsall_bat(paths); + const std::wstring command = Strings::wformat(LR"("%s" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", + vcvarsall_bat.native(), Strings::utf8_to_utf16(target_triplet.architecture()), Strings::utf8_to_utf16(source_paragraph.name), Strings::utf8_to_utf16(target_triplet.canonical_name()), From 612d2041214e90d242a5cad9bcf8b2b52357685d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:37:03 -0800 Subject: [PATCH 144/561] Remove check for empty MSVC dir. --- toolsrc/src/vcpkg_Environment.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 54541bd456..de17158b42 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -117,8 +117,6 @@ namespace vcpkg::Environment return fs::is_directory(current); }, &msvc_subdirectories); - Checks::check_exit(!msvc_subdirectories.empty(), "No subdirectories were found in %s", msvc_path.generic_string()); - // Sort them so that latest comes first std::sort(msvc_subdirectories.begin(), msvc_subdirectories.end(), [&](const fs::path& left, const fs::path& right) { From a4b419dc7b6fd533904b5c702053c4a871f72629 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:39:05 -0800 Subject: [PATCH 145/561] Add comment about trailing backslash in VS140COMNTOOLS --- toolsrc/src/vcpkg_Environment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index de17158b42..7096278789 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -97,7 +97,7 @@ namespace vcpkg::Environment static const fs::path& get_VS2015_installation_instance() { - static const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // TODO: Check why this requires parent_path() call + static const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // The call to parent path is needed because the env variable has a trailing backslash static const fs::path vs2015_path = vs2015_cmntools.parent_path().parent_path(); return vs2015_path; } From ac2f2cb478bba52c247ccdab13b9c5ad15cd4947 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:46:58 -0800 Subject: [PATCH 146/561] Strings::split() now handles trailing delimiters --- toolsrc/src/vcpkg_Strings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 16477a45ca..e53cfa1efb 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -132,7 +132,7 @@ namespace vcpkg::Strings i = ++pos; pos = s.find(delimiter, pos); - if (pos == std::string::npos) + if (pos == std::string::npos && i != s.length()) // The second check is so no items are added if there is nothing after the last delimiter { output.push_back(s.substr(i, s.length())); } From 5d603cbae259e492b8ff034a748573d3f680e7c7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:50:29 -0800 Subject: [PATCH 147/561] Improve Strings::split() --- toolsrc/src/vcpkg_Strings.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index e53cfa1efb..b974b0a063 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -125,17 +125,16 @@ namespace vcpkg::Strings std::vector output; size_t i = 0; - size_t pos = s.find(delimiter); - while (pos != std::string::npos) + for (size_t pos = s.find(delimiter); pos != std::string::npos; pos = s.find(delimiter, pos)) { output.push_back(s.substr(i, pos - i)); i = ++pos; - pos = s.find(delimiter, pos); + } - if (pos == std::string::npos && i != s.length()) // The second check is so no items are added if there is nothing after the last delimiter - { - output.push_back(s.substr(i, s.length())); - } + // Add the rest of the string after the last delimiter, unless there is nothing after it + if (i != s.length()) + { + output.push_back(s.substr(i, s.length())); } return output; From 522b393901638c3abfc89ff63085ec64367c7671 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 17:02:43 -0800 Subject: [PATCH 148/561] Bump version of required CMake to 3.7.2 --- scripts/fetchDependency.ps1 | 30 +++++++++++++++--------------- toolsrc/src/vcpkg_Environment.cpp | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 2f3d992ba4..7e8e1d32cc 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -51,12 +51,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { return } - + $title = "Download " + $Dependency $message = ("No suitable version of " + $Dependency + " was found (requires $requiredVersion or higher). Download portable version?") $yesDescription = "Downloads " + $Dependency + " v" + $downloadVersion +" app-locally." - $noDescription = "Does not download " + $Dependency + "." - + $noDescription = "Does not download " + $Dependency + "." + $userAllowedDownload = promptForDownload $title $message $yesDescription $noDescription if (!$userAllowedDownload) { @@ -86,10 +86,10 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $ExtractionType_NO_EXTRACTION_REQUIRED = 0 $ExtractionType_ZIP = 1 $ExtractionType_SELF_EXTRACTING_7Z = 2 - - + + # Using this to wait for the execution to finish - function Invoke-Command() + function Invoke-Command() { param ( [string]$program = $(throw "Please specify a program" ), [string]$argumentString = "", @@ -99,7 +99,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $psi.FileName = $program $psi.Arguments = $argumentString $proc = [Diagnostics.Process]::Start($psi) - if ( $waitForExit ) + if ( $waitForExit ) { $proc.WaitForExit(); } @@ -120,12 +120,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if($Dependency -eq "cmake") { - $requiredVersion = "3.5.0" - $downloadVersion = "3.5.2" - $url = "https://cmake.org/files/v3.5/cmake-3.5.2-win32-x86.zip" - $downloadName = "cmake-3.5.2-win32-x86.zip" - $expectedDownloadedFileHash = "671073aee66b3480a564d0736792e40570a11e861bb34819bb7ae7858bbdfb80" - $executableFromDownload = "$downloadsDir\cmake-3.5.2-win32-x86\bin\cmake.exe" + $requiredVersion = "3.7.2" + $downloadVersion = "3.7.2" + $url = "https://cmake.org/files/v3.7/cmake-3.7.2-win32-x86.zip" + $downloadName = "cmake-3.7.2-win32-x86.zip" + $expectedDownloadedFileHash = "ec5e299d412e0272e01d4de5bf07718f42c96361f83d51cc39f91bf49cc3e5c3" + $executableFromDownload = "$downloadsDir\cmake-3.7.2-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP } elseif($Dependency -eq "nuget") @@ -146,7 +146,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $downloadName = "PortableGit-2.8.3-32-bit.7z.exe" $expectedDownloadedFileHash = "DE52D070219E9C4EC1DB179F2ADBF4B760686C3180608F0382A1F8C7031E72AD" # There is another copy of git.exe in PortableGit\bin. However, an installed version of git add the cmd dir to the PATH. - # Therefore, choosing the cmd dir here as well. + # Therefore, choosing the cmd dir here as well. $executableFromDownload = "$downloadsDir\PortableGit\cmd\git.exe" $extractionType = $ExtractionType_SELF_EXTRACTING_7Z } @@ -186,7 +186,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if (-not (Test-Path $executableFromDownload)) { Invoke-Command $downloadPath "-y" -waitForExit:$true - } + } } else { diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 7096278789..e1eb229696 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -63,7 +63,7 @@ namespace vcpkg::Environment void ensure_cmake_on_path(const vcpkg_paths& paths) { - const fs::path downloaded_cmake = paths.downloads / "cmake-3.5.2-win32-x86" / "bin"; + const fs::path downloaded_cmake = paths.downloads / "cmake-3.7.2-win32-x86" / "bin"; const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s", downloaded_cmake.native(), System::wdupenv_str(L"PATH"), @@ -71,7 +71,7 @@ namespace vcpkg::Environment default_cmake_installation_dir_x86.native()); _wputenv_s(L"PATH", path_buf.c_str()); - static constexpr std::array cmake_version = {3,5,0}; + static constexpr std::array cmake_version = {3,7,2}; // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned ensure_on_path(cmake_version, L"cmake --version 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency cmake"); } From 4e86b01a36cba7a1e1b883a8d62a6f68c2b6e030 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 17:24:34 -0800 Subject: [PATCH 149/561] [Environemnt] Don't depend on present working dir --- toolsrc/src/vcpkg_Environment.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index e1eb229696..22a9252b0a 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -14,7 +14,7 @@ namespace vcpkg::Environment static const fs::path default_git_installation_dir = "C:/Program Files/git/cmd"; static const fs::path default_git_installation_dir_x86 = "C:/Program Files (x86)/git/cmd"; - static void ensure_on_path(const std::array& version, const wchar_t* version_check_cmd, const wchar_t* install_cmd) + static void ensure_on_path(const std::array& version, const std::wstring& version_check_cmd, const std::wstring& install_cmd) { System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(version_check_cmd); if (ec_data.exit_code == 0) @@ -57,8 +57,11 @@ namespace vcpkg::Environment _wputenv_s(L"PATH", path_buf.c_str()); static constexpr std::array git_version = {2,0,0}; + static const std::wstring version_check_cmd = L"git --version 2>&1"; + const fs::path script = paths.scripts / "fetchDependency.ps1"; // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - ensure_on_path(git_version, L"git --version 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency git"); + const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency git", script.native()); + ensure_on_path(git_version, version_check_cmd, install_cmd); } void ensure_cmake_on_path(const vcpkg_paths& paths) @@ -72,8 +75,11 @@ namespace vcpkg::Environment _wputenv_s(L"PATH", path_buf.c_str()); static constexpr std::array cmake_version = {3,7,2}; + static const std::wstring version_check_cmd = L"cmake --version 2>&1"; + const fs::path script = paths.scripts / "fetchDependency.ps1"; // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - ensure_on_path(cmake_version, L"cmake --version 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency cmake"); + const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency cmake", script.native()); + ensure_on_path(cmake_version, version_check_cmd, install_cmd); } void ensure_nuget_on_path(const vcpkg_paths& paths) @@ -82,8 +88,11 @@ namespace vcpkg::Environment _wputenv_s(L"PATH", path_buf.c_str()); static constexpr std::array nuget_version = {1,0,0}; + static const std::wstring version_check_cmd = L"nuget 2>&1"; + const fs::path script = paths.scripts / "fetchDependency.ps1"; // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - ensure_on_path(nuget_version, L"nuget 2>&1", L"powershell -ExecutionPolicy Bypass scripts\\fetchDependency.ps1 -Dependency nuget"); + const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency nuget", script.native()); + ensure_on_path(nuget_version, version_check_cmd, install_cmd); } static std::vector get_VS2017_installation_instances(const vcpkg_paths& paths) From d9f770ad8d6010a09d6be2ec9a262fc6ce074267 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 17:28:20 -0800 Subject: [PATCH 150/561] Improve comment --- toolsrc/src/vcpkg_Environment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 22a9252b0a..aaa6bb1065 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -106,7 +106,7 @@ namespace vcpkg::Environment static const fs::path& get_VS2015_installation_instance() { - static const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // The call to parent path is needed because the env variable has a trailing backslash + static const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // The call to parent_path() is needed because the env variable has a trailing backslash static const fs::path vs2015_path = vs2015_cmntools.parent_path().parent_path(); return vs2015_path; } From 44810f267d095986f519d8b41592e83e913c2e56 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 23 Jan 2017 18:26:57 -0800 Subject: [PATCH 151/561] [vcpkg integrate] Lower verbosity of MSBuild messages. --- scripts/buildsystems/msbuild/vcpkg.targets | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 912cf6b8e2..26a524ca3a 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -57,12 +57,14 @@ Lines="^$(OutputPath)$(TargetName).$(OutputType);" Encoding="Unicode"/> + ConsoleToMSBuild="true" + StandardOutputImportance="Normal"> + ConsoleToMSBuild="true" + StandardOutputImportance="Normal"> From 64bcc326fb98a7ae8249cc50b6305166e8f3ac89 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 17:49:41 -0800 Subject: [PATCH 152/561] Improve format of output error messages --- toolsrc/src/vcpkg_Environment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index aaa6bb1065..b6705cc47d 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -155,7 +155,7 @@ namespace vcpkg::Environment System::println("The following paths were examined:"); for (const fs::path& path : paths_examined) { - System::println(path.generic_string()); + System::println(" %s", path.generic_string()); } exit(EXIT_FAILURE); } @@ -194,7 +194,7 @@ namespace vcpkg::Environment System::println("The following paths were examined:"); for (const fs::path& path : paths_examined) { - System::println(path.generic_string()); + System::println(" %s",path.generic_string()); } exit(EXIT_FAILURE); } From 2670075bf202529aa23b6c278b589e3c0541076e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 18:36:22 -0800 Subject: [PATCH 153/561] Extract method --- toolsrc/src/vcpkg_Environment.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index b6705cc47d..76aa07fb65 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -46,6 +46,13 @@ namespace vcpkg::Environment } } + static std::wstring create_default_install_cmd(const vcpkg_paths& paths, const std::wstring& tool_name) + { + const fs::path script = paths.scripts / "fetchDependency.ps1"; + // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned + return Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency %s", script.native(), tool_name); + } + void ensure_git_on_path(const vcpkg_paths& paths) { const fs::path downloaded_git = paths.downloads / "PortableGit" / "cmd"; @@ -58,9 +65,7 @@ namespace vcpkg::Environment static constexpr std::array git_version = {2,0,0}; static const std::wstring version_check_cmd = L"git --version 2>&1"; - const fs::path script = paths.scripts / "fetchDependency.ps1"; - // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency git", script.native()); + const std::wstring install_cmd = create_default_install_cmd(paths, L"git"); ensure_on_path(git_version, version_check_cmd, install_cmd); } @@ -76,9 +81,7 @@ namespace vcpkg::Environment static constexpr std::array cmake_version = {3,7,2}; static const std::wstring version_check_cmd = L"cmake --version 2>&1"; - const fs::path script = paths.scripts / "fetchDependency.ps1"; - // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency cmake", script.native()); + const std::wstring install_cmd = create_default_install_cmd(paths, L"cmake"); ensure_on_path(cmake_version, version_check_cmd, install_cmd); } @@ -89,9 +92,7 @@ namespace vcpkg::Environment static constexpr std::array nuget_version = {1,0,0}; static const std::wstring version_check_cmd = L"nuget 2>&1"; - const fs::path script = paths.scripts / "fetchDependency.ps1"; - // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency nuget", script.native()); + const std::wstring install_cmd = create_default_install_cmd(paths, L"nuget"); ensure_on_path(nuget_version, version_check_cmd, install_cmd); } From 868a7623addee16f19b17718163b7719c4d739e2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 18:42:34 -0800 Subject: [PATCH 154/561] Bump nuget.exe version --- scripts/fetchDependency.ps1 | 8 ++++---- toolsrc/src/vcpkg_Environment.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 7e8e1d32cc..eedfb15d11 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -130,11 +130,11 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "nuget") { - $requiredVersion = "1.0.0" - $downloadVersion = "3.4.3" - $url = "https://dist.nuget.org/win-x86-commandline/v3.4.3/nuget.exe" + $requiredVersion = "3.3.0" + $downloadVersion = "3.5.0" + $url = "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe" $downloadName = "nuget.exe" - $expectedDownloadedFileHash = "3B1EA72943968D7AF6BACDB4F2F3A048A25AFD14564EF1D8B1C041FDB09EBB0A" + $expectedDownloadedFileHash = "399ec24c26ed54d6887cde61994bb3d1cada7956c1b19ff880f06f060c039918" $executableFromDownload = "$downloadsDir\nuget.exe" $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED } diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 76aa07fb65..1a50a604a1 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -90,7 +90,7 @@ namespace vcpkg::Environment const std::wstring path_buf = Strings::wformat(L"%s;%s", paths.downloads.native(), System::wdupenv_str(L"PATH")); _wputenv_s(L"PATH", path_buf.c_str()); - static constexpr std::array nuget_version = {1,0,0}; + static constexpr std::array nuget_version = {3,3,0}; static const std::wstring version_check_cmd = L"nuget 2>&1"; const std::wstring install_cmd = create_default_install_cmd(paths, L"nuget"); ensure_on_path(nuget_version, version_check_cmd, install_cmd); From 7c9db95feccf6e9d01d2e1af6c7012685d8e46b6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 18:47:38 -0800 Subject: [PATCH 155/561] Bump downloaded git version --- scripts/fetchDependency.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index eedfb15d11..e1ef184ab7 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -141,10 +141,10 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) elseif($Dependency -eq "git") { $requiredVersion = "2.0.0" - $downloadVersion = "2.8.3" - $url = "https://github.com/git-for-windows/git/releases/download/v2.8.3.windows.1/PortableGit-2.8.3-32-bit.7z.exe" # We choose the 32-bit version - $downloadName = "PortableGit-2.8.3-32-bit.7z.exe" - $expectedDownloadedFileHash = "DE52D070219E9C4EC1DB179F2ADBF4B760686C3180608F0382A1F8C7031E72AD" + $downloadVersion = "2.11.0" + $url = "https://github.com/git-for-windows/git/releases/download/v2.11.0.windows.3/PortableGit-2.11.0.3-32-bit.7z.exe" # We choose the 32-bit version + $downloadName = "PortableGit-2.11.0.3-32-bit.7z.exe" + $expectedDownloadedFileHash = "8bf3769c37945e991903dd1b988c6b1d97bbf0f3afc9851508974f38bf94dc01" # There is another copy of git.exe in PortableGit\bin. However, an installed version of git add the cmd dir to the PATH. # Therefore, choosing the cmd dir here as well. $executableFromDownload = "$downloadsDir\PortableGit\cmd\git.exe" From 93c3c0648a782b1fa75bae1f200beca6ba871f9a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 19:25:47 -0800 Subject: [PATCH 156/561] [VS2017] Enable building with v141 toolset --- scripts/cmake/vcpkg_configure_cmake.cmake | 27 +++++++++++++++++------ toolsrc/include/vcpkg_Environment.h | 8 ++++++- toolsrc/src/commands_build.cpp | 7 +++--- toolsrc/src/vcpkg_Environment.cpp | 10 ++++----- 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 1797031724..1287820753 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -4,20 +4,33 @@ function(vcpkg_configure_cmake) if(_csc_GENERATOR) set(GENERATOR ${_csc_GENERATOR}) - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 Win64") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 ARM") # elseif(NOT vcpkg_configure_cmake_NINJA MATCHES "NOTFOUND") # set(GENERATOR "Ninja") - elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") - elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 Win64") elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm") - set(GENERATOR "Visual Studio 14 2015 ARM") + set(GENERATOR "Visual Studio 14 2015 ARM" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") + + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017 Win64") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017 ARM") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017 Win64") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm") + set(GENERATOR "Visual Studio 15 2017 ARM" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") endif() file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) @@ -33,7 +46,7 @@ function(vcpkg_configure_cmake) elseif(DEFINED VCPKG_LIBRARY_LINKAGE AND VCPKG_LIBRARY_LINKAGE STREQUAL static) list(APPEND _csc_OPTIONS -DBUILD_SHARED_LIBS=OFF) endif() - + list(APPEND _csc_OPTIONS "-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc" diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index 9161f7ce53..e4dd47472c 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -17,5 +17,11 @@ namespace vcpkg::Environment const fs::path& get_dumpbin_exe(const vcpkg_paths& paths); - const fs::path& get_vcvarsall_bat(const vcpkg_paths& paths); + struct vcvarsall_and_platform_toolset + { + fs::path path; + std::wstring platform_toolset; + }; + + const vcvarsall_and_platform_toolset& get_vcvarsall_bat(const vcpkg_paths& paths); } diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index af1b3dc246..d9d5d2107b 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -30,12 +30,13 @@ namespace vcpkg::Commands::Build const triplet& target_triplet = spec.target_triplet(); const fs::path ports_cmake_script_path = paths.ports_cmake; - const fs::path vcvarsall_bat = Environment::get_vcvarsall_bat(paths); - const std::wstring command = Strings::wformat(LR"("%s" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", - vcvarsall_bat.native(), + const Environment::vcvarsall_and_platform_toolset vcvarsall_bat = Environment::get_vcvarsall_bat(paths); + const std::wstring command = Strings::wformat(LR"("%s" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s -DVCPKG_PLATFORM_TOOLSET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", + vcvarsall_bat.path.native(), Strings::utf8_to_utf16(target_triplet.architecture()), Strings::utf8_to_utf16(source_paragraph.name), Strings::utf8_to_utf16(target_triplet.canonical_name()), + vcvarsall_bat.platform_toolset, port_dir.generic_wstring(), ports_cmake_script_path.generic_wstring()); diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 1a50a604a1..c204bfaf43 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -167,7 +167,7 @@ namespace vcpkg::Environment return dumpbin_exe; } - static fs::path find_vcvarsall_bat(const vcpkg_paths& paths) + static vcvarsall_and_platform_toolset find_vcvarsall_bat(const vcpkg_paths& paths) { const std::vector vs2017_installation_instances = get_VS2017_installation_instances(paths); std::vector paths_examined; @@ -179,7 +179,7 @@ namespace vcpkg::Environment paths_examined.push_back(vcvarsall_bat); if (fs::exists(vcvarsall_bat)) { - return vcvarsall_bat; + return { vcvarsall_bat , L"v141"}; } } @@ -188,7 +188,7 @@ namespace vcpkg::Environment paths_examined.push_back(vs2015_vcvarsall_bat); if (fs::exists(vs2015_vcvarsall_bat)) { - return vs2015_vcvarsall_bat; + return { vs2015_vcvarsall_bat, L"v140" }; } System::println(System::color::error, "Could not detect vccarsall.bat."); @@ -200,9 +200,9 @@ namespace vcpkg::Environment exit(EXIT_FAILURE); } - const fs::path& get_vcvarsall_bat(const vcpkg_paths& paths) + const vcvarsall_and_platform_toolset& get_vcvarsall_bat(const vcpkg_paths& paths) { - static const fs::path vcvarsall_bat = find_vcvarsall_bat(paths); + static const vcvarsall_and_platform_toolset vcvarsall_bat = find_vcvarsall_bat(paths); return vcvarsall_bat; } } From ab33a7fd49904b5a4ff25af6f87d32ddf15fcd6c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 19:56:07 -0800 Subject: [PATCH 157/561] Update CHANGELOG and bump version to v0.0.70 --- CHANGELOG.md | 21 +++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 103417bada..3380cd074f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +vcpkg (0.0.70) +-------------- + * Add ports: + - fltk 1.3.4-1 + - glib 2.50.2 + - lzo 2.09 + - uvatlas sept2016 + * Update ports: + - dx 1.0.0 -> 1.0.1 + - libmysql 5.7.16 -> 5.7.17 + * Add support for Visual Studio 2017 + - Previously, you could use Visual Studio 2017 for your own application and `vcpkg` integration would work, but you needed to have Visual Studio 2015 to build `vcpkg` itself as well as the libraries. This requirement has now been removed + - If both Visual Studio 2015 and Visual Studio 2017 are installed, Visual Studio 2017 tools will be preferred over those of Visual Studio 2015 + * Bump required version & auto-downloaded version of `cmake` to 3.7.2 (was 3.5.x), which includes generators for Visual Studio 2017 + * Bump auto-downloaded version of `nuget` to 3.5.0 (was 3.4.3) + * Bump auto-downloaded version of `git` to 2.11.0 (was 2.8.3) + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team MON, 23 Jan 2017 19:50:00 -0800 + + vcpkg (0.0.67) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 8afb66b095..1759b863b1 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.67" \ No newline at end of file +"0.0.70" \ No newline at end of file From ccda20a8584a9fcc89c4dd631e5ef8d4189f1131 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 12:01:11 -0800 Subject: [PATCH 158/561] Remove $downloadName variable --- scripts/fetchDependency.ps1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index e1ef184ab7..9269dba8cc 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -123,7 +123,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $requiredVersion = "3.7.2" $downloadVersion = "3.7.2" $url = "https://cmake.org/files/v3.7/cmake-3.7.2-win32-x86.zip" - $downloadName = "cmake-3.7.2-win32-x86.zip" + $downloadPath = "$downloadsDir\cmake-3.7.2-win32-x86.zip" $expectedDownloadedFileHash = "ec5e299d412e0272e01d4de5bf07718f42c96361f83d51cc39f91bf49cc3e5c3" $executableFromDownload = "$downloadsDir\cmake-3.7.2-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP @@ -133,7 +133,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $requiredVersion = "3.3.0" $downloadVersion = "3.5.0" $url = "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe" - $downloadName = "nuget.exe" + $downloadPath = "$downloadsDir\nuget.exe" $expectedDownloadedFileHash = "399ec24c26ed54d6887cde61994bb3d1cada7956c1b19ff880f06f060c039918" $executableFromDownload = "$downloadsDir\nuget.exe" $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED @@ -143,7 +143,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $requiredVersion = "2.0.0" $downloadVersion = "2.11.0" $url = "https://github.com/git-for-windows/git/releases/download/v2.11.0.windows.3/PortableGit-2.11.0.3-32-bit.7z.exe" # We choose the 32-bit version - $downloadName = "PortableGit-2.11.0.3-32-bit.7z.exe" + $downloadPath = "$downloadsDir\PortableGit-2.11.0.3-32-bit.7z.exe" $expectedDownloadedFileHash = "8bf3769c37945e991903dd1b988c6b1d97bbf0f3afc9851508974f38bf94dc01" # There is another copy of git.exe in PortableGit\bin. However, an installed version of git add the cmd dir to the PATH. # Therefore, choosing the cmd dir here as well. @@ -155,7 +155,6 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) throw "Unknown program requested" } - $downloadPath = "$downloadsDir\$downloadName" performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion #calculating the hash From d5e7a501e907f06ad1e8bb4ffdebce9a29179d2d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 12:30:14 -0800 Subject: [PATCH 159/561] Download nuget.exe in a version-including subfolder in Downloads\ --- scripts/fetchDependency.ps1 | 10 ++++++++-- toolsrc/src/vcpkg_Environment.cpp | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 9269dba8cc..d05d16bead 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -133,9 +133,9 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $requiredVersion = "3.3.0" $downloadVersion = "3.5.0" $url = "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe" - $downloadPath = "$downloadsDir\nuget.exe" + $downloadPath = "$downloadsDir\nuget-3.5.0\nuget.exe" $expectedDownloadedFileHash = "399ec24c26ed54d6887cde61994bb3d1cada7956c1b19ff880f06f060c039918" - $executableFromDownload = "$downloadsDir\nuget.exe" + $executableFromDownload = $downloadPath $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED } elseif($Dependency -eq "git") @@ -155,6 +155,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) throw "Unknown program requested" } + $downloadSubdir = Split-path $downloadPath -Parent + if (!(Test-Path $downloadSubdir)) + { + New-Item -ItemType Directory -Path $downloadSubdir | Out-Null + } + performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion #calculating the hash diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index c204bfaf43..66d33edeb7 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -87,7 +87,8 @@ namespace vcpkg::Environment void ensure_nuget_on_path(const vcpkg_paths& paths) { - const std::wstring path_buf = Strings::wformat(L"%s;%s", paths.downloads.native(), System::wdupenv_str(L"PATH")); + const fs::path downloaded_nuget = paths.downloads / "nuget-3.5.0"; + const std::wstring path_buf = Strings::wformat(L"%s;%s", downloaded_nuget.native(), System::wdupenv_str(L"PATH")); _wputenv_s(L"PATH", path_buf.c_str()); static constexpr std::array nuget_version = {3,3,0}; From d96f56736e9696248584506f364ee31acf12ddc3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 12:32:03 -0800 Subject: [PATCH 160/561] Fix path to nuget.exe --- scripts/findVisualStudioInstallationInstances.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 1cb78fa9e2..241b05bc13 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -11,7 +11,7 @@ $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" & $scriptsDir\fetchDependency.ps1 "nuget" -$nugetexe = "$downloadsDir\nuget.exe" +$nugetexe = "$downloadsDir\nuget-3.5.0\nuget.exe" $nugetPackageDir = "$downloadsDir\nuget-packages" $SetupAPIVersion = "1.3.269-rc" From f2ac7a32aaf9e0f374cf3025f6f86561780951eb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 12:36:46 -0800 Subject: [PATCH 161/561] FetchDependency.ps1 now returns the downloaded exe's path --- scripts/fetchDependency.ps1 | 2 ++ scripts/findVisualStudioInstallationInstances.ps1 | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index d05d16bead..b56bf10876 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -202,6 +202,8 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { throw [System.IO.FileNotFoundException] ("Could not detect or download " + $Dependency) } + + return $downloadPath } SelectProgram $Dependency \ No newline at end of file diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 241b05bc13..d5faa57d37 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -10,8 +10,7 @@ $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" -& $scriptsDir\fetchDependency.ps1 "nuget" -$nugetexe = "$downloadsDir\nuget-3.5.0\nuget.exe" +$nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" $nugetPackageDir = "$downloadsDir\nuget-packages" $SetupAPIVersion = "1.3.269-rc" From 6946f2d244703c82219743b701d659c4bea4b9f5 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 24 Jan 2017 21:57:52 +0100 Subject: [PATCH 162/561] [libarchive] add one more patch --- .../override-broken-feature-checks.patch | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 ports/libarchive/override-broken-feature-checks.patch diff --git a/ports/libarchive/override-broken-feature-checks.patch b/ports/libarchive/override-broken-feature-checks.patch new file mode 100644 index 0000000000..63c65a10fd --- /dev/null +++ b/ports/libarchive/override-broken-feature-checks.patch @@ -0,0 +1,55 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2d035a1..1e32afd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1226,7 +1226,8 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) + CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) + CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) +-CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++#CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++set(HAVE_MEMMOVE 1) + CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) + CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) + CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) +@@ -1257,11 +1258,16 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) + CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) + CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) +-CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) +-CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) +-CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++#CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) ++set(HAVE_WCRTOMB 1) ++#CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) ++set(HAVE_WCSCMP 1) ++#CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) ++set(HAVE_WCSCPY 1) ++#CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) ++set(HAVE_WCSLEN 1) ++#CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++set(HAVE_WCTOMB 1) + CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) + CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) + CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) +@@ -1273,10 +1279,14 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) + CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) + CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) +-CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) +-CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) +-CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) +-CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++#CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) ++set(HAVE_VPRINTF 1) ++#CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) ++set(HAVE_WMEMCMP 1) ++#CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) ++set(HAVE_WMEMCPY 1) ++#CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++set(HAVE_WMEMMOVE 1) + + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + From 05b82a96aedede08c3a4c5ef9525de944788d9e9 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 24 Jan 2017 21:59:05 +0100 Subject: [PATCH 163/561] [libarchive] apply patch --- ports/libarchive/portfile.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/libarchive/portfile.cmake b/ports/libarchive/portfile.cmake index 26d1755168..731174790a 100644 --- a/ports/libarchive/portfile.cmake +++ b/ports/libarchive/portfile.cmake @@ -16,7 +16,8 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-buildsystem.patch - ${CMAKE_CURRENT_LIST_DIR}/use-memset-not-bzero.patch) + ${CMAKE_CURRENT_LIST_DIR}/use-memset-not-bzero.patch + ${CMAKE_CURRENT_LIST_DIR}/override-broken-feature-checks.patch) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} From cf5770d2641bb56830f0ef27ee604313b20b9cb1 Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 24 Jan 2017 21:59:24 +0100 Subject: [PATCH 164/561] [libarchive] bump version --- ports/libarchive/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libarchive/CONTROL b/ports/libarchive/CONTROL index c035a891ee..43979243c0 100644 --- a/ports/libarchive/CONTROL +++ b/ports/libarchive/CONTROL @@ -1,4 +1,4 @@ Source: libarchive -Version: 3.2.2 +Version: 3.2.2-1 Description: Library for reading and writing streaming archives Build-Depends: zlib, bzip2, libxml2, libiconv, lz4, liblzma, openssl From e3c3497dbc03607492f38e54122106bc8f00ca20 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 14:12:27 -0800 Subject: [PATCH 165/561] Suppress VS2017's vcvarsall.bat output --- toolsrc/src/commands_build.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index d9d5d2107b..e7e005100c 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -31,7 +31,7 @@ namespace vcpkg::Commands::Build const fs::path ports_cmake_script_path = paths.ports_cmake; const Environment::vcvarsall_and_platform_toolset vcvarsall_bat = Environment::get_vcvarsall_bat(paths); - const std::wstring command = Strings::wformat(LR"("%s" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s -DVCPKG_PLATFORM_TOOLSET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", + const std::wstring command = Strings::wformat(LR"("%s" %s >nul 2>&1 && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s -DVCPKG_PLATFORM_TOOLSET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", vcvarsall_bat.path.native(), Strings::utf8_to_utf16(target_triplet.architecture()), Strings::utf8_to_utf16(source_paragraph.name), From c09e6ff69ac353cee7538d073e9c35dfef392836 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 24 Jan 2017 14:55:07 -0800 Subject: [PATCH 166/561] [wt] Suppress reliance on boost autolinking Fixes #558 --- ports/wt/CONTROL | 2 +- .../add-disable-boost-autolink-option.patch | 26 +++++++++++++++++++ ports/wt/portfile.cmake | 10 +++++-- 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 ports/wt/add-disable-boost-autolink-option.patch diff --git a/ports/wt/CONTROL b/ports/wt/CONTROL index fc71d9aaf2..1a89dd3785 100644 --- a/ports/wt/CONTROL +++ b/ports/wt/CONTROL @@ -1,4 +1,4 @@ Source: wt -Version: 3.3.6 +Version: 3.3.6-2 Description: Wt is a C++ library for developing web applications Build-Depends: boost, openssl diff --git a/ports/wt/add-disable-boost-autolink-option.patch b/ports/wt/add-disable-boost-autolink-option.patch new file mode 100644 index 0000000000..57cb3ed99d --- /dev/null +++ b/ports/wt/add-disable-boost-autolink-option.patch @@ -0,0 +1,26 @@ +diff --git a/cmake/WtFindBoost-cmake.txt b/cmake/WtFindBoost-cmake.txt +index b66741f..377cede 100644 +--- a/cmake/WtFindBoost-cmake.txt ++++ b/cmake/WtFindBoost-cmake.txt +@@ -99,7 +99,7 @@ IF (Boost_FOUND) + SET(BOOST_WTHTTP_MT_FOUND TRUE) + SET(BOOST_WTHTTP_FOUND TRUE) + +- IF(MSVC) ++ IF(MSVC AND NOT DISABLE_BOOST_AUTOLINK) + # use autolink + SET(BOOST_WT_LIBRARIES "") + SET(BOOST_WTHTTP_LIBRARIES "") +diff --git a/src/wt/Dbo/CMakeLists.txt b/src/wt/Dbo/CMakeLists.txt +index 64d3af2..f9c31e0 100644 +--- a/src/wt/Dbo/CMakeLists.txt ++++ b/src/wt/Dbo/CMakeLists.txt +@@ -31,7 +31,7 @@ IF(ENABLE_LIBWTDBO) + StringStream.C + ) + +- IF(MSVC) ++ IF(MSVC AND NOT DISABLE_BOOST_AUTOLINK) + #win32 links automatically against boost libs; specifying too much causes + #trouble + IF(MULTI_THREADED_BUILD) diff --git a/ports/wt/portfile.cmake b/ports/wt/portfile.cmake index 66b1d5a330..f762efaced 100644 --- a/ports/wt/portfile.cmake +++ b/ports/wt/portfile.cmake @@ -8,9 +8,13 @@ vcpkg_download_distfile(ARCHIVE_FILE ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/add-disable-boost-autolink-option.patch +) + vcpkg_configure_cmake( -SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH ${SOURCE_PATH} OPTIONS -DSHARED_LIBS=ON -DENABLE_SSL=ON @@ -20,6 +24,8 @@ SOURCE_PATH ${SOURCE_PATH} -DENABLE_MYSQL=OFF -DENABLE_QT4=OFF -DBOOST_DYNAMIC=ON + -DDISABLE_BOOST_AUTOLINK=ON + -DENABLE_LIBWTTEST=OFF ) vcpkg_install_cmake() From 33ce94a4565ce68cd02cacda221fccbd756d3949 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 24 Jan 2017 15:17:45 -0800 Subject: [PATCH 167/561] [vcpkg integrate] Exit silently if target cannot be found. --- scripts/buildsystems/msbuild/applocal.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index 46981fad5b..55680c1f6d 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -2,7 +2,14 @@ param([string]$targetBinary, [string]$installedDir, [string]$tlogFile) function resolve($targetBinary) { - $targetBinaryPath = Resolve-Path $targetBinary + try + { + $targetBinaryPath = Resolve-Path $targetBinary -erroraction stop + } + catch [System.Management.Automation.ItemNotFoundException] + { + return + } $targetBinaryDir = Split-Path $targetBinaryPath -parent $a = $(dumpbin /DEPENDENTS $targetBinary | ? { $_ -match "^ [^ ].*\.dll" } | % { $_ -replace "^ ","" }) From af0727cbc000ff2b9d3d7489c417d69170fc3a5f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 17:51:45 -0800 Subject: [PATCH 168/561] Improve detection of VS installation instances --- scripts/findVisualStudioInstallationInstances.ps1 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index d5faa57d37..a2ce665224 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -32,9 +32,12 @@ if (!(Test-Path $SetupConsoleExe)) throw $nugetOutput } -$consoleOutput = & $SetupConsoleExe 2>&1 +$instances = & $SetupConsoleExe -nologo -value InstallationPath 2>&1 +$instanceCount = $instances.Length +# The last item can be empty +if ($instances[$entryCount - 1] -eq "") +{ + $instances = $instances[0..($instanceCount - 2)] +} -$key = "InstallationPath = " -$paths = $consoleOutput | Select-String -SimpleMatch $key -$paths = $paths -replace $key, "" -return $paths \ No newline at end of file +return $instances From 7fe735c02e37057596396d42b17caef3169415b0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 18:00:43 -0800 Subject: [PATCH 169/561] Add error message when CONTROL file cannot be opened --- toolsrc/src/Paragraphs.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp index d99ad45cf9..f4592afed8 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/Paragraphs.cpp @@ -41,8 +41,8 @@ namespace vcpkg::Paragraphs static bool is_alphanum(char ch) { return (ch >= 'A' && ch <= 'Z') - || (ch >= 'a' && ch <= 'z') - || (ch >= '0' && ch <= '9'); + || (ch >= 'a' && ch <= 'z') + || (ch >= '0' && ch <= '9'); } static bool is_lineend(char ch) @@ -153,7 +153,13 @@ namespace vcpkg::Paragraphs std::vector> get_paragraphs(const fs::path& control_path) { - return parse_paragraphs(Files::read_contents(control_path).get_or_throw()); + const expected contents = Files::read_contents(control_path); + if (auto spgh = contents.get()) + { + return parse_paragraphs(*spgh); + } + + Checks::exit_with_message("Error while reading %s: %s", control_path.generic_string(), contents.error_code().message()); } std::vector> parse_paragraphs(const std::string& str) From 8fd59c59bcabde5ec79e2fba6ba84a0e96bee462 Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 25 Jan 2017 10:25:38 +0800 Subject: [PATCH 170/561] [libmariadb] rollback conflict with libmysql --- ports/libmariadb/portfile.cmake | 8 ++++++++ ports/libmysql/portfile.cmake | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/ports/libmariadb/portfile.cmake b/ports/libmariadb/portfile.cmake index ebca3d7f3b..3dba9c7d1f 100644 --- a/ports/libmariadb/portfile.cmake +++ b/ports/libmariadb/portfile.cmake @@ -1,3 +1,8 @@ + +if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql/mysql.h") + message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.") +endif() + include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mariadb-connector-c-2.3.2) @@ -57,6 +62,9 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/include/mariadb/mysql_version.h.in ${CURRENT_PACKAGES_DIR}/include/mariadb/CMakeLists.txt ${CURRENT_PACKAGES_DIR}/include/mariadb/Makefile.am) +file(RENAME + ${CURRENT_PACKAGES_DIR}/include/mariadb + ${CURRENT_PACKAGES_DIR}/include/mysql) # copy license file file(COPY ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmariadb) diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index 592482544f..4d711fef57 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -1,3 +1,7 @@ +if (EXISTS "${CURRENT_INSTALLED_DIR}/include/mysql/mysql.h") + message(FATAL_ERROR "FATAL ERROR: libmysql and libmariadb are incompatible.") +endif() + include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mysql-server-mysql-5.7.17) From 318d32e870f8ee25bdf71c8012115ebb9bc38361 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 24 Jan 2017 18:55:41 -0800 Subject: [PATCH 171/561] [vcpkg] Add user-facing notification to prompt rebuilding vcpkg.exe in face of cmake changes. --- scripts/cmake/vcpkg_configure_cmake.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 1287820753..5db9b5d05a 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -2,6 +2,10 @@ find_program(vcpkg_configure_cmake_NINJA ninja) function(vcpkg_configure_cmake) cmake_parse_arguments(_csc "" "SOURCE_PATH;GENERATOR" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) + if(NOT VCPKG_PLATFORM_TOOLSET) + message(FATAL_ERROR "Vcpkg has been updated with VS2017 support, however you need to rebuild vcpkg.exe by re-running bootstrap.ps1\n powershell -exec bypass scripts\\bootstrap.ps1\n") + endif() + if(_csc_GENERATOR) set(GENERATOR ${_csc_GENERATOR}) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") From 9b8afccc9db0959cb3a47d77fd0255096011e245 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 19:08:51 -0800 Subject: [PATCH 172/561] Properly convert wchar to char before printing --- toolsrc/src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/main.cpp b/toolsrc/src/main.cpp index 08e65391f4..b783191676 100644 --- a/toolsrc/src/main.cpp +++ b/toolsrc/src/main.cpp @@ -13,6 +13,7 @@ #include "vcpkg_Input.h" #include "Paragraphs.h" #include "vcpkg_info.h" +#include "vcpkg_Strings.h" using namespace vcpkg; @@ -242,7 +243,7 @@ int wmain(const int argc, const wchar_t* const* const argv) << "EXCEPTION='" << exc_msg << "'\n" << "CMD=\n"; for (int x = 0; x < argc; ++x) - std::cerr << argv[x] << "|\n"; + std::cerr << Strings::utf16_to_utf8(argv[x]) << "|\n"; std::cerr << "\n"; } From a3aeb99092e8dabe1e3bed020be23d60df1787cf Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Mon, 9 Jan 2017 11:03:56 +0100 Subject: [PATCH 173/561] [boost] Fix zlib detection in debug build --- ports/boost/portfile.cmake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 0e25f34bcd..5c272e9cce 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -31,9 +31,7 @@ endif() message(STATUS "Bootstrapping done") set(B2_OPTIONS - -sZLIB_BINARY=zlib -sZLIB_INCLUDE="${CURRENT_INSTALLED_DIR}\\include" - -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" -sNO_BZIP2=1 -j$ENV{NUMBER_OF_PROCESSORS} --debug-configuration @@ -65,12 +63,15 @@ if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") endif() # Add build type specific options -set(B2_OPTIONS_DBG - ${B2_OPTIONS} +set(B2_OPTIONS_DBG + ${B2_OPTIONS} + -sZLIB_BINARY=zlibd -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib" ) -set(B2_OPTIONS_REL - ${B2_OPTIONS} + +set(B2_OPTIONS_REL + ${B2_OPTIONS} + -sZLIB_BINARY=zlib -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" ) From 23ac6d0c190df12998f466ddf015ca4bc5dfd847 Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Mon, 9 Jan 2017 11:04:18 +0100 Subject: [PATCH 174/561] [gdal] Link against external libpng --- ports/gdal/CONTROL | 2 +- ports/gdal/portfile.cmake | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ports/gdal/CONTROL b/ports/gdal/CONTROL index 38eccc46da..e22e97ba87 100644 --- a/ports/gdal/CONTROL +++ b/ports/gdal/CONTROL @@ -1,4 +1,4 @@ Source: gdal Version: 1.11.3 Description: The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data. -Build-Depends: proj +Build-Depends: proj, libpng diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index f198f4f0cd..9bf3016642 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -32,15 +32,23 @@ file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR) file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/share/gdal" NATIVE_DATA_DIR) file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/share/gdal/html" NATIVE_HTML_DIR) +# Setup proj4 libraries + include path file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" PROJ_INCLUDE_DIR) file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/proj.lib" PROJ_LIBRARY_REL) file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/projd.lib" PROJ_LIBRARY_DBG) +# Setup libpng libraries + include path +file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" PNG_INCLUDE_DIR) +file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/libpng16.lib" PNG_LIBRARY_REL) +file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libpng16d.lib" PNG_LIBRARY_DBG) + set(NMAKE_OPTIONS GDAL_HOME=${NATIVE_PACKAGES_DIR} DATADIR=${NATIVE_DATA_DIR} HTMLDIR=${NATIVE_HTML_DIR} PROJ_INCLUDE=-I${PROJ_INCLUDE_DIR} + PNG_EXTERNAL_LIB=1 + PNGDIR=${PNG_INCLUDE_DIR} MSVC_VER=1900 ) @@ -65,12 +73,14 @@ set(NMAKE_OPTIONS_REL "${NMAKE_OPTIONS}" CXX_CRT_FLAGS=${LINKAGE_FLAGS} PROJ_LIBRARY=${PROJ_LIBRARY_REL} + PNG_LIB=${PNG_LIBRARY_REL} ) set(NMAKE_OPTIONS_DBG "${NMAKE_OPTIONS}" CXX_CRT_FLAGS="${LINKAGE_FLAGS}d" PROJ_LIBRARY=${PROJ_LIBRARY_DBG} + PNG_LIB=${PNG_LIBRARY_DBG} DEBUG=1 ) ################ From 44590c5c1e934fe260618ee1add2cfc63440202d Mon Sep 17 00:00:00 2001 From: Manuel Massing Date: Mon, 9 Jan 2017 11:04:18 +0100 Subject: [PATCH 175/561] [boost] Add bzip2 support --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 0abbac659d..f5676974ac 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost Version: 1.62-11 Description: Peer-reviewed portable C++ source libraries -Build-Depends: zlib +Build-Depends: zlib, bzip2 diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 5c272e9cce..f9c0a0a34c 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -32,7 +32,7 @@ message(STATUS "Bootstrapping done") set(B2_OPTIONS -sZLIB_INCLUDE="${CURRENT_INSTALLED_DIR}\\include" - -sNO_BZIP2=1 + -sBZIP2_INCLUDE="${CURRENT_INSTALLED_DIR}\\include" -j$ENV{NUMBER_OF_PROCESSORS} --debug-configuration --hash @@ -67,12 +67,16 @@ set(B2_OPTIONS_DBG ${B2_OPTIONS} -sZLIB_BINARY=zlibd -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib" + -sBZIP2_BINARY=bz2 + -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib" ) set(B2_OPTIONS_REL ${B2_OPTIONS} -sZLIB_BINARY=zlib -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" + -sBZIP2_BINARY=bz2 + -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" ) file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) From 2d4fb63bf8f91b021ac2be00a0f966a78bb71f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=9D=B0?= Date: Wed, 25 Jan 2017 22:33:21 +0800 Subject: [PATCH 176/561] [directxtk] do not use win10 sdk (can now built without win10 sdk installed) --- ports/directxtk/CONTROL | 2 +- ports/directxtk/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/directxtk/CONTROL b/ports/directxtk/CONTROL index 8a3da81a6e..97f97ecd9a 100644 --- a/ports/directxtk/CONTROL +++ b/ports/directxtk/CONTROL @@ -1,3 +1,3 @@ Source: directxtk -Version: dec2016 +Version: dec2016-1 Description: A collection of helper classes for writing DirectX 11.x code in C++. diff --git a/ports/directxtk/portfile.cmake b/ports/directxtk/portfile.cmake index 08f8a45371..ebecf50048 100644 --- a/ports/directxtk/portfile.cmake +++ b/ports/directxtk/portfile.cmake @@ -19,19 +19,19 @@ ELSE() ENDIF() vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/DirectXTK_Desktop_2015_Win10.sln + PROJECT_PATH ${SOURCE_PATH}/DirectXTK_Desktop_2015.sln PLATFORM ${BUILD_ARCH} ) file(INSTALL - ${SOURCE_PATH}/Bin/Desktop_2015_Win10/${BUILD_ARCH}/Release/DirectXTK.lib + ${SOURCE_PATH}/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXTK.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) file(INSTALL - ${SOURCE_PATH}/Bin/Desktop_2015_Win10/${BUILD_ARCH}/Debug/DirectXTK.lib + ${SOURCE_PATH}/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXTK.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -set(DXTK_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/directxtk) +set(DXTK_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools) file(MAKE_DIRECTORY ${DXTK_TOOL_PATH}) file(INSTALL From db9ea49377ef1e393d7c8e8ac64b4cfc42bbe99c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=9D=B0?= Date: Wed, 25 Jan 2017 22:37:18 +0800 Subject: [PATCH 177/561] [directxtk] rollback toolpath --- ports/directxtk/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/directxtk/portfile.cmake b/ports/directxtk/portfile.cmake index ebecf50048..fc4418d75a 100644 --- a/ports/directxtk/portfile.cmake +++ b/ports/directxtk/portfile.cmake @@ -31,7 +31,7 @@ file(INSTALL ${SOURCE_PATH}/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXTK.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -set(DXTK_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools) +set(DXTK_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/directxtk) file(MAKE_DIRECTORY ${DXTK_TOOL_PATH}) file(INSTALL From c42d3b3677d84eaa1e2b9325e1fbf95b2f52fc3c Mon Sep 17 00:00:00 2001 From: Olaf van der Spek Date: Wed, 25 Jan 2017 16:55:36 +0100 Subject: [PATCH 178/561] Update CONTROL --- ports/libmariadb/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libmariadb/CONTROL b/ports/libmariadb/CONTROL index a42f79ee5f..26e23810ad 100644 --- a/ports/libmariadb/CONTROL +++ b/ports/libmariadb/CONTROL @@ -1,3 +1,3 @@ Source: libmariadb Version: 2.3.2 -Description: The MariaDB Connector/C is used to connect applications developed in C/C++ to MariaDB and MySQL databases. \ No newline at end of file +Description: MariaDB Connector/C is used to connect C/C++ applications to MariaDB and MySQL databases From 73f4c47d761e51cdc0682df88dead76b407f1058 Mon Sep 17 00:00:00 2001 From: Olaf van der Spek Date: Wed, 25 Jan 2017 19:09:01 +0100 Subject: [PATCH 179/561] Update commands_update.cpp --- toolsrc/src/commands_update.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index 12b4dad506..021bfe7055 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -84,7 +84,7 @@ namespace vcpkg::Commands::Update { if (maj1 != maj2 || min1 != min2 || rev1 != rev2) { - System::println("Different source is available for vcpkg (%d.%d.%d -> %d.%d.%d). Use scripts\\bootstrap.ps1 to update.", + System::println("Different source is available for vcpkg (%d.%d.%d -> %d.%d.%d). Use powershell -exec bypass scripts/bootstrap.ps1 to update.", maj2, min2, rev2, maj1, min1, rev1); } From 8ea9781f4f1600996d6b339ea77836b8bf298c5f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 12:47:19 -0800 Subject: [PATCH 180/561] [boost] Bump version --- ports/boost/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 0abbac659d..76d19763ce 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost -Version: 1.62-11 +Version: 1.62-12 Description: Peer-reviewed portable C++ source libraries Build-Depends: zlib From 3d1b72ea05bd4065a3cc5eb57cac1d9277451d0f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 14:20:17 -0800 Subject: [PATCH 181/561] Move MachineType.cpp to src\ --- toolsrc/{ => src}/MachineType.cpp | 0 toolsrc/vcpkg/vcpkg.vcxproj | 2 +- toolsrc/vcpkg/vcpkg.vcxproj.filters | 6 +++--- 3 files changed, 4 insertions(+), 4 deletions(-) rename toolsrc/{ => src}/MachineType.cpp (100%) diff --git a/toolsrc/MachineType.cpp b/toolsrc/src/MachineType.cpp similarity index 100% rename from toolsrc/MachineType.cpp rename to toolsrc/src/MachineType.cpp diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 15673e0487..8bf3854a1d 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -125,7 +125,6 @@ - @@ -143,6 +142,7 @@ + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 1f43777b83..7e7ec69127 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -66,9 +66,6 @@ Source Files - - Source Files - Source Files @@ -96,6 +93,9 @@ Source Files + + Source Files + From d04e78815a82b52af8b36d14fd68703936199ce3 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 25 Jan 2017 15:05:30 -0800 Subject: [PATCH 182/561] [vcpkg] Do not build tests when running scripts\bootstrap.ps1. --- scripts/bootstrap.ps1 | 2 +- toolsrc/dirs.proj | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 toolsrc/dirs.proj diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index a37ed99aad..98ccb40ad7 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -26,7 +26,7 @@ try{ $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $msbuildExe = $msbuildExeWithPlatformToolset[0] $platformToolset = $msbuildExeWithPlatformToolset[1] - & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /m + & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /m dirs.proj Write-Verbose("Placing vcpkg.exe in the correct location") diff --git a/toolsrc/dirs.proj b/toolsrc/dirs.proj new file mode 100644 index 0000000000..06bfd6b5de --- /dev/null +++ b/toolsrc/dirs.proj @@ -0,0 +1,22 @@ + + + $(MSBuildThisFileDirectory) + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 25872147c1016fea74aac5627880fb7d40c0c1f7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 16:44:56 -0800 Subject: [PATCH 183/561] Add quotes are port name in error message --- toolsrc/src/commands_edit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index 3297b52956..cb457a9e26 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -11,7 +11,7 @@ namespace vcpkg::Commands::Edit const std::string port_name = args.command_arguments.at(0); const fs::path portpath = paths.ports / port_name; - Checks::check_exit(fs::is_directory(portpath), "Could not find port named %s", port_name); + Checks::check_exit(fs::is_directory(portpath), R"(Could not find port named "%s")", port_name); // Find editor std::wstring env_EDITOR = System::wdupenv_str(L"EDITOR"); From fe96dcab61c3acdabf446463bf1f538d3148863a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 25 Jan 2017 17:25:56 -0800 Subject: [PATCH 184/561] [gdal] Bump version to correspond with adding external libpng dependency. --- ports/gdal/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/gdal/CONTROL b/ports/gdal/CONTROL index e22e97ba87..16b1caa7ec 100644 --- a/ports/gdal/CONTROL +++ b/ports/gdal/CONTROL @@ -1,4 +1,4 @@ Source: gdal -Version: 1.11.3 +Version: 1.11.3-1 Description: The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data. Build-Depends: proj, libpng From 7bd267bc13906bdb7f89cee4e71a53822c473fef Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 25 Jan 2017 17:27:53 -0800 Subject: [PATCH 185/561] [boost] Bump version to correspond with added bzip2 dependency. --- ports/boost/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index f5676974ac..039cef7212 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost -Version: 1.62-11 +Version: 1.62-12 Description: Peer-reviewed portable C++ source libraries Build-Depends: zlib, bzip2 From 8b602f97c83613862837d842263a17850828e953 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 18:32:24 -0800 Subject: [PATCH 186/561] [vcpkg_copy_pdbs] Force output to be in en-us. Resolves #587 --- scripts/cmake/vcpkg_copy_pdbs.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/cmake/vcpkg_copy_pdbs.cmake b/scripts/cmake/vcpkg_copy_pdbs.cmake index 10cd1b2d35..61ad977288 100644 --- a/scripts/cmake/vcpkg_copy_pdbs.cmake +++ b/scripts/cmake/vcpkg_copy_pdbs.cmake @@ -13,6 +13,9 @@ function(vcpkg_copy_pdbs) set(DLLS_WITHOUT_MATCHING_PDBS) + set(PREVIOUS_VSLANG $ENV{VSLANG}) + set(ENV{VSLANG} 1033) + foreach(DLL ${DLLS}) execute_process(COMMAND dumpbin /PDBPATH ${DLL} COMMAND findstr PDB @@ -31,6 +34,8 @@ function(vcpkg_copy_pdbs) endif() endforeach() + set(ENV{VSLANG} ${PREVIOUS_VSLANG}) + list(LENGTH DLLS_WITHOUT_MATCHING_PDBS UNMATCHED_DLLS_LENGTH) if(UNMATCHED_DLLS_LENGTH GREATER 0) merge_filelist(MSG DLLS_WITHOUT_MATCHING_PDBS) From a026f0d10c86352a97c4db2f66a0ba5627b2fe17 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:07:18 -0800 Subject: [PATCH 187/561] Remove vcpkgmetrics.vcxproj. Merge it into vcpkglib.vcxproj --- toolsrc/dirs.proj | 1 - toolsrc/vcpkg.sln | 10 -- toolsrc/vcpkg/vcpkg.vcxproj | 3 - toolsrc/vcpkglib/vcpkglib.vcxproj | 13 +- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 + toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj | 137 ------------------ .../vcpkgmetrics/vcpkgmetrics.vcxproj.filters | 27 ---- .../vcpkgmetricsuploader.vcxproj | 4 +- toolsrc/vcpkgtest/vcpkgtest.vcxproj | 3 - 9 files changed, 17 insertions(+), 187 deletions(-) delete mode 100644 toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj delete mode 100644 toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj.filters diff --git a/toolsrc/dirs.proj b/toolsrc/dirs.proj index 06bfd6b5de..55de4fcd42 100644 --- a/toolsrc/dirs.proj +++ b/toolsrc/dirs.proj @@ -6,7 +6,6 @@ - diff --git a/toolsrc/vcpkg.sln b/toolsrc/vcpkg.sln index 83051670a7..ded66d86e2 100644 --- a/toolsrc/vcpkg.sln +++ b/toolsrc/vcpkg.sln @@ -9,8 +9,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgcommon", "vcpkgcommon\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkglib", "vcpkglib\vcpkglib.vcxproj", "{B98C92B7-2874-4537-9D46-D14E5C237F04}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgmetrics", "vcpkgmetrics\vcpkgmetrics.vcxproj", "{7226078C-1D2A-4123-9EF1-8DF2B722B8F1}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgmetricsuploader", "vcpkgmetricsuploader\vcpkgmetricsuploader.vcxproj", "{7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgtest", "vcpkgtest\vcpkgtest.vcxproj", "{F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}" @@ -47,14 +45,6 @@ Global {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x64.Build.0 = Release|x64 {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x86.ActiveCfg = Release|Win32 {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x86.Build.0 = Release|Win32 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Debug|x64.ActiveCfg = Debug|x64 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Debug|x64.Build.0 = Debug|x64 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Debug|x86.ActiveCfg = Debug|Win32 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Debug|x86.Build.0 = Debug|Win32 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Release|x64.ActiveCfg = Release|x64 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Release|x64.Build.0 = Release|x64 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Release|x86.ActiveCfg = Release|Win32 - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1}.Release|x86.Build.0 = Release|Win32 {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x64.ActiveCfg = Debug|x64 {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x64.Build.0 = Debug|x64 {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x86.ActiveCfg = Debug|Win32 diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 8bf3854a1d..cf5b56cec1 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -171,9 +171,6 @@ {b98c92b7-2874-4537-9d46-d14e5c237f04} - - {7226078c-1d2a-4123-9ef1-8df2b722b8f1} - diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 561b224772..eefc43c267 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -47,6 +47,9 @@ true MultiByte + + 0 + @@ -72,7 +75,7 @@ Disabled true ..\include - VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) + DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) @@ -82,7 +85,7 @@ Disabled true ..\include - VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) + DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) @@ -94,7 +97,7 @@ true true ..\include - VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) + DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) @@ -110,7 +113,7 @@ true true ..\include - VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) + DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) @@ -121,6 +124,7 @@ + @@ -136,6 +140,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index e8856235c5..9b7a3779f4 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -54,6 +54,9 @@ Source Files + + Source Files + @@ -95,5 +98,8 @@ Header Files + + Header Files + \ No newline at end of file diff --git a/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj b/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj deleted file mode 100644 index 66cf522325..0000000000 --- a/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj +++ /dev/null @@ -1,137 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {7226078C-1D2A-4123-9EF1-8DF2B722B8F1} - vcpkgmetrics - 8.1 - v140 - - - - StaticLibrary - true - MultiByte - - - StaticLibrary - false - true - MultiByte - - - StaticLibrary - true - MultiByte - - - StaticLibrary - false - true - MultiByte - - - 0 - - - - - - - - - - - - - - - - - - - - - - - Level3 - Disabled - true - ..\include - - - - - Level3 - Disabled - true - ..\include - - - - - Level3 - MaxSpeed - true - true - true - ..\include - DISABLE_METRICS=$(DISABLE_METRICS);_MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - - - true - true - - - - - Level3 - MaxSpeed - true - true - true - ..\include - DISABLE_METRICS=$(DISABLE_METRICS);_MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - - - true - true - - - - - DISABLE_METRICS=$(DISABLE_METRICS);_MBCS;%(PreprocessorDefinitions) - DISABLE_METRICS=$(DISABLE_METRICS);_MBCS;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - /std:c++latest %(AdditionalOptions) - - - - - - - - - - - - \ No newline at end of file diff --git a/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj.filters b/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj.filters deleted file mode 100644 index 7116a42474..0000000000 --- a/toolsrc/vcpkgmetrics/vcpkgmetrics.vcxproj.filters +++ /dev/null @@ -1,27 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Header Files - - - - - Source Files - - - \ No newline at end of file diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index dc666c19ed..9160da1e1a 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -131,8 +131,8 @@ {7129f242-f20c-43e7-bbec-4e15b71890b2} - - {7226078c-1d2a-4123-9ef1-8df2b722b8f1} + + {b98c92b7-2874-4537-9d46-d14e5c237f04} diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index a68d77b461..dab95b9aa5 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -29,9 +29,6 @@ {b98c92b7-2874-4537-9d46-d14e5c237f04} - - {7226078c-1d2a-4123-9ef1-8df2b722b8f1} - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D} From b8253457092e4b1eb274fa75da891b9a20305816 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:14:53 -0800 Subject: [PATCH 188/561] Move all sources (except main.cpp) from vcpkg.vcxproj to vcpkglib.vcxproj --- toolsrc/vcpkg/vcpkg.vcxproj | 43 +-------- toolsrc/vcpkg/vcpkg.vcxproj.filters | 107 ---------------------- toolsrc/vcpkglib/vcpkglib.vcxproj | 37 +++++++- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 105 +++++++++++++++++++++ 4 files changed, 144 insertions(+), 148 deletions(-) diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index cf5b56cec1..476b1fabcd 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -124,46 +124,6 @@ winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {7129f242-f20c-43e7-bbec-4e15b71890b2} @@ -172,6 +132,9 @@ {b98c92b7-2874-4537-9d46-d14e5c237f04} + + + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 7e7ec69127..04e008bd86 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -18,112 +18,5 @@ Source Files - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - \ No newline at end of file diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index eefc43c267..10f1bdcdaf 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -47,7 +47,7 @@ true MultiByte - + 0 @@ -124,23 +124,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -150,6 +181,10 @@ + + + + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 9b7a3779f4..41ee0a4bda 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -57,6 +57,84 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + @@ -101,5 +179,32 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + \ No newline at end of file From 59be40a100910d1f833cd54762e624b7123965ed Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:32:50 -0800 Subject: [PATCH 189/561] Rename vcpkg.h/cpp to vcpkglib.h/cpp --- toolsrc/include/{vcpkg.h => vcpkglib.h} | 0 toolsrc/src/commands_build.cpp | 2 +- toolsrc/src/commands_build_external.cpp | 2 +- toolsrc/src/commands_install.cpp | 2 +- toolsrc/src/commands_list.cpp | 2 +- toolsrc/src/commands_owns.cpp | 2 +- toolsrc/src/commands_remove.cpp | 2 +- toolsrc/src/commands_update.cpp | 2 +- toolsrc/src/vcpkg_Dependencies.cpp | 2 +- toolsrc/src/{vcpkg.cpp => vcpkglib.cpp} | 2 +- toolsrc/vcpkglib/vcpkglib.vcxproj | 4 ++-- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 12 ++++++------ 12 files changed, 17 insertions(+), 17 deletions(-) rename toolsrc/include/{vcpkg.h => vcpkglib.h} (100%) rename toolsrc/src/{vcpkg.cpp => vcpkglib.cpp} (99%) diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkglib.h similarity index 100% rename from toolsrc/include/vcpkg.h rename to toolsrc/include/vcpkglib.h diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index e7e005100c..629cbbb5f5 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -1,6 +1,6 @@ #include "vcpkg_Commands.h" #include "StatusParagraphs.h" -#include "vcpkg.h" +#include "vcpkglib.h" #include "vcpkg_Input.h" #include "post_build_lint.h" #include "vcpkg_Dependencies.h" diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index 09a9256d78..51dc29e864 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -2,7 +2,7 @@ #include "vcpkg_System.h" #include "vcpkg_Environment.h" #include "vcpkg_Input.h" -#include "vcpkg.h" +#include "vcpkglib.h" namespace vcpkg::Commands::BuildExternal { diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index ff517d9b1c..6fc0e32f0a 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -1,5 +1,5 @@ #include "vcpkg_Commands.h" -#include "vcpkg.h" +#include "vcpkglib.h" #include "vcpkg_Environment.h" #include "metrics.h" #include "vcpkg_Files.h" diff --git a/toolsrc/src/commands_list.cpp b/toolsrc/src/commands_list.cpp index d9c4a52f23..18e95d4055 100644 --- a/toolsrc/src/commands_list.cpp +++ b/toolsrc/src/commands_list.cpp @@ -1,5 +1,5 @@ #include "vcpkg_Commands.h" -#include "vcpkg.h" +#include "vcpkglib.h" #include "vcpkg_System.h" #include "vcpkglib_helpers.h" diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp index bb1a7eb9ff..fe02b62247 100644 --- a/toolsrc/src/commands_owns.cpp +++ b/toolsrc/src/commands_owns.cpp @@ -1,6 +1,6 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" -#include "vcpkg.h" +#include "vcpkglib.h" namespace vcpkg::Commands::Owns { diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 23d981fc1d..4b53f47785 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -1,5 +1,5 @@ #include "vcpkg_Commands.h" -#include "vcpkg.h" +#include "vcpkglib.h" #include "vcpkg_System.h" #include "vcpkg_Input.h" #include diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index 021bfe7055..d7a554303b 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -1,5 +1,5 @@ #include "vcpkg_Commands.h" -#include "vcpkg.h" +#include "vcpkglib.h" #include "vcpkg_System.h" #include "vcpkg_Files.h" #include "Paragraphs.h" diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index f1464a6055..1daa6de02b 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -7,7 +7,7 @@ #include #include "vcpkg_Maps.h" #include "vcpkg_Files.h" -#include "vcpkg.h" +#include "vcpkglib.h" namespace vcpkg::Dependencies { diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkglib.cpp similarity index 99% rename from toolsrc/src/vcpkg.cpp rename to toolsrc/src/vcpkglib.cpp index eb2184ccbb..5cea0c585e 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkglib.cpp @@ -1,4 +1,4 @@ -#include "vcpkg.h" +#include "vcpkglib.h" #include #include #include diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 10f1bdcdaf..0247e8cc34 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -136,7 +136,7 @@ - + @@ -172,7 +172,7 @@ - + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 41ee0a4bda..41fce6541c 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -45,9 +45,6 @@ Source Files - - Source Files - Source Files @@ -135,11 +132,11 @@ Source Files + + Source Files + - - Header Files - Header Files @@ -206,5 +203,8 @@ Header Files + + Header Files + \ No newline at end of file From 31ddf1a80393d825925cf45b4573710423d14233 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:34:25 -0800 Subject: [PATCH 190/561] Rename main.cpp to vcpkg.cpp --- toolsrc/src/{main.cpp => vcpkg.cpp} | 0 toolsrc/vcpkg/vcpkg.vcxproj.filters | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename toolsrc/src/{main.cpp => vcpkg.cpp} (100%) diff --git a/toolsrc/src/main.cpp b/toolsrc/src/vcpkg.cpp similarity index 100% rename from toolsrc/src/main.cpp rename to toolsrc/src/vcpkg.cpp diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters index 04e008bd86..ca9723bbfe 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -15,7 +15,7 @@ - + Source Files From 2a246f26af6771482938d4052e08ce2fdbad92e8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:38:14 -0800 Subject: [PATCH 191/561] Change check_throw() to check_exit() --- toolsrc/include/vcpkg_Sets.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/include/vcpkg_Sets.h b/toolsrc/include/vcpkg_Sets.h index 6dec95b899..ec48008646 100644 --- a/toolsrc/include/vcpkg_Sets.h +++ b/toolsrc/include/vcpkg_Sets.h @@ -8,7 +8,7 @@ namespace vcpkg::Sets template void remove_all(std::unordered_set* input_set, Container remove_these) { - Checks::check_throw(input_set != nullptr, "Input set cannot be null"); + Checks::check_exit(input_set != nullptr, "Input set cannot be null"); for (const T& r : remove_these) { input_set->erase(r); From f28125f0138f0257579b3e32612049529cbe504b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:50:56 -0800 Subject: [PATCH 192/561] Remove vcpkgcommon.vcxproj. Merge it into vcpkglib.vcxproj --- toolsrc/vcpkg.sln | 10 -- toolsrc/vcpkg/vcpkg.vcxproj | 5 +- toolsrc/vcpkgcommon/vcpkgcommon.vcxproj | 142 ------------------ .../vcpkgcommon/vcpkgcommon.vcxproj.filters | 69 --------- toolsrc/vcpkglib/vcpkglib.vcxproj | 16 ++ toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 48 ++++++ .../vcpkgmetricsuploader.vcxproj | 3 - toolsrc/vcpkgtest/vcpkgtest.vcxproj | 3 - 8 files changed, 65 insertions(+), 231 deletions(-) delete mode 100644 toolsrc/vcpkgcommon/vcpkgcommon.vcxproj delete mode 100644 toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters diff --git a/toolsrc/vcpkg.sln b/toolsrc/vcpkg.sln index ded66d86e2..c97756c212 100644 --- a/toolsrc/vcpkg.sln +++ b/toolsrc/vcpkg.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkg", "vcpkg\vcpkg.vcxproj", "{34671B80-54F9-46F5-8310-AC429C11D4FB}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgcommon", "vcpkgcommon\vcpkgcommon.vcxproj", "{7129F242-F20C-43E7-BBEC-4E15B71890B2}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkglib", "vcpkglib\vcpkglib.vcxproj", "{B98C92B7-2874-4537-9D46-D14E5C237F04}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgmetricsuploader", "vcpkgmetricsuploader\vcpkgmetricsuploader.vcxproj", "{7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}" @@ -29,14 +27,6 @@ Global {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x64.Build.0 = Release|x64 {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x86.ActiveCfg = Release|Win32 {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x86.Build.0 = Release|Win32 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Debug|x64.ActiveCfg = Debug|x64 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Debug|x64.Build.0 = Debug|x64 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Debug|x86.ActiveCfg = Debug|Win32 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Debug|x86.Build.0 = Debug|Win32 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Release|x64.ActiveCfg = Release|x64 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Release|x64.Build.0 = Release|x64 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Release|x86.ActiveCfg = Release|Win32 - {7129F242-F20C-43E7-BBEC-4E15B71890B2}.Release|x86.Build.0 = Release|Win32 {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x64.ActiveCfg = Debug|x64 {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x64.Build.0 = Debug|x64 {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x86.ActiveCfg = Debug|Win32 diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 476b1fabcd..c256173e31 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -125,15 +125,12 @@ - - {7129f242-f20c-43e7-bbec-4e15b71890b2} - {b98c92b7-2874-4537-9d46-d14e5c237f04} - + diff --git a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj deleted file mode 100644 index 2504a0227d..0000000000 --- a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj +++ /dev/null @@ -1,142 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {7129F242-F20C-43E7-BBEC-4E15B71890B2} - vcpkgcommon - 8.1 - v140 - - - - StaticLibrary - true - MultiByte - - - StaticLibrary - false - true - MultiByte - - - StaticLibrary - true - MultiByte - - - StaticLibrary - false - true - MultiByte - - - - - - - - - - - - - - - - - - - - - - - Level3 - Disabled - true - ..\include - /std:c++latest %(AdditionalOptions) - - - - - Level3 - Disabled - true - ..\include - /std:c++latest %(AdditionalOptions) - - - - - Level3 - MaxSpeed - true - true - true - ..\include - _MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - - - true - true - - - - - Level3 - MaxSpeed - true - true - true - ..\include - _MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - - - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters b/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters deleted file mode 100644 index bba605c54d..0000000000 --- a/toolsrc/vcpkgcommon/vcpkgcommon.vcxproj.filters +++ /dev/null @@ -1,69 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 0247e8cc34..0163fe1732 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -125,9 +125,12 @@ + + + @@ -135,16 +138,24 @@ + + + + + + + + @@ -172,6 +183,7 @@ + @@ -181,12 +193,16 @@ + + + + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 41fce6541c..faac8cd67b 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -135,6 +135,21 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + @@ -206,5 +221,38 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + \ No newline at end of file diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index 9160da1e1a..c925a0b31e 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -128,9 +128,6 @@ - - {7129f242-f20c-43e7-bbec-4e15b71890b2} - {b98c92b7-2874-4537-9d46-d14e5c237f04} diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index dab95b9aa5..0fb11eb302 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -23,9 +23,6 @@ - - {7129f242-f20c-43e7-bbec-4e15b71890b2} - {b98c92b7-2874-4537-9d46-d14e5c237f04} From c379962a420afaa17e3041f7ba54585a613818cc Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:53:07 -0800 Subject: [PATCH 193/561] Remove defunct reference to vcpkgcommon.vcxproj --- toolsrc/dirs.proj | 1 - 1 file changed, 1 deletion(-) diff --git a/toolsrc/dirs.proj b/toolsrc/dirs.proj index 55de4fcd42..17d9fa1b0b 100644 --- a/toolsrc/dirs.proj +++ b/toolsrc/dirs.proj @@ -5,7 +5,6 @@ - From 490ddfe2f7362c442190f4da9e41386a8a811681 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 25 Jan 2017 21:14:57 -0800 Subject: [PATCH 194/561] [libarchive] Disable libiconv support This fixes an issue with the detection code on VS2017. Additionally, it appears that the functionality provided by libiconv is minimal on Windows due to the existance of the Win32 conversion APIs. --- ports/libarchive/CONTROL | 4 ++-- ports/libarchive/portfile.cmake | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/libarchive/CONTROL b/ports/libarchive/CONTROL index 43979243c0..96f2de7dd6 100644 --- a/ports/libarchive/CONTROL +++ b/ports/libarchive/CONTROL @@ -1,4 +1,4 @@ Source: libarchive -Version: 3.2.2-1 +Version: 3.2.2-2 Description: Library for reading and writing streaming archives -Build-Depends: zlib, bzip2, libxml2, libiconv, lz4, liblzma, openssl +Build-Depends: zlib, bzip2, libxml2, lz4, liblzma, openssl diff --git a/ports/libarchive/portfile.cmake b/ports/libarchive/portfile.cmake index 731174790a..5a60f1d6d2 100644 --- a/ports/libarchive/portfile.cmake +++ b/ports/libarchive/portfile.cmake @@ -33,6 +33,7 @@ vcpkg_configure_cmake( -DENABLE_XATTR=OFF -DENABLE_ACL=OFF -DENABLE_TEST=OFF + -DENABLE_ICONV=OFF -DPOSIX_REGEX_LIB=NONE OPTIONS_DEBUG -DARCHIVE_SKIP_HEADERS=ON) From 95b67ab8e97135538034d220b9658ad9286429c6 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 26 Jan 2017 11:12:55 +0100 Subject: [PATCH 195/561] [cairo] update port --- ports/cairo/CMakeLists_cairo.txt | 67 +++++++++++++++++++++++++++++++- ports/cairo/CONTROL | 4 +- ports/cairo/cairo-features.h | 9 +++++ ports/cairo/portfile.cmake | 10 +++-- 4 files changed, 82 insertions(+), 8 deletions(-) diff --git a/ports/cairo/CMakeLists_cairo.txt b/ports/cairo/CMakeLists_cairo.txt index f445605b96..85cf9457ce 100644 --- a/ports/cairo/CMakeLists_cairo.txt +++ b/ports/cairo/CMakeLists_cairo.txt @@ -101,6 +101,8 @@ file(GLOB SOURCES "cairo-tor-scan-converter.c" "cairo-tor22-scan-converter.c" "cairo-clip-tor-scan-converter.c" +"cairo-tag-attributes.c" +"cairo-tag-stack.c" "cairo-toy-font-face.c" "cairo-traps.c" "cairo-tristrip.c" @@ -127,6 +129,7 @@ file(GLOB SOURCES "cairo-type1-subset.c" "cairo-type3-glyph-surface.c" # pdf +"cairo-pdf-interchange.c" "cairo-pdf-operators.c" "cairo-pdf-shading.c" "cairo-pdf-surface.c" @@ -140,6 +143,8 @@ file(GLOB SOURCES "cairo-svg-surface.c" # script surface "cairo-script-surface.c" +# fontconfig + freetype +"cairo-ft-font.c" ) set(CMAKE_DEBUG_POSTFIX "d") @@ -222,11 +227,36 @@ endif() add_library(user32 UNKNOWN IMPORTED) set_property(TARGET user32 PROPERTY IMPORTED_LOCATION "${USER32_LIBRARY}") +# Find dependencies of optional modules + +# Find FreeType +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(FREETYPE_SUFFIX d) +endif() +find_library(FREETYPE_LIBRARY freetype${FREETYPE_SUFFIX}) +if (FREETYPE_LIBRARY MATCHES NOTFOUND) + message(FATAL_ERROR "The freetype library could not be found. Check to ensure that it is properly installed.") +endif() + +# Cairo needs to be told which features of FreeType are availible +add_definitions( + -DHAVE_FT_GLYPHSLOT_EMBOLDEN=1 + -DHAVE_FT_LIBRARY_SETLCDFILTER=1 + -DHAVE_FT_GLYPHSLOT_OBLIQUE=1 + -DHAVE_FT_LOAD_SFNT_TABLE=1 + -DHAVE_FT_GET_X11_FONT_FORMAT=1) + +# Find FontConfig +find_library(FONTCONFIG_LIBRARY fontconfig) +if (FONTCONFIG_LIBRARY MATCHES NOTFOUND) + message(FATAL_ERROR "The fontconfig library could not be found. Check to ensure that it is properly installed.") +endif() + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) add_library(cairo ${SOURCES}) # cairo produces a lot of warnings which are disabled here because they otherwise fill up the log files target_compile_options(cairo PUBLIC "/wd4244" PUBLIC "/wd4146" PUBLIC "/wd4312" PUBLIC "/wd4267" PUBLIC "/wd4996" PUBLIC "/wd4311" PUBLIC "/wd4334" PUBLIC "/wd4101") - target_link_libraries(cairo gdi32 msimg32 user32 zlib libpng pixman) + target_link_libraries(cairo gdi32 msimg32 user32 zlib libpng pixman ${FREETYPE_LIBRARY} ${FONTCONFIG_LIBRARY}) install(TARGETS cairo RUNTIME DESTINATION bin @@ -238,7 +268,7 @@ elseif (VCPKG_LIBRARY_LINKAGE STREQUAL static) target_compile_options(cairo-static PUBLIC "/DCAIRO_WIN32_STATIC_BUILD=1") # cairo produces a lot of warnings which are disabled here because they otherwise fill up the log files target_compile_options(cairo-static PUBLIC "/wd4244" PUBLIC "/wd4146" PUBLIC "/wd4312" PUBLIC "/wd4267" PUBLIC "/wd4996" PUBLIC "/wd4311" PUBLIC "/wd4334" PUBLIC "/wd4101") - target_link_libraries(cairo-static gdi32 msimg32 user32 zlib libpng pixman) + target_link_libraries(cairo-static gdi32 msimg32 user32 zlib libpng pixman ${FREETYPE_LIBRARY} ${FONTCONFIG_LIBRARY}) install(TARGETS cairo-static RUNTIME DESTINATION bin @@ -248,3 +278,36 @@ elseif (VCPKG_LIBRARY_LINKAGE STREQUAL static) else() message(FATAL_ERROR "VCPKG_LIBRARY_LINKAGE is not defined or has an unexpected value") endif() + +# GObject support module + +set(CAIRO_GOBJECT_SOURCES + "../util/cairo-gobject/cairo-gobject-enums.c" + "../util/cairo-gobject/cairo-gobject-structs.c") + +# GObject support sources do not include header with export macro +if(BUILD_SHARED_LIBS) + set_source_files_properties( + "../util/cairo-gobject/cairo-gobject-enums.c" + "../util/cairo-gobject/cairo-gobject-structs.c" + PROPERTIES COMPILE_DEFINITIONS cairo_public=__declspec\(dllexport\)) +endif() + +# Make GLib's GObject available +find_library(GLIB_LIBRARY NAMES glib-2.0) +find_library(GOBJECT_LIBRARY NAMES gobject-2.0) +set(GLIB_LIBRARIES ${GLIB_LIBRARY} ${GOBJECT_LIBRARY}) +if (GLIB_LIBRARIES MATCHES NOTFOUND) + message(FATAL_ERROR "The glib library could not be found. Check to ensure that it is properly installed.") +endif() + +add_library(cairo-gobject ${CAIRO_GOBJECT_SOURCES}) +if(BUILD_SHARED_LIBS) + target_link_libraries(cairo-gobject cairo ${GLIB_LIBRARIES}) +else() + target_link_libraries(cairo-gobject cairo-static ${GLIB_LIBRARIES}) +endif() +install(TARGETS cairo-gobject + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) diff --git a/ports/cairo/CONTROL b/ports/cairo/CONTROL index 017569c507..89ba03b790 100644 --- a/ports/cairo/CONTROL +++ b/ports/cairo/CONTROL @@ -1,4 +1,4 @@ Source: cairo -Version: 1.14.6 +Version: 1.15.4 Description: Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB. -Build-Depends: zlib, libpng, pixman +Build-Depends: zlib, libpng, pixman, glib, freetype, fontconfig diff --git a/ports/cairo/cairo-features.h b/ports/cairo/cairo-features.h index b9277b7f75..3a1963974b 100644 --- a/ports/cairo/cairo-features.h +++ b/ports/cairo/cairo-features.h @@ -24,4 +24,13 @@ #define CAIRO_HAS_OBSERVER_SURFACE 1 #define CAIRO_HAS_USER_FONT 1 +/* Require GObject */ +#define CAIRO_HAS_GOBJECT_FUNCTIONS 1 + +/* Require FreeType */ +#define CAIRO_HAS_FT_FONT 1 + +/* Require FontConfig */ +#define CAIRO_HAS_FC_FONT 1 + #endif diff --git a/ports/cairo/portfile.cmake b/ports/cairo/portfile.cmake index 2131bd146c..57b45e91c0 100644 --- a/ports/cairo/portfile.cmake +++ b/ports/cairo/portfile.cmake @@ -7,11 +7,11 @@ # include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cairo-1.14.6) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cairo-1.15.4) vcpkg_download_distfile(ARCHIVE - URLS "https://www.cairographics.org/releases/cairo-1.14.6.tar.xz" - FILENAME "cairo-1.14.6.tar.xz" - SHA512 e2aa17a33b95b68d407b53ac321cca15b0c148eb49b8639c75b2af1e75e7b417a2168ea978dabb8581b341f0f45dc042d3b1a56b01ab525b1984015f0865316b + URLS "http://cairographics.org/snapshots/cairo-1.15.4.tar.xz" + FILENAME "cairo-1.15.4.tar.xz" + SHA512 ac3e6879fcf0876bca9f801cdf9e970ef1822644228cdd21962d0bf5db5fc074973f4ae651eb9c76b44fffd405cf0a0c7cbb228dba96b835ea137a2740277ee9 ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -43,6 +43,8 @@ file(COPY "${SOURCE_PATH}/src/cairo-svg.h" "${SOURCE_PATH}/cairo-version.h" "${SOURCE_PATH}/src/cairo-win32.h" +"${SOURCE_PATH}/util/cairo-gobject/cairo-gobject.h" +"${SOURCE_PATH}/src/cairo-ft.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include ) From 1df57b358591a6bf9fa60955a65b8944f20547f2 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 26 Jan 2017 11:25:24 +0100 Subject: [PATCH 196/561] [harfbuzz] add glib support --- ports/harfbuzz/portfile.cmake | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 911dea8606..83f2679120 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -21,18 +21,31 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include" FREETYPE_INCLUDE_DIR) -file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/lib" FREETYPE_LIB_DIR_DBG) -file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib" FREETYPE_LIB_DIR_REL) +file(WRITE ${SOURCE_PATH}/win32/msvc_recommended_pragmas.h "/* I'm expected to exist */") + +# for GObject support, harfbuzz expects glib-mkenums tool (perl script) to be availible in $(PREFIX)/bin +file(COPY ${CURRENT_INSTALLED_DIR}/tools/glib/glib-mkenums DESTINATION ${SOURCE_PATH}/bin) +vcpkg_find_acquire_program(PERL) + +file(TO_NATIVE_PATH "${PERL}" PERL_INTERPRETER) +file(TO_NATIVE_PATH "${SOURCE_PATH}" MKENUMS_TOOL_DIR) + +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include" INCLUDE_DIR) +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/lib" LIB_DIR_DBG) +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib" LIB_DIR_REL) + +set(DEPENDENCIES FREETYPE=1 GLIB=1 GOBJECT=1) vcpkg_execute_required_process( - COMMAND ${NMAKE} -f Makefile.vc CFG=debug FREETYPE=1 FREETYPE_DIR=${FREETYPE_INCLUDE_DIR} ADDITIONAL_LIB_DIR=${FREETYPE_LIB_DIR_DBG} + COMMAND ${NMAKE} -f Makefile.vc CFG=debug ${DEPENDENCIES} FREETYPE_DIR=${INCLUDE_DIR} ADDITIONAL_LIB_DIR=${LIB_DIR_DBG} + PREFIX=${MKENUMS_TOOL_DIR} PERL=${PERL_INTERPRETER} WORKING_DIRECTORY ${SOURCE_PATH}/win32/ LOGNAME nmake-build-${TARGET_TRIPLET}-debug ) vcpkg_execute_required_process( - COMMAND ${NMAKE} -f Makefile.vc CFG=release FREETYPE=1 FREETYPE_DIR=${FREETYPE_INCLUDE_DIR} ADDITIONAL_LIB_DIR=${FREETYPE_LIB_DIR_REL} + COMMAND ${NMAKE} -f Makefile.vc CFG=release ${DEPENDENCIES} FREETYPE_DIR=${INCLUDE_DIR} ADDITIONAL_LIB_DIR=${LIB_DIR_REL} + PREFIX=${MKENUMS_TOOL_DIR} PERL=${PERL_INTERPRETER} WORKING_DIRECTORY ${SOURCE_PATH}/win32/ LOGNAME nmake-build-${TARGET_TRIPLET}-release ) @@ -40,7 +53,7 @@ vcpkg_execute_required_process( file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/debug" NATIVE_PACKAGES_DIR_DBG) vcpkg_execute_required_process( - COMMAND ${NMAKE} -f Makefile.vc CFG=debug FREETYPE=1 PREFIX=${NATIVE_PACKAGES_DIR_DBG} install + COMMAND ${NMAKE} -f Makefile.vc CFG=debug ${DEPENDENCIES} PREFIX=${NATIVE_PACKAGES_DIR_DBG} install WORKING_DIRECTORY ${SOURCE_PATH}/win32/ LOGNAME nmake-install-${TARGET_TRIPLET}-debug ) @@ -49,11 +62,16 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR_REL) vcpkg_execute_required_process( - COMMAND ${NMAKE} -f Makefile.vc CFG=release FREETYPE=1 PREFIX=${NATIVE_PACKAGES_DIR_REL} install + COMMAND ${NMAKE} -f Makefile.vc CFG=release ${DEPENDENCIES} PREFIX=${NATIVE_PACKAGES_DIR_REL} install WORKING_DIRECTORY ${SOURCE_PATH}/win32/ LOGNAME nmake-install-${TARGET_TRIPLET}-release ) +file(GLOB EXECUTABLES + ${CURRENT_PACKAGES_DIR}/bin/*.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) +file(REMOVE ${EXECUTABLES}) + # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/harfbuzz) file(RENAME ${CURRENT_PACKAGES_DIR}/share/harfbuzz/COPYING ${CURRENT_PACKAGES_DIR}/share/harfbuzz/copyright) From 95e1f378fdacb537d3f093aafdd8a36a03c7a3b9 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 26 Jan 2017 11:59:48 +0100 Subject: [PATCH 197/561] [harfbuzz] bump version --- ports/harfbuzz/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index eab88ff114..8624853aae 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,4 +1,4 @@ Source: harfbuzz -Version: 1.3.4 +Version: 1.3.4-1 Description: HarfBuzz OpenType text shaping engine Build-Depends: freetype From d2ef8f847e56f97ab988c3314c3b064497571955 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 26 Jan 2017 12:24:17 +0100 Subject: [PATCH 198/561] [harfbuzz] list glib as dependency --- ports/harfbuzz/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index 8624853aae..526dca3b36 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,4 +1,4 @@ Source: harfbuzz Version: 1.3.4-1 Description: HarfBuzz OpenType text shaping engine -Build-Depends: freetype +Build-Depends: freetype, glib From 4be93bac78aaba43ea562b454dc14ca5a391e570 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 13:08:35 -0800 Subject: [PATCH 199/561] [Stopwatch] Specify elapsedNanos = 0 on construction --- toolsrc/src/Stopwatch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/Stopwatch.cpp b/toolsrc/src/Stopwatch.cpp index 550f1ebd80..b0e54e381a 100644 --- a/toolsrc/src/Stopwatch.cpp +++ b/toolsrc/src/Stopwatch.cpp @@ -88,7 +88,7 @@ namespace vcpkg return Strings::format("%.4g ns", nanos_as_double); } - Stopwatch::Stopwatch() : m_isRunning(false), m_elapsedNanos(), m_startTick() + Stopwatch::Stopwatch() : m_isRunning(false), m_elapsedNanos(0), m_startTick() { } From fb7cc35f30e98c265c5ea8831987440f37126d2c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 13:28:07 -0800 Subject: [PATCH 200/561] [boost] Update to 1.63 --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 039cef7212..2cc98f16b3 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost -Version: 1.62-12 +Version: 1.63 Description: Peer-reviewed portable C++ source libraries Build-Depends: zlib, bzip2 diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index f9c0a0a34c..d8f0a23d12 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -1,22 +1,22 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/boost_1_62_0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/boost_1_63_0) vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://sourceforge.net/projects/boost/files/boost/1.62.0/boost_1_62_0.tar.bz2" - FILENAME "boost_1_62_0.tar.bz2" - SHA512 5385ae3d5255a433a704169ad454d8dc2b0b5bcae3fb23defd6570df4ff7d845cf9fcbeebccdc1c5db0eec9f82ee3d90040de9507c8167467c635d3b215463be + URLS "https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.tar.bz2" + FILENAME "boost_1_63_0.tar.bz2" + SHA512 c915c5f5778dee49b8e9d0a40f37f90f56fb1fdb1d8ce92d97bf48bc7bc462212487badfe4bbe30b06196d1149cfb221da12ac54e97499b0d4cb6466813bb4ad ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) # apply boost range hotfix vcpkg_download_distfile(DIFF URLS "https://github.com/boostorg/range/commit/e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff" - FILENAME "boost-range-has_range_interator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff" + FILENAME "boost-range-has_range_iterator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff" SHA512 77dad42bfd9bbab2bbddf361d5b7ad3dd6f812f4294c6dd1a677bb4d0191a4fff43bca32fdd4fce05d428562abb6e38afd0fd33ca6a8b5f28481d70cd2f3dd67 ) FILE(READ "${DIFF}" content) STRING(REGEX REPLACE "include/" "" content "${content}") -set(DIFF2 ${CURRENT_BUILDTREES_DIR}/src/boost-range-has_range_interator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff.fixed) +set(DIFF2 ${CURRENT_BUILDTREES_DIR}/src/boost-range-has_range_iterator-hotfix_e7ebe14707130cda7b72e0ae5e93b17157fdb6a2.diff.fixed) FILE(WRITE ${DIFF2} "${content}") vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} PATCHES ${DIFF2}) @@ -63,7 +63,7 @@ if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") endif() # Add build type specific options -set(B2_OPTIONS_DBG +set(B2_OPTIONS_DBG ${B2_OPTIONS} -sZLIB_BINARY=zlibd -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib" @@ -71,7 +71,7 @@ set(B2_OPTIONS_DBG -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}\\debug\\lib" ) -set(B2_OPTIONS_REL +set(B2_OPTIONS_REL ${B2_OPTIONS} -sZLIB_BINARY=zlib -sZLIB_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" @@ -128,7 +128,7 @@ file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/ message(STATUS "Packaging headers done") # This function makes the static build lib names match the dynamic build lib names which FindBoost.cmake is looking for by default. -# It also renames a couple of "libboost" lib files in the dynamic build (for example libboost_exception-vc140-mt-1_62.lib). +# It also renames a couple of "libboost" lib files in the dynamic build (for example libboost_exception-vc140-mt-1_63.lib). function(boost_rename_libs LIBS) foreach(LIB ${${LIBS}}) get_filename_component(OLD_FILENAME ${LIB} NAME) From 8bc3c1f06267bd49119a0fa1bfea8b9bfdde194f Mon Sep 17 00:00:00 2001 From: Eric Mittelette Date: Thu, 26 Jan 2017 16:27:52 -0800 Subject: [PATCH 201/561] add xercesc --- ports/xercesc/CONTROL | 3 +++ ports/xercesc/portfile.cmake | 40 ++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 ports/xercesc/CONTROL create mode 100644 ports/xercesc/portfile.cmake diff --git a/ports/xercesc/CONTROL b/ports/xercesc/CONTROL new file mode 100644 index 0000000000..497ef66c3d --- /dev/null +++ b/ports/xercesc/CONTROL @@ -0,0 +1,3 @@ +Source: xercesc +Version: 3.1.4 +Description: Xerces-C++ is a XML parser, for parsing, generating, manipulating, and validating XML documents using the DOM, SAX, and SAX2 APIs. diff --git a/ports/xercesc/portfile.cmake b/ports/xercesc/portfile.cmake new file mode 100644 index 0000000000..bf2a2ee59e --- /dev/null +++ b/ports/xercesc/portfile.cmake @@ -0,0 +1,40 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/xerces-c-3.1.4) + +vcpkg_download_distfile(ARCHIVE + URLS "http://www-us.apache.org/dist//xerces/c/3/sources/xerces-c-3.1.4.zip" + FILENAME "xerces-c-3.1.4.zip" + SHA512 3ba1bf38875bda8a294990dba73143cfd6dbfa158b17f4db1fd0ee9a08a078af969103200eaf8957756f8363c8a661983cc95124b4978eb2162dc0344a85fff8 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +if (TRIPLET_SYSTEM_ARCH MATCHES "x86") + set(BUILD_ARCH "Win32") +else() + set(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +endif() + + +vcpkg_build_msbuild( + #PROJECT_PATH ${SOURCE_PATH}/projects/Win32/VC14/xerces-all/xerces-all.sln + PROJECT_PATH ${SOURCE_PATH}/projects/Win32/VC14/xerces-all/xercesLib/xercesLib.vcxproj + PLATFORM ${BUILD_ARCH}) + + +file(COPY ${SOURCE_PATH}/src/xercesc DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.hpp) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xercesc/NLS) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xercesc/util/MsgLoaders/ICU/resources) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/xerces) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/xerces/LICENSE ${CURRENT_PACKAGES_DIR}/share/xerces/copyright) From 5de87096b1440a7a3f0ca781620a88f25e8ce060 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 16:43:22 -0800 Subject: [PATCH 202/561] Rename xercesc to xerces-c and fix copyright file placement --- ports/{xercesc => xerces-c}/CONTROL | 2 +- ports/{xercesc => xerces-c}/portfile.cmake | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) rename ports/{xercesc => xerces-c}/CONTROL (90%) rename ports/{xercesc => xerces-c}/portfile.cmake (83%) diff --git a/ports/xercesc/CONTROL b/ports/xerces-c/CONTROL similarity index 90% rename from ports/xercesc/CONTROL rename to ports/xerces-c/CONTROL index 497ef66c3d..822c50387c 100644 --- a/ports/xercesc/CONTROL +++ b/ports/xerces-c/CONTROL @@ -1,3 +1,3 @@ -Source: xercesc +Source: xerces-c Version: 3.1.4 Description: Xerces-C++ is a XML parser, for parsing, generating, manipulating, and validating XML documents using the DOM, SAX, and SAX2 APIs. diff --git a/ports/xercesc/portfile.cmake b/ports/xerces-c/portfile.cmake similarity index 83% rename from ports/xercesc/portfile.cmake rename to ports/xerces-c/portfile.cmake index bf2a2ee59e..5543f80ed1 100644 --- a/ports/xercesc/portfile.cmake +++ b/ports/xerces-c/portfile.cmake @@ -17,11 +17,11 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -if (TRIPLET_SYSTEM_ARCH MATCHES "x86") - set(BUILD_ARCH "Win32") -else() - set(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) -endif() +if (TRIPLET_SYSTEM_ARCH MATCHES "x86") + set(BUILD_ARCH "Win32") +else() + set(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH}) +endif() vcpkg_build_msbuild( @@ -36,5 +36,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xercesc/NLS) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/xercesc/util/MsgLoaders/ICU/resources) # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/xerces) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/xerces/LICENSE ${CURRENT_PACKAGES_DIR}/share/xerces/copyright) +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/xerces-c) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/xerces-c/LICENSE ${CURRENT_PACKAGES_DIR}/share/xerces-c/copyright) From 5d2f44859248f1ef32d4c79b6b22eec95b18db1a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 13:01:22 -0800 Subject: [PATCH 203/561] Use Strings::join() --- toolsrc/src/commands_install.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 6fc0e32f0a..a8ddf35f43 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -153,12 +153,7 @@ namespace vcpkg::Commands::Install System::println(System::color::error, "The following files are already installed in %s and are in conflict with %s", triplet_install_path.generic_string(), binary_paragraph.spec); - System::println(""); - for (const std::string& s : intersection) - { - System::println(" %s", s); - } - System::println(""); + Strings::join(intersection, "\n "); exit(EXIT_FAILURE); } From 6a58bee5e4e1277aea4c6f0f3991645abb738bbf Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 27 Jan 2017 19:06:50 -0800 Subject: [PATCH 204/561] [harfbuzz] Uses in-source builds, so we need to clean them every time. --- ports/harfbuzz/CONTROL | 2 +- ports/harfbuzz/portfile.cmake | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index 526dca3b36..6a54dc583f 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,4 +1,4 @@ Source: harfbuzz -Version: 1.3.4-1 +Version: 1.3.4-2 Description: HarfBuzz OpenType text shaping engine Build-Depends: freetype, glib diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 83f2679120..ac3252455f 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -11,7 +11,7 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/harfbuzz-1.3.4) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src/harfbuzz-1.3.4) find_program(NMAKE nmake) vcpkg_download_distfile(ARCHIVE @@ -19,7 +19,9 @@ vcpkg_download_distfile(ARCHIVE FILENAME "harfbuzz-1.3.4.tar.bz2" SHA512 72027ce64d735f1f7ecabcc78ba426d6155cebd564439feb77cefdfc28b00bfd9f6314e6735addaa90cee1d98cf6d2c0b61f77b446ba34e11f7eb7cdfdcd386a ) -vcpkg_extract_source_archive(${ARCHIVE}) +# Harfbuzz only supports in-source builds, so to make sure we get a clean build, we need to re-extract every time +file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src) +vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src) file(WRITE ${SOURCE_PATH}/win32/msvc_recommended_pragmas.h "/* I'm expected to exist */") From d81c9b94ebde6f47cb92991e9523f22645a112bb Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Sat, 28 Jan 2017 17:25:17 +0100 Subject: [PATCH 205/561] [openssl] Update to 1.0.2k --- ports/openssl/CMakeLists.txt | 2 +- ports/openssl/CONTROL | 4 ++-- ports/openssl/portfile.cmake | 11 ++++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ports/openssl/CMakeLists.txt b/ports/openssl/CMakeLists.txt index 1fa0f30d09..a82f14d609 100644 --- a/ports/openssl/CMakeLists.txt +++ b/ports/openssl/CMakeLists.txt @@ -3,7 +3,7 @@ project(openssl NONE) include(vcpkg_execute_required_process) include(vcpkg_apply_patches) -set(SOURCE_PATH ${CMAKE_CURRENT_BINARY_DIR}/openssl-1.0.2j) +set(SOURCE_PATH ${CMAKE_CURRENT_BINARY_DIR}/openssl-${OPENSSL_VERSION}) find_program(PERL perl) find_program(NMAKE nmake) diff --git a/ports/openssl/CONTROL b/ports/openssl/CONTROL index ca4aae2e65..2486f0358d 100644 --- a/ports/openssl/CONTROL +++ b/ports/openssl/CONTROL @@ -1,3 +1,3 @@ Source: openssl -Version: 1.0.2j-2 -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. \ No newline at end of file +Version: 1.0.2k-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. diff --git a/ports/openssl/portfile.cmake b/ports/openssl/portfile.cmake index 9b84b74758..b132581198 100644 --- a/ports/openssl/portfile.cmake +++ b/ports/openssl/portfile.cmake @@ -4,7 +4,8 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-1.0.2j) +set(OPENSSL_VERSION 1.0.2k) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-${OPENSSL_VERSION}) vcpkg_find_acquire_program(PERL) find_program(NMAKE nmake) @@ -12,9 +13,9 @@ get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE - URLS "https://www.openssl.org/source/openssl-1.0.2j.tar.gz" - FILENAME "openssl-1.0.2j.tar.gz" - SHA512 7d6ccae4aa3ccec3a5d128da29c68401cdb1210cba6d212d55235fc3bc63d7085e2f119e2bbee7ddff6b7b5eef07c6196156791724cd2caf313a4c2fef724edd + URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" + FILENAME "openssl-${OPENSSL_VERSION}.tar.gz" + SHA512 0d314b42352f4b1df2c40ca1094abc7e9ad684c5c35ea997efdd58204c70f22a1abcb17291820f0fff3769620a4e06906034203d31eb1a4d540df3e0db294016 ) file(COPY @@ -34,7 +35,7 @@ vcpkg_configure_cmake( -DOPENSSL_SOURCE_ARCHIVE=${OPENSSL_SOURCE_ARCHIVE} -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} -DTRIPLET_SYSTEM_ARCH=${TRIPLET_SYSTEM_ARCH} - -DVERSION=1.0.2j + -DVERSION=${OPENSSL_VERSION} -DTARGET_TRIPLET=${TARGET_TRIPLET} ) From 0ce85b546ee8746e5dacb27dcc8c689a55b0735d Mon Sep 17 00:00:00 2001 From: Markus Otto Date: Thu, 26 Jan 2017 01:27:09 +0100 Subject: [PATCH 206/561] [libopus] add version 1.1.4 --- ports/libopus/CONTROL | 3 ++ ports/libopus/portfile.cmake | 76 ++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 ports/libopus/CONTROL create mode 100644 ports/libopus/portfile.cmake diff --git a/ports/libopus/CONTROL b/ports/libopus/CONTROL new file mode 100644 index 0000000000..eb1706f3a5 --- /dev/null +++ b/ports/libopus/CONTROL @@ -0,0 +1,3 @@ +Source: libopus +Version: 1.1.4 +Description: Totally open, royalty-free, highly versatile audio codec diff --git a/ports/libopus/portfile.cmake b/ports/libopus/portfile.cmake new file mode 100644 index 0000000000..1fb111dfe6 --- /dev/null +++ b/ports/libopus/portfile.cmake @@ -0,0 +1,76 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/opus-1.1.4) +vcpkg_download_distfile(ARCHIVE + URLS "http://downloads.xiph.org/releases/opus/opus-1.1.4.tar.gz" + FILENAME "opus-1.1.4.tar.gz" + SHA512 57f14b9e8037eaa02a4d86535d3bbcceca249310fbc9ef1a452cc19dd442d4cf338d5db241d20605c236e22549df2c8266b7486c5f1666b80c532afd52cb3585 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(RELEASE_CONFIGURATION "Release") + set(DEBUG_CONFIGURATION "Debug") +else() + set(RELEASE_CONFIGURATION "ReleaseDll") + set(DEBUG_CONFIGURATION "DebugDll") +endif() + +if(TARGET_TRIPLET MATCHES "x86") + set(ARCH_DIR "Win32") +elseif(TARGET_TRIPLET MATCHES "x64") + set(ARCH_DIR "x64") +else() + message("Architecture not supported") +endif() + +function(build_project PROJECT_PATH) + vcpkg_build_msbuild( + PROJECT_PATH ${PROJECT_PATH} + RELEASE_CONFIGURATION ${RELEASE_CONFIGURATION} + DEBUG_CONFIGURATION ${DEBUG_CONFIGURATION} + ) +endfunction(build_project) + + +build_project(${SOURCE_PATH}/win32/VS2015/celt.vcxproj) +build_project(${SOURCE_PATH}/win32/VS2015/silk_common.vcxproj) +build_project(${SOURCE_PATH}/win32/VS2015/silk_float.vcxproj) +build_project(${SOURCE_PATH}/win32/VS2015/silk_fixed.vcxproj) +build_project(${SOURCE_PATH}/win32/VS2015/opus.vcxproj) + + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + # Install release build + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/celt.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/silk_common.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/silk_fixed.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/silk_float.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + + # Install debug build + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/celt.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/celt.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_common.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_common.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_fixed.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_fixed.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_float.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/silk_float.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) +else() + # Install release build + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${RELEASE_CONFIGURATION}/opus.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin/) + + # Install debug build + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/) + file(INSTALL ${SOURCE_PATH}/win32/VS2015/${ARCH_DIR}/${DEBUG_CONFIGURATION}/opus.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/) +endif() + +# Install headers +file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include RENAME opus) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libopus RENAME copyright) From faf60f0ee3ba35976e13f331a563c68a310cb946 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 28 Jan 2017 20:11:26 -0800 Subject: [PATCH 207/561] [opus] Rename libopus to opus to match upstream project's name --- ports/{libopus => opus}/CONTROL | 2 +- ports/{libopus => opus}/portfile.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename ports/{libopus => opus}/CONTROL (84%) rename ports/{libopus => opus}/portfile.cmake (99%) diff --git a/ports/libopus/CONTROL b/ports/opus/CONTROL similarity index 84% rename from ports/libopus/CONTROL rename to ports/opus/CONTROL index eb1706f3a5..7177b21998 100644 --- a/ports/libopus/CONTROL +++ b/ports/opus/CONTROL @@ -1,3 +1,3 @@ -Source: libopus +Source: opus Version: 1.1.4 Description: Totally open, royalty-free, highly versatile audio codec diff --git a/ports/libopus/portfile.cmake b/ports/opus/portfile.cmake similarity index 99% rename from ports/libopus/portfile.cmake rename to ports/opus/portfile.cmake index 1fb111dfe6..a004f09dd6 100644 --- a/ports/libopus/portfile.cmake +++ b/ports/opus/portfile.cmake @@ -73,4 +73,4 @@ endif() file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include RENAME opus) # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libopus RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/opus RENAME copyright) From 41942fa9b75e30a155abf238bad737f953ada610 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 29 Jan 2017 18:32:50 +0100 Subject: [PATCH 208/561] add atk --- ports/atk/CMakeLists.txt | 129 +++++++++++++++++++++++++++++++++++++++ ports/atk/CONTROL | 4 ++ ports/atk/portfile.cmake | 28 +++++++++ 3 files changed, 161 insertions(+) create mode 100644 ports/atk/CMakeLists.txt create mode 100644 ports/atk/CONTROL create mode 100644 ports/atk/portfile.cmake diff --git a/ports/atk/CMakeLists.txt b/ports/atk/CMakeLists.txt new file mode 100644 index 0000000000..3762ee27f8 --- /dev/null +++ b/ports/atk/CMakeLists.txt @@ -0,0 +1,129 @@ +cmake_minimum_required(VERSION 3.0) +project(atk) + +set(ATK_LIB_SUFFIX 1.0) +set(ATK_DLL_SUFFIX 1) +set(GLIB_LIB_VERSION 2.0) + +if(BUILD_SHARED_LIBS) + set(ATK_EXPORT_MACRO DLL_EXPORT) +endif() + +# generate atkmarshal.c and atkmarshal.h source files +# glib-genmarshal should be installed along with glib +if(NOT EXISTS ${CMAKE_SOURCE_DIR}/atk/atkmarshal.h OR NOT EXISTS ${CMAKE_SOURCE_DIR}/atk/atkmarshal.c) + find_program(GLIB_GENMARSHAL glib-genmarshal PATH_SUFFIXES glib) + execute_process( + COMMAND ${GLIB_GENMARSHAL} --prefix=atk_marshal atkmarshal.list --header + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/atk + OUTPUT_FILE ${CMAKE_SOURCE_DIR}/atk/atkmarshal.h) + execute_process( + COMMAND ${GLIB_GENMARSHAL} --prefix=atk_marshal atkmarshal.list --body + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/atk + OUTPUT_FILE ${CMAKE_SOURCE_DIR}/atk/atkmarshal.c) +endif() + +configure_file(config.h.win32 ${CMAKE_SOURCE_DIR}/config.h COPYONLY) +add_definitions(-DHAVE_CONFIG_H) +include_directories(. ./atk) + +find_path(GLIB_INCLUDE_DIR glib.h) +find_library(GLIB_GLIB_LIBRARY glib-${GLIB_LIB_VERSION}) +find_library(GLIB_GOBJECT_LIBRARY gobject-${GLIB_LIB_VERSION}) +find_library(GLIB_GMODULE_LIBRARY gmodule-${GLIB_LIB_VERSION}) +set(GLIB_LIBRARIES ${GLIB_GLIB_LIBRARY} ${GLIB_GOBJECT_LIBRARY} ${GLIB_GMODULE_LIBRARY}) + +find_path(LIBINTL_INCLUDE_DIR libintl.h) +find_library(LIBINTL_LIBRARY NAMES libintl intl) + +set(ATK_SOURCES + atk/atkaction.c + atk/atkcomponent.c + atk/atkdocument.c + atk/atkeditabletext.c + atk/atkgobjectaccessible.c + atk/atkhyperlink.c + atk/atkhyperlinkimpl.c + atk/atkhypertext.c + atk/atkimage.c + atk/atknoopobject.c + atk/atknoopobjectfactory.c + atk/atkobject.c + atk/atkobjectfactory.c + atk/atkplug.c + atk/atkprivate.c + atk/atkrange.c + atk/atkregistry.c + atk/atkrelation.c + atk/atkrelationset.c + atk/atkselection.c + atk/atksocket.c + atk/atkstate.c + atk/atkstateset.c + atk/atkstreamablecontent.c + atk/atktable.c + atk/atktablecell.c + atk/atktext.c + atk/atkutil.c + atk/atkmisc.c + atk/atkvalue.c + atk/atkversion.c + atk/atkwindow.c + atk/atk-enum-types.c) + +add_library(atk ${ATK_SOURCES}) +target_compile_definitions(atk PRIVATE ATK_COMPILATION ${ATK_EXPORT_MACRO} G_DISABLE_SINGLE_INCLUDES ATK_LOCALEDIR="/dummy/share/locale") +target_link_libraries(atk ${LIBINTL_LIBRARY} ${GLIB_LIBRARIES}) +target_include_directories(atk PRIVATE ${GLIB_INCLUDE_DIR} ${LIBINTL_INCLUDE_DIR}) + +set_target_properties(atk PROPERTIES + OUTPUT_NAME atk-${ATK_DLL_SUFFIX} + ARCHIVE_OUTPUT_NAME atk-${ATK_LIB_SUFFIX}) + +install(TARGETS atk RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + +if(NOT ATK_SKIP_HEADERS) + install(FILES + atk/atk.h + atk/atkaction.h + atk/atkcomponent.h + atk/atkdocument.h + atk/atkeditabletext.h + atk/atkgobjectaccessible.h + atk/atkhyperlink.h + atk/atkhyperlinkimpl.h + atk/atkhypertext.h + atk/atknoopobject.h + atk/atknoopobjectfactory.h + atk/atkobject.h + atk/atkobjectfactory.h + atk/atkplug.h + atk/atkimage.h + atk/atkrange.h + atk/atkregistry.h + atk/atkrelation.h + atk/atkrelationtype.h + atk/atkrelationset.h + atk/atkselection.h + atk/atksocket.h + atk/atkstate.h + atk/atkstateset.h + atk/atkstreamablecontent.h + atk/atktable.h + atk/atktablecell.h + atk/atktext.h + atk/atkutil.h + atk/atkmisc.h + atk/atkvalue.h + atk/atkwindow.h + atk/atkversion.h + atk/atk-enum-types.h + atk/atkversion.h + DESTINATION include/atk) +endif() + +message(STATUS "Link-time dependencies:") +message(STATUS " " ${LIBINTL_LIBRARY}) +foreach(GL ${GLIB_LIBRARIES}) + message(STATUS " " ${GL}) +endforeach() diff --git a/ports/atk/CONTROL b/ports/atk/CONTROL new file mode 100644 index 0000000000..7ac71a0c3e --- /dev/null +++ b/ports/atk/CONTROL @@ -0,0 +1,4 @@ +Source: atk +Version: 2.22.0 +Description: GNOME Accessibility Toolkit +Build-Depends: glib, gettext diff --git a/ports/atk/portfile.cmake b/ports/atk/portfile.cmake new file mode 100644 index 0000000000..08f4d6593b --- /dev/null +++ b/ports/atk/portfile.cmake @@ -0,0 +1,28 @@ +# ATK uses DllMain +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/atk-2.22.0) +vcpkg_download_distfile(ARCHIVE + URLS "http://ftp.gnome.org/pub/GNOME/sources/atk/2.22/atk-2.22.0.tar.xz" + FILENAME "atk-2.22.0.tar.xz" + SHA512 af3f6197eb97de869ee706f19564449b02c1444c413e5418323e4bf4c8cf1d98c7c8baa25189f6879d63606d4bc75f33799cb901f4697c087e868bb9a5643cba +) +vcpkg_extract_source_archive(${ARCHIVE}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DCMAKE_PROGRAM_PATH=${CURRENT_INSTALLED_DIR}/tools/glib + OPTIONS_DEBUG + -DATK_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/atk) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/atk/COPYING ${CURRENT_PACKAGES_DIR}/share/atk/copyright) From 01c4540a774defebcafb426e4b34bbc9bfab99c9 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 29 Jan 2017 18:46:22 +0100 Subject: [PATCH 209/561] add pango --- ports/pango/CMakeLists.txt | 180 +++++++++++++++++++++++++++++++++++++ ports/pango/CONTROL | 4 + ports/pango/portfile.cmake | 26 ++++++ 3 files changed, 210 insertions(+) create mode 100644 ports/pango/CMakeLists.txt create mode 100644 ports/pango/CONTROL create mode 100644 ports/pango/portfile.cmake diff --git a/ports/pango/CMakeLists.txt b/ports/pango/CMakeLists.txt new file mode 100644 index 0000000000..d290d13320 --- /dev/null +++ b/ports/pango/CMakeLists.txt @@ -0,0 +1,180 @@ +cmake_minimum_required(VERSION 3.0) +project(pango) + +set(PANGO_LIB_SUFFIX 1.0) +set(PANGO_DLL_SUFFIX 1) +set(GLIB_LIB_VERSION 2.0) + +configure_file(./config.h.win32 ${CMAKE_SOURCE_DIR}/config.h COPYONLY) +add_definitions(-DHAVE_CONFIG_H) +include_directories(. ./pango) + +# find libintl +find_path(LIBINTL_INCLUDE_DIR libintl.h) +find_library(LIBINTL_LIBRARY NAMES libintl intl) + +# find glib +find_path(GLIB_INCLUDE_DIR glib.h) +find_library(GLIB_GLIB_LIBRARY glib-${GLIB_LIB_VERSION}) +find_library(GLIB_GOBJECT_LIBRARY gobject-${GLIB_LIB_VERSION}) +find_library(GLIB_GMODULE_LIBRARY gmodule-${GLIB_LIB_VERSION}) +set(GLIB_LIBRARIES ${GLIB_GLIB_LIBRARY} ${GLIB_GOBJECT_LIBRARY} ${GLIB_GMODULE_LIBRARY}) + +# find cairo +find_path(CAIRO_INCLUDE_DIR cairo.h) +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CAIRO_SUFFIX d) +endif() +find_library(CAIRO_LIBRARY cairo${CAIRO_SUFFIX}) +find_library(CAIRO_GOBJECT_LIBRARY cairo-gobject${CAIRO_SUFFIX}) +set(CAIRO_LIBRARIES ${CAIRO_LIBRARY} ${CAIRO_GOBJECT_LIBRARY}) + +# find fontconfig +find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h) +find_library(FONTCONFIG_LIBRARY fontconfig) + +# find freetype +find_path(FREETYPE_INCLUDE_DIR ft2build.h) +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(FT_SUFFIX d) +endif() +find_library(FREETYPE_LIBRARY freetype${FT_SUFFIX}) + +# find harfbuzz +find_path(HARFBUZZ_INCLUDE_DIR harfbuzz/hb.h) +find_library(HARFBUZZ_LIBRARY harfbuzz) + +set(FONT_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR} ${FONTCONFIG_INCLUDE_DIR} ${HARFBUZZ_INCLUDE_DIR}/harfbuzz) +set(FONT_LIBRARIES ${FREETYPE_LIBRARY} ${FONTCONFIG_LIBRARY} ${HARFBUZZ_LIBRARY}) + +macro(pango_add_module MODULE_NAME) + add_library(${MODULE_NAME} ${ARGN}) + target_include_directories(${MODULE_NAME} PRIVATE ${GLIB_INCLUDE_DIR} ${LIBINTL_INCLUDE_DIR}) + target_link_libraries(${MODULE_NAME} ${LIBINTL_LIBRARY} ${GLIB_LIBRARIES}) + target_compile_definitions(${MODULE_NAME} PRIVATE + G_LOG_DOMAIN="Pango" PANGO_ENABLE_BACKEND PANGO_ENABLE_ENGINE + G_DISABLE_SINGLE_INCLUDES SYSCONFDIR="/dummy/etc" LIBDIR="/dummy/lib") + target_compile_definitions(${MODULE_NAME} PRIVATE HAVE_CAIRO_FREETYPE=1) + set_target_properties(${MODULE_NAME} PROPERTIES + OUTPUT_NAME ${MODULE_NAME}-${PANGO_DLL_SUFFIX} + ARCHIVE_OUTPUT_NAME ${MODULE_NAME}-${PANGO_LIB_SUFFIX}) + install(TARGETS ${MODULE_NAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) +endmacro() + +pango_add_module(pango + pango/break-arabic.c + pango/break-indic.c + pango/mini-fribidi/fribidi.c + pango/mini-fribidi/fribidi_char_type.c + pango/mini-fribidi/fribidi_types.c + pango/break.c + pango/ellipsize.c + pango/fonts.c + pango/glyphstring.c + pango/modules.c + pango/pango-attributes.c + pango/pango-bidi-type.c + pango/pango-color.c + pango/pango-context.c + pango/pango-coverage.c + pango/pango-engine.c + pango/pango-fontmap.c + pango/pango-fontset.c + pango/pango-glyph-item.c + pango/pango-gravity.c + pango/pango-item.c + pango/pango-language.c + pango/pango-layout.c + pango/pango-markup.c + pango/pango-matrix.c + pango/pango-renderer.c + pango/pango-script.c + pango/pango-tabs.c + pango/pango-utils.c + pango/reorder-items.c + pango/shape.c + pango/pango-enum-types.c) + +pango_add_module(pangowin32 + pango/pangowin32.c + pango/pangowin32-fontcache.c + pango/pangowin32-fontmap.c + pango/pangowin32-shape.c) +target_link_libraries(pangowin32 usp10 pango) + +pango_add_module(pangoft2 + pango/pangofc-font.c + pango/pangofc-fontmap.c + pango/pangofc-decoder.c + pango/pangofc-shape.c + pango/pangoft2.c + pango/pangoft2-fontmap.c + pango/pangoft2-render.c + pango/pango-ot-buffer.c + pango/pango-ot-info.c + pango/pango-ot-ruleset.c + pango/pango-ot-tag.c) +target_link_libraries(pangoft2 pango ${FONT_LIBRARIES}) +target_include_directories(pangoft2 PRIVATE ${FONT_INCLUDE_DIRS}) + +pango_add_module(pangocairo + pango/pangocairo-fcfont.c + pango/pangocairo-fcfontmap.c + pango/pangocairo-win32font.c + pango/pangocairo-win32fontmap.c + pango/pangocairo-context.c + pango/pangocairo-font.c + pango/pangocairo-fontmap.c + pango/pangocairo-render.c) +target_link_libraries(pangocairo ${CAIRO_LIBRARIES} pango pangowin32 pangoft2 ${FONT_LIBRARIES}) +target_include_directories(pangocairo PRIVATE ${CAIRO_INCLUDE_DIR} ${FONT_INCLUDE_DIRS}) + +if(NOT PANGO_SKIP_HEADERS) + install(FILES + pango/pango.h + pango/pango-attributes.h + pango/pango-bidi-type.h + pango/pango-break.h + pango/pango-context.h + pango/pango-coverage.h + pango/pango-engine.h + pango/pango-font.h + pango/pango-fontmap.h + pango/pango-fontset.h + pango/pango-glyph.h + pango/pango-glyph-item.h + pango/pango-gravity.h + pango/pango-item.h + pango/pango-language.h + pango/pango-layout.h + pango/pango-matrix.h + pango/pango-modules.h + pango/pango-renderer.h + pango/pango-script.h + pango/pango-tabs.h + pango/pango-types.h + pango/pango-utils.h + pango/pango-version-macros.h + pango/pangocairo.h + pango/pangowin32.h + pango/pango-features.h + pango/pango-enum-types.h + pango/pangofc-decoder.h + pango/pangofc-font.h + pango/pangofc-fontmap.h + pango/pango-ot.h + pango/pangoft2.h + DESTINATION include/pango) +endif() + +message(STATUS "Link-time dependencies:") +message(STATUS " " ${LIBINTL_LIBRARY}) +foreach(GL ${GLIB_LIBRARIES}) + message(STATUS " " ${GL}) +endforeach() +foreach(CL ${CAIRO_LIBRARIES}) + message(STATUS " " ${CL}) +endforeach() +foreach(FL ${FONT_LIBRARIES}) + message(STATUS " " ${FL}) +endforeach() diff --git a/ports/pango/CONTROL b/ports/pango/CONTROL new file mode 100644 index 0000000000..b763f25e84 --- /dev/null +++ b/ports/pango/CONTROL @@ -0,0 +1,4 @@ +Source: pango +Version: 1.40.3 +Description: Text and font handling library. +Build-Depends: glib, gettext, cairo, fontconfig, freetype, harfbuzz diff --git a/ports/pango/portfile.cmake b/ports/pango/portfile.cmake new file mode 100644 index 0000000000..07dfc69296 --- /dev/null +++ b/ports/pango/portfile.cmake @@ -0,0 +1,26 @@ + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pango-1.40.3) +vcpkg_download_distfile(ARCHIVE + URLS "http://ftp.gnome.org/pub/GNOME/sources/pango/1.40/pango-1.40.3.tar.xz" + FILENAME "pango-1.40.3.tar.xz" + SHA512 ff82395e8487624dffe212975b72b3383dcebb197a8675c8b409665e3e2e30fc23d9a6c25c3129a115adb7182b2a71a49550dbe881eb7ee9bbc572de6ba18d27) + +vcpkg_extract_source_archive(${ARCHIVE}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_DEBUG + -DPANGO_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/pango) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/pango/COPYING ${CURRENT_PACKAGES_DIR}/share/pango/copyright) From d1595aca30c03c7bfa13eb433cae6a35e7d87de4 Mon Sep 17 00:00:00 2001 From: Scott Date: Sun, 29 Jan 2017 15:38:44 -0800 Subject: [PATCH 210/561] Fixed incorrect naming of files Reverting the naming to stick with how the FLTK library naturally decided to name their files. There was an error in the renaming where the incorrect libraries were being renamed. Reverting this fixes build linking issues --- ports/fltk/portfile.cmake | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/ports/fltk/portfile.cmake b/ports/fltk/portfile.cmake index 848096dced..261a03c7ff 100644 --- a/ports/fltk/portfile.cmake +++ b/ports/fltk/portfile.cmake @@ -48,25 +48,7 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk-config) vcpkg_copy_pdbs() if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_formsd.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_gld.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk_imagesd.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltkd.lib) - - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_forms_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_formsd.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gl_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gld.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_images_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_imagesd.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_SHAREDd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltkd.lib) - - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_forms.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_gl.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk_images.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/fltk.lib) - - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_forms_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk_forms.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_gl_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk_gl.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_images_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk_images.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fltk_SHARED.lib ${CURRENT_PACKAGES_DIR}/lib/fltk.lib) + else() file(REMOVE_RECURSE @@ -77,11 +59,6 @@ else() endif() -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_formsd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_forms.lib) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gld.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_gl.lib) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_imagesd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk_images.lib) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fltkd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/fltk.lib) - file(INSTALL From 798ae24d96edba63917a769ec196e555385af4dc Mon Sep 17 00:00:00 2001 From: agadoul Date: Mon, 30 Jan 2017 14:35:38 +0100 Subject: [PATCH 211/561] use induced library type. --- ports/lcms/CMakeLists.txt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ports/lcms/CMakeLists.txt b/ports/lcms/CMakeLists.txt index 85807a0b95..ccb8b6f5a0 100644 --- a/ports/lcms/CMakeLists.txt +++ b/ports/lcms/CMakeLists.txt @@ -4,11 +4,6 @@ project(lcms) option(SHARED_LIBRARY "use shared library" ON) -set(LIBRARY_TYPE STATIC) -if(SHARED_LIBRARY) - set(LIBRARY_TYPE SHARED) -endif(SHARED_LIBRARY) - set(SRCS "src/cmstypes.c" "src/cmsvirt.c" @@ -47,9 +42,7 @@ include_directories( "./include" ) -add_library(lcms ${LIBRARY_TYPE} -${SRCS} -) +add_library(lcms ${SRCS}) if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) From 4ef429dd9e687f80f9f30042263d817984a10097 Mon Sep 17 00:00:00 2001 From: agadoul Date: Mon, 30 Jan 2017 15:22:39 +0100 Subject: [PATCH 212/561] implment reviews. --- ports/lcms/CMakeLists.txt | 6 ++---- ports/lcms/portfile.cmake | 10 +++++++--- ports/lcms/shared.patch | 10 ++++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 ports/lcms/shared.patch diff --git a/ports/lcms/CMakeLists.txt b/ports/lcms/CMakeLists.txt index ccb8b6f5a0..0fedfb95e6 100644 --- a/ports/lcms/CMakeLists.txt +++ b/ports/lcms/CMakeLists.txt @@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.5) project(lcms) -option(SHARED_LIBRARY "use shared library" ON) - set(SRCS "src/cmstypes.c" "src/cmsvirt.c" @@ -44,7 +42,7 @@ include_directories( add_library(lcms ${SRCS}) -if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) +if(NOT SKIP_INSTALL_HEADERS ) install(FILES "./include/lcms2.h" @@ -52,7 +50,7 @@ if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) DESTINATION include ) -endif(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) +endif(NOT SKIP_INSTALL_HEADERS ) install(TARGETS lcms EXPORT lcms_EXPORT RUNTIME DESTINATION bin diff --git a/ports/lcms/portfile.cmake b/ports/lcms/portfile.cmake index 5c6926071e..4487cce6aa 100644 --- a/ports/lcms/portfile.cmake +++ b/ports/lcms/portfile.cmake @@ -3,7 +3,6 @@ set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lcms2-2.8) vcpkg_download_distfile(ARCHIVE URLS "https://sourceforge.net/projects/lcms/files/lcms/2.8/lcms2-2.8.tar.gz/download" - #URLS "C:/Users/d3r55d/Downloads/lcms2-2.8.tar.gz" FILENAME "lcms2-2.8.tar.gz" SHA512 a9478885b4892c79314a2ef9ab560e6655ac8f2d17abae0805e8b871138bb190e21f0e5c805398449f9dad528dc50baaf9e3cce8b8158eb8ff74179be5733f8f ) @@ -18,8 +17,6 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DSHARED_LIBRARY=${USE_SHARED_LIBRARY} OPTIONS_DEBUG -DSKIP_INSTALL_HEADERS=ON ) @@ -29,3 +26,10 @@ vcpkg_install_cmake() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/lcms RENAME copyright) vcpkg_copy_pdbs() + +#patch header files to fix import/export issues +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES "${CMAKE_CURRENT_LIST_DIR}/shared.patch") +endif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) diff --git a/ports/lcms/shared.patch b/ports/lcms/shared.patch new file mode 100644 index 0000000000..b3e7bf75f6 --- /dev/null +++ b/ports/lcms/shared.patch @@ -0,0 +1,10 @@ +--- lcms2.h Wed Jul 20 08:46:01 2016 ++++ lcms2.h Mon Jan 30 15:01:12 2017 +@@ -212,6 +212,7 @@ + + #endif // CMS_USE_BIG_ENDIAN + ++#define CMS_DLL_BUILD + + // Calling convention -- this is hardly platform and compiler dependent + #ifdef CMS_IS_WINDOWS_ From 90fe56b0156a178b6b5d56f87fa7d4bc68d746ab Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Mon, 30 Jan 2017 14:12:08 -0800 Subject: [PATCH 213/561] uwp builds need _CRT_SECURE_NO_WARNINGS and others defined --- ports/bzip2/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/bzip2/CMakeLists.txt b/ports/bzip2/CMakeLists.txt index 9f9737da3d..d5407cc5f9 100644 --- a/ports/bzip2/CMakeLists.txt +++ b/ports/bzip2/CMakeLists.txt @@ -20,6 +20,12 @@ if(BUILD_SHARED_LIBS) target_compile_definitions(libbz2 PRIVATE -DBZ_BUILD_DLL) endif() +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) +endif() + install(TARGETS libbz2 RUNTIME DESTINATION bin ARCHIVE DESTINATION lib From 29b4c68f1d16ece3dec9f2bb65f875c914122918 Mon Sep 17 00:00:00 2001 From: Eric Mittelette Date: Mon, 30 Jan 2017 14:17:19 -0800 Subject: [PATCH 214/561] add VS2017 in pre requisite --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 78470dd0c9..1026e21294 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ For short description of available commands, run `vcpkg help`. ## Quick Start Prerequisites: -- Visual Studio 2015 Update 3 +- Visual Studio 2015 Update 3 or +- Visual Studio 2017 - `git.exe` available in your path Clone this repository, then run From e916d52345b5bf6900e48dd48d1d090767326017 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 30 Jan 2017 17:22:46 -0800 Subject: [PATCH 215/561] [openssl] Update UWP/WinRT to 1.0.2k --- ports/openssl/CONTROL | 2 +- ports/openssl/portfile-uwp.cmake | 12 +- ports/openssl/setVSvars.bat | 185 ------------------------------- 3 files changed, 5 insertions(+), 194 deletions(-) delete mode 100644 ports/openssl/setVSvars.bat diff --git a/ports/openssl/CONTROL b/ports/openssl/CONTROL index 2486f0358d..6fb5204044 100644 --- a/ports/openssl/CONTROL +++ b/ports/openssl/CONTROL @@ -1,3 +1,3 @@ Source: openssl -Version: 1.0.2k-1 +Version: 1.0.2k-2 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. diff --git a/ports/openssl/portfile-uwp.cmake b/ports/openssl/portfile-uwp.cmake index f4a0a716b1..289c549fc3 100644 --- a/ports/openssl/portfile-uwp.cmake +++ b/ports/openssl/portfile-uwp.cmake @@ -26,16 +26,16 @@ endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-OpenSSL_1_0_2j_WinRT) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-OpenSSL_1_0_2k_WinRT) vcpkg_find_acquire_program(PERL) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/Microsoft/openssl/archive/OpenSSL_1_0_2j_WinRT.zip" - FILENAME "openssl-microsoft-1.0.2j_WinRT.zip" - SHA512 0860d1f5fca7b1345870e866d7bb78f14672c5bb63c56bb04360ee891be542b4b56625ab971ef9b304b792b6cf36c9508bfd812c4a133f6ba8bafdde5e2f8fcf + URLS "https://github.com/Microsoft/openssl/archive/OpenSSL_1_0_2k_WinRT.zip" + FILENAME "openssl-microsoft-1.0.2k_WinRT.zip" + SHA512 afb434ef69c399f690f7ce723fabb228f77a12428f19062c5df3b8b841a2a7881c01150fdcfd2fab23867e3963292874a08ad227b37d168907b507fb1d7fede7 ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -44,10 +44,6 @@ file(REMOVE_RECURSE ${SOURCE_PATH}/tmp32dll) file(REMOVE_RECURSE ${SOURCE_PATH}/out32dll) file(REMOVE_RECURSE ${SOURCE_PATH}/inc32dll) -file(COPY -${CMAKE_CURRENT_LIST_DIR}/setVSvars.bat -DESTINATION ${SOURCE_PATH}/ms) - file(COPY ${CMAKE_CURRENT_LIST_DIR}/make-openssl.bat DESTINATION ${SOURCE_PATH}) diff --git a/ports/openssl/setVSvars.bat b/ports/openssl/setVSvars.bat deleted file mode 100644 index e6ebc0a7d1..0000000000 --- a/ports/openssl/setVSvars.bat +++ /dev/null @@ -1,185 +0,0 @@ -@echo off -call:set_%1 -exit /b -:set_universal10.0Win32 - call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86 store - set _VCPlatform=x86 - set _VCLibPlat= - call:setEnv - goto :eof - -:set_universal10.0x64 - call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x64 store - set _VCPlatform=x64 - set _VCLibPlat=amd64 - call:setEnv - goto :eof - -:set_universal10.0arm - call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86_arm store - set _VCPlatform=ARM - set _VCLibPlat=ARM - call:setEnv - goto :eof - -:set_universal10.0arm64 - call:setVar _VS14VC VisualStudio14VC - call "%_VS14VC%vcvarsall" x86_arm64 store - set _VCPlatform=ARM64 - set _VCLibPlat=ARM64 - call:setEnv - goto :eof - -:set_wp8.1arm - call:setVar _VS12VC VisualStudio12VC - call:setVar _WPKITS81 WindowsPhoneKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x86_arm - set PATH=%_VS12VC\Bin%;%PATH% - set INCLUDE=%_WPKITS81%\Include;%_WPKITS81%\Include\abi;%_WPKITS81%\Include\mincore;%_WPKITS81%\Include\minwin;%_WPKITS81%\Include\wrl;%INCLUDE% - set LIB=%_WPKITS81%\lib\ARM;%_VS12VC%\lib\store\ARM; - set LIBPATH=%LIBPATH%;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:set_wp8.1Win32 - call:setVar _VS12VC VisualStudio12VC - call:setVar _WPKITS81 WindowsPhoneKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x86 - set INCLUDE=%_WPKITS81%\Include;%_WPKITS81%\Include\abi;%_WPKITS81%\Include\mincore;%_WPKITS81%\Include\minwin;%_WPKITS81%\Include\wrl;%INCLUDE% - set LIB=%_WPKITS81%\lib\x86;%_VS12VC%\lib\store; - set LIBPATH=%LIBPATH%;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:set_wp8.0arm - call:setVar _VS11VC VisualStudio11VC - call:setVar _WPKITS80 WindowsPhoneKits8.0 - call "%_VS11VC%\WPSDK\WP80\vcvarsphoneall.bat" x86_arm - goto :eof - -:set_wp8.0Win32 - call:setVar _VS11VC VisualStudio11VC - call:setVar _WPKITS80 WindowsPhoneKits8.0 - call "%_VS11VC%\WPSDK\WP80\vcvarsphoneall.bat" x86 - goto :eof - -:set_ws8.1Win32 - call:setVar _VS12VC VisualStudio12VC - call:setVar _WSKITS81 WindowsKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x86 - set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; - set LIB=%_VS12VC%\lib\store;%_VS12VC%\atlmfc\lib;%_WSKITS81%\lib\winv6.3\um\x86; - set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:set_ws8.1x64 - call:setVar _VS12VC VisualStudio12VC - call:setVar _WSKITS81 WindowsKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x64 - set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; - set LIB=%_VS12VC%\lib\store\amd64;%_VS12VC%\atlmfc\lib\amd64;%_WSKITS81%\lib\winv6.3\um\x64; - set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib\amd64;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:set_ws8.1arm - call:setVar _VS12VC VisualStudio12VC - call:setVar _WSKITS81 WindowsKits8.1 - call:setVar _VS14VC VisualStudio14VC - call "%_VS12VC%\vcvarsall" x86_arm - set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt; - set LIB=%_VS12VC%\lib\store\arm;%_VS12VC%\atlmfc\lib\arm;%_WSKITS81%\lib\winv6.3\um\arm; - set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib\arm;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages; - goto :eof - -:setVar - call:set%1 - if "!%1!"=="" echo warning: could not locate %2 - goto :eof - -:setRegVar - for /F "usebackq tokens=2*" %%A IN (`reg query %1 /v %2 2^>nul`) do ( - set %3=%%B - ) - goto :eof - -:setAppend - if exist %1%2 set %3=%1%2 - goto :eof - -:set_VS11VC - if not "%_VS11VC%"=="" goto :eof - call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Setup\VC" ProductDir _VS11VC - if not "%_VS11VC%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\Setup\VC" ProductDir _VS11VC - if not "%_VS11VC%"=="" goto :eof - call:setAppend VSSDK110Install \..\VC _VS11VC - if not "%_VS11VC%"=="" goto :eof - call:setAppend VS110COMNTOOLS \..\..\VC _VS11VC - goto :eof - -:set_VS12VC - if not "%_VS12VC%"=="" goto :eof - call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\Setup\VC" ProductDir _VS12VC - if not "%_VS12VC%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\Setup\VC" ProductDir _VS12VC - if not "%_VS12VC%"=="" goto :eof - call:setAppend VSSDK120Install \..\VC _VS12VC - if not "%_VS12VC%"=="" goto :eof - call:setAppend VS120COMNTOOLS \..\..\VC _VS12VC - goto :eof - -:set_VS14VC - if not "%_VS14VC%"=="" goto :eof - call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config\Setup\VC" ProductDir _VS14VC - if not "%_VS14VC%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\Setup\VC" ProductDir _VS14VC - if not "%_VS14VC%"=="" goto :eof - call:setAppend VSSDK140Install \..\VC _VS14VC - if not "%_VS14VC%"=="" goto :eof - call:setAppend VS140COMNTOOLS \..\..\VC _VS14VC - goto :eof - -:set_WPKITS80 - if not "%_WPKITS80%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows Phone\v8.0" InstallationFolder _WPKITS80 - if not "%_WPKITS80%"=="" goto :eof - goto :eof - -:set_WPKITS81 - if not "%_WPKITS81%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows Phone\v8.1" InstallationFolder _WPKITS81 - if not "%_WPKITS81%"=="" goto :eof - goto :eof - -:set_WSKITS81 - if not "%_WSKITS81%"=="" goto :eof - call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots" KitsRoot81 _WSKITS81 - if not "%_WSKITS81%"=="" goto :eof - goto :eof - -:set_WKITS10 - if not "%_WKITS10%"=="" goto :eof - call:setRegVar "HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" InstallationFolder _WKITS10 - if not "%_WKITS10%"=="" goto :eof - goto :eof - -:set_WKITS10VER - if not "%_WKITS10VER%"=="" goto :eof - call:setRegVar "HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" ProductVersion _WKITS10VER - echo %_WKITS10VER% - if not "%_WKITS10VER%"=="" goto :eof - goto :eof - -:setEnv - call:setVar _VS14VC VisualStudio14VC - call:setVar _WKITS10 WindowsKits10.0 - set PATH=%_VS14VCBin%;%PATH% - set "LIBPATH=%_WKITS10%UnionMetadata\Facade;%_VS14VC%vcpackages;%_WKITS10%references\windows.foundation.foundationcontract\1.0.0.0\;%_WKITS10%references\windows.foundation.universalapicontract\1.0.0.0\" - goto :eof - -:end From 872332df343cf01a5b6309a41b1f9c84bcca1bf0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 18:13:58 -0800 Subject: [PATCH 216/561] Remove doVcpkgRelease.ps1 --- scripts/doVcpkgRelease.ps1 | 84 -------------------------------------- 1 file changed, 84 deletions(-) delete mode 100644 scripts/doVcpkgRelease.ps1 diff --git a/scripts/doVcpkgRelease.ps1 b/scripts/doVcpkgRelease.ps1 deleted file mode 100644 index fb964d0c30..0000000000 --- a/scripts/doVcpkgRelease.ps1 +++ /dev/null @@ -1,84 +0,0 @@ -[CmdletBinding()] -param( - -) -$ErrorActionPreference = "Stop" -$version = git show HEAD:toolsrc/VERSION.txt -#Remove the quotes from the string -$version = $version.Substring(1, $version.length - 2) -$versionRegex = '^\d+\.\d+\.\d+$' -if (!($version -match $versionRegex)) -{ - throw [System.ArgumentException] ("Expected version in the form d.d.d but was " + $version) -} - -Write-Verbose("New version is " + $version) -$gitTagString = "v$version" - -# Intentionally doesn't have ^ (=starts with) to match remote tags as well -$matchingTags = git tag | Where-Object {$_ -match "$gitTagString$"} -if ($matchingTags.Length -gt 0) -{ - throw [System.ArgumentException] ("Git tag matches existing tags: " + $matchingTags) -} - -$gitHash = git rev-parse HEAD -Write-Verbose("Git hash is " + $gitHash) - -$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition -$vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root -$gitStartOfHash = $gitHash.substring(0,6) -$versionWithStartOfHash = "$version-$gitStartOfHash" -$buildPath = "$vcpkgRootDir\build-$versionWithStartOfHash" -$releasePath = "$vcpkgRootDir\release-$versionWithStartOfHash" -Write-Verbose("Build Path " + $buildPath) -Write-Verbose("Release Path " + $releasePath) - -# 0 is metrics disabled, 1 is metrics enabled -for ($disableMetrics = 0; $disableMetrics -le 1; $disableMetrics++) -{ - - if (!(Test-Path $buildPath)) - { - New-Item -ItemType directory -Path $buildPath -force | Out-Null - } - - if (!(Test-Path $releasePath)) - { - New-Item -ItemType directory -Path $releasePath -force | Out-Null - } - - # Partial checkout for building vcpkg - $dotGitDir = "$vcpkgRootDir\.git" - $workTreeForBuildOnly = "$buildPath" - $checkoutForBuildOnly = ".\scripts",".\toolsrc",".vcpkg-root" # Must be relative to the root of the repository - Write-Verbose("Creating partial temporary checkout: $buildPath") - git --git-dir="$dotGitDir" --work-tree="$workTreeForBuildOnly" checkout $gitHash -f -q -- $checkoutForBuildOnly - git reset - - & "$buildPath\scripts\bootstrap.ps1" -disableMetrics $disableMetrics - - # Full checkout which will be a zip along with the executables from the previous step - $workTree = "$releasePath" - $checkoutThisDir = ".\" # Must be relative to the root of the repository - Write-Verbose("Creating temporary checkout: $releasePath") - git --git-dir=$dotGitDir --work-tree=$workTree checkout $gitHash -f -q -- $checkoutThisDir - git reset - - Copy-Item $buildPath\vcpkg.exe $releasePath\vcpkg.exe | Out-Null - Copy-Item $buildPath\scripts\vcpkgmetricsuploader.exe $releasePath\scripts\vcpkgmetricsuploader.exe | Out-Null - - Write-Verbose("Archiving") - $outputArchive = "$vcpkgRootDir\vcpkg-$versionWithStartOfHash.zip" - if ($disableMetrics -ne 0) - { - $outputArchive = "$vcpkgRootDir\vcpkg-$versionWithStartOfHash-external.zip" - } - Compress-Archive -Path "$releasePath\*" -CompressionLevel Optimal -DestinationPath $outputArchive -Force | Out-Null - - Write-Verbose("Removing temporary checkouts: $releasePath") - Remove-Item -recurse $buildPath | Out-Null - Remove-Item -recurse $releasePath | Out-Null - - Write-Verbose("Redistributable archive is: $outputArchive") -} \ No newline at end of file From a26c0288931f7fba284ef9bea5e7cbc655e127ba Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 30 Jan 2017 19:37:07 -0800 Subject: [PATCH 217/561] [vcpkg] Fixup 5d2f4485 --- toolsrc/src/commands_install.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index a8ddf35f43..69495bd62f 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -153,7 +153,9 @@ namespace vcpkg::Commands::Install System::println(System::color::error, "The following files are already installed in %s and are in conflict with %s", triplet_install_path.generic_string(), binary_paragraph.spec); - Strings::join(intersection, "\n "); + System::print("\n "); + System::println(Strings::join(intersection, "\n ")); + System::println(""); exit(EXIT_FAILURE); } From ae3f4149ed67169c325626ad1a8e8f1efd5be956 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 30 Jan 2017 19:47:14 -0800 Subject: [PATCH 218/561] [fltk] Bump version to correspond with binary layout change --- ports/fltk/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/fltk/CONTROL b/ports/fltk/CONTROL index 4f85195505..985c6b1c09 100644 --- a/ports/fltk/CONTROL +++ b/ports/fltk/CONTROL @@ -1,4 +1,4 @@ Source: fltk -Version: 1.3.4-1 +Version: 1.3.4-2 Description: FLTK (pronounced fulltick) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL and its built-in GLUT emulation. Build-Depends: zlib, libpng, libjpeg-turbo \ No newline at end of file From 9502d795bb325669df8e4e3b32f6ca60827813f1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 14:25:36 -0800 Subject: [PATCH 219/561] Move & rename remove_plan_type enum --- toolsrc/include/vcpkg_Dependencies.h | 8 ++++++++ toolsrc/src/commands_remove.cpp | 24 ++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 4da9de6943..1c49ccafdc 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -26,5 +26,13 @@ namespace vcpkg::Dependencies install_plan_action plan; }; + enum class remove_plan_type + { + NOT_INSTALLED, + DEPENDENCIES_NOT_SATISFIED, + SHOULD_REMOVE + }; + + std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); } diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 4b53f47785..bf415d2c08 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -2,10 +2,13 @@ #include "vcpkglib.h" #include "vcpkg_System.h" #include "vcpkg_Input.h" +#include "vcpkg_Dependencies.h" #include namespace vcpkg::Commands::Remove { + using Dependencies::remove_plan_type; + static const std::string OPTION_PURGE = "--purge"; static void delete_directory(const fs::path& directory) @@ -22,14 +25,7 @@ namespace vcpkg::Commands::Remove } } - enum class deinstall_plan - { - not_installed, - dependencies_not_satisfied, - should_deinstall - }; - - static deinstall_plan deinstall_package_plan( + static remove_plan_type deinstall_package_plan( const StatusParagraphs::iterator package_it, const StatusParagraphs& status_db, std::vector& dependencies_out) @@ -38,7 +34,7 @@ namespace vcpkg::Commands::Remove if (package_it == status_db.end() || (*package_it)->state == install_state_t::not_installed) { - return deinstall_plan::not_installed; + return remove_plan_type::NOT_INSTALLED; } auto& pkg = (*package_it)->package; @@ -59,9 +55,9 @@ namespace vcpkg::Commands::Remove } if (!dependencies_out.empty()) - return deinstall_plan::dependencies_not_satisfied; + return remove_plan_type::DEPENDENCIES_NOT_SATISFIED; - return deinstall_plan::should_deinstall; + return remove_plan_type::SHOULD_REMOVE; } static void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db) @@ -79,17 +75,17 @@ namespace vcpkg::Commands::Remove auto plan = deinstall_package_plan(package_it, status_db, deps); switch (plan) { - case deinstall_plan::not_installed: + case remove_plan_type::NOT_INSTALLED: System::println(System::color::success, "Package %s is not installed", spec); return; - case deinstall_plan::dependencies_not_satisfied: + case remove_plan_type::DEPENDENCIES_NOT_SATISFIED: System::println(System::color::error, "Error: Cannot remove package %s:", spec); for (auto&& dep : deps) { System::println(" %s depends on %s", dep->package.displayname(), pkg.package.displayname()); } exit(EXIT_FAILURE); - case deinstall_plan::should_deinstall: + case remove_plan_type::SHOULD_REMOVE: break; default: Checks::unreachable(); From cc81c3de6c74837dc146d7d3de73e4388cfc14dc Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 17:52:54 -0800 Subject: [PATCH 220/561] [StatusParagraphs] Replace auto with actual type --- toolsrc/include/StatusParagraphs.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/toolsrc/include/StatusParagraphs.h b/toolsrc/include/StatusParagraphs.h index 7a0f2177d0..11491cf4ec 100644 --- a/toolsrc/include/StatusParagraphs.h +++ b/toolsrc/include/StatusParagraphs.h @@ -1,6 +1,7 @@ #pragma once #include "StatusParagraph.h" #include +#include namespace vcpkg { @@ -25,22 +26,22 @@ namespace vcpkg friend std::ostream& operator<<(std::ostream&, const StatusParagraphs&); - auto end() + iterator end() { return paragraphs.rend(); } - auto end() const + const_iterator end() const { return paragraphs.rend(); } - auto begin() + iterator begin() { return paragraphs.rbegin(); } - auto begin() const + const_iterator begin() const { return paragraphs.rbegin(); } From 33b46b1fee70996a23a7860f853e95ef80ff3978 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 17:53:45 -0800 Subject: [PATCH 221/561] Create a remove plan. NOT used yet --- toolsrc/include/vcpkg_Dependencies.h | 16 +++++++- toolsrc/src/commands_remove.cpp | 8 +++- toolsrc/src/vcpkg_Dependencies.cpp | 58 ++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 3 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 1c49ccafdc..528abedfb8 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -30,9 +30,23 @@ namespace vcpkg::Dependencies { NOT_INSTALLED, DEPENDENCIES_NOT_SATISFIED, - SHOULD_REMOVE + REMOVE, + REMOVE_USER_REQUESTED }; + struct remove_plan_action + { + remove_plan_type type; + std::unique_ptr bpgh; + }; + + struct package_spec_with_remove_plan + { + package_spec spec; + remove_plan_action plan; + }; std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + + std::vector create_remove_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); } diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index bf415d2c08..7b8286f9cc 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -7,6 +7,7 @@ namespace vcpkg::Commands::Remove { + using Dependencies::package_spec_with_remove_plan; using Dependencies::remove_plan_type; static const std::string OPTION_PURGE = "--purge"; @@ -57,7 +58,7 @@ namespace vcpkg::Commands::Remove if (!dependencies_out.empty()) return remove_plan_type::DEPENDENCIES_NOT_SATISFIED; - return remove_plan_type::SHOULD_REMOVE; + return remove_plan_type::REMOVE; } static void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db) @@ -85,7 +86,7 @@ namespace vcpkg::Commands::Remove System::println(" %s depends on %s", dep->package.displayname(), pkg.package.displayname()); } exit(EXIT_FAILURE); - case remove_plan_type::SHOULD_REMOVE: + case remove_plan_type::REMOVE: break; default: Checks::unreachable(); @@ -174,6 +175,9 @@ namespace vcpkg::Commands::Remove Input::check_triplets(specs, paths); bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end(); + const std::vector remove_plan = Dependencies::create_remove_plan(paths, specs, status_db); + Checks::check_exit(!remove_plan.empty(), "Remove plan cannot be empty"); + for (const package_spec& spec : specs) { deinstall_package(paths, spec, status_db); diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 1daa6de02b..4468930c43 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -5,6 +5,7 @@ #include "package_spec.h" #include "StatusParagraphs.h" #include +#include #include "vcpkg_Maps.h" #include "vcpkg_Files.h" #include "vcpkglib.h" @@ -72,4 +73,61 @@ namespace vcpkg::Dependencies } return ret; } + + std::vector create_remove_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) + { + std::unordered_set specs_as_set(specs.cbegin(), specs.cend()); + + std::unordered_map was_examined; // Examine = we have checked its immediate (non-recursive) dependencies + Graphs::Graph graph; + graph.add_vertices(specs); + + std::vector examine_stack(specs); + while (!examine_stack.empty()) + { + const package_spec spec = examine_stack.back(); + examine_stack.pop_back(); + + if (was_examined.find(spec) != was_examined.end()) + { + continue; + } + + auto it = status_db.find(spec); + if (it == status_db.end() || (*it)->state == install_state_t::not_installed) + { + was_examined.emplace(spec, remove_plan_action{ remove_plan_type::NOT_INSTALLED, nullptr}); + continue; + } + + for (const std::unique_ptr& an_installed_package : status_db) + { + if (an_installed_package->want != want_t::install) + continue; + if (an_installed_package->package.spec.target_triplet() != spec.target_triplet()) + continue; + + const std::vector& deps = an_installed_package->package.depends; + if (std::find(deps.begin(), deps.end(), spec.name()) == deps.end()) + { + continue; + } + + graph.add_edge(spec, an_installed_package.get()->package.spec); + examine_stack.push_back(an_installed_package.get()->package.spec); + } + + const remove_plan_type type = specs_as_set.find(spec) != specs_as_set.end() ? remove_plan_type::REMOVE_USER_REQUESTED: remove_plan_type::REMOVE; + was_examined.emplace(spec, remove_plan_action{ type, std::make_unique(std::move((*it)->package))}); + } + + std::vector ret; + + const std::vector pkgs = graph.find_topological_sort(); + for (const package_spec& pkg : pkgs) + { + ret.push_back({ pkg, std::move(was_examined[pkg]) }); + } + return ret; + } } From 4ded91423aa1dfa3ad8bb7a57879f48d58b9b786 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 12:45:54 -0800 Subject: [PATCH 222/561] Enable multiprocessor compilation for vcpkg itself --- toolsrc/vcpkg/vcpkg.vcxproj | 4 ++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 4 ++++ toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj | 4 ++++ toolsrc/vcpkgtest/vcpkgtest.vcxproj | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index c256173e31..eea257e7d9 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -73,6 +73,7 @@ true ..\include /std:c++latest %(AdditionalOptions) + true winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -85,6 +86,7 @@ true ..\include /std:c++latest %(AdditionalOptions) + true winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -100,6 +102,7 @@ ..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true true @@ -117,6 +120,7 @@ ..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true true diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 0163fe1732..cd220892f6 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -77,6 +77,7 @@ ..\include DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true @@ -87,6 +88,7 @@ ..\include DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true @@ -99,6 +101,7 @@ ..\include DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true true @@ -115,6 +118,7 @@ ..\include DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true true diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index c925a0b31e..47687dbcf8 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -73,6 +73,7 @@ true ..\include /std:c++latest %(AdditionalOptions) + true winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -85,6 +86,7 @@ true ..\include /std:c++latest %(AdditionalOptions) + true winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -100,6 +102,7 @@ ..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true true @@ -117,6 +120,7 @@ ..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) + true true diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index 0fb11eb302..263cd0658e 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -97,6 +97,7 @@ true /std:c++latest %(AdditionalOptions) + true Windows @@ -113,6 +114,7 @@ true /std:c++latest %(AdditionalOptions) + true Windows @@ -131,6 +133,7 @@ true /std:c++latest %(AdditionalOptions) + true Windows @@ -151,6 +154,7 @@ true /std:c++latest %(AdditionalOptions) + true Windows From 050e4a0f7a8156bd862f95c06ea298ab6697e147 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 12:49:09 -0800 Subject: [PATCH 223/561] Introduce precompiled headers --- toolsrc/include/pch.h | 38 +++++++++++++++++++++ toolsrc/src/BinaryParagraph.cpp | 1 + toolsrc/src/BuildInfo.cpp | 1 + toolsrc/src/MachineType.cpp | 1 + toolsrc/src/Paragraphs.cpp | 1 + toolsrc/src/SourceParagraph.cpp | 1 + toolsrc/src/StatusParagraph.cpp | 1 + toolsrc/src/StatusParagraphs.cpp | 2 +- toolsrc/src/Stopwatch.cpp | 1 + toolsrc/src/coff_file_reader.cpp | 4 +-- toolsrc/src/commands_available_commands.cpp | 1 + toolsrc/src/commands_build.cpp | 2 +- toolsrc/src/commands_build_external.cpp | 1 + toolsrc/src/commands_cache.cpp | 1 + toolsrc/src/commands_contact.cpp | 1 + toolsrc/src/commands_create.cpp | 1 + toolsrc/src/commands_edit.cpp | 1 + toolsrc/src/commands_hash.cpp | 1 + toolsrc/src/commands_help.cpp | 1 + toolsrc/src/commands_import.cpp | 2 +- toolsrc/src/commands_install.cpp | 1 + toolsrc/src/commands_integrate.cpp | 7 +--- toolsrc/src/commands_list.cpp | 1 + toolsrc/src/commands_owns.cpp | 1 + toolsrc/src/commands_portsdiff.cpp | 6 +--- toolsrc/src/commands_remove.cpp | 2 +- toolsrc/src/commands_search.cpp | 1 + toolsrc/src/commands_update.cpp | 1 + toolsrc/src/commands_version.cpp | 1 + toolsrc/src/metrics.cpp | 12 +------ toolsrc/src/package_spec.cpp | 2 +- toolsrc/src/package_spec_parse_result.cpp | 4 +-- toolsrc/src/pch.cpp | 1 + toolsrc/src/post_build_lint.cpp | 3 +- toolsrc/src/triplet.cpp | 2 +- toolsrc/src/vcpkg_Checks.cpp | 3 +- toolsrc/src/vcpkg_Dependencies.cpp | 5 +-- toolsrc/src/vcpkg_Environment.cpp | 3 +- toolsrc/src/vcpkg_Files.cpp | 3 +- toolsrc/src/vcpkg_Input.cpp | 1 + toolsrc/src/vcpkg_Strings.cpp | 8 +---- toolsrc/src/vcpkg_System.cpp | 4 +-- toolsrc/src/vcpkg_cmd_arguments.cpp | 4 +-- toolsrc/src/vcpkg_info.cpp | 1 + toolsrc/src/vcpkg_paths.cpp | 1 + toolsrc/src/vcpkglib.cpp | 10 +----- toolsrc/src/vcpkglib_helpers.cpp | 3 +- toolsrc/vcpkglib/vcpkglib.vcxproj | 15 ++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 ++++ 49 files changed, 106 insertions(+), 69 deletions(-) create mode 100644 toolsrc/include/pch.h create mode 100644 toolsrc/src/pch.cpp diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h new file mode 100644 index 0000000000..48aca2b774 --- /dev/null +++ b/toolsrc/include/pch.h @@ -0,0 +1,38 @@ +#pragma once + +#define WIN32_LEAN_AND_MEAN +#define NOMINMAX +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include \ No newline at end of file diff --git a/toolsrc/src/BinaryParagraph.cpp b/toolsrc/src/BinaryParagraph.cpp index ad85a1f8af..eed87eb813 100644 --- a/toolsrc/src/BinaryParagraph.cpp +++ b/toolsrc/src/BinaryParagraph.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "BinaryParagraph.h" #include "vcpkglib_helpers.h" #include "vcpkg_Checks.h" diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index a45dc4b723..b401f9d442 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "BuildInfo.h" #include "vcpkg_Checks.h" #include "vcpkglib_helpers.h" diff --git a/toolsrc/src/MachineType.cpp b/toolsrc/src/MachineType.cpp index 0115f3e5ef..81012234de 100644 --- a/toolsrc/src/MachineType.cpp +++ b/toolsrc/src/MachineType.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "MachineType.h" #include "vcpkg_Checks.h" diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp index f4592afed8..6dde5da7c9 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/Paragraphs.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "Paragraphs.h" #include "vcpkg_Files.h" diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/SourceParagraph.cpp index bdf15a7379..eef4a47344 100644 --- a/toolsrc/src/SourceParagraph.cpp +++ b/toolsrc/src/SourceParagraph.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "SourceParagraph.h" #include "vcpkglib_helpers.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/StatusParagraph.cpp b/toolsrc/src/StatusParagraph.cpp index bf12ae89ac..3f07689cae 100644 --- a/toolsrc/src/StatusParagraph.cpp +++ b/toolsrc/src/StatusParagraph.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "StatusParagraph.h" #include "vcpkglib_helpers.h" diff --git a/toolsrc/src/StatusParagraphs.cpp b/toolsrc/src/StatusParagraphs.cpp index 3e23c519a8..c2398d2b82 100644 --- a/toolsrc/src/StatusParagraphs.cpp +++ b/toolsrc/src/StatusParagraphs.cpp @@ -1,5 +1,5 @@ +#include "pch.h" #include "StatusParagraphs.h" -#include #include "vcpkg_Checks.h" namespace vcpkg diff --git a/toolsrc/src/Stopwatch.cpp b/toolsrc/src/Stopwatch.cpp index b0e54e381a..ec7af60b68 100644 --- a/toolsrc/src/Stopwatch.cpp +++ b/toolsrc/src/Stopwatch.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "Stopwatch.h" #include "vcpkg_Checks.h" diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index 8ce714bbe9..f48f912c17 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -1,8 +1,6 @@ +#include "pch.h" #include "coff_file_reader.h" -#include #include "vcpkg_Checks.h" -#include -#include using namespace std; diff --git a/toolsrc/src/commands_available_commands.cpp b/toolsrc/src/commands_available_commands.cpp index 48239587d5..56056218b9 100644 --- a/toolsrc/src/commands_available_commands.cpp +++ b/toolsrc/src/commands_available_commands.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" namespace vcpkg::Commands diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 629cbbb5f5..22f3af8729 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "StatusParagraphs.h" #include "vcpkglib.h" @@ -8,7 +9,6 @@ #include "vcpkg_Environment.h" #include "metrics.h" #include "vcpkg_info.h" -#include namespace vcpkg::Commands::Build { diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index 51dc29e864..5c3fa9857e 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_Environment.h" diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/commands_cache.cpp index 63bf322605..fa49a647ff 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/commands_cache.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_Files.h" diff --git a/toolsrc/src/commands_contact.cpp b/toolsrc/src/commands_contact.cpp index 3e3ebc2b43..2be468fb8c 100644 --- a/toolsrc/src/commands_contact.cpp +++ b/toolsrc/src/commands_contact.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_info.h" diff --git a/toolsrc/src/commands_create.cpp b/toolsrc/src/commands_create.cpp index d842d3fab6..5042ab97b6 100644 --- a/toolsrc/src/commands_create.cpp +++ b/toolsrc/src/commands_create.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_Environment.h" diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index cb457a9e26..dff30f7add 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_Input.h" diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index 7048fb0d98..4c0028f53d 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/commands_help.cpp index e4769752c0..6068c22fb5 100644 --- a/toolsrc/src/commands_help.cpp +++ b/toolsrc/src/commands_help.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp index 14e83e75f3..7af2c7185d 100644 --- a/toolsrc/src/commands_import.cpp +++ b/toolsrc/src/commands_import.cpp @@ -1,8 +1,8 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "Paragraphs.h" #include "StatusParagraph.h" #include "vcpkg_Files.h" -#include namespace vcpkg::Commands::Import { diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 69495bd62f..2ae67a4974 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkglib.h" #include "vcpkg_Environment.h" diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 2bd5027ec0..03c51b5a75 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -1,10 +1,5 @@ -#define WIN32_LEAN_AND_MEAN -#include -#include +#include "pch.h" #include "vcpkg_Commands.h" -#include -#include -#include #include "vcpkg_Environment.h" #include "vcpkg_Checks.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/commands_list.cpp b/toolsrc/src/commands_list.cpp index 18e95d4055..34a9c2fc83 100644 --- a/toolsrc/src/commands_list.cpp +++ b/toolsrc/src/commands_list.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkglib.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp index fe02b62247..6c4c20c445 100644 --- a/toolsrc/src/commands_owns.cpp +++ b/toolsrc/src/commands_owns.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkglib.h" diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 1665d7c471..e75633b3cb 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -1,11 +1,7 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" -#include -#include #include "vcpkg_Maps.h" -#include -#include -#include #include "Paragraphs.h" #include "SourceParagraph.h" #include "vcpkg_Environment.h" diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 7b8286f9cc..9b37ff11fb 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -1,9 +1,9 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkglib.h" #include "vcpkg_System.h" #include "vcpkg_Input.h" #include "vcpkg_Dependencies.h" -#include namespace vcpkg::Commands::Remove { diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index 3f197b06b6..3a3226e4b2 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "Paragraphs.h" diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index d7a554303b..a42ae5341d 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkglib.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/commands_version.cpp index e982516013..a521b2567c 100644 --- a/toolsrc/src/commands_version.cpp +++ b/toolsrc/src/commands_version.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_info.h" diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp index 1806dad874..263d6eb74c 100644 --- a/toolsrc/src/metrics.cpp +++ b/toolsrc/src/metrics.cpp @@ -1,15 +1,5 @@ +#include "pch.h" #include "metrics.h" -#include -#include -#include -#include -#include -#include -#include -#define WIN32_LEAN_AND_MEAN -#include -#include -#include #include "filesystem_fs.h" #include "vcpkg_Strings.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/package_spec.cpp b/toolsrc/src/package_spec.cpp index 86d4393bd5..9ba3bdf795 100644 --- a/toolsrc/src/package_spec.cpp +++ b/toolsrc/src/package_spec.cpp @@ -1,5 +1,5 @@ +#include "pch.h" #include "package_spec.h" -#include namespace vcpkg { diff --git a/toolsrc/src/package_spec_parse_result.cpp b/toolsrc/src/package_spec_parse_result.cpp index dc377f656a..892232c2ee 100644 --- a/toolsrc/src/package_spec_parse_result.cpp +++ b/toolsrc/src/package_spec_parse_result.cpp @@ -1,5 +1,5 @@ -#include -#include +#include "pch.h" +#include "package_spec.h" #include "package_spec_parse_result.h" namespace vcpkg diff --git a/toolsrc/src/pch.cpp b/toolsrc/src/pch.cpp new file mode 100644 index 0000000000..17305716aa --- /dev/null +++ b/toolsrc/src/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" \ No newline at end of file diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index af76b79635..daf6f49ee7 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -1,12 +1,11 @@ +#include "pch.h" #include "vcpkg_paths.h" #include "package_spec.h" #include "vcpkg_Files.h" -#include #include "vcpkg_System.h" #include "vcpkg_Environment.h" #include "coff_file_reader.h" #include "BuildInfo.h" -#include namespace vcpkg::PostBuildLint { diff --git a/toolsrc/src/triplet.cpp b/toolsrc/src/triplet.cpp index a6816b4459..e1302d9edf 100644 --- a/toolsrc/src/triplet.cpp +++ b/toolsrc/src/triplet.cpp @@ -1,6 +1,6 @@ +#include "pch.h" #include "triplet.h" #include "vcpkg_Checks.h" -#include namespace vcpkg { diff --git a/toolsrc/src/vcpkg_Checks.cpp b/toolsrc/src/vcpkg_Checks.cpp index 46b28e55cd..5c3fef27a8 100644 --- a/toolsrc/src/vcpkg_Checks.cpp +++ b/toolsrc/src/vcpkg_Checks.cpp @@ -1,6 +1,5 @@ +#include "pch.h" #include "vcpkg_Checks.h" - -#include #include "vcpkg_System.h" namespace vcpkg::Checks diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 4468930c43..3b6db5bbdc 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -1,12 +1,9 @@ +#include "pch.h" #include "vcpkg_Dependencies.h" -#include #include "vcpkg_Graphs.h" #include "vcpkg_paths.h" #include "package_spec.h" #include "StatusParagraphs.h" -#include -#include -#include "vcpkg_Maps.h" #include "vcpkg_Files.h" #include "vcpkglib.h" diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 66d33edeb7..1babdc5470 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -1,5 +1,4 @@ -#include -#include +#include "pch.h" #include "vcpkg_Environment.h" #include "vcpkg_Commands.h" #include "metrics.h" diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 1d4faa7733..87700238d5 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -1,6 +1,5 @@ +#include "pch.h" #include "vcpkg_Files.h" -#include -#include #include "vcpkg_System.h" namespace vcpkg::Files diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp index bf7ccd3467..5720cadc06 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg_Input.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_Input.h" #include "vcpkg_System.h" #include "metrics.h" diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index b974b0a063..5b6d9967c9 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -1,12 +1,6 @@ +#include "pch.h" #include "vcpkg_Strings.h" -#include -#include -#include -#include -#include -#include - namespace vcpkg::Strings::details { // To disambiguate between two overloads diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 405dfd1b80..754a26741f 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -1,7 +1,5 @@ +#include "pch.h" #include "vcpkg_System.h" -#include -#include -#include namespace vcpkg::System { diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index aa1c359650..4a06128a41 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -1,8 +1,6 @@ -#define WIN32_LEAN_AND_MEAN -#include +#include "pch.h" #include "vcpkg_cmd_arguments.h" #include "vcpkg_Commands.h" -#include #include "metrics.h" #include "vcpkg_System.h" diff --git a/toolsrc/src/vcpkg_info.cpp b/toolsrc/src/vcpkg_info.cpp index 69bc6a3554..f8e214998b 100644 --- a/toolsrc/src/vcpkg_info.cpp +++ b/toolsrc/src/vcpkg_info.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "vcpkg_info.h" #include "metrics.h" diff --git a/toolsrc/src/vcpkg_paths.cpp b/toolsrc/src/vcpkg_paths.cpp index 39e4c8986a..8d7060a022 100644 --- a/toolsrc/src/vcpkg_paths.cpp +++ b/toolsrc/src/vcpkg_paths.cpp @@ -1,3 +1,4 @@ +#include "pch.h" #include "expected.h" #include "vcpkg_paths.h" #include "metrics.h" diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkglib.cpp index 5cea0c585e..06487684c5 100644 --- a/toolsrc/src/vcpkglib.cpp +++ b/toolsrc/src/vcpkglib.cpp @@ -1,15 +1,7 @@ +#include "pch.h" #include "vcpkglib.h" -#include -#include -#include -#include -#include -#include -#include -#include #include "vcpkg_Files.h" #include "Paragraphs.h" -#include #include "metrics.h" using namespace vcpkg; diff --git a/toolsrc/src/vcpkglib_helpers.cpp b/toolsrc/src/vcpkglib_helpers.cpp index fdc287507d..6b96c25cb5 100644 --- a/toolsrc/src/vcpkglib_helpers.cpp +++ b/toolsrc/src/vcpkglib_helpers.cpp @@ -1,7 +1,6 @@ +#include "pch.h" #include "vcpkg_Checks.h" #include "vcpkglib_helpers.h" -#include -#include namespace vcpkg::details { diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index cd220892f6..bbf18e80dd 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -78,6 +78,8 @@ DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true + Use + pch.h @@ -89,6 +91,8 @@ DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true + Use + pch.h @@ -102,6 +106,8 @@ DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true + Use + pch.h true @@ -119,6 +125,8 @@ DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true + Use + pch.h true @@ -138,6 +146,7 @@ + @@ -186,6 +195,12 @@ + + Create + Create + Create + Create + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index faac8cd67b..0f8b033789 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -150,6 +150,9 @@ Source Files + + Source Files + @@ -254,5 +257,8 @@ Header Files + + Header Files + \ No newline at end of file From 31bf4634d220b9a2ae33380eb301335e85018e46 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 13:30:26 -0800 Subject: [PATCH 224/561] Disable MinimalRebuild --- toolsrc/vcpkg/vcpkg.vcxproj | 2 ++ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 ++ toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj | 2 ++ toolsrc/vcpkgtest/vcpkgtest.vcxproj | 2 ++ 4 files changed, 8 insertions(+) diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index eea257e7d9..c91bc2a751 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -74,6 +74,7 @@ ..\include /std:c++latest %(AdditionalOptions) true + false winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -87,6 +88,7 @@ ..\include /std:c++latest %(AdditionalOptions) true + false winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index bbf18e80dd..b9722c68e6 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -80,6 +80,7 @@ true Use pch.h + false @@ -93,6 +94,7 @@ true Use pch.h + false diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index 47687dbcf8..b66b7fd9df 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -74,6 +74,7 @@ ..\include /std:c++latest %(AdditionalOptions) true + false winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -87,6 +88,7 @@ ..\include /std:c++latest %(AdditionalOptions) true + false winhttp.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index 263cd0658e..224500d829 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -98,6 +98,7 @@ /std:c++latest %(AdditionalOptions) true + false Windows @@ -115,6 +116,7 @@ /std:c++latest %(AdditionalOptions) true + false Windows From 6f363339d8eb5cd8c7a2dd83787af3a34ff0eb4b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 14:33:54 -0800 Subject: [PATCH 225/561] Reorganize pch.h --- toolsrc/include/pch.h | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index 48aca2b774..2c8b5b5f75 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -7,32 +7,33 @@ #include #include -#include -#include -#include #include -#include -#include -#include +#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include + +#include +#include +#include +#include #include #include -#include -#include +#include +#include -#include -#include \ No newline at end of file +#include +#include +#include + +#include +#include From 9da07d4540c0c0bb34fedad649e4e2d5a75bbf09 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 14:37:14 -0800 Subject: [PATCH 226/561] Add and to pch.h --- toolsrc/include/pch.h | 3 +++ toolsrc/include/vcpkg_cmd_arguments.h | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index 2c8b5b5f75..56f24f161c 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -34,6 +35,8 @@ #include #include #include +#include #include #include +#include diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 2194e6d2ce..8ace985867 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -4,7 +4,6 @@ #include #include #include "opt_bool.h" -#include "vcpkg_paths.h" namespace vcpkg { From 4059d4a6b9f9467ff5c58594f7304eef7ba79664 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 17:28:00 -0800 Subject: [PATCH 227/561] [package_spec] Make toString() a member function --- toolsrc/include/package_spec.h | 4 ++-- toolsrc/src/commands_build.cpp | 10 +++++----- toolsrc/src/commands_install.cpp | 4 ++-- toolsrc/src/package_spec.cpp | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/toolsrc/include/package_spec.h b/toolsrc/include/package_spec.h index 30dfca5c7c..01b4377a5f 100644 --- a/toolsrc/include/package_spec.h +++ b/toolsrc/include/package_spec.h @@ -18,13 +18,13 @@ namespace vcpkg std::string dir() const; + std::string toString() const; + private: std::string m_name; triplet m_target_triplet; }; - std::string to_string(const package_spec& spec); - std::string to_printf_arg(const package_spec& spec); bool operator==(const package_spec& left, const package_spec& right); diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 22f3af8729..b6c3cea03b 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -44,20 +44,20 @@ namespace vcpkg::Commands::Build timer.start(); int return_code = System::cmd_execute(command); timer.stop(); - TrackMetric("buildtimeus-" + to_string(spec), timer.microseconds()); + TrackMetric("buildtimeus-" + spec.toString(), timer.microseconds()); if (return_code != 0) { - System::println(System::color::error, "Error: building package %s failed", to_string(spec)); + System::println(System::color::error, "Error: building package %s failed", spec.toString()); System::println("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" " Package: %s\n" " Vcpkg version: %s\n" "\n" "Additionally, attach any relevant sections from the log files above." - , to_string(spec), Info::version()); + , spec.toString(), Info::version()); TrackProperty("error", "build failed"); - TrackProperty("build_error", to_string(spec)); + TrackProperty("build_error", spec.toString()); exit(EXIT_FAILURE); } @@ -118,7 +118,7 @@ namespace vcpkg::Commands::Build System::println(""); for (const package_spec_with_install_plan& p : unmet_dependencies) { - System::println(" %s", to_string(p.spec)); + System::println(" %s", p.spec.toString()); } System::println(""); exit(EXIT_FAILURE); diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 2ae67a4974..dabce44f68 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -192,11 +192,11 @@ namespace vcpkg::Commands::Install std::vector install_plan = Dependencies::create_install_plan(paths, specs, status_db); Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty"); - std::string specs_string = to_string(install_plan[0].spec); + std::string specs_string = install_plan[0].spec.toString(); for (size_t i = 1; i < install_plan.size(); ++i) { specs_string.push_back(','); - specs_string.append(to_string(install_plan[i].spec)); + specs_string.append(install_plan[i].spec.toString()); } TrackProperty("installplan", specs_string); Environment::ensure_utilities_on_path(paths); diff --git a/toolsrc/src/package_spec.cpp b/toolsrc/src/package_spec.cpp index 9ba3bdf795..7d8d2681db 100644 --- a/toolsrc/src/package_spec.cpp +++ b/toolsrc/src/package_spec.cpp @@ -55,14 +55,14 @@ namespace vcpkg return Strings::format("%s_%s", this->m_name, this->m_target_triplet); } - std::string to_string(const package_spec& spec) + std::string package_spec::toString() const { - return Strings::format("%s:%s", spec.name(), spec.target_triplet()); + return Strings::format("%s:%s", this->name(), this->target_triplet()); } std::string to_printf_arg(const package_spec& spec) { - return to_string(spec); + return spec.toString(); } bool operator==(const package_spec& left, const package_spec& right) @@ -72,6 +72,6 @@ namespace vcpkg std::ostream& operator<<(std::ostream& os, const package_spec& spec) { - return os << to_string(spec); + return os << spec.toString(); } } From 0f0698dc18ec162666ed92b4ac181e512b439b83 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 20:09:40 -0800 Subject: [PATCH 228/561] Introduce Strings::Joiner --- toolsrc/include/vcpkg_Strings.h | 50 ++++++++++++++++++++++++++++++++- toolsrc/src/SourceParagraph.cpp | 4 +-- toolsrc/src/vcpkg_Strings.cpp | 41 ++++++++++++++++++--------- 3 files changed, 78 insertions(+), 17 deletions(-) diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index cb5d2334cc..8d5d7135bc 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -68,7 +68,55 @@ namespace vcpkg::Strings std::string ascii_to_lowercase(const std::string& input); - std::string join(const std::vector& v, const std::string& delimiter); + template + static std::string join(const std::vector& v, const std::string& prefix, const std::string& delimiter, const std::string& suffix, Transformer transformer) + { + if (v.empty()) + { + return std::string(); + } + + std::string output; + size_t size = v.size(); + + output.append(prefix); + output.append(transformer(v.at(0))); + + for (size_t i = 1; i < size; ++i) + { + output.append(delimiter); + output.append(transformer(v.at(i))); + } + + output.append(suffix); + return output; + } + + static std::string join(const std::vector& v, const std::string& prefix, const std::string& delimiter, const std::string& suffix); + + class Joiner + { + public: + static Joiner on(const std::string& delimiter); + + Joiner& prefix(const std::string& prefix); + Joiner& suffix(const std::string& suffix); + + std::string join(const std::vector& v) const; + + template + std::string join(const std::vector& v, Transformer transformer) const + { + return Strings::join(v, this->m_prefix, this->m_delimiter, this->m_suffix, transformer); + } + + private: + explicit Joiner(const std::string& delimiter); + + std::string m_prefix; + std::string m_delimiter; + std::string m_suffix; + }; void trim(std::string* s); diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/SourceParagraph.cpp index eef4a47344..8bfe8e84dc 100644 --- a/toolsrc/src/SourceParagraph.cpp +++ b/toolsrc/src/SourceParagraph.cpp @@ -53,8 +53,8 @@ namespace vcpkg const std::vector remaining_fields = Maps::extract_keys(fields); const std::vector& valid_fields = get_list_of_valid_fields(); - const std::string remaining_fields_as_string = Strings::join(remaining_fields, "\n "); - const std::string valid_fields_as_string = Strings::join(valid_fields, "\n "); + const std::string remaining_fields_as_string = Strings::Joiner::on("\n ").join(remaining_fields); + const std::string valid_fields_as_string = Strings::Joiner::on("\n ").join(valid_fields); System::println(System::color::error, "Error: There are invalid fields in the Source Paragraph of %s", this->name); System::println("The following fields were not expected:\n\n %s\n\n", remaining_fields_as_string); diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 5b6d9967c9..3b9d6a8598 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -67,25 +67,38 @@ namespace vcpkg::Strings return output; } - std::string join(const std::vector& v, const std::string& delimiter) + std::string join(const std::vector& v, const std::string& prefix, const std::string& delimiter, const std::string& suffix) { - if (v.empty()) + return join(v, prefix, delimiter, suffix, [](const std::string& i) -> std::string { - return std::string(); - } + return i; + }); + } - std::string output; - size_t size = v.size(); + Joiner Joiner::on(const std::string& delimiter) + { + return Joiner(delimiter); + } - output.append(v.at(0)); + Joiner& Joiner::prefix(const std::string& prefix) + { + this->m_prefix = prefix; + return *this; + } - for (size_t i = 1; i < size; ++i) - { - output.append(delimiter); - output.append(v.at(i)); - } + Joiner& Joiner::suffix(const std::string& suffix) + { + this->m_suffix = suffix; + return *this; + } - return output; + std::string Joiner::join(const std::vector& v) const + { + return Strings::join(v, this->m_prefix, this->m_delimiter, this->m_suffix); + } + + Joiner::Joiner(const std::string& delimiter) : m_prefix(""), m_delimiter(delimiter), m_suffix("") + { } void trim(std::string* s) @@ -119,7 +132,7 @@ namespace vcpkg::Strings std::vector output; size_t i = 0; - for (size_t pos = s.find(delimiter); pos != std::string::npos; pos = s.find(delimiter, pos)) + for (size_t pos = s.find(delimiter); pos != std::string::npos; pos = s.find(delimiter, pos)) { output.push_back(s.substr(i, pos - i)); i = ++pos; From e0577978c512cbc3ea0e05067882b14eedacc679 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 20:21:04 -0800 Subject: [PATCH 229/561] Remove unneeded #include directive --- toolsrc/include/package_spec.h | 1 - 1 file changed, 1 deletion(-) diff --git a/toolsrc/include/package_spec.h b/toolsrc/include/package_spec.h index 01b4377a5f..b469567c74 100644 --- a/toolsrc/include/package_spec.h +++ b/toolsrc/include/package_spec.h @@ -1,5 +1,4 @@ #pragma once -#include #include "package_spec_parse_result.h" #include "triplet.h" #include "expected.h" From c1562f1d17bf48e96f31c2a61092dd7bc8c3d9d2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 20:22:33 -0800 Subject: [PATCH 230/561] Print remove plan. Fail if --recursive is not passed and there are dependencies --- toolsrc/src/commands_remove.cpp | 80 ++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 9b37ff11fb..8e6a6c2279 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -11,6 +11,7 @@ namespace vcpkg::Commands::Remove using Dependencies::remove_plan_type; static const std::string OPTION_PURGE = "--purge"; + static const std::string OPTION_RECURSIVE = "--recursive"; static void delete_directory(const fs::path& directory) { @@ -163,6 +164,67 @@ namespace vcpkg::Commands::Remove System::println(System::color::success, "Package %s was successfully removed", pkg.package.displayname()); } + static void sort_packages_by_name(std::vector* packages) + { + std::sort(packages->begin(), packages->end(), [](const package_spec_with_remove_plan* left, const package_spec_with_remove_plan* right) -> bool + { + return left->spec.name() < right->spec.name(); + }); + } + + static void print_plan(const std::vector& plan) + { + std::vector not_installed; + std::vector remove; + + for (const package_spec_with_remove_plan& i : plan) + { + if (i.plan.type == remove_plan_type::NOT_INSTALLED) + { + not_installed.push_back(&i); + continue; + } + + if (i.plan.type == remove_plan_type::REMOVE || i.plan.type == remove_plan_type::REMOVE_USER_REQUESTED) + { + remove.push_back(&i); + continue; + } + + Checks::unreachable(); + } + + //std::copy_if(plan.cbegin(), plan.cend(), std::back_inserter(not_installed), [](const package_spec_with_remove_plan& i) + // { + // return i.plan.type == remove_plan_type::NOT_INSTALLED; + // }); + + if (!not_installed.empty()) + { + sort_packages_by_name(¬_installed); + System::println("The following packages are not installed, so not removed:\n%s", + Strings::Joiner::on("\n ").prefix(" ").join(not_installed, [](const package_spec_with_remove_plan* p) + { + return p->spec.toString(); + })); + } + + if (!remove.empty()) + { + sort_packages_by_name(&remove); + System::println("The following packages will be removed:\n%s", + Strings::Joiner::on("\n").join(remove, [](const package_spec_with_remove_plan* p) + { + if (p->plan.type == remove_plan_type::REMOVE_USER_REQUESTED) + { + return " " + p->spec.toString(); + } + + return " * " + p->spec.toString(); + })); + } + } + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { static const std::string example = Commands::Help::create_example_string("remove zlib zlib:x64-windows curl boost"); @@ -173,11 +235,27 @@ namespace vcpkg::Commands::Remove std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example); Input::check_triplets(specs, paths); - bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end(); + const bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end(); + const bool isRecursive = options.find(OPTION_PURGE) != options.end(); const std::vector remove_plan = Dependencies::create_remove_plan(paths, specs, status_db); Checks::check_exit(!remove_plan.empty(), "Remove plan cannot be empty"); + print_plan(remove_plan); + + const bool has_non_user_requested_packages = std::find_if(remove_plan.cbegin(), remove_plan.cend(), [](const package_spec_with_remove_plan& package)-> bool + { + return package.plan.type == remove_plan_type::REMOVE; + }) != remove_plan.cend(); + + if (has_non_user_requested_packages && !isRecursive) + { + System::println(System::color::warning, "Additional packages (*) need to be removed to complete this operation.\n" + "If you are sure you want to remove them, run the command with the --recursive option"); + exit(EXIT_FAILURE); + } + + //exit(EXIT_SUCCESS); for (const package_spec& spec : specs) { deinstall_package(paths, spec, status_db); From 661776fe29344c431731e5ae464da4942b38bf79 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 12:34:36 -0800 Subject: [PATCH 231/561] Enable recursive `remove` command --- toolsrc/include/vcpkg_Dependencies.h | 5 +- toolsrc/src/commands_remove.cpp | 110 +++++++-------------------- toolsrc/src/vcpkg_Dependencies.cpp | 4 +- 3 files changed, 33 insertions(+), 86 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 528abedfb8..2a3030c898 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -29,15 +29,14 @@ namespace vcpkg::Dependencies enum class remove_plan_type { NOT_INSTALLED, - DEPENDENCIES_NOT_SATISFIED, - REMOVE, + REMOVE_AUTO_SELECTED, REMOVE_USER_REQUESTED }; struct remove_plan_action { remove_plan_type type; - std::unique_ptr bpgh; + std::unique_ptr status_pgh; }; struct package_spec_with_remove_plan diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 8e6a6c2279..d95fd7af99 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -27,72 +27,8 @@ namespace vcpkg::Commands::Remove } } - static remove_plan_type deinstall_package_plan( - const StatusParagraphs::iterator package_it, - const StatusParagraphs& status_db, - std::vector& dependencies_out) + static void remove_package(const vcpkg_paths& paths, StatusParagraph& pkg) { - dependencies_out.clear(); - - if (package_it == status_db.end() || (*package_it)->state == install_state_t::not_installed) - { - return remove_plan_type::NOT_INSTALLED; - } - - auto& pkg = (*package_it)->package; - - for (auto&& inst_pkg : status_db) - { - if (inst_pkg->want != want_t::install) - continue; - if (inst_pkg->package.spec.target_triplet() != pkg.spec.target_triplet()) - continue; - - const auto& deps = inst_pkg->package.depends; - - if (std::find(deps.begin(), deps.end(), pkg.spec.name()) != deps.end()) - { - dependencies_out.push_back(inst_pkg.get()); - } - } - - if (!dependencies_out.empty()) - return remove_plan_type::DEPENDENCIES_NOT_SATISFIED; - - return remove_plan_type::REMOVE; - } - - static void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db) - { - auto package_it = status_db.find(spec.name(), spec.target_triplet()); - if (package_it == status_db.end()) - { - System::println(System::color::success, "Package %s is not installed", spec); - return; - } - - auto& pkg = **package_it; - - std::vector deps; - auto plan = deinstall_package_plan(package_it, status_db, deps); - switch (plan) - { - case remove_plan_type::NOT_INSTALLED: - System::println(System::color::success, "Package %s is not installed", spec); - return; - case remove_plan_type::DEPENDENCIES_NOT_SATISFIED: - System::println(System::color::error, "Error: Cannot remove package %s:", spec); - for (auto&& dep : deps) - { - System::println(" %s depends on %s", dep->package.displayname(), pkg.package.displayname()); - } - exit(EXIT_FAILURE); - case remove_plan_type::REMOVE: - break; - default: - Checks::unreachable(); - } - pkg.want = want_t::purge; pkg.state = install_state_t::half_installed; write_update(paths, pkg); @@ -185,7 +121,7 @@ namespace vcpkg::Commands::Remove continue; } - if (i.plan.type == remove_plan_type::REMOVE || i.plan.type == remove_plan_type::REMOVE_USER_REQUESTED) + if (i.plan.type == remove_plan_type::REMOVE_AUTO_SELECTED || i.plan.type == remove_plan_type::REMOVE_USER_REQUESTED) { remove.push_back(&i); continue; @@ -215,12 +151,15 @@ namespace vcpkg::Commands::Remove System::println("The following packages will be removed:\n%s", Strings::Joiner::on("\n").join(remove, [](const package_spec_with_remove_plan* p) { - if (p->plan.type == remove_plan_type::REMOVE_USER_REQUESTED) + switch (p->plan.type) { - return " " + p->spec.toString(); + case remove_plan_type::REMOVE_USER_REQUESTED: + return " " + p->spec.toString(); + case remove_plan_type::REMOVE_AUTO_SELECTED: + return " * " + p->spec.toString(); + default: + Checks::unreachable(); } - - return " * " + p->spec.toString(); })); } } @@ -230,13 +169,13 @@ namespace vcpkg::Commands::Remove static const std::string example = Commands::Help::create_example_string("remove zlib zlib:x64-windows curl boost"); args.check_min_arg_count(1, example); - const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_PURGE}); + const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_PURGE, OPTION_RECURSIVE}); auto status_db = database_load_check(paths); std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example); Input::check_triplets(specs, paths); const bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end(); - const bool isRecursive = options.find(OPTION_PURGE) != options.end(); + const bool isRecursive = options.find(OPTION_RECURSIVE) != options.end(); const std::vector remove_plan = Dependencies::create_remove_plan(paths, specs, status_db); Checks::check_exit(!remove_plan.empty(), "Remove plan cannot be empty"); @@ -245,27 +184,36 @@ namespace vcpkg::Commands::Remove const bool has_non_user_requested_packages = std::find_if(remove_plan.cbegin(), remove_plan.cend(), [](const package_spec_with_remove_plan& package)-> bool { - return package.plan.type == remove_plan_type::REMOVE; + return package.plan.type == remove_plan_type::REMOVE_AUTO_SELECTED; }) != remove_plan.cend(); if (has_non_user_requested_packages && !isRecursive) { System::println(System::color::warning, "Additional packages (*) need to be removed to complete this operation.\n" - "If you are sure you want to remove them, run the command with the --recursive option"); + "If you are sure you want to remove them, run the command with the --recursive option"); exit(EXIT_FAILURE); } - //exit(EXIT_SUCCESS); - for (const package_spec& spec : specs) + for (const package_spec_with_remove_plan& action : remove_plan) { - deinstall_package(paths, spec, status_db); - - if (alsoRemoveFolderFromPackages) + if (action.plan.type == remove_plan_type::NOT_INSTALLED) { - const fs::path spec_package_dir = paths.packages / spec.dir(); - delete_directory(spec_package_dir); + System::println(System::color::success, "Package %s is not installed", action.spec); } + else if (action.plan.type == remove_plan_type::REMOVE_AUTO_SELECTED || action.plan.type == remove_plan_type::REMOVE_USER_REQUESTED) + { + remove_package(paths, *action.plan.status_pgh); + + if (alsoRemoveFolderFromPackages) + { + const fs::path spec_package_dir = paths.packages / action.spec.dir(); + delete_directory(spec_package_dir); + } + } + else + Checks::unreachable(); } + exit(EXIT_SUCCESS); } } diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 3b6db5bbdc..5de782e73f 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -114,8 +114,8 @@ namespace vcpkg::Dependencies examine_stack.push_back(an_installed_package.get()->package.spec); } - const remove_plan_type type = specs_as_set.find(spec) != specs_as_set.end() ? remove_plan_type::REMOVE_USER_REQUESTED: remove_plan_type::REMOVE; - was_examined.emplace(spec, remove_plan_action{ type, std::make_unique(std::move((*it)->package))}); + const remove_plan_type type = specs_as_set.find(spec) != specs_as_set.end() ? remove_plan_type::REMOVE_USER_REQUESTED: remove_plan_type::REMOVE_AUTO_SELECTED; + was_examined.emplace(spec, remove_plan_action{ type, std::make_unique(std::move(**it))}); } std::vector ret; From 884cd176b05a76e7fbba924685a0d71c3dea0f9b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 12:36:27 -0800 Subject: [PATCH 232/561] Renames and formatting --- toolsrc/include/vcpkg_Dependencies.h | 4 ++-- toolsrc/src/commands_install.cpp | 4 ++-- toolsrc/src/vcpkg_Dependencies.cpp | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 2a3030c898..5b0bf31874 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -16,8 +16,8 @@ namespace vcpkg::Dependencies struct install_plan_action { install_plan_type type; - std::unique_ptr bpgh; - std::unique_ptr spgh; + std::unique_ptr binary_pgh; + std::unique_ptr source_pgh; }; struct package_spec_with_install_plan diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index dabce44f68..e5c5dd013d 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -214,14 +214,14 @@ namespace vcpkg::Commands::Install } else if (action.plan.type == install_plan_type::BUILD_AND_INSTALL) { - Commands::Build::build_package(*action.plan.spgh, action.spec, paths, paths.port_dir(action.spec)); + Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec)); const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); install_package(paths, bpgh, status_db); System::println(System::color::success, "Package %s is installed", action.spec); } else if (action.plan.type == install_plan_type::INSTALL) { - install_package(paths, *action.plan.bpgh, status_db); + install_package(paths, *action.plan.binary_pgh, status_db); System::println(System::color::success, "Package %s is installed", action.spec); } else diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 5de782e73f..b0047a772e 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -66,7 +66,7 @@ namespace vcpkg::Dependencies const std::vector pkgs = graph.find_topological_sort(); for (const package_spec& pkg : pkgs) { - ret.push_back({ pkg, std::move(was_examined[pkg]) }); + ret.push_back({pkg, std::move(was_examined[pkg])}); } return ret; } @@ -93,7 +93,7 @@ namespace vcpkg::Dependencies auto it = status_db.find(spec); if (it == status_db.end() || (*it)->state == install_state_t::not_installed) { - was_examined.emplace(spec, remove_plan_action{ remove_plan_type::NOT_INSTALLED, nullptr}); + was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, nullptr}); continue; } @@ -114,8 +114,8 @@ namespace vcpkg::Dependencies examine_stack.push_back(an_installed_package.get()->package.spec); } - const remove_plan_type type = specs_as_set.find(spec) != specs_as_set.end() ? remove_plan_type::REMOVE_USER_REQUESTED: remove_plan_type::REMOVE_AUTO_SELECTED; - was_examined.emplace(spec, remove_plan_action{ type, std::make_unique(std::move(**it))}); + const remove_plan_type type = specs_as_set.find(spec) != specs_as_set.end() ? remove_plan_type::REMOVE_USER_REQUESTED : remove_plan_type::REMOVE_AUTO_SELECTED; + was_examined.emplace(spec, remove_plan_action{type, std::make_unique(std::move(**it))}); } std::vector ret; @@ -123,7 +123,7 @@ namespace vcpkg::Dependencies const std::vector pkgs = graph.find_topological_sort(); for (const package_spec& pkg : pkgs) { - ret.push_back({ pkg, std::move(was_examined[pkg]) }); + ret.push_back({pkg, std::move(was_examined[pkg])}); } return ret; } From 4d104541674f1975b60c2ccd694d447e25a16359 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 12:45:26 -0800 Subject: [PATCH 233/561] Add package_spec::display_name() --- toolsrc/include/package_spec.h | 2 ++ toolsrc/src/BinaryParagraph.cpp | 2 +- toolsrc/src/package_spec.cpp | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/toolsrc/include/package_spec.h b/toolsrc/include/package_spec.h index b469567c74..1bc493756b 100644 --- a/toolsrc/include/package_spec.h +++ b/toolsrc/include/package_spec.h @@ -15,6 +15,8 @@ namespace vcpkg const triplet& target_triplet() const; + std::string display_name() const; + std::string dir() const; std::string toString() const; diff --git a/toolsrc/src/BinaryParagraph.cpp b/toolsrc/src/BinaryParagraph.cpp index eed87eb813..f949677a38 100644 --- a/toolsrc/src/BinaryParagraph.cpp +++ b/toolsrc/src/BinaryParagraph.cpp @@ -71,7 +71,7 @@ namespace vcpkg std::string BinaryParagraph::displayname() const { - return Strings::format("%s:%s", this->spec.name(), this->spec.target_triplet()); + return this->spec.display_name(); } std::string BinaryParagraph::dir() const diff --git a/toolsrc/src/package_spec.cpp b/toolsrc/src/package_spec.cpp index 7d8d2681db..2713e219f7 100644 --- a/toolsrc/src/package_spec.cpp +++ b/toolsrc/src/package_spec.cpp @@ -50,6 +50,11 @@ namespace vcpkg return this->m_target_triplet; } + std::string package_spec::display_name() const + { + return Strings::format("%s:%s", this->name(), this->target_triplet()); + } + std::string package_spec::dir() const { return Strings::format("%s_%s", this->m_name, this->m_target_triplet); @@ -57,7 +62,7 @@ namespace vcpkg std::string package_spec::toString() const { - return Strings::format("%s:%s", this->name(), this->target_triplet()); + return this->display_name(); } std::string to_printf_arg(const package_spec& spec) From b1f0a09af250296d7483aa28e3a014d2635600b5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 12:46:35 -0800 Subject: [PATCH 234/561] Remove commented-out code --- toolsrc/src/commands_remove.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index d95fd7af99..9a0b6950e6 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -130,11 +130,6 @@ namespace vcpkg::Commands::Remove Checks::unreachable(); } - //std::copy_if(plan.cbegin(), plan.cend(), std::back_inserter(not_installed), [](const package_spec_with_remove_plan& i) - // { - // return i.plan.type == remove_plan_type::NOT_INSTALLED; - // }); - if (!not_installed.empty()) { sort_packages_by_name(¬_installed); From 82005ffe7474b5432bb043e3b4859bdd68ea6030 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 12:59:10 -0800 Subject: [PATCH 235/561] Improve messages from the `remove` command --- toolsrc/src/commands_remove.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 9a0b6950e6..85154d3562 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -97,7 +97,6 @@ namespace vcpkg::Commands::Remove pkg.state = install_state_t::not_installed; write_update(paths, pkg); - System::println(System::color::success, "Package %s was successfully removed", pkg.package.displayname()); } static void sort_packages_by_name(std::vector* packages) @@ -197,12 +196,17 @@ namespace vcpkg::Commands::Remove } else if (action.plan.type == remove_plan_type::REMOVE_AUTO_SELECTED || action.plan.type == remove_plan_type::REMOVE_USER_REQUESTED) { + const std::string display_name = action.spec.display_name(); + System::println("Removing package %s... ", display_name); remove_package(paths, *action.plan.status_pgh); + System::println(System::color::success, "Removing package %s... done", display_name); if (alsoRemoveFolderFromPackages) { const fs::path spec_package_dir = paths.packages / action.spec.dir(); + System::println("Purging package %s... ", display_name); delete_directory(spec_package_dir); + System::println(System::color::success, "Purging package %s... done", display_name); } } else From 9c87fcbd8b7e1cdee148d33ed272ae5ecc83fb60 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 13:37:00 -0800 Subject: [PATCH 236/561] Formatting --- toolsrc/src/commands_remove.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 85154d3562..b28fe32838 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -183,7 +183,8 @@ namespace vcpkg::Commands::Remove if (has_non_user_requested_packages && !isRecursive) { - System::println(System::color::warning, "Additional packages (*) need to be removed to complete this operation.\n" + System::println(System::color::warning, + "Additional packages (*) need to be removed to complete this operation.\n" "If you are sure you want to remove them, run the command with the --recursive option"); exit(EXIT_FAILURE); } From e461467affad578d2e13a5c8f18cc37ee3007938 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 13:57:43 -0800 Subject: [PATCH 237/561] [Dependencies] User-requested vs autos-elected info is now in a separate enum --- toolsrc/include/vcpkg_Dependencies.h | 12 +++++++++--- toolsrc/src/commands_remove.cpp | 26 ++++++++++++++------------ toolsrc/src/vcpkg_Dependencies.cpp | 6 +++--- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 5b0bf31874..b987a6b389 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -6,6 +6,12 @@ namespace vcpkg::Dependencies { + enum class request_type + { + USER_REQUESTED, + AUTO_SELECTED + }; + enum class install_plan_type { BUILD_AND_INSTALL, @@ -29,13 +35,13 @@ namespace vcpkg::Dependencies enum class remove_plan_type { NOT_INSTALLED, - REMOVE_AUTO_SELECTED, - REMOVE_USER_REQUESTED + REMOVE }; struct remove_plan_action { - remove_plan_type type; + remove_plan_type plan_type; + request_type request_type; std::unique_ptr status_pgh; }; diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index b28fe32838..2fc560275d 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -114,13 +114,13 @@ namespace vcpkg::Commands::Remove for (const package_spec_with_remove_plan& i : plan) { - if (i.plan.type == remove_plan_type::NOT_INSTALLED) + if (i.plan.plan_type == remove_plan_type::NOT_INSTALLED) { not_installed.push_back(&i); continue; } - if (i.plan.type == remove_plan_type::REMOVE_AUTO_SELECTED || i.plan.type == remove_plan_type::REMOVE_USER_REQUESTED) + if (i.plan.plan_type == remove_plan_type::REMOVE) { remove.push_back(&i); continue; @@ -145,15 +145,17 @@ namespace vcpkg::Commands::Remove System::println("The following packages will be removed:\n%s", Strings::Joiner::on("\n").join(remove, [](const package_spec_with_remove_plan* p) { - switch (p->plan.type) + if (p->plan.request_type == Dependencies::request_type::AUTO_SELECTED) { - case remove_plan_type::REMOVE_USER_REQUESTED: - return " " + p->spec.toString(); - case remove_plan_type::REMOVE_AUTO_SELECTED: - return " * " + p->spec.toString(); - default: - Checks::unreachable(); + return " * " + p->spec.toString(); } + + if (p->plan.request_type == Dependencies::request_type::USER_REQUESTED) + { + return " " + p->spec.toString(); + } + + Checks::unreachable(); })); } } @@ -178,7 +180,7 @@ namespace vcpkg::Commands::Remove const bool has_non_user_requested_packages = std::find_if(remove_plan.cbegin(), remove_plan.cend(), [](const package_spec_with_remove_plan& package)-> bool { - return package.plan.type == remove_plan_type::REMOVE_AUTO_SELECTED; + return package.plan.plan_type == remove_plan_type::REMOVE_AUTO_SELECTED; }) != remove_plan.cend(); if (has_non_user_requested_packages && !isRecursive) @@ -191,11 +193,11 @@ namespace vcpkg::Commands::Remove for (const package_spec_with_remove_plan& action : remove_plan) { - if (action.plan.type == remove_plan_type::NOT_INSTALLED) + if (action.plan.plan_type == remove_plan_type::NOT_INSTALLED) { System::println(System::color::success, "Package %s is not installed", action.spec); } - else if (action.plan.type == remove_plan_type::REMOVE_AUTO_SELECTED || action.plan.type == remove_plan_type::REMOVE_USER_REQUESTED) + else if (action.plan.plan_type == remove_plan_type::REMOVE_AUTO_SELECTED || action.plan.plan_type == remove_plan_type::REMOVE_USER_REQUESTED) { const std::string display_name = action.spec.display_name(); System::println("Removing package %s... ", display_name); diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index b0047a772e..669cdfc205 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -93,7 +93,7 @@ namespace vcpkg::Dependencies auto it = status_db.find(spec); if (it == status_db.end() || (*it)->state == install_state_t::not_installed) { - was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, nullptr}); + was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED, nullptr}); continue; } @@ -114,8 +114,8 @@ namespace vcpkg::Dependencies examine_stack.push_back(an_installed_package.get()->package.spec); } - const remove_plan_type type = specs_as_set.find(spec) != specs_as_set.end() ? remove_plan_type::REMOVE_USER_REQUESTED : remove_plan_type::REMOVE_AUTO_SELECTED; - was_examined.emplace(spec, remove_plan_action{type, std::make_unique(std::move(**it))}); + const request_type request_type = specs_as_set.find(spec) != specs_as_set.end() ? request_type::USER_REQUESTED : request_type::AUTO_SELECTED; + was_examined.emplace(spec, remove_plan_action{remove_plan_type::REMOVE, request_type,std::make_unique(std::move(**it))}); } std::vector ret; From b4e9322a11aa2d0d9b0f1c0f960d921ce51e1c0f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 13:58:58 -0800 Subject: [PATCH 238/561] Rename field --- toolsrc/include/vcpkg_Dependencies.h | 2 +- toolsrc/src/commands_build.cpp | 2 +- toolsrc/src/commands_install.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index b987a6b389..ac4a13e846 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -21,7 +21,7 @@ namespace vcpkg::Dependencies struct install_plan_action { - install_plan_type type; + install_plan_type plan_type; std::unique_ptr binary_pgh; std::unique_ptr source_pgh; }; diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index b6c3cea03b..ccc3c8d9f1 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -107,7 +107,7 @@ namespace vcpkg::Commands::Build unmet_dependencies.erase( std::remove_if(unmet_dependencies.begin(), unmet_dependencies.end(), [](const package_spec_with_install_plan& p) { - return p.plan.type == install_plan_type::ALREADY_INSTALLED; + return p.plan.plan_type == install_plan_type::ALREADY_INSTALLED; }), unmet_dependencies.end()); diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index e5c5dd013d..0371cc6e5b 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -205,21 +205,21 @@ namespace vcpkg::Commands::Install { try { - if (action.plan.type == install_plan_type::ALREADY_INSTALLED) + if (action.plan.plan_type == install_plan_type::ALREADY_INSTALLED) { if (std::find(specs.begin(), specs.end(), action.spec) != specs.end()) { System::println(System::color::success, "Package %s is already installed", action.spec); } } - else if (action.plan.type == install_plan_type::BUILD_AND_INSTALL) + else if (action.plan.plan_type == install_plan_type::BUILD_AND_INSTALL) { Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec)); const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); install_package(paths, bpgh, status_db); System::println(System::color::success, "Package %s is installed", action.spec); } - else if (action.plan.type == install_plan_type::INSTALL) + else if (action.plan.plan_type == install_plan_type::INSTALL) { install_package(paths, *action.plan.binary_pgh, status_db); System::println(System::color::success, "Package %s is installed", action.spec); From a7be90f823d9a3b33e58568c28836be33bda5ac8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 14:17:26 -0800 Subject: [PATCH 239/561] Fix usage of remove_plan_type --- toolsrc/src/commands_remove.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 2fc560275d..b09790efc7 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -9,6 +9,7 @@ namespace vcpkg::Commands::Remove { using Dependencies::package_spec_with_remove_plan; using Dependencies::remove_plan_type; + using Dependencies::request_type; static const std::string OPTION_PURGE = "--purge"; static const std::string OPTION_RECURSIVE = "--recursive"; @@ -180,7 +181,7 @@ namespace vcpkg::Commands::Remove const bool has_non_user_requested_packages = std::find_if(remove_plan.cbegin(), remove_plan.cend(), [](const package_spec_with_remove_plan& package)-> bool { - return package.plan.plan_type == remove_plan_type::REMOVE_AUTO_SELECTED; + return package.plan.request_type != request_type::USER_REQUESTED; }) != remove_plan.cend(); if (has_non_user_requested_packages && !isRecursive) @@ -197,7 +198,7 @@ namespace vcpkg::Commands::Remove { System::println(System::color::success, "Package %s is not installed", action.spec); } - else if (action.plan.plan_type == remove_plan_type::REMOVE_AUTO_SELECTED || action.plan.plan_type == remove_plan_type::REMOVE_USER_REQUESTED) + else if (action.plan.plan_type == remove_plan_type::REMOVE) { const std::string display_name = action.spec.display_name(); System::println("Removing package %s... ", display_name); @@ -206,9 +207,8 @@ namespace vcpkg::Commands::Remove if (alsoRemoveFolderFromPackages) { - const fs::path spec_package_dir = paths.packages / action.spec.dir(); System::println("Purging package %s... ", display_name); - delete_directory(spec_package_dir); + delete_directory(paths.packages / action.spec.dir()); System::println(System::color::success, "Purging package %s... done", display_name); } } From 836de4b0748617db6d06b0eef6fe9ccff9980b1f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 15:29:02 -0800 Subject: [PATCH 240/561] Fix remove_plan code --- toolsrc/include/vcpkg_Dependencies.h | 2 +- toolsrc/src/vcpkg_Dependencies.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index ac4a13e846..9180cb65e1 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -42,7 +42,7 @@ namespace vcpkg::Dependencies { remove_plan_type plan_type; request_type request_type; - std::unique_ptr status_pgh; + StatusParagraph* status_pgh; }; struct package_spec_with_remove_plan diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 669cdfc205..bb2ecc666b 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -90,7 +90,7 @@ namespace vcpkg::Dependencies continue; } - auto it = status_db.find(spec); + const StatusParagraphs::const_iterator it = status_db.find(spec); if (it == status_db.end() || (*it)->state == install_state_t::not_installed) { was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED, nullptr}); @@ -115,7 +115,7 @@ namespace vcpkg::Dependencies } const request_type request_type = specs_as_set.find(spec) != specs_as_set.end() ? request_type::USER_REQUESTED : request_type::AUTO_SELECTED; - was_examined.emplace(spec, remove_plan_action{remove_plan_type::REMOVE, request_type,std::make_unique(std::move(**it))}); + was_examined.emplace(spec, remove_plan_action{remove_plan_type::REMOVE, request_type,it->get()}); } std::vector ret; From 8de71af4bd94ae1e41bf39a455ed716ac8cdf9bc Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 16:14:48 -0800 Subject: [PATCH 241/561] Introduce "optional" alias --- toolsrc/include/vcpkg_Dependencies.h | 5 +++-- toolsrc/include/vcpkg_optional.h | 5 +++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 1 + toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 3 +++ 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 toolsrc/include/vcpkg_optional.h diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 9180cb65e1..2595d9fb83 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -3,6 +3,7 @@ #include "package_spec.h" #include "StatusParagraphs.h" #include "vcpkg_paths.h" +#include "vcpkg_optional.h" namespace vcpkg::Dependencies { @@ -22,8 +23,8 @@ namespace vcpkg::Dependencies struct install_plan_action { install_plan_type plan_type; - std::unique_ptr binary_pgh; - std::unique_ptr source_pgh; + optional binary_pgh; + optional source_pgh; }; struct package_spec_with_install_plan diff --git a/toolsrc/include/vcpkg_optional.h b/toolsrc/include/vcpkg_optional.h new file mode 100644 index 0000000000..7b935bea99 --- /dev/null +++ b/toolsrc/include/vcpkg_optional.h @@ -0,0 +1,5 @@ +#pragma once +#include + +template +using optional = std::unique_ptr; diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index b9722c68e6..e6fbfb65ab 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -166,6 +166,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 0f8b033789..7ddfba6f29 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -260,5 +260,8 @@ Header Files + + Header Files + \ No newline at end of file From 86a5ab7bccce5988682e69c4e1c14fedbf9a13a7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 16:40:09 -0800 Subject: [PATCH 242/561] Use pointer instead of reference for out param --- toolsrc/src/commands_install.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 0371cc6e5b..439424d28e 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -134,11 +134,11 @@ namespace vcpkg::Commands::Install return ImmutableSortedVector::create(std::move(installed_files)); } - void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) + void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs* status_db) { const fs::path package_dir = paths.package_dir(binary_paragraph.spec); const triplet& triplet = binary_paragraph.spec.target_triplet(); - const std::vector pgh_and_files = get_installed_files(paths, status_db); + const std::vector pgh_and_files = get_installed_files(paths, *status_db); const ImmutableSortedVector package_files = build_list_of_package_files(package_dir); const ImmutableSortedVector installed_files = build_list_of_installed_files(pgh_and_files, triplet); @@ -166,19 +166,19 @@ namespace vcpkg::Commands::Install spgh.state = install_state_t::half_installed; for (auto&& dep : spgh.package.depends) { - if (status_db.find_installed(dep, spgh.package.spec.target_triplet()) == status_db.end()) + if (status_db->find_installed(dep, spgh.package.spec.target_triplet()) == status_db->end()) { Checks::unreachable(); } } write_update(paths, spgh); - status_db.insert(std::make_unique(spgh)); + status_db->insert(std::make_unique(spgh)); install_and_write_listfile(paths, spgh.package); spgh.state = install_state_t::installed; write_update(paths, spgh); - status_db.insert(std::make_unique(spgh)); + status_db->insert(std::make_unique(spgh)); } void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) @@ -216,12 +216,12 @@ namespace vcpkg::Commands::Install { Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec)); const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); - install_package(paths, bpgh, status_db); + install_package(paths, bpgh, &status_db); System::println(System::color::success, "Package %s is installed", action.spec); } else if (action.plan.plan_type == install_plan_type::INSTALL) { - install_package(paths, *action.plan.binary_pgh, status_db); + install_package(paths, *action.plan.binary_pgh, &status_db); System::println(System::color::success, "Package %s is installed", action.spec); } else From 4252d9436e6d4104f6acc5560aef461046aae853 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 16:46:39 -0800 Subject: [PATCH 243/561] remove_plan now depends on the spec, instead of StatusParagraph --- toolsrc/include/vcpkg_Dependencies.h | 1 - toolsrc/src/commands_remove.cpp | 6 ++++-- toolsrc/src/vcpkg_Dependencies.cpp | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 2595d9fb83..ba84d1bd14 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -43,7 +43,6 @@ namespace vcpkg::Dependencies { remove_plan_type plan_type; request_type request_type; - StatusParagraph* status_pgh; }; struct package_spec_with_remove_plan diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index b09790efc7..5a9467b47e 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -28,8 +28,10 @@ namespace vcpkg::Commands::Remove } } - static void remove_package(const vcpkg_paths& paths, StatusParagraph& pkg) + static void remove_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs* status_db) { + StatusParagraph& pkg = **status_db->find(spec.name(), spec.target_triplet()); + pkg.want = want_t::purge; pkg.state = install_state_t::half_installed; write_update(paths, pkg); @@ -202,7 +204,7 @@ namespace vcpkg::Commands::Remove { const std::string display_name = action.spec.display_name(); System::println("Removing package %s... ", display_name); - remove_package(paths, *action.plan.status_pgh); + remove_package(paths, action.spec, &status_db); System::println(System::color::success, "Removing package %s... done", display_name); if (alsoRemoveFolderFromPackages) diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index bb2ecc666b..a534537d23 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -93,7 +93,7 @@ namespace vcpkg::Dependencies const StatusParagraphs::const_iterator it = status_db.find(spec); if (it == status_db.end() || (*it)->state == install_state_t::not_installed) { - was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED, nullptr}); + was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED}); continue; } @@ -115,7 +115,7 @@ namespace vcpkg::Dependencies } const request_type request_type = specs_as_set.find(spec) != specs_as_set.end() ? request_type::USER_REQUESTED : request_type::AUTO_SELECTED; - was_examined.emplace(spec, remove_plan_action{remove_plan_type::REMOVE, request_type,it->get()}); + was_examined.emplace(spec, remove_plan_action{remove_plan_type::REMOVE}); } std::vector ret; From 4e64dc598a53493a85d65f94c81a33c4862fc89a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 17:52:53 -0800 Subject: [PATCH 244/561] [Dependencies] Specify constructors and fix bug with default remove_plan_action init --- toolsrc/include/vcpkg_Dependencies.h | 22 ++++++++++++++++++ toolsrc/src/vcpkg_Dependencies.cpp | 34 ++++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index ba84d1bd14..b638160891 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -9,12 +9,14 @@ namespace vcpkg::Dependencies { enum class request_type { + UNKNOWN, USER_REQUESTED, AUTO_SELECTED }; enum class install_plan_type { + UNKNOWN, BUILD_AND_INSTALL, INSTALL, ALREADY_INSTALLED @@ -22,6 +24,13 @@ namespace vcpkg::Dependencies struct install_plan_action { + install_plan_action(); + install_plan_action(const install_plan_type& plan_type, optional binary_pgh, optional source_pgh); + install_plan_action(const install_plan_action&) = delete; + install_plan_action(install_plan_action&&) = default; + install_plan_action& operator=(const install_plan_action&) = delete; + install_plan_action& operator=(install_plan_action&&) = default; + install_plan_type plan_type; optional binary_pgh; optional source_pgh; @@ -29,24 +38,37 @@ namespace vcpkg::Dependencies struct package_spec_with_install_plan { + package_spec_with_install_plan(const package_spec& spec, install_plan_action&& plan); + package_spec spec; install_plan_action plan; }; enum class remove_plan_type { + UNKNOWN, NOT_INSTALLED, REMOVE }; struct remove_plan_action { + remove_plan_action(); + remove_plan_action(const remove_plan_type& plan_type, const request_type& request_type); + remove_plan_action(const remove_plan_action&) = delete; + remove_plan_action(remove_plan_action&&) = default; + remove_plan_action& operator=(const remove_plan_action&) = delete; + remove_plan_action& operator=(remove_plan_action&&) = default; + + remove_plan_type plan_type; request_type request_type; }; struct package_spec_with_remove_plan { + package_spec_with_remove_plan(const package_spec& spec, remove_plan_action&& plan); + package_spec spec; remove_plan_action plan; }; diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index a534537d23..5bd6c3eb9d 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -9,6 +9,32 @@ namespace vcpkg::Dependencies { + install_plan_action::install_plan_action() : plan_type(install_plan_type::UNKNOWN), binary_pgh(nullptr), source_pgh(nullptr) + { + } + + install_plan_action::install_plan_action(const install_plan_type& plan_type, optional binary_pgh, optional source_pgh) + : plan_type(std::move(plan_type)), binary_pgh(std::move(binary_pgh)), source_pgh(std::move(source_pgh)) + { + } + + package_spec_with_install_plan::package_spec_with_install_plan(const package_spec& spec, install_plan_action&& plan) : spec(spec), plan(std::move(plan)) + { + } + + remove_plan_action::remove_plan_action() : plan_type(remove_plan_type::UNKNOWN), request_type(request_type::UNKNOWN) + { + } + + remove_plan_action::remove_plan_action(const remove_plan_type& plan_type, const Dependencies::request_type& request_type) : plan_type(plan_type), request_type(request_type) + { + } + + package_spec_with_remove_plan::package_spec_with_remove_plan(const package_spec& spec, remove_plan_action&& plan) + : spec(spec), plan(std::move(plan)) + { + } + std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) { std::unordered_map was_examined; // Examine = we have checked its immediate (non-recursive) dependencies @@ -66,7 +92,7 @@ namespace vcpkg::Dependencies const std::vector pkgs = graph.find_topological_sort(); for (const package_spec& pkg : pkgs) { - ret.push_back({pkg, std::move(was_examined[pkg])}); + ret.push_back(package_spec_with_install_plan(pkg, std::move(was_examined[pkg]))); } return ret; } @@ -93,7 +119,7 @@ namespace vcpkg::Dependencies const StatusParagraphs::const_iterator it = status_db.find(spec); if (it == status_db.end() || (*it)->state == install_state_t::not_installed) { - was_examined.emplace(spec, remove_plan_action{remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED}); + was_examined.emplace(spec, remove_plan_action(remove_plan_type::NOT_INSTALLED, request_type::USER_REQUESTED)); continue; } @@ -115,7 +141,7 @@ namespace vcpkg::Dependencies } const request_type request_type = specs_as_set.find(spec) != specs_as_set.end() ? request_type::USER_REQUESTED : request_type::AUTO_SELECTED; - was_examined.emplace(spec, remove_plan_action{remove_plan_type::REMOVE}); + was_examined.emplace(spec, remove_plan_action(remove_plan_type::REMOVE, request_type)); } std::vector ret; @@ -123,7 +149,7 @@ namespace vcpkg::Dependencies const std::vector pkgs = graph.find_topological_sort(); for (const package_spec& pkg : pkgs) { - ret.push_back({pkg, std::move(was_examined[pkg])}); + ret.push_back(package_spec_with_remove_plan(pkg, std::move(was_examined[pkg]))); } return ret; } From 5c01fc4af871ed1cc1481a53957be1460142a6f2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 22:04:04 -0800 Subject: [PATCH 245/561] Change --recursive option to --recurse --- toolsrc/src/commands_remove.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 5a9467b47e..7e8608e727 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -12,7 +12,7 @@ namespace vcpkg::Commands::Remove using Dependencies::request_type; static const std::string OPTION_PURGE = "--purge"; - static const std::string OPTION_RECURSIVE = "--recursive"; + static const std::string OPTION_RECURSE = "--recurse"; static void delete_directory(const fs::path& directory) { @@ -168,13 +168,13 @@ namespace vcpkg::Commands::Remove static const std::string example = Commands::Help::create_example_string("remove zlib zlib:x64-windows curl boost"); args.check_min_arg_count(1, example); - const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_PURGE, OPTION_RECURSIVE}); + const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_PURGE, OPTION_RECURSE}); auto status_db = database_load_check(paths); std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example); Input::check_triplets(specs, paths); const bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end(); - const bool isRecursive = options.find(OPTION_RECURSIVE) != options.end(); + const bool isRecursive = options.find(OPTION_RECURSE) != options.end(); const std::vector remove_plan = Dependencies::create_remove_plan(paths, specs, status_db); Checks::check_exit(!remove_plan.empty(), "Remove plan cannot be empty"); @@ -190,7 +190,7 @@ namespace vcpkg::Commands::Remove { System::println(System::color::warning, "Additional packages (*) need to be removed to complete this operation.\n" - "If you are sure you want to remove them, run the command with the --recursive option"); + "If you are sure you want to remove them, run the command with the --recurse option"); exit(EXIT_FAILURE); } From e6e325b1cd92bf0b1aa05c84a2a757713f17fa08 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 22:10:08 -0800 Subject: [PATCH 246/561] Fix usage of Strings::Joiner --- toolsrc/src/commands_install.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 439424d28e..1f5a2234d8 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -155,7 +155,7 @@ namespace vcpkg::Commands::Install triplet_install_path.generic_string(), binary_paragraph.spec); System::print("\n "); - System::println(Strings::join(intersection, "\n ")); + System::println(Strings::Joiner::on("\n ").join(intersection)); System::println(""); exit(EXIT_FAILURE); } From c6ab2a962600b5c1c506b7dbf70d5719c4c8aaf1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 23:01:33 -0800 Subject: [PATCH 247/561] Update CHANGELOG and bump version to v0.0.71 --- CHANGELOG.md | 38 ++++++++++++++++++++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3380cd074f..b631be48b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,41 @@ +vcpkg (0.0.71) +-------------- + * Add ports: + - atk 2.22.0 + - fontconfig 2.12.1 + - opus 1.1.4 + - pango 1.40.3 + - xerces-c 3.1.4 + * Update ports: + - boost 1.62-11 -> 1.63 + - cairo 1.14.6 -> 1.15.4 + - directxtk dec2016 -> dec2016-1 + - fltk 1.3.4-1 -> 1.3.4-2 + - gdal 1.11.3 -> 1.11.3-1 + - harfbuzz 1.3.4 -> 1.3.4-2 + - libarchive 3.2.2 -> 3.2.2-2 + - libmariadb 2.3.1 -> 2.3.2 + - mpir 2.7.2 -> 2.7.2-1 + - openssl 1.0.2j-2 -> 1.0.2k-2 + - wt 3.3.6 -> 3.3.6-2 + * Improve `vcpkg remove`: + - Now shows all dependencies that need to be removed instead of just the immediate dependencies + - Add `--recurse` option that removes all dependencies + - Improve messages + * Improve support for Visual Studio 2017 + - Better VS2017 detection + - Fixed various issues with `bootstrap.ps1` and VS2017 support + * Fix `vcpkg_copy_pdbs()` under non-English locale + * Notable changes for buiding the `vcpkg` tool: + - Restructure `vcpkg` project hierarchy. Now only has 4 projects (down from 6). Most of the code now lives under vcpkglib.vcxproj + - Enable multiprocessor compilation + - Disable MinimalRebuild + - Use precompiled headers + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team MON, 30 Jan 2017 23:00:00 -0800 + + vcpkg (0.0.70) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 1759b863b1..fcedfa2359 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.70" \ No newline at end of file +"0.0.71" \ No newline at end of file From 2a83c5eda6288cba46cb723996f95b0f6b21e61f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 12:59:20 -0800 Subject: [PATCH 248/561] [opt_bool] Make members ALL_CAPS --- toolsrc/include/opt_bool.h | 6 +++--- toolsrc/include/vcpkg_cmd_arguments.h | 6 +++--- toolsrc/src/vcpkg.cpp | 12 ++++++------ toolsrc/src/vcpkg_cmd_arguments.cpp | 12 ++++++------ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/toolsrc/include/opt_bool.h b/toolsrc/include/opt_bool.h index 3856366c8a..42133fb7ad 100644 --- a/toolsrc/include/opt_bool.h +++ b/toolsrc/include/opt_bool.h @@ -4,8 +4,8 @@ namespace vcpkg { enum class opt_bool { - unspecified, - enabled, - disabled + UNSPECIFIED, + ENABLED, + DISABLED }; } diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 8ace985867..79e12841d3 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -14,9 +14,9 @@ namespace vcpkg std::unique_ptr vcpkg_root_dir; std::unique_ptr target_triplet; - opt_bool debug = opt_bool::unspecified; - opt_bool sendmetrics = opt_bool::unspecified; - opt_bool printmetrics = opt_bool::unspecified; + opt_bool debug = opt_bool::UNSPECIFIED; + opt_bool sendmetrics = opt_bool::UNSPECIFIED; + opt_bool printmetrics = opt_bool::UNSPECIFIED; std::string command; std::vector command_arguments; diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index b783191676..36bd0a40ac 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -202,14 +202,14 @@ int wmain(const int argc, const wchar_t* const* const argv) const vcpkg_cmd_arguments args = vcpkg_cmd_arguments::create_from_command_line(argc, argv); - if (args.printmetrics != opt_bool::unspecified) - SetPrintMetrics(args.printmetrics == opt_bool::enabled); - if (args.sendmetrics != opt_bool::unspecified) - SetSendMetrics(args.sendmetrics == opt_bool::enabled); + if (args.printmetrics != opt_bool::UNSPECIFIED) + SetPrintMetrics(args.printmetrics == opt_bool::ENABLED); + if (args.sendmetrics != opt_bool::UNSPECIFIED) + SetSendMetrics(args.sendmetrics == opt_bool::ENABLED); - if (args.debug != opt_bool::unspecified) + if (args.debug != opt_bool::UNSPECIFIED) { - g_debugging = (args.debug == opt_bool::enabled); + g_debugging = (args.debug == opt_bool::ENABLED); } if (g_debugging) diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index 4a06128a41..e0d3070778 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -36,7 +36,7 @@ namespace vcpkg const std::string& option_name, opt_bool& option_field) { - if (option_field != opt_bool::unspecified && option_field != new_setting) + if (option_field != opt_bool::UNSPECIFIED && option_field != new_setting) { System::println(System::color::error, "Error: conflicting values specified for --%s", option_name); TrackProperty("error", "error conflicting switches"); @@ -94,27 +94,27 @@ namespace vcpkg } if (arg == "--debug") { - parse_switch(opt_bool::enabled, "debug", args.debug); + parse_switch(opt_bool::ENABLED, "debug", args.debug); continue; } if (arg == "--sendmetrics") { - parse_switch(opt_bool::enabled, "sendmetrics", args.sendmetrics); + parse_switch(opt_bool::ENABLED, "sendmetrics", args.sendmetrics); continue; } if (arg == "--printmetrics") { - parse_switch(opt_bool::enabled, "printmetrics", args.printmetrics); + parse_switch(opt_bool::ENABLED, "printmetrics", args.printmetrics); continue; } if (arg == "--no-sendmetrics") { - parse_switch(opt_bool::disabled, "sendmetrics", args.sendmetrics); + parse_switch(opt_bool::DISABLED, "sendmetrics", args.sendmetrics); continue; } if (arg == "--no-printmetrics") { - parse_switch(opt_bool::disabled, "printmetrics", args.printmetrics); + parse_switch(opt_bool::DISABLED, "printmetrics", args.printmetrics); continue; } From 8b219333675e42edf21f6c528fe7760d6d465460 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 31 Jan 2017 17:53:08 -0800 Subject: [PATCH 249/561] [vcpkg-msbuild] Add troubleshooting message to MSBuild projects with Importance=Normal --- scripts/buildsystems/msbuild/vcpkg.targets | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 26a524ca3a..d1d804e944 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -51,6 +51,11 @@ + + + + + Date: Tue, 31 Jan 2017 18:14:25 -0800 Subject: [PATCH 250/561] [boost] Add additional build assertions. --- ports/boost/portfile.cmake | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index d8f0a23d12..81424078eb 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -79,7 +79,19 @@ set(B2_OPTIONS_REL -sBZIP2_LIBPATH="${CURRENT_INSTALLED_DIR}\\lib" ) -file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) +file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) +if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + message(FATAL_ERROR "Unable to remove directory: ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel\n Files are likely in use.") +endif() + +file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) +if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + message(FATAL_ERROR "Unable to remove directory: ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg\n Files are likely in use.") +endif() + +if(EXISTS ${CURRENT_PACKAGES_DIR}/debug) + message(FATAL_ERROR "Error: directory exists: ${CURRENT_PACKAGES_DIR}/debug\n The previous package was not fully cleared. This is an internal error.") +endif() message(STATUS "Building ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process_repeat( From f02c8f9e6472e5cf5fa1cc4b7273871bd6cf26c8 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Wed, 1 Feb 2017 06:40:01 -0800 Subject: [PATCH 251/561] added patch to add missing NO_DEPRECATE defines for UWP --- .../0002-Allow-deprecated-functions.patch | 14 ++++++++++++++ ports/libvorbis/portfile.cmake | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 ports/libvorbis/0002-Allow-deprecated-functions.patch diff --git a/ports/libvorbis/0002-Allow-deprecated-functions.patch b/ports/libvorbis/0002-Allow-deprecated-functions.patch new file mode 100644 index 0000000000..ea1d07e399 --- /dev/null +++ b/ports/libvorbis/0002-Allow-deprecated-functions.patch @@ -0,0 +1,14 @@ +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 2043294..e273393 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -61,6 +61,9 @@ if(MSVC) + list(APPEND VORBIS_SOURCES ../win32/vorbis.def) + list(APPEND VORBISENC_SOURCES ../win32/vorbisenc.def) + list(APPEND VORBISFILE_SOURCES ../win32/vorbisfile.def) ++ add_definitions(-D_CRT_SECURE_NO_WARNINGS) ++ add_definitions(-D_CRT_SECURE_NO_DEPRECATE) ++ add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + endif() + + include_directories(../include) diff --git a/ports/libvorbis/portfile.cmake b/ports/libvorbis/portfile.cmake index 66bfca07c7..85fa1d26bd 100644 --- a/ports/libvorbis/portfile.cmake +++ b/ports/libvorbis/portfile.cmake @@ -35,7 +35,9 @@ if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") ) message(STATUS "Patching") vcpkg_execute_required_process( - COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Add-vorbisenc.c-to-vorbis-library.patch --ignore-whitespace --whitespace=fix + COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Add-vorbisenc.c-to-vorbis-library.patch + ${CMAKE_CURRENT_LIST_DIR}/0002-Allow-deprecated-functions.patch + --ignore-whitespace --whitespace=fix WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src LOGNAME patch ) From 9ee6208e02128f0d22859ffe91cb29ac49a13f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Wed, 1 Feb 2017 12:49:09 -0500 Subject: [PATCH 252/561] Install grpc_cpp_plugin.exe into tools folder --- ports/grpc/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index ffd71d1375..90915976ce 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -53,6 +53,8 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCTargets-release.cmake ${C file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/gRPC/gRPCTargets-debug.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-debug.cmake) file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) +file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/grpc_cpp_plugin.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) From f2d40c5b81cba14c86d836bc21978c4f3f691538 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 11:38:58 -0800 Subject: [PATCH 253/561] Download 32-bit perl instead of 64-bit. Resolves #620 --- scripts/cmake/vcpkg_find_acquire_program.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index ab0cf1587b..cd4a554f47 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -8,9 +8,9 @@ function(vcpkg_find_acquire_program VAR) if(VAR MATCHES "PERL") set(PROGNAME perl) set(PATHS ${DOWNLOADS}/tools/perl/perl/bin) - set(URL "http://strawberryperl.com/download/5.20.2.1/strawberry-perl-5.20.2.1-64bit-portable.zip") - set(ARCHIVE "strawberry-perl-5.20.2.1-64bit-portable.zip") - set(HASH 6e14e5580e52da5d35f29b67a52ef9db0e021af1575b4bbd84ebdbf18580522287890bdc21c0d21ddc1b2529d888f8e159dcaa017a3ff06d8fd23d16901bcc8b) + set(URL "http://strawberryperl.com/download/5.24.1.1/strawberry-perl-5.24.1.1-32bit-portable.zip") + set(ARCHIVE "strawberry-perl-5.24.1.1-32bit-portable.zip") + set(HASH a6e685ea24376f50db5f06c5b46075f1d3be25168fa1f27fa9b02e2ac017826cee62a2b43562f9b6c989337a231ba914416c110075457764de2d11f99d5e0f26) elseif(VAR MATCHES "NASM") set(PROGNAME nasm) set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.11.08) From bd1a10e5b97b073731cbb97e26611edf317c16d5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 13:31:45 -0800 Subject: [PATCH 254/561] Enhance the opt_bool type --- toolsrc/include/opt_bool.h | 28 +++++++++++++++++++--- toolsrc/include/vcpkg_cmd_arguments.h | 6 ++--- toolsrc/src/opt_bool.cpp | 29 +++++++++++++++++++++++ toolsrc/src/vcpkg.cpp | 12 +++++----- toolsrc/src/vcpkg_cmd_arguments.cpp | 16 ++++++------- toolsrc/vcpkglib/vcpkglib.vcxproj | 1 + toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 3 +++ 7 files changed, 75 insertions(+), 20 deletions(-) create mode 100644 toolsrc/src/opt_bool.cpp diff --git a/toolsrc/include/opt_bool.h b/toolsrc/include/opt_bool.h index 42133fb7ad..06642a399f 100644 --- a/toolsrc/include/opt_bool.h +++ b/toolsrc/include/opt_bool.h @@ -1,11 +1,33 @@ #pragma once -namespace vcpkg +#include +#include + +namespace vcpkg::opt_bool { - enum class opt_bool + enum class type { - UNSPECIFIED, + UNSPECIFIED = 0, ENABLED, DISABLED }; + + type parse(const std::string& s); + + template + type from_map(const std::map& map, const T& key) + { + auto it = map.find(key); + if (it == map.cend()) + { + return type::UNSPECIFIED; + } + + return parse(*it); + } } + +namespace vcpkg +{ + using opt_bool_t = opt_bool::type; +} \ No newline at end of file diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 79e12841d3..91f7de8ac1 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -14,9 +14,9 @@ namespace vcpkg std::unique_ptr vcpkg_root_dir; std::unique_ptr target_triplet; - opt_bool debug = opt_bool::UNSPECIFIED; - opt_bool sendmetrics = opt_bool::UNSPECIFIED; - opt_bool printmetrics = opt_bool::UNSPECIFIED; + opt_bool_t debug = opt_bool_t::UNSPECIFIED; + opt_bool_t sendmetrics = opt_bool_t::UNSPECIFIED; + opt_bool_t printmetrics = opt_bool_t::UNSPECIFIED; std::string command; std::vector command_arguments; diff --git a/toolsrc/src/opt_bool.cpp b/toolsrc/src/opt_bool.cpp new file mode 100644 index 0000000000..324936fb4d --- /dev/null +++ b/toolsrc/src/opt_bool.cpp @@ -0,0 +1,29 @@ +#include "pch.h" +#include "opt_bool.h" +#include "vcpkg_Checks.h" + +namespace vcpkg::opt_bool +{ + static const std::string UNSPECIFIED_NAME = "unspecified"; + static const std::string ENABLED_NAME = "enabled"; + static const std::string DISABLED_NAME = "disabled"; + type parse(const std::string& s) + { + if (s == UNSPECIFIED_NAME) + { + return opt_bool_t::UNSPECIFIED; + } + + if (s == ENABLED_NAME) + { + return opt_bool_t::ENABLED; + } + + if (s == DISABLED_NAME) + { + return opt_bool_t::DISABLED; + } + + Checks::exit_with_message("Could not convert string [%s] to opt_bool", s); + } +} diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 36bd0a40ac..3e313c7022 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -202,14 +202,14 @@ int wmain(const int argc, const wchar_t* const* const argv) const vcpkg_cmd_arguments args = vcpkg_cmd_arguments::create_from_command_line(argc, argv); - if (args.printmetrics != opt_bool::UNSPECIFIED) - SetPrintMetrics(args.printmetrics == opt_bool::ENABLED); - if (args.sendmetrics != opt_bool::UNSPECIFIED) - SetSendMetrics(args.sendmetrics == opt_bool::ENABLED); + if (args.printmetrics != opt_bool_t::UNSPECIFIED) + SetPrintMetrics(args.printmetrics == opt_bool_t::ENABLED); + if (args.sendmetrics != opt_bool_t::UNSPECIFIED) + SetSendMetrics(args.sendmetrics == opt_bool_t::ENABLED); - if (args.debug != opt_bool::UNSPECIFIED) + if (args.debug != opt_bool_t::UNSPECIFIED) { - g_debugging = (args.debug == opt_bool::ENABLED); + g_debugging = (args.debug == opt_bool_t::ENABLED); } if (g_debugging) diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index e0d3070778..fdeb6e877a 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -32,11 +32,11 @@ namespace vcpkg } static void parse_switch( - opt_bool new_setting, + opt_bool_t new_setting, const std::string& option_name, - opt_bool& option_field) + opt_bool_t& option_field) { - if (option_field != opt_bool::UNSPECIFIED && option_field != new_setting) + if (option_field != opt_bool_t::UNSPECIFIED && option_field != new_setting) { System::println(System::color::error, "Error: conflicting values specified for --%s", option_name); TrackProperty("error", "error conflicting switches"); @@ -94,27 +94,27 @@ namespace vcpkg } if (arg == "--debug") { - parse_switch(opt_bool::ENABLED, "debug", args.debug); + parse_switch(opt_bool_t::ENABLED, "debug", args.debug); continue; } if (arg == "--sendmetrics") { - parse_switch(opt_bool::ENABLED, "sendmetrics", args.sendmetrics); + parse_switch(opt_bool_t::ENABLED, "sendmetrics", args.sendmetrics); continue; } if (arg == "--printmetrics") { - parse_switch(opt_bool::ENABLED, "printmetrics", args.printmetrics); + parse_switch(opt_bool_t::ENABLED, "printmetrics", args.printmetrics); continue; } if (arg == "--no-sendmetrics") { - parse_switch(opt_bool::DISABLED, "sendmetrics", args.sendmetrics); + parse_switch(opt_bool_t::DISABLED, "sendmetrics", args.sendmetrics); continue; } if (arg == "--no-printmetrics") { - parse_switch(opt_bool::DISABLED, "printmetrics", args.printmetrics); + parse_switch(opt_bool_t::DISABLED, "printmetrics", args.printmetrics); continue; } diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index e6fbfb65ab..e0374774cb 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -198,6 +198,7 @@ + Create Create diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 7ddfba6f29..40bde15361 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -153,6 +153,9 @@ Source Files + + Source Files + From 459999786960483f6d46229524500543459968ed Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 17:09:48 -0800 Subject: [PATCH 255/561] Introduce BuildPolicies (not used by the post_build checks yet) --- toolsrc/include/BuildInfo.h | 6 ++- toolsrc/include/BuildPolicies.h | 30 ++++++++++++++ toolsrc/src/BuildInfo.cpp | 16 ++++++-- toolsrc/src/BuildPolicies.cpp | 49 +++++++++++++++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 + toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 +++ 6 files changed, 105 insertions(+), 4 deletions(-) create mode 100644 toolsrc/include/BuildPolicies.h create mode 100644 toolsrc/src/BuildPolicies.cpp diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index c90ad7a4e6..1fd032aa22 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -3,6 +3,8 @@ #include #include "Paragraphs.h" #include +#include "BuildPolicies.h" +#include "opt_bool.h" namespace vcpkg::PostBuildLint { @@ -119,10 +121,12 @@ namespace vcpkg::PostBuildLint struct BuildInfo { - static BuildInfo create(const std::unordered_map& pgh); + static BuildInfo create(std::unordered_map pgh); std::string crt_linkage; std::string library_linkage; + + std::map policies; }; BuildInfo read_build_info(const fs::path& filepath); diff --git a/toolsrc/include/BuildPolicies.h b/toolsrc/include/BuildPolicies.h new file mode 100644 index 0000000000..fbe9b0ff33 --- /dev/null +++ b/toolsrc/include/BuildPolicies.h @@ -0,0 +1,30 @@ +#pragma once +#include + +namespace vcpkg::PostBuildLint::BuildPolicies +{ + enum class backing_enum_t + { + UNKNOWN = 0, + DLLS_WITHOUT_LIBS + }; + + struct type + { + static constexpr int length() { return 2; } + constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { } + constexpr operator backing_enum_t() const { return backing_enum; } + + const std::string& toString() const; + const std::string& cmake_variable() const; + + private: + type(); + backing_enum_t backing_enum; + }; + + static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); + static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); + + type parse(const std::string& s); +} diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index b401f9d442..82243ebac4 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "BuildInfo.h" #include "vcpkg_Checks.h" +#include "opt_bool.h" #include "vcpkglib_helpers.h" namespace vcpkg::PostBuildLint @@ -44,11 +45,20 @@ namespace vcpkg::PostBuildLint static const std::string LIBRARY_LINKAGE = "LibraryLinkage"; } - BuildInfo BuildInfo::create(const std::unordered_map& pgh) + BuildInfo BuildInfo::create(std::unordered_map pgh) { BuildInfo build_info; - build_info.crt_linkage = details::required_field(pgh, BuildInfoRequiredField::CRT_LINKAGE); - build_info.library_linkage = details::required_field(pgh, BuildInfoRequiredField::LIBRARY_LINKAGE); + build_info.crt_linkage = details::remove_required_field(&pgh, BuildInfoRequiredField::CRT_LINKAGE); + build_info.library_linkage = details::remove_required_field(&pgh, BuildInfoRequiredField::LIBRARY_LINKAGE); + + // The remaining entries are policies + for (const std::unordered_map::value_type& p : pgh) + { + const BuildPolicies::type policy = BuildPolicies::parse(p.first); + Checks::check_exit(policy != BuildPolicies::UNKNOWN, "Unknown policy found: %s", p.first); + const opt_bool_t status = opt_bool::parse(p.second); + build_info.policies.emplace(policy, status); + } return build_info; } diff --git a/toolsrc/src/BuildPolicies.cpp b/toolsrc/src/BuildPolicies.cpp new file mode 100644 index 0000000000..0f7c3c4924 --- /dev/null +++ b/toolsrc/src/BuildPolicies.cpp @@ -0,0 +1,49 @@ +#include "pch.h" +#include "BuildPolicies.h" +#include "vcpkg_Checks.h" + +namespace vcpkg::PostBuildLint::BuildPolicies +{ + static const std::string NAME_UNKNOWN = "PolicyUnknown"; + static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs"; + + const std::string& type::toString() const + { + switch (this->backing_enum) + { + case DLLS_WITHOUT_LIBS: + return NAME_DLLS_WITHOUT_LIBS; + case UNKNOWN: + return NAME_UNKNOWN; + default: + Checks::unreachable(); + } + } + + const std::string& type::cmake_variable() const + { + static const std::string CMAKE_VARIABLE_DLLS_WITHOUT_LIBS = "VCPKG_POLICY_DLLS_WITHOUT_LIBS"; + + switch (this->backing_enum) + { + case DLLS_WITHOUT_LIBS: + return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS; + case UNKNOWN: + Checks::exit_with_message("No CMake command corresponds to UNKNOWN"); + default: + Checks::unreachable(); + } + } + + type::type(): backing_enum(backing_enum_t::UNKNOWN) {} + + type parse(const std::string& s) + { + if (s == NAME_DLLS_WITHOUT_LIBS) + { + return BuildPolicies::DLLS_WITHOUT_LIBS; + } + + return BuildPolicies::UNKNOWN; + } +} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index e0374774cb..802198ccb6 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -138,6 +138,7 @@ + @@ -176,6 +177,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 40bde15361..4461655d1d 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -156,6 +156,9 @@ Source Files + + Source Files + @@ -266,5 +269,8 @@ Header Files + + Header Files + \ No newline at end of file From cd0b7d644b2ba61618b70ae58f50d2e880dbe509 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 18:31:19 -0800 Subject: [PATCH 256/561] Add PolicyDLLsWithoutLIBs policy --- scripts/ports.cmake | 6 +++++- toolsrc/src/post_build_lint.cpp | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/scripts/ports.cmake b/scripts/ports.cmake index 4e28cbb670..cc01a0619e 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -74,7 +74,11 @@ if(CMD MATCHES "^BUILD$") set(BUILD_INFO_FILE_PATH ${CURRENT_PACKAGES_DIR}/BUILD_INFO) file(WRITE ${BUILD_INFO_FILE_PATH} "CRTLinkage: ${VCPKG_CRT_LINKAGE}\n") - file(APPEND ${BUILD_INFO_FILE_PATH} "LibraryLinkage: ${VCPKG_LIBRARY_LINKAGE}") + file(APPEND ${BUILD_INFO_FILE_PATH} "LibraryLinkage: ${VCPKG_LIBRARY_LINKAGE}\n") + + if (DEFINED VCPKG_POLICY_DLLS_WITHOUT_LIBS) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyDLLsWithoutLIBs: ${VCPKG_POLICY_DLLS_WITHOUT_LIBS}\n") + endif() elseif(CMD MATCHES "^CREATE$") file(TO_NATIVE_PATH ${VCPKG_ROOT_DIR} NATIVE_VCPKG_ROOT_DIR) file(TO_NATIVE_PATH ${DOWNLOADS} NATIVE_DOWNLOADS) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index daf6f49ee7..009f8019c2 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -368,11 +368,20 @@ namespace vcpkg::PostBuildLint return lint_status::ERROR_DETECTED; } - static lint_status check_lib_files_are_available_if_dlls_are_available(const size_t lib_count, const size_t dll_count, const fs::path& lib_dir) + static lint_status check_lib_files_are_available_if_dlls_are_available(const std::map& policies, const size_t lib_count, const size_t dll_count, const fs::path& lib_dir) { + auto it = policies.find(BuildPolicies::DLLS_WITHOUT_LIBS); + if (it != policies.cend() && it->second == opt_bool_t::DISABLED) + { + return lint_status::SUCCESS; + } + if (lib_count == 0 && dll_count != 0) { System::println(System::color::warning, "Import libs were not present in %s", lib_dir.generic_string()); + System::println(System::color::warning, + "If this is intended, add the following line in the portfile:\n" + " SET(%s disabled)", BuildPolicies::DLLS_WITHOUT_LIBS.cmake_variable()); return lint_status::ERROR_DETECTED; } @@ -616,8 +625,8 @@ namespace vcpkg::PostBuildLint error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); - error_count += check_lib_files_are_available_if_dlls_are_available(debug_libs.size(), debug_dlls.size(), debug_lib_dir); - error_count += check_lib_files_are_available_if_dlls_are_available(release_libs.size(), release_dlls.size(), release_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); std::vector dlls; dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); From c595fac0ffb8de45f390ab591fbc76fa12ca0442 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 18:55:14 -0800 Subject: [PATCH 257/561] Add BuildPolicies::values() --- toolsrc/include/BuildPolicies.h | 4 +++- toolsrc/src/BuildPolicies.cpp | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/toolsrc/include/BuildPolicies.h b/toolsrc/include/BuildPolicies.h index fbe9b0ff33..8298ffe2d4 100644 --- a/toolsrc/include/BuildPolicies.h +++ b/toolsrc/include/BuildPolicies.h @@ -11,7 +11,6 @@ namespace vcpkg::PostBuildLint::BuildPolicies struct type { - static constexpr int length() { return 2; } constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { } constexpr operator backing_enum_t() const { return backing_enum; } @@ -23,6 +22,9 @@ namespace vcpkg::PostBuildLint::BuildPolicies backing_enum_t backing_enum; }; + static constexpr int value_count = 2; + const std::vector& values(); + static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); diff --git a/toolsrc/src/BuildPolicies.cpp b/toolsrc/src/BuildPolicies.cpp index 0f7c3c4924..ed0f76c382 100644 --- a/toolsrc/src/BuildPolicies.cpp +++ b/toolsrc/src/BuildPolicies.cpp @@ -26,17 +26,23 @@ namespace vcpkg::PostBuildLint::BuildPolicies switch (this->backing_enum) { - case DLLS_WITHOUT_LIBS: - return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS; - case UNKNOWN: - Checks::exit_with_message("No CMake command corresponds to UNKNOWN"); - default: - Checks::unreachable(); + case DLLS_WITHOUT_LIBS: + return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS; + case UNKNOWN: + Checks::exit_with_message("No CMake command corresponds to UNKNOWN"); + default: + Checks::unreachable(); } } type::type(): backing_enum(backing_enum_t::UNKNOWN) {} + const std::vector& values() + { + static const std::vector& v = {UNKNOWN, DLLS_WITHOUT_LIBS}; + return v; + } + type parse(const std::string& s) { if (s == NAME_DLLS_WITHOUT_LIBS) From a3eaed8f1faacc03dc5abb56d2117096d3413735 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 1 Feb 2017 16:19:27 -0800 Subject: [PATCH 258/561] [vcpkg] Add /MP to base compilation flags, enabling parallel builds. --- scripts/cmake/vcpkg_configure_cmake.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 5db9b5d05a..c524d12edc 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -53,8 +53,8 @@ function(vcpkg_configure_cmake) list(APPEND _csc_OPTIONS - "-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc" - "-DCMAKE_C_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8" + "-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP" + "-DCMAKE_C_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /MP" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" From 9086fcebdf43ad01892c8f96afc5e676f9b72135 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:24:06 -0800 Subject: [PATCH 259/561] Rename files in PostBuildLint namespace --- .../{post_build_lint.h => PostBuildLint.h} | 0 ...{BuildInfo.h => PostBuildLint_BuildInfo.h} | 2 +- ...licies.h => PostBuildLint_BuildPolicies.h} | 0 ...{post_build_lint.cpp => PostBuildLint.cpp} | 2 +- ...ldInfo.cpp => PostBuildLint_BuildInfo.cpp} | 2 +- ...es.cpp => PostBuildLint_BuildPolicies.cpp} | 2 +- toolsrc/src/commands_build.cpp | 2 +- toolsrc/vcpkglib/vcpkglib.vcxproj | 12 ++++---- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 28 +++++++++---------- 9 files changed, 25 insertions(+), 25 deletions(-) rename toolsrc/include/{post_build_lint.h => PostBuildLint.h} (100%) rename toolsrc/include/{BuildInfo.h => PostBuildLint_BuildInfo.h} (99%) rename toolsrc/include/{BuildPolicies.h => PostBuildLint_BuildPolicies.h} (100%) rename toolsrc/src/{post_build_lint.cpp => PostBuildLint.cpp} (99%) rename toolsrc/src/{BuildInfo.cpp => PostBuildLint_BuildInfo.cpp} (99%) rename toolsrc/src/{BuildPolicies.cpp => PostBuildLint_BuildPolicies.cpp} (97%) diff --git a/toolsrc/include/post_build_lint.h b/toolsrc/include/PostBuildLint.h similarity index 100% rename from toolsrc/include/post_build_lint.h rename to toolsrc/include/PostBuildLint.h diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h similarity index 99% rename from toolsrc/include/BuildInfo.h rename to toolsrc/include/PostBuildLint_BuildInfo.h index 1fd032aa22..cf444ce904 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -3,7 +3,7 @@ #include #include "Paragraphs.h" #include -#include "BuildPolicies.h" +#include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" namespace vcpkg::PostBuildLint diff --git a/toolsrc/include/BuildPolicies.h b/toolsrc/include/PostBuildLint_BuildPolicies.h similarity index 100% rename from toolsrc/include/BuildPolicies.h rename to toolsrc/include/PostBuildLint_BuildPolicies.h diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/PostBuildLint.cpp similarity index 99% rename from toolsrc/src/post_build_lint.cpp rename to toolsrc/src/PostBuildLint.cpp index 009f8019c2..e7e9763832 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -5,7 +5,7 @@ #include "vcpkg_System.h" #include "vcpkg_Environment.h" #include "coff_file_reader.h" -#include "BuildInfo.h" +#include "PostBuildLint_BuildInfo.h" namespace vcpkg::PostBuildLint { diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/PostBuildLint_BuildInfo.cpp similarity index 99% rename from toolsrc/src/BuildInfo.cpp rename to toolsrc/src/PostBuildLint_BuildInfo.cpp index 82243ebac4..59896e168e 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/PostBuildLint_BuildInfo.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "BuildInfo.h" +#include "PostBuildLint_BuildInfo.h" #include "vcpkg_Checks.h" #include "opt_bool.h" #include "vcpkglib_helpers.h" diff --git a/toolsrc/src/BuildPolicies.cpp b/toolsrc/src/PostBuildLint_BuildPolicies.cpp similarity index 97% rename from toolsrc/src/BuildPolicies.cpp rename to toolsrc/src/PostBuildLint_BuildPolicies.cpp index ed0f76c382..d7d67c991c 100644 --- a/toolsrc/src/BuildPolicies.cpp +++ b/toolsrc/src/PostBuildLint_BuildPolicies.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "BuildPolicies.h" +#include "PostBuildLint_BuildPolicies.h" #include "vcpkg_Checks.h" namespace vcpkg::PostBuildLint::BuildPolicies diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index ccc3c8d9f1..c5a2784506 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -3,7 +3,7 @@ #include "StatusParagraphs.h" #include "vcpkglib.h" #include "vcpkg_Input.h" -#include "post_build_lint.h" +#include "PostBuildLint.h" #include "vcpkg_Dependencies.h" #include "vcpkg_System.h" #include "vcpkg_Environment.h" diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 802198ccb6..c1730367d0 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -137,8 +137,8 @@ - - + + @@ -150,7 +150,7 @@ - + @@ -176,8 +176,8 @@ - - + + @@ -207,7 +207,7 @@ Create Create - + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 4461655d1d..65d2dd202f 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -48,9 +48,6 @@ Source Files - - Source Files - Source Files @@ -123,9 +120,6 @@ Source Files - - Source Files - Source Files @@ -156,7 +150,13 @@ Source Files - + + Source Files + + + Source Files + + Source Files @@ -194,9 +194,6 @@ Header Files - - Header Files - Header Files @@ -212,9 +209,6 @@ Header Files - - Header Files - Header Files @@ -269,7 +263,13 @@ Header Files - + + Header Files + + + Header Files + + Header Files From 7a04aff33e596b843fba2162ab9b05180fc5169c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:38:02 -0800 Subject: [PATCH 260/561] Split LinkageType into separate h/cpp --- toolsrc/include/PostBuildLint_BuildInfo.h | 12 +------- toolsrc/include/PostBuildLint_LinkageType.h | 16 ++++++++++ toolsrc/src/PostBuildLint_BuildInfo.cpp | 29 ------------------ toolsrc/src/PostBuildLint_LinkageType.cpp | 34 +++++++++++++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 ++ toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 ++++ 6 files changed, 59 insertions(+), 40 deletions(-) create mode 100644 toolsrc/include/PostBuildLint_LinkageType.h create mode 100644 toolsrc/src/PostBuildLint_LinkageType.cpp diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index cf444ce904..5305548e1e 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -5,20 +5,10 @@ #include #include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" +#include "PostBuildLint_LinkageType.h" namespace vcpkg::PostBuildLint { - enum class LinkageType - { - DYNAMIC, - STATIC, - UNKNOWN - }; - - LinkageType linkage_type_value_of(const std::string& as_string); - - std::string to_string(const LinkageType& build_info); - enum class ConfigurationType { DEBUG = 1, diff --git a/toolsrc/include/PostBuildLint_LinkageType.h b/toolsrc/include/PostBuildLint_LinkageType.h new file mode 100644 index 0000000000..7cca97639c --- /dev/null +++ b/toolsrc/include/PostBuildLint_LinkageType.h @@ -0,0 +1,16 @@ +#pragma once +#include + +namespace vcpkg::PostBuildLint +{ + enum class LinkageType + { + DYNAMIC, + STATIC, + UNKNOWN + }; + + LinkageType linkage_type_value_of(const std::string& as_string); + + std::string to_string(const LinkageType& build_info); +} diff --git a/toolsrc/src/PostBuildLint_BuildInfo.cpp b/toolsrc/src/PostBuildLint_BuildInfo.cpp index 59896e168e..e15e2ca738 100644 --- a/toolsrc/src/PostBuildLint_BuildInfo.cpp +++ b/toolsrc/src/PostBuildLint_BuildInfo.cpp @@ -68,35 +68,6 @@ namespace vcpkg::PostBuildLint const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); - LinkageType linkage_type_value_of(const std::string& as_string) - - { - if (as_string == "dynamic") - { - return LinkageType::DYNAMIC; - } - - if (as_string == "static") - { - return LinkageType::STATIC; - } - - return LinkageType::UNKNOWN; - } - - std::string to_string(const LinkageType& build_info) - { - switch (build_info) - { - case LinkageType::STATIC: - return "static"; - case LinkageType::DYNAMIC: - return "dynamic"; - default: - Checks::unreachable(); - } - } - std::string to_string(const ConfigurationType& conf) { switch (conf) diff --git a/toolsrc/src/PostBuildLint_LinkageType.cpp b/toolsrc/src/PostBuildLint_LinkageType.cpp new file mode 100644 index 0000000000..8a3f35be8a --- /dev/null +++ b/toolsrc/src/PostBuildLint_LinkageType.cpp @@ -0,0 +1,34 @@ +#include "pch.h" +#include "PostBuildLint_LinkageType.h" +#include "vcpkg_Checks.h" + +namespace vcpkg::PostBuildLint +{ + LinkageType linkage_type_value_of(const std::string& as_string) + { + if (as_string == "dynamic") + { + return LinkageType::DYNAMIC; + } + + if (as_string == "static") + { + return LinkageType::STATIC; + } + + return LinkageType::UNKNOWN; + } + + std::string to_string(const LinkageType& build_info) + { + switch (build_info) + { + case LinkageType::STATIC: + return "static"; + case LinkageType::DYNAMIC: + return "dynamic"; + default: + Checks::unreachable(); + } + } +} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index c1730367d0..07a3dcf837 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -151,6 +151,7 @@ + @@ -208,6 +209,7 @@ Create + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 65d2dd202f..7e000258d9 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -159,6 +159,9 @@ Source Files + + Source Files + @@ -272,5 +275,8 @@ Header Files + + Header Files + \ No newline at end of file From 4aef2485b9d5cf2dfbb30543963e5714dcc411c4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:43:29 -0800 Subject: [PATCH 261/561] Split ConfigurationType into separate h/cpp --- toolsrc/include/PostBuildLint_BuildInfo.h | 9 +-------- .../include/PostBuildLint_ConfigurationType.h | 14 ++++++++++++++ toolsrc/src/PostBuildLint_BuildInfo.cpp | 13 ------------- .../src/PostBuildLint_ConfigurationType.cpp | 19 +++++++++++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 ++ toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 ++++++ 6 files changed, 42 insertions(+), 21 deletions(-) create mode 100644 toolsrc/include/PostBuildLint_ConfigurationType.h create mode 100644 toolsrc/src/PostBuildLint_ConfigurationType.cpp diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index 5305548e1e..2685b6f7bd 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -6,17 +6,10 @@ #include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" #include "PostBuildLint_LinkageType.h" +#include "PostBuildLint_ConfigurationType.h" namespace vcpkg::PostBuildLint { - enum class ConfigurationType - { - DEBUG = 1, - RELEASE = 2 - }; - - std::string to_string(const ConfigurationType& conf); - struct BuildType { static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); diff --git a/toolsrc/include/PostBuildLint_ConfigurationType.h b/toolsrc/include/PostBuildLint_ConfigurationType.h new file mode 100644 index 0000000000..55dede921f --- /dev/null +++ b/toolsrc/include/PostBuildLint_ConfigurationType.h @@ -0,0 +1,14 @@ +#pragma once +#pragma once +#include + +namespace vcpkg::PostBuildLint +{ + enum class ConfigurationType + { + DEBUG = 1, + RELEASE = 2 + }; + + std::string to_string(const ConfigurationType& conf); +} diff --git a/toolsrc/src/PostBuildLint_BuildInfo.cpp b/toolsrc/src/PostBuildLint_BuildInfo.cpp index e15e2ca738..c67c8754f9 100644 --- a/toolsrc/src/PostBuildLint_BuildInfo.cpp +++ b/toolsrc/src/PostBuildLint_BuildInfo.cpp @@ -68,19 +68,6 @@ namespace vcpkg::PostBuildLint const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); - std::string to_string(const ConfigurationType& conf) - { - switch (conf) - { - case ConfigurationType::DEBUG: - return "Debug"; - case ConfigurationType::RELEASE: - return "Release"; - default: - Checks::unreachable(); - } - } - BuildType BuildType::value_of(const ConfigurationType& config, const LinkageType& linkage) { if (config == ConfigurationType::DEBUG && linkage == LinkageType::STATIC) diff --git a/toolsrc/src/PostBuildLint_ConfigurationType.cpp b/toolsrc/src/PostBuildLint_ConfigurationType.cpp new file mode 100644 index 0000000000..9c3499cac3 --- /dev/null +++ b/toolsrc/src/PostBuildLint_ConfigurationType.cpp @@ -0,0 +1,19 @@ +#include "pch.h" +#include "PostBuildLint_ConfigurationType.h" +#include "vcpkg_Checks.h" + +namespace vcpkg::PostBuildLint +{ + std::string to_string(const ConfigurationType& conf) + { + switch (conf) + { + case ConfigurationType::DEBUG: + return "Debug"; + case ConfigurationType::RELEASE: + return "Release"; + default: + Checks::unreachable(); + } + } +} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 07a3dcf837..14b476b647 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -151,6 +151,7 @@ + @@ -209,6 +210,7 @@ Create + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 7e000258d9..72d73344fd 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -162,6 +162,9 @@ Source Files + + Source Files + @@ -278,5 +281,8 @@ Header Files + + Header Files + \ No newline at end of file From 0a0a17b7f9eb2aca7f999de1c4b8c63428e1eadf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:49:28 -0800 Subject: [PATCH 262/561] Split BuildType into separate h/cpp --- toolsrc/include/PostBuildLint_BuildInfo.h | 39 ------------- toolsrc/include/PostBuildLint_BuildType.h | 45 +++++++++++++++ toolsrc/src/PostBuildLint_BuildInfo.cpp | 62 --------------------- toolsrc/src/PostBuiltLint_BuildType.cpp | 68 +++++++++++++++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 + toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 ++ 6 files changed, 121 insertions(+), 101 deletions(-) create mode 100644 toolsrc/include/PostBuildLint_BuildType.h create mode 100644 toolsrc/src/PostBuiltLint_BuildType.cpp diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index 2685b6f7bd..b41478ef01 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -5,48 +5,9 @@ #include #include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" -#include "PostBuildLint_LinkageType.h" -#include "PostBuildLint_ConfigurationType.h" namespace vcpkg::PostBuildLint { - struct BuildType - { - static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); - - static const BuildType DEBUG_STATIC; - static const BuildType DEBUG_DYNAMIC; - static const BuildType RELEASE_STATIC; - static const BuildType RELEASE_DYNAMIC; - - static const std::vector& values() - { - static const std::vector v = {DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC}; - return v; - } - - BuildType() = delete; - - const ConfigurationType& config() const; - const LinkageType& linkage() const; - std::regex crt_regex() const; - std::string toString() const; - - private: - BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) - : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string) - { - } - - ConfigurationType m_config; - LinkageType m_linkage; - std::string m_crt_regex_as_string; - }; - - bool operator ==(const BuildType& lhs, const BuildType& rhs); - - bool operator !=(const BuildType& lhs, const BuildType& rhs); - struct OutdatedDynamicCrt { // Old CPP diff --git a/toolsrc/include/PostBuildLint_BuildType.h b/toolsrc/include/PostBuildLint_BuildType.h new file mode 100644 index 0000000000..a5cb24f492 --- /dev/null +++ b/toolsrc/include/PostBuildLint_BuildType.h @@ -0,0 +1,45 @@ +#pragma once +#include "PostBuildLint_ConfigurationType.h" +#include "PostBuildLint_LinkageType.h" +#include +#include + +namespace vcpkg::PostBuildLint +{ + struct BuildType + { + static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); + + static const BuildType DEBUG_STATIC; + static const BuildType DEBUG_DYNAMIC; + static const BuildType RELEASE_STATIC; + static const BuildType RELEASE_DYNAMIC; + + static const std::vector& values() + { + static const std::vector v = { DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC }; + return v; + } + + BuildType() = delete; + + const ConfigurationType& config() const; + const LinkageType& linkage() const; + std::regex crt_regex() const; + std::string toString() const; + + private: + BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) + : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string) + { + } + + ConfigurationType m_config; + LinkageType m_linkage; + std::string m_crt_regex_as_string; + }; + + bool operator ==(const BuildType& lhs, const BuildType& rhs); + + bool operator !=(const BuildType& lhs, const BuildType& rhs); +} diff --git a/toolsrc/src/PostBuildLint_BuildInfo.cpp b/toolsrc/src/PostBuildLint_BuildInfo.cpp index c67c8754f9..1d6d45e108 100644 --- a/toolsrc/src/PostBuildLint_BuildInfo.cpp +++ b/toolsrc/src/PostBuildLint_BuildInfo.cpp @@ -6,38 +6,6 @@ namespace vcpkg::PostBuildLint { - const ConfigurationType& BuildType::config() const - { - return this->m_config; - } - - const LinkageType& BuildType::linkage() const - { - return this->m_linkage; - } - - std::regex BuildType::crt_regex() const - { - const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); - return r; - } - - std::string BuildType::toString() const - { - const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); - return s; - } - - bool operator==(const BuildType& lhs, const BuildType& rhs) - { - return lhs.config() == rhs.config() && lhs.linkage() == rhs.linkage(); - } - - bool operator!=(const BuildType& lhs, const BuildType& rhs) - { - return !(lhs == rhs); - } - // namespace BuildInfoRequiredField { @@ -63,36 +31,6 @@ namespace vcpkg::PostBuildLint return build_info; } - const BuildType BuildType::DEBUG_STATIC = BuildType(ConfigurationType::DEBUG, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMTD)"); - const BuildType BuildType::DEBUG_DYNAMIC = BuildType(ConfigurationType::DEBUG, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRTD)"); - const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); - const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); - - BuildType BuildType::value_of(const ConfigurationType& config, const LinkageType& linkage) - { - if (config == ConfigurationType::DEBUG && linkage == LinkageType::STATIC) - { - return DEBUG_STATIC; - } - - if (config == ConfigurationType::DEBUG && linkage == LinkageType::DYNAMIC) - { - return DEBUG_DYNAMIC; - } - - if (config == ConfigurationType::RELEASE && linkage == LinkageType::STATIC) - { - return RELEASE_STATIC; - } - - if (config == ConfigurationType::RELEASE && linkage == LinkageType::DYNAMIC) - { - return RELEASE_DYNAMIC; - } - - Checks::unreachable(); - } - BuildInfo read_build_info(const fs::path& filepath) { const std::vector> pghs = Paragraphs::get_paragraphs(filepath); diff --git a/toolsrc/src/PostBuiltLint_BuildType.cpp b/toolsrc/src/PostBuiltLint_BuildType.cpp new file mode 100644 index 0000000000..b4e199aee4 --- /dev/null +++ b/toolsrc/src/PostBuiltLint_BuildType.cpp @@ -0,0 +1,68 @@ +#include "pch.h" +#include "PostBuildLint_BuildType.h" +#include "vcpkg_Checks.h" + +namespace vcpkg::PostBuildLint +{ + const BuildType BuildType::DEBUG_STATIC = BuildType(ConfigurationType::DEBUG, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMTD)"); + const BuildType BuildType::DEBUG_DYNAMIC = BuildType(ConfigurationType::DEBUG, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRTD)"); + const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); + const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); + + BuildType BuildType::value_of(const ConfigurationType& config, const LinkageType& linkage) + { + if (config == ConfigurationType::DEBUG && linkage == LinkageType::STATIC) + { + return DEBUG_STATIC; + } + + if (config == ConfigurationType::DEBUG && linkage == LinkageType::DYNAMIC) + { + return DEBUG_DYNAMIC; + } + + if (config == ConfigurationType::RELEASE && linkage == LinkageType::STATIC) + { + return RELEASE_STATIC; + } + + if (config == ConfigurationType::RELEASE && linkage == LinkageType::DYNAMIC) + { + return RELEASE_DYNAMIC; + } + + Checks::unreachable(); + } + + const ConfigurationType& BuildType::config() const + { + return this->m_config; + } + + const LinkageType& BuildType::linkage() const + { + return this->m_linkage; + } + + std::regex BuildType::crt_regex() const + { + const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); + return r; + } + + std::string BuildType::toString() const + { + const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); + return s; + } + + bool operator==(const BuildType& lhs, const BuildType& rhs) + { + return lhs.config() == rhs.config() && lhs.linkage() == rhs.linkage(); + } + + bool operator!=(const BuildType& lhs, const BuildType& rhs) + { + return !(lhs == rhs); + } +} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 14b476b647..59bf5c2145 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -151,6 +151,7 @@ + @@ -212,6 +213,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 72d73344fd..e9758e4855 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -165,6 +165,9 @@ Source Files + + Source Files + @@ -284,5 +287,8 @@ Header Files + + Header Files + \ No newline at end of file From 1d34facb84812bd478f2320857a5a7a3ed327bbf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:54:08 -0800 Subject: [PATCH 263/561] Split OutdatedDynamicCrt into separate h/cpp --- toolsrc/include/PostBuildLint_BuildInfo.h | 56 ------------------ .../PostBuildLint_OutdatedDynamicCrt.h | 59 +++++++++++++++++++ toolsrc/src/PostBuildLint.cpp | 2 + toolsrc/src/PostBuildLint_BuildInfo.cpp | 29 --------- .../src/PostBuildLint_OutdatedDynamicCrt.cpp | 35 +++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 + toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 ++ 7 files changed, 104 insertions(+), 85 deletions(-) create mode 100644 toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h create mode 100644 toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index b41478ef01..ff996b2b61 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -2,67 +2,11 @@ #include #include "Paragraphs.h" -#include #include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" namespace vcpkg::PostBuildLint { - struct OutdatedDynamicCrt - { - // Old CPP - static const OutdatedDynamicCrt MSVCP100_DLL; - static const OutdatedDynamicCrt MSVCP100D_DLL; - static const OutdatedDynamicCrt MSVCP110_DLL; - static const OutdatedDynamicCrt MSVCP110_WIN_DLL; - static const OutdatedDynamicCrt MSVCP120_DLL; - static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCP60_DLL; - static const OutdatedDynamicCrt MSVCP_WIN_DLL; - - // Old C - static const OutdatedDynamicCrt MSVCR100_DLL; - static const OutdatedDynamicCrt MSVCR100D_DLL; - static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCR110_DLL; - static const OutdatedDynamicCrt MSVCR120_DLL; - static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCRT_DLL; - static const OutdatedDynamicCrt MSVCRT20_DLL; - static const OutdatedDynamicCrt MSVCRT40_DLL; - - static const std::vector& values() - { - static const std::vector v = { - MSVCP100_DLL, MSVCP100D_DLL, - MSVCP110_DLL,MSVCP110_WIN_DLL, - MSVCP120_DLL, MSVCP120_CLR0400_DLL, - MSVCP60_DLL, - MSVCP_WIN_DLL, - - MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, - MSVCR110_DLL, - MSVCR120_DLL, MSVCR120_CLR0400_DLL, - MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL - }; - return v; - } - - OutdatedDynamicCrt() = delete; - - std::regex crt_regex() const; - const std::string& toString() const; - - private: - explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) - : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) - { - } - - std::string m_dll_name; - std::string m_crt_regex_as_string; - }; - struct BuildInfo { static BuildInfo create(std::unordered_map pgh); diff --git a/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h b/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h new file mode 100644 index 0000000000..484f74cf00 --- /dev/null +++ b/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h @@ -0,0 +1,59 @@ +#pragma once +#include +#include + +namespace vcpkg::PostBuildLint +{ + struct OutdatedDynamicCrt + { + // Old CPP + static const OutdatedDynamicCrt MSVCP100_DLL; + static const OutdatedDynamicCrt MSVCP100D_DLL; + static const OutdatedDynamicCrt MSVCP110_DLL; + static const OutdatedDynamicCrt MSVCP110_WIN_DLL; + static const OutdatedDynamicCrt MSVCP120_DLL; + static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCP60_DLL; + static const OutdatedDynamicCrt MSVCP_WIN_DLL; + + // Old C + static const OutdatedDynamicCrt MSVCR100_DLL; + static const OutdatedDynamicCrt MSVCR100D_DLL; + static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCR110_DLL; + static const OutdatedDynamicCrt MSVCR120_DLL; + static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCRT_DLL; + static const OutdatedDynamicCrt MSVCRT20_DLL; + static const OutdatedDynamicCrt MSVCRT40_DLL; + + static const std::vector& values() + { + static const std::vector v = { + MSVCP100_DLL, MSVCP100D_DLL, + MSVCP110_DLL,MSVCP110_WIN_DLL, + MSVCP120_DLL, MSVCP120_CLR0400_DLL, + MSVCP60_DLL, + MSVCP_WIN_DLL, + + MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, + MSVCR110_DLL, + MSVCR120_DLL, MSVCR120_CLR0400_DLL, + MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL + }; + return v; + } + + OutdatedDynamicCrt() = delete; + + std::regex crt_regex() const; + const std::string& toString() const; + + private: + explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) + : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) { } + + std::string m_dll_name; + std::string m_crt_regex_as_string; + }; +} diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index e7e9763832..5954089e9d 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -6,6 +6,8 @@ #include "vcpkg_Environment.h" #include "coff_file_reader.h" #include "PostBuildLint_BuildInfo.h" +#include "PostBuildLint_BuildType.h" +#include "PostBuildLint_OutdatedDynamicCrt.h" namespace vcpkg::PostBuildLint { diff --git a/toolsrc/src/PostBuildLint_BuildInfo.cpp b/toolsrc/src/PostBuildLint_BuildInfo.cpp index 1d6d45e108..63107acd1c 100644 --- a/toolsrc/src/PostBuildLint_BuildInfo.cpp +++ b/toolsrc/src/PostBuildLint_BuildInfo.cpp @@ -39,33 +39,4 @@ namespace vcpkg::PostBuildLint return BuildInfo::create(pghs[0]); } - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100_DLL = OutdatedDynamicCrt("msvcp100.dll", R"(msvcp100\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100D_DLL = OutdatedDynamicCrt("msvcp100d.dll", R"(msvcp100d\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_DLL = OutdatedDynamicCrt("msvcp110.dll", R"(msvcp110\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_WIN_DLL = OutdatedDynamicCrt("msvcp110_win.dll", R"(msvcp110_win\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_DLL = OutdatedDynamicCrt("msvcp120.dll", R"(msvcp120\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_CLR0400_DLL = OutdatedDynamicCrt("msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP60_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP_WIN_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)");; - - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_DLL = OutdatedDynamicCrt("msvcr100.dll", R"(msvcr100\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100D_DLL = OutdatedDynamicCrt("msvcr100d.dll", R"(msvcr100d\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_CLR0400_DLL = OutdatedDynamicCrt("msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR110_DLL = OutdatedDynamicCrt("msvcr110.dll", R"(msvcr110\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_DLL = OutdatedDynamicCrt("msvcr120.dll", R"(msvcr120\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_CLR0400_DLL = OutdatedDynamicCrt("msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT_DLL = OutdatedDynamicCrt("msvcrt.dll", R"(msvcrt\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT20_DLL = OutdatedDynamicCrt("msvcrt20.dll", R"(msvcrt20\.dll)");; - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT40_DLL = OutdatedDynamicCrt("msvcrt40.dll", R"(msvcrt40\.dll)");; - - std::regex OutdatedDynamicCrt::crt_regex() const - { - const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); - return r; - } - - const std::string& OutdatedDynamicCrt::toString() const - { - return this->m_dll_name; - } } diff --git a/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp b/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp new file mode 100644 index 0000000000..67965cd936 --- /dev/null +++ b/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp @@ -0,0 +1,35 @@ +#include "pch.h" +#include "PostBuildLint_OutdatedDynamicCrt.h" + +namespace vcpkg::PostBuildLint +{ + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100_DLL = OutdatedDynamicCrt("msvcp100.dll", R"(msvcp100\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100D_DLL = OutdatedDynamicCrt("msvcp100d.dll", R"(msvcp100d\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_DLL = OutdatedDynamicCrt("msvcp110.dll", R"(msvcp110\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_WIN_DLL = OutdatedDynamicCrt("msvcp110_win.dll", R"(msvcp110_win\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_DLL = OutdatedDynamicCrt("msvcp120.dll", R"(msvcp120\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_CLR0400_DLL = OutdatedDynamicCrt("msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP60_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP_WIN_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)");; + + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_DLL = OutdatedDynamicCrt("msvcr100.dll", R"(msvcr100\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100D_DLL = OutdatedDynamicCrt("msvcr100d.dll", R"(msvcr100d\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_CLR0400_DLL = OutdatedDynamicCrt("msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR110_DLL = OutdatedDynamicCrt("msvcr110.dll", R"(msvcr110\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_DLL = OutdatedDynamicCrt("msvcr120.dll", R"(msvcr120\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_CLR0400_DLL = OutdatedDynamicCrt("msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT_DLL = OutdatedDynamicCrt("msvcrt.dll", R"(msvcrt\.dll)"); + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT20_DLL = OutdatedDynamicCrt("msvcrt20.dll", R"(msvcrt20\.dll)");; + const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT40_DLL = OutdatedDynamicCrt("msvcrt40.dll", R"(msvcrt40\.dll)");; + + std::regex OutdatedDynamicCrt::crt_regex() const + { + const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); + return r; + } + + const std::string& OutdatedDynamicCrt::toString() const + { + return this->m_dll_name; + } +} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 59bf5c2145..1217f67653 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -154,6 +154,7 @@ + @@ -213,6 +214,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index e9758e4855..f1bf4f9c9f 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -168,6 +168,9 @@ Source Files + + Source Files + @@ -290,5 +293,8 @@ Header Files + + Header Files + \ No newline at end of file From fdc885fb06cb6dcb201099b6520a73fb5034da34 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 18:20:49 -0800 Subject: [PATCH 264/561] Fix filename --- ...ostBuiltLint_BuildType.cpp => PostBuildLint_BuildType.cpp} | 0 toolsrc/vcpkglib/vcpkglib.vcxproj | 2 +- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename toolsrc/src/{PostBuiltLint_BuildType.cpp => PostBuildLint_BuildType.cpp} (100%) diff --git a/toolsrc/src/PostBuiltLint_BuildType.cpp b/toolsrc/src/PostBuildLint_BuildType.cpp similarity index 100% rename from toolsrc/src/PostBuiltLint_BuildType.cpp rename to toolsrc/src/PostBuildLint_BuildType.cpp diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 1217f67653..d002f8d5f7 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -215,7 +215,7 @@ - + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index f1bf4f9c9f..3359d9ada8 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -165,10 +165,10 @@ Source Files - + Source Files - + Source Files From a2f3a4bf4c67c751e0912ccea6aca2132894c9f8 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 1 Feb 2017 19:02:14 -0800 Subject: [PATCH 265/561] [libvorbis] Move patch application outside if() to ensure it applies to previously obtained sources --- ports/libvorbis/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libvorbis/CONTROL b/ports/libvorbis/CONTROL index 258edc4db0..db9b1f530e 100644 --- a/ports/libvorbis/CONTROL +++ b/ports/libvorbis/CONTROL @@ -1,4 +1,4 @@ Source: libvorbis -Version: 1.3.5-143caf4023a90c09a5eb685fdd46fb9b9c36b1ee +Version: 1.3.5-1-143caf4023a90c09a5eb685fdd46fb9b9c36b1ee Description: Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format. Build-Depends: libogg From 7a080e79163d8e3bdf9eb33b5d761d2d0ca89696 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 1 Feb 2017 19:05:55 -0800 Subject: [PATCH 266/561] [libvorbis] Fixup missed commit in a2f3a4b --- ports/libvorbis/portfile.cmake | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ports/libvorbis/portfile.cmake b/ports/libvorbis/portfile.cmake index 85fa1d26bd..757196caf6 100644 --- a/ports/libvorbis/portfile.cmake +++ b/ports/libvorbis/portfile.cmake @@ -33,15 +33,12 @@ if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") WORKING_DIRECTORY ${DOWNLOADS}/vorbis.git LOGNAME worktree ) - message(STATUS "Patching") - vcpkg_execute_required_process( - COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Add-vorbisenc.c-to-vorbis-library.patch - ${CMAKE_CURRENT_LIST_DIR}/0002-Allow-deprecated-functions.patch - --ignore-whitespace --whitespace=fix - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src - LOGNAME patch - ) endif() +vcpkg_apply_patches(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001-Add-vorbisenc.c-to-vorbis-library.patch + ${CMAKE_CURRENT_LIST_DIR}/0002-Allow-deprecated-functions.patch +) file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include" OGG_INCLUDE) file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/ogg.lib" OGG_LIB_REL) From b2b2c9136918ed3ef85961c5c2885b9562d07d1d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 2 Feb 2017 15:41:20 -0800 Subject: [PATCH 267/561] [vcpkg] Override Boost_COMPILER setting for all packages and toolchain to enable mixing VS2015 and VS2017 --- scripts/buildsystems/vcpkg.cmake | 2 ++ scripts/cmake/vcpkg_configure_cmake.cmake | 1 + 2 files changed, 3 insertions(+) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 7be93e54d4..e7b2b20db2 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -57,6 +57,8 @@ if(NOT VCPKG_TOOLCHAIN) ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link ) + set(Boost_COMPILER "-vc140") + set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) option(VCPKG_APPLOCAL_DEPS "Automatically copy dependencies into the output directory for executables." ON) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index c524d12edc..fbebe13a49 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -58,6 +58,7 @@ function(vcpkg_configure_cmake) "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" + "-DBoost_COMPILER=-vc140" ) if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) list(APPEND _csc_OPTIONS_DEBUG From ce9927f7327bc71ade246108a7d984deda6293fd Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 2 Feb 2017 16:00:30 -0800 Subject: [PATCH 268/561] Improve error handling if BITS transfer fails --- scripts/fetchDependency.ps1 | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index b56bf10876..8d31b0edbd 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -70,15 +70,21 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if ($Dependency -ne "git") # git fails with BITS { - Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction SilentlyContinue - } - else - { - if (!(Test-Path $downloadPath)) - { - Write-Host("Downloading $Dependency...") - (New-Object System.Net.WebClient).DownloadFile($url, $downloadPath) + try { + Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop } + catch [System.Exception] { + # If BITS fails for any reason, delete any potentially partially downloaded files and continue + if (Test-Path $downloadPath) + { + Remove-Item $downloadPath + } + } + } + if (!(Test-Path $downloadPath)) + { + Write-Host("Downloading $Dependency...") + (New-Object System.Net.WebClient).DownloadFile($url, $downloadPath) } } From 5aa5f191aef4d40c5a44594418b00e7c47f10339 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 2 Feb 2017 18:03:32 -0800 Subject: [PATCH 269/561] [cereal] directly copy folder instead of invoking another cmake to copy --- ports/cereal/portfile.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ports/cereal/portfile.cmake b/ports/cereal/portfile.cmake index ccdf13fd43..f6555416cb 100644 --- a/ports/cereal/portfile.cmake +++ b/ports/cereal/portfile.cmake @@ -13,6 +13,4 @@ file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cerea file(RENAME ${CURRENT_PACKAGES_DIR}/share/cereal/LICENSE ${CURRENT_PACKAGES_DIR}/share/cereal/copyright) # Copy the cereal header files -execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory - ${SOURCE_PATH}/include/cereal/ - ${CURRENT_PACKAGES_DIR}/include/cereal) +file(COPY ${SOURCE_PATH}/include/cereal DESTINATION ${CURRENT_PACKAGES_DIR}/include) \ No newline at end of file From 62e7557545c17462670b7741d74dd2db4f5612eb Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 2 Feb 2017 18:45:51 -0800 Subject: [PATCH 270/561] [fmt] Bump version to 3.0.1-2 to correspond with binary output change in 4f5f52ff47 --- ports/fmt/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/fmt/CONTROL b/ports/fmt/CONTROL index adcb2def4f..ce2bfc4e0b 100644 --- a/ports/fmt/CONTROL +++ b/ports/fmt/CONTROL @@ -1,3 +1,3 @@ Source: fmt -Version: 3.0.1-1 +Version: 3.0.1-2 Description: Formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams. From 761d56711ef4865c5e6f4076977e55b7b232665a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 2 Feb 2017 18:49:50 -0800 Subject: [PATCH 271/561] Add websocketpp --- ports/websocketpp/CONTROL | 3 +++ ports/websocketpp/portfile.cmake | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 ports/websocketpp/CONTROL create mode 100644 ports/websocketpp/portfile.cmake diff --git a/ports/websocketpp/CONTROL b/ports/websocketpp/CONTROL new file mode 100644 index 0000000000..c11e64d3e1 --- /dev/null +++ b/ports/websocketpp/CONTROL @@ -0,0 +1,3 @@ +Source: websocketpp +Version: 0.7.0 +Description: Library that implements RFC6455 The WebSocket Protocol \ No newline at end of file diff --git a/ports/websocketpp/portfile.cmake b/ports/websocketpp/portfile.cmake new file mode 100644 index 0000000000..98a4d52e6c --- /dev/null +++ b/ports/websocketpp/portfile.cmake @@ -0,0 +1,24 @@ +#header-only library +include(vcpkg_common_functions) +set(VERSION "0.7.0") +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/websocketpp-${VERSION}) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/zaphoyd/websocketpp/archive/${VERSION}.zip" + FILENAME "websocketpp-${VERSION}.zip" + SHA512 0cfbc5ed7034758b3666b5154854287441ebeef8e18c4e5f39b62559d4f0e9dda63d79021243c447f57b9855209e1813aeb1c6c475fc98aa71ff03933fc7ac0c +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) + +# Put the license file where vcpkg expects it +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/websocketpp/) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/websocketpp/COPYING ${CURRENT_PACKAGES_DIR}/share/websocketpp/copyright) + +# Copy the header files +file(COPY "${SOURCE_PATH}/websocketpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include" FILES_MATCHING PATTERN "*.hpp") + +set(INSTALL_INCLUDE_DIR "\${CMAKE_CURRENT_LIST_DIR}/../../include") +set(WEBSOCKETPP_VERSION ${VERSION}) +configure_file (${SOURCE_PATH}/websocketpp-config.cmake.in "${CURRENT_PACKAGES_DIR}/share/websocketpp/websocketpp-config.cmake" @ONLY) +configure_file (${SOURCE_PATH}/websocketpp-configVersion.cmake.in "${CURRENT_PACKAGES_DIR}/share/websocketpp/websocketpp-configVersion.cmake" @ONLY) \ No newline at end of file From 95af9aac7c39765d1524b7c9c39dc283e9f0facf Mon Sep 17 00:00:00 2001 From: codicodi Date: Fri, 3 Feb 2017 17:16:13 +0100 Subject: [PATCH 272/561] Add Ninja support --- ports/fmt/CONTROL | 2 +- ports/fmt/portfile.cmake | 1 + scripts/cmake/vcpkg_build_cmake.cmake | 12 +++++++++--- scripts/cmake/vcpkg_configure_cmake.cmake | 14 ++++++++++---- scripts/cmake/vcpkg_find_acquire_program.cmake | 16 ++++++++++++---- scripts/cmake/vcpkg_install_cmake.cmake | 12 +++++++++--- scripts/templates/portfile.in.cmake | 1 + 7 files changed, 43 insertions(+), 15 deletions(-) diff --git a/ports/fmt/CONTROL b/ports/fmt/CONTROL index ce2bfc4e0b..2c90cc300f 100644 --- a/ports/fmt/CONTROL +++ b/ports/fmt/CONTROL @@ -1,3 +1,3 @@ Source: fmt -Version: 3.0.1-2 +Version: 3.0.1-3 Description: Formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams. diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index 3ea33e7790..5fbbcc12ed 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -13,6 +13,7 @@ vcpkg_extract_source_archive(${ARCHIVE_FILE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA OPTIONS -DFMT_CMAKE_DIR=share/fmt -DFMT_TEST=OFF diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 6d7cfe6434..2e73a72d60 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -1,7 +1,7 @@ function(vcpkg_build_cmake) cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) - set(MSVC_EXTRA_ARGS) + set(MSVC_EXTRA_ARGS /p:VCPkgLocalAppDataDisabled=true) # Specifies the architecture of the toolset, NOT the architecture of the produced binary if (_bc_MSVC_64_TOOLSET) @@ -12,9 +12,15 @@ function(vcpkg_build_cmake) list(APPEND MSVC_EXTRA_ARGS "/m") endif() + if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/build.ninja) + set(BUILD_ARGS -v) # verbose output + else() + set(BUILD_ARGS ${MSVC_EXTRA_ARGS}) + endif() + message(STATUS "Build ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${BUILD_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel ) @@ -22,7 +28,7 @@ function(vcpkg_build_cmake) message(STATUS "Build ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Debug -- ${BUILD_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index fbebe13a49..42570226fc 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -1,6 +1,5 @@ -find_program(vcpkg_configure_cmake_NINJA ninja) function(vcpkg_configure_cmake) - cmake_parse_arguments(_csc "" "SOURCE_PATH;GENERATOR" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) + cmake_parse_arguments(_csc "PREFER_NINJA" "SOURCE_PATH;GENERATOR" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) if(NOT VCPKG_PLATFORM_TOOLSET) message(FATAL_ERROR "Vcpkg has been updated with VS2017 support, however you need to rebuild vcpkg.exe by re-running bootstrap.ps1\n powershell -exec bypass scripts\\bootstrap.ps1\n") @@ -8,14 +7,14 @@ function(vcpkg_configure_cmake) if(_csc_GENERATOR) set(GENERATOR ${_csc_GENERATOR}) + elseif(_csc_PREFER_NINJA AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(GENERATOR "Ninja") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 Win64") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 ARM") - # elseif(NOT vcpkg_configure_cmake_NINJA MATCHES "NOTFOUND") - # set(GENERATOR "Ninja") elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") @@ -36,6 +35,13 @@ function(vcpkg_configure_cmake) elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm") set(GENERATOR "Visual Studio 15 2017 ARM" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") endif() + + # If we use Ninja, make sure it's on PATH + if(GENERATOR STREQUAL "Ninja") + vcpkg_find_acquire_program(NINJA) + get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) + set(ENV{PATH} "${NINJA_PATH};$ENV{PATH}") + endif() file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index cd4a554f47..0442913829 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -4,6 +4,7 @@ function(vcpkg_find_acquire_program VAR) endif() unset(NOEXTRACT) + unset(SUBDIR) if(VAR MATCHES "PERL") set(PROGNAME perl) @@ -63,6 +64,13 @@ function(vcpkg_find_acquire_program VAR) 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.7.2") + set(PATHS ${DOWNLOADS}/tools/ninja/${SUBDIR}) + set(URL "https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip") + set(ARCHIVE "ninja-win.zip") + set(HASH cccab9281b274c564f9ad77a2115be1f19be67d7b2ee14a55d1db1b27f3b68db8e76076e4f804b61eb8e573e26a8ecc9985675a8dcf03fd7a77b7f57234f1393) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() @@ -73,15 +81,15 @@ function(vcpkg_find_acquire_program VAR) EXPECTED_HASH SHA512=${HASH} SHOW_PROGRESS ) - file(MAKE_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}) + file(MAKE_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) if(DEFINED NOEXTRACT) - file(COPY ${DOWNLOADS}/${ARCHIVE} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}) + file(COPY ${DOWNLOADS}/${ARCHIVE} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) else() get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} EXT) string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION) if(${ARCHIVE_EXTENSION} STREQUAL ".msi") file(TO_NATIVE_PATH "${DOWNLOADS}/${ARCHIVE}" ARCHIVE_NATIVE_PATH) - file(TO_NATIVE_PATH "${DOWNLOADS}/tools/${PROGNAME}" DESTINATION_NATIVE_PATH) + file(TO_NATIVE_PATH "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}" DESTINATION_NATIVE_PATH) execute_process( COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH} WORKING_DIRECTORY ${DOWNLOADS} @@ -89,7 +97,7 @@ function(vcpkg_find_acquire_program VAR) else() execute_process( COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE} - WORKING_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME} + WORKING_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR} ) endif() endif() diff --git a/scripts/cmake/vcpkg_install_cmake.cmake b/scripts/cmake/vcpkg_install_cmake.cmake index f29f3ce5db..5997fa7642 100644 --- a/scripts/cmake/vcpkg_install_cmake.cmake +++ b/scripts/cmake/vcpkg_install_cmake.cmake @@ -1,7 +1,7 @@ function(vcpkg_install_cmake) cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) - set(MSVC_EXTRA_ARGS) + set(MSVC_EXTRA_ARGS /p:VCPkgLocalAppDataDisabled=true) # Specifies the architecture of the toolset, NOT the architecture of the produced binary if (_bc_MSVC_64_TOOLSET) @@ -11,10 +11,16 @@ function(vcpkg_install_cmake) if (NOT _bc_DISABLE_PARALLEL) list(APPEND MSVC_EXTRA_ARGS "/m") endif() + + if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/build.ninja) + set(BUILD_ARGS -v) # verbose output + else() + set(BUILD_ARGS ${MSVC_EXTRA_ARGS}) + endif() message(STATUS "Package ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release --target install -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Release --target install -- ${BUILD_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME package-${TARGET_TRIPLET}-rel ) @@ -22,7 +28,7 @@ function(vcpkg_install_cmake) message(STATUS "Package ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug --target install -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Debug --target install -- ${BUILD_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME package-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/templates/portfile.in.cmake b/scripts/templates/portfile.in.cmake index c848b6445b..ef72431ff4 100644 --- a/scripts/templates/portfile.in.cmake +++ b/scripts/templates/portfile.in.cmake @@ -17,6 +17,7 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1 From bfc7a36e923434b000f9d16c621d850444c7125b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Feb 2017 14:38:49 -0800 Subject: [PATCH 273/561] [cpprestsdk] Use websocketpp from vcpkg instead of cpprest's copy --- ports/cpprestsdk/CONTROL | 4 ++-- ports/cpprestsdk/portfile.cmake | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/cpprestsdk/CONTROL b/ports/cpprestsdk/CONTROL index b3438026f4..f284f2b530 100644 --- a/ports/cpprestsdk/CONTROL +++ b/ports/cpprestsdk/CONTROL @@ -1,5 +1,5 @@ Source: cpprestsdk -Version: 2.9.0-1 -Build-Depends: zlib [windows], openssl [windows], boost [windows] +Version: 2.9.0-2 +Build-Depends: zlib [windows], openssl [windows], boost [windows], websocketpp [windows] Description: C++11 JSON, REST, and OAuth library The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services. \ No newline at end of file diff --git a/ports/cpprestsdk/portfile.cmake b/ports/cpprestsdk/portfile.cmake index d1b5fa7f6d..f92c5147a0 100644 --- a/ports/cpprestsdk/portfile.cmake +++ b/ports/cpprestsdk/portfile.cmake @@ -15,9 +15,13 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch ) +SET(WEBSOCKETPP_PATH "${CURRENT_INSTALLED_DIR}/share/websocketpp") + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/Release OPTIONS + -DWEBSOCKETPP_CONFIG=${WEBSOCKETPP_PATH} + -DWEBSOCKETPP_CONFIG_VERSION=${WEBSOCKETPP_PATH} -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -DCPPREST_EXCLUDE_WEBSOCKETS=OFF From ac44d930696cfc190c33f88c9ffa673918166cf5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Feb 2017 14:39:16 -0800 Subject: [PATCH 274/561] [webscoketpp] Fix dependencies --- ports/websocketpp/CONTROL | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/websocketpp/CONTROL b/ports/websocketpp/CONTROL index c11e64d3e1..f812dc565d 100644 --- a/ports/websocketpp/CONTROL +++ b/ports/websocketpp/CONTROL @@ -1,3 +1,4 @@ Source: websocketpp Version: 0.7.0 +Build-Depends: zlib, openssl, boost Description: Library that implements RFC6455 The WebSocket Protocol \ No newline at end of file From f7dcbe97fffdb5e4a005de7513816fc476aeef81 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 3 Feb 2017 17:46:09 -0800 Subject: [PATCH 275/561] [vcpkg] Disable Intel MKL for all internal builds. Fixes #609. --- scripts/cmake/vcpkg_build_cmake.cmake | 11 ++++++++--- scripts/cmake/vcpkg_build_msbuild.cmake | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 6d7cfe6434..3e8363a2c7 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -1,9 +1,14 @@ function(vcpkg_build_cmake) cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) - set(MSVC_EXTRA_ARGS) + set(MSVC_EXTRA_ARGS + "/p:VCPkgLocalAppDataDisabled=true" + "/p:UseIntelMKL=No" + ) # Specifies the architecture of the toolset, NOT the architecture of the produced binary + # This can help libraries that cause the linker to run out of memory. + # https://support.microsoft.com/en-us/help/2891057/linker-fatal-error-lnk1102-out-of-memory if (_bc_MSVC_64_TOOLSET) list(APPEND MSVC_EXTRA_ARGS "/p:PreferredToolArchitecture=x64") endif() @@ -14,7 +19,7 @@ function(vcpkg_build_cmake) message(STATUS "Build ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel ) @@ -22,7 +27,7 @@ function(vcpkg_build_cmake) message(STATUS "Build ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Debug -- ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index df255c7451..f4a809e7fa 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -55,6 +55,7 @@ function(vcpkg_build_msbuild) /p:Configuration=${_csc_RELEASE_CONFIGURATION} /p:Platform=${_csc_PLATFORM} /p:VCPkgLocalAppDataDisabled=true + /p:UseIntelMKL=No /m WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel @@ -67,6 +68,7 @@ function(vcpkg_build_msbuild) /p:Configuration=${_csc_DEBUG_CONFIGURATION} /p:Platform=${_csc_PLATFORM} /p:VCPkgLocalAppDataDisabled=true + /p:UseIntelMKL=No /m WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg From 5fa7aba4d21ce35b65da02243697319bd23bf2f6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Feb 2017 18:25:43 -0800 Subject: [PATCH 276/561] [vcpkg remove] Fix remove --purge not applying to not-installed packages --- toolsrc/src/commands_remove.cpp | 39 ++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 7e8608e727..f49104d1ec 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -196,26 +196,29 @@ namespace vcpkg::Commands::Remove for (const package_spec_with_remove_plan& action : remove_plan) { - if (action.plan.plan_type == remove_plan_type::NOT_INSTALLED) - { - System::println(System::color::success, "Package %s is not installed", action.spec); - } - else if (action.plan.plan_type == remove_plan_type::REMOVE) - { - const std::string display_name = action.spec.display_name(); - System::println("Removing package %s... ", display_name); - remove_package(paths, action.spec, &status_db); - System::println(System::color::success, "Removing package %s... done", display_name); + const std::string display_name = action.spec.display_name(); - if (alsoRemoveFolderFromPackages) - { - System::println("Purging package %s... ", display_name); - delete_directory(paths.packages / action.spec.dir()); - System::println(System::color::success, "Purging package %s... done", display_name); - } + switch (action.plan.plan_type) + { + case remove_plan_type::NOT_INSTALLED: + System::println(System::color::success, "Package %s is not installed", display_name); + break; + case remove_plan_type::REMOVE: + System::println("Removing package %s... ", display_name); + remove_package(paths, action.spec, &status_db); + System::println(System::color::success, "Removing package %s... done", display_name); + break; + case remove_plan_type::UNKNOWN: + default: + Checks::unreachable(); + } + + if (alsoRemoveFolderFromPackages) + { + System::println("Purging package %s... ", display_name); + delete_directory(paths.packages / action.spec.dir()); + System::println(System::color::success, "Purging package %s... done", display_name); } - else - Checks::unreachable(); } exit(EXIT_SUCCESS); From 20ac877b5e6e182ca449c633516636c173e71f94 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 3 Feb 2017 18:54:38 -0800 Subject: [PATCH 277/561] [wt] Apply upstream patch to fix boost 1.63 compat. Fixes #626. --- ports/wt/CONTROL | 2 +- ports/wt/portfile.cmake | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ports/wt/CONTROL b/ports/wt/CONTROL index 1a89dd3785..d7ac2c535b 100644 --- a/ports/wt/CONTROL +++ b/ports/wt/CONTROL @@ -1,4 +1,4 @@ Source: wt -Version: 3.3.6-2 +Version: 3.3.6-3 Description: Wt is a C++ library for developing web applications Build-Depends: boost, openssl diff --git a/ports/wt/portfile.cmake b/ports/wt/portfile.cmake index f762efaced..7e2bdb47c1 100644 --- a/ports/wt/portfile.cmake +++ b/ports/wt/portfile.cmake @@ -7,10 +7,15 @@ vcpkg_download_distfile(ARCHIVE_FILE SHA512 d6135713d300bcd3956a4fd673af73be0561eb5d6aa91c47255b966950ddb411217e6a826c1d11c0d941dbb6d006c9926231d7334b21de6256cca331066e18a6 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) - +vcpkg_download_distfile(PATCH_FILE + URLS "https://github.com/emweb/wt/commit/b944cdc0961f683cd12fc6e60db3d0b328cd46dd.diff" + FILENAME "wt-fix-boost-1-63.diff" + SHA512 0766837ed8852da675b02b45bfbe7a6705ab20f67aa20849df4cc4b93b00dec0b73acea3568bca1046e203119445044c5ea06e33bac5d5d991f6a56b8fe282e1 +) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/add-disable-boost-autolink-option.patch + ${PATCH_FILE} ) vcpkg_configure_cmake( From 85cab47ea46f255dd6c3528e309191ed7c3fd2ff Mon Sep 17 00:00:00 2001 From: sdcb Date: Sat, 4 Feb 2017 11:18:04 +0800 Subject: [PATCH 278/561] [aws-sdk-cpp] upgrade to 1.0.61 1. upgrade to 1.0.61 2. disable warning as error temply(fix https://github.com/Microsoft/vcpkg/issues/629 before https://github.com/aws/aws-sdk-cpp/issues/438) 3. using cmake file(append) instead of patch to define #define USE_IMPORT_EXPORT in SDKConfig.h (simplified code) --- ports/aws-sdk-cpp/disable_warning_as_error.patch | 13 +++++++++++++ ports/aws-sdk-cpp/portfile.cmake | 15 ++++++--------- ports/aws-sdk-cpp/shared_define.patch | 10 ---------- 3 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 ports/aws-sdk-cpp/disable_warning_as_error.patch delete mode 100644 ports/aws-sdk-cpp/shared_define.patch diff --git a/ports/aws-sdk-cpp/disable_warning_as_error.patch b/ports/aws-sdk-cpp/disable_warning_as_error.patch new file mode 100644 index 0000000000..ec5587eb86 --- /dev/null +++ b/ports/aws-sdk-cpp/disable_warning_as_error.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/compiler_settings.cmake b/cmake/compiler_settings.cmake +index 36795a2..77334ee 100644 +--- a/cmake/compiler_settings.cmake ++++ b/cmake/compiler_settings.cmake +@@ -57,7 +57,7 @@ endif() + if(MSVC) + # warnings as errors, max warning level (4) + if(NOT CMAKE_CXX_FLAGS MATCHES "/WX") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") ++ #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") + endif() + + # taken from http://stackoverflow.com/questions/2368811/how-to-set-warning-level-in-cmake diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index 5313e85b76..21219c3c99 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -1,9 +1,9 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aws-sdk-cpp-1.0.47) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aws-sdk-cpp-1.0.61) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/aws/aws-sdk-cpp/archive/1.0.47.tar.gz" - FILENAME "aws-sdk-cpp-1.0.47.tar.gz" - SHA512 ce7471bafe2763f1c382eed8afeaf6422058599a3aa11ae52909da668c45d12827fcd06b9b3ce34e3c2fa33297fd2e09421b8a89833d581efaf62b7108232acf + URLS "https://github.com/aws/aws-sdk-cpp/archive/1.0.61.tar.gz" + FILENAME "aws-sdk-cpp-1.0.61.tar.gz" + SHA512 aef0a85a32db24dc4fba0fc49c2533074580f3df628e787ff0808f03deea5dac42e19b1edc966706784e98cfed17a350c3eff4f222df7cc756065be56d1fc6a6 ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -11,6 +11,7 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/drop_git.patch + ${CMAKE_CURRENT_LIST_DIR}/disable_warning_as_error.patch ) if(VCPKG_CRT_LINKAGE STREQUAL static) @@ -44,11 +45,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(COPY ${DEBUG_LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) file(REMOVE ${LIB_FILES} ${DEBUG_LIB_FILES}) - vcpkg_apply_patches( #define USE_IMPORT_EXPORT in SDKConfig.h - SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/shared_define.patch - ) + file(APPEND ${CURRENT_PACKAGES_DIR}/include/aws/core/SDKConfig.h "#define USE_IMPORT_EXPORT") endif() # Handle copyright diff --git a/ports/aws-sdk-cpp/shared_define.patch b/ports/aws-sdk-cpp/shared_define.patch deleted file mode 100644 index 96657b33ea..0000000000 --- a/ports/aws-sdk-cpp/shared_define.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/aws/core/SDKConfig.h b/aws/core/SDKConfig.h -index 130c9dd..66b2630 100644 ---- a/aws/core/SDKConfig.h -+++ b/aws/core/SDKConfig.h -@@ -17,3 +17,4 @@ - - #define JSON_USE_EXCEPTION 0 - -+#define USE_IMPORT_EXPORT -\ No newline at end of file From a923738dab74e0b2f1a611cac162d71efd9aaee2 Mon Sep 17 00:00:00 2001 From: flysha Date: Sun, 5 Feb 2017 18:28:50 +0800 Subject: [PATCH 279/561] add sqlite-modern-cpp https://github.com/aminroosta/sqlite_modern_cpp --- ports/sqlite-modern-cpp/CONTROL | 3 +++ ports/sqlite-modern-cpp/portfile.cmake | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 ports/sqlite-modern-cpp/CONTROL create mode 100644 ports/sqlite-modern-cpp/portfile.cmake diff --git a/ports/sqlite-modern-cpp/CONTROL b/ports/sqlite-modern-cpp/CONTROL new file mode 100644 index 0000000000..5b16bd9dc4 --- /dev/null +++ b/ports/sqlite-modern-cpp/CONTROL @@ -0,0 +1,3 @@ +Source: sqlite-modern-cpp +Version: 2.4 +Description: The C++14 wrapper around sqlite library diff --git a/ports/sqlite-modern-cpp/portfile.cmake b/ports/sqlite-modern-cpp/portfile.cmake new file mode 100644 index 0000000000..a7b0f81edd --- /dev/null +++ b/ports/sqlite-modern-cpp/portfile.cmake @@ -0,0 +1,21 @@ +# header only +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/sqlite_modern_cpp-2.4) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/aminroosta/sqlite_modern_cpp/archive/v2.4.tar.gz" + FILENAME "sqlite_modern_cpp-2.4.tar.gz" + SHA512 99d8220c9dcbf7383c75ef8061bc792a4ea0b7e6e1290992f1604f66e77fcb5055af8c54c2d82b6a8d331359e2829d987b7528208f032f32699e1349296792db +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(INSTALL ${SOURCE_PATH}/hdr/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +# Handle copyright +message("Download license...") +vcpkg_download_distfile(LICENSE + URLS https://raw.githubusercontent.com/aminroosta/sqlite_modern_cpp/1d7747fcbb16325ec6673477b06f0c780de24a27/License.txt + FILENAME "sqlite_modern_cpp-2.4-license-mit.txt" + SHA512 4ffc41d14902b37841463b9e9274537cb48523a7ab7e5fbbbd14a01820d141e367851b0496aa18546ddab96100e7381db7fc35621c795a97c3290b618e18a8bd +) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/sqlite-modern-cpp) +file(RENAME ${LICENSE} ${CURRENT_PACKAGES_DIR}/share/sqlite-modern-cpp/copyright) From 0bbae46a9cae7edcee9fe613d1f59e4c20af8af6 Mon Sep 17 00:00:00 2001 From: flysha Date: Sun, 5 Feb 2017 18:30:37 +0800 Subject: [PATCH 280/561] [sqlite-modern-cpp] add build-depends --- ports/sqlite-modern-cpp/CONTROL | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/sqlite-modern-cpp/CONTROL b/ports/sqlite-modern-cpp/CONTROL index 5b16bd9dc4..641b3229ca 100644 --- a/ports/sqlite-modern-cpp/CONTROL +++ b/ports/sqlite-modern-cpp/CONTROL @@ -1,3 +1,4 @@ Source: sqlite-modern-cpp Version: 2.4 +Build-Depends: sqlite3 Description: The C++14 wrapper around sqlite library From 504545d2c864623ebddf169b1e402326bfe136f4 Mon Sep 17 00:00:00 2001 From: Ben Harper Date: Mon, 6 Feb 2017 14:44:59 +0200 Subject: [PATCH 281/561] Add a workaround for another BITS code path The fix from last week (ce9927f7327bc71ade246108a7d984deda6293fd) worked for downloading most dependencies, but there is still one BITS transfer code path, which this fix addresses. --- .../findVisualStudioInstallationInstances.ps1 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index a2ce665224..9d54990a26 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -20,7 +20,21 @@ $downloadPath = "$downloadsDir\$downloadName" if (!(Test-Path $downloadPath)) { - Start-BitsTransfer -Source $url -Destination $downloadPath #-ErrorAction SilentlyContinue + try { + Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop + } + catch [System.Exception] { + # If BITS fails for any reason, delete any potentially partially downloaded files and continue + if (Test-Path $downloadPath) + { + Remove-Item $downloadPath + } + } +} +if (!(Test-Path $downloadPath)) +{ + Write-Host("Downloading $downloadName...") + (New-Object System.Net.WebClient).DownloadFile($url, $downloadPath) } $nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Pre -Source $downloadsDir -OutputDirectory $nugetPackageDir 2>&1 From 7207316ed405c334be1ac507d76dd45a5979903d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 6 Feb 2017 15:26:35 -0800 Subject: [PATCH 282/561] Don't download nupkg. nuget.exe auto-downloads it --- .../findVisualStudioInstallationInstances.ps1 | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 9d54990a26..2c42ef4209 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -14,29 +14,6 @@ $nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" $nugetPackageDir = "$downloadsDir\nuget-packages" $SetupAPIVersion = "1.3.269-rc" -$url = "https://api.nuget.org/packages/microsoft.visualstudio.setup.configuration.native.$SetupAPIVersion.nupkg" -$downloadName = "microsoft.visualstudio.setup.configuration.native.$SetupAPIVersion.nupkg" -$downloadPath = "$downloadsDir\$downloadName" - -if (!(Test-Path $downloadPath)) -{ - try { - Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop - } - catch [System.Exception] { - # If BITS fails for any reason, delete any potentially partially downloaded files and continue - if (Test-Path $downloadPath) - { - Remove-Item $downloadPath - } - } -} -if (!(Test-Path $downloadPath)) -{ - Write-Host("Downloading $downloadName...") - (New-Object System.Net.WebClient).DownloadFile($url, $downloadPath) -} - $nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Pre -Source $downloadsDir -OutputDirectory $nugetPackageDir 2>&1 $SetupConsoleExe = "$nugetPackageDir\Microsoft.VisualStudio.Setup.Configuration.Native.$SetupAPIVersion\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Console.exe" From 1bfd72480d46845a941f891d232eb8c67b9d146c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 6 Feb 2017 15:52:48 -0800 Subject: [PATCH 283/561] [poco] Fix #475 by adding include path to public interface. --- ports/poco/CONTROL | 2 +- ports/poco/foundation-public-include-pcre.patch | 12 ++++++++++++ ports/poco/portfile.cmake | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 ports/poco/foundation-public-include-pcre.patch diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL index 6f4f7e3b1e..ae2758c1f3 100644 --- a/ports/poco/CONTROL +++ b/ports/poco/CONTROL @@ -1,4 +1,4 @@ Source: poco -Version: 1.7.6-2 +Version: 1.7.6-3 Build-Depends: zlib, pcre, sqlite3, expat Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. \ No newline at end of file diff --git a/ports/poco/foundation-public-include-pcre.patch b/ports/poco/foundation-public-include-pcre.patch new file mode 100644 index 0000000000..ab4403ad84 --- /dev/null +++ b/ports/poco/foundation-public-include-pcre.patch @@ -0,0 +1,12 @@ +diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt +index 76005b1..efc99b6 100644 +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -166,6 +166,7 @@ target_link_libraries( "${LIBNAME}" ${SYSLIBS}) + target_include_directories( "${LIBNAME}" + PUBLIC + $ ++ $ + $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src + ) diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index 413f19c7e1..e774c3c17c 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -13,6 +13,7 @@ vcpkg_apply_patches( PATCHES ${CMAKE_CURRENT_LIST_DIR}/config_h.patch ${CMAKE_CURRENT_LIST_DIR}/find_pcre.patch + ${CMAKE_CURRENT_LIST_DIR}/foundation-public-include-pcre.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) From acc669e86942dd569884d5241b023a91eed61908 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 6 Feb 2017 15:55:39 -0800 Subject: [PATCH 284/561] Update SetupAPI version. Explicitly specify version. Use -nocache --- scripts/findVisualStudioInstallationInstances.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 2c42ef4209..260ee73fe1 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -13,8 +13,8 @@ $downloadsDir = "$vcpkgRootDir\downloads" $nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" $nugetPackageDir = "$downloadsDir\nuget-packages" -$SetupAPIVersion = "1.3.269-rc" -$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Pre -Source $downloadsDir -OutputDirectory $nugetPackageDir 2>&1 +$SetupAPIVersion = "1.5.125-rc" +$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Version $SetupAPIVersion -OutputDirectory $nugetPackageDir -nocache 2>&1 $SetupConsoleExe = "$nugetPackageDir\Microsoft.VisualStudio.Setup.Configuration.Native.$SetupAPIVersion\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Console.exe" From 8c322ca613a51798741812dc4d0125dc9324b448 Mon Sep 17 00:00:00 2001 From: Max Smolens Date: Tue, 7 Feb 2017 15:30:19 -0500 Subject: [PATCH 285/561] [grpc] Fix exported targets Fix gRPC's exported targets. Now CMake projects can do: find_package(gRPC CONFIG REQUIRED) and then use the exported targets such as gRPC::grpc and gRPC::grpc++. Additionally, install gRPC tools and protoc plugins into the 'tools' directory. The plugins are required to generate gRPC client and server interfaces from .proto service definitions. --- ports/grpc/portfile.cmake | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index ffd71d1375..9c4ddbc067 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -48,12 +48,33 @@ vcpkg_install_cmake() file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/grpc) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCConfig.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCConfig.cmake) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCConfigVersion.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCConfigVersion.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCTargets.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCTargets-release.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-release.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/gRPC/gRPCTargets-debug.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-debug.cmake) + +# Update import target prefix in gRPCTargets.cmake +file(READ ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCTargets.cmake _contents) +set(pattern "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\n") +string(REPLACE "${pattern}${pattern}" "${pattern}" _contents "${_contents}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets.cmake "${_contents}") + +# Update paths in gRPCTargets-release.cmake +file(READ ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCTargets-release.cmake _contents) +string(REPLACE "\${_IMPORT_PREFIX}/bin/" "\${_IMPORT_PREFIX}/tools/" _contents "${_contents}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-release.cmake "${_contents}") + +# Update paths in gRPCTargets-debug.cmake +file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/gRPC/gRPCTargets-debug.cmake _contents) +string(REPLACE "\${_IMPORT_PREFIX}/bin/" "\${_IMPORT_PREFIX}/tools/" _contents "${_contents}") +string(REPLACE "\${_IMPORT_PREFIX}/lib/" "\${_IMPORT_PREFIX}/debug/lib/" _contents "${_contents}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-debug.cmake "${_contents}") file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright) +# Install tools and plugins +file( + INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/ + DESTINATION ${CURRENT_PACKAGES_DIR}/tools + FILES_MATCHING PATTERN "*.exe" +) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) From 8d5cbff2954a425731057a206a8e769a5bc53e16 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 7 Feb 2017 15:04:07 -0800 Subject: [PATCH 286/561] [examples] Add the manual-link directories to the Examples documentation --- docs/EXAMPLES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/EXAMPLES.md b/docs/EXAMPLES.md index 6302dab07e..cc100c4ca1 100644 --- a/docs/EXAMPLES.md +++ b/docs/EXAMPLES.md @@ -150,9 +150,9 @@ PS D:\src\cmake-test\build> .\Debug\main.exe Libraries are installed into the `installed\` subfolder, partitioned by architecture (e.g. x86-windows): * The header files are installed to `installed\x86-windows\include` -* Release `.lib` files are installed to `installed\x86-windows\lib` +* Release `.lib` files are installed to `installed\x86-windows\lib` or `installed\x86-windows\lib\manual-link` * Release `.dll` files are installed to `installed\x86-windows\bin` -* Debug `.lib` files are installed to `installed\x86-windows\debug\lib` +* Debug `.lib` files are installed to `installed\x86-windows\debug\lib` or `installed\x86-windows\debug\lib\manual-link` * Debug `.dll` files are installed to `installed\x86-windows\debug\bin` See your build system specific documentation for how to use prebuilt binaries. From f9616c6994ccf66e2a64e2d62e6a1408694c190c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 7 Feb 2017 17:02:57 -0800 Subject: [PATCH 287/561] Add new Policy: Empty Package --- scripts/ports.cmake | 3 + toolsrc/include/PostBuildLint_BuildPolicies.h | 5 +- toolsrc/src/PostBuildLint.cpp | 92 +++++++++++-------- toolsrc/src/PostBuildLint_BuildPolicies.cpp | 13 ++- 4 files changed, 72 insertions(+), 41 deletions(-) diff --git a/scripts/ports.cmake b/scripts/ports.cmake index cc01a0619e..c03b005ead 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -79,6 +79,9 @@ if(CMD MATCHES "^BUILD$") if (DEFINED VCPKG_POLICY_DLLS_WITHOUT_LIBS) file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyDLLsWithoutLIBs: ${VCPKG_POLICY_DLLS_WITHOUT_LIBS}\n") endif() + if (DEFINED VCPKG_POLICY_EMPTY_PACKAGE) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyEmptyPackage: ${VCPKG_POLICY_EMPTY_PACKAGE}\n") + endif() elseif(CMD MATCHES "^CREATE$") file(TO_NATIVE_PATH ${VCPKG_ROOT_DIR} NATIVE_VCPKG_ROOT_DIR) file(TO_NATIVE_PATH ${DOWNLOADS} NATIVE_DOWNLOADS) diff --git a/toolsrc/include/PostBuildLint_BuildPolicies.h b/toolsrc/include/PostBuildLint_BuildPolicies.h index 8298ffe2d4..187ba6d646 100644 --- a/toolsrc/include/PostBuildLint_BuildPolicies.h +++ b/toolsrc/include/PostBuildLint_BuildPolicies.h @@ -6,6 +6,7 @@ namespace vcpkg::PostBuildLint::BuildPolicies enum class backing_enum_t { UNKNOWN = 0, + EMPTY_PACKAGE, DLLS_WITHOUT_LIBS }; @@ -22,10 +23,12 @@ namespace vcpkg::PostBuildLint::BuildPolicies backing_enum_t backing_enum; }; - static constexpr int value_count = 2; + static constexpr int value_count = 3; const std::vector& values(); + static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); + static constexpr type EMPTY_PACKAGE(backing_enum_t::EMPTY_PACKAGE); static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); type parse(const std::string& s); diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 5954089e9d..533e28fcf2 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -582,16 +582,21 @@ namespace vcpkg::PostBuildLint left += static_cast(right); } - void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths) + static size_t perform_all_checks_and_return_error_count(const package_spec& spec, const vcpkg_paths& paths) { const fs::path dumpbin_exe = Environment::get_dumpbin_exe(paths); - System::println("-- Performing post-build validation"); - BuildInfo build_info = read_build_info(paths.build_info_file_path(spec)); const fs::path package_dir = paths.package_dir(spec); size_t error_count = 0; + + auto it = build_info.policies.find(BuildPolicies::EMPTY_PACKAGE); + if (it != build_info.policies.cend() && it->second == opt_bool_t::ENABLED) + { + return error_count; + } + error_count += check_for_files_in_include_directory(package_dir); error_count += check_for_files_in_debug_include_directory(package_dir); error_count += check_for_files_in_debug_share_directory(package_dir); @@ -620,56 +625,65 @@ namespace vcpkg::PostBuildLint switch (linkage_type_value_of(build_info.library_linkage)) { - case LinkageType::DYNAMIC: - { - const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); - const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); + case LinkageType::DYNAMIC: + { + const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); + const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); - error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); + error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); - error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); - error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); - std::vector dlls; - dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); - dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); + std::vector dlls; + dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); + dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); - error_count += check_exports_of_dlls(dlls, dumpbin_exe); - error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); - error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); + error_count += check_exports_of_dlls(dlls, dumpbin_exe); + error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); + error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); - error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); - break; - } - case LinkageType::STATIC: - { - std::vector dlls; - Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); - error_count += check_no_dlls_present(dlls); + error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); + break; + } + case LinkageType::STATIC: + { + std::vector dlls; + Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); + error_count += check_no_dlls_present(dlls); - error_count += check_bin_folders_are_not_present_in_static_build(package_dir); + error_count += check_bin_folders_are_not_present_in_static_build(package_dir); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); - break; - } - case LinkageType::UNKNOWN: - { - error_count += 1; - System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); - break; - } - default: - Checks::unreachable(); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); + break; + } + case LinkageType::UNKNOWN: + { + error_count += 1; + System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); + break; + } + default: + Checks::unreachable(); } #if 0 - error_count += check_no_subdirectories(package_dir / "lib"); - error_count += check_no_subdirectories(package_dir / "debug" / "lib"); + error_count += check_no_subdirectories(package_dir / "lib"); + error_count += check_no_subdirectories(package_dir / "debug" / "lib"); #endif error_count += check_no_empty_folders(package_dir); error_count += check_no_files_in_package_dir_and_debug_dir(package_dir); + return error_count; + } + + void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths) + { + System::println("-- Performing post-build validation"); + + const size_t error_count = perform_all_checks_and_return_error_count(spec, paths); + if (error_count != 0) { const fs::path portfile = paths.ports / spec.name() / "portfile.cmake"; diff --git a/toolsrc/src/PostBuildLint_BuildPolicies.cpp b/toolsrc/src/PostBuildLint_BuildPolicies.cpp index d7d67c991c..4e5ac3ceae 100644 --- a/toolsrc/src/PostBuildLint_BuildPolicies.cpp +++ b/toolsrc/src/PostBuildLint_BuildPolicies.cpp @@ -5,12 +5,15 @@ namespace vcpkg::PostBuildLint::BuildPolicies { static const std::string NAME_UNKNOWN = "PolicyUnknown"; + static const std::string NAME_EMPTY_PACKAGE = "PolicyEmptyPackage"; static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs"; const std::string& type::toString() const { switch (this->backing_enum) { + case EMPTY_PACKAGE: + return NAME_EMPTY_PACKAGE; case DLLS_WITHOUT_LIBS: return NAME_DLLS_WITHOUT_LIBS; case UNKNOWN: @@ -22,10 +25,13 @@ namespace vcpkg::PostBuildLint::BuildPolicies const std::string& type::cmake_variable() const { + static const std::string CMAKE_VARIABLE_EMPTY_PACKAGE = "VCPKG_POLICY_EMPTY_PACKAGE"; static const std::string CMAKE_VARIABLE_DLLS_WITHOUT_LIBS = "VCPKG_POLICY_DLLS_WITHOUT_LIBS"; switch (this->backing_enum) { + case EMPTY_PACKAGE: + return CMAKE_VARIABLE_EMPTY_PACKAGE; case DLLS_WITHOUT_LIBS: return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS; case UNKNOWN: @@ -39,12 +45,17 @@ namespace vcpkg::PostBuildLint::BuildPolicies const std::vector& values() { - static const std::vector& v = {UNKNOWN, DLLS_WITHOUT_LIBS}; + static const std::vector& v = {UNKNOWN, EMPTY_PACKAGE, DLLS_WITHOUT_LIBS}; return v; } type parse(const std::string& s) { + if (s == NAME_EMPTY_PACKAGE) + { + return BuildPolicies::EMPTY_PACKAGE; + } + if (s == NAME_DLLS_WITHOUT_LIBS) { return BuildPolicies::DLLS_WITHOUT_LIBS; From d4fa0b34c08dcfb11bd285846ee5cc061885033d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 7 Feb 2017 17:04:24 -0800 Subject: [PATCH 288/561] Add CUDA portfile The intention of this package is for other packages to declare a dependency on CUDA --- ports/cuda/CONTROL | 3 +++ ports/cuda/portfile.cmake | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 ports/cuda/CONTROL create mode 100644 ports/cuda/portfile.cmake diff --git a/ports/cuda/CONTROL b/ports/cuda/CONTROL new file mode 100644 index 0000000000..00df3011c8 --- /dev/null +++ b/ports/cuda/CONTROL @@ -0,0 +1,3 @@ +Source: cuda +Version: 8.0 +Description: A parallel computing platform and programming model \ No newline at end of file diff --git a/ports/cuda/portfile.cmake b/ports/cuda/portfile.cmake new file mode 100644 index 0000000000..3b20afe0fa --- /dev/null +++ b/ports/cuda/portfile.cmake @@ -0,0 +1,34 @@ +# Due to the complexity involved, this package doesn't install CUDA. It instead verifies that CUDA is installed. +# Other packages can depend on this package to declare a dependency on CUDA. +# If this package is installed, we assume that CUDA is properly installed. + +execute_process( + COMMAND nvcc --version + OUTPUT_VARIABLE NVCC_OUTPUT + RESULT_VARIABLE error_code) + +# Sample output +# NVIDIA (R) Cuda compiler driver +# Copyright (c) 2005-2016 NVIDIA Corporation +# Built on Sat_Sep__3_19:05:48_CDT_2016 +# Cuda compilation tools, release 8.0, V8.0.44 +set(CUDA_REQUIRED_VERSION "V8.0.0") + +if (${error_code}) + message(FATAL_ERROR "CUDA is not installed. Before continuing, please download and install CUDA (${CUDA_REQUIRED_VERSION} or higher) from:" + "\n https://developer.nvidia.com/cuda-downloads \n") +endif() + +string(REGEX MATCH "V([0-9]+)\\.([0-9]+)\\.([0-9]+)" CUDA_VERSION ${NVCC_OUTPUT}) +message(STATUS "Found CUDA ${CUDA_VERSION}") +set(CUDA_VERSION_MAJOR ${CMAKE_MATCH_1}) +#set(CUDA_VERSION_MINOR ${CMAKE_MATCH_2}) +#set(CUDA_VERSION_PATCH ${CMAKE_MATCH_3}) + + +if (${CUDA_VERSION_MAJOR} LESS 8) + message(FATAL_ERROR "CUDA ${CUDA_VERSION} but ${CUDA_REQUIRED_VERSION} is required. Please download and install a more recent version of CUDA from:" + "\n https://developer.nvidia.com/cuda-downloads \n") +endif() + +SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file From 994ebec3ea29994197be64084f33d3653ec428c5 Mon Sep 17 00:00:00 2001 From: sdflysha Date: Wed, 8 Feb 2017 10:50:01 +0800 Subject: [PATCH 289/561] [aws-sdk-cpp] bump version to 1.0.61 I created a PR here: https://github.com/Microsoft/vcpkg/pull/631 but forgot to bump the aws-sdk-cpp version, I fixed it here. --- ports/aws-sdk-cpp/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/aws-sdk-cpp/CONTROL b/ports/aws-sdk-cpp/CONTROL index 989d3a9ebd..18de04d46f 100644 --- a/ports/aws-sdk-cpp/CONTROL +++ b/ports/aws-sdk-cpp/CONTROL @@ -1,3 +1,3 @@ Source: aws-sdk-cpp -Version: 1.0.47 +Version: 1.0.61 Description: AWS SDK for C++ From d36a1b7cb0b8be59e7826a7a699d9951e91abc2c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 7 Feb 2017 22:57:37 -0800 Subject: [PATCH 290/561] Remove OutdatedDynamicCrt enum. Replace with vector --- .../PostBuildLint_OutdatedDynamicCrt.h | 59 ---------- toolsrc/src/PostBuildLint.cpp | 107 +++++++++++------- .../src/PostBuildLint_OutdatedDynamicCrt.cpp | 35 ------ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 - toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 - 5 files changed, 69 insertions(+), 140 deletions(-) delete mode 100644 toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h delete mode 100644 toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp diff --git a/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h b/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h deleted file mode 100644 index 484f74cf00..0000000000 --- a/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once -#include -#include - -namespace vcpkg::PostBuildLint -{ - struct OutdatedDynamicCrt - { - // Old CPP - static const OutdatedDynamicCrt MSVCP100_DLL; - static const OutdatedDynamicCrt MSVCP100D_DLL; - static const OutdatedDynamicCrt MSVCP110_DLL; - static const OutdatedDynamicCrt MSVCP110_WIN_DLL; - static const OutdatedDynamicCrt MSVCP120_DLL; - static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCP60_DLL; - static const OutdatedDynamicCrt MSVCP_WIN_DLL; - - // Old C - static const OutdatedDynamicCrt MSVCR100_DLL; - static const OutdatedDynamicCrt MSVCR100D_DLL; - static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCR110_DLL; - static const OutdatedDynamicCrt MSVCR120_DLL; - static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCRT_DLL; - static const OutdatedDynamicCrt MSVCRT20_DLL; - static const OutdatedDynamicCrt MSVCRT40_DLL; - - static const std::vector& values() - { - static const std::vector v = { - MSVCP100_DLL, MSVCP100D_DLL, - MSVCP110_DLL,MSVCP110_WIN_DLL, - MSVCP120_DLL, MSVCP120_CLR0400_DLL, - MSVCP60_DLL, - MSVCP_WIN_DLL, - - MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, - MSVCR110_DLL, - MSVCR120_DLL, MSVCR120_CLR0400_DLL, - MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL - }; - return v; - } - - OutdatedDynamicCrt() = delete; - - std::regex crt_regex() const; - const std::string& toString() const; - - private: - explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) - : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) { } - - std::string m_dll_name; - std::string m_crt_regex_as_string; - }; -} diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 533e28fcf2..7986d913a9 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -7,7 +7,6 @@ #include "coff_file_reader.h" #include "PostBuildLint_BuildInfo.h" #include "PostBuildLint_BuildType.h" -#include "PostBuildLint_OutdatedDynamicCrt.h" namespace vcpkg::PostBuildLint { @@ -17,6 +16,38 @@ namespace vcpkg::PostBuildLint ERROR_DETECTED = 1 }; + struct OutdatedDynamicCrt + { + std::string name; + std::regex regex; + }; + + const std::vector& get_outdated_dynamic_crts() + { + static const std::vector v = { + {"msvcp100.dll", std::regex(R"(msvcp100\.dll)")}, + {"msvcp100d.dll", std::regex(R"(msvcp100d\.dll)")}, + {"msvcp110.dll", std::regex(R"(msvcp110\.dll)")}, + {"msvcp110_win.dll", std::regex(R"(msvcp110_win\.dll)")}, + {"msvcp120.dll", std::regex(R"(msvcp120\.dll)")}, + {"msvcp120_clr0400.dll", std::regex(R"(msvcp120_clr0400\.dll)")}, + {"msvcp60.dll", std::regex(R"(msvcp60\.dll)")}, + {"msvcp60.dll", std::regex(R"(msvcp60\.dll)")}, + + {"msvcr100.dll", std::regex(R"(msvcr100\.dll)")}, + {"msvcr100d.dll", std::regex(R"(msvcr100d\.dll)")}, + {"msvcr100_clr0400.dll", std::regex(R"(msvcr100_clr0400\.dll)")}, + {"msvcr110.dll", std::regex(R"(msvcr110\.dll)")}, + {"msvcr120.dll", std::regex(R"(msvcr120\.dll)")}, + {"msvcr120_clr0400.dll", std::regex(R"(msvcr120_clr0400\.dll)")}, + {"msvcrt.dll", std::regex(R"(msvcrt\.dll)")}, + {"msvcrt20.dll", std::regex(R"(msvcrt20\.dll)")}, + {"msvcrt40.dll", std::regex(R"(msvcrt40\.dll)")} + }; + + return v; + } + static lint_status check_for_files_in_include_directory(const fs::path& package_dir) { const fs::path include_dir = package_dir / "include"; @@ -516,7 +547,7 @@ namespace vcpkg::PostBuildLint static lint_status check_outdated_crt_linkage_of_dlls(const std::vector& dlls, const fs::path dumpbin_exe) { - const std::vector& outdated_crts = OutdatedDynamicCrt::values(); + const std::vector& outdated_crts = get_outdated_dynamic_crts(); std::vector dlls_with_outdated_crt; @@ -528,7 +559,7 @@ namespace vcpkg::PostBuildLint for (const OutdatedDynamicCrt& outdated_crt : outdated_crts) { - if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), outdated_crt.crt_regex())) + if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), outdated_crt.regex)) { dlls_with_outdated_crt.push_back({dll, outdated_crt}); break; @@ -542,7 +573,7 @@ namespace vcpkg::PostBuildLint System::println(""); for (const OutdatedDynamicCrt_and_file btf : dlls_with_outdated_crt) { - System::println(" %s: %s", btf.file.generic_string(), btf.outdated_crt.toString()); + System::println(" %s: %s", btf.file.generic_string(), btf.outdated_crt.name); } System::println(""); @@ -625,47 +656,47 @@ namespace vcpkg::PostBuildLint switch (linkage_type_value_of(build_info.library_linkage)) { - case LinkageType::DYNAMIC: - { - const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); - const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); + case LinkageType::DYNAMIC: + { + const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); + const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); - error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); + error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); - error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); - error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); - std::vector dlls; - dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); - dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); + std::vector dlls; + dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); + dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); - error_count += check_exports_of_dlls(dlls, dumpbin_exe); - error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); - error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); + error_count += check_exports_of_dlls(dlls, dumpbin_exe); + error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); + error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); - error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); - break; - } - case LinkageType::STATIC: - { - std::vector dlls; - Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); - error_count += check_no_dlls_present(dlls); + error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); + break; + } + case LinkageType::STATIC: + { + std::vector dlls; + Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); + error_count += check_no_dlls_present(dlls); - error_count += check_bin_folders_are_not_present_in_static_build(package_dir); + error_count += check_bin_folders_are_not_present_in_static_build(package_dir); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); - break; - } - case LinkageType::UNKNOWN: - { - error_count += 1; - System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); - break; - } - default: - Checks::unreachable(); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); + break; + } + case LinkageType::UNKNOWN: + { + error_count += 1; + System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); + break; + } + default: + Checks::unreachable(); } #if 0 error_count += check_no_subdirectories(package_dir / "lib"); diff --git a/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp b/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp deleted file mode 100644 index 67965cd936..0000000000 --- a/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "pch.h" -#include "PostBuildLint_OutdatedDynamicCrt.h" - -namespace vcpkg::PostBuildLint -{ - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100_DLL = OutdatedDynamicCrt("msvcp100.dll", R"(msvcp100\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100D_DLL = OutdatedDynamicCrt("msvcp100d.dll", R"(msvcp100d\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_DLL = OutdatedDynamicCrt("msvcp110.dll", R"(msvcp110\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_WIN_DLL = OutdatedDynamicCrt("msvcp110_win.dll", R"(msvcp110_win\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_DLL = OutdatedDynamicCrt("msvcp120.dll", R"(msvcp120\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_CLR0400_DLL = OutdatedDynamicCrt("msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP60_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP_WIN_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)");; - - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_DLL = OutdatedDynamicCrt("msvcr100.dll", R"(msvcr100\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100D_DLL = OutdatedDynamicCrt("msvcr100d.dll", R"(msvcr100d\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_CLR0400_DLL = OutdatedDynamicCrt("msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR110_DLL = OutdatedDynamicCrt("msvcr110.dll", R"(msvcr110\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_DLL = OutdatedDynamicCrt("msvcr120.dll", R"(msvcr120\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_CLR0400_DLL = OutdatedDynamicCrt("msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT_DLL = OutdatedDynamicCrt("msvcrt.dll", R"(msvcrt\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT20_DLL = OutdatedDynamicCrt("msvcrt20.dll", R"(msvcrt20\.dll)");; - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT40_DLL = OutdatedDynamicCrt("msvcrt40.dll", R"(msvcrt40\.dll)");; - - std::regex OutdatedDynamicCrt::crt_regex() const - { - const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); - return r; - } - - const std::string& OutdatedDynamicCrt::toString() const - { - return this->m_dll_name; - } -} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index d002f8d5f7..2a651e294a 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -154,7 +154,6 @@ - @@ -214,7 +213,6 @@ - diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 3359d9ada8..99cbf7037b 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -165,9 +165,6 @@ Source Files - - Source Files - Source Files @@ -293,8 +290,5 @@ Header Files - - Header Files - \ No newline at end of file From e1aea256b84d2c1ac5c29db0e5e40ed536e3157f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Feb 2017 02:07:53 -0800 Subject: [PATCH 291/561] Fix variable name and guard against 0 instances --- scripts/findVisualStudioInstallationInstances.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 260ee73fe1..951975758c 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -25,8 +25,9 @@ if (!(Test-Path $SetupConsoleExe)) $instances = & $SetupConsoleExe -nologo -value InstallationPath 2>&1 $instanceCount = $instances.Length + # The last item can be empty -if ($instances[$entryCount - 1] -eq "") +if ($instanceCount -gt 0 -and $instances[$instanceCount - 1] -eq "") { $instances = $instances[0..($instanceCount - 2)] } From 8c6320916711e5ac77ef16f17ab5c6a09737939e Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 8 Feb 2017 11:12:18 +0100 Subject: [PATCH 292/561] Updated msmpi version to 8.0 & implemented checks for installed redistributable packages --- ports/msmpi/CONTROL | 2 +- ports/msmpi/portfile.cmake | 110 ++++++++++++++++++++++--------------- 2 files changed, 67 insertions(+), 45 deletions(-) diff --git a/ports/msmpi/CONTROL b/ports/msmpi/CONTROL index 3d55547a29..44752712a8 100644 --- a/ports/msmpi/CONTROL +++ b/ports/msmpi/CONTROL @@ -1,3 +1,3 @@ Source: msmpi -Version: 7.1 +Version: 8.0 Description: Microsoft MPI diff --git a/ports/msmpi/portfile.cmake b/ports/msmpi/portfile.cmake index 9fc169a286..b59a2f590b 100644 --- a/ports/msmpi/portfile.cmake +++ b/ports/msmpi/portfile.cmake @@ -1,19 +1,54 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/msmpi-7.1) - -vcpkg_find_acquire_program(7Z) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/msmpi-8.0) vcpkg_download_distfile(SDK_ARCHIVE - URLS "https://download.microsoft.com/download/E/8/A/E8A080AF-040D-43FF-97B4-065D4F220301/msmpisdk.msi" - FILENAME "msmpisdk-7.1.msi" - SHA512 e3b479189e0effc83c030c74ac6e6762f577cfa94bffb2b35192aab3329b5cfad7933c353c0304754e6b097912b81dbfd4d4b52a5fe5563bd4f3578cd1cf71d7 -) -vcpkg_download_distfile(REDIST_ARCHIVE - URLS "https://download.microsoft.com/download/E/8/A/E8A080AF-040D-43FF-97B4-065D4F220301/MSMpiSetup.exe" - FILENAME "MSMpiSetup-7.1.exe" - SHA512 f75c448e49b1ab4f5e60c958f0c7c1766e06665d65d2bdec42578aa77fb9d5fdc0215cee6ec51909e77d13451490bfff1c324bf9eb4311cb886b98a6ad469a2d + URLS "https://download.microsoft.com/download/B/2/E/B2EB83FE-98C2-4156-834A-E1711E6884FB/msmpisdk.msi" + FILENAME "msmpisdk-8.0.msi" + SHA512 49c762873ba777ccb3c959a1d2ca1392e4c3c8d366e604ad707184ea432302e6649894ec6599162d0d40f3e6ebc0dada1eb9ca0da1cde0f6ba7a9b1847dac8c0 ) +# Check for correct version of installed redistributable package +set(SYSTEM_MPIEXEC_FILEPATH "$ENV{PROGRAMFILES}/Microsoft MPI/Bin/mpiexec.exe") +set(MSMPI_EXPECTED_FULL_VERSION "8.0.12438.0") + +if(EXISTS ${SYSTEM_MPIEXEC_FILEPATH}) + set(MPIEXEC_VERSION_LOGNAME "mpiexec-version") + vcpkg_execute_required_process( + COMMAND ${SYSTEM_MPIEXEC_FILEPATH} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} + LOGNAME ${MPIEXEC_VERSION_LOGNAME} + ) + file(READ ${CURRENT_BUILDTREES_DIR}/${MPIEXEC_VERSION_LOGNAME}-out.log MPIEXEC_OUTPUT) + + if(${MPIEXEC_OUTPUT} MATCHES "\\[Version ([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)\\]") + if(NOT ${CMAKE_MATCH_1} STREQUAL ${MSMPI_EXPECTED_FULL_VERSION}) + message(FATAL_ERROR + " The version of the installed MSMPI redistributable packages does not match the version to be installed\n" + " Expected version: ${MSMPI_EXPECTED_FULL_VERSION}\n" + " Found version: ${CMAKE_MATCH_1}\n") + endif() + else() + message(FATAL_ERROR + " Could not determine installed MSMPI redistributable package version.\n" + " See logs for more information:\n" + " ${CURRENT_BUILDTREES_DIR}\\${MPIEXEC_VERSION_LOGNAME}-out.log\n" + " ${CURRENT_BUILDTREES_DIR}\\${MPIEXEC_VERSION_LOGNAME}-err.log\n") + endif() +else() + vcpkg_download_distfile(REDIST_ARCHIVE + URLS "https://download.microsoft.com/download/B/2/E/B2EB83FE-98C2-4156-834A-E1711E6884FB/MSMpiSetup.exe" + FILENAME "MSMpiSetup-8.0.exe" + SHA512 f5271255817f5417de8e432cd21e5ff3c617911a30b7777560c0ceb6f4031ace5fa88fc7675759ae0964bcf4e2076fe367a06c129f3a9ad06871a08bf95ed68b + ) + + message(FATAL_ERROR + " Could not find:\n" + " ${SYSTEM_MPIEXEC_FILEPATH}\n" + " Please install the MSMPI redistributable package before trying to install this port.\n" + " The appropriate installer has been downloaded to:\n" + " ${REDIST_ARCHIVE}\n") +endif() + file(TO_NATIVE_PATH "${SDK_ARCHIVE}" SDK_ARCHIVE) file(TO_NATIVE_PATH "${SOURCE_PATH}/sdk" SDK_SOURCE_DIR) @@ -23,30 +58,23 @@ vcpkg_execute_required_process( LOGNAME extract-sdk ) -vcpkg_execute_required_process( - COMMAND ${7Z} e -o${SOURCE_PATH}/redist -aoa ${REDIST_ARCHIVE} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} - LOGNAME extract-redist -) - set(SOURCE_INCLUDE_PATH "${SOURCE_PATH}/sdk/PFiles/Microsoft SDKs/MPI/Include") set(SOURCE_LIB_PATH "${SOURCE_PATH}/sdk/PFiles/Microsoft SDKs/MPI/Lib") -set(SOURCE_BIN_PATH "${SOURCE_PATH}/redist") # Install include files file(INSTALL "${SOURCE_INCLUDE_PATH}/mpi.h" "${SOURCE_INCLUDE_PATH}/mpif.h" "${SOURCE_INCLUDE_PATH}/mpi.f90" + "${SOURCE_INCLUDE_PATH}/mpio.h" + "${SOURCE_INCLUDE_PATH}/mspms.h" + "${SOURCE_INCLUDE_PATH}/pmidbg.h" "${SOURCE_INCLUDE_PATH}/${TRIPLET_SYSTEM_ARCH}/mpifptr.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include ) -# NOTE: we do not install the dlls here since they are not architecture independent (x86 only) -# and they seam not to be required by neither mpiexec nor programs build against msmpi.lib - -# Install release libraries and tools +# Install release libraries file(INSTALL "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpi.lib" "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifec.lib" @@ -54,12 +82,14 @@ file(INSTALL DESTINATION ${CURRENT_PACKAGES_DIR}/lib ) -# file(INSTALL -# "${SOURCE_BIN_PATH}/msmpi.dll" -# "${SOURCE_BIN_PATH}/msmpires.dll" -# DESTINATION -# ${CURRENT_PACKAGES_DIR}/bin -# ) +if(${TRIPLET_SYSTEM_ARCH} STREQUAL "x86") + file(INSTALL + "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifes.lib" + "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifms.lib" + DESTINATION + ${CURRENT_PACKAGES_DIR}/lib + ) +endif() # Install debug libraries # NOTE: since the binary distribution does not include any debug libraries we simply install the release libraries @@ -70,22 +100,14 @@ file(INSTALL DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib ) -# file(INSTALL -# "${SOURCE_BIN_PATH}/msmpi.dll" -# "${SOURCE_BIN_PATH}/msmpires.dll" -# DESTINATION -# ${CURRENT_PACKAGES_DIR}/debug/bin -# ) - -# Install tools -file(INSTALL - "${SOURCE_BIN_PATH}/mpiexec.exe" - "${SOURCE_BIN_PATH}/msmpilaunchsvc.exe" - "${SOURCE_BIN_PATH}/smpd.exe" - "${SOURCE_BIN_PATH}/mpitrace.man" - DESTINATION - ${CURRENT_PACKAGES_DIR}/tools -) +if(${TRIPLET_SYSTEM_ARCH} STREQUAL "x86") + file(INSTALL + "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifes.lib" + "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifms.lib" + DESTINATION + ${CURRENT_PACKAGES_DIR}/debug/lib + ) +endif() # Handle copyright file(COPY "${SOURCE_PATH}/sdk/PFiles/Microsoft SDKs/MPI/License/license_sdk.rtf" DESTINATION ${CURRENT_PACKAGES_DIR}/share/msmpi) From 5e588ddb5be9e6e27cebcc3be2e1a27f3ca83a50 Mon Sep 17 00:00:00 2001 From: Oleksii Mandrychenko Date: Wed, 8 Feb 2017 19:11:00 +0000 Subject: [PATCH 293/561] Improved formatting of doc/EXAMPLES.md - added "./" so that commands can be copy-pasted into the PowerShel --- docs/EXAMPLES.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/EXAMPLES.md b/docs/EXAMPLES.md index d991d87f93..f67ce3313c 100644 --- a/docs/EXAMPLES.md +++ b/docs/EXAMPLES.md @@ -3,7 +3,7 @@ ## Overview Vcpkg helps you get C and C++ libraries on Windows. -For short description of available commands, run `vcpkg help`. +For short description of available commands, run `./vcpkg help`. ## Table of Contents - Example 1: Using the C++ REST SDK @@ -87,7 +87,7 @@ To install for other architectures and platforms such as Universal Windows Platf PS D:\src\vcpkg> .\vcpkg install cpprestsdk:x86-uwp zlib:x64-windows ``` -See `vcpkg help triplet` for all supported targets. +See `.\vcpkg help triplet` for all supported targets. ### Step 2: Use @@ -105,7 +105,7 @@ Installing new libraries will make them instantly available. ``` *Note: You will need to restart Visual Studio or perform a Build to update intellisense with the changes.* -To remove the integration for your user, you can use `vcpkg integrate remove`. +To remove the integration for your user, you can use `./vcpkg integrate remove`. #### Option B: CMake (Toolchain File) From a9f7fc6e90feaad50c1221ef9bd56e2620302215 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Feb 2017 12:36:32 -0800 Subject: [PATCH 294/561] Make regex for OutdatedDyanmicCRTs case insensitive --- toolsrc/src/PostBuildLint.cpp | 37 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 7986d913a9..90bd558435 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -20,29 +20,32 @@ namespace vcpkg::PostBuildLint { std::string name; std::regex regex; + + OutdatedDynamicCrt(const std::string& name, const std::string& regex_as_string) + : name(name), regex(std::regex(regex_as_string, std::regex_constants::icase)) {} }; const std::vector& get_outdated_dynamic_crts() { static const std::vector v = { - {"msvcp100.dll", std::regex(R"(msvcp100\.dll)")}, - {"msvcp100d.dll", std::regex(R"(msvcp100d\.dll)")}, - {"msvcp110.dll", std::regex(R"(msvcp110\.dll)")}, - {"msvcp110_win.dll", std::regex(R"(msvcp110_win\.dll)")}, - {"msvcp120.dll", std::regex(R"(msvcp120\.dll)")}, - {"msvcp120_clr0400.dll", std::regex(R"(msvcp120_clr0400\.dll)")}, - {"msvcp60.dll", std::regex(R"(msvcp60\.dll)")}, - {"msvcp60.dll", std::regex(R"(msvcp60\.dll)")}, + {"msvcp100.dll", R"(msvcp100\.dll)"}, + {"msvcp100d.dll", R"(msvcp100d\.dll)"}, + {"msvcp110.dll", R"(msvcp110\.dll)"}, + {"msvcp110_win.dll", R"(msvcp110_win\.dll)"}, + {"msvcp120.dll", R"(msvcp120\.dll)"}, + {"msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"}, + {"msvcp60.dll", R"(msvcp60\.dll)"}, + {"msvcp60.dll", R"(msvcp60\.dll)"}, - {"msvcr100.dll", std::regex(R"(msvcr100\.dll)")}, - {"msvcr100d.dll", std::regex(R"(msvcr100d\.dll)")}, - {"msvcr100_clr0400.dll", std::regex(R"(msvcr100_clr0400\.dll)")}, - {"msvcr110.dll", std::regex(R"(msvcr110\.dll)")}, - {"msvcr120.dll", std::regex(R"(msvcr120\.dll)")}, - {"msvcr120_clr0400.dll", std::regex(R"(msvcr120_clr0400\.dll)")}, - {"msvcrt.dll", std::regex(R"(msvcrt\.dll)")}, - {"msvcrt20.dll", std::regex(R"(msvcrt20\.dll)")}, - {"msvcrt40.dll", std::regex(R"(msvcrt40\.dll)")} + {"msvcr100.dll", R"(msvcr100\.dll)"}, + {"msvcr100d.dll", R"(msvcr100d\.dll)"}, + {"msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"}, + {"msvcr110.dll", R"(msvcr110\.dll)"}, + {"msvcr120.dll", R"(msvcr120\.dll)"}, + {"msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"}, + {"msvcrt.dll", R"(msvcrt\.dll)"}, + {"msvcrt20.dll", R"(msvcrt20\.dll)"}, + {"msvcrt40.dll", R"(msvcrt40\.dll)"} }; return v; From 7cba4eb1a5c458a0c3a716c2808a7a8318a40005 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 8 Feb 2017 15:14:29 -0800 Subject: [PATCH 295/561] [examples] Replace ./ with .\ to preserve copy-paste into cmd. --- docs/EXAMPLES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/EXAMPLES.md b/docs/EXAMPLES.md index b6a219b4f7..1a2bacc994 100644 --- a/docs/EXAMPLES.md +++ b/docs/EXAMPLES.md @@ -3,7 +3,7 @@ ## Overview Vcpkg helps you get C and C++ libraries on Windows. -For short description of available commands, run `./vcpkg help`. +For short description of available commands, run `.\vcpkg help`. ## Table of Contents - Example 1: Using Sqlite From 81dd967f0d2e150d028b23ac6953afb58d531218 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Feb 2017 16:01:22 -0800 Subject: [PATCH 296/561] Fix warning about default constructor --- toolsrc/src/PostBuildLint.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 90bd558435..37db0b8b63 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -546,6 +546,8 @@ namespace vcpkg::PostBuildLint { fs::path file; OutdatedDynamicCrt outdated_crt; + + OutdatedDynamicCrt_and_file() = delete; }; static lint_status check_outdated_crt_linkage_of_dlls(const std::vector& dlls, const fs::path dumpbin_exe) From 52ebf3944d1a0aa276472f50e47de9fa61429a7c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Feb 2017 16:13:27 -0800 Subject: [PATCH 297/561] Format --- toolsrc/src/PostBuildLint.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 37db0b8b63..ac33969840 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -22,7 +22,8 @@ namespace vcpkg::PostBuildLint std::regex regex; OutdatedDynamicCrt(const std::string& name, const std::string& regex_as_string) - : name(name), regex(std::regex(regex_as_string, std::regex_constants::icase)) {} + : name(name), + regex(std::regex(regex_as_string, std::regex_constants::icase)) {} }; const std::vector& get_outdated_dynamic_crts() From 8316692e32380528dfa381329f516a121bd6b533 Mon Sep 17 00:00:00 2001 From: Felix Huang Date: Wed, 8 Feb 2017 16:39:16 -0800 Subject: [PATCH 298/561] [libraw] update to version 0.18.0 --- ports/libraw/CONTROL | 2 +- ports/libraw/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/libraw/CONTROL b/ports/libraw/CONTROL index b10e10794d..9bb52aae0e 100644 --- a/ports/libraw/CONTROL +++ b/ports/libraw/CONTROL @@ -1,4 +1,4 @@ Source: libraw -Version: 0.17.2-2 +Version: 0.18.0-1 Build-Depends: libjpeg-turbo Description: raw image decoder library diff --git a/ports/libraw/portfile.cmake b/ports/libraw/portfile.cmake index 159251c280..2e25ec714a 100644 --- a/ports/libraw/portfile.cmake +++ b/ports/libraw/portfile.cmake @@ -1,9 +1,9 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/LibRaw-0.17.2) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/LibRaw-0.18.0) vcpkg_download_distfile(ARCHIVE - URLS "http://www.libraw.org/data/LibRaw-0.17.2.zip" - FILENAME "LibRaw-0.17.2" - SHA512 97d34c84dafdcad300d607fbd4df7b120aea1ecdbc2783a8616bc423fa6a7a15adfbeb975f8dab021be09d08ef466c401a3b65bfd1abcfa49d31d4ab91873e60 + URLS "http://www.libraw.org/data/LibRaw-0.18.0.zip" + FILENAME "LibRaw-0.18.0.zip" + SHA512 c66ae2331caffe18c2835d76d6106052125fab2f549a6f06687b4c1fedaae1c46ee0e4ae4c23b0480976870d76e8cfdbb91dd3cf11e3433ccc070bf03c538bb1 ) set(LIBRAW_CMAKE_COMMIT "a71f3b83ee3dccd7be32f9a2f410df4d9bdbde0a") set(LIBRAW_CMAKE_SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/LibRaw-cmake-${LIBRAW_CMAKE_COMMIT}) From 116b1b8c66afbe11719c42d03d342bb6fe5d58b0 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 8 Feb 2017 17:39:31 -0800 Subject: [PATCH 299/561] Reorder path alterations to generally append instead of prepend. This solves the issue where some software bundles (git) provide multiple executables in the same folder, which can override other desired programs (link.exe). --- ports/libjpeg-turbo/portfile.cmake | 2 +- ports/mpg123/portfile.cmake | 2 +- ports/openssl/portfile-uwp.cmake | 2 +- ports/openssl/portfile.cmake | 2 +- ports/qca/portfile.cmake | 2 +- ports/qt5/portfile.cmake | 2 +- scripts/cmake/vcpkg_configure_cmake.cmake | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/libjpeg-turbo/portfile.cmake b/ports/libjpeg-turbo/portfile.cmake index aaa01547c5..b58ba01ede 100644 --- a/ports/libjpeg-turbo/portfile.cmake +++ b/ports/libjpeg-turbo/portfile.cmake @@ -14,7 +14,7 @@ vcpkg_apply_patches( vcpkg_find_acquire_program(NASM) get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) -set(ENV{PATH} "${NASM_EXE_PATH};$ENV{PATH}") +set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}") if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) set(BUILD_STATIC OFF) diff --git a/ports/mpg123/portfile.cmake b/ports/mpg123/portfile.cmake index 0308bb17e8..76b69c48b3 100644 --- a/ports/mpg123/portfile.cmake +++ b/ports/mpg123/portfile.cmake @@ -13,7 +13,7 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_find_acquire_program(YASM) get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) -set(ENV{PATH} "${YASM_EXE_PATH};$ENV{PATH}") +set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH}") vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} diff --git a/ports/openssl/portfile-uwp.cmake b/ports/openssl/portfile-uwp.cmake index 289c549fc3..cf2f1e7ca0 100644 --- a/ports/openssl/portfile-uwp.cmake +++ b/ports/openssl/portfile-uwp.cmake @@ -30,7 +30,7 @@ set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-OpenSSL_1_0_2k_WinRT) vcpkg_find_acquire_program(PERL) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) -set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") +set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}") vcpkg_download_distfile(ARCHIVE URLS "https://github.com/Microsoft/openssl/archive/OpenSSL_1_0_2k_WinRT.zip" diff --git a/ports/openssl/portfile.cmake b/ports/openssl/portfile.cmake index b132581198..0422789431 100644 --- a/ports/openssl/portfile.cmake +++ b/ports/openssl/portfile.cmake @@ -10,7 +10,7 @@ vcpkg_find_acquire_program(PERL) find_program(NMAKE nmake) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) -set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") +set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}") vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" diff --git a/ports/qca/portfile.cmake b/ports/qca/portfile.cmake index 072c4b7cb4..6ad35d1f77 100644 --- a/ports/qca/portfile.cmake +++ b/ports/qca/portfile.cmake @@ -15,7 +15,7 @@ include(vcpkg_common_functions) find_program(GIT git) vcpkg_find_acquire_program(PERL) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) -set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") +set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}") # Set git variables to qca version 2.2.0 commit set(GIT_URL "git://anongit.kde.org/qca.git") diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 2b337df02b..df17621f18 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -12,7 +12,7 @@ vcpkg_find_acquire_program(PYTHON3) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY) -set(ENV{PATH} "${JOM_EXE_PATH};${PYTHON3_EXE_PATH};${PERL_EXE_PATH};$ENV{PATH}") +set(ENV{PATH} "${JOM_EXE_PATH};${PYTHON3_EXE_PATH};$ENV{PATH};${PERL_EXE_PATH}") set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}") set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;$ENV{LIB}") vcpkg_download_distfile(ARCHIVE_FILE diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 42570226fc..85a67a4019 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -40,7 +40,7 @@ function(vcpkg_configure_cmake) if(GENERATOR STREQUAL "Ninja") vcpkg_find_acquire_program(NINJA) get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) - set(ENV{PATH} "${NINJA_PATH};$ENV{PATH}") + set(ENV{PATH} "$ENV{PATH};${NINJA_PATH}") endif() file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) From 6af35363b8c9c768fe6c298605b1647a522229b2 Mon Sep 17 00:00:00 2001 From: Christopher Warrington Date: Wed, 8 Feb 2017 19:34:55 -0800 Subject: [PATCH 300/561] Upgrade Bond to 5.2.0 * Make Bond always build as a static lib. * Bond's CMake currently isn't written to be able to produce DLLs. There's a special dllimport/dllexport dance that would need to be done. * Apply patch so that Bond doesn't force Boost static libs. * Apply patch to omit installing Bond's copy of rapidjson. * Clean up empty bin/ directories, now that vcpkg is more strict. --- ports/bond/0001_boost_static_libs.patch | 23 +++++++++++++++ ports/bond/0002_omit_rapidjson.patch | 12 ++++++++ ports/bond/CONTROL | 2 +- ports/bond/portfile.cmake | 37 +++++++++++++++++-------- 4 files changed, 61 insertions(+), 13 deletions(-) create mode 100644 ports/bond/0001_boost_static_libs.patch create mode 100644 ports/bond/0002_omit_rapidjson.patch diff --git a/ports/bond/0001_boost_static_libs.patch b/ports/bond/0001_boost_static_libs.patch new file mode 100644 index 0000000000..cc712b6c7b --- /dev/null +++ b/ports/bond/0001_boost_static_libs.patch @@ -0,0 +1,23 @@ +diff --git a/cmake/Config.cmake b/cmake/Config.cmake +index ed225d14..1573c915 100644 +--- a/cmake/Config.cmake ++++ b/cmake/Config.cmake +@@ -19,7 +19,7 @@ if (MSVC) + # disable MSVC warnings + add_compile_options (/bigobj /FIbond/core/warning.h /W4 /WX) + add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS) +- set (Boost_USE_STATIC_LIBS ON) ++ set (Boost_USE_STATIC_LIBS OFF) + endif (MSVC) + + if (WIN32) +@@ -90,9 +90,6 @@ if (DEFINED ENV{APPVEYOR} AND ("$ENV{BOND_BUILD}" STREQUAL "C++")) + endif() + endif() + +-# disable Boost auto-linking +-add_definitions (-DBOOST_ALL_NO_LIB) +- + # VS2015U2 fixed a bug with atomics and emits a warning without this definition. + add_definitions (-D_ENABLE_ATOMIC_ALIGNMENT_FIX) + diff --git a/ports/bond/0002_omit_rapidjson.patch b/ports/bond/0002_omit_rapidjson.patch new file mode 100644 index 0000000000..3e4a0571b3 --- /dev/null +++ b/ports/bond/0002_omit_rapidjson.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0d743da4..92f91103 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -39,7 +39,6 @@ install (DIRECTORY + cpp/inc/bond + cpp/generated/bond + python/inc/bond +- thirdparty/rapidjson/include/rapidjson + DESTINATION include + PATTERN *.cpp EXCLUDE) + diff --git a/ports/bond/CONTROL b/ports/bond/CONTROL index 70384f0200..0e804025ab 100644 --- a/ports/bond/CONTROL +++ b/ports/bond/CONTROL @@ -1,5 +1,5 @@ Source: bond Maintainer: bond@microsoft.com -Version: 5.0.0-4-g53ea136 +Version: 5.2.0 Description: Bond is a cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services. Build-Depends: boost, rapidjson diff --git a/ports/bond/portfile.cmake b/ports/bond/portfile.cmake index 8dbf7cf535..0225a263fb 100644 --- a/ports/bond/portfile.cmake +++ b/ports/bond/portfile.cmake @@ -1,16 +1,29 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) +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) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/bond-53ea13692925bee4ba494ee9de3614f15c09d85d) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/bond-5.2.0) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/Microsoft/bond/archive/53ea13692925bee4ba494ee9de3614f15c09d85d.zip" - FILENAME "bond-5.0.0-4-g53ea136.zip" - SHA512 fe39dc211f6b99cba3f2284d78a524305dfb8dcd1f597639c45625df369f96c3321cb6782fef9eb34d34fab69c8da9015024eee34be6d0a76d730729517183da -) + URLS "https://github.com/Microsoft/bond/archive/5.2.0.zip" + FILENAME "bond-5.2.0.zip" + SHA512 bc533d9e7431d0690b555aa4a42ca947f8025fc388f698c40cfeacf4286892ac5fd86d93df187009d4791e3eae240eb60886947cfe600838c6058274eb4d625c + ) + vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + # Change Boost_USE_STATIC_LIBS to be compatible with vcpkg's treatment + # of Boost + ${CMAKE_CURRENT_LIST_DIR}/0001_boost_static_libs.patch + # Don't install rapidjson from the (empty) submodule. With vcpkg, we get + # rapidjson from vcpkg + ${CMAKE_CURRENT_LIST_DIR}/0002_omit_rapidjson.patch +) + # To build Bond, you'll either need to have the Haskell toolchain installed # or set the environment variable BOND_GBC_PATH to point to a directory that # contains a pre-compiled version of gbc.exe. @@ -35,10 +48,10 @@ file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/bond) file(RENAME ${CURRENT_PACKAGES_DIR}/share/bond/LICENSE ${CURRENT_PACKAGES_DIR}/share/bond/copyright) # vcpkg doesn't--as of version 0.0.30--like executables such as gbc.exe in -# the output. Just delete it for now. -file(REMOVE - ${CURRENT_PACKAGES_DIR}/bin/gbc.exe - ${CURRENT_PACKAGES_DIR}/debug/bin/gbc.exe) +# the output. Just delete the bin/ directories for now. +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/bin/ + ${CURRENT_PACKAGES_DIR}/debug/bin/) # There's no way to supress installation of the headers in the debug build, # so we just delete them. From bef39cd24f44314936d416d577a1650411d84e24 Mon Sep 17 00:00:00 2001 From: Christopher Warrington Date: Wed, 8 Feb 2017 19:35:04 -0800 Subject: [PATCH 301/561] Fetch a pre-compiled gbc from GitHub The BOND_GBC_PATH environment variable is no longer consulted, and the Haskell toolchain will _not_ be used even if it exists. At the moment, the downloaded gbc is amd64 only. --- ports/bond/portfile.cmake | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/ports/bond/portfile.cmake b/ports/bond/portfile.cmake index 0225a263fb..ca9ff156b0 100644 --- a/ports/bond/portfile.cmake +++ b/ports/bond/portfile.cmake @@ -5,14 +5,28 @@ endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/bond-5.2.0) + vcpkg_download_distfile(ARCHIVE URLS "https://github.com/Microsoft/bond/archive/5.2.0.zip" FILENAME "bond-5.2.0.zip" SHA512 bc533d9e7431d0690b555aa4a42ca947f8025fc388f698c40cfeacf4286892ac5fd86d93df187009d4791e3eae240eb60886947cfe600838c6058274eb4d625c - ) +) +vcpkg_download_distfile(GBC_ARCHIVE + URLS "https://github.com/Microsoft/bond/releases/download/5.2.0/gbc-5.2.0-amd64.zip" + FILENAME "gbc-5.2.0-amd64.zip" + SHA512 9413c0035939788724e08ac858bfc3b2ccefbba74ed737b22eca35ec0da576aa2bf8403e606d2ac20b3fbc827933c289630266824613e04b1921b66fef00e132 +) vcpkg_extract_source_archive(${ARCHIVE}) +# Extract the precompiled gbc +vcpkg_extract_source_archive(${GBC_ARCHIVE} ${CURRENT_BUILDTREES_DIR}/tools/) +set(FETCHED_GBC_PATH ${CURRENT_BUILDTREES_DIR}/tools/gbc-5.2.0-amd64.exe) + +if (NOT EXISTS ${FETCHED_GBC_PATH}) + message(FATAL_ERROR "Fetching GBC failed. Expected '${FETCHED_GBC_PATH}' to exists, but it doesn't.") +endif() + vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES @@ -24,21 +38,11 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/0002_omit_rapidjson.patch ) -# To build Bond, you'll either need to have the Haskell toolchain installed -# or set the environment variable BOND_GBC_PATH to point to a directory that -# contains a pre-compiled version of gbc.exe. -# -# You can get a pre-compiled version of gbc from the Bond.Compiler NuGet -# package . -# -# For instructions on installing the Haskell toolchain and getting it to -# work with Bond, see the Bond README -# - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DBOND_LIBRARIES_ONLY=TRUE + -DBOND_GBC_PATH=${FETCHED_GBC_PATH} ) vcpkg_install_cmake() From cd44f885732a35f1ae9c35d1248a335c0c6ac917 Mon Sep 17 00:00:00 2001 From: Christopher Warrington Date: Wed, 8 Feb 2017 19:35:08 -0800 Subject: [PATCH 302/561] Install gbc.exe to tools/ This at least allows people to write their own codegen rules until Bond includes its own. --- .../bond/0003_rename_gbc_during_install.patch | 22 +++++++++++++++++++ ports/bond/portfile.cmake | 6 +++++ 2 files changed, 28 insertions(+) create mode 100644 ports/bond/0003_rename_gbc_during_install.patch diff --git a/ports/bond/0003_rename_gbc_during_install.patch b/ports/bond/0003_rename_gbc_during_install.patch new file mode 100644 index 0000000000..edbce6c0a8 --- /dev/null +++ b/ports/bond/0003_rename_gbc_during_install.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0d743da4..72d62c5e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -49,7 +49,14 @@ install (EXPORT bond + + # if BOND_GBC_PATH is set we must copy over that gbc to the install location + if (BOND_GBC_PATH) +- install (FILES +- ${BOND_GBC_PATH} +- DESTINATION bin) ++ if (WIN32) ++ set(INSTALLED_GBC_NAME gbc.exe) ++ else() ++ set(INSTALLED_GBC_NAME gbc) ++ endif() ++ ++ install ( ++ FILES ${BOND_GBC_PATH} ++ DESTINATION bin ++ RENAME ${INSTALLED_GBC_NAME}) + endif() diff --git a/ports/bond/portfile.cmake b/ports/bond/portfile.cmake index ca9ff156b0..d806173f13 100644 --- a/ports/bond/portfile.cmake +++ b/ports/bond/portfile.cmake @@ -36,6 +36,9 @@ vcpkg_apply_patches( # Don't install rapidjson from the (empty) submodule. With vcpkg, we get # rapidjson from vcpkg ${CMAKE_CURRENT_LIST_DIR}/0002_omit_rapidjson.patch + # Temporary until this is committed upstream. See + # https://github.com/Microsoft/bond/pull/324 for details. + ${CMAKE_CURRENT_LIST_DIR}/0003_rename_gbc_during_install.patch ) vcpkg_configure_cmake( @@ -51,6 +54,9 @@ vcpkg_install_cmake() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/bond) file(RENAME ${CURRENT_PACKAGES_DIR}/share/bond/LICENSE ${CURRENT_PACKAGES_DIR}/share/bond/copyright) +# Drop a copy of gbc in tools/ so that it can be used +file(COPY ${CURRENT_PACKAGES_DIR}/bin/gbc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/) + # vcpkg doesn't--as of version 0.0.30--like executables such as gbc.exe in # the output. Just delete the bin/ directories for now. file(REMOVE_RECURSE From b6b69025c3c5d64f73faa3445fa3f17c967a8337 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Feb 2017 19:34:19 -0800 Subject: [PATCH 303/561] bootstrap.ps1 now detects the available Windows SDKs --- scripts/bootstrap.ps1 | 3 +- scripts/findTargetPlatformVersion.ps1 | 43 +++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 scripts/findTargetPlatformVersion.ps1 diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 98ccb40ad7..9907e31fbc 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -26,7 +26,8 @@ try{ $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $msbuildExe = $msbuildExeWithPlatformToolset[0] $platformToolset = $msbuildExeWithPlatformToolset[1] - & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /m dirs.proj + $targetPlatformVersion = & $scriptsDir\findTargetPlatformVersion.ps1 + & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /p:TargetPlatformVersion=$targetPlatformVersion /m dirs.proj Write-Verbose("Placing vcpkg.exe in the correct location") diff --git a/scripts/findTargetPlatformVersion.ps1 b/scripts/findTargetPlatformVersion.ps1 new file mode 100644 index 0000000000..5bc6cf854a --- /dev/null +++ b/scripts/findTargetPlatformVersion.ps1 @@ -0,0 +1,43 @@ +[CmdletBinding()] +param( + +) + +Import-Module BitsTransfer + +$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition +$CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}" + +# Windows 10 SDK +foreach ($ProgramFiles in $CandidateProgramFiles) +{ + $folder = "$ProgramFiles\Windows Kits\10\Include" + if (!(Test-Path $folder)) + { + continue + } + + $win10sdkVersions = Get-ChildItem $folder | Where-Object {$_.Name -match "^10"} | Sort-Object + $win10sdkVersionCount = $win10sdkVersions.Length + + if ($win10sdkVersionCount -eq 0) + { + continue + } + + return $win10sdkVersions[$win10sdkVersionCount - 1].ToString() +} + + + +# Windows 8.1 SDK +foreach ($ProgramFiles in $CandidateProgramFiles) +{ + $folder = "$ProgramFiles\Windows Kits\8.1\Include" + if (Test-Path $folder) + { + return "8.1" + } +} + +throw "Could not detect a Windows SDK / TargetPlatformVersion" \ No newline at end of file From fb080f38cb1bd673eaef9a56ca5056960e44e60e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Feb 2017 22:28:54 -0800 Subject: [PATCH 304/561] Remove unnecessary $(PlatformToolset) condition --- toolsrc/vcpkg/vcpkg.vcxproj | 2 +- toolsrc/vcpkglib/vcpkglib.vcxproj | 2 +- toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj | 2 +- toolsrc/vcpkgtest/vcpkgtest.vcxproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index c91bc2a751..fd8e5d33e1 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -22,7 +22,7 @@ {34671B80-54F9-46F5-8310-AC429C11D4FB} vcpkg 8.1 - v140 + v140 diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 2a651e294a..ad15ea7ea7 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -22,7 +22,7 @@ {B98C92B7-2874-4537-9D46-D14E5C237F04} vcpkglib 8.1 - v140 + v140 diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index b66b7fd9df..cce816ab04 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -22,7 +22,7 @@ {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE} vcpkgmetricsuploader 8.1 - v140 + v140 diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index 224500d829..c0a91ce50b 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -32,7 +32,7 @@ Win32Proj vcpkgtest 8.1 - v140 + v140 From 4f8e4af36321708ee0ac98a77cdc45926ad44a58 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Feb 2017 22:31:04 -0800 Subject: [PATCH 305/561] Remove unneeded Import-Module --- scripts/findTargetPlatformVersion.ps1 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/findTargetPlatformVersion.ps1 b/scripts/findTargetPlatformVersion.ps1 index 5bc6cf854a..e9d676724a 100644 --- a/scripts/findTargetPlatformVersion.ps1 +++ b/scripts/findTargetPlatformVersion.ps1 @@ -3,8 +3,6 @@ param( ) -Import-Module BitsTransfer - $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}" @@ -28,8 +26,6 @@ foreach ($ProgramFiles in $CandidateProgramFiles) return $win10sdkVersions[$win10sdkVersionCount - 1].ToString() } - - # Windows 8.1 SDK foreach ($ProgramFiles in $CandidateProgramFiles) { From 5693ce8b4d4f522b1aeb270c2903ca07878597ae Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Feb 2017 23:15:27 -0800 Subject: [PATCH 306/561] [hdf5] Enable ninja option --- ports/hdf5/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/hdf5/portfile.cmake b/ports/hdf5/portfile.cmake index a09f758b67..5c421f0c61 100644 --- a/ports/hdf5/portfile.cmake +++ b/ports/hdf5/portfile.cmake @@ -17,6 +17,7 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA OPTIONS -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=1 -DBUILD_TESTING=OFF From 68255095226847ac9de011848f876c1df6f924ab Mon Sep 17 00:00:00 2001 From: Tobias Kohlbau Date: Thu, 9 Feb 2017 08:46:46 +0100 Subject: [PATCH 307/561] [opencv] bump to 3.2.0 Signed-off-by: Tobias Kohlbau --- ports/opencv/CONTROL | 2 +- .../opencv/opencv-installation-options.patch | 101 +++++++----------- ports/opencv/portfile.cmake | 9 +- 3 files changed, 44 insertions(+), 68 deletions(-) diff --git a/ports/opencv/CONTROL b/ports/opencv/CONTROL index 74cf1d3bc5..0c9766079a 100644 --- a/ports/opencv/CONTROL +++ b/ports/opencv/CONTROL @@ -1,4 +1,4 @@ Source: opencv -Version: 3.1.0-1 +Version: 3.2.0 Build-Depends: zlib, libpng, libjpeg-turbo, tiff Description: computer vision library diff --git a/ports/opencv/opencv-installation-options.patch b/ports/opencv/opencv-installation-options.patch index 5803346340..cfb401836e 100644 --- a/ports/opencv/opencv-installation-options.patch +++ b/ports/opencv/opencv-installation-options.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3ee50ff..64b0405 100644 +index cc45f6f..b4265bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -250,6 +250,10 @@ OCV_OPTION(INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF ) +@@ -263,6 +263,10 @@ OCV_OPTION(INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF ) OCV_OPTION(INSTALL_ANDROID_EXAMPLES "Install Android examples" OFF IF ANDROID ) OCV_OPTION(INSTALL_TO_MANGLED_PATHS "Enables mangled install paths, that help with side by side installs." OFF IF (UNIX AND NOT ANDROID AND NOT APPLE_FRAMEWORK AND BUILD_SHARED_LIBS) ) OCV_OPTION(INSTALL_TESTS "Install accuracy and performance test binaries and test data" OFF) @@ -13,36 +13,18 @@ index 3ee50ff..64b0405 100644 # OpenCV build options # =================================================== -@@ -315,7 +319,9 @@ else() +@@ -330,7 +334,9 @@ else() endif() if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows) - if(DEFINED OpenCV_RUNTIME AND DEFINED OpenCV_ARCH) + if(DEFINED OpenCV_DISABLE_ARCH_PATH) -+ set(OpenCV_INSTALL_BINARIES_PREFIX "") ++ ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "") + elseif(DEFINED OpenCV_RUNTIME AND DEFINED OpenCV_ARCH) - set(OpenCV_INSTALL_BINARIES_PREFIX "${OpenCV_ARCH}/${OpenCV_RUNTIME}/") + ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "${OpenCV_ARCH}/${OpenCV_RUNTIME}/") else() message(STATUS "Can't detect runtime and/or arch") -@@ -379,7 +385,7 @@ else() - set(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}") - set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native) - set(OPENCV_JAR_INSTALL_PATH java) -- set(OPENCV_OTHER_INSTALL_PATH etc) -+ set(OPENCV_OTHER_INSTALL_PATH etc CACHE STRING "") - else() - set(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX}) - set(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}) -@@ -393,7 +399,7 @@ else() - if(LIB_SUFFIX AND NOT SIZEOF_VOID_P_BITS EQUAL LIB_SUFFIX) - set(OPENCV_CONFIG_INSTALL_PATH lib${LIB_SUFFIX}/cmake/opencv) - else() -- set(OPENCV_CONFIG_INSTALL_PATH share/OpenCV) -+ set(OPENCV_CONFIG_INSTALL_PATH share/OpenCV CACHE STRING "") - endif() - endif() - -@@ -734,7 +740,7 @@ if(NOT OPENCV_LICENSE_FILE) +@@ -784,7 +790,7 @@ if(NOT OPENCV_LICENSE_FILE) endif() # for UNIX it does not make sense as LICENSE and readme will be part of the package automatically @@ -50,29 +32,29 @@ index 3ee50ff..64b0405 100644 +if(ANDROID OR NOT UNIX AND INSTALL_LICENSE) install(FILES ${OPENCV_LICENSE_FILE} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT libs) + DESTINATION ./ COMPONENT libs) diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake -index dbfd7ca..8bfa448 100644 +index 206acfd..b4c223e 100644 --- a/cmake/OpenCVGenConfig.cmake +++ b/cmake/OpenCVGenConfig.cmake -@@ -103,7 +103,7 @@ set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_ - set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"") - set(OpenCV_3RDPARTY_LIB_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_3P_LIB_INSTALL_PATH}\"") +@@ -91,7 +91,7 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME) + endif() + endfunction() --if(UNIX) # ANDROID configuration is created here also -+if(UNIX OR INSTALL_FORCE_UNIX_PATHS) # ANDROID configuration is created here also - #http://www.vtk.org/Wiki/CMake/Tutorials/Packaging reference - # For a command "find_package( [major[.minor]] [EXACT] [REQUIRED|QUIET])" - # cmake will look in the following dir on unix: -@@ -127,7 +127,7 @@ endif() +-if(UNIX AND NOT ANDROID) ++if((UNIX AND NOT ANDROID) OR INSTALL_FORCE_UNIX_PATHS) + ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "" "") + endif() + +@@ -103,7 +103,7 @@ endif() # -------------------------------------------------------------------------------------------- # Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages # -------------------------------------------------------------------------------------------- -if(WIN32) +if(WIN32 AND NOT INSTALL_FORCE_UNIX_PATHS) - set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_CONFIG_PATH}/include\" \"\${OpenCV_CONFIG_PATH}/include/opencv\"") - set(OpenCV2_INCLUDE_DIRS_CONFIGCMAKE "\"\"") - + if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows) + if(BUILD_SHARED_LIBS) + set(_lib_suffix "lib") diff --git a/cmake/OpenCVGenHeaders.cmake b/cmake/OpenCVGenHeaders.cmake index 2988979..810871b 100644 --- a/cmake/OpenCVGenHeaders.cmake @@ -97,10 +79,10 @@ index 2988979..810871b 100644 + install(FILES "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp" DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 COMPONENT dev) +endif() diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake -index 3385385..530e53f 100644 +index 742a287..c8242dd 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake -@@ -879,7 +879,9 @@ macro(_ocv_create_module) +@@ -880,7 +880,9 @@ macro(_ocv_create_module) foreach(hdr ${OPENCV_MODULE_${m}_HEADERS}) string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}") if(NOT hdr2 MATCHES "opencv2/${m}/private.*" AND hdr2 MATCHES "^(opencv2/?.*)/[^/]+.h(..)?$" ) @@ -111,19 +93,6 @@ index 3385385..530e53f 100644 endif() endforeach() endif() -diff --git a/cmake/templates/OpenCVConfig.cmake.in b/cmake/templates/OpenCVConfig.cmake.in -index 80ffbaf..0585c9f 100644 ---- a/cmake/templates/OpenCVConfig.cmake.in -+++ b/cmake/templates/OpenCVConfig.cmake.in -@@ -112,7 +112,7 @@ set(OpenCV_USE_MANGLED_PATHS @OpenCV_USE_MANGLED_PATHS_CONFIGCMAKE@) - # Extract the directory where *this* file has been installed (determined at cmake run-time) - get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE) - --if(NOT WIN32 OR ANDROID) -+if(NOT WIN32 OR ANDROID OR "@INSTALL_FORCE_UNIX_PATHS@") - if(ANDROID) - set(OpenCV_INSTALL_PATH "${OpenCV_CONFIG_PATH}/../../..") - else() diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 1f0d720..86b9d89 100644 --- a/data/CMakeLists.txt @@ -142,19 +111,27 @@ index 1f0d720..86b9d89 100644 if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH) install(DIRECTORY "${OPENCV_TEST_DATA_PATH}/" DESTINATION "${OPENCV_TEST_DATA_INSTALL_PATH}" COMPONENT "tests") diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt -index b4e48e6..6ea20d6 100644 +index b4e48e6..d5ed455 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -1,7 +1,9 @@ -file(GLOB old_hdrs "opencv/*.h*") -install(FILES ${old_hdrs} -+if(INSTALL_HEADERS) -+ file(GLOB old_hdrs "opencv/*.h*") -+ install(FILES ${old_hdrs} - DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv - COMPONENT dev) +- DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv +- COMPONENT dev) -install(FILES "opencv2/opencv.hpp" -+ install(FILES "opencv2/opencv.hpp" - DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 - COMPONENT dev) +- DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 +- COMPONENT dev) ++if(INSTALL_HEADERS) ++ file(GLOB old_hdrs "opencv/*.h*") ++ install(FILES ${old_hdrs} ++ DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv ++ COMPONENT dev) ++ install(FILES "opencv2/opencv.hpp" ++ DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 ++ COMPONENT dev) +endif() +\ No newline at end of file +-- +2.9.0.windows.1 + diff --git a/ports/opencv/portfile.cmake b/ports/opencv/portfile.cmake index 224c99c428..6614fbb1a7 100644 --- a/ports/opencv/portfile.cmake +++ b/ports/opencv/portfile.cmake @@ -3,11 +3,11 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/opencv-92387b1ef8fad15196dd5f7fb4931444a68bc93a) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/opencv-3.2.0) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/opencv/opencv/archive/92387b1ef8fad15196dd5f7fb4931444a68bc93a.zip" - FILENAME "opencv-92387b1ef8fad15196dd5f7fb4931444a68bc93a.zip" - SHA512 b95fa1a5bce0ea9e9bd43173b904e5d779a2f640f4f8dbb36a12df462e8e4cdce3ff94b2fbd85cb96ddf338019f9888e9e7410c468c81b1de98d9c1da945a7eb + URLS "https://github.com/opencv/opencv/archive/3.2.0.zip" + FILENAME "opencv-3.2.0.zip" + SHA512 c6418d2a7654fe9d50611e756778df4c6736f2de76b85773efbf490bb475dd95ec1041fe57a87163ce11a7db44430cd378c8416af3319f979ced92532bf5ebb5 ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -24,7 +24,6 @@ vcpkg_configure_cmake( -DBUILD_TIFF=OFF -DBUILD_JPEG=OFF -DBUILD_PNG=OFF - -DINSTALL_CREATE_DISTRIB=ON -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_apps=OFF From 1bd912bb3e319991645ec480183db2e30fdf6b85 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 8 Feb 2017 23:51:16 -0800 Subject: [PATCH 308/561] [rapidjson] Update to 1.1.0 --- ports/rapidjson/CONTROL | 2 +- ports/rapidjson/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/rapidjson/CONTROL b/ports/rapidjson/CONTROL index 2ef641783d..0dd6333cfe 100644 --- a/ports/rapidjson/CONTROL +++ b/ports/rapidjson/CONTROL @@ -1,3 +1,3 @@ Source: rapidjson -Version: 1.0.2-1 +Version: 1.1.0 Description: A fast JSON parser/generator for C++ with both SAX/DOM style API diff --git a/ports/rapidjson/portfile.cmake b/ports/rapidjson/portfile.cmake index 3d923cb959..80dc14f5d5 100644 --- a/ports/rapidjson/portfile.cmake +++ b/ports/rapidjson/portfile.cmake @@ -1,10 +1,10 @@ #header-only library include(vcpkg_common_functions) -SET(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/rapidjson-879def80f2e466cdf4c86dc7e53ea2dd4cafaea0) +SET(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/rapidjson-1.1.0) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/miloyip/rapidjson/archive/879def80f2e466cdf4c86dc7e53ea2dd4cafaea0.zip" - FILENAME "rapidjson-879def80f2e466cdf4c86dc7e53ea2dd4cafaea0.zip" - SHA512 4d9ef7cce7d179344c33245c081a142ca5fcb2a0cc170ed39e3d0add008efab8e7389feec03e1ea83b30c5778cd0600865b08bc1c23592e5154dbe1f21f9547d + URLS "https://github.com/miloyip/rapidjson/archive/v1.1.0.zip" + FILENAME "rapidjson-v1.1.0.zip" + SHA512 4ddbf6dc5d943eb971e7a62910dd78d1cc5cc3016066a443f351d4276d2be3375ed97796e672c2aecd6990f0b332826f8c8ddc7d367193d7b82f0037f4e4012c ) vcpkg_extract_source_archive(${ARCHIVE}) From b4c3c30d4039ac56f1264b3692aa3a4cc49c6869 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 8 Feb 2017 23:51:46 -0800 Subject: [PATCH 309/561] [vcpkg] Fix typo in a lint check --- toolsrc/src/PostBuildLint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index ac33969840..21d1cef136 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -487,7 +487,7 @@ namespace vcpkg::PostBuildLint System::println("The following empty directories were found: "); Files::print_paths(empty_directories); System::println(System::color::warning, "If a directory should be populated but is not, this might indicate an error in the portfile.\n" - "If the directories are not needed and their creation cannot be disabled, use something like this in the portfile to remove them)\n" + "If the directories are not needed and their creation cannot be disabled, use something like this in the portfile to remove them:\n" "\n" R"###( file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/a/dir ${CURRENT_PACKAGES_DIR}/some/other/dir))###""\n" "\n"); From ddab90208a59a173e07754cb2a0c6a53f17e8f7c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 8 Feb 2017 23:55:50 -0800 Subject: [PATCH 310/561] [sqlite-modern-cpp] Avoid moving downloaded file --- ports/sqlite-modern-cpp/portfile.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/sqlite-modern-cpp/portfile.cmake b/ports/sqlite-modern-cpp/portfile.cmake index a7b0f81edd..3171b55502 100644 --- a/ports/sqlite-modern-cpp/portfile.cmake +++ b/ports/sqlite-modern-cpp/portfile.cmake @@ -11,11 +11,10 @@ vcpkg_extract_source_archive(${ARCHIVE}) file(INSTALL ${SOURCE_PATH}/hdr/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) # Handle copyright -message("Download license...") vcpkg_download_distfile(LICENSE URLS https://raw.githubusercontent.com/aminroosta/sqlite_modern_cpp/1d7747fcbb16325ec6673477b06f0c780de24a27/License.txt FILENAME "sqlite_modern_cpp-2.4-license-mit.txt" SHA512 4ffc41d14902b37841463b9e9274537cb48523a7ab7e5fbbbd14a01820d141e367851b0496aa18546ddab96100e7381db7fc35621c795a97c3290b618e18a8bd ) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/sqlite-modern-cpp) -file(RENAME ${LICENSE} ${CURRENT_PACKAGES_DIR}/share/sqlite-modern-cpp/copyright) +file(INSTALL ${LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/sqlite-modern-cpp RENAME copyright) From 47109bb96aa257f300b142e4d0ac6e115ec5150f Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 9 Feb 2017 00:04:05 -0800 Subject: [PATCH 311/561] [grpc] Bump package version to match change in cmake config file output --- ports/grpc/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/grpc/CONTROL b/ports/grpc/CONTROL index b9d19da4c0..3de78c477d 100644 --- a/ports/grpc/CONTROL +++ b/ports/grpc/CONTROL @@ -1,4 +1,4 @@ Source: grpc -Version: 1.1.0-dev-1674f65-1 +Version: 1.1.0-dev-1674f65-2 Build-Depends: zlib, openssl, protobuf Description: An RPC library and framework \ No newline at end of file From f19c145ab5129bc68aa17d6f377ae0d772b913ca Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 9 Feb 2017 00:33:02 -0800 Subject: [PATCH 312/561] [openvr] Initial commit of 1.0.5 --- ports/openvr/CONTROL | 3 +++ ports/openvr/portfile.cmake | 54 +++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 ports/openvr/CONTROL create mode 100644 ports/openvr/portfile.cmake diff --git a/ports/openvr/CONTROL b/ports/openvr/CONTROL new file mode 100644 index 0000000000..2a2228ba2f --- /dev/null +++ b/ports/openvr/CONTROL @@ -0,0 +1,3 @@ +Source: openvr +Version: 1.0.5 +Description: an API and runtime that allows access to VR hardware from multiple vendors without requiring that applications have specific knowledge of the hardware they are targeting. diff --git a/ports/openvr/portfile.cmake b/ports/openvr/portfile.cmake new file mode 100644 index 0000000000..94e90143db --- /dev/null +++ b/ports/openvr/portfile.cmake @@ -0,0 +1,54 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openvr-1.0.5) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/ValveSoftware/openvr/archive/v1.0.5.zip" + FILENAME "openvr-v1.0.5.zip" + SHA512 18c2e3f7a8754d0e9389c953d0af70788c77adf43f51d25b6664beaeb407dc8d2daa755396c45ce2b4be1b08d333b378810dbebdf3c9bb5f5a03a9d372dc97b0 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +set(VCPKG_LIBRARY_LINKAGE dynamic) + +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(ARCH_PATH "win64") +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(ARCH_PATH "win32") +else() + message(FATAL_ERROR "Package only supports x64 and x86 windows.") +endif() + +if(VCPKG_CMAKE_SYSTEM_NAME) + message(FATAL_ERROR "Package only supports windows desktop.") +endif() + +file(MAKE_DIRECTORY + ${CURRENT_PACKAGES_DIR}/lib + ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/debug/lib + ${CURRENT_PACKAGES_DIR}/debug/bin +) +file(COPY ${SOURCE_PATH}/lib/${ARCH_PATH}/openvr_api.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(COPY ${SOURCE_PATH}/lib/${ARCH_PATH}/openvr_api.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(COPY + ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.dll + ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/bin +) +file(COPY + ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.dll + ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin +) +file(COPY ${SOURCE_PATH}/headers DESTINATION ${CURRENT_PACKAGES_DIR}) +file(RENAME ${CURRENT_PACKAGES_DIR}/headers ${CURRENT_PACKAGES_DIR}/include) + +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openvr) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/openvr/LICENSE ${CURRENT_PACKAGES_DIR}/share/openvr/copyright) From 6ca475a5b47e0a49e2cdd4e65f3c51913a431328 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 9 Feb 2017 18:13:52 +0100 Subject: [PATCH 313/561] add libepoxy --- ports/libepoxy/CONTROL | 3 + ports/libepoxy/portfile.cmake | 17 +++++ scripts/cmake/vcpkg_common_functions.cmake | 2 + scripts/cmake/vcpkg_configure_meson.cmake | 72 +++++++++++++++++++ .../cmake/vcpkg_find_acquire_program.cmake | 25 ++++++- scripts/cmake/vcpkg_install_meson.cmake | 23 ++++++ 6 files changed, 139 insertions(+), 3 deletions(-) create mode 100644 ports/libepoxy/CONTROL create mode 100644 ports/libepoxy/portfile.cmake create mode 100644 scripts/cmake/vcpkg_configure_meson.cmake create mode 100644 scripts/cmake/vcpkg_install_meson.cmake diff --git a/ports/libepoxy/CONTROL b/ports/libepoxy/CONTROL new file mode 100644 index 0000000000..8ac70cd224 --- /dev/null +++ b/ports/libepoxy/CONTROL @@ -0,0 +1,3 @@ +Source: libepoxy +Version: 1.4.0-2432daf +Description: Epoxy is a library for handling OpenGL function pointer management for you diff --git a/ports/libepoxy/portfile.cmake b/ports/libepoxy/portfile.cmake new file mode 100644 index 0000000000..add95b480f --- /dev/null +++ b/ports/libepoxy/portfile.cmake @@ -0,0 +1,17 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libepoxy-2432daf4cf58b5ff11e008ca34811588285c43b3) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/anholt/libepoxy/archive/2432daf4cf58b5ff11e008ca34811588285c43b3.zip" + FILENAME "libepoxy-2432daf4cf58b5ff11e008ca34811588285c43b3.zip" + SHA512 70b59b6c5722eb87522927fdedab44f74ffd2d71d2ae42509de07b0c3e13f71320b25da0d4c75dca75c4208ea7a525483267d6ccb8acd5274728c015c7ac4006) + +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_meson(SOURCE_PATH ${SOURCE_PATH}) +vcpkg_install_meson() + +vcpkg_copy_pdbs() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libepoxy) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libepoxy/COPYING ${CURRENT_PACKAGES_DIR}/share/libepoxy/copyright) diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 6e60bf2bc3..fb626efe8a 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -7,7 +7,9 @@ include(vcpkg_build_cmake) include(vcpkg_build_msbuild) include(vcpkg_build_qmake) include(vcpkg_install_cmake) +include(vcpkg_install_meson) include(vcpkg_configure_cmake) +include(vcpkg_configure_meson) include(vcpkg_configure_qmake) include(vcpkg_apply_patches) include(vcpkg_copy_pdbs) diff --git a/scripts/cmake/vcpkg_configure_meson.cmake b/scripts/cmake/vcpkg_configure_meson.cmake new file mode 100644 index 0000000000..277f91e117 --- /dev/null +++ b/scripts/cmake/vcpkg_configure_meson.cmake @@ -0,0 +1,72 @@ +function(vcpkg_configure_meson) + cmake_parse_arguments(_vcm "" "SOURCE_PATH" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) + + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + + # use the same compiler options as in vcpkg_configure_cmake + set(MESON_COMMON_CFLAGS "${MESON_COMMON_CFLAGS} /DWIN32 /D_WINDOWS /W3 /utf-8") + set(MESON_COMMON_CXXFLAGS "${MESON_COMMON_CXXFLAGS} /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc") + + if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) + set(MESON_DEBUG_CFLAGS "${MESON_DEBUG_CFLAGS} /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1") + set(MESON_DEBUG_CXXFLAGS "${MESON_DEBUG_CXXFLAGS} /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1") + + set(MESON_RELEASE_CFLAGS "${MESON_RELEASE_CFLAGS} /MD /O2 /Oi /Gy /DNDEBUG /Zi") + set(MESON_RELEASE_CXXFLAGS "${MESON_RELEASE_CXXFLAGS} /MD /O2 /Oi /Gy /DNDEBUG /Zi") + elseif(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) + set(MESON_DEBUG_CFLAGS "${MESON_DEBUG_CFLAGS} /D_DEBUG /MTd /Zi /Ob0 /Od /RTC1") + set(MESON_DEBUG_CXXFLAGS "${MESON_DEBUG_CXXFLAGS} /D_DEBUG /MTd /Zi /Ob0 /Od /RTC1") + + set(MESON_RELEASE_CFLAGS "${MESON_RELEASE_CFLAGS} /MT /O2 /Oi /Gy /DNDEBUG /Zi") + set(MESON_RELEASE_CXXFLAGS "${MESON_RELEASE_CXXFLAGS} /MT /O2 /Oi /Gy /DNDEBUG /Zi") + endif() + + set(MESON_COMMON_LDFLAGS "${MESON_COMMON_LDFLAGS} /DEBUG") + set(MESON_RELEASE_LDFLAGS "${MESON_RELEASE_LDFLAGS} /INCREMENTAL:NO /OPT:REF /OPT:ICF") + + # select meson cmd-line options + list(APPEND _vcm_OPTIONS --buildtype plain --backend ninja) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + list(APPEND _vcm_OPTIONS --default-library shared) + else() + list(APPEND _vcm_OPTIONS --default-library static) + endif() + + list(APPEND _vcm_OPTIONS_DEBUG --prefix ${CURRENT_PACKAGES_DIR}/debug --includedir ../include) + list(APPEND _vcm_OPTIONS_RELEASE --prefix ${CURRENT_PACKAGES_DIR}) + + vcpkg_find_acquire_program(MESON) + vcpkg_find_acquire_program(NINJA) + get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) + set(ENV{PATH} "$ENV{PATH};${NINJA_PATH}") + + # configure release + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + set(ENV{CFLAGS} "${MESON_COMMON_CFLAGS} ${MESON_RELEASE_CFLAGS}") + set(ENV{CXXFLAGS} "${MESON_COMMON_CXXFLAGS} ${MESON_RELEASE_CXXFLAGS}") + set(ENV{LDFLAGS} "${MESON_COMMON_LDFLAGS} ${MESON_RELEASE_LDFLAGS}") + set(ENV{CPPFLAGS} "${MESON_COMMON_CPPFLAGS} ${MESON_RELEASE_CPPFLAGS}") + vcpkg_execute_required_process( + COMMAND ${MESON} ${_vcm_OPTIONS} ${_vcm_OPTIONS_RELEASE} ${_vcm_SOURCE_PATH} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + + # configure debug + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + set(ENV{CFLAGS} "${MESON_COMMON_CFLAGS} ${MESON_DEBUG_CFLAGS}") + set(ENV{CXXFLAGS} "${MESON_COMMON_CXXFLAGS} ${MESON_DEBUG_CXXFLAGS}") + set(ENV{LDFLAGS} "${MESON_COMMON_LDFLAGS} ${MESON_DEBUG_LDFLAGS}") + set(ENV{CPPFLAGS} "${MESON_COMMON_CPPFLAGS} ${MESON_DEBUG_CPPFLAGS}") + vcpkg_execute_required_process( + COMMAND ${MESON} ${_vcm_OPTIONS} ${_vcm_OPTIONS_DEBUG} ${_vcm_SOURCE_PATH} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + +endfunction() diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 0442913829..b9a397fcc8 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -5,6 +5,7 @@ function(vcpkg_find_acquire_program VAR) unset(NOEXTRACT) unset(SUBDIR) + unset(REQUIRED_INTERPRETER) if(VAR MATCHES "PERL") set(PROGNAME perl) @@ -70,12 +71,30 @@ function(vcpkg_find_acquire_program VAR) set(PATHS ${DOWNLOADS}/tools/ninja/${SUBDIR}) set(URL "https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip") set(ARCHIVE "ninja-win.zip") - set(HASH cccab9281b274c564f9ad77a2115be1f19be67d7b2ee14a55d1db1b27f3b68db8e76076e4f804b61eb8e573e26a8ecc9985675a8dcf03fd7a77b7f57234f1393) + set(HASH cccab9281b274c564f9ad77a2115be1f19be67d7b2ee14a55d1db1b27f3b68db8e76076e4f804b61eb8e573e26a8ecc9985675a8dcf03fd7a77b7f57234f1393) + elseif(VAR MATCHES "MESON") + set(PROGNAME meson) + set(REQUIRED_INTERPRETER PYTHON3) + set(SCRIPTNAME meson.py) + set(PATHS ${DOWNLOADS}/tools/meson/meson-0.38.1) + set(URL "https://github.com/mesonbuild/meson/archive/0.38.1.zip") + set(ARCHIVE "meson-0.38.1.zip") + set(HASH 89642b1d976af7e29e9ca2b1a378510ce286ebd90a8234e898f3dd9dd7151538fdfc61fba770681605dad843b77b344fee94f992f18328655669d5f603c7fee5) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() - find_program(${VAR} ${PROGNAME} PATHS ${PATHS}) + macro(do_find) + if(NOT DEFINED REQUIRED_INTERPRETER) + find_program(${VAR} ${PROGNAME} PATHS ${PATHS}) + else() + vcpkg_find_acquire_program(${REQUIRED_INTERPRETER}) + find_file(SCIRPT ${SCRIPTNAME} PATHS ${PATHS}) + set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCIRPT}) + endif() + endmacro() + + do_find() if(${VAR} MATCHES "-NOTFOUND") file(DOWNLOAD ${URL} ${DOWNLOADS}/${ARCHIVE} EXPECTED_HASH SHA512=${HASH} @@ -102,7 +121,7 @@ function(vcpkg_find_acquire_program VAR) endif() endif() - find_program(${VAR} ${PROGNAME} PATHS ${PATHS}) + do_find() endif() set(${VAR} ${${VAR}} PARENT_SCOPE) diff --git a/scripts/cmake/vcpkg_install_meson.cmake b/scripts/cmake/vcpkg_install_meson.cmake new file mode 100644 index 0000000000..21737bdc9e --- /dev/null +++ b/scripts/cmake/vcpkg_install_meson.cmake @@ -0,0 +1,23 @@ +function(vcpkg_install_meson) + + vcpkg_find_acquire_program(NINJA) + + unset(ENV{DESTDIR}) # installation directory was already specified with '--prefix' option + + message(STATUS "Package ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND ${NINJA} install -v + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME package-${TARGET_TRIPLET}-rel + ) + message(STATUS "Package ${TARGET_TRIPLET}-rel done") + + message(STATUS "Package ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND ${NINJA} install -v + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME package-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Package ${TARGET_TRIPLET}-dbg done") + +endfunction() From b65ae7c27793d2837881412f609ee08974c14f82 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 9 Feb 2017 18:15:57 +0100 Subject: [PATCH 314/561] tabs to spaces --- scripts/cmake/vcpkg_install_meson.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/cmake/vcpkg_install_meson.cmake b/scripts/cmake/vcpkg_install_meson.cmake index 21737bdc9e..f6d49288cc 100644 --- a/scripts/cmake/vcpkg_install_meson.cmake +++ b/scripts/cmake/vcpkg_install_meson.cmake @@ -1,9 +1,9 @@ function(vcpkg_install_meson) - + vcpkg_find_acquire_program(NINJA) - - unset(ENV{DESTDIR}) # installation directory was already specified with '--prefix' option - + + unset(ENV{DESTDIR}) # installation directory was already specified with '--prefix' option + message(STATUS "Package ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( COMMAND ${NINJA} install -v @@ -11,7 +11,7 @@ function(vcpkg_install_meson) LOGNAME package-${TARGET_TRIPLET}-rel ) message(STATUS "Package ${TARGET_TRIPLET}-rel done") - + message(STATUS "Package ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( COMMAND ${NINJA} install -v From 91442a634ef429277b9d65b47ae67d4c6791fe09 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 9 Feb 2017 18:23:21 +0100 Subject: [PATCH 315/561] [libepoxy] ensure python is on path --- ports/libepoxy/portfile.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/libepoxy/portfile.cmake b/ports/libepoxy/portfile.cmake index add95b480f..521f7a2926 100644 --- a/ports/libepoxy/portfile.cmake +++ b/ports/libepoxy/portfile.cmake @@ -8,6 +8,11 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) +# ensure python is on path - not for meson but some source geneation scripts +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "$ENV{PATH};${PYTHON3_PATH}") + vcpkg_configure_meson(SOURCE_PATH ${SOURCE_PATH}) vcpkg_install_meson() From 6c380e057890094ce1e2c36ded5481675e139078 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 9 Feb 2017 18:24:17 +0100 Subject: [PATCH 316/561] fix typo --- ports/libepoxy/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libepoxy/portfile.cmake b/ports/libepoxy/portfile.cmake index 521f7a2926..188cd3668c 100644 --- a/ports/libepoxy/portfile.cmake +++ b/ports/libepoxy/portfile.cmake @@ -8,7 +8,7 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) -# ensure python is on path - not for meson but some source geneation scripts +# ensure python is on path - not for meson but some source generation scripts vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_PATH ${PYTHON3} DIRECTORY) set(ENV{PATH} "$ENV{PATH};${PYTHON3_PATH}") From cfd5adaf135ccfe2ade3bce43a00d27abd007b0a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 9 Feb 2017 15:26:40 -0800 Subject: [PATCH 317/561] Improve WinSDK detection --- scripts/findTargetPlatformVersion.ps1 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/findTargetPlatformVersion.ps1 b/scripts/findTargetPlatformVersion.ps1 index e9d676724a..d3dba73f13 100644 --- a/scripts/findTargetPlatformVersion.ps1 +++ b/scripts/findTargetPlatformVersion.ps1 @@ -15,15 +15,16 @@ foreach ($ProgramFiles in $CandidateProgramFiles) continue } - $win10sdkVersions = Get-ChildItem $folder | Where-Object {$_.Name -match "^10"} | Sort-Object - $win10sdkVersionCount = $win10sdkVersions.Length + $win10sdkVersions = @(Get-ChildItem $folder | Where-Object {$_.Name -match "^10"} | Sort-Object) + [array]::Reverse($win10sdkVersions) # Newest SDK first - if ($win10sdkVersionCount -eq 0) + foreach ($win10sdkV in $win10sdkVersions) { - continue + if (Test-Path "$folder\$win10sdkV\um\windows.h") + { + return $win10sdkV.ToString() + } } - - return $win10sdkVersions[$win10sdkVersionCount - 1].ToString() } # Windows 8.1 SDK From 43665857a3ad11de8135c7fd6cd9839269212d7d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 9 Feb 2017 17:23:15 -0800 Subject: [PATCH 318/561] [fmt] Force headers in shared build to always have FMT_SHARED. Fixes #331. --- ports/fmt/CONTROL | 2 +- ports/fmt/portfile.cmake | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/fmt/CONTROL b/ports/fmt/CONTROL index 2c90cc300f..4e980b4d54 100644 --- a/ports/fmt/CONTROL +++ b/ports/fmt/CONTROL @@ -1,3 +1,3 @@ Source: fmt -Version: 3.0.1-3 +Version: 3.0.1-4 Description: Formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams. diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index 5fbbcc12ed..959a0ebe73 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -30,6 +30,10 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fmt.dll ${CURRENT_PACKAGES_DIR}/bin/fmt.dll) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fmt.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fmt.dll) + # Force FMT_SHARED to 1 + file(READ ${CURRENT_PACKAGES_DIR}/include/fmt/format.h FMT_FORMAT_H) + string(REPLACE "defined(FMT_SHARED)" "1" FMT_FORMAT_H "${FMT_FORMAT_H}") + file(WRITE ${CURRENT_PACKAGES_DIR}/include/fmt/format.h "${FMT_FORMAT_H}") endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) #file(REMOVE ${CURRENT_PACKAGES_DIR}/include/fmt/format.cc) From a58139adf0b910fc9cc751e7162d507ac29471f4 Mon Sep 17 00:00:00 2001 From: sdcb Date: Fri, 10 Feb 2017 17:32:54 +0800 Subject: [PATCH 319/561] [asio] upgrade to 1.10.8 --- ports/asio/CONTROL | 6 +++--- ports/asio/portfile.cmake | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/asio/CONTROL b/ports/asio/CONTROL index 466ef6cd0a..18d9692f53 100644 --- a/ports/asio/CONTROL +++ b/ports/asio/CONTROL @@ -1,3 +1,3 @@ -Source: asio -Version: 1.10.6 -Description: Asio is a cross-platform C++ library for network and low-level I/O programming that provides developers with a consistent asynchronous model using a modern C++ approach. +Source: asio +Version: 1.10.8 +Description: Asio is a cross-platform C++ library for network and low-level I/O programming that provides developers with a consistent asynchronous model using a modern C++ approach. diff --git a/ports/asio/portfile.cmake b/ports/asio/portfile.cmake index 345ddd673d..39fefa012e 100644 --- a/ports/asio/portfile.cmake +++ b/ports/asio/portfile.cmake @@ -1,10 +1,10 @@ #header-only library include(vcpkg_common_functions) -SET(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/asio-asio-1-10-6/asio/) +SET(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/asio-asio-1-10-8/asio/) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/chriskohlhoff/asio/archive/asio-1-10-6.zip" - FILENAME "asio-1-10-6.zip" - SHA512 7e3fde7e88d305d19b88482b73c8b7a41751d65e81bd23dd8ef45eb4e3ef3a10629696b4d347e5a68f08d6fb2dede15a2f38c7ee8d18ac88be769215542da4c6 + URLS "https://github.com/chriskohlhoff/asio/archive/asio-1-10-8.zip" + FILENAME "asio-1-10-8.zip" + SHA512 bc9794a20fc7844a2a9d22bfa418005f61defbcecdd612daba0d317e6f8fc5a61d3a3b2d7d557b92584294b8adfccc3c47a8f0441f3e34a47a0f715ca1ba0e5b ) vcpkg_extract_source_archive(${ARCHIVE}) From 47a4bff2d11881f95bd0eb0b659360ff1b7465c0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 9 Feb 2017 18:26:16 -0800 Subject: [PATCH 320/561] Add vcpkg_Enums --- toolsrc/include/vcpkg_Enums.h | 11 +++++++++++ toolsrc/src/vcpkg_Enums.cpp | 21 +++++++++++++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 ++ toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 ++++++ 4 files changed, 40 insertions(+) create mode 100644 toolsrc/include/vcpkg_Enums.h create mode 100644 toolsrc/src/vcpkg_Enums.cpp diff --git a/toolsrc/include/vcpkg_Enums.h b/toolsrc/include/vcpkg_Enums.h new file mode 100644 index 0000000000..5c4dc8b06e --- /dev/null +++ b/toolsrc/include/vcpkg_Enums.h @@ -0,0 +1,11 @@ +#pragma once +#include + +namespace vcpkg::Enums +{ + std::string nullvalue_toString(const std::string& enum_name); + + __declspec(noreturn) void nullvalue_used(const std::string& enum_name); + + __declspec(noreturn) void unreachable(const std::string& enum_name); +} diff --git a/toolsrc/src/vcpkg_Enums.cpp b/toolsrc/src/vcpkg_Enums.cpp new file mode 100644 index 0000000000..5e698659db --- /dev/null +++ b/toolsrc/src/vcpkg_Enums.cpp @@ -0,0 +1,21 @@ +#include "pch.h" +#include "vcpkg_Enums.h" +#include "vcpkg_Checks.h" + +namespace vcpkg::Enums +{ + std::string nullvalue_toString(const std::string& enum_name) + { + return Strings::format("%s_NULLVALUE", enum_name); + } + + void nullvalue_used(const std::string& enum_name) + { + Checks::exit_with_message("NULLVALUE of enum %s was used", enum_name); + } + + void unreachable(const std::string& enum_name) + { + Checks::exit_with_message("Unreachable code for enum, %s", enum_name); + } +} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index ad15ea7ea7..537b2fb0fd 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -165,6 +165,7 @@ + @@ -227,6 +228,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 99cbf7037b..519331b497 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -168,6 +168,9 @@ Source Files + + Source Files + @@ -290,5 +293,8 @@ Header Files + + Header Files + \ No newline at end of file From 7a0404cb839ae49bf7e52ca54f905d182a12de5d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 9 Feb 2017 18:39:03 -0800 Subject: [PATCH 321/561] BuildInfo now holds enum instead of string --- toolsrc/include/PostBuildLint_BuildInfo.h | 5 +++-- toolsrc/src/PostBuildLint.cpp | 11 +++-------- toolsrc/src/PostBuildLint_BuildInfo.cpp | 9 +++++++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index ff996b2b61..878b90e6f2 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -4,6 +4,7 @@ #include "Paragraphs.h" #include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" +#include "PostBuildLint_LinkageType.h" namespace vcpkg::PostBuildLint { @@ -11,8 +12,8 @@ namespace vcpkg::PostBuildLint { static BuildInfo create(std::unordered_map pgh); - std::string crt_linkage; - std::string library_linkage; + LinkageType crt_linkage; + LinkageType library_linkage; std::map policies; }; diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 21d1cef136..d952403db5 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -660,7 +660,7 @@ namespace vcpkg::PostBuildLint error_count += check_lib_architecture(spec.target_triplet().architecture(), libs); - switch (linkage_type_value_of(build_info.library_linkage)) + switch (build_info.library_linkage) { case LinkageType::DYNAMIC: { @@ -691,16 +691,11 @@ namespace vcpkg::PostBuildLint error_count += check_bin_folders_are_not_present_in_static_build(package_dir); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, build_info.crt_linkage), debug_libs, dumpbin_exe); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, build_info.crt_linkage), release_libs, dumpbin_exe); break; } case LinkageType::UNKNOWN: - { - error_count += 1; - System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); - break; - } default: Checks::unreachable(); } diff --git a/toolsrc/src/PostBuildLint_BuildInfo.cpp b/toolsrc/src/PostBuildLint_BuildInfo.cpp index 63107acd1c..5440850008 100644 --- a/toolsrc/src/PostBuildLint_BuildInfo.cpp +++ b/toolsrc/src/PostBuildLint_BuildInfo.cpp @@ -16,8 +16,13 @@ namespace vcpkg::PostBuildLint BuildInfo BuildInfo::create(std::unordered_map pgh) { BuildInfo build_info; - build_info.crt_linkage = details::remove_required_field(&pgh, BuildInfoRequiredField::CRT_LINKAGE); - build_info.library_linkage = details::remove_required_field(&pgh, BuildInfoRequiredField::LIBRARY_LINKAGE); + const std::string crt_linkage_as_string = details::remove_required_field(&pgh, BuildInfoRequiredField::CRT_LINKAGE); + build_info.crt_linkage = linkage_type_value_of(crt_linkage_as_string); + Checks::check_exit(build_info.crt_linkage != LinkageType::UNKNOWN, "Invalid crt linkage type: [%s]", crt_linkage_as_string); + + const std::string library_linkage_as_string = details::remove_required_field(&pgh, BuildInfoRequiredField::LIBRARY_LINKAGE); + build_info.library_linkage = linkage_type_value_of(library_linkage_as_string); + Checks::check_exit(build_info.library_linkage != LinkageType::UNKNOWN, "Invalid library linkage type: [%s]", library_linkage_as_string); // The remaining entries are policies for (const std::unordered_map::value_type& p : pgh) From 95650bdd424b9499f4676dae8f110b15b3fd024f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 9 Feb 2017 19:00:09 -0800 Subject: [PATCH 322/561] PostBuildLint enum revamp --- toolsrc/include/PostBuildLint_BuildInfo.h | 4 +- toolsrc/include/PostBuildLint_BuildPolicies.h | 13 ++-- toolsrc/include/PostBuildLint_BuildType.h | 70 ++++++++++--------- .../include/PostBuildLint_ConfigurationType.h | 25 ++++++- toolsrc/include/PostBuildLint_LinkageType.h | 30 ++++++-- toolsrc/src/PostBuildLint.cpp | 14 ++-- toolsrc/src/PostBuildLint_BuildInfo.cpp | 10 +-- toolsrc/src/PostBuildLint_BuildPolicies.cpp | 27 +++---- toolsrc/src/PostBuildLint_BuildType.cpp | 69 +++++++++++------- .../src/PostBuildLint_ConfigurationType.cpp | 27 ++++--- toolsrc/src/PostBuildLint_LinkageType.cpp | 45 +++++++----- 11 files changed, 199 insertions(+), 135 deletions(-) diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index 878b90e6f2..7dbadb1478 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -12,8 +12,8 @@ namespace vcpkg::PostBuildLint { static BuildInfo create(std::unordered_map pgh); - LinkageType crt_linkage; - LinkageType library_linkage; + LinkageType::type crt_linkage; + LinkageType::type library_linkage; std::map policies; }; diff --git a/toolsrc/include/PostBuildLint_BuildPolicies.h b/toolsrc/include/PostBuildLint_BuildPolicies.h index 187ba6d646..082de31d00 100644 --- a/toolsrc/include/PostBuildLint_BuildPolicies.h +++ b/toolsrc/include/PostBuildLint_BuildPolicies.h @@ -1,17 +1,19 @@ #pragma once #include +#include namespace vcpkg::PostBuildLint::BuildPolicies { enum class backing_enum_t { - UNKNOWN = 0, + NULLVALUE = 0, EMPTY_PACKAGE, DLLS_WITHOUT_LIBS }; struct type { + constexpr type() : backing_enum(backing_enum_t::NULLVALUE) {} constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { } constexpr operator backing_enum_t() const { return backing_enum; } @@ -19,17 +21,16 @@ namespace vcpkg::PostBuildLint::BuildPolicies const std::string& cmake_variable() const; private: - type(); backing_enum_t backing_enum; }; - static constexpr int value_count = 3; - const std::vector& values(); + static const std::string ENUM_NAME = "vcpkg::PostBuildLint::BuildPolicies"; - - static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); + static constexpr type NULLVALUE(backing_enum_t::NULLVALUE); static constexpr type EMPTY_PACKAGE(backing_enum_t::EMPTY_PACKAGE); static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); + static constexpr std::array values = { EMPTY_PACKAGE, DLLS_WITHOUT_LIBS }; + type parse(const std::string& s); } diff --git a/toolsrc/include/PostBuildLint_BuildType.h b/toolsrc/include/PostBuildLint_BuildType.h index a5cb24f492..31fbb11c90 100644 --- a/toolsrc/include/PostBuildLint_BuildType.h +++ b/toolsrc/include/PostBuildLint_BuildType.h @@ -1,45 +1,47 @@ #pragma once #include "PostBuildLint_ConfigurationType.h" #include "PostBuildLint_LinkageType.h" -#include +#include #include -namespace vcpkg::PostBuildLint +namespace vcpkg::PostBuildLint::BuildType { - struct BuildType + enum class backing_enum_t { - static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); - - static const BuildType DEBUG_STATIC; - static const BuildType DEBUG_DYNAMIC; - static const BuildType RELEASE_STATIC; - static const BuildType RELEASE_DYNAMIC; - - static const std::vector& values() - { - static const std::vector v = { DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC }; - return v; - } - - BuildType() = delete; - - const ConfigurationType& config() const; - const LinkageType& linkage() const; - std::regex crt_regex() const; - std::string toString() const; - - private: - BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) - : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string) - { - } - - ConfigurationType m_config; - LinkageType m_linkage; - std::string m_crt_regex_as_string; + DEBUG_STATIC = 1, + DEBUG_DYNAMIC, + RELEASE_STATIC, + RELEASE_DYNAMIC }; - bool operator ==(const BuildType& lhs, const BuildType& rhs); + struct type + { + type() = delete; - bool operator !=(const BuildType& lhs, const BuildType& rhs); + constexpr explicit type(const backing_enum_t backing_enum, const ConfigurationType::type config, const LinkageType::type linkage) : + backing_enum(backing_enum), m_config(config), m_linkage(linkage) { } + + constexpr operator backing_enum_t() const { return backing_enum; } + + const ConfigurationType::type& config() const; + const LinkageType::type& linkage() const; + const std::regex& crt_regex() const; + const std::string& toString() const; + + private: + backing_enum_t backing_enum; + ConfigurationType::type m_config; + LinkageType::type m_linkage; + }; + + static const std::string ENUM_NAME = "vcpkg::PostBuildLint::BuildType"; + + static constexpr type DEBUG_STATIC = type(backing_enum_t::DEBUG_STATIC, ConfigurationType::DEBUG, LinkageType::STATIC); + static constexpr type DEBUG_DYNAMIC = type(backing_enum_t::DEBUG_DYNAMIC, ConfigurationType::DEBUG, LinkageType::DYNAMIC); + static constexpr type RELEASE_STATIC = type(backing_enum_t::RELEASE_STATIC, ConfigurationType::RELEASE, LinkageType::STATIC); + static constexpr type RELEASE_DYNAMIC = type(backing_enum_t::RELEASE_DYNAMIC, ConfigurationType::RELEASE, LinkageType::DYNAMIC); + + static constexpr std::array values = { DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC }; + + type value_of(const ConfigurationType::type& config, const LinkageType::type& linkage); } diff --git a/toolsrc/include/PostBuildLint_ConfigurationType.h b/toolsrc/include/PostBuildLint_ConfigurationType.h index 55dede921f..7245d2932a 100644 --- a/toolsrc/include/PostBuildLint_ConfigurationType.h +++ b/toolsrc/include/PostBuildLint_ConfigurationType.h @@ -2,13 +2,32 @@ #pragma once #include -namespace vcpkg::PostBuildLint +namespace vcpkg::PostBuildLint::ConfigurationType { - enum class ConfigurationType + enum class backing_enum_t { + NULLVALUE = 0, DEBUG = 1, RELEASE = 2 }; - std::string to_string(const ConfigurationType& conf); + struct type + { + constexpr type() : backing_enum(backing_enum_t::NULLVALUE) {} + constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { } + constexpr operator backing_enum_t() const { return backing_enum; } + + const std::string& toString() const; + + private: + backing_enum_t backing_enum; + }; + + static const std::string ENUM_NAME = "vcpkg::PostBuildLint::ConfigurationType"; + + static constexpr type NULLVALUE(backing_enum_t::NULLVALUE); + static constexpr type DEBUG(backing_enum_t::DEBUG); + static constexpr type RELEASE(backing_enum_t::RELEASE); + + static constexpr std::array values = { DEBUG, RELEASE }; } diff --git a/toolsrc/include/PostBuildLint_LinkageType.h b/toolsrc/include/PostBuildLint_LinkageType.h index 7cca97639c..0cecc8c9fb 100644 --- a/toolsrc/include/PostBuildLint_LinkageType.h +++ b/toolsrc/include/PostBuildLint_LinkageType.h @@ -1,16 +1,34 @@ #pragma once #include -namespace vcpkg::PostBuildLint +namespace vcpkg::PostBuildLint::LinkageType { - enum class LinkageType + enum class backing_enum_t { + NULLVALUE = 0, DYNAMIC, - STATIC, - UNKNOWN + STATIC }; - LinkageType linkage_type_value_of(const std::string& as_string); + struct type + { + constexpr type() : backing_enum(backing_enum_t::NULLVALUE) {} + constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { } + constexpr operator backing_enum_t() const { return backing_enum; } - std::string to_string(const LinkageType& build_info); + const std::string& toString() const; + + private: + backing_enum_t backing_enum; + }; + + static const std::string ENUM_NAME = "vcpkg::PostBuildLint::LinkageType"; + + static constexpr type NULLVALUE(backing_enum_t::NULLVALUE); + static constexpr type DYNAMIC(backing_enum_t::DYNAMIC); + static constexpr type STATIC(backing_enum_t::STATIC); + + static constexpr std::array values = { DYNAMIC, STATIC }; + + type value_of(const std::string& as_string); } diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index d952403db5..23f1347cfa 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -500,12 +500,12 @@ namespace vcpkg::PostBuildLint struct BuildType_and_file { fs::path file; - BuildType build_type; + BuildType::type build_type; }; - static lint_status check_crt_linkage_of_libs(const BuildType& expected_build_type, const std::vector& libs, const fs::path dumpbin_exe) + static lint_status check_crt_linkage_of_libs(const BuildType::type& expected_build_type, const std::vector& libs, const fs::path dumpbin_exe) { - std::vector bad_build_types = BuildType::values(); + std::vector bad_build_types(BuildType::values.cbegin(), BuildType::values.cend()); bad_build_types.erase(std::remove(bad_build_types.begin(), bad_build_types.end(), expected_build_type), bad_build_types.end()); std::vector libs_with_invalid_crt; @@ -516,7 +516,7 @@ namespace vcpkg::PostBuildLint System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); - for (const BuildType& bad_build_type : bad_build_types) + for (const BuildType::type& bad_build_type : bad_build_types) { if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), bad_build_type.crt_regex())) { @@ -662,7 +662,7 @@ namespace vcpkg::PostBuildLint switch (build_info.library_linkage) { - case LinkageType::DYNAMIC: + case LinkageType::backing_enum_t::DYNAMIC: { const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); @@ -683,7 +683,7 @@ namespace vcpkg::PostBuildLint error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); break; } - case LinkageType::STATIC: + case LinkageType::backing_enum_t::STATIC: { std::vector dlls; Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); @@ -695,7 +695,7 @@ namespace vcpkg::PostBuildLint error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, build_info.crt_linkage), release_libs, dumpbin_exe); break; } - case LinkageType::UNKNOWN: + case LinkageType::backing_enum_t::NULLVALUE: default: Checks::unreachable(); } diff --git a/toolsrc/src/PostBuildLint_BuildInfo.cpp b/toolsrc/src/PostBuildLint_BuildInfo.cpp index 5440850008..7308c9bac0 100644 --- a/toolsrc/src/PostBuildLint_BuildInfo.cpp +++ b/toolsrc/src/PostBuildLint_BuildInfo.cpp @@ -17,18 +17,18 @@ namespace vcpkg::PostBuildLint { BuildInfo build_info; const std::string crt_linkage_as_string = details::remove_required_field(&pgh, BuildInfoRequiredField::CRT_LINKAGE); - build_info.crt_linkage = linkage_type_value_of(crt_linkage_as_string); - Checks::check_exit(build_info.crt_linkage != LinkageType::UNKNOWN, "Invalid crt linkage type: [%s]", crt_linkage_as_string); + build_info.crt_linkage = LinkageType::value_of(crt_linkage_as_string); + Checks::check_exit(build_info.crt_linkage != LinkageType::NULLVALUE, "Invalid crt linkage type: [%s]", crt_linkage_as_string); const std::string library_linkage_as_string = details::remove_required_field(&pgh, BuildInfoRequiredField::LIBRARY_LINKAGE); - build_info.library_linkage = linkage_type_value_of(library_linkage_as_string); - Checks::check_exit(build_info.library_linkage != LinkageType::UNKNOWN, "Invalid library linkage type: [%s]", library_linkage_as_string); + build_info.library_linkage = LinkageType::value_of(library_linkage_as_string); + Checks::check_exit(build_info.library_linkage != LinkageType::NULLVALUE, "Invalid library linkage type: [%s]", library_linkage_as_string); // The remaining entries are policies for (const std::unordered_map::value_type& p : pgh) { const BuildPolicies::type policy = BuildPolicies::parse(p.first); - Checks::check_exit(policy != BuildPolicies::UNKNOWN, "Unknown policy found: %s", p.first); + Checks::check_exit(policy != BuildPolicies::NULLVALUE, "Unknown policy found: %s", p.first); const opt_bool_t status = opt_bool::parse(p.second); build_info.policies.emplace(policy, status); } diff --git a/toolsrc/src/PostBuildLint_BuildPolicies.cpp b/toolsrc/src/PostBuildLint_BuildPolicies.cpp index 4e5ac3ceae..53dfcf95a3 100644 --- a/toolsrc/src/PostBuildLint_BuildPolicies.cpp +++ b/toolsrc/src/PostBuildLint_BuildPolicies.cpp @@ -1,10 +1,11 @@ #include "pch.h" #include "PostBuildLint_BuildPolicies.h" -#include "vcpkg_Checks.h" +#include "vcpkg_Enums.h" namespace vcpkg::PostBuildLint::BuildPolicies { - static const std::string NAME_UNKNOWN = "PolicyUnknown"; + static const std::string NULLVALUE_STRING = Enums::nullvalue_toString(ENUM_NAME); + static const std::string NAME_EMPTY_PACKAGE = "PolicyEmptyPackage"; static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs"; @@ -16,10 +17,10 @@ namespace vcpkg::PostBuildLint::BuildPolicies return NAME_EMPTY_PACKAGE; case DLLS_WITHOUT_LIBS: return NAME_DLLS_WITHOUT_LIBS; - case UNKNOWN: - return NAME_UNKNOWN; + case NULLVALUE: + return NULLVALUE_STRING; default: - Checks::unreachable(); + Enums::unreachable(ENUM_NAME); } } @@ -34,21 +35,13 @@ namespace vcpkg::PostBuildLint::BuildPolicies return CMAKE_VARIABLE_EMPTY_PACKAGE; case DLLS_WITHOUT_LIBS: return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS; - case UNKNOWN: - Checks::exit_with_message("No CMake command corresponds to UNKNOWN"); + case NULLVALUE: + Enums::nullvalue_used(ENUM_NAME); default: - Checks::unreachable(); + Enums::unreachable(ENUM_NAME); } } - type::type(): backing_enum(backing_enum_t::UNKNOWN) {} - - const std::vector& values() - { - static const std::vector& v = {UNKNOWN, EMPTY_PACKAGE, DLLS_WITHOUT_LIBS}; - return v; - } - type parse(const std::string& s) { if (s == NAME_EMPTY_PACKAGE) @@ -61,6 +54,6 @@ namespace vcpkg::PostBuildLint::BuildPolicies return BuildPolicies::DLLS_WITHOUT_LIBS; } - return BuildPolicies::UNKNOWN; + return BuildPolicies::NULLVALUE; } } diff --git a/toolsrc/src/PostBuildLint_BuildType.cpp b/toolsrc/src/PostBuildLint_BuildType.cpp index b4e199aee4..f2fb292d75 100644 --- a/toolsrc/src/PostBuildLint_BuildType.cpp +++ b/toolsrc/src/PostBuildLint_BuildType.cpp @@ -1,15 +1,10 @@ #include "pch.h" #include "PostBuildLint_BuildType.h" -#include "vcpkg_Checks.h" +#include "vcpkg_Enums.h" -namespace vcpkg::PostBuildLint +namespace vcpkg::PostBuildLint::BuildType { - const BuildType BuildType::DEBUG_STATIC = BuildType(ConfigurationType::DEBUG, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMTD)"); - const BuildType BuildType::DEBUG_DYNAMIC = BuildType(ConfigurationType::DEBUG, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRTD)"); - const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); - const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); - - BuildType BuildType::value_of(const ConfigurationType& config, const LinkageType& linkage) + type value_of(const ConfigurationType::type& config, const LinkageType::type& linkage) { if (config == ConfigurationType::DEBUG && linkage == LinkageType::STATIC) { @@ -31,38 +26,60 @@ namespace vcpkg::PostBuildLint return RELEASE_DYNAMIC; } - Checks::unreachable(); + Enums::unreachable(ENUM_NAME); } - const ConfigurationType& BuildType::config() const + const ConfigurationType::type& type::config() const { return this->m_config; } - const LinkageType& BuildType::linkage() const + const LinkageType::type& type::linkage() const { return this->m_linkage; } - std::regex BuildType::crt_regex() const + const std::regex& type::crt_regex() const { - const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); - return r; + static const std::regex REGEX_DEBUG_STATIC(R"(/DEFAULTLIB:LIBCMTD)", std::regex_constants::icase); + static const std::regex REGEX_DEBUG_DYNAMIC(R"(/DEFAULTLIB:MSVCRTD)", std::regex_constants::icase); + static const std::regex REGEX_RELEASE_STATIC(R"(/DEFAULTLIB:LIBCMT[^D])", std::regex_constants::icase); + static const std::regex REGEX_RELEASE_DYNAMIC(R"(/DEFAULTLIB:MSVCRT[^D])", std::regex_constants::icase); + + switch (backing_enum) + { + case BuildType::DEBUG_STATIC: + return REGEX_DEBUG_STATIC; + case BuildType::DEBUG_DYNAMIC: + return REGEX_DEBUG_DYNAMIC; + case BuildType::RELEASE_STATIC: + return REGEX_RELEASE_STATIC; + case BuildType::RELEASE_DYNAMIC: + return REGEX_RELEASE_DYNAMIC; + default: + Enums::unreachable(ENUM_NAME); + } } - std::string BuildType::toString() const + const std::string& type::toString() const { - const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); - return s; - } + static const std::string NAME_DEBUG_STATIC("Debug,Static"); + static const std::string NAME_DEBUG_DYNAMIC("Debug,Dynamic"); + static const std::string NAME_RELEASE_STATIC("Release,Static"); + static const std::string NAME_RELEASE_DYNAMIC("Release,Dynamic"); - bool operator==(const BuildType& lhs, const BuildType& rhs) - { - return lhs.config() == rhs.config() && lhs.linkage() == rhs.linkage(); - } - - bool operator!=(const BuildType& lhs, const BuildType& rhs) - { - return !(lhs == rhs); + switch (backing_enum) + { + case BuildType::DEBUG_STATIC: + return NAME_DEBUG_STATIC; + case BuildType::DEBUG_DYNAMIC: + return NAME_DEBUG_DYNAMIC; + case BuildType::RELEASE_STATIC: + return NAME_RELEASE_STATIC; + case BuildType::RELEASE_DYNAMIC: + return NAME_RELEASE_DYNAMIC; + default: + Enums::unreachable(ENUM_NAME); + } } } diff --git a/toolsrc/src/PostBuildLint_ConfigurationType.cpp b/toolsrc/src/PostBuildLint_ConfigurationType.cpp index 9c3499cac3..990b10a37c 100644 --- a/toolsrc/src/PostBuildLint_ConfigurationType.cpp +++ b/toolsrc/src/PostBuildLint_ConfigurationType.cpp @@ -1,19 +1,26 @@ #include "pch.h" #include "PostBuildLint_ConfigurationType.h" -#include "vcpkg_Checks.h" +#include "vcpkg_Enums.h" -namespace vcpkg::PostBuildLint +namespace vcpkg::PostBuildLint::ConfigurationType { - std::string to_string(const ConfigurationType& conf) + static const std::string NULLVALUE_STRING = Enums::nullvalue_toString(ENUM_NAME); + + static const std::string NAME_DEBUG = "Debug"; + static const std::string NAME_RELEASE = "Release"; + + const std::string& type::toString() const { - switch (conf) + switch (this->backing_enum) { - case ConfigurationType::DEBUG: - return "Debug"; - case ConfigurationType::RELEASE: - return "Release"; - default: - Checks::unreachable(); + case ConfigurationType::DEBUG: + return NAME_DEBUG; + case ConfigurationType::RELEASE: + return NAME_RELEASE; + case ConfigurationType::NULLVALUE: + return NULLVALUE_STRING; + default: + Enums::unreachable(ENUM_NAME); } } } diff --git a/toolsrc/src/PostBuildLint_LinkageType.cpp b/toolsrc/src/PostBuildLint_LinkageType.cpp index 8a3f35be8a..6d2c2c9359 100644 --- a/toolsrc/src/PostBuildLint_LinkageType.cpp +++ b/toolsrc/src/PostBuildLint_LinkageType.cpp @@ -1,34 +1,41 @@ #include "pch.h" #include "PostBuildLint_LinkageType.h" -#include "vcpkg_Checks.h" +#include "vcpkg_Enums.h" -namespace vcpkg::PostBuildLint +namespace vcpkg::PostBuildLint::LinkageType { - LinkageType linkage_type_value_of(const std::string& as_string) + static const std::string NULLVALUE_STRING = Enums::nullvalue_toString(ENUM_NAME); + + static const std::string NAME_DYNAMIC = "dynamic"; + static const std::string NAME_STATIC = "static"; + + const std::string& type::toString() const { - if (as_string == "dynamic") + switch (this->backing_enum) + { + case LinkageType::DYNAMIC: + return NAME_DYNAMIC; + case LinkageType::STATIC: + return NAME_STATIC; + case LinkageType::NULLVALUE: + return NULLVALUE_STRING; + default: + Enums::unreachable(ENUM_NAME); + } + } + + type value_of(const std::string& as_string) + { + if (as_string == NAME_DYNAMIC) { return LinkageType::DYNAMIC; } - if (as_string == "static") + if (as_string == NAME_STATIC) { return LinkageType::STATIC; } - return LinkageType::UNKNOWN; - } - - std::string to_string(const LinkageType& build_info) - { - switch (build_info) - { - case LinkageType::STATIC: - return "static"; - case LinkageType::DYNAMIC: - return "dynamic"; - default: - Checks::unreachable(); - } + return LinkageType::NULLVALUE; } } From a13b2f0c92d1cd5322ed0cb839a4bba5b1ab6aa7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Feb 2017 18:10:29 -0800 Subject: [PATCH 323/561] build_package() modified to return the result of the build --- toolsrc/include/PostBuildLint.h | 2 +- toolsrc/include/vcpkg_Commands.h | 11 +++++++++- toolsrc/src/PostBuildLint.cpp | 8 ++++---- toolsrc/src/commands_build.cpp | 27 ++++++++++++++++++++----- toolsrc/src/commands_build_external.cpp | 7 ++++++- toolsrc/src/commands_install.cpp | 6 +++++- 6 files changed, 48 insertions(+), 13 deletions(-) diff --git a/toolsrc/include/PostBuildLint.h b/toolsrc/include/PostBuildLint.h index 215a237aa4..73c8ec54bd 100644 --- a/toolsrc/include/PostBuildLint.h +++ b/toolsrc/include/PostBuildLint.h @@ -4,5 +4,5 @@ namespace vcpkg::PostBuildLint { - void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths); + size_t perform_all_checks(const package_spec& spec, const vcpkg_paths& paths); } diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 8d772b255f..ef300ac121 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -11,7 +11,16 @@ namespace vcpkg::Commands namespace Build { - void build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); + enum class BuildResult + { + BUILD_NOT_STARTED = 0, + SUCCESS, + CASCADED_DUE_TO_MISSING_DEPENDENCIES, + BUILD_FAILED, + POST_BUILD_CHECKS_FAILED, + }; + + BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); } diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 23f1347cfa..a5fd7aa52e 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -619,6 +619,7 @@ namespace vcpkg::PostBuildLint left += static_cast(right); } + static size_t perform_all_checks_and_return_error_count(const package_spec& spec, const vcpkg_paths& paths) { const fs::path dumpbin_exe = Environment::get_dumpbin_exe(paths); @@ -710,19 +711,18 @@ namespace vcpkg::PostBuildLint return error_count; } - void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths) + size_t perform_all_checks(const package_spec& spec, const vcpkg_paths& paths) { System::println("-- Performing post-build validation"); - const size_t error_count = perform_all_checks_and_return_error_count(spec, paths); + System::println("-- Performing post-build validation done"); if (error_count != 0) { const fs::path portfile = paths.ports / spec.name() / "portfile.cmake"; System::println(System::color::error, "Found %u error(s). Please correct the portfile:\n %s", error_count, portfile.string()); - exit(EXIT_FAILURE); } - System::println("-- Performing post-build validation done"); + return error_count; } } diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index c5a2784506..a9c6469d79 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -9,6 +9,7 @@ #include "vcpkg_Environment.h" #include "metrics.h" #include "vcpkg_info.h" +#include "vcpkg_Enums.h" namespace vcpkg::Commands::Build { @@ -24,7 +25,7 @@ namespace vcpkg::Commands::Build std::ofstream(binary_control_file) << bpgh; } - void build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) + BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) { Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_internal()"); const triplet& target_triplet = spec.target_triplet(); @@ -58,15 +59,22 @@ namespace vcpkg::Commands::Build , spec.toString(), Info::version()); TrackProperty("error", "build failed"); TrackProperty("build_error", spec.toString()); - exit(EXIT_FAILURE); + return BuildResult::BUILD_FAILED; } - PostBuildLint::perform_all_checks(spec, paths); + const size_t error_count = PostBuildLint::perform_all_checks(spec, paths); + + if (error_count != 0) + { + return BuildResult::POST_BUILD_CHECKS_FAILED; + } create_binary_control_file(paths, source_paragraph, target_triplet); // const fs::path port_buildtrees_dir = paths.buildtrees / spec.name; // delete_directory(port_buildtrees_dir); + + return BuildResult::SUCCESS; } void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) @@ -86,7 +94,11 @@ namespace vcpkg::Commands::Build const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_CHECKS_ONLY}); if (options.find(OPTION_CHECKS_ONLY) != options.end()) { - PostBuildLint::perform_all_checks(spec, paths); + const size_t error_count = PostBuildLint::perform_all_checks(spec, paths); + if (error_count > 0) + { + exit(EXIT_FAILURE); + } exit(EXIT_SUCCESS); } @@ -125,7 +137,12 @@ namespace vcpkg::Commands::Build } Environment::ensure_utilities_on_path(paths); - build_package(spgh, spec, paths, paths.port_dir(spec)); + const BuildResult result = build_package(spgh, spec, paths, paths.port_dir(spec)); + if (result != BuildResult::SUCCESS) + { + exit(EXIT_FAILURE); + } + exit(EXIT_SUCCESS); } } diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index 5c3fa9857e..8e9bf50fde 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -21,7 +21,12 @@ namespace vcpkg::Commands::BuildExternal const expected maybe_spgh = try_load_port(port_dir); if (auto spgh = maybe_spgh.get()) { - Commands::Build::build_package(*spgh, *spec, paths, port_dir); + const Build::BuildResult result = Commands::Build::build_package(*spgh, *spec, paths, port_dir); + if (result !=Build::BuildResult::SUCCESS) + { + exit(EXIT_FAILURE); + } + exit(EXIT_SUCCESS); } } diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 1f5a2234d8..48da05e9c9 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -214,7 +214,11 @@ namespace vcpkg::Commands::Install } else if (action.plan.plan_type == install_plan_type::BUILD_AND_INSTALL) { - Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec)); + const Build::BuildResult result = Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec)); + if (result != Build::BuildResult::SUCCESS) + { + exit(EXIT_FAILURE); + } const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); install_package(paths, bpgh, &status_db); System::println(System::color::success, "Package %s is installed", action.spec); From d46370aae5a3d94203b2614ea927b50d271c62b3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Feb 2017 12:37:35 -0800 Subject: [PATCH 324/561] Fix error message --- toolsrc/src/commands_build.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index a9c6469d79..9efa114d2c 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -27,7 +27,7 @@ namespace vcpkg::Commands::Build BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) { - Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_internal()"); + Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_package()"); const triplet& target_triplet = spec.target_triplet(); const fs::path ports_cmake_script_path = paths.ports_cmake; From a0eb236eaa21d44351d0adcf7e4525f0a99e0c08 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Feb 2017 13:59:56 -0800 Subject: [PATCH 325/561] Remove unused #include --- toolsrc/src/commands_build.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 9efa114d2c..fa2468e1c4 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -9,7 +9,6 @@ #include "vcpkg_Environment.h" #include "metrics.h" #include "vcpkg_info.h" -#include "vcpkg_Enums.h" namespace vcpkg::Commands::Build { From 4cef21b894b5ce8507447c6c63fb0f00228b75ec Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 11 Feb 2017 09:51:02 -0800 Subject: [PATCH 326/561] [bootstrap] Specify NuGet Source to avoid impact from user config. --- scripts/findVisualStudioInstallationInstances.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 951975758c..9034ddfa8f 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -14,7 +14,7 @@ $nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" $nugetPackageDir = "$downloadsDir\nuget-packages" $SetupAPIVersion = "1.5.125-rc" -$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Version $SetupAPIVersion -OutputDirectory $nugetPackageDir -nocache 2>&1 +$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Version $SetupAPIVersion -OutputDirectory $nugetPackageDir -Source "https://api.nuget.org/v3/index.json" -nocache 2>&1 $SetupConsoleExe = "$nugetPackageDir\Microsoft.VisualStudio.Setup.Configuration.Native.$SetupAPIVersion\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Console.exe" From c9bf4b613867177001176f7f8bba5c883b6e4361 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 11 Feb 2017 10:39:57 -0800 Subject: [PATCH 327/561] [sfml] Update to 2.4.2 --- ports/sfml/CONTROL | 2 +- ports/sfml/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/sfml/CONTROL b/ports/sfml/CONTROL index 175aaa0ab6..e7fb08ecd7 100644 --- a/ports/sfml/CONTROL +++ b/ports/sfml/CONTROL @@ -1,4 +1,4 @@ Source: sfml -Version: 2.4.1 +Version: 2.4.2 Description: Simple and fast multimedia library Build-Depends: freetype, libflac, libjpeg-turbo, libogg, libvorbis, openal-soft, stb diff --git a/ports/sfml/portfile.cmake b/ports/sfml/portfile.cmake index 916b033ef3..69f114ca54 100644 --- a/ports/sfml/portfile.cmake +++ b/ports/sfml/portfile.cmake @@ -1,10 +1,10 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SFML-2.4.1) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SFML-2.4.2) vcpkg_download_distfile(ARCHIVE - URLS "http://www.sfml-dev.org/files/SFML-2.4.1-sources.zip" - FILENAME "SFML-2.4.1-sources.zip" - SHA512 e2a49927e1db6ab94fa52b88460782fa2b28ccd4a8c75793e10c7669b24736f63aab723c2e1d8befc96f6f5cf4ed185f13da2550da721d206780003f158e5507) + URLS "http://www.sfml-dev.org/files/SFML-2.4.2-sources.zip" + FILENAME "SFML-2.4.2-sources.zip" + SHA512 14f2b9f244bbff681d1992581f20012f3073456e4baed0fb2bf2cf82538e9c5ddd8ce01b0cfb3874af47091ec19654aa23c426df04fe1ffcfa209623dc362f85) vcpkg_extract_source_archive(${ARCHIVE}) From a932e5fc209db0bfae032da585de7d86d98c5d7a Mon Sep 17 00:00:00 2001 From: Iraklis Karagkiozoglou Date: Mon, 13 Feb 2017 05:35:12 +0200 Subject: [PATCH 328/561] libnice port --- ports/libnice/CMakeLists.txt | 144 +++++++++++++++++++++++++++++++++++ ports/libnice/CONTROL | 4 + ports/libnice/portfile.cmake | 32 ++++++++ 3 files changed, 180 insertions(+) create mode 100644 ports/libnice/CMakeLists.txt create mode 100644 ports/libnice/CONTROL create mode 100644 ports/libnice/portfile.cmake diff --git a/ports/libnice/CMakeLists.txt b/ports/libnice/CMakeLists.txt new file mode 100644 index 0000000000..3c8206cda0 --- /dev/null +++ b/ports/libnice/CMakeLists.txt @@ -0,0 +1,144 @@ +cmake_minimum_required(VERSION 3.0) +project(libnice C) +SET (this_target libnice) + +add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS) + +configure_file(${CMAKE_SOURCE_DIR}/win32/vs9/config.h ${CMAKE_SOURCE_DIR}/config.h COPYONLY) +configure_file(${CMAKE_SOURCE_DIR}/win32/vs9/libnice.def ${CMAKE_SOURCE_DIR}/libnice.def COPYONLY) + +find_path(GLIB_INCLUDE_DIR glib.h) +find_library(GLIB_LIBRARY glib-2.0) +find_library(GOBJECT_LIBRARY gobject-2.0) +find_library(GIO_LIBRARY gio-2.0) +find_library(IPHLPAPI_LIBRARY iphlpapi) +find_library(WS2_32_LIB ws2_32) +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/agent + ${CMAKE_CURRENT_SOURCE_DIR}/random + ${CMAKE_CURRENT_SOURCE_DIR}/socket + ${CMAKE_CURRENT_SOURCE_DIR}/stun + ${GLIB_INCLUDE_DIR}) + + +## section: source files +# Add your source files here (one file per line), please SORT in alphabetical order for future maintenance +SET (SRCS + ./agent/address.c + ./agent/agent.c + ./agent/candidate.c + ./agent/component.c + ./agent/conncheck.c + ./agent/debug.c + ./agent/discovery.c + ./agent/discovery.c + ./agent/inputstream.c + ./agent/interfaces.c + ./agent/iostream.c + ./agent/outputstream.c + ./agent/pseudotcp.c + ./agent/stream.c + ./random/random.c + ./random/random-glib.c + ./socket/http.c + ./socket/pseudossl.c + ./socket/socket.c + ./socket/socks5.c + ./socket/tcp-active.c + ./socket/tcp-bsd.c + ./socket/tcp-passive.c + ./socket/udp-bsd.c + ./socket/udp-turn.c + ./socket/udp-turn-over-tcp.c + ./stun/debug.c + ./stun/md5.c + ./stun/rand.c + ./stun/sha1.c + ./stun/stun5389.c + ./stun/stunagent.c + ./stun/stuncrc32.c + ./stun/stunhmac.c + ./stun/stunmessage.c + ./stun/usages/bind.c + ./stun/usages/ice.c + ./stun/usages/timer.c + ./stun/usages/turn.c + ./stun/utils.c + ./libnice.def + ) + +## section: header files +# Add your header files here(one file per line), please SORT in alphabetical order for future maintenance! +SET(HEADERS + ./config.h + ./agent/address.h + ./agent/agent.h + ./agent/agent-priv.h + ./agent/candidate.h + ./agent/component.h + ./agent/conncheck.h + ./agent/debug.h + ./agent/discovery.h + ./agent/discovery.h + ./agent/inputstream.h + ./agent/interfaces.h + ./agent/iostream.h + ./agent/outputstream.h + ./agent/pseudotcp.h + ./agent/stream.h + ./random/random.h + ./random/random-glib.h + ./socket/http.h + ./socket/pseudossl.h + ./socket/socket.h + ./socket/socks5.h + ./socket/tcp-active.h + ./socket/tcp-bsd.h + ./socket/tcp-passive.h + ./socket/udp-bsd.h + ./socket/udp-turn.h + ./socket/udp-turn-over-tcp.h + ./stun/constants.h + ./stun/debug.h + ./stun/md5.h + ./stun/rand.h + ./stun/sha1.h + ./stun/stun5389.h + ./stun/stunagent.h + ./stun/stuncrc32.h + ./stun/stunhmac.h + ./stun/stunmessage.h + ./stun/usages/bind.h + ./stun/usages/ice.h + ./stun/usages/timer.h + ./stun/usages/turn.h + ./stun/utils.h + ./stun/win32_common.h + ) +add_library(libnice ${SRCS} ${HEADERS}) +set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/wd4244 /wd4005 /wd4391 /wd4142 /wd4267") +target_link_libraries(libnice ${IPHLPAPI_LIBRARY} ${WS2_32_LIB} ${GLIB_LIBRARY} ${GOBJECT_LIBRARY} ${GIO_LIBRARY}) +install(TARGETS libnice +RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) + +if (${CMAKE_BUILD_TYPE} STREQUAL "Release") +install(FILES agent/address.h DESTINATION include/nice) +install(FILES agent/agent.h DESTINATION include/nice) +install(FILES agent/candidate.h DESTINATION include/nice) +install(FILES agent/debug.h DESTINATION include/nice) +install(FILES agent/interfaces.h DESTINATION include/nice) +install(FILES nice/nice.h DESTINATION include/nice) +install(FILES agent/pseudotcp.h DESTINATION include/nice) +install(FILES stun/constants.h DESTINATION include/stun) +install(FILES stun/debug.h DESTINATION include/stun) +install(FILES stun/stunagent.h DESTINATION include/stun) +install(FILES stun/stunmessage.h DESTINATION include/stun) +install(FILES stun/usages/bind.h DESTINATION include/stun/usages) +install(FILES stun/usages/ice.h DESTINATION include/stun/usages) +install(FILES stun/usages/timer.h DESTINATION include/stun/usages) +install(FILES stun/usages/turn.h DESTINATION include/stun/usages) +install(FILES stun/win32_common.h DESTINATION include/stun) +endif() \ No newline at end of file diff --git a/ports/libnice/CONTROL b/ports/libnice/CONTROL new file mode 100644 index 0000000000..7d16f42622 --- /dev/null +++ b/ports/libnice/CONTROL @@ -0,0 +1,4 @@ +Source: libnice +Version: 0.1.13 +Description: Libnice is an implementation of the IETF's Interactive Connectivity Establishment (ICE) standard (RFC 5245) and the Session Traversal Utilities for NAT (STUN) standard (RFC 5389). +Build-Depends: glib \ No newline at end of file diff --git a/ports/libnice/portfile.cmake b/ports/libnice/portfile.cmake new file mode 100644 index 0000000000..eb829d4a4f --- /dev/null +++ b/ports/libnice/portfile.cmake @@ -0,0 +1,32 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libnice-0.1.13) +vcpkg_download_distfile(ARCHIVE + URLS "https://nice.freedesktop.org/releases/libnice-0.1.13.tar.gz" + FILENAME "libnice-0.1.13.tar.gz" + SHA512 c9bb81e8cd0b4e3673dba07ce08a16dd8821831339b44f1006510cdc09f9ae4c6eb7d43230711a2509867acb8d7df71821c411830dbf71c5a5d7e802f14a32c1 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS_RELEASE -DOPTIMIZE=1 + OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libnice) +file(COPY ${SOURCE_PATH}/COPYING.LGPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/libnice) +file(COPY ${SOURCE_PATH}/COPYING.MPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/libnice) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libnice/COPYING ${CURRENT_PACKAGES_DIR}/share/libnice/copyright) From a82a0c01b5762470c3e15d3fd1538b2af469cca8 Mon Sep 17 00:00:00 2001 From: Iraklis Karagkiozoglou Date: Mon, 13 Feb 2017 05:45:28 +0200 Subject: [PATCH 329/561] Remove auto generated comments --- ports/libnice/CMakeLists.txt | 5 ----- ports/libnice/portfile.cmake | 13 ++++--------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/ports/libnice/CMakeLists.txt b/ports/libnice/CMakeLists.txt index 3c8206cda0..c631d33171 100644 --- a/ports/libnice/CMakeLists.txt +++ b/ports/libnice/CMakeLists.txt @@ -22,8 +22,6 @@ include_directories( ${GLIB_INCLUDE_DIR}) -## section: source files -# Add your source files here (one file per line), please SORT in alphabetical order for future maintenance SET (SRCS ./agent/address.c ./agent/agent.c @@ -67,9 +65,6 @@ SET (SRCS ./stun/utils.c ./libnice.def ) - -## section: header files -# Add your header files here(one file per line), please SORT in alphabetical order for future maintenance! SET(HEADERS ./config.h ./agent/address.h diff --git a/ports/libnice/portfile.cmake b/ports/libnice/portfile.cmake index eb829d4a4f..4d4a97baec 100644 --- a/ports/libnice/portfile.cmake +++ b/ports/libnice/portfile.cmake @@ -1,13 +1,7 @@ -# Common Ambient Variables: -# VCPKG_ROOT_DIR = -# TARGET_TRIPLET is the current triplet (x86-windows, etc) -# PORT is the current port name (zlib, etc) -# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} -# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} -# - include(vcpkg_common_functions) + set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libnice-0.1.13) + vcpkg_download_distfile(ARCHIVE URLS "https://nice.freedesktop.org/releases/libnice-0.1.13.tar.gz" FILENAME "libnice-0.1.13.tar.gz" @@ -16,6 +10,7 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS_RELEASE -DOPTIMIZE=1 @@ -23,9 +18,9 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() + vcpkg_copy_pdbs() -# Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libnice) file(COPY ${SOURCE_PATH}/COPYING.LGPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/libnice) file(COPY ${SOURCE_PATH}/COPYING.MPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/libnice) From a59f6dda5ee6874e859276bbc3066247d705a904 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 12 Feb 2017 23:54:05 -0800 Subject: [PATCH 330/561] [libepoxy] Disable static builds due to dllimport/export issues. --- ports/libepoxy/CONTROL | 2 +- ports/libepoxy/portfile.cmake | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/libepoxy/CONTROL b/ports/libepoxy/CONTROL index 8ac70cd224..963a3e17a3 100644 --- a/ports/libepoxy/CONTROL +++ b/ports/libepoxy/CONTROL @@ -1,3 +1,3 @@ Source: libepoxy -Version: 1.4.0-2432daf +Version: 1.4.0-2432daf-1 Description: Epoxy is a library for handling OpenGL function pointer management for you diff --git a/ports/libepoxy/portfile.cmake b/ports/libepoxy/portfile.cmake index 188cd3668c..ef1880d16d 100644 --- a/ports/libepoxy/portfile.cmake +++ b/ports/libepoxy/portfile.cmake @@ -1,3 +1,7 @@ +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported yet. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libepoxy-2432daf4cf58b5ff11e008ca34811588285c43b3) From 7bc68516386015730ff5062b54534226df8c7763 Mon Sep 17 00:00:00 2001 From: Guillaume Dumont Date: Mon, 13 Feb 2017 12:04:53 -0500 Subject: [PATCH 331/561] Updated patch to fix sizeof off_t differences between UNIX and Windows --- ...8275d2a410e683bae4ef44881e0f55fa3c4d.patch | 436 ++++++++++-------- 1 file changed, 231 insertions(+), 205 deletions(-) diff --git a/ports/lmdb/lmdb_45a88275d2a410e683bae4ef44881e0f55fa3c4d.patch b/ports/lmdb/lmdb_45a88275d2a410e683bae4ef44881e0f55fa3c4d.patch index 18fd36fd66..e6d1f108c0 100644 --- a/ports/lmdb/lmdb_45a88275d2a410e683bae4ef44881e0f55fa3c4d.patch +++ b/ports/lmdb/lmdb_45a88275d2a410e683bae4ef44881e0f55fa3c4d.patch @@ -252,7 +252,7 @@ index c4d05d1..30d5862 100644 /** @brief Compare two data items according to a particular database. * diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c -index d2e81e4..0110402 100644 +index d2e81e4..1d9e9fa 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -35,9 +35,42 @@ @@ -298,7 +298,26 @@ index d2e81e4..0110402 100644 /** getpid() returns int; MinGW defines pid_t but MinGW64 typedefs it * as int64 which is wrong. MSVC doesn't define it at all, so just * don't use it. -@@ -116,7 +149,9 @@ typedef SSIZE_T ssize_t; +@@ -56,6 +89,10 @@ + # define SSIZE_MAX INT_MAX + # endif + #endif ++/* Windows uses 32-bit off_t to define our own ++ 64 bit offset type ++*/ ++#define offset_t __int64 + #else + #include + #include +@@ -68,6 +105,7 @@ + #include + #endif + #include ++#define offset_t off_t + #endif + + #if defined(__mips) && defined(__linux) +@@ -116,7 +154,9 @@ typedef SSIZE_T ssize_t; #endif #if defined(__APPLE__) || defined (BSD) @@ -309,7 +328,7 @@ index d2e81e4..0110402 100644 # define MDB_FDATASYNC fsync #elif defined(ANDROID) # define MDB_FDATASYNC fsync -@@ -127,12 +162,22 @@ typedef SSIZE_T ssize_t; +@@ -127,12 +167,22 @@ typedef SSIZE_T ssize_t; #ifdef MDB_USE_POSIX_SEM # define MDB_USE_HASH 1 #include @@ -335,7 +354,7 @@ index d2e81e4..0110402 100644 + defined(MDB_USE_POSIX_MUTEX) != 1 # error "Ambiguous shared-lock implementation" #endif -@@ -183,7 +228,7 @@ typedef SSIZE_T ssize_t; +@@ -183,7 +233,7 @@ typedef SSIZE_T ssize_t; #if (BYTE_ORDER == LITTLE_ENDIAN) == (BYTE_ORDER == BIG_ENDIAN) # error "Unknown or unsupported endianness (BYTE_ORDER)" @@ -344,7 +363,7 @@ index d2e81e4..0110402 100644 # error "Two's complement, reasonably sized integer types, please" #endif -@@ -234,6 +279,8 @@ typedef SSIZE_T ssize_t; +@@ -234,6 +284,8 @@ typedef SSIZE_T ssize_t; #define MDB_NO_ROOT (MDB_LAST_ERRCODE + 10) #ifdef _WIN32 #define MDB_OWNERDEAD ((int) WAIT_ABANDONED) @@ -353,7 +372,7 @@ index d2e81e4..0110402 100644 #elif defined(MDB_USE_POSIX_MUTEX) && defined(EOWNERDEAD) #define MDB_OWNERDEAD EOWNERDEAD /**< #LOCK_MUTEX0() result if dead owner */ #endif -@@ -256,16 +303,20 @@ typedef SSIZE_T ssize_t; +@@ -256,16 +308,20 @@ typedef SSIZE_T ssize_t; # define MDB_USE_ROBUST 0 # else # define MDB_USE_ROBUST 1 @@ -378,7 +397,7 @@ index d2e81e4..0110402 100644 #define MDB_ROBUST_SUPPORTED 1 #endif -@@ -288,8 +339,10 @@ typedef HANDLE mdb_mutex_t, mdb_mutexref_t; +@@ -288,8 +344,10 @@ typedef HANDLE mdb_mutex_t, mdb_mutexref_t; #define pthread_mutex_lock(x) WaitForSingleObject(*x, INFINITE) #define pthread_cond_signal(x) SetEvent(*x) #define pthread_cond_wait(cond,mutex) do{SignalObjectAndWait(*mutex, *cond, INFINITE, FALSE); WaitForSingleObject(*mutex, INFINITE);}while(0) @@ -391,7 +410,7 @@ index d2e81e4..0110402 100644 #define LOCK_MUTEX0(mutex) WaitForSingleObject(mutex, INFINITE) #define UNLOCK_MUTEX(mutex) ReleaseMutex(mutex) #define mdb_mutex_consistent(mutex) 0 -@@ -305,12 +358,10 @@ typedef HANDLE mdb_mutex_t, mdb_mutexref_t; +@@ -305,12 +363,10 @@ typedef HANDLE mdb_mutex_t, mdb_mutexref_t; #else #define MDB_PROCESS_QUERY_LIMITED_INFORMATION 0x1000 #endif @@ -404,7 +423,7 @@ index d2e81e4..0110402 100644 /** For MDB_LOCK_FORMAT: True if readers take a pid lock in the lockfile */ #define MDB_PIDLOCK 1 -@@ -329,12 +380,46 @@ mdb_sem_wait(sem_t *sem) +@@ -329,12 +385,46 @@ mdb_sem_wait(sem_t *sem) return rc; } @@ -453,7 +472,7 @@ index d2e81e4..0110402 100644 * @{ */ typedef pthread_mutex_t mdb_mutex_t[1], *mdb_mutexref_t; -@@ -349,7 +434,7 @@ typedef pthread_mutex_t mdb_mutex_t[1], *mdb_mutexref_t; +@@ -349,7 +439,7 @@ typedef pthread_mutex_t mdb_mutex_t[1], *mdb_mutexref_t; /** Mark mutex-protected data as repaired, after death of previous owner. */ #define mdb_mutex_consistent(mutex) pthread_mutex_consistent(mutex) @@ -462,7 +481,7 @@ index d2e81e4..0110402 100644 /** Get the error code for the last failed system function. */ -@@ -374,12 +459,24 @@ typedef pthread_mutex_t mdb_mutex_t[1], *mdb_mutexref_t; +@@ -374,12 +464,24 @@ typedef pthread_mutex_t mdb_mutex_t[1], *mdb_mutexref_t; #define GET_PAGESIZE(x) ((x) = sysconf(_SC_PAGE_SIZE)) #endif @@ -487,7 +506,7 @@ index d2e81e4..0110402 100644 /** @} */ #ifdef MDB_ROBUST_SUPPORTED -@@ -521,7 +618,7 @@ static txnid_t mdb_debug_start; +@@ -521,7 +623,7 @@ static txnid_t mdb_debug_start; /** The version number for a database's datafile format. */ #define MDB_DATA_VERSION ((MDB_DEVEL) ? 999 : 1) /** The version number for a database's lockfile format. */ @@ -496,7 +515,7 @@ index d2e81e4..0110402 100644 /** @brief The max size of a key we can write, or 0 for computed max. * -@@ -712,6 +809,9 @@ typedef struct MDB_txbody { +@@ -712,6 +814,9 @@ typedef struct MDB_txbody { uint32_t mtb_format; #if defined(_WIN32) || defined(MDB_USE_POSIX_SEM) char mtb_rmname[MNAME_LEN]; @@ -506,7 +525,7 @@ index d2e81e4..0110402 100644 #else /** Mutex protecting access to this table. * This is the reader table lock used with LOCK_MUTEX(). -@@ -740,12 +840,19 @@ typedef struct MDB_txninfo { +@@ -740,12 +845,19 @@ typedef struct MDB_txninfo { #define mti_rmname mt1.mtb.mtb_rmname #define mti_txnid mt1.mtb.mtb_txnid #define mti_numreaders mt1.mtb.mtb_numreaders @@ -526,7 +545,7 @@ index d2e81e4..0110402 100644 #else mdb_mutex_t mt2_wmutex; #define mti_wmutex mt2.mt2_wmutex -@@ -760,12 +867,27 @@ typedef struct MDB_txninfo { +@@ -760,12 +872,27 @@ typedef struct MDB_txninfo { ((uint32_t) \ ((MDB_LOCK_VERSION) \ /* Flags which describe functionality */ \ @@ -557,7 +576,7 @@ index d2e81e4..0110402 100644 */ typedef struct MDB_page { #define mp_pgno mp_p.p_pgno -@@ -774,7 +896,7 @@ typedef struct MDB_page { +@@ -774,7 +901,7 @@ typedef struct MDB_page { pgno_t p_pgno; /**< page number */ struct MDB_page *p_next; /**< for in-memory list of freed pages */ } mp_p; @@ -566,7 +585,7 @@ index d2e81e4..0110402 100644 /** @defgroup mdb_page Page Flags * @ingroup internal * Flags for the page headers. -@@ -841,7 +963,9 @@ typedef struct MDB_page { +@@ -841,7 +968,9 @@ typedef struct MDB_page { /** The number of overflow pages needed to store the given size. */ #define OVPAGES(size, psize) ((PAGEHDRSZ-1 + (size)) / (psize) + 1) @@ -577,7 +596,7 @@ index d2e81e4..0110402 100644 #define NEXT_LOOSE_PAGE(p) (*(MDB_page **)((p) + 2)) /** Header for a single key/data pair within a page. -@@ -924,7 +1048,7 @@ typedef struct MDB_node { +@@ -924,7 +1053,7 @@ typedef struct MDB_node { #ifdef MISALIGNED_OK #define COPY_PGNO(dst,src) dst = src #else @@ -586,7 +605,7 @@ index d2e81e4..0110402 100644 #define COPY_PGNO(dst,src) do { \ unsigned short *s, *d; \ s = (unsigned short *)&(src); \ -@@ -965,13 +1089,13 @@ typedef struct MDB_db { +@@ -965,13 +1094,13 @@ typedef struct MDB_db { pgno_t md_branch_pages; /**< number of internal pages */ pgno_t md_leaf_pages; /**< number of leaf pages */ pgno_t md_overflow_pages; /**< number of overflow pages */ @@ -602,7 +621,7 @@ index d2e81e4..0110402 100644 #define VALID_FLAGS (MDB_REVERSEKEY|MDB_DUPSORT|MDB_INTEGERKEY|MDB_DUPFIXED|\ MDB_INTEGERDUP|MDB_REVERSEDUP|MDB_CREATE) -@@ -995,14 +1119,25 @@ typedef struct MDB_meta { +@@ -995,14 +1124,25 @@ typedef struct MDB_meta { uint32_t mm_magic; /** Version number of this file. Must be set to #MDB_DATA_VERSION. */ uint32_t mm_version; @@ -630,7 +649,7 @@ index d2e81e4..0110402 100644 volatile txnid_t mm_txnid; /**< txnid that committed this page */ } MDB_meta; -@@ -1039,6 +1174,9 @@ struct MDB_txn { +@@ -1039,6 +1179,9 @@ struct MDB_txn { /** Nested txn under this txn, set together with flag #MDB_TXN_HAS_CHILD */ MDB_txn *mt_child; pgno_t mt_next_pgno; /**< next unallocated page */ @@ -640,7 +659,7 @@ index d2e81e4..0110402 100644 /** The ID of this transaction. IDs are integers incrementing from 1. * Only committed write transactions increment the ID. If a transaction * aborts, the ID may be re-used by the next writer. -@@ -1052,7 +1190,7 @@ struct MDB_txn { +@@ -1052,7 +1195,7 @@ struct MDB_txn { * in this transaction, linked through #NEXT_LOOSE_PAGE(page). */ MDB_page *mt_loose_pgs; @@ -649,7 +668,7 @@ index d2e81e4..0110402 100644 int mt_loose_count; /** The sorted list of dirty pages we temporarily wrote to disk * because the dirty list was full. page numbers in here are -@@ -1085,6 +1223,19 @@ struct MDB_txn { +@@ -1085,6 +1228,19 @@ struct MDB_txn { MDB_cursor **mt_cursors; /** Array of flags for each DB */ unsigned char *mt_dbflags; @@ -669,7 +688,7 @@ index d2e81e4..0110402 100644 /** Number of DB records in use, or 0 when the txn is finished. * This number only ever increments until the txn finishes; we * don't decrement it when individual DB handles are closed. -@@ -1096,7 +1247,9 @@ struct MDB_txn { +@@ -1096,7 +1252,9 @@ struct MDB_txn { * @{ */ /** #mdb_txn_begin() flags */ @@ -680,7 +699,7 @@ index d2e81e4..0110402 100644 #define MDB_TXN_RDONLY MDB_RDONLY /**< read-only transaction */ /* internal txn flags */ #define MDB_TXN_WRITEMAP MDB_WRITEMAP /**< copy of #MDB_env flag in writers */ -@@ -1162,10 +1315,24 @@ struct MDB_cursor { +@@ -1162,10 +1320,24 @@ struct MDB_cursor { #define C_SUB 0x04 /**< Cursor is a sub-cursor */ #define C_DEL 0x08 /**< last op was a cursor_del */ #define C_UNTRACK 0x40 /**< Un-track cursor when closing */ @@ -705,7 +724,7 @@ index d2e81e4..0110402 100644 }; /** Context for sorted-dup records. -@@ -1195,6 +1362,9 @@ struct MDB_env { +@@ -1195,6 +1367,9 @@ struct MDB_env { HANDLE me_fd; /**< The main data file */ HANDLE me_lfd; /**< The lock file */ HANDLE me_mfd; /**< just for writing the meta pages */ @@ -715,16 +734,18 @@ index d2e81e4..0110402 100644 /** Failed to update the meta page. Probably an I/O error. */ #define MDB_FATAL_ERROR 0x80000000U /** Some fields are initialized. */ -@@ -1219,7 +1389,7 @@ struct MDB_env { +@@ -1219,8 +1394,8 @@ struct MDB_env { void *me_pbuf; /**< scratch area for DUPSORT put() */ MDB_txn *me_txn; /**< current write transaction */ MDB_txn *me_txn0; /**< prealloc'd write transaction */ - size_t me_mapsize; /**< size of the data memory map */ +- off_t me_size; /**< current file size */ + mdb_size_t me_mapsize; /**< size of the data memory map */ - off_t me_size; /**< current file size */ ++ offset_t me_size; /**< current file size */ pgno_t me_maxpg; /**< me_mapsize / me_psize */ MDB_dbx *me_dbxs; /**< array of static DB info */ -@@ -1253,6 +1423,13 @@ struct MDB_env { + uint16_t *me_dbflags; /**< array of flags from MDB_db.md_flags */ +@@ -1253,6 +1428,13 @@ struct MDB_env { mdb_mutex_t me_rmutex; mdb_mutex_t me_wmutex; #endif @@ -738,7 +759,7 @@ index d2e81e4..0110402 100644 void *me_userctx; /**< User-settable context */ MDB_assert_func *me_assert_func; /**< Callback for assertion failures */ }; -@@ -1298,7 +1475,7 @@ enum { +@@ -1298,7 +1480,7 @@ enum { #define MDB_END_SLOT MDB_NOTLS /**< release any reader slot if #MDB_NOTLS */ static void mdb_txn_end(MDB_txn *txn, unsigned mode); @@ -747,7 +768,7 @@ index d2e81e4..0110402 100644 static int mdb_page_search_root(MDB_cursor *mc, MDB_val *key, int modify); #define MDB_PS_MODIFY 1 -@@ -1327,7 +1504,7 @@ static int mdb_node_add(MDB_cursor *mc, indx_t indx, +@@ -1327,7 +1509,7 @@ static int mdb_node_add(MDB_cursor *mc, indx_t indx, static void mdb_node_del(MDB_cursor *mc, int ksize); static void mdb_node_shrink(MDB_page *mp, indx_t indx); static int mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft); @@ -756,7 +777,7 @@ index d2e81e4..0110402 100644 static size_t mdb_leaf_size(MDB_env *env, MDB_val *key, MDB_val *data); static size_t mdb_branch_size(MDB_env *env, MDB_val *key); -@@ -1360,13 +1537,18 @@ static int mdb_reader_check0(MDB_env *env, int rlocked, int *dead); +@@ -1360,13 +1542,18 @@ static int mdb_reader_check0(MDB_env *env, int rlocked, int *dead); static MDB_cmp_func mdb_cmp_memn, mdb_cmp_memnr, mdb_cmp_int, mdb_cmp_cint, mdb_cmp_long; /** @endcond */ @@ -776,7 +797,7 @@ index d2e81e4..0110402 100644 #ifdef _WIN32 static SECURITY_DESCRIPTOR mdb_null_sd; static SECURITY_ATTRIBUTES mdb_all_sa; -@@ -1407,6 +1589,7 @@ static char *const mdb_errstr[] = { +@@ -1407,6 +1594,7 @@ static char *const mdb_errstr[] = { "MDB_BAD_TXN: Transaction must abort, has a child, or is invalid", "MDB_BAD_VALSIZE: Unsupported size of key/DB name/data, or wrong DUPFIXED size", "MDB_BAD_DBI: The specified DBI handle was closed/changed unexpectedly", @@ -784,7 +805,7 @@ index d2e81e4..0110402 100644 }; char * -@@ -1417,8 +1600,9 @@ mdb_strerror(int err) +@@ -1417,8 +1605,9 @@ mdb_strerror(int err) * This works as long as no function between the call to mdb_strerror * and the actual use of the message uses more than 4K of stack. */ @@ -796,7 +817,7 @@ index d2e81e4..0110402 100644 #endif int i; if (!err) -@@ -1450,7 +1634,7 @@ mdb_strerror(int err) +@@ -1450,7 +1639,7 @@ mdb_strerror(int err) buf[0] = 0; FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, @@ -805,7 +826,7 @@ index d2e81e4..0110402 100644 return ptr; #else return strerror(err); -@@ -1550,20 +1734,20 @@ mdb_page_list(MDB_page *mp) +@@ -1550,20 +1739,20 @@ mdb_page_list(MDB_page *mp) case P_LEAF|P_LEAF2: type = "LEAF2 page"; break; case P_LEAF|P_LEAF2|P_SUBP: type = "LEAF2 sub-page"; break; case P_OVERFLOW: @@ -830,7 +851,7 @@ index d2e81e4..0110402 100644 for (i=0; imn_data; nsize = NODESIZE + key.mv_size; if (IS_BRANCH(mp)) { @@ -839,7 +860,7 @@ index d2e81e4..0110402 100644 DKEY(&key)); total += nsize; } else { -@@ -1674,7 +1858,7 @@ static void mdb_audit(MDB_txn *txn) +@@ -1674,7 +1863,7 @@ static void mdb_audit(MDB_txn *txn) } } if (freecount + count + NUM_METAS != txn->mt_next_pgno) { @@ -848,7 +869,7 @@ index d2e81e4..0110402 100644 txn->mt_txnid, freecount, count+NUM_METAS, freecount+count+NUM_METAS, txn->mt_next_pgno); } -@@ -1691,10 +1875,8 @@ int +@@ -1691,10 +1880,8 @@ int mdb_dcmp(MDB_txn *txn, MDB_dbi dbi, const MDB_val *a, const MDB_val *b) { MDB_cmp_func *dcmp = txn->mt_dbxs[dbi].md_dcmp; @@ -860,7 +881,7 @@ index d2e81e4..0110402 100644 return dcmp(a, b); } -@@ -1774,6 +1956,51 @@ mdb_dlist_free(MDB_txn *txn) +@@ -1774,6 +1961,51 @@ mdb_dlist_free(MDB_txn *txn) dl[0].mid = 0; } @@ -912,7 +933,7 @@ index d2e81e4..0110402 100644 /** Loosen or free a single page. * Saves single pages to a list for future reuse * in this same txn. It has been pulled from the freeDB -@@ -1803,7 +2030,7 @@ mdb_page_loose(MDB_cursor *mc, MDB_page *mp) +@@ -1803,7 +2035,7 @@ mdb_page_loose(MDB_cursor *mc, MDB_page *mp) if (mp != dl[x].mptr) { /* bad cursor? */ mc->mc_flags &= ~(C_INITIALIZED|C_EOF); txn->mt_flags |= MDB_TXN_ERROR; @@ -921,7 +942,7 @@ index d2e81e4..0110402 100644 } /* ok, it's ours */ loose = 1; -@@ -1815,8 +2042,7 @@ mdb_page_loose(MDB_cursor *mc, MDB_page *mp) +@@ -1815,8 +2047,7 @@ mdb_page_loose(MDB_cursor *mc, MDB_page *mp) } } if (loose) { @@ -931,7 +952,7 @@ index d2e81e4..0110402 100644 NEXT_LOOSE_PAGE(mp) = txn->mt_loose_pgs; txn->mt_loose_pgs = mp; txn->mt_loose_count++; -@@ -1842,7 +2068,7 @@ mdb_pages_xkeep(MDB_cursor *mc, unsigned pflags, int all) +@@ -1842,7 +2073,7 @@ mdb_pages_xkeep(MDB_cursor *mc, unsigned pflags, int all) { enum { Mask = P_SUBP|P_DIRTY|P_LOOSE|P_KEEP }; MDB_txn *txn = mc->mc_txn; @@ -940,7 +961,7 @@ index d2e81e4..0110402 100644 MDB_xcursor *mx; MDB_page *dp, *mp; MDB_node *leaf; -@@ -1885,7 +2111,7 @@ mdb_pages_xkeep(MDB_cursor *mc, unsigned pflags, int all) +@@ -1885,7 +2116,7 @@ mdb_pages_xkeep(MDB_cursor *mc, unsigned pflags, int all) pgno_t pgno = txn->mt_dbs[i].md_root; if (pgno == P_INVALID) continue; @@ -949,7 +970,7 @@ index d2e81e4..0110402 100644 break; if ((dp->mp_flags & Mask) == pflags && level <= 1) dp->mp_flags ^= P_KEEP; -@@ -2074,6 +2300,8 @@ mdb_page_dirty(MDB_txn *txn, MDB_page *mp) +@@ -2074,6 +2305,8 @@ mdb_page_dirty(MDB_txn *txn, MDB_page *mp) * Do not modify the freedB, just merge freeDB records into me_pghead[] * and move me_pglast to say which records were consumed. Only this * function can create me_pghead and move me_pglast/mt_next_pgno. @@ -958,7 +979,7 @@ index d2e81e4..0110402 100644 * @param[in] mc cursor A cursor handle identifying the transaction and * database for which we are allocating. * @param[in] num the number of pages to allocate. -@@ -2111,8 +2339,7 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) +@@ -2111,8 +2344,7 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) np = txn->mt_loose_pgs; txn->mt_loose_pgs = NEXT_LOOSE_PAGE(np); txn->mt_loose_count--; @@ -968,7 +989,7 @@ index d2e81e4..0110402 100644 *mp = np; return MDB_SUCCESS; } -@@ -2149,6 +2376,14 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) +@@ -2149,6 +2381,14 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) last = env->me_pglast; oldest = env->me_pgoldest; mdb_cursor_init(&m2, txn, FREE_DBI, NULL); @@ -983,7 +1004,7 @@ index d2e81e4..0110402 100644 if (last) { op = MDB_SET_RANGE; key.mv_data = &last; /* will look up last+1 */ -@@ -2189,7 +2424,7 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) +@@ -2189,7 +2429,7 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) } np = m2.mc_pg[m2.mc_top]; leaf = NODEPTR(np, m2.mc_ki[m2.mc_top]); @@ -992,7 +1013,7 @@ index d2e81e4..0110402 100644 return rc; idl = (MDB_ID *) data.mv_data; -@@ -2206,10 +2441,10 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) +@@ -2206,10 +2446,10 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) } env->me_pglast = last; #if (MDB_DEBUG) > 1 @@ -1005,7 +1026,7 @@ index d2e81e4..0110402 100644 #endif /* Merge in descending sorted order */ mdb_midl_xmerge(mop, idl); -@@ -2224,6 +2459,20 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) +@@ -2224,6 +2464,20 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) rc = MDB_MAP_FULL; goto fail; } @@ -1026,7 +1047,7 @@ index d2e81e4..0110402 100644 search_done: if (env->me_flags & MDB_WRITEMAP) { -@@ -2365,7 +2614,7 @@ mdb_page_touch(MDB_cursor *mc) +@@ -2365,7 +2619,7 @@ mdb_page_touch(MDB_cursor *mc) (rc = mdb_page_alloc(mc, 1, &np))) goto fail; pgno = np->mp_pgno; @@ -1035,7 +1056,7 @@ index d2e81e4..0110402 100644 mp->mp_pgno, pgno)); mdb_cassert(mc, mp->mp_pgno != pgno); mdb_midl_xappend(txn->mt_free_pgs, mp->mp_pgno); -@@ -2389,7 +2638,7 @@ mdb_page_touch(MDB_cursor *mc) +@@ -2389,7 +2643,7 @@ mdb_page_touch(MDB_cursor *mc) if (mp != dl[x].mptr) { /* bad cursor? */ mc->mc_flags &= ~(C_INITIALIZED|C_EOF); txn->mt_flags |= MDB_TXN_ERROR; @@ -1044,7 +1065,7 @@ index d2e81e4..0110402 100644 } return 0; } -@@ -2439,6 +2688,7 @@ done: +@@ -2439,6 +2693,7 @@ done: } } } @@ -1052,7 +1073,7 @@ index d2e81e4..0110402 100644 return 0; fail: -@@ -2447,7 +2697,7 @@ fail: +@@ -2447,7 +2702,7 @@ fail: } int @@ -1061,7 +1082,7 @@ index d2e81e4..0110402 100644 { int rc = 0; if (env->me_flags & MDB_RDONLY) -@@ -2456,7 +2706,7 @@ mdb_env_sync(MDB_env *env, int force) +@@ -2456,7 +2711,7 @@ mdb_env_sync(MDB_env *env, int force) if (env->me_flags & MDB_WRITEMAP) { int flags = ((env->me_flags & MDB_MAPASYNC) && !force) ? MS_ASYNC : MS_SYNC; @@ -1070,7 +1091,7 @@ index d2e81e4..0110402 100644 rc = ErrCode(); #ifdef _WIN32 else if (flags == MS_SYNC && MDB_FDATASYNC(env->me_fd)) -@@ -2476,6 +2726,13 @@ mdb_env_sync(MDB_env *env, int force) +@@ -2476,6 +2731,13 @@ mdb_env_sync(MDB_env *env, int force) return rc; } @@ -1084,7 +1105,7 @@ index d2e81e4..0110402 100644 /** Back up parent txn's cursors, then grab the originals for tracking */ static int mdb_cursor_shadow(MDB_txn *src, MDB_txn *dst) -@@ -2720,6 +2977,9 @@ mdb_txn_renew0(MDB_txn *txn) +@@ -2720,6 +2982,9 @@ mdb_txn_renew0(MDB_txn *txn) /* Moved to here to avoid a data race in read TXNs */ txn->mt_next_pgno = meta->mm_last_pg+1; @@ -1094,7 +1115,7 @@ index d2e81e4..0110402 100644 txn->mt_flags = flags; -@@ -2755,7 +3015,7 @@ mdb_txn_renew(MDB_txn *txn) +@@ -2755,7 +3020,7 @@ mdb_txn_renew(MDB_txn *txn) rc = mdb_txn_renew0(txn); if (rc == MDB_SUCCESS) { @@ -1103,7 +1124,7 @@ index d2e81e4..0110402 100644 txn->mt_txnid, (txn->mt_flags & MDB_TXN_RDONLY) ? 'r' : 'w', (void *)txn, (void *)txn->mt_env, txn->mt_dbs[MAIN_DBI].md_root)); } -@@ -2798,6 +3058,17 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret) +@@ -2798,6 +3063,17 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret) DPRINTF(("calloc: %s", strerror(errno))); return ENOMEM; } @@ -1121,7 +1142,7 @@ index d2e81e4..0110402 100644 txn->mt_dbxs = env->me_dbxs; /* static */ txn->mt_dbs = (MDB_db *) ((char *)txn + tsize); txn->mt_dbflags = (unsigned char *)txn + size - env->me_maxdbs; -@@ -2825,6 +3096,9 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret) +@@ -2825,6 +3101,9 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret) parent->mt_child = txn; txn->mt_parent = parent; txn->mt_numdbs = parent->mt_numdbs; @@ -1131,7 +1152,7 @@ index d2e81e4..0110402 100644 memcpy(txn->mt_dbs, parent->mt_dbs, txn->mt_numdbs * sizeof(MDB_db)); /* Copy parent's mt_dbflags, but clear DB_NEW */ for (i=0; imt_numdbs; i++) -@@ -2850,12 +3124,16 @@ renew: +@@ -2850,12 +3129,16 @@ renew: rc = mdb_txn_renew0(txn); } if (rc) { @@ -1150,7 +1171,7 @@ index d2e81e4..0110402 100644 txn->mt_txnid, (flags & MDB_RDONLY) ? 'r' : 'w', (void *) txn, (void *) env, txn->mt_dbs[MAIN_DBI].md_root)); } -@@ -2870,7 +3148,7 @@ mdb_txn_env(MDB_txn *txn) +@@ -2870,7 +3153,7 @@ mdb_txn_env(MDB_txn *txn) return txn->mt_env; } @@ -1159,7 +1180,7 @@ index d2e81e4..0110402 100644 mdb_txn_id(MDB_txn *txn) { if(!txn) return 0; -@@ -2922,7 +3200,7 @@ mdb_txn_end(MDB_txn *txn, unsigned mode) +@@ -2922,7 +3205,7 @@ mdb_txn_end(MDB_txn *txn, unsigned mode) /* Export or close DBI handles opened in this txn */ mdb_dbis_update(txn, mode & MDB_END_UPDATE); @@ -1168,7 +1189,7 @@ index d2e81e4..0110402 100644 names[mode & MDB_END_OPMASK], txn->mt_txnid, (txn->mt_flags & MDB_TXN_RDONLY) ? 'r' : 'w', (void *) txn, (void *)env, txn->mt_dbs[MAIN_DBI].md_root)); -@@ -2976,7 +3254,31 @@ mdb_txn_end(MDB_txn *txn, unsigned mode) +@@ -2976,7 +3259,31 @@ mdb_txn_end(MDB_txn *txn, unsigned mode) mdb_midl_free(pghead); } @@ -1201,7 +1222,7 @@ index d2e81e4..0110402 100644 if (mode & MDB_END_FREE) free(txn); } -@@ -3008,6 +3310,9 @@ mdb_txn_abort(MDB_txn *txn) +@@ -3008,6 +3315,9 @@ mdb_txn_abort(MDB_txn *txn) /** Save the freelist as of this transaction to the freeDB. * This changes the freelist. Keep trying until it stabilizes. @@ -1211,7 +1232,7 @@ index d2e81e4..0110402 100644 */ static int mdb_freelist_save(MDB_txn *txn) -@@ -3096,10 +3401,10 @@ mdb_freelist_save(MDB_txn *txn) +@@ -3096,10 +3406,10 @@ mdb_freelist_save(MDB_txn *txn) #if (MDB_DEBUG) > 1 { unsigned int i = free_pgs[0]; @@ -1224,13 +1245,13 @@ index d2e81e4..0110402 100644 } #endif continue; -@@ -3210,15 +3515,16 @@ mdb_page_flush(MDB_txn *txn, int keep) +@@ -3210,15 +3520,16 @@ mdb_page_flush(MDB_txn *txn, int keep) MDB_ID2L dl = txn->mt_u.dirty_list; unsigned psize = env->me_psize, j; int i, pagecount = dl[0].mid, rc; - size_t size = 0, pos = 0; + size_t size = 0; -+ off_t pos = 0; ++ offset_t pos = 0; pgno_t pgno = 0; MDB_page *dp = NULL; #ifdef _WIN32 @@ -1240,11 +1261,11 @@ index d2e81e4..0110402 100644 - ssize_t wpos = 0, wsize = 0, wres; - size_t next_pos = 1; /* impossible pos, so pos != next_pos */ + ssize_t wsize = 0, wres; -+ off_t wpos = 0, next_pos = 1; /* impossible pos, so pos != next_pos */ ++ offset_t wpos = 0, next_pos = 1; /* impossible pos, so pos != next_pos */ int n = 0; #endif -@@ -3266,7 +3572,7 @@ mdb_page_flush(MDB_txn *txn, int keep) +@@ -3266,7 +3577,7 @@ mdb_page_flush(MDB_txn *txn, int keep) * the write offset, to at least save the overhead of a Seek * system call. */ @@ -1253,7 +1274,7 @@ index d2e81e4..0110402 100644 memset(&ov, 0, sizeof(ov)); ov.Offset = pos & 0xffffffff; ov.OffsetHigh = pos >> 16 >> 16; -@@ -3317,7 +3623,7 @@ retry_seek: +@@ -3317,7 +3628,7 @@ retry_seek: wpos = pos; wsize = 0; } @@ -1262,7 +1283,7 @@ index d2e81e4..0110402 100644 next_pos = pos + size; iov[n].iov_len = size; iov[n].iov_base = (char *)dp; -@@ -3325,6 +3631,10 @@ retry_seek: +@@ -3325,6 +3636,10 @@ retry_seek: n++; #endif /* _WIN32 */ } @@ -1273,7 +1294,7 @@ index d2e81e4..0110402 100644 /* MIPS has cache coherency issues, this is a no-op everywhere else * Note: for any size >= on-chip cache size, entire on-chip cache is -@@ -3526,7 +3836,7 @@ mdb_txn_commit(MDB_txn *txn) +@@ -3526,7 +3841,7 @@ mdb_txn_commit(MDB_txn *txn) !(txn->mt_flags & (MDB_TXN_DIRTY|MDB_TXN_SPILLS))) goto done; @@ -1282,7 +1303,7 @@ index d2e81e4..0110402 100644 txn->mt_txnid, (void*)txn, (void*)env, txn->mt_dbs[MAIN_DBI].md_root)); /* Update DB root pointers */ -@@ -3564,9 +3874,12 @@ mdb_txn_commit(MDB_txn *txn) +@@ -3564,9 +3879,12 @@ mdb_txn_commit(MDB_txn *txn) mdb_audit(txn); #endif @@ -1298,7 +1319,7 @@ index d2e81e4..0110402 100644 goto fail; end_mode = MDB_END_COMMITTED|MDB_END_UPDATE; -@@ -3621,7 +3934,7 @@ mdb_env_read_header(MDB_env *env, MDB_meta *meta) +@@ -3621,7 +3939,7 @@ mdb_env_read_header(MDB_env *env, MDB_meta *meta) p = (MDB_page *)&pbuf; if (!F_ISSET(p->mp_flags, P_META)) { @@ -1307,7 +1328,7 @@ index d2e81e4..0110402 100644 return MDB_INVALID; } -@@ -3691,7 +4004,6 @@ mdb_env_init_meta(MDB_env *env, MDB_meta *meta) +@@ -3691,7 +4009,6 @@ mdb_env_init_meta(MDB_env *env, MDB_meta *meta) p = calloc(NUM_METAS, psize); if (!p) return ENOMEM; @@ -1315,16 +1336,18 @@ index d2e81e4..0110402 100644 p->mp_pgno = 0; p->mp_flags = P_META; *(MDB_meta *)METADATA(p) = *meta; -@@ -3722,7 +4034,7 @@ mdb_env_write_meta(MDB_txn *txn) +@@ -3722,8 +4039,8 @@ mdb_env_write_meta(MDB_txn *txn) MDB_env *env; MDB_meta meta, metab, *mp; unsigned flags; - size_t mapsize; +- off_t off; + mdb_size_t mapsize; - off_t off; ++ offset_t off; int rc, len, toggle; char *ptr; -@@ -3734,11 +4046,11 @@ mdb_env_write_meta(MDB_txn *txn) + HANDLE mfd; +@@ -3734,11 +4051,11 @@ mdb_env_write_meta(MDB_txn *txn) #endif toggle = txn->mt_txnid & 1; @@ -1338,7 +1361,7 @@ index d2e81e4..0110402 100644 mp = env->me_metas[toggle]; mapsize = env->me_metas[toggle ^ 1]->mm_mapsize; /* Persist any increases of mapsize config */ -@@ -3867,6 +4179,9 @@ mdb_env_create(MDB_env **env) +@@ -3867,6 +4184,9 @@ mdb_env_create(MDB_env **env) #ifdef MDB_USE_POSIX_SEM e->me_rmutex = SEM_FAILED; e->me_wmutex = SEM_FAILED; @@ -1348,7 +1371,7 @@ index d2e81e4..0110402 100644 #endif e->me_pid = getpid(); GET_PAGESIZE(e->me_os_psize); -@@ -3875,6 +4190,19 @@ mdb_env_create(MDB_env **env) +@@ -3875,6 +4195,19 @@ mdb_env_create(MDB_env **env) return MDB_SUCCESS; } @@ -1368,7 +1391,7 @@ index d2e81e4..0110402 100644 static int ESECT mdb_env_map(MDB_env *env, void *addr) { -@@ -3882,42 +4210,51 @@ mdb_env_map(MDB_env *env, void *addr) +@@ -3882,42 +4215,51 @@ mdb_env_map(MDB_env *env, void *addr) unsigned int flags = env->me_flags; #ifdef _WIN32 int rc; @@ -1447,7 +1470,7 @@ index d2e81e4..0110402 100644 #else int prot = PROT_READ; if (flags & MDB_WRITEMAP) { -@@ -3951,6 +4288,7 @@ mdb_env_map(MDB_env *env, void *addr) +@@ -3951,6 +4293,7 @@ mdb_env_map(MDB_env *env, void *addr) */ if (addr && env->me_map != addr) return EBUSY; /* TODO: Make a new MDB_* error code? */ @@ -1455,7 +1478,7 @@ index d2e81e4..0110402 100644 p = (MDB_page *)env->me_map; env->me_metas[0] = METADATA(p); -@@ -3960,15 +4298,17 @@ mdb_env_map(MDB_env *env, void *addr) +@@ -3960,15 +4303,17 @@ mdb_env_map(MDB_env *env, void *addr) } int ESECT @@ -1475,7 +1498,7 @@ index d2e81e4..0110402 100644 if (env->me_txn) return EINVAL; meta = mdb_env_pick_meta(env); -@@ -3976,16 +4316,21 @@ mdb_env_set_mapsize(MDB_env *env, size_t size) +@@ -3976,16 +4321,21 @@ mdb_env_set_mapsize(MDB_env *env, size_t size) size = meta->mm_mapsize; { /* Silently round up to minimum if the size is too small */ @@ -1498,7 +1521,7 @@ index d2e81e4..0110402 100644 } env->me_mapsize = size; if (env->me_psize) -@@ -4021,7 +4366,7 @@ mdb_env_get_maxreaders(MDB_env *env, unsigned int *readers) +@@ -4021,7 +4371,7 @@ mdb_env_get_maxreaders(MDB_env *env, unsigned int *readers) } static int ESECT @@ -1507,7 +1530,7 @@ index d2e81e4..0110402 100644 { #ifdef _WIN32 LARGE_INTEGER fsize; -@@ -4135,7 +4480,7 @@ mdb_env_open2(MDB_env *env) +@@ -4135,7 +4485,7 @@ mdb_env_open2(MDB_env *env) /* Make sure mapsize >= committed data size. Even when using * mm_mapsize, which could be broken in old files (ITS#7789). */ @@ -1516,7 +1539,7 @@ index d2e81e4..0110402 100644 if (env->me_mapsize < minsize) env->me_mapsize = minsize; } -@@ -4154,6 +4499,18 @@ mdb_env_open2(MDB_env *env) +@@ -4154,6 +4504,18 @@ mdb_env_open2(MDB_env *env) return rc; newenv = 0; } @@ -1535,7 +1558,7 @@ index d2e81e4..0110402 100644 rc = mdb_env_map(env, (flags & MDB_FIXEDMAP) ? meta.mm_address : NULL); if (rc) -@@ -4183,13 +4540,13 @@ mdb_env_open2(MDB_env *env) +@@ -4183,13 +4545,13 @@ mdb_env_open2(MDB_env *env) DPRINTF(("opened database version %u, pagesize %u", meta->mm_version, env->me_psize)); @@ -1556,7 +1579,7 @@ index d2e81e4..0110402 100644 } #endif -@@ -4465,6 +4822,10 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) +@@ -4465,8 +4827,12 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) # define MDB_CLOEXEC 0 #endif #endif @@ -1565,9 +1588,12 @@ index d2e81e4..0110402 100644 + union semun semu; +#endif int rc; - off_t size, rsize; +- off_t size, rsize; ++ offset_t size, rsize; -@@ -4616,19 +4977,42 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) + #ifdef _WIN32 + wchar_t *wlpath; +@@ -4616,19 +4982,42 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) env->me_wmutex = sem_open(env->me_txns->mti_wmname, O_CREAT|O_EXCL, mode, 1); if (env->me_wmutex == SEM_FAILED) goto fail_errno; @@ -1617,7 +1643,7 @@ index d2e81e4..0110402 100644 env->me_txns->mti_magic = MDB_MAGIC; env->me_txns->mti_format = MDB_LOCK_FORMAT; -@@ -4636,6 +5020,9 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) +@@ -4636,6 +5025,9 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) env->me_txns->mti_numreaders = 0; } else { @@ -1627,7 +1653,7 @@ index d2e81e4..0110402 100644 if (env->me_txns->mti_magic != MDB_MAGIC) { DPUTS("lock region has invalid magic"); rc = MDB_INVALID; -@@ -4661,8 +5048,33 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) +@@ -4661,8 +5053,33 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) if (env->me_rmutex == SEM_FAILED) goto fail_errno; env->me_wmutex = sem_open(env->me_txns->mti_wmname, 0); if (env->me_wmutex == SEM_FAILED) goto fail_errno; @@ -1661,7 +1687,7 @@ index d2e81e4..0110402 100644 return MDB_SUCCESS; fail_errno: -@@ -4701,6 +5113,17 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode +@@ -4701,6 +5118,17 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode if (env->me_fd!=INVALID_HANDLE_VALUE || (flags & ~(CHANGEABLE|CHANGELESS))) return EINVAL; @@ -1679,7 +1705,7 @@ index d2e81e4..0110402 100644 len = strlen(path); if (flags & MDB_NOSUBDIR) { rc = len + sizeof(LOCKSUFF) + len + 1; -@@ -4730,6 +5153,17 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode +@@ -4730,6 +5158,17 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode (env->me_dirty_list = calloc(MDB_IDL_UM_SIZE, sizeof(MDB_ID2))))) rc = ENOMEM; } @@ -1697,7 +1723,7 @@ index d2e81e4..0110402 100644 env->me_flags = flags |= MDB_ENV_ACTIVE; if (rc) goto leave; -@@ -4828,6 +5262,16 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode +@@ -4828,6 +5267,16 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t mode txn->mt_dbiseqs = (unsigned int *)(txn->mt_cursors + env->me_maxdbs); txn->mt_dbflags = (unsigned char *)(txn->mt_dbiseqs + env->me_maxdbs); txn->mt_env = env; @@ -1714,7 +1740,7 @@ index d2e81e4..0110402 100644 txn->mt_dbxs = env->me_dbxs; txn->mt_flags = MDB_TXN_FINISHED; env->me_txn0 = txn; -@@ -4866,6 +5310,15 @@ mdb_env_close0(MDB_env *env, int excl) +@@ -4866,6 +5315,15 @@ mdb_env_close0(MDB_env *env, int excl) free(env->me_dbflags); free(env->me_path); free(env->me_dirty_list); @@ -1730,7 +1756,7 @@ index d2e81e4..0110402 100644 free(env->me_txn0); mdb_midl_free(env->me_free_pgs); -@@ -4883,7 +5336,11 @@ mdb_env_close0(MDB_env *env, int excl) +@@ -4883,7 +5341,11 @@ mdb_env_close0(MDB_env *env, int excl) } if (env->me_map) { @@ -1742,7 +1768,7 @@ index d2e81e4..0110402 100644 } if (env->me_mfd != env->me_fd && env->me_mfd != INVALID_HANDLE_VALUE) (void) close(env->me_mfd); -@@ -4924,6 +5381,16 @@ mdb_env_close0(MDB_env *env, int excl) +@@ -4924,6 +5386,16 @@ mdb_env_close0(MDB_env *env, int excl) sem_unlink(env->me_txns->mti_wmname); } } @@ -1759,7 +1785,7 @@ index d2e81e4..0110402 100644 #endif munmap((void *)env->me_txns, (env->me_maxreaders-1)*sizeof(MDB_reader)+sizeof(MDB_txninfo)); } -@@ -4938,6 +5405,14 @@ mdb_env_close0(MDB_env *env, int excl) +@@ -4938,6 +5410,14 @@ mdb_env_close0(MDB_env *env, int excl) #endif (void) close(env->me_lfd); } @@ -1774,7 +1800,7 @@ index d2e81e4..0110402 100644 env->me_flags &= ~(MDB_ENV_ACTIVE|MDB_ENV_TXKEY); } -@@ -4961,18 +5436,18 @@ mdb_env_close(MDB_env *env) +@@ -4961,18 +5441,18 @@ mdb_env_close(MDB_env *env) free(env); } @@ -1797,7 +1823,7 @@ index d2e81e4..0110402 100644 */ static int mdb_cmp_int(const MDB_val *a, const MDB_val *b) -@@ -5077,7 +5552,7 @@ mdb_node_search(MDB_cursor *mc, MDB_val *key, int *exactp) +@@ -5077,7 +5557,7 @@ mdb_node_search(MDB_cursor *mc, MDB_val *key, int *exactp) nkeys = NUMKEYS(mp); @@ -1806,7 +1832,7 @@ index d2e81e4..0110402 100644 nkeys, IS_LEAF(mp) ? "leaf" : "branch", IS_SUBP(mp) ? "sub-" : "", mdb_dbg_pgno(mp))); -@@ -5089,7 +5564,7 @@ mdb_node_search(MDB_cursor *mc, MDB_val *key, int *exactp) +@@ -5089,7 +5569,7 @@ mdb_node_search(MDB_cursor *mc, MDB_val *key, int *exactp) * alignment is guaranteed. Use faster mdb_cmp_int. */ if (cmp == mdb_cmp_cint && IS_BRANCH(mp)) { @@ -1815,7 +1841,7 @@ index d2e81e4..0110402 100644 cmp = mdb_cmp_long; else cmp = mdb_cmp_int; -@@ -5125,7 +5600,7 @@ mdb_node_search(MDB_cursor *mc, MDB_val *key, int *exactp) +@@ -5125,7 +5605,7 @@ mdb_node_search(MDB_cursor *mc, MDB_val *key, int *exactp) DPRINTF(("found leaf index %u [%s], rc = %i", i, DKEY(&nodekey), rc)); else @@ -1824,7 +1850,7 @@ index d2e81e4..0110402 100644 i, DKEY(&nodekey), NODEPGNO(node), rc)); #endif if (rc == 0) -@@ -5173,7 +5648,7 @@ static void +@@ -5173,7 +5653,7 @@ static void mdb_cursor_pop(MDB_cursor *mc) { if (mc->mc_snum) { @@ -1833,7 +1859,7 @@ index d2e81e4..0110402 100644 mc->mc_pg[mc->mc_top]->mp_pgno, DDBI(mc), (void *) mc)); mc->mc_snum--; -@@ -5189,7 +5664,7 @@ mdb_cursor_pop(MDB_cursor *mc) +@@ -5189,7 +5669,7 @@ mdb_cursor_pop(MDB_cursor *mc) static int mdb_cursor_push(MDB_cursor *mc, MDB_page *mp) { @@ -1842,7 +1868,7 @@ index d2e81e4..0110402 100644 DDBI(mc), (void *) mc)); if (mc->mc_snum >= CURSOR_STACK) { -@@ -5204,21 +5679,309 @@ mdb_cursor_push(MDB_cursor *mc, MDB_page *mp) +@@ -5204,21 +5684,309 @@ mdb_cursor_push(MDB_cursor *mc, MDB_page *mp) return MDB_SUCCESS; } @@ -1920,7 +1946,7 @@ index d2e81e4..0110402 100644 + len, &off, &len, ViewUnmap, (env->me_flags & MDB_RDONLY) ? 0 : MEM_RESERVE, PAGE_READONLY); \ + if (rc) rc = mdb_nt2win32(rc) +#else -+ off_t off; ++ offset_t off; + size_t len; +#define SET_OFF(off,val) off = val +#define MAP(rc,env,addr,len,off) \ @@ -2156,7 +2182,7 @@ index d2e81e4..0110402 100644 MDB_txn *tx2 = txn; level = 1; do { -@@ -5233,8 +5996,7 @@ mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl) +@@ -5233,8 +6001,7 @@ mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl) MDB_ID pn = pgno << 1; x = mdb_midl_search(tx2->mt_spill_pgs, pn); if (x <= tx2->mt_spill_pgs[0] && tx2->mt_spill_pgs[x] == pn) { @@ -2166,7 +2192,7 @@ index d2e81e4..0110402 100644 } } if (dl[0].mid) { -@@ -5248,15 +6010,26 @@ mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl) +@@ -5248,15 +6015,26 @@ mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl) } while ((tx2 = tx2->mt_parent) != NULL); } @@ -2198,7 +2224,7 @@ index d2e81e4..0110402 100644 done: *ret = p; if (lvl) -@@ -5278,13 +6051,13 @@ mdb_page_search_root(MDB_cursor *mc, MDB_val *key, int flags) +@@ -5278,13 +6056,13 @@ mdb_page_search_root(MDB_cursor *mc, MDB_val *key, int flags) MDB_node *node; indx_t i; @@ -2214,7 +2240,7 @@ index d2e81e4..0110402 100644 if (flags & (MDB_PS_FIRST|MDB_PS_LAST)) { i = 0; -@@ -5308,7 +6081,7 @@ mdb_page_search_root(MDB_cursor *mc, MDB_val *key, int flags) +@@ -5308,7 +6086,7 @@ mdb_page_search_root(MDB_cursor *mc, MDB_val *key, int flags) mdb_cassert(mc, i < NUMKEYS(mp)); node = NODEPTR(mp, i); @@ -2223,7 +2249,7 @@ index d2e81e4..0110402 100644 return rc; mc->mc_ki[mc->mc_top] = i; -@@ -5329,7 +6102,7 @@ mdb_page_search_root(MDB_cursor *mc, MDB_val *key, int flags) +@@ -5329,7 +6107,7 @@ mdb_page_search_root(MDB_cursor *mc, MDB_val *key, int flags) return MDB_CORRUPTED; } @@ -2232,7 +2258,7 @@ index d2e81e4..0110402 100644 key ? DKEY(key) : "null")); mc->mc_flags |= C_INITIALIZED; mc->mc_flags &= ~C_EOF; -@@ -5350,7 +6123,7 @@ mdb_page_search_lowest(MDB_cursor *mc) +@@ -5350,7 +6128,7 @@ mdb_page_search_lowest(MDB_cursor *mc) MDB_node *node = NODEPTR(mp, 0); int rc; @@ -2241,7 +2267,7 @@ index d2e81e4..0110402 100644 return rc; mc->mc_ki[mc->mc_top] = 0; -@@ -5402,7 +6175,7 @@ mdb_page_search(MDB_cursor *mc, MDB_val *key, int flags) +@@ -5402,7 +6180,7 @@ mdb_page_search(MDB_cursor *mc, MDB_val *key, int flags) return MDB_NOTFOUND; if ((leaf->mn_flags & (F_DUPDATA|F_SUBDATA)) != F_SUBDATA) return MDB_INCOMPATIBLE; /* not a named DB */ @@ -2250,7 +2276,7 @@ index d2e81e4..0110402 100644 if (rc) return rc; memcpy(&flags, ((char *) data.mv_data + offsetof(MDB_db, md_flags)), -@@ -5425,14 +6198,26 @@ mdb_page_search(MDB_cursor *mc, MDB_val *key, int flags) +@@ -5425,14 +6203,26 @@ mdb_page_search(MDB_cursor *mc, MDB_val *key, int flags) } mdb_cassert(mc, root > 1); @@ -2280,7 +2306,7 @@ index d2e81e4..0110402 100644 DDBI(mc), root, mc->mc_pg[0]->mp_flags)); if (flags & MDB_PS_MODIFY) { -@@ -5457,7 +6242,7 @@ mdb_ovpage_free(MDB_cursor *mc, MDB_page *mp) +@@ -5457,7 +6247,7 @@ mdb_ovpage_free(MDB_cursor *mc, MDB_page *mp) MDB_ID pn = pg << 1; int rc; @@ -2289,7 +2315,7 @@ index d2e81e4..0110402 100644 /* If the page is dirty or on the spill list we just acquired it, * so we should give it back to our current free list, if any. * Otherwise put it onto the list of pages we freed in this txn. -@@ -5498,7 +6283,7 @@ mdb_ovpage_free(MDB_cursor *mc, MDB_page *mp) +@@ -5498,7 +6288,7 @@ mdb_ovpage_free(MDB_cursor *mc, MDB_page *mp) j = ++(dl[0].mid); dl[j] = ix; /* Unsorted. OK when MDB_TXN_ERROR. */ txn->mt_flags |= MDB_TXN_ERROR; @@ -2298,7 +2324,7 @@ index d2e81e4..0110402 100644 } } txn->mt_dirty_room++; -@@ -5523,18 +6308,22 @@ release: +@@ -5523,18 +6313,22 @@ release: } /** Return the data associated with a given node. @@ -2323,7 +2349,7 @@ index d2e81e4..0110402 100644 if (!F_ISSET(leaf->mn_flags, F_BIGDATA)) { data->mv_size = NODEDSZ(leaf); data->mv_data = NODEDATA(leaf); -@@ -5545,11 +6334,12 @@ mdb_node_read(MDB_txn *txn, MDB_node *leaf, MDB_val *data) +@@ -5545,11 +6339,12 @@ mdb_node_read(MDB_txn *txn, MDB_node *leaf, MDB_val *data) */ data->mv_size = NODEDSZ(leaf); memcpy(&pgno, NODEDATA(leaf), sizeof(pgno)); @@ -2338,7 +2364,7 @@ index d2e81e4..0110402 100644 return MDB_SUCCESS; } -@@ -5560,7 +6350,7 @@ mdb_get(MDB_txn *txn, MDB_dbi dbi, +@@ -5560,7 +6355,7 @@ mdb_get(MDB_txn *txn, MDB_dbi dbi, { MDB_cursor mc; MDB_xcursor mx; @@ -2347,7 +2373,7 @@ index d2e81e4..0110402 100644 DKBUF; DPRINTF(("===> get db %u key [%s]", dbi, DKEY(key))); -@@ -5572,7 +6362,12 @@ mdb_get(MDB_txn *txn, MDB_dbi dbi, +@@ -5572,7 +6367,12 @@ mdb_get(MDB_txn *txn, MDB_dbi dbi, return MDB_BAD_TXN; mdb_cursor_init(&mc, txn, dbi, &mx); @@ -2361,7 +2387,7 @@ index d2e81e4..0110402 100644 } /** Find a sibling for a page. -@@ -5589,13 +6384,19 @@ mdb_cursor_sibling(MDB_cursor *mc, int move_right) +@@ -5589,13 +6389,19 @@ mdb_cursor_sibling(MDB_cursor *mc, int move_right) int rc; MDB_node *indx; MDB_page *mp; @@ -2382,7 +2408,7 @@ index d2e81e4..0110402 100644 mc->mc_pg[mc->mc_top]->mp_pgno, mc->mc_ki[mc->mc_top])); if (move_right ? (mc->mc_ki[mc->mc_top] + 1u >= NUMKEYS(mc->mc_pg[mc->mc_top])) -@@ -5618,8 +6419,10 @@ mdb_cursor_sibling(MDB_cursor *mc, int move_right) +@@ -5618,8 +6424,10 @@ mdb_cursor_sibling(MDB_cursor *mc, int move_right) } mdb_cassert(mc, IS_BRANCH(mc->mc_pg[mc->mc_top])); @@ -2394,7 +2420,7 @@ index d2e81e4..0110402 100644 /* mc will be inconsistent if caller does mc_snum++ as above */ mc->mc_flags &= ~(C_INITIALIZED|C_EOF); return rc; -@@ -5640,11 +6443,12 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) +@@ -5640,11 +6448,12 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) MDB_node *leaf; int rc; @@ -2410,7 +2436,7 @@ index d2e81e4..0110402 100644 mp = mc->mc_pg[mc->mc_top]; -@@ -5659,6 +6463,9 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) +@@ -5659,6 +6468,9 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) return rc; } } @@ -2420,7 +2446,7 @@ index d2e81e4..0110402 100644 } else { mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); if (op == MDB_NEXT_DUP) -@@ -5666,7 +6473,7 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) +@@ -5666,7 +6478,7 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) } } @@ -2429,7 +2455,7 @@ index d2e81e4..0110402 100644 mdb_dbg_pgno(mp), (void *) mc)); if (mc->mc_flags & C_DEL) { mc->mc_flags ^= C_DEL; -@@ -5680,12 +6487,12 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) +@@ -5680,12 +6492,12 @@ mdb_cursor_next(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) return rc; } mp = mc->mc_pg[mc->mc_top]; @@ -2444,7 +2470,7 @@ index d2e81e4..0110402 100644 mdb_dbg_pgno(mp), NUMKEYS(mp), mc->mc_ki[mc->mc_top])); if (IS_LEAF2(mp)) { -@@ -5701,7 +6508,7 @@ skip: +@@ -5701,7 +6513,7 @@ skip: mdb_xcursor_init1(mc, leaf); } if (data) { @@ -2453,7 +2479,7 @@ index d2e81e4..0110402 100644 return rc; if (F_ISSET(leaf->mn_flags, F_DUPDATA)) { -@@ -5723,7 +6530,12 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) +@@ -5723,7 +6535,12 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) MDB_node *leaf; int rc; @@ -2467,7 +2493,7 @@ index d2e81e4..0110402 100644 mp = mc->mc_pg[mc->mc_top]; -@@ -5740,6 +6552,9 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) +@@ -5740,6 +6557,9 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) return rc; } } @@ -2477,7 +2503,7 @@ index d2e81e4..0110402 100644 } else { mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF); if (op == MDB_PREV_DUP) -@@ -5747,7 +6562,7 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) +@@ -5747,7 +6567,7 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) } } @@ -2486,7 +2512,7 @@ index d2e81e4..0110402 100644 mdb_dbg_pgno(mp), (void *) mc)); mc->mc_flags &= ~(C_EOF|C_DEL); -@@ -5759,11 +6574,13 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) +@@ -5759,11 +6579,13 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) } mp = mc->mc_pg[mc->mc_top]; mc->mc_ki[mc->mc_top] = NUMKEYS(mp) - 1; @@ -2502,7 +2528,7 @@ index d2e81e4..0110402 100644 mdb_dbg_pgno(mp), NUMKEYS(mp), mc->mc_ki[mc->mc_top])); if (IS_LEAF2(mp)) { -@@ -5779,7 +6596,7 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) +@@ -5779,7 +6601,7 @@ mdb_cursor_prev(MDB_cursor *mc, MDB_val *key, MDB_val *data, MDB_cursor_op op) mdb_xcursor_init1(mc, leaf); } if (data) { @@ -2511,7 +2537,7 @@ index d2e81e4..0110402 100644 return rc; if (F_ISSET(leaf->mn_flags, F_DUPDATA)) { -@@ -5806,8 +6623,10 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data, +@@ -5806,8 +6628,10 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data, if (key->mv_size == 0) return MDB_BAD_VALSIZE; @@ -2523,7 +2549,7 @@ index d2e81e4..0110402 100644 /* See if we're already on the right page */ if (mc->mc_flags & C_INITIALIZED) { -@@ -5873,6 +6692,7 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data, +@@ -5873,6 +6697,7 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data, } } rc = 0; @@ -2531,7 +2557,7 @@ index d2e81e4..0110402 100644 goto set2; } } -@@ -5961,25 +6781,23 @@ set1: +@@ -5961,25 +6786,23 @@ set1: } else if (op == MDB_GET_BOTH || op == MDB_GET_BOTH_RANGE) { MDB_val olddata; MDB_cmp_func *dcmp; @@ -2561,7 +2587,7 @@ index d2e81e4..0110402 100644 return rc; } } -@@ -5999,8 +6817,10 @@ mdb_cursor_first(MDB_cursor *mc, MDB_val *key, MDB_val *data) +@@ -5999,8 +6822,10 @@ mdb_cursor_first(MDB_cursor *mc, MDB_val *key, MDB_val *data) int rc; MDB_node *leaf; @@ -2573,7 +2599,7 @@ index d2e81e4..0110402 100644 if (!(mc->mc_flags & C_INITIALIZED) || mc->mc_top) { rc = mdb_page_search(mc, NULL, MDB_PS_FIRST); -@@ -6028,7 +6848,7 @@ mdb_cursor_first(MDB_cursor *mc, MDB_val *key, MDB_val *data) +@@ -6028,7 +6853,7 @@ mdb_cursor_first(MDB_cursor *mc, MDB_val *key, MDB_val *data) if (rc) return rc; } else { @@ -2582,7 +2608,7 @@ index d2e81e4..0110402 100644 return rc; } } -@@ -6043,8 +6863,10 @@ mdb_cursor_last(MDB_cursor *mc, MDB_val *key, MDB_val *data) +@@ -6043,8 +6868,10 @@ mdb_cursor_last(MDB_cursor *mc, MDB_val *key, MDB_val *data) int rc; MDB_node *leaf; @@ -2594,7 +2620,7 @@ index d2e81e4..0110402 100644 if (!(mc->mc_flags & C_EOF)) { -@@ -6073,7 +6895,7 @@ mdb_cursor_last(MDB_cursor *mc, MDB_val *key, MDB_val *data) +@@ -6073,7 +6900,7 @@ mdb_cursor_last(MDB_cursor *mc, MDB_val *key, MDB_val *data) if (rc) return rc; } else { @@ -2603,7 +2629,7 @@ index d2e81e4..0110402 100644 return rc; } } -@@ -6119,7 +6941,7 @@ mdb_cursor_get(MDB_cursor *mc, MDB_val *key, MDB_val *data, +@@ -6119,7 +6946,7 @@ mdb_cursor_get(MDB_cursor *mc, MDB_val *key, MDB_val *data, if (F_ISSET(leaf->mn_flags, F_DUPDATA)) { rc = mdb_cursor_get(&mc->mc_xcursor->mx_cursor, data, NULL, MDB_GET_CURRENT); } else { @@ -2612,7 +2638,7 @@ index d2e81e4..0110402 100644 } } } -@@ -6169,10 +6991,7 @@ mdb_cursor_get(MDB_cursor *mc, MDB_val *key, MDB_val *data, +@@ -6169,10 +6996,7 @@ mdb_cursor_get(MDB_cursor *mc, MDB_val *key, MDB_val *data, rc = MDB_INCOMPATIBLE; break; } @@ -2624,7 +2650,7 @@ index d2e81e4..0110402 100644 if (rc == MDB_SUCCESS) { if (mc->mc_xcursor->mx_cursor.mc_flags & C_INITIALIZED) { MDB_cursor *mx; -@@ -6187,24 +7006,38 @@ fetchm: +@@ -6187,24 +7011,38 @@ fetchm: } } break; @@ -2674,7 +2700,7 @@ index d2e81e4..0110402 100644 rc = mdb_cursor_prev(mc, key, data, op); break; case MDB_FIRST: -@@ -6225,7 +7058,7 @@ fetchm: +@@ -6225,7 +7063,7 @@ fetchm: MDB_node *leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]); if (!F_ISSET(leaf->mn_flags, F_DUPDATA)) { MDB_GET_KEY(leaf, key); @@ -2683,7 +2709,7 @@ index d2e81e4..0110402 100644 break; } } -@@ -6487,10 +7320,8 @@ more: +@@ -6487,10 +7325,8 @@ more: if (flags == MDB_CURRENT) goto current; dcmp = mc->mc_dbx->md_dcmp; @@ -2695,7 +2721,7 @@ index d2e81e4..0110402 100644 /* does data match? */ if (!dcmp(data, &olddata)) { if (flags & (MDB_NODUPDATA|MDB_APPENDDUP)) -@@ -6609,7 +7440,7 @@ current: +@@ -6609,7 +7445,7 @@ current: int level, ovpages, dpages = OVPAGES(data->mv_size, env->me_psize); memcpy(&pg, olddata.mv_data, sizeof(pg)); @@ -2704,7 +2730,7 @@ index d2e81e4..0110402 100644 return rc2; ovpages = omp->mp_pages; -@@ -6641,8 +7472,13 @@ current: +@@ -6641,8 +7477,13 @@ current: /* Note - this page is already counted in parent's dirty_room */ rc2 = mdb_mid2l_insert(mc->mc_txn->mt_u.dirty_list, &id2); mdb_cassert(mc, rc2 == 0); @@ -2719,7 +2745,7 @@ index d2e81e4..0110402 100644 * compiler may copy words instead of bytes. */ off = (PAGEHDRSZ + data->mv_size) & -sizeof(size_t); -@@ -6728,7 +7564,7 @@ new_sub: +@@ -6728,7 +7569,7 @@ new_sub: */ if (do_sub) { int xflags, new_dupdata; @@ -2728,7 +2754,7 @@ index d2e81e4..0110402 100644 put_sub: xdata.mv_size = 0; xdata.mv_data = ""; -@@ -6810,7 +7646,7 @@ put_sub: +@@ -6810,7 +7651,7 @@ put_sub: return rc; bad_sub: if (rc == MDB_KEYEXIST) /* should not happen, we deleted that item */ @@ -2737,7 +2763,7 @@ index d2e81e4..0110402 100644 } mc->mc_txn->mt_flags |= MDB_TXN_ERROR; return rc; -@@ -6910,7 +7746,7 @@ mdb_cursor_del(MDB_cursor *mc, unsigned int flags) +@@ -6910,7 +7751,7 @@ mdb_cursor_del(MDB_cursor *mc, unsigned int flags) pgno_t pg; memcpy(&pg, NODEDATA(leaf), sizeof(pg)); @@ -2746,7 +2772,7 @@ index d2e81e4..0110402 100644 (rc = mdb_ovpage_free(mc, omp))) goto fail; } -@@ -6939,7 +7775,7 @@ mdb_page_new(MDB_cursor *mc, uint32_t flags, int num, MDB_page **mp) +@@ -6939,7 +7780,7 @@ mdb_page_new(MDB_cursor *mc, uint32_t flags, int num, MDB_page **mp) if ((rc = mdb_page_alloc(mc, num, &np))) return rc; @@ -2755,7 +2781,7 @@ index d2e81e4..0110402 100644 np->mp_pgno, mc->mc_txn->mt_env->me_psize)); np->mp_flags = flags | P_DIRTY; np->mp_lower = (PAGEHDRSZ-PAGEBASE); -@@ -7039,7 +7875,7 @@ mdb_node_add(MDB_cursor *mc, indx_t indx, +@@ -7039,7 +7880,7 @@ mdb_node_add(MDB_cursor *mc, indx_t indx, mdb_cassert(mc, mp->mp_upper >= mp->mp_lower); @@ -2764,7 +2790,7 @@ index d2e81e4..0110402 100644 IS_LEAF(mp) ? "leaf" : "branch", IS_SUBP(mp) ? "sub-" : "", mdb_dbg_pgno(mp), indx, data ? data->mv_size : 0, -@@ -7080,7 +7916,7 @@ mdb_node_add(MDB_cursor *mc, indx_t indx, +@@ -7080,7 +7921,7 @@ mdb_node_add(MDB_cursor *mc, indx_t indx, goto full; if ((rc = mdb_page_new(mc, P_OVERFLOW, ovpages, &ofp))) return rc; @@ -2773,7 +2799,7 @@ index d2e81e4..0110402 100644 flags |= F_BIGDATA; goto update; } else { -@@ -7137,7 +7973,7 @@ update: +@@ -7137,7 +7978,7 @@ update: return MDB_SUCCESS; full: @@ -2782,7 +2808,7 @@ index d2e81e4..0110402 100644 mdb_dbg_pgno(mp), NUMKEYS(mp))); DPRINTF(("upper-lower = %u - %u = %"Z"d", mp->mp_upper,mp->mp_lower,room)); DPRINTF(("node size = %"Z"u", node_size)); -@@ -7160,7 +7996,7 @@ mdb_node_del(MDB_cursor *mc, int ksize) +@@ -7160,7 +8001,7 @@ mdb_node_del(MDB_cursor *mc, int ksize) MDB_node *node; char *base; @@ -2791,7 +2817,7 @@ index d2e81e4..0110402 100644 IS_LEAF(mp) ? "leaf" : "branch", mdb_dbg_pgno(mp))); numkeys = NUMKEYS(mp); mdb_cassert(mc, indx < numkeys); -@@ -7269,7 +8105,8 @@ mdb_xcursor_init0(MDB_cursor *mc) +@@ -7269,7 +8110,8 @@ mdb_xcursor_init0(MDB_cursor *mc) mx->mx_cursor.mc_dbflag = &mx->mx_dbflag; mx->mx_cursor.mc_snum = 0; mx->mx_cursor.mc_top = 0; @@ -2801,7 +2827,7 @@ index d2e81e4..0110402 100644 mx->mx_dbx.md_name.mv_size = 0; mx->mx_dbx.md_name.mv_data = NULL; mx->mx_dbx.md_cmp = mc->mc_dbx->md_dcmp; -@@ -7288,12 +8125,12 @@ mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node) +@@ -7288,12 +8130,12 @@ mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node) { MDB_xcursor *mx = mc->mc_xcursor; @@ -2815,7 +2841,7 @@ index d2e81e4..0110402 100644 } else { MDB_page *fp = NODEDATA(node); mx->mx_db.md_pad = 0; -@@ -7306,7 +8143,7 @@ mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node) +@@ -7306,7 +8148,7 @@ mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node) COPY_PGNO(mx->mx_db.md_root, fp->mp_pgno); mx->mx_cursor.mc_snum = 1; mx->mx_cursor.mc_top = 0; @@ -2824,7 +2850,7 @@ index d2e81e4..0110402 100644 mx->mx_cursor.mc_pg[0] = fp; mx->mx_cursor.mc_ki[0] = 0; if (mc->mc_db->md_flags & MDB_DUPFIXED) { -@@ -7316,13 +8153,11 @@ mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node) +@@ -7316,13 +8158,11 @@ mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node) mx->mx_db.md_flags |= MDB_INTEGERKEY; } } @@ -2840,7 +2866,7 @@ index d2e81e4..0110402 100644 } -@@ -7345,7 +8180,7 @@ mdb_xcursor_init2(MDB_cursor *mc, MDB_xcursor *src_mx, int new_dupdata) +@@ -7345,7 +8185,7 @@ mdb_xcursor_init2(MDB_cursor *mc, MDB_xcursor *src_mx, int new_dupdata) mx->mx_cursor.mc_flags |= C_INITIALIZED; mx->mx_cursor.mc_ki[0] = 0; mx->mx_dbflag = DB_VALID|DB_USRVALID|DB_DIRTY; /* DB_DIRTY guides mdb_cursor_touch */ @@ -2849,7 +2875,7 @@ index d2e81e4..0110402 100644 mx->mx_dbx.md_cmp = src_mx->mx_dbx.md_cmp; #endif } else if (!(mx->mx_cursor.mc_flags & C_INITIALIZED)) { -@@ -7353,7 +8188,7 @@ mdb_xcursor_init2(MDB_cursor *mc, MDB_xcursor *src_mx, int new_dupdata) +@@ -7353,7 +8193,7 @@ mdb_xcursor_init2(MDB_cursor *mc, MDB_xcursor *src_mx, int new_dupdata) } mx->mx_db = src_mx->mx_db; mx->mx_cursor.mc_pg[0] = src_mx->mx_cursor.mc_pg[0]; @@ -2858,7 +2884,7 @@ index d2e81e4..0110402 100644 mx->mx_db.md_root)); } -@@ -7372,7 +8207,8 @@ mdb_cursor_init(MDB_cursor *mc, MDB_txn *txn, MDB_dbi dbi, MDB_xcursor *mx) +@@ -7372,7 +8212,8 @@ mdb_cursor_init(MDB_cursor *mc, MDB_txn *txn, MDB_dbi dbi, MDB_xcursor *mx) mc->mc_top = 0; mc->mc_pg[0] = 0; mc->mc_ki[0] = 0; @@ -2868,7 +2894,7 @@ index d2e81e4..0110402 100644 if (txn->mt_dbs[dbi].md_flags & MDB_DUPSORT) { mdb_tassert(txn, mx != NULL); mc->mc_xcursor = mx; -@@ -7437,7 +8273,7 @@ mdb_cursor_renew(MDB_txn *txn, MDB_cursor *mc) +@@ -7437,7 +8278,7 @@ mdb_cursor_renew(MDB_txn *txn, MDB_cursor *mc) /* Return the count of duplicate data items for the current key */ int @@ -2877,7 +2903,7 @@ index d2e81e4..0110402 100644 { MDB_node *leaf; -@@ -7471,6 +8307,9 @@ mdb_cursor_count(MDB_cursor *mc, size_t *countp) +@@ -7471,6 +8312,9 @@ mdb_cursor_count(MDB_cursor *mc, size_t *countp) void mdb_cursor_close(MDB_cursor *mc) { @@ -2887,7 +2913,7 @@ index d2e81e4..0110402 100644 if (mc && !mc->mc_backup) { /* remove from txn, if tracked */ if ((mc->mc_flags & C_UNTRACK) && mc->mc_txn->mt_cursors) { -@@ -7522,7 +8361,7 @@ mdb_update_key(MDB_cursor *mc, MDB_val *key) +@@ -7522,7 +8366,7 @@ mdb_update_key(MDB_cursor *mc, MDB_val *key) char kbuf2[DKBUF_MAXKEYSIZE*2+1]; k2.mv_data = NODEKEY(node); k2.mv_size = node->mn_ksize; @@ -2896,7 +2922,7 @@ index d2e81e4..0110402 100644 indx, ptr, mdb_dkey(&k2, kbuf2), DKEY(key), -@@ -7670,7 +8509,7 @@ mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft) +@@ -7670,7 +8514,7 @@ mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft) return rc; } @@ -2905,7 +2931,7 @@ index d2e81e4..0110402 100644 IS_LEAF(csrc->mc_pg[csrc->mc_top]) ? "leaf" : "branch", csrc->mc_ki[csrc->mc_top], DKEY(&key), -@@ -7764,7 +8603,7 @@ mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft) +@@ -7764,7 +8608,7 @@ mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft) key.mv_size = NODEKSZ(srcnode); key.mv_data = NODEKEY(srcnode); } @@ -2914,7 +2940,7 @@ index d2e81e4..0110402 100644 csrc->mc_pg[csrc->mc_top]->mp_pgno, DKEY(&key))); mdb_cursor_copy(csrc, &mn); mn.mc_snum--; -@@ -7795,7 +8634,7 @@ mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft) +@@ -7795,7 +8639,7 @@ mdb_node_move(MDB_cursor *csrc, MDB_cursor *cdst, int fromleft) key.mv_size = NODEKSZ(srcnode); key.mv_data = NODEKEY(srcnode); } @@ -2923,7 +2949,7 @@ index d2e81e4..0110402 100644 cdst->mc_pg[cdst->mc_top]->mp_pgno, DKEY(&key))); mdb_cursor_copy(cdst, &mn); mn.mc_snum--; -@@ -7841,7 +8680,7 @@ mdb_page_merge(MDB_cursor *csrc, MDB_cursor *cdst) +@@ -7841,7 +8685,7 @@ mdb_page_merge(MDB_cursor *csrc, MDB_cursor *cdst) psrc = csrc->mc_pg[csrc->mc_top]; pdst = cdst->mc_pg[cdst->mc_top]; @@ -2932,7 +2958,7 @@ index d2e81e4..0110402 100644 mdb_cassert(csrc, csrc->mc_snum > 1); /* can't merge root page */ mdb_cassert(csrc, cdst->mc_snum > 1); -@@ -7898,7 +8737,7 @@ mdb_page_merge(MDB_cursor *csrc, MDB_cursor *cdst) +@@ -7898,7 +8742,7 @@ mdb_page_merge(MDB_cursor *csrc, MDB_cursor *cdst) } } @@ -2941,7 +2967,7 @@ index d2e81e4..0110402 100644 pdst->mp_pgno, NUMKEYS(pdst), (float)PAGEFILL(cdst->mc_txn->mt_env, pdst) / 10)); -@@ -7986,6 +8825,7 @@ mdb_cursor_copy(const MDB_cursor *csrc, MDB_cursor *cdst) +@@ -7986,6 +8830,7 @@ mdb_cursor_copy(const MDB_cursor *csrc, MDB_cursor *cdst) cdst->mc_snum = csrc->mc_snum; cdst->mc_top = csrc->mc_top; cdst->mc_flags = csrc->mc_flags; @@ -2949,7 +2975,7 @@ index d2e81e4..0110402 100644 for (i=0; imc_snum; i++) { cdst->mc_pg[i] = csrc->mc_pg[i]; -@@ -8014,14 +8854,14 @@ mdb_rebalance(MDB_cursor *mc) +@@ -8014,14 +8859,14 @@ mdb_rebalance(MDB_cursor *mc) minkeys = 1; thresh = FILL_THRESHOLD; } @@ -2966,7 +2992,7 @@ index d2e81e4..0110402 100644 mdb_dbg_pgno(mc->mc_pg[mc->mc_top]))); return MDB_SUCCESS; } -@@ -8069,7 +8909,7 @@ mdb_rebalance(MDB_cursor *mc) +@@ -8069,7 +8914,7 @@ mdb_rebalance(MDB_cursor *mc) if (rc) return rc; mc->mc_db->md_root = NODEPGNO(NODEPTR(mp, 0)); @@ -2975,7 +3001,7 @@ index d2e81e4..0110402 100644 if (rc) return rc; mc->mc_db->md_depth--; -@@ -8130,7 +8970,7 @@ mdb_rebalance(MDB_cursor *mc) +@@ -8130,7 +8975,7 @@ mdb_rebalance(MDB_cursor *mc) DPUTS("reading right neighbor"); mn.mc_ki[ptop]++; node = NODEPTR(mc->mc_pg[ptop], mn.mc_ki[ptop]); @@ -2984,7 +3010,7 @@ index d2e81e4..0110402 100644 if (rc) return rc; mn.mc_ki[mn.mc_top] = 0; -@@ -8142,7 +8982,7 @@ mdb_rebalance(MDB_cursor *mc) +@@ -8142,7 +8987,7 @@ mdb_rebalance(MDB_cursor *mc) DPUTS("reading left neighbor"); mn.mc_ki[ptop]--; node = NODEPTR(mc->mc_pg[ptop], mn.mc_ki[ptop]); @@ -2993,7 +3019,7 @@ index d2e81e4..0110402 100644 if (rc) return rc; mn.mc_ki[mn.mc_top] = NUMKEYS(mn.mc_pg[mn.mc_top]) - 1; -@@ -8150,7 +8990,7 @@ mdb_rebalance(MDB_cursor *mc) +@@ -8150,7 +8995,7 @@ mdb_rebalance(MDB_cursor *mc) fromleft = 1; } @@ -3002,7 +3028,7 @@ index d2e81e4..0110402 100644 mn.mc_pg[mn.mc_top]->mp_pgno, NUMKEYS(mn.mc_pg[mn.mc_top]), (float)PAGEFILL(mc->mc_txn->mt_env, mn.mc_pg[mn.mc_top]) / 10)); -@@ -8207,8 +9047,6 @@ mdb_cursor_del0(MDB_cursor *mc) +@@ -8207,8 +9052,6 @@ mdb_cursor_del0(MDB_cursor *mc) if (m3->mc_pg[mc->mc_top] == mp) { if (m3->mc_ki[mc->mc_top] == ki) { m3->mc_flags |= C_DEL; @@ -3011,7 +3037,7 @@ index d2e81e4..0110402 100644 } else if (m3->mc_ki[mc->mc_top] > ki) { m3->mc_ki[mc->mc_top]--; } -@@ -8242,11 +9080,21 @@ mdb_cursor_del0(MDB_cursor *mc) +@@ -8242,11 +9085,21 @@ mdb_cursor_del0(MDB_cursor *mc) continue; if (m3->mc_pg[mc->mc_top] == mp) { /* if m3 points past last node in page, find next sibling */ @@ -3038,7 +3064,7 @@ index d2e81e4..0110402 100644 } } } -@@ -8352,7 +9200,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno +@@ -8352,7 +9205,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno newindx = mc->mc_ki[mc->mc_top]; nkeys = NUMKEYS(mp); @@ -3047,7 +3073,7 @@ index d2e81e4..0110402 100644 IS_LEAF(mp) ? "leaf" : "branch", mp->mp_pgno, DKEY(newkey), mc->mc_ki[mc->mc_top], nkeys)); -@@ -8360,7 +9208,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno +@@ -8360,7 +9213,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno if ((rc = mdb_page_new(mc, mp->mp_flags, 1, &rp))) return rc; rp->mp_pad = mp->mp_pad; @@ -3056,7 +3082,7 @@ index d2e81e4..0110402 100644 /* Usually when splitting the root page, the cursor * height is 1. But when called from mdb_update_key, -@@ -8378,7 +9226,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno +@@ -8378,7 +9231,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno mc->mc_pg[0] = pp; mc->mc_ki[0] = 0; mc->mc_db->md_root = pp->mp_pgno; @@ -3065,7 +3091,7 @@ index d2e81e4..0110402 100644 new_root = mc->mc_db->md_depth++; /* Add left (implicit) pointer. */ -@@ -8395,7 +9243,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno +@@ -8395,7 +9248,7 @@ mdb_page_split(MDB_cursor *mc, MDB_val *newkey, MDB_val *newdata, pgno_t newpgno ptop = 0; } else { ptop = mc->mc_top-1; @@ -3074,7 +3100,7 @@ index d2e81e4..0110402 100644 } mdb_cursor_copy(mc, &mn); -@@ -8776,11 +9624,12 @@ mdb_put(MDB_txn *txn, MDB_dbi dbi, +@@ -8776,11 +9629,12 @@ mdb_put(MDB_txn *txn, MDB_dbi dbi, #ifndef MDB_WBUF #define MDB_WBUF (1024*1024) #endif @@ -3089,7 +3115,7 @@ index d2e81e4..0110402 100644 char *mc_wbuf[2]; char *mc_over[2]; MDB_env *mc_env; -@@ -8789,10 +9638,9 @@ typedef struct mdb_copy { +@@ -8789,10 +9643,9 @@ typedef struct mdb_copy { int mc_olen[2]; pgno_t mc_next_pgno; HANDLE mc_fd; @@ -3103,7 +3129,7 @@ index d2e81e4..0110402 100644 } mdb_copy; /** Dedicated writer thread for compacting copy. */ -@@ -8811,20 +9659,16 @@ mdb_env_copythr(void *arg) +@@ -8811,20 +9664,16 @@ mdb_env_copythr(void *arg) #endif pthread_mutex_lock(&my->mc_mutex); @@ -3127,7 +3153,7 @@ index d2e81e4..0110402 100644 DO_WRITE(rc, my->mc_fd, ptr, wsize, len); if (!rc) { rc = ErrCode(); -@@ -8840,8 +9684,7 @@ again: +@@ -8840,8 +9689,7 @@ again: } } if (rc) { @@ -3137,7 +3163,7 @@ index d2e81e4..0110402 100644 } /* If there's an overflow page tail, write it too */ if (my->mc_olen[toggle]) { -@@ -8852,39 +9695,41 @@ again: +@@ -8852,39 +9700,41 @@ again: } my->mc_wlen[toggle] = 0; toggle ^= 1; @@ -3194,7 +3220,7 @@ index d2e81e4..0110402 100644 MDB_node *ni; MDB_page *mo, *mp, *leaf; char *buf, *ptr; -@@ -8896,10 +9741,10 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) +@@ -8896,10 +9746,10 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) return MDB_SUCCESS; mc.mc_snum = 1; @@ -3208,7 +3234,7 @@ index d2e81e4..0110402 100644 if (rc) return rc; rc = mdb_page_search_root(&mc, NULL, MDB_PS_FIRST); -@@ -8943,7 +9788,8 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) +@@ -8943,7 +9793,8 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) } memcpy(&pg, NODEDATA(ni), sizeof(pg)); @@ -3218,7 +3244,7 @@ index d2e81e4..0110402 100644 if (rc) goto done; if (my->mc_wlen[toggle] >= MDB_WBUF) { -@@ -8965,7 +9811,6 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) +@@ -8965,7 +9816,6 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) goto done; toggle = my->mc_toggle; } @@ -3226,7 +3252,7 @@ index d2e81e4..0110402 100644 } else if (ni->mn_flags & F_SUBDATA) { MDB_db db; -@@ -8994,7 +9839,7 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) +@@ -8994,7 +9844,7 @@ mdb_env_cwalk(mdb_copy *my, pgno_t *pg, int flags) again: ni = NODEPTR(mp, mc.mc_ki[mc.mc_top]); pg = NODEPGNO(ni); @@ -3235,7 +3261,7 @@ index d2e81e4..0110402 100644 if (rc) goto done; mc.mc_top++; -@@ -9043,47 +9888,56 @@ mdb_env_copyfd1(MDB_env *env, HANDLE fd) +@@ -9043,47 +9893,56 @@ mdb_env_copyfd1(MDB_env *env, HANDLE fd) { MDB_meta *mm; MDB_page *mp; @@ -3314,7 +3340,7 @@ index d2e81e4..0110402 100644 mp = (MDB_page *)my.mc_wbuf[0]; memset(mp, 0, NUM_METAS * env->me_psize); -@@ -9099,57 +9953,64 @@ mdb_env_copyfd1(MDB_env *env, HANDLE fd) +@@ -9099,57 +9958,64 @@ mdb_env_copyfd1(MDB_env *env, HANDLE fd) *(MDB_meta *)METADATA(mp) = *mm; mm = (MDB_meta *)METADATA(mp); @@ -3409,7 +3435,7 @@ index d2e81e4..0110402 100644 } /** Copy environment as-is. */ -@@ -9159,7 +10020,7 @@ mdb_env_copyfd0(MDB_env *env, HANDLE fd) +@@ -9159,7 +10025,7 @@ mdb_env_copyfd0(MDB_env *env, HANDLE fd) MDB_txn *txn = NULL; mdb_mutexref_t wmutex = NULL; int rc; @@ -3418,7 +3444,7 @@ index d2e81e4..0110402 100644 char *ptr; #ifdef _WIN32 DWORD len, w2; -@@ -9220,7 +10081,7 @@ mdb_env_copyfd0(MDB_env *env, HANDLE fd) +@@ -9220,7 +10086,7 @@ mdb_env_copyfd0(MDB_env *env, HANDLE fd) w3 = txn->mt_next_pgno * env->me_psize; { @@ -3427,7 +3453,7 @@ index d2e81e4..0110402 100644 if ((rc = mdb_fsize(env->me_fd, &fsize))) goto leave; if (w3 > fsize) -@@ -9659,11 +10520,19 @@ mdb_drop0(MDB_cursor *mc, int subs) +@@ -9659,11 +10525,19 @@ mdb_drop0(MDB_cursor *mc, int subs) /* DUPSORT sub-DBs have no ovpages/DBs. Omit scanning leaves. * This also avoids any P_LEAF2 pages, which have no nodes. @@ -3448,7 +3474,7 @@ index d2e81e4..0110402 100644 while (mc->mc_snum > 0) { MDB_page *mp = mc->mc_pg[mc->mc_top]; unsigned n = NUMKEYS(mp); -@@ -9674,7 +10543,7 @@ mdb_drop0(MDB_cursor *mc, int subs) +@@ -9674,7 +10548,7 @@ mdb_drop0(MDB_cursor *mc, int subs) MDB_page *omp; pgno_t pg; memcpy(&pg, NODEDATA(ni), sizeof(pg)); @@ -3457,7 +3483,7 @@ index d2e81e4..0110402 100644 if (rc != 0) goto done; mdb_cassert(mc, IS_OVERFLOW(omp)); -@@ -9682,6 +10551,9 @@ mdb_drop0(MDB_cursor *mc, int subs) +@@ -9682,6 +10556,9 @@ mdb_drop0(MDB_cursor *mc, int subs) pg, omp->mp_pages); if (rc) goto done; @@ -3467,7 +3493,7 @@ index d2e81e4..0110402 100644 } else if (subs && (ni->mn_flags & F_SUBDATA)) { mdb_xcursor_init1(mc, ni); rc = mdb_drop0(&mc->mc_xcursor->mx_cursor, 0); -@@ -9689,6 +10561,8 @@ mdb_drop0(MDB_cursor *mc, int subs) +@@ -9689,6 +10566,8 @@ mdb_drop0(MDB_cursor *mc, int subs) goto done; } } @@ -3476,7 +3502,7 @@ index d2e81e4..0110402 100644 } else { if ((rc = mdb_midl_need(&txn->mt_free_pgs, n)) != 0) goto done; -@@ -9710,6 +10584,7 @@ mdb_drop0(MDB_cursor *mc, int subs) +@@ -9710,6 +10589,7 @@ mdb_drop0(MDB_cursor *mc, int subs) /* no more siblings, go back to beginning * of previous level. */ @@ -3484,7 +3510,7 @@ index d2e81e4..0110402 100644 mdb_cursor_pop(mc); mc->mc_ki[0] = 0; for (i=1; imc_snum; i++) { -@@ -9723,6 +10598,8 @@ mdb_drop0(MDB_cursor *mc, int subs) +@@ -9723,6 +10603,8 @@ mdb_drop0(MDB_cursor *mc, int subs) done: if (rc) txn->mt_flags |= MDB_TXN_ERROR; @@ -3493,7 +3519,7 @@ index d2e81e4..0110402 100644 } else if (rc == MDB_NOTFOUND) { rc = MDB_SUCCESS; } -@@ -9842,7 +10719,7 @@ mdb_reader_list(MDB_env *env, MDB_msg_func *func, void *ctx) +@@ -9842,7 +10724,7 @@ mdb_reader_list(MDB_env *env, MDB_msg_func *func, void *ctx) if (mr[i].mr_pid) { txnid_t txnid = mr[i].mr_txnid; sprintf(buf, txnid == (txnid_t)-1 ? @@ -3502,7 +3528,7 @@ index d2e81e4..0110402 100644 (int)mr[i].mr_pid, (size_t)mr[i].mr_tid, txnid); if (first) { first = 0; -@@ -9947,7 +10824,7 @@ mdb_reader_check0(MDB_env *env, int rlocked, int *dead) +@@ -9947,7 +10829,7 @@ mdb_reader_check0(MDB_env *env, int rlocked, int *dead) } for (; j Date: Fri, 10 Feb 2017 14:57:02 -0800 Subject: [PATCH 332/561] Make StatusParagraph::find_installed() const --- toolsrc/include/StatusParagraphs.h | 2 +- toolsrc/src/StatusParagraphs.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolsrc/include/StatusParagraphs.h b/toolsrc/include/StatusParagraphs.h index 11491cf4ec..3c5d351831 100644 --- a/toolsrc/include/StatusParagraphs.h +++ b/toolsrc/include/StatusParagraphs.h @@ -20,7 +20,7 @@ namespace vcpkg } const_iterator find(const std::string& name, const triplet& target_triplet) const; iterator find(const std::string& name, const triplet& target_triplet); - iterator find_installed(const std::string& name, const triplet& target_triplet); + const_iterator find_installed(const std::string& name, const triplet& target_triplet) const; iterator insert(std::unique_ptr); diff --git a/toolsrc/src/StatusParagraphs.cpp b/toolsrc/src/StatusParagraphs.cpp index c2398d2b82..48bc0b0624 100644 --- a/toolsrc/src/StatusParagraphs.cpp +++ b/toolsrc/src/StatusParagraphs.cpp @@ -29,9 +29,9 @@ namespace vcpkg }); } - StatusParagraphs::iterator StatusParagraphs::find_installed(const std::string& name, const triplet& target_triplet) + StatusParagraphs::const_iterator StatusParagraphs::find_installed(const std::string& name, const triplet& target_triplet) const { - auto it = find(name, target_triplet); + const const_iterator it = find(name, target_triplet); if (it != end() && (*it)->want == want_t::install) { return it; From af583825a7068614b080536870b15cbaa6bcf10a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Feb 2017 16:51:36 -0800 Subject: [PATCH 333/561] [Checks] Add check_exit() overload with no message --- toolsrc/include/vcpkg_Checks.h | 2 ++ toolsrc/src/vcpkg_Checks.cpp | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/toolsrc/include/vcpkg_Checks.h b/toolsrc/include/vcpkg_Checks.h index a58b38ac0d..23869f35f2 100644 --- a/toolsrc/include/vcpkg_Checks.h +++ b/toolsrc/include/vcpkg_Checks.h @@ -35,6 +35,8 @@ namespace vcpkg::Checks } } + void check_exit(bool expression); + void check_exit(bool expression, const char* errorMessage); template diff --git a/toolsrc/src/vcpkg_Checks.cpp b/toolsrc/src/vcpkg_Checks.cpp index 5c3fef27a8..f02addc081 100644 --- a/toolsrc/src/vcpkg_Checks.cpp +++ b/toolsrc/src/vcpkg_Checks.cpp @@ -33,6 +33,14 @@ namespace vcpkg::Checks } } + void check_exit(bool expression) + { + if (!expression) + { + exit(EXIT_FAILURE); + } + } + void check_exit(bool expression, const char* errorMessage) { if (!expression) From 0c03dc563191b5bb8a843e7517a0a24427f0ddde Mon Sep 17 00:00:00 2001 From: codicodi Date: Mon, 13 Feb 2017 23:48:48 +0100 Subject: [PATCH 334/561] add-gdk-pixbuf --- ports/gdk-pixbuf/CMakeLists.txt | 128 ++++++++++++++++++++++++++++++++ ports/gdk-pixbuf/CONTROL | 4 + ports/gdk-pixbuf/portfile.cmake | 24 ++++++ 3 files changed, 156 insertions(+) create mode 100644 ports/gdk-pixbuf/CMakeLists.txt create mode 100644 ports/gdk-pixbuf/CONTROL create mode 100644 ports/gdk-pixbuf/portfile.cmake diff --git a/ports/gdk-pixbuf/CMakeLists.txt b/ports/gdk-pixbuf/CMakeLists.txt new file mode 100644 index 0000000000..a26e59fb48 --- /dev/null +++ b/ports/gdk-pixbuf/CMakeLists.txt @@ -0,0 +1,128 @@ +cmake_minimum_required(VERSION 3.0) +project(gdk-pixbuf) + +set(GDK_PIXBUF_LIB_SUFFIX 2.0) +set(GDK_PIXBUF_DLL_SUFFIX 2) +set(GDK_PIXBUF_BINARY_VERSION 2.10.0) +set(GLIB_LIB_VERSION 2.0) + +find_package(ZLIB REQUIRED) +find_package(PNG REQUIRED) + +find_path(GLIB_INCLUDE_DIR glib.h) +find_library(GLIB_GLIB_LIBRARY glib-${GLIB_LIB_VERSION}) +find_library(GLIB_GIO_LIBRARY gio-${GLIB_LIB_VERSION}) +find_library(GLIB_GOBJECT_LIBRARY gobject-${GLIB_LIB_VERSION}) +find_library(GLIB_GMODULE_LIBRARY gmodule-${GLIB_LIB_VERSION}) +set(GLIB_LIBRARIES ${GLIB_GLIB_LIBRARY} ${GLIB_GOBJECT_LIBRARY} ${GLIB_GMODULE_LIBRARY} ${GLIB_GIO_LIBRARY}) + +find_path(LIBINTL_INCLUDE_DIR libintl.h) +find_library(LIBINTL_LIBRARY NAMES libintl intl) + +configure_file(./config.h.win32 ${CMAKE_SOURCE_DIR}/config.h COPYONLY) +include_directories(. ./gdk-pixbuf) + +add_library(gdk-pixbuf + gdk-pixbuf/gdk-pixbuf.c + gdk-pixbuf/gdk-pixbuf-animation.c + gdk-pixbuf/gdk-pixbuf-data.c + gdk-pixbuf/gdk-pixbuf-io.c + gdk-pixbuf/gdk-pixbuf-loader.c + gdk-pixbuf/gdk-pixbuf-scale.c + gdk-pixbuf/gdk-pixbuf-simple-anim.c + gdk-pixbuf/gdk-pixbuf-scaled-anim.c + gdk-pixbuf/gdk-pixbuf-util.c + gdk-pixbuf/gdk-pixdata.c + gdk-pixbuf/gdk-pixbuf-enum-types.c + gdk-pixbuf/io-ani.c + gdk-pixbuf/io-ani-animation.c + gdk-pixbuf/io-icns.c + gdk-pixbuf/io-pnm.c + gdk-pixbuf/io-png.c + gdk-pixbuf/io-qtif.c + gdk-pixbuf/io-tga.c + gdk-pixbuf/gdk-pixbuf-buffer-queue.c + gdk-pixbuf/io-xpm.c + gdk-pixbuf/io-xbm.c + gdk-pixbuf/pixops/pixops.c + gdk-pixbuf/io-gdip-animation.c + gdk-pixbuf/io-gdip-bmp.c + gdk-pixbuf/io-gdip-emf.c + gdk-pixbuf/io-gdip-gif.c + gdk-pixbuf/io-gdip-ico.c + gdk-pixbuf/io-gdip-jpeg.c + gdk-pixbuf/io-gdip-tiff.c + gdk-pixbuf/io-gdip-utils.c + gdk-pixbuf/io-gdip-wmf.c) + +target_include_directories(gdk-pixbuf PRIVATE + ${GLIB_INCLUDE_DIR} + ${PNG_INCLUDE_DIRS} + ${ZLIB_INCLUDE_DIRS} + ${LIBINTL_INCLUDE_DIR}) + +target_link_libraries(gdk-pixbuf + ${GLIB_LIBRARIES} + ${ZLIB_LIBRARIES} + ${PNG_LIBRARIES} + ${LIBINTL_LIBRARY} + Gdiplus) + +target_compile_definitions(gdk-pixbuf PRIVATE + HAVE_CONFIG_H + GDK_PIXBUF_COMPILATION + GDK_PIXBUF_ENABLE_BACKEND + DLL_EXPORT + GDK_PIXBUF_RELOCATABLE + GDK_PIXBUF_PREFIX="/dummy" + GDK_PIXBUF_BINARY_VERSION="${GDK_PIXBUF_BINARY_VERSION}" + INCLUDE_ani + INCLUDE_tga + INCLUDE_xbm + INCLUDE_png + INCLUDE_qtif + INCLUDE_pnm + INCLUDE_icns + INCLUDE_xpm + INCLUDE_gdiplus + G_DISABLE_SINGLE_INCLUDES + GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) + +set_target_properties(gdk-pixbuf PROPERTIES + OUTPUT_NAME gdk_pixbuf-${GDK_PIXBUF_DLL_SUFFIX} + ARCHIVE_OUTPUT_NAME gdk_pixbuf-${GDK_PIXBUF_LIB_SUFFIX}) + +install(TARGETS gdk-pixbuf + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) + +macro(gdk_add_tool TOOL_NAME) + add_executable(${TOOL_NAME} ${ARGN}) + target_include_directories(${TOOL_NAME} PRIVATE ${GLIB_INCLUDE_DIR}) + target_link_libraries(${TOOL_NAME} gdk-pixbuf ${GLIB_LIBRARIES}) + install(TARGETS ${TOOL_NAME} RUNTIME DESTINATION tools/gdk-pixbuf) +endmacro() + +if(NOT GDK_SKIP_TOOLS) + gdk_add_tool(gdk-pixbuf-csource gdk-pixbuf/gdk-pixbuf-csource.c) + gdk_add_tool(gdk-pixbuf-pixdata gdk-pixbuf/gdk-pixbuf-pixdata.c) +endif() + +if(NOT GDK_SKIP_HEADERS) + INSTALL(FILES + gdk-pixbuf/gdk-pixbuf.h + gdk-pixbuf/gdk-pixbuf-autocleanups.h + gdk-pixbuf/gdk-pixbuf-core.h + gdk-pixbuf/gdk-pixbuf-transform.h + gdk-pixbuf/gdk-pixbuf-io.h + gdk-pixbuf/gdk-pixbuf-animation.h + gdk-pixbuf/gdk-pixbuf-simple-anim.h + gdk-pixbuf/gdk-pixbuf-loader.h + gdk-pixbuf/gdk-pixbuf-enum-types.h + gdk-pixbuf/gdk-pixbuf-marshal.h + gdk-pixbuf/gdk-pixbuf-features.h + gdk-pixbuf/gdk-pixdata.h + gdk-pixbuf/gdk-pixbuf-macros.h + DESTINATION include/gdk-pixbuf) +endif() diff --git a/ports/gdk-pixbuf/CONTROL b/ports/gdk-pixbuf/CONTROL new file mode 100644 index 0000000000..1a8a208dbc --- /dev/null +++ b/ports/gdk-pixbuf/CONTROL @@ -0,0 +1,4 @@ +Source: gdk-pixbuf +Version: 2.36.3 +Description: Image loading library. +Build-Depends: gettext, zlib, libpng, glib diff --git a/ports/gdk-pixbuf/portfile.cmake b/ports/gdk-pixbuf/portfile.cmake new file mode 100644 index 0000000000..d10338d4c8 --- /dev/null +++ b/ports/gdk-pixbuf/portfile.cmake @@ -0,0 +1,24 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gdk-pixbuf-2.36.3) +vcpkg_download_distfile(ARCHIVE + URLS "http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.36/gdk-pixbuf-2.36.3.tar.xz" + FILENAME "gdk-pixbuf-2.36.3.tar.xz" + SHA512 b9c9fdf45445ceeb7f5039e73cfc803756c5b34574eae4958cdfb525036e1722ab996c1b439fdaa85e73b11069762aeec43e11cadce514d1701d0e43626f20de) + +vcpkg_extract_source_archive(${ARCHIVE}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS_DEBUG + -DGDK_SKIP_HEADERS=ON + -DGDK_SKIP_TOOLS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/gdk-pixbuf) + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/gdk-pixbuf) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/gdk-pixbuf/COPYING ${CURRENT_PACKAGES_DIR}/share/gdk-pixbuf/copyright) From 9406f333aaa290c4386fe06b2845b5b439592ed9 Mon Sep 17 00:00:00 2001 From: codicodi Date: Mon, 13 Feb 2017 23:58:50 +0100 Subject: [PATCH 335/561] [gdk-pixbuf] use latest version --- ports/gdk-pixbuf/CONTROL | 2 +- ports/gdk-pixbuf/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/gdk-pixbuf/CONTROL b/ports/gdk-pixbuf/CONTROL index 1a8a208dbc..8c32ddeff6 100644 --- a/ports/gdk-pixbuf/CONTROL +++ b/ports/gdk-pixbuf/CONTROL @@ -1,4 +1,4 @@ Source: gdk-pixbuf -Version: 2.36.3 +Version: 2.36.5 Description: Image loading library. Build-Depends: gettext, zlib, libpng, glib diff --git a/ports/gdk-pixbuf/portfile.cmake b/ports/gdk-pixbuf/portfile.cmake index d10338d4c8..e31690d641 100644 --- a/ports/gdk-pixbuf/portfile.cmake +++ b/ports/gdk-pixbuf/portfile.cmake @@ -1,10 +1,10 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gdk-pixbuf-2.36.3) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gdk-pixbuf-2.36.5) vcpkg_download_distfile(ARCHIVE - URLS "http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.36/gdk-pixbuf-2.36.3.tar.xz" - FILENAME "gdk-pixbuf-2.36.3.tar.xz" - SHA512 b9c9fdf45445ceeb7f5039e73cfc803756c5b34574eae4958cdfb525036e1722ab996c1b439fdaa85e73b11069762aeec43e11cadce514d1701d0e43626f20de) + URLS "http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.36/gdk-pixbuf-2.36.5.tar.xz" + FILENAME "gdk-pixbuf-2.36.5.tar.xz" + SHA512 27c39bace7bc6cf713915dcb1f35eebfb80ae599d1c9106f48af4cd447050c41e37adee76d29d6b42fbe3d0123b054c8701f2d1b4b99060b4869aa7871523b70) vcpkg_extract_source_archive(${ARCHIVE}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) From 18abe2944da14e741ece014205510643eeb6577d Mon Sep 17 00:00:00 2001 From: codicodi Date: Tue, 14 Feb 2017 00:27:59 +0100 Subject: [PATCH 336/561] [gdk-pixbuf] disable static builds --- ports/gdk-pixbuf/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/gdk-pixbuf/portfile.cmake b/ports/gdk-pixbuf/portfile.cmake index e31690d641..7d104a9fe8 100644 --- a/ports/gdk-pixbuf/portfile.cmake +++ b/ports/gdk-pixbuf/portfile.cmake @@ -1,3 +1,7 @@ +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static building not supported. Building dynamic.") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gdk-pixbuf-2.36.5) From 7c5f8e2f70297f724b8548805d00eceb7f9f6dad Mon Sep 17 00:00:00 2001 From: sdcb Date: Tue, 14 Feb 2017 15:30:30 +0800 Subject: [PATCH 337/561] [chakracore] upgrade to latest 1.4.1 and fix #665 1. upgrade to latest 1.4.1(https://github.com/Microsoft/ChakraCore/releases) 2. fix https://github.com/Microsoft/vcpkg/issues/665 by disable /WX 3. add ch.exe, GCStres.exe, rl.exe into tools directory(which I think maybe useful). --- .../chakracore/disable_warning_as_error.patch | 20 +++++++++++++++++ ports/chakracore/portfile.cmake | 22 +++++++++++++++---- 2 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 ports/chakracore/disable_warning_as_error.patch diff --git a/ports/chakracore/disable_warning_as_error.patch b/ports/chakracore/disable_warning_as_error.patch new file mode 100644 index 0000000000..da7b5da77f --- /dev/null +++ b/ports/chakracore/disable_warning_as_error.patch @@ -0,0 +1,20 @@ +diff --git a/bin/NativeTests/NativeTests.vcxproj b/bin/NativeTests/NativeTests.vcxproj +index d020992..ac70a65 100644 +--- a/bin/NativeTests/NativeTests.vcxproj ++++ b/bin/NativeTests/NativeTests.vcxproj +@@ -30,6 +30,15 @@ + true + false + false ++ false ++ false ++ false ++ false ++ false ++ false ++ false ++ false ++ false + + + diff --git a/ports/chakracore/portfile.cmake b/ports/chakracore/portfile.cmake index d4bec63d20..b6aa94b4a0 100644 --- a/ports/chakracore/portfile.cmake +++ b/ports/chakracore/portfile.cmake @@ -4,14 +4,20 @@ endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.4.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.4.1) vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://github.com/Microsoft/ChakraCore/archive/v1.4.0.tar.gz" - FILENAME "ChakraCore-1.4.0.tar.gz" - SHA512 d515d56ff1c5776ca4663e27daa4d1c7ca58c57f097799de756980771b5701e35639eefa4db5921d7327e6607b8920df3b30677eb467123e04536df0d971cebc + URLS "https://github.com/Microsoft/ChakraCore/archive/v1.4.1.tar.gz" + FILENAME "ChakraCore-1.4.1.tar.gz" + SHA512 9ca89de88a4d6102826ce4e301ea81b70296cca72131043f9942de715dee2862791c6f33ebce1f12fcafc1554a872a2cf9317313d56c57abff0a6d814a77f2d5 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/disable_warning_as_error.patch +) + vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/Build/Chakra.Core.sln ) @@ -19,6 +25,8 @@ vcpkg_build_msbuild( file(INSTALL ${SOURCE_PATH}/lib/jsrt/ChakraCore.h ${SOURCE_PATH}/lib/jsrt/ChakraCommon.h + ${SOURCE_PATH}/lib/jsrt/ChakraCommonWindows.h + ${SOURCE_PATH}/lib/jsrt/ChakraDebug.h DESTINATION ${CURRENT_PACKAGES_DIR}/include ) file(INSTALL @@ -39,6 +47,12 @@ file(INSTALL ${SOURCE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/Chakracore.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib ) +file(INSTALL + ${SOURCE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/ch.exe + ${SOURCE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/GCStress.exe + ${SOURCE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/rl.exe + DESTINATION ${CURRENT_PACKAGES_DIR}/tools/chakracore) +vcpkg_copy_pdbs() file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/ChakraCore RENAME copyright) From e03ca8215f4d9859185684a2e3c206e0e303be23 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 11:35:21 -0800 Subject: [PATCH 338/561] Update CHANGELOG and bump version to v0.0.72 --- CHANGELOG.md | 37 +++++++++++++++++++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b631be48b2..7fa8739dba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,40 @@ +vcpkg (0.0.72) +-------------- + * Add ports: + - cuda 8.0 + - hdf5 1.8.18 + - lcms 2.8 + - libepoxy 1.4.0-2432daf-1 + - libnice 0.1.13 + - msmpi 8.0 + - parmetis 4.0.3 + - sqlite-modern-cpp 2.4 + - websocketpp 0.7.0 + * Update ports: + - asio 1.10.6 -> 1.10.8 + - aws-sdk-cpp 1.0.47 -> 1.0.61 + - bond 5.0.0-4-g53ea136 -> 5.2.0 + - cpprestsdk 2.9.0-1 -> 2.9.0-2 + - fmt 3.0.1-1 -> 3.0.1-4 + - grpc 1.1.0-dev-1674f65-1 -> 1.1.0-dev-1674f65-2 + - libraw 0.17.2-2 -> 0.18.0-1 + - libvorbis 1.3.5-143caf4023a90c09a5eb685fdd46fb9b9c36b1ee -> 1.3.5-1-143caf4023a90c09a5eb685fdd46fb9b9c36b1ee + - poco 1.7.6-2 -> 1.7.6-3 + - rapidjson 1.0.2-1 -> 1.1.0 + - sfml 2.4.1 -> 2.4.2 + - wt 3.3.6-2 -> 3.3.6-3 + * Introduce Build Policies: + - Packages with special characteristics (e.g. CUDA) can now use Build Policies to control which post-build checks apply to them. + * Improve support for Visual Studio 2017 + - Add auto-detection for Windows SDK + - Fixed various issues with `bootstrap.ps1` and VS2017 support + * Automatic acquisition of perl now uses the 32-bit version isntead of the 64-bit version + * Fix `vcpkg remove --purge` not applying to non-installed packages + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team TUE, 14 Feb 2017 11:30:00 -0800 + + vcpkg (0.0.71) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index fcedfa2359..204dee5e59 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.71" \ No newline at end of file +"0.0.72" \ No newline at end of file From 8aa82bb8957cb5b76ad1d1209cf675b2eba7401d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 13:03:51 -0800 Subject: [PATCH 339/561] [msmpi] Find the correct Program Files. Resolves #669 --- ports/msmpi/portfile.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ports/msmpi/portfile.cmake b/ports/msmpi/portfile.cmake index b59a2f590b..4a142f20b0 100644 --- a/ports/msmpi/portfile.cmake +++ b/ports/msmpi/portfile.cmake @@ -7,8 +7,16 @@ vcpkg_download_distfile(SDK_ARCHIVE SHA512 49c762873ba777ccb3c959a1d2ca1392e4c3c8d366e604ad707184ea432302e6649894ec6599162d0d40f3e6ebc0dada1eb9ca0da1cde0f6ba7a9b1847dac8c0 ) -# Check for correct version of installed redistributable package -set(SYSTEM_MPIEXEC_FILEPATH "$ENV{PROGRAMFILES}/Microsoft MPI/Bin/mpiexec.exe") +### Check for correct version of installed redistributable package + +# We always want the ProgramFiles folder even on a 64-bit machine (not the ProgramFilesx86 folder) +# The following makes sure both 32-bit and 64-bit processes get the correct ProgramFiles +if(DEFINED ENV{ProgramW6432}) + set(PROGRAM_FILES_FOLDER $ENV{ProgramW6432}) +else() + set(PROGRAM_FILES_FOLDER $ENV{PROGRAMFILES}) +endif() +set(SYSTEM_MPIEXEC_FILEPATH "${PROGRAM_FILES_FOLDER}/Microsoft MPI/Bin/mpiexec.exe") set(MSMPI_EXPECTED_FULL_VERSION "8.0.12438.0") if(EXISTS ${SYSTEM_MPIEXEC_FILEPATH}) From c11b2c790e0260434d057cd5fbeccd59f36732c7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 13:21:30 -0800 Subject: [PATCH 340/561] Rename wdupenv_str to get_environmental_variable() --- toolsrc/include/vcpkg_System.h | 2 +- toolsrc/src/commands_edit.cpp | 2 +- toolsrc/src/commands_integrate.cpp | 2 +- toolsrc/src/vcpkg.cpp | 4 ++-- toolsrc/src/vcpkg_Environment.cpp | 8 ++++---- toolsrc/src/vcpkg_System.cpp | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index c9195163c5..92ceacc88b 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -92,5 +92,5 @@ namespace vcpkg::System double microseconds() const; }; - std::wstring wdupenv_str(const wchar_t* varname) noexcept; + std::wstring get_environmental_variable(const wchar_t* varname) noexcept; } diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index dff30f7add..a25a9e4dc6 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -15,7 +15,7 @@ namespace vcpkg::Commands::Edit Checks::check_exit(fs::is_directory(portpath), R"(Could not find port named "%s")", port_name); // Find editor - std::wstring env_EDITOR = System::wdupenv_str(L"EDITOR"); + std::wstring env_EDITOR = System::get_environmental_variable(L"EDITOR"); if (env_EDITOR.empty()) { static const std::wstring CODE_EXE_PATH = LR"(C:\Program Files (x86)\Microsoft VS Code\Code.exe)"; diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 03c51b5a75..93fb294870 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -136,7 +136,7 @@ namespace vcpkg::Commands::Integrate static fs::path get_appdata_targets_path() { - return fs::path(System::wdupenv_str(L"LOCALAPPDATA")) / "vcpkg" / "vcpkg.user.targets"; + return fs::path(System::get_environmental_variable(L"LOCALAPPDATA")) / "vcpkg" / "vcpkg.user.targets"; } static void integrate_install(const vcpkg_paths& paths) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 3e313c7022..27a34b80d4 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -47,7 +47,7 @@ static void inner(const vcpkg_cmd_arguments& args) } else { - auto vcpkg_root_dir_env = System::wdupenv_str(L"VCPKG_ROOT"); + auto vcpkg_root_dir_env = System::get_environmental_variable(L"VCPKG_ROOT"); if (!vcpkg_root_dir_env.empty()) { @@ -79,7 +79,7 @@ static void inner(const vcpkg_cmd_arguments& args) } else { - const auto vcpkg_default_triplet_env = System::wdupenv_str(L"VCPKG_DEFAULT_TRIPLET"); + const auto vcpkg_default_triplet_env = System::get_environmental_variable(L"VCPKG_DEFAULT_TRIPLET"); if (!vcpkg_default_triplet_env.empty()) { default_target_triplet = triplet::from_canonical_name(Strings::utf16_to_utf8(vcpkg_default_triplet_env)); diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 1babdc5470..abde735cb5 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -57,7 +57,7 @@ namespace vcpkg::Environment const fs::path downloaded_git = paths.downloads / "PortableGit" / "cmd"; const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s", downloaded_git.native(), - System::wdupenv_str(L"PATH"), + System::get_environmental_variable(L"PATH"), default_git_installation_dir.native(), default_git_installation_dir_x86.native()); _wputenv_s(L"PATH", path_buf.c_str()); @@ -73,7 +73,7 @@ namespace vcpkg::Environment const fs::path downloaded_cmake = paths.downloads / "cmake-3.7.2-win32-x86" / "bin"; const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s", downloaded_cmake.native(), - System::wdupenv_str(L"PATH"), + System::get_environmental_variable(L"PATH"), default_cmake_installation_dir.native(), default_cmake_installation_dir_x86.native()); _wputenv_s(L"PATH", path_buf.c_str()); @@ -87,7 +87,7 @@ namespace vcpkg::Environment void ensure_nuget_on_path(const vcpkg_paths& paths) { const fs::path downloaded_nuget = paths.downloads / "nuget-3.5.0"; - const std::wstring path_buf = Strings::wformat(L"%s;%s", downloaded_nuget.native(), System::wdupenv_str(L"PATH")); + const std::wstring path_buf = Strings::wformat(L"%s;%s", downloaded_nuget.native(), System::get_environmental_variable(L"PATH")); _wputenv_s(L"PATH", path_buf.c_str()); static constexpr std::array nuget_version = {3,3,0}; @@ -107,7 +107,7 @@ namespace vcpkg::Environment static const fs::path& get_VS2015_installation_instance() { - static const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // The call to parent_path() is needed because the env variable has a trailing backslash + static const fs::path vs2015_cmntools = fs::path(System::get_environmental_variable(L"VS140COMNTOOLS")).parent_path(); // The call to parent_path() is needed because the env variable has a trailing backslash static const fs::path vs2015_path = vs2015_cmntools.parent_path().parent_path(); return vs2015_path; } diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 754a26741f..1d9f8e6966 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -73,7 +73,7 @@ namespace vcpkg::System std::cout << "\n"; } - std::wstring wdupenv_str(const wchar_t* varname) noexcept + std::wstring get_environmental_variable(const wchar_t* varname) noexcept { std::wstring ret; wchar_t* buffer; From 0d47ce63ed1cc5159a038de0a8446e3828b8aeeb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 13:26:21 -0800 Subject: [PATCH 341/561] Add System::set_environmental_variable() --- toolsrc/include/vcpkg_System.h | 2 ++ toolsrc/src/vcpkg_Environment.cpp | 6 +++--- toolsrc/src/vcpkg_System.cpp | 11 ++++++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index 92ceacc88b..777f64bf4f 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -93,4 +93,6 @@ namespace vcpkg::System }; std::wstring get_environmental_variable(const wchar_t* varname) noexcept; + + void set_environmental_variable(const wchar_t* varname, const wchar_t* varvalue) noexcept; } diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index abde735cb5..7722136952 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -60,7 +60,7 @@ namespace vcpkg::Environment System::get_environmental_variable(L"PATH"), default_git_installation_dir.native(), default_git_installation_dir_x86.native()); - _wputenv_s(L"PATH", path_buf.c_str()); + System::set_environmental_variable(L"PATH", path_buf.c_str()); static constexpr std::array git_version = {2,0,0}; static const std::wstring version_check_cmd = L"git --version 2>&1"; @@ -76,7 +76,7 @@ namespace vcpkg::Environment System::get_environmental_variable(L"PATH"), default_cmake_installation_dir.native(), default_cmake_installation_dir_x86.native()); - _wputenv_s(L"PATH", path_buf.c_str()); + System::set_environmental_variable(L"PATH", path_buf.c_str()); static constexpr std::array cmake_version = {3,7,2}; static const std::wstring version_check_cmd = L"cmake --version 2>&1"; @@ -88,7 +88,7 @@ namespace vcpkg::Environment { const fs::path downloaded_nuget = paths.downloads / "nuget-3.5.0"; const std::wstring path_buf = Strings::wformat(L"%s;%s", downloaded_nuget.native(), System::get_environmental_variable(L"PATH")); - _wputenv_s(L"PATH", path_buf.c_str()); + System::set_environmental_variable(L"PATH", path_buf.c_str()); static constexpr std::array nuget_version = {3,3,0}; static const std::wstring version_check_cmd = L"nuget 2>&1"; diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 1d9f8e6966..e7349df692 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -29,7 +29,7 @@ namespace vcpkg::System auto pipe = _wpopen(actual_cmd_line.c_str(), L"r"); if (pipe == nullptr) { - return {1, output}; + return { 1, output }; } while (fgets(buf, 1024, pipe)) { @@ -37,10 +37,10 @@ namespace vcpkg::System } if (!feof(pipe)) { - return {1, output}; + return { 1, output }; } auto ec = _pclose(pipe); - return {ec, output}; + return { ec, output }; } void print(const char* message) @@ -86,6 +86,11 @@ namespace vcpkg::System return ret; } + void set_environmental_variable(const wchar_t* varname, const wchar_t* varvalue) noexcept + { + _wputenv_s(varname, varvalue); + } + void Stopwatch2::start() { static_assert(sizeof(start_time) == sizeof(LARGE_INTEGER), ""); From a5181331653592afcd6223140722ecbcfa58c94d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 15:27:37 -0800 Subject: [PATCH 342/561] Fix typo --- toolsrc/src/vcpkg_Environment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 7722136952..c9d844033a 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -191,7 +191,7 @@ namespace vcpkg::Environment return { vs2015_vcvarsall_bat, L"v140" }; } - System::println(System::color::error, "Could not detect vccarsall.bat."); + System::println(System::color::error, "Could not detect vcvarsall.bat."); System::println("The following paths were examined:"); for (const fs::path& path : paths_examined) { From b882f365e9aebf95c07c8667e38ae2730931f74e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 15:35:34 -0800 Subject: [PATCH 343/561] System::get_environmental_variable() now returns optional<> --- toolsrc/include/vcpkg_System.h | 3 +- toolsrc/src/commands_edit.cpp | 10 ++++-- toolsrc/src/commands_integrate.cpp | 2 +- toolsrc/src/vcpkg.cpp | 13 ++++--- toolsrc/src/vcpkg_Environment.cpp | 57 ++++++++++++++++++++---------- toolsrc/src/vcpkg_System.cpp | 13 ++++--- 6 files changed, 64 insertions(+), 34 deletions(-) diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index 777f64bf4f..7634034ab9 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -2,6 +2,7 @@ #include "vcpkg_Strings.h" #include "filesystem_fs.h" +#include "vcpkg_optional.h" namespace vcpkg::System { @@ -92,7 +93,7 @@ namespace vcpkg::System double microseconds() const; }; - std::wstring get_environmental_variable(const wchar_t* varname) noexcept; + optional get_environmental_variable(const wchar_t* varname) noexcept; void set_environmental_variable(const wchar_t* varname, const wchar_t* varvalue) noexcept; } diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index a25a9e4dc6..1487c759da 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -15,8 +15,14 @@ namespace vcpkg::Commands::Edit Checks::check_exit(fs::is_directory(portpath), R"(Could not find port named "%s")", port_name); // Find editor - std::wstring env_EDITOR = System::get_environmental_variable(L"EDITOR"); - if (env_EDITOR.empty()) + const optional env_EDITOR_optional = System::get_environmental_variable(L"EDITOR"); + std::wstring env_EDITOR; + + if (env_EDITOR_optional) + { + env_EDITOR = *env_EDITOR_optional; + } + else { static const std::wstring CODE_EXE_PATH = LR"(C:\Program Files (x86)\Microsoft VS Code\Code.exe)"; if (fs::exists(CODE_EXE_PATH)) diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 93fb294870..ed3ab2c7e7 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -136,7 +136,7 @@ namespace vcpkg::Commands::Integrate static fs::path get_appdata_targets_path() { - return fs::path(System::get_environmental_variable(L"LOCALAPPDATA")) / "vcpkg" / "vcpkg.user.targets"; + return fs::path(*System::get_environmental_variable(L"LOCALAPPDATA")) / "vcpkg" / "vcpkg.user.targets"; } static void integrate_install(const vcpkg_paths& paths) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 27a34b80d4..1531090536 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -47,11 +47,10 @@ static void inner(const vcpkg_cmd_arguments& args) } else { - auto vcpkg_root_dir_env = System::get_environmental_variable(L"VCPKG_ROOT"); - - if (!vcpkg_root_dir_env.empty()) + const optional vcpkg_root_dir_env = System::get_environmental_variable(L"VCPKG_ROOT"); + if (vcpkg_root_dir_env) { - vcpkg_root_dir = fs::absolute(vcpkg_root_dir_env); + vcpkg_root_dir = fs::absolute(*vcpkg_root_dir_env); } else { @@ -79,10 +78,10 @@ static void inner(const vcpkg_cmd_arguments& args) } else { - const auto vcpkg_default_triplet_env = System::get_environmental_variable(L"VCPKG_DEFAULT_TRIPLET"); - if (!vcpkg_default_triplet_env.empty()) + const optional vcpkg_default_triplet_env = System::get_environmental_variable(L"VCPKG_DEFAULT_TRIPLET"); + if (vcpkg_default_triplet_env) { - default_target_triplet = triplet::from_canonical_name(Strings::utf16_to_utf8(vcpkg_default_triplet_env)); + default_target_triplet = triplet::from_canonical_name(Strings::utf16_to_utf8(*vcpkg_default_triplet_env)); } else { diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index c9d844033a..366c198c2f 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -57,12 +57,12 @@ namespace vcpkg::Environment const fs::path downloaded_git = paths.downloads / "PortableGit" / "cmd"; const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s", downloaded_git.native(), - System::get_environmental_variable(L"PATH"), + *System::get_environmental_variable(L"PATH"), default_git_installation_dir.native(), default_git_installation_dir_x86.native()); System::set_environmental_variable(L"PATH", path_buf.c_str()); - static constexpr std::array git_version = {2,0,0}; + static constexpr std::array git_version = { 2,0,0 }; static const std::wstring version_check_cmd = L"git --version 2>&1"; const std::wstring install_cmd = create_default_install_cmd(paths, L"git"); ensure_on_path(git_version, version_check_cmd, install_cmd); @@ -73,12 +73,12 @@ namespace vcpkg::Environment const fs::path downloaded_cmake = paths.downloads / "cmake-3.7.2-win32-x86" / "bin"; const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s", downloaded_cmake.native(), - System::get_environmental_variable(L"PATH"), + *System::get_environmental_variable(L"PATH"), default_cmake_installation_dir.native(), default_cmake_installation_dir_x86.native()); System::set_environmental_variable(L"PATH", path_buf.c_str()); - static constexpr std::array cmake_version = {3,7,2}; + static constexpr std::array cmake_version = { 3,7,2 }; static const std::wstring version_check_cmd = L"cmake --version 2>&1"; const std::wstring install_cmd = create_default_install_cmd(paths, L"cmake"); ensure_on_path(cmake_version, version_check_cmd, install_cmd); @@ -87,10 +87,10 @@ namespace vcpkg::Environment void ensure_nuget_on_path(const vcpkg_paths& paths) { const fs::path downloaded_nuget = paths.downloads / "nuget-3.5.0"; - const std::wstring path_buf = Strings::wformat(L"%s;%s", downloaded_nuget.native(), System::get_environmental_variable(L"PATH")); + const std::wstring path_buf = Strings::wformat(L"%s;%s", downloaded_nuget.native(), *System::get_environmental_variable(L"PATH")); System::set_environmental_variable(L"PATH", path_buf.c_str()); - static constexpr std::array nuget_version = {3,3,0}; + static constexpr std::array nuget_version = { 3,3,0 }; static const std::wstring version_check_cmd = L"nuget 2>&1"; const std::wstring install_cmd = create_default_install_cmd(paths, L"nuget"); ensure_on_path(nuget_version, version_check_cmd, install_cmd); @@ -105,10 +105,22 @@ namespace vcpkg::Environment return Strings::split(ec_data.output, "\n"); } - static const fs::path& get_VS2015_installation_instance() + static optional find_vs2015_installation_instance() { - static const fs::path vs2015_cmntools = fs::path(System::get_environmental_variable(L"VS140COMNTOOLS")).parent_path(); // The call to parent_path() is needed because the env variable has a trailing backslash + const optional vs2015_cmntools_optional = System::get_environmental_variable(L"VS140COMNTOOLS"); + if (!vs2015_cmntools_optional) + { + return nullptr; + } + + static const fs::path vs2015_cmntools = fs::path(*vs2015_cmntools_optional).parent_path(); // The call to parent_path() is needed because the env variable has a trailing backslash static const fs::path vs2015_path = vs2015_cmntools.parent_path().parent_path(); + return std::make_unique(vs2015_path); + } + + static const optional& get_VS2015_installation_instance() + { + static const optional vs2015_path = find_vs2015_installation_instance(); return vs2015_path; } @@ -145,11 +157,15 @@ namespace vcpkg::Environment } // VS2015 - const fs::path vs2015_dumpbin_exe = get_VS2015_installation_instance() / "VC" / "bin" / "dumpbin.exe"; - paths_examined.push_back(vs2015_dumpbin_exe); - if (fs::exists(vs2015_dumpbin_exe)) + const optional& vs_2015_installation_instance = get_VS2015_installation_instance(); + if (vs_2015_installation_instance) { - return vs2015_dumpbin_exe; + const fs::path vs2015_dumpbin_exe = *vs_2015_installation_instance / "VC" / "bin" / "dumpbin.exe"; + paths_examined.push_back(vs2015_dumpbin_exe); + if (fs::exists(vs2015_dumpbin_exe)) + { + return vs2015_dumpbin_exe; + } } System::println(System::color::error, "Could not detect dumpbin.exe."); @@ -179,23 +195,28 @@ namespace vcpkg::Environment paths_examined.push_back(vcvarsall_bat); if (fs::exists(vcvarsall_bat)) { - return { vcvarsall_bat , L"v141"}; + return { vcvarsall_bat , L"v141" }; } } // VS2015 - const fs::path vs2015_vcvarsall_bat = get_VS2015_installation_instance() / "VC" / "vcvarsall.bat"; - paths_examined.push_back(vs2015_vcvarsall_bat); - if (fs::exists(vs2015_vcvarsall_bat)) + const optional& vs_2015_installation_instance = get_VS2015_installation_instance(); + if (vs_2015_installation_instance) { - return { vs2015_vcvarsall_bat, L"v140" }; + const fs::path vs2015_vcvarsall_bat = *vs_2015_installation_instance / "VC" / "vcvarsall.bat"; + + paths_examined.push_back(vs2015_vcvarsall_bat); + if (fs::exists(vs2015_vcvarsall_bat)) + { + return { vs2015_vcvarsall_bat, L"v140" }; + } } System::println(System::color::error, "Could not detect vcvarsall.bat."); System::println("The following paths were examined:"); for (const fs::path& path : paths_examined) { - System::println(" %s",path.generic_string()); + System::println(" %s", path.generic_string()); } exit(EXIT_FAILURE); } diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index e7349df692..3b056a675b 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -73,17 +73,20 @@ namespace vcpkg::System std::cout << "\n"; } - std::wstring get_environmental_variable(const wchar_t* varname) noexcept + optional get_environmental_variable(const wchar_t* varname) noexcept { std::wstring ret; wchar_t* buffer; _wdupenv_s(&buffer, nullptr, varname); - if (buffer != nullptr) + + if (buffer == nullptr) { - ret = buffer; - free(buffer); + return nullptr; } - return ret; + + ret = buffer; + free(buffer); + return std::make_unique(ret); } void set_environmental_variable(const wchar_t* varname, const wchar_t* varvalue) noexcept From a7c5063d4d08c44c100eb62726ef31a95c1e5121 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 16:23:02 -0800 Subject: [PATCH 344/561] Add functions to find the Program Files folders on the C++ side. Resolves #606 --- toolsrc/include/vcpkg_Environment.h | 4 +++ toolsrc/src/commands_edit.cpp | 3 +- toolsrc/src/commands_integrate.cpp | 8 ++--- toolsrc/src/vcpkg_Environment.cpp | 49 ++++++++++++++++++++++++----- 4 files changed, 52 insertions(+), 12 deletions(-) diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index e4dd47472c..c27ce54c21 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -24,4 +24,8 @@ namespace vcpkg::Environment }; const vcvarsall_and_platform_toolset& get_vcvarsall_bat(const vcpkg_paths& paths); + + const fs::path& get_ProgramFiles_32_bit(); + + const fs::path& get_ProgramFiles_Platform_bitness(); } diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index 1487c759da..50308cec91 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -2,6 +2,7 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_Input.h" +#include "vcpkg_Environment.h" namespace vcpkg::Commands::Edit { @@ -24,7 +25,7 @@ namespace vcpkg::Commands::Edit } else { - static const std::wstring CODE_EXE_PATH = LR"(C:\Program Files (x86)\Microsoft VS Code\Code.exe)"; + static const fs::path CODE_EXE_PATH = Environment::get_ProgramFiles_32_bit() / "Microsoft VS Code/Code.exe"; if (fs::exists(CODE_EXE_PATH)) { env_EDITOR = CODE_EXE_PATH; diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index ed3ab2c7e7..aa5edeb8a8 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -8,10 +8,10 @@ namespace vcpkg::Commands::Integrate { static const std::array old_system_target_files = { - "C:/Program Files (x86)/MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.nuget.targets", - "C:/Program Files (x86)/MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.system.targets" + Environment::get_ProgramFiles_32_bit() / "MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.nuget.targets", + Environment::get_ProgramFiles_32_bit() / "MSBuild/14.0/Microsoft.Common.Targets/ImportBefore/vcpkg.system.targets" }; - static const fs::path system_wide_targets_file = "C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/V140/ImportBefore/Default/vcpkg.system.props"; + static const fs::path system_wide_targets_file = Environment::get_ProgramFiles_32_bit() / "MSBuild/Microsoft.Cpp/v4.0/V140/ImportBefore/Default/vcpkg.system.props"; static std::string create_appdata_targets_shortcut(const std::string& target_path) noexcept { @@ -109,7 +109,7 @@ namespace vcpkg::Commands::Integrate static elevation_prompt_user_choice elevated_cmd_execute(const std::string& param) { - SHELLEXECUTEINFO shExInfo = {0}; + SHELLEXECUTEINFO shExInfo = { 0 }; shExInfo.cbSize = sizeof(shExInfo); shExInfo.fMask = SEE_MASK_NOCLOSEPROCESS; shExInfo.hwnd = nullptr; diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 366c198c2f..3528623b43 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -8,11 +8,6 @@ namespace vcpkg::Environment { - static const fs::path default_cmake_installation_dir = "C:/Program Files/CMake/bin"; - static const fs::path default_cmake_installation_dir_x86 = "C:/Program Files (x86)/CMake/bin"; - static const fs::path default_git_installation_dir = "C:/Program Files/git/cmd"; - static const fs::path default_git_installation_dir_x86 = "C:/Program Files (x86)/git/cmd"; - static void ensure_on_path(const std::array& version, const std::wstring& version_check_cmd, const std::wstring& install_cmd) { System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(version_check_cmd); @@ -54,12 +49,15 @@ namespace vcpkg::Environment void ensure_git_on_path(const vcpkg_paths& paths) { + static const fs::path default_git_installation_dir = Environment::get_ProgramFiles_Platform_bitness() / "git/cmd"; + static const fs::path default_git_installation_dir_32 = Environment::get_ProgramFiles_32_bit() / "git/cmd"; + const fs::path downloaded_git = paths.downloads / "PortableGit" / "cmd"; const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s", downloaded_git.native(), *System::get_environmental_variable(L"PATH"), default_git_installation_dir.native(), - default_git_installation_dir_x86.native()); + default_git_installation_dir_32.native()); System::set_environmental_variable(L"PATH", path_buf.c_str()); static constexpr std::array git_version = { 2,0,0 }; @@ -70,12 +68,15 @@ namespace vcpkg::Environment void ensure_cmake_on_path(const vcpkg_paths& paths) { + static const fs::path default_cmake_installation_dir = Environment::get_ProgramFiles_Platform_bitness() / "CMake/bin"; + static const fs::path default_cmake_installation_dir_32 = Environment::get_ProgramFiles_32_bit() / "CMake/bin"; + const fs::path downloaded_cmake = paths.downloads / "cmake-3.7.2-win32-x86" / "bin"; const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s", downloaded_cmake.native(), *System::get_environmental_variable(L"PATH"), default_cmake_installation_dir.native(), - default_cmake_installation_dir_x86.native()); + default_cmake_installation_dir_32.native()); System::set_environmental_variable(L"PATH", path_buf.c_str()); static constexpr std::array cmake_version = { 3,7,2 }; @@ -226,4 +227,38 @@ namespace vcpkg::Environment static const vcvarsall_and_platform_toolset vcvarsall_bat = find_vcvarsall_bat(paths); return vcvarsall_bat; } + + static fs::path find_ProgramFiles_32_bit() + { + const optional program_files_X86 = System::get_environmental_variable(L"ProgramFiles(x86)"); + if (program_files_X86) + { + return *program_files_X86; + } + + return *System::get_environmental_variable(L"PROGRAMFILES"); + } + + const fs::path& get_ProgramFiles_32_bit() + { + static const fs::path p = find_ProgramFiles_32_bit(); + return p; + } + + static fs::path find_ProgramFiles_Platform_bitness() + { + const optional program_files_W6432 = System::get_environmental_variable(L"ProgramW6432"); + if (program_files_W6432) + { + return *program_files_W6432; + } + + return *System::get_environmental_variable(L"PROGRAMFILES"); + } + + const fs::path& get_ProgramFiles_Platform_bitness() + { + static const fs::path p = find_ProgramFiles_Platform_bitness(); + return p; + } } From 444f28dd24f4bffa3e0ee450e8fbbe30340086b4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 16:53:29 -0800 Subject: [PATCH 345/561] Add functions to find Program Files folders on the powershell side --- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 4 +++- scripts/findTargetPlatformVersion.ps1 | 4 +++- scripts/getProgramFiles32bit.ps1 | 11 +++++++++++ scripts/getProgramFilesPlatformBitness.ps1 | 11 +++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 scripts/getProgramFiles32bit.ps1 create mode 100644 scripts/getProgramFilesPlatformBitness.ps1 diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index 1be4a4e6d2..d160aea125 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -18,7 +18,9 @@ foreach ($instance in $VisualStudio2017InstallationInstances) } # VS2015 -$CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}" +$programFiles32 = & $scriptsDir\getProgramFiles32bit.ps1 +$programFilesP = & $scriptsDir\getProgramFilesPlatformBitness.ps1 +$CandidateProgramFiles = $programFiles32, $programFilesP foreach ($ProgramFiles in $CandidateProgramFiles) { $clExe= "$ProgramFiles\Microsoft Visual Studio 14.0\\VC\bin\cl.exe" diff --git a/scripts/findTargetPlatformVersion.ps1 b/scripts/findTargetPlatformVersion.ps1 index d3dba73f13..650e0b4edc 100644 --- a/scripts/findTargetPlatformVersion.ps1 +++ b/scripts/findTargetPlatformVersion.ps1 @@ -4,7 +4,9 @@ param( ) $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition -$CandidateProgramFiles = "${env:PROGRAMFILES(X86)}", "${env:PROGRAMFILES}" +$programFiles32 = & $scriptsDir\getProgramFiles32bit.ps1 +$programFilesP = & $scriptsDir\getProgramFilesPlatformBitness.ps1 +$CandidateProgramFiles = $programFiles32, $programFilesP # Windows 10 SDK foreach ($ProgramFiles in $CandidateProgramFiles) diff --git a/scripts/getProgramFiles32bit.ps1 b/scripts/getProgramFiles32bit.ps1 new file mode 100644 index 0000000000..fd71671914 --- /dev/null +++ b/scripts/getProgramFiles32bit.ps1 @@ -0,0 +1,11 @@ +[CmdletBinding()] +param( + +) + +if (Test-Path env:PROGRAMFILES`(X86`)) +{ + return ${env:PROGRAMFILES(X86)} +} + +return ${env:PROGRAMFILES} \ No newline at end of file diff --git a/scripts/getProgramFilesPlatformBitness.ps1 b/scripts/getProgramFilesPlatformBitness.ps1 new file mode 100644 index 0000000000..6d0a513ca2 --- /dev/null +++ b/scripts/getProgramFilesPlatformBitness.ps1 @@ -0,0 +1,11 @@ +[CmdletBinding()] +param( + +) + +if (Test-Path env:ProgramW6432) +{ + return ${env:ProgramW6432} +} + +return ${env:PROGRAMFILES} \ No newline at end of file From a9a63192dd77837fd3cf9fb4d04469a54f793317 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 16:57:34 -0800 Subject: [PATCH 346/561] Function rename --- toolsrc/include/vcpkg_Environment.h | 2 +- toolsrc/src/vcpkg_Environment.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index c27ce54c21..c2d2ed7ae6 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -27,5 +27,5 @@ namespace vcpkg::Environment const fs::path& get_ProgramFiles_32_bit(); - const fs::path& get_ProgramFiles_Platform_bitness(); + const fs::path& get_ProgramFiles_platform_bitness(); } diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 3528623b43..c9fadc8ac2 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -49,7 +49,7 @@ namespace vcpkg::Environment void ensure_git_on_path(const vcpkg_paths& paths) { - static const fs::path default_git_installation_dir = Environment::get_ProgramFiles_Platform_bitness() / "git/cmd"; + static const fs::path default_git_installation_dir = Environment::get_ProgramFiles_platform_bitness() / "git/cmd"; static const fs::path default_git_installation_dir_32 = Environment::get_ProgramFiles_32_bit() / "git/cmd"; const fs::path downloaded_git = paths.downloads / "PortableGit" / "cmd"; @@ -68,7 +68,7 @@ namespace vcpkg::Environment void ensure_cmake_on_path(const vcpkg_paths& paths) { - static const fs::path default_cmake_installation_dir = Environment::get_ProgramFiles_Platform_bitness() / "CMake/bin"; + static const fs::path default_cmake_installation_dir = Environment::get_ProgramFiles_platform_bitness() / "CMake/bin"; static const fs::path default_cmake_installation_dir_32 = Environment::get_ProgramFiles_32_bit() / "CMake/bin"; const fs::path downloaded_cmake = paths.downloads / "cmake-3.7.2-win32-x86" / "bin"; @@ -245,7 +245,7 @@ namespace vcpkg::Environment return p; } - static fs::path find_ProgramFiles_Platform_bitness() + static fs::path find_ProgramFiles_platform_bitness() { const optional program_files_W6432 = System::get_environmental_variable(L"ProgramW6432"); if (program_files_W6432) @@ -256,9 +256,9 @@ namespace vcpkg::Environment return *System::get_environmental_variable(L"PROGRAMFILES"); } - const fs::path& get_ProgramFiles_Platform_bitness() + const fs::path& get_ProgramFiles_platform_bitness() { - static const fs::path p = find_ProgramFiles_Platform_bitness(); + static const fs::path p = find_ProgramFiles_platform_bitness(); return p; } } From da26d097165b5d06b77e7dcb13bf1b8a8c9c079e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 17:29:47 -0800 Subject: [PATCH 347/561] Add functions to find Program Files folders on the CMake side --- ports/msmpi/portfile.cmake | 9 ++------- scripts/cmake/vcpkg_common_functions.cmake | 2 ++ scripts/cmake/vcpkg_find_acquire_program.cmake | 5 ++++- scripts/cmake/vcpkg_get_program_files_32_bit.cmake | 7 +++++++ .../cmake/vcpkg_get_program_files_platform_bitness.cmake | 7 +++++++ 5 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 scripts/cmake/vcpkg_get_program_files_32_bit.cmake create mode 100644 scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake diff --git a/ports/msmpi/portfile.cmake b/ports/msmpi/portfile.cmake index 4a142f20b0..faf0123963 100644 --- a/ports/msmpi/portfile.cmake +++ b/ports/msmpi/portfile.cmake @@ -10,13 +10,8 @@ vcpkg_download_distfile(SDK_ARCHIVE ### Check for correct version of installed redistributable package # We always want the ProgramFiles folder even on a 64-bit machine (not the ProgramFilesx86 folder) -# The following makes sure both 32-bit and 64-bit processes get the correct ProgramFiles -if(DEFINED ENV{ProgramW6432}) - set(PROGRAM_FILES_FOLDER $ENV{ProgramW6432}) -else() - set(PROGRAM_FILES_FOLDER $ENV{PROGRAMFILES}) -endif() -set(SYSTEM_MPIEXEC_FILEPATH "${PROGRAM_FILES_FOLDER}/Microsoft MPI/Bin/mpiexec.exe") +vcpkg_get_program_files_platform_bitness(PROGRAM_FILES_PLATFORM_BITNESS) +set(SYSTEM_MPIEXEC_FILEPATH "${PROGRAM_FILES_PLATFORM_BITNESS}/Microsoft MPI/Bin/mpiexec.exe") set(MSMPI_EXPECTED_FULL_VERSION "8.0.12438.0") if(EXISTS ${SYSTEM_MPIEXEC_FILEPATH}) diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index fb626efe8a..50c4ed2dcb 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -14,3 +14,5 @@ include(vcpkg_configure_qmake) include(vcpkg_apply_patches) include(vcpkg_copy_pdbs) include(vcpkg_copy_tool_dependencies) +include(vcpkg_get_program_files_32_bit) +include(vcpkg_get_program_files_platform_bitness) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index b9a397fcc8..44e347e048 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -7,6 +7,9 @@ function(vcpkg_find_acquire_program VAR) unset(SUBDIR) unset(REQUIRED_INTERPRETER) + vcpkg_get_program_files_platform_bitness(PROGRAM_FILES_PLATFORM_BITNESS) + vcpkg_get_program_files_32_bit(PROGRAM_FILES_32_BIT) + if(VAR MATCHES "PERL") set(PROGNAME perl) set(PATHS ${DOWNLOADS}/tools/perl/perl/bin) @@ -61,7 +64,7 @@ function(vcpkg_find_acquire_program VAR) set(HASH 23a26dc7e29979bec5dcd3bfcabf76397b93ace64f5d46f2254d6420158bac5eff1c1a8454e3427e7a2fe2c233c5f2cffc87b376772399e12e40b51be2c065f4) elseif(VAR MATCHES "7Z") set(PROGNAME 7z) - set(PATHS "C:/Program Files/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) diff --git a/scripts/cmake/vcpkg_get_program_files_32_bit.cmake b/scripts/cmake/vcpkg_get_program_files_32_bit.cmake new file mode 100644 index 0000000000..386e59c759 --- /dev/null +++ b/scripts/cmake/vcpkg_get_program_files_32_bit.cmake @@ -0,0 +1,7 @@ +function(vcpkg_get_program_files_32_bit ret) + if(DEFINED ENV{ProgramFiles\(X86\)}) + set(${ret} $ENV{ProgramFiles\(X86\)} PARENT_SCOPE) + else() + set(${ret} $ENV{PROGRAMFILES} PARENT_SCOPE) + endif() +endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake b/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake new file mode 100644 index 0000000000..44fba4d628 --- /dev/null +++ b/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake @@ -0,0 +1,7 @@ +function(vcpkg_get_program_files_platform_bitness ret) + if(DEFINED ENV{ProgramW6432}) + set(${ret} $ENV{ProgramW6432} PARENT_SCOPE) + else() + set(${ret} $ENV{PROGRAMFILES} PARENT_SCOPE) + endif() +endfunction() \ No newline at end of file From ff3b3ecb55e95038ddf22b60650795862bc3e7ba Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 18:28:41 -0800 Subject: [PATCH 348/561] Improve impl of get_environmental_variable() --- toolsrc/src/vcpkg_System.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 3b056a675b..e1a4c9d516 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -75,7 +75,6 @@ namespace vcpkg::System optional get_environmental_variable(const wchar_t* varname) noexcept { - std::wstring ret; wchar_t* buffer; _wdupenv_s(&buffer, nullptr, varname); @@ -83,10 +82,8 @@ namespace vcpkg::System { return nullptr; } - - ret = buffer; - free(buffer); - return std::make_unique(ret); + std::unique_ptr bufptr(buffer, free); + return std::make_unique(buffer); } void set_environmental_variable(const wchar_t* varname, const wchar_t* varvalue) noexcept From 3e0e9e3449d0da506fe70d58cee7715c64708b2b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 18:34:59 -0800 Subject: [PATCH 349/561] [antlr4] Fix downloading of LICENSE file --- ports/antlr4/portfile.cmake | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ports/antlr4/portfile.cmake b/ports/antlr4/portfile.cmake index 8b11c95b07..41bb5559e1 100644 --- a/ports/antlr4/portfile.cmake +++ b/ports/antlr4/portfile.cmake @@ -6,6 +6,14 @@ vcpkg_download_distfile(ARCHIVE FILENAME "antlr4-cpp-runtime-4.6-source.zip" SHA512 e123c2227e41ce80da5a3758725a018690ed70a4e10c23da26c966259e6bdafa192f4363f5a7e1181ef9a47bf3cc50d6b0ca7b26c8dd2b19222a7edf54de8de2 ) + +# license not exist in antlr folder. +vcpkg_download_distfile(LICENSE + URLS https://raw.githubusercontent.com/antlr/antlr4/4.6/LICENSE.txt + FILENAME "antlr4-copyright" + SHA512 c72ae3d5c9f3f07160405b5ca44f01116a9602d82291d6cd218fcc5ec6e8baf985e4baa2acf3d621079585385708bd171c96ef44dd808e60c40a48bc1f56c9ae +) + vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( @@ -62,13 +70,6 @@ else() DESTINATION ${CURRENT_PACKAGES_DIR}/bin) endif() - -# license not exist in antlr folder. -vcpkg_download_distfile(LICENSE - URLS https://raw.githubusercontent.com/antlr/antlr4/master/LICENSE.txt - FILENAME "antlr4-copyright" - SHA512 c72ae3d5c9f3f07160405b5ca44f01116a9602d82291d6cd218fcc5ec6e8baf985e4baa2acf3d621079585385708bd171c96ef44dd808e60c40a48bc1f56c9ae -) file(INSTALL ${LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/antlr4 RENAME copyright) message(STATUS "Installing done") \ No newline at end of file From 9dac4b073ae58e3af0a22f53275f6f36f66f2865 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 18:35:40 -0800 Subject: [PATCH 350/561] [antlr4] Make identation consistent --- ports/antlr4/portfile.cmake | 78 ++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/ports/antlr4/portfile.cmake b/ports/antlr4/portfile.cmake index 41bb5559e1..d10513064a 100644 --- a/ports/antlr4/portfile.cmake +++ b/ports/antlr4/portfile.cmake @@ -9,65 +9,65 @@ vcpkg_download_distfile(ARCHIVE # license not exist in antlr folder. vcpkg_download_distfile(LICENSE - URLS https://raw.githubusercontent.com/antlr/antlr4/4.6/LICENSE.txt - FILENAME "antlr4-copyright" - SHA512 c72ae3d5c9f3f07160405b5ca44f01116a9602d82291d6cd218fcc5ec6e8baf985e4baa2acf3d621079585385708bd171c96ef44dd808e60c40a48bc1f56c9ae + URLS https://raw.githubusercontent.com/antlr/antlr4/4.6/LICENSE.txt + FILENAME "antlr4-copyright" + SHA512 c72ae3d5c9f3f07160405b5ca44f01116a9602d82291d6cd218fcc5ec6e8baf985e4baa2acf3d621079585385708bd171c96ef44dd808e60c40a48bc1f56c9ae ) vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src - PATCHES ${CMAKE_CURRENT_LIST_DIR}/crt_mt.patch +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src + PATCHES ${CMAKE_CURRENT_LIST_DIR}/crt_mt.patch ) if (${VCPKG_LIBRARY_LINKAGE} STREQUAL static) - set(DEBUG_CONFIG "Debug Static") - set(RELEASE_CONFIG "Release Static") + set(DEBUG_CONFIG "Debug Static") + set(RELEASE_CONFIG "Release Static") else() - set(DEBUG_CONFIG "Debug DLL") - set(RELEASE_CONFIG "Release DLL") + set(DEBUG_CONFIG "Debug DLL") + set(RELEASE_CONFIG "Release DLL") endif() -vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/antlr4cpp-vs2015.vcxproj - DEBUG_CONFIGURATION ${DEBUG_CONFIG} - RELEASE_CONFIGURATION ${RELEASE_CONFIG} +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/antlr4cpp-vs2015.vcxproj + DEBUG_CONFIGURATION ${DEBUG_CONFIG} + RELEASE_CONFIGURATION ${RELEASE_CONFIG} ) -file (MAKE_DIRECTORY - ${CURRENT_PACKAGES_DIR}/include) -FILE(COPY ${SOURCE_PATH}/src/ - DESTINATION ${CURRENT_PACKAGES_DIR}/include +file (MAKE_DIRECTORY + ${CURRENT_PACKAGES_DIR}/include) +FILE(COPY ${SOURCE_PATH}/src/ + DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN "*.h") -file (MAKE_DIRECTORY - ${CURRENT_PACKAGES_DIR}/lib - ${CURRENT_PACKAGES_DIR}/debug/lib) +file (MAKE_DIRECTORY + ${CURRENT_PACKAGES_DIR}/lib + ${CURRENT_PACKAGES_DIR}/debug/lib) file(COPY ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${DEBUG_CONFIG}/antlr4-runtime.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) file(COPY ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${RELEASE_CONFIG}/antlr4-runtime.lib - DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) if (${VCPKG_LIBRARY_LINKAGE} STREQUAL static) - vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include - PATCHES ${CMAKE_CURRENT_LIST_DIR}/static.patch - ) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES ${CMAKE_CURRENT_LIST_DIR}/static.patch + ) else() - file (MAKE_DIRECTORY - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/bin) - - file(COPY - ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${DEBUG_CONFIG}/antlr4-runtime.dll - ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${DEBUG_CONFIG}/antlr4-runtime.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(COPY - ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${RELEASE_CONFIG}/antlr4-runtime.dll - ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${RELEASE_CONFIG}/antlr4-runtime.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + file (MAKE_DIRECTORY + ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/debug/bin) + + file(COPY + ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${DEBUG_CONFIG}/antlr4-runtime.dll + ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${DEBUG_CONFIG}/antlr4-runtime.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(COPY + ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${RELEASE_CONFIG}/antlr4-runtime.dll + ${SOURCE_PATH}/bin/vs-2015/${TRIPLET_SYSTEM_ARCH}/${RELEASE_CONFIG}/antlr4-runtime.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) endif() file(INSTALL ${LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/antlr4 RENAME copyright) From 4d29741fcbf8627579f0dde0f0f42bc87d9cb893 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 19:09:09 -0800 Subject: [PATCH 351/561] Flush std::cout before launching external process --- toolsrc/src/vcpkg_System.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index e1a4c9d516..0be026b79e 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -14,6 +14,9 @@ namespace vcpkg::System int cmd_execute(const wchar_t* cmd_line) { + // Flush cout before launching external process + std::cout << std::flush; + // Basically we are wrapping it in quotes const std::wstring& actual_cmd_line = Strings::wformat(LR"###("%s")###", cmd_line); int exit_code = _wsystem(actual_cmd_line.c_str()); @@ -22,6 +25,9 @@ namespace vcpkg::System exit_code_and_output cmd_execute_and_capture_output(const wchar_t* cmd_line) { + // Flush cout before launching external process + std::cout << std::flush; + const std::wstring& actual_cmd_line = Strings::wformat(LR"###("%s")###", cmd_line); std::string output; From edec017ecec2e2a8ad57a0b5ee660b59a9479aac Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 14 Feb 2017 19:20:13 -0800 Subject: [PATCH 352/561] Fix download of nasm. Resolves libjpeg-turbo build error --- scripts/cmake/vcpkg_find_acquire_program.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 44e347e048..7e4f1ba9c1 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -18,10 +18,10 @@ function(vcpkg_find_acquire_program VAR) set(HASH a6e685ea24376f50db5f06c5b46075f1d3be25168fa1f27fa9b02e2ac017826cee62a2b43562f9b6c989337a231ba914416c110075457764de2d11f99d5e0f26) elseif(VAR MATCHES "NASM") set(PROGNAME nasm) - set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.11.08) - set(URL "http://www.nasm.us/pub/nasm/releasebuilds/2.11.08/win32/nasm-2.11.08-win32.zip") - set(ARCHIVE "nasm-2.11.08-win32.zip") - set(HASH cd80b540530d3995d15dc636e97673f1d34f471baadf1dac993165232c61efefe7f8ec10625f8f718fc89f0dd3dcb6a4595e0cf40c5fd7cbac1b71672b644d2d) + set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.12.02) + set(URL "http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win32/nasm-2.12.02-win32.zip") + set(ARCHIVE "nasm-2.12.02-win32.zip") + set(HASH df7aaba094e17832688c88993997612a2e2c96cc3dc14ca3e8347b44c7762115f5a7fc6d7f20be402553aaa4c9e43ddfcf6228f581cfe89289bae550de151b36) elseif(VAR MATCHES "YASM") set(PROGNAME yasm) set(PATHS ${DOWNLOADS}/tools/yasm) From d9462fdf490d3396cac58b1a935b1b8a982b3a72 Mon Sep 17 00:00:00 2001 From: Oleksii Mandrychenko Date: Wed, 15 Feb 2017 10:46:50 +0000 Subject: [PATCH 353/561] Trivial print out change - An error message now contains a command that we can copy-paste directly to powershell vcpkg update => .\\vcpkg update Adding two slashes to escape the output --- toolsrc/src/commands_build.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index c5a2784506..743be216aa 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -49,7 +49,7 @@ namespace vcpkg::Commands::Build if (return_code != 0) { System::println(System::color::error, "Error: building package %s failed", spec.toString()); - System::println("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" + System::println("Please ensure sure you're using the latest portfiles with `.\\vcpkg update`, then\n" "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" " Package: %s\n" " Vcpkg version: %s\n" From 0541bc2807af3f704c3eaf3c9c1caf8dbebeb170 Mon Sep 17 00:00:00 2001 From: Olaf van der Spek Date: Wed, 15 Feb 2017 12:14:01 +0100 Subject: [PATCH 354/561] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1026e21294..ee0d65eda4 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Install any packages with ``` C:\src\vcpkg> .\vcpkg install sdl2 curl ``` -Finally, create a New Project (or open an existing one) in Visual Studio 2015 or Visual Studio "15" Preview. You can now `#include` and use any of the installed libraries. +Finally, create a New Project (or open an existing one) in Visual Studio 2015 or Visual Studio 2017. You can now `#include` and use any of the installed libraries. ## Examples See the [`docs\EXAMPLES.md`](docs/EXAMPLES.md) document for specific walkthroughs, including using a package and adding a new package. From cad7e2a30c3a3e8627a71cf09dca22e60ee11244 Mon Sep 17 00:00:00 2001 From: flysha Date: Wed, 15 Feb 2017 20:14:37 +0800 Subject: [PATCH 355/561] [sqlite3] upgrade to 3.17.0 --- ports/sqlite3/CONTROL | 4 +-- ports/sqlite3/portfile.cmake | 54 ++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/ports/sqlite3/CONTROL b/ports/sqlite3/CONTROL index e382a6f85b..bc5b4af98c 100644 --- a/ports/sqlite3/CONTROL +++ b/ports/sqlite3/CONTROL @@ -1,3 +1,3 @@ -Source: sqlite3 -Version: 3.15.0 +Source: sqlite3 +Version: 3.17.0 Description: SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. \ No newline at end of file diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index 8302e9d3e7..fdf4ec1591 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -1,27 +1,27 @@ -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/sqlite-amalgamation-3150000) -vcpkg_download_distfile(ARCHIVE - URLS "https://sqlite.org/2016/sqlite-amalgamation-3150000.zip" - FILENAME "sqlite-amalgamation-3150000.zip" - SHA512 82fea23b2158c448cbe2b80121eb32652df49eb85357edbaeef0c343ef478433706ebc4cd8add1985763db223d9268d0f7e74fc8db59353c15267cbc3d2078a8 -) -vcpkg_extract_source_archive(${ARCHIVE}) - -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DSOURCE=${SOURCE_PATH} -) -vcpkg_build_cmake() -vcpkg_install_cmake() - -file(READ ${CURRENT_PACKAGES_DIR}/debug/share/sqlite3/sqlite3Config-debug.cmake SQLITE3_DEBUG_CONFIG) -string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" SQLITE3_DEBUG_CONFIG "${SQLITE3_DEBUG_CONFIG}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3Config-debug.cmake "${SQLITE3_DEBUG_CONFIG}") - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - -file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n") -vcpkg_copy_pdbs() +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/sqlite-amalgamation-3170000) +vcpkg_download_distfile(ARCHIVE + URLS "https://sqlite.org/2017/sqlite-amalgamation-3170000.zip" + FILENAME "sqlite-amalgamation-3170000.zip" + SHA512 36dc05dbb21428237332e813181d4dd0c2ffaedb92a53934630c25421617afd9c1a65784665d222501f1b4b5c6445f425f8c512572a97e42603510dcc0796344 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DSOURCE=${SOURCE_PATH} +) +vcpkg_build_cmake() +vcpkg_install_cmake() + +file(READ ${CURRENT_PACKAGES_DIR}/debug/share/sqlite3/sqlite3Config-debug.cmake SQLITE3_DEBUG_CONFIG) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" SQLITE3_DEBUG_CONFIG "${SQLITE3_DEBUG_CONFIG}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3Config-debug.cmake "${SQLITE3_DEBUG_CONFIG}") + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n") +vcpkg_copy_pdbs() From 500fe7957a04e4e9a5dc320580f9e2151f050a65 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 16:12:29 -0800 Subject: [PATCH 356/561] [glbinding] Delete exes that appear in the presence of glfw3. Resolves #537 --- ports/glbinding/portfile.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ports/glbinding/portfile.cmake b/ports/glbinding/portfile.cmake index 165c8d889e..6f6dfcc686 100644 --- a/ports/glbinding/portfile.cmake +++ b/ports/glbinding/portfile.cmake @@ -53,6 +53,19 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/AUTHORS ${CURRENT_PACKAGES_DIR}/debug/VERSION ) +# There are some executables that are only built if glfw is found by CMake (see source/tools/*/CMakeLists.txt). +# glfw is not listed as a dependency for glbinding, so this only happen on systems where package glfw3 is present. +# glbinding's CMake doesn't offer the choice to exlude those tools from the build process, so deleting them here: +file(REMOVE ${CURRENT_PACKAGES_DIR}/glcontexts.exe + ${CURRENT_PACKAGES_DIR}/glfunctions.exe + ${CURRENT_PACKAGES_DIR}/glmeta.exe + ${CURRENT_PACKAGES_DIR}/glqueries.exe + ${CURRENT_PACKAGES_DIR}/debug/glcontextsd.exe + ${CURRENT_PACKAGES_DIR}/debug/glfunctionsd.exe + ${CURRENT_PACKAGES_DIR}/debug/glmetad.exe + ${CURRENT_PACKAGES_DIR}/debug/glqueriesd.exe +) + # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/glbinding) file(RENAME ${CURRENT_PACKAGES_DIR}/share/glbinding/LICENSE ${CURRENT_PACKAGES_DIR}/share/glbinding/copyright) From 03b65486536fc36889a9225fb8dc9de10f823ac6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 16:35:51 -0800 Subject: [PATCH 357/561] Use MinGit instead of PortableGit. Resolves #662 --- scripts/fetchDependency.ps1 | 27 ++++++++++++++++----------- toolsrc/src/vcpkg_Environment.cpp | 9 ++++++--- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 8d31b0edbd..1faf5b165d 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -113,8 +113,11 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) function Expand-ZIPFile($file, $destination) { - Write-Host($file) - Write-Host($destination) + if (!(Test-Path $destination)) + { + New-Item -ItemType Directory -Path $destination | Out-Null + } + $shell = new-object -com shell.application $zip = $shell.NameSpace($file) foreach($item in $zip.items()) @@ -133,6 +136,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $expectedDownloadedFileHash = "ec5e299d412e0272e01d4de5bf07718f42c96361f83d51cc39f91bf49cc3e5c3" $executableFromDownload = "$downloadsDir\cmake-3.7.2-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP + $extractionFolder = $downloadsDir } elseif($Dependency -eq "nuget") { @@ -147,14 +151,15 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) elseif($Dependency -eq "git") { $requiredVersion = "2.0.0" - $downloadVersion = "2.11.0" - $url = "https://github.com/git-for-windows/git/releases/download/v2.11.0.windows.3/PortableGit-2.11.0.3-32-bit.7z.exe" # We choose the 32-bit version - $downloadPath = "$downloadsDir\PortableGit-2.11.0.3-32-bit.7z.exe" - $expectedDownloadedFileHash = "8bf3769c37945e991903dd1b988c6b1d97bbf0f3afc9851508974f38bf94dc01" - # There is another copy of git.exe in PortableGit\bin. However, an installed version of git add the cmd dir to the PATH. + $downloadVersion = "2.11.1" + $url = "https://github.com/git-for-windows/git/releases/download/v2.11.1.windows.1/MinGit-2.11.1-32-bit.zip" # We choose the 32-bit version + $downloadPath = "$downloadsDir\MinGit-2.11.1-32-bit.zip" + $expectedDownloadedFileHash = "6ca79af09015625f350ef4ad74a75cfb001b340aec095b6963be9d45becb3bba" + # There is another copy of git.exe in MinGit\bin. However, an installed version of git add the cmd dir to the PATH. # Therefore, choosing the cmd dir here as well. - $executableFromDownload = "$downloadsDir\PortableGit\cmd\git.exe" - $extractionType = $ExtractionType_SELF_EXTRACTING_7Z + $executableFromDownload = "$downloadsDir\MinGit-2.11.1-32-bit\cmd\git.exe" + $extractionType = $ExtractionType_ZIP + $extractionFolder = "$downloadsDir\MinGit-2.11.1-32-bit" } else { @@ -188,8 +193,8 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { if (-not (Test-Path $executableFromDownload)) # consider renaming the extraction folder to make sure the extraction finished { - # Expand-Archive $downloadPath -dest "$downloadsDir" -Force # Requires powershell 5+ - Expand-ZIPFile -File $downloadPath -Destination $downloadsDir + # Expand-Archive $downloadPath -dest "$extractionFolder" -Force # Requires powershell 5+ + Expand-ZIPFile -File $downloadPath -Destination $extractionFolder } } elseif($extractionType -eq $ExtractionType_SELF_EXTRACTING_7Z) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index c9fadc8ac2..cc3dba1002 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -52,12 +52,15 @@ namespace vcpkg::Environment static const fs::path default_git_installation_dir = Environment::get_ProgramFiles_platform_bitness() / "git/cmd"; static const fs::path default_git_installation_dir_32 = Environment::get_ProgramFiles_32_bit() / "git/cmd"; - const fs::path downloaded_git = paths.downloads / "PortableGit" / "cmd"; - const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s", - downloaded_git.native(), + const fs::path portable_git = paths.downloads / "PortableGit" / "cmd"; // TODO: Remove next time we bump the version + const fs::path min_git = paths.downloads / "MinGit-2.11.1-32-bit" / "cmd"; + const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s;%s", + min_git.native(), + portable_git.native(), *System::get_environmental_variable(L"PATH"), default_git_installation_dir.native(), default_git_installation_dir_32.native()); + System::set_environmental_variable(L"PATH", path_buf.c_str()); static constexpr std::array git_version = { 2,0,0 }; From db4b7dfa655a01964aac052df5fb00c2311a7845 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 16:53:20 -0800 Subject: [PATCH 358/561] [lmdb] Bump version --- ports/lmdb/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/lmdb/CONTROL b/ports/lmdb/CONTROL index bda09ee710..13c648fa64 100644 --- a/ports/lmdb/CONTROL +++ b/ports/lmdb/CONTROL @@ -1,3 +1,3 @@ Source: lmdb -Version: 0.9.18-1 +Version: 0.9.18-2 Description: LMDB is an extraordinarily fast, memory-efficient database \ No newline at end of file From 1ecf03e2b08c0ec3be62da4989730108c7c8de23 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 17:45:02 -0800 Subject: [PATCH 359/561] [clockutils] Remove stray LICENSE file Fixes post-build checks --- ports/clockutils/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/clockutils/portfile.cmake b/ports/clockutils/portfile.cmake index c078673a68..2c75495d9d 100644 --- a/ports/clockutils/portfile.cmake +++ b/ports/clockutils/portfile.cmake @@ -33,5 +33,6 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/clockUtils) file(RENAME ${CURRENT_PACKAGES_DIR}/share/clockUtils/LICENSE ${CURRENT_PACKAGES_DIR}/share/clockUtils/copyright) file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/LICENSE) vcpkg_copy_pdbs() \ No newline at end of file From 2b9035063234f04fb68c3b4fefe8d3da7a5175a6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Feb 2017 17:00:46 -0800 Subject: [PATCH 360/561] Separate dependency check from build_package() --- toolsrc/include/vcpkg_Commands.h | 11 ++++- toolsrc/src/commands_build.cpp | 53 +++++++++++++++---------- toolsrc/src/commands_build_external.cpp | 8 +++- toolsrc/src/commands_install.cpp | 4 +- 4 files changed, 50 insertions(+), 26 deletions(-) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index ef300ac121..86c77a8bf1 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -2,6 +2,7 @@ #include "vcpkg_cmd_arguments.h" #include "vcpkg_paths.h" +#include "StatusParagraphs.h" namespace vcpkg::Commands { @@ -11,16 +12,22 @@ namespace vcpkg::Commands namespace Build { + enum class DependencyStatus + { + ALL_DEPENDENCIES_INSTALLED, + MISSING_DEPENDENCIES + }; + enum class BuildResult { BUILD_NOT_STARTED = 0, SUCCESS, - CASCADED_DUE_TO_MISSING_DEPENDENCIES, BUILD_FAILED, POST_BUILD_CHECKS_FAILED, }; - BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); + DependencyStatus check_dependencies(const SourceParagraph& source_paragraph, const package_spec& spec, const StatusParagraphs& status_db); + BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir, const DependencyStatus& dependency_status); void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); } diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index fa2468e1c4..c9292aae9b 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -24,11 +24,12 @@ namespace vcpkg::Commands::Build std::ofstream(binary_control_file) << bpgh; } - BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir) + BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir, const DependencyStatus& dependency_status) { Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_package()"); - const triplet& target_triplet = spec.target_triplet(); + Checks::check_exit(dependency_status == DependencyStatus::ALL_DEPENDENCIES_INSTALLED, "Dependencies must be satisfied before attempting to build a package"); + const triplet& target_triplet = spec.target_triplet(); const fs::path ports_cmake_script_path = paths.ports_cmake; const Environment::vcvarsall_and_platform_toolset vcvarsall_bat = Environment::get_vcvarsall_bat(paths); const std::wstring command = Strings::wformat(LR"("%s" %s >nul 2>&1 && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s -DVCPKG_PLATFORM_TOOLSET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", @@ -76,6 +77,22 @@ namespace vcpkg::Commands::Build return BuildResult::SUCCESS; } + DependencyStatus check_dependencies(const SourceParagraph& source_paragraph, const package_spec& spec, const StatusParagraphs& status_db) + { + Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to check_dependencies()"); + const triplet& target_triplet = spec.target_triplet(); + + for (auto&& dep : source_paragraph.depends) + { + if (status_db.find_installed(dep.name, target_triplet) == status_db.end()) + { + return DependencyStatus::MISSING_DEPENDENCIES; + } + } + + return DependencyStatus::ALL_DEPENDENCIES_INSTALLED; + } + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { static const std::string example = Commands::Help::create_example_string("build zlib:x64-windows"); @@ -90,7 +107,7 @@ namespace vcpkg::Commands::Build const package_spec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example); Input::check_triplet(spec.target_triplet(), paths); - const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_CHECKS_ONLY}); + const std::unordered_set options = args.check_and_get_optional_command_arguments({ OPTION_CHECKS_ONLY }); if (options.find(OPTION_CHECKS_ONLY) != options.end()) { const size_t error_count = PostBuildLint::perform_all_checks(spec, paths); @@ -106,24 +123,19 @@ namespace vcpkg::Commands::Build Checks::check_exit(!maybe_spgh.error_code(), "Could not find package named %s: %s", spec, maybe_spgh.error_code().message()); const SourceParagraph& spgh = *maybe_spgh.get(); - const std::vector first_level_deps = filter_dependencies(spgh.depends, spec.target_triplet()); - - std::vector first_level_deps_specs; - for (const std::string& dep : first_level_deps) + Environment::ensure_utilities_on_path(paths); + const DependencyStatus dependency_status = check_dependencies(spgh, spec, status_db); + if (dependency_status == DependencyStatus::MISSING_DEPENDENCIES) { - first_level_deps_specs.push_back(package_spec::from_name_and_triplet(dep, spec.target_triplet()).get_or_throw()); - } + std::vector unmet_dependencies = Dependencies::create_install_plan(paths, { spec }, status_db); + unmet_dependencies.erase( + std::remove_if(unmet_dependencies.begin(), unmet_dependencies.end(), [&spec](const package_spec_with_install_plan& p) + { + return (p.spec == spec) || (p.plan.plan_type == install_plan_type::ALREADY_INSTALLED); + }), + unmet_dependencies.end()); - std::vector unmet_dependencies = Dependencies::create_install_plan(paths, first_level_deps_specs, status_db); - unmet_dependencies.erase( - std::remove_if(unmet_dependencies.begin(), unmet_dependencies.end(), [](const package_spec_with_install_plan& p) - { - return p.plan.plan_type == install_plan_type::ALREADY_INSTALLED; - }), - unmet_dependencies.end()); - - if (!unmet_dependencies.empty()) - { + Checks::check_exit(unmet_dependencies.empty()); System::println(System::color::error, "The build command requires all dependencies to be already installed."); System::println("The following dependencies are missing:"); System::println(""); @@ -135,8 +147,7 @@ namespace vcpkg::Commands::Build exit(EXIT_FAILURE); } - Environment::ensure_utilities_on_path(paths); - const BuildResult result = build_package(spgh, spec, paths, paths.port_dir(spec)); + const BuildResult result = build_package(spgh, spec, paths, paths.port_dir(spec), dependency_status); if (result != BuildResult::SUCCESS) { exit(EXIT_FAILURE); diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index 8e9bf50fde..319e3c3d80 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -12,6 +12,8 @@ namespace vcpkg::Commands::BuildExternal static const std::string example = Commands::Help::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); args.check_exact_arg_count(2, example); + StatusParagraphs status_db = database_load_check(paths); + expected maybe_current_spec = package_spec::from_string(args.command_arguments[0], default_target_triplet); if (auto spec = maybe_current_spec.get()) { @@ -21,8 +23,10 @@ namespace vcpkg::Commands::BuildExternal const expected maybe_spgh = try_load_port(port_dir); if (auto spgh = maybe_spgh.get()) { - const Build::BuildResult result = Commands::Build::build_package(*spgh, *spec, paths, port_dir); - if (result !=Build::BuildResult::SUCCESS) + const Build::DependencyStatus dependency_status = Build::check_dependencies(*spgh, *spec, status_db); + Checks::check_exit(dependency_status == Build::DependencyStatus::ALL_DEPENDENCIES_INSTALLED); + const Build::BuildResult result = Commands::Build::build_package(*spgh, *spec, paths, port_dir, dependency_status); + if (result != Build::BuildResult::SUCCESS) { exit(EXIT_FAILURE); } diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 48da05e9c9..a57d2cc6d2 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -214,7 +214,9 @@ namespace vcpkg::Commands::Install } else if (action.plan.plan_type == install_plan_type::BUILD_AND_INSTALL) { - const Build::BuildResult result = Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec)); + const Build::DependencyStatus dependency_status = Build::check_dependencies(*action.plan.source_pgh, action.spec, status_db); + Checks::check_exit(dependency_status == Build::DependencyStatus::ALL_DEPENDENCIES_INSTALLED); + const Build::BuildResult result = Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec), dependency_status); if (result != Build::BuildResult::SUCCESS) { exit(EXIT_FAILURE); From cc1692f304ed5c2514e69a12c4ed974b0d7b679e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Feb 2017 17:14:54 -0800 Subject: [PATCH 361/561] Don't capture anything in lambdas, if they don't need it --- toolsrc/src/vcpkg_Files.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg_Files.cpp index 87700238d5..57d4c665cf 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg_Files.cpp @@ -102,7 +102,7 @@ namespace vcpkg::Files void recursive_find_all_files_in_dir(const fs::path& dir, std::vector* output) { - recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current) + recursive_find_matching_paths_in_dir(dir, [](const fs::path& current) { return !fs::is_directory(current); }, output); @@ -117,7 +117,7 @@ namespace vcpkg::Files void non_recursive_find_all_files_in_dir(const fs::path& dir, std::vector* output) { - non_recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current) + non_recursive_find_matching_paths_in_dir(dir, [](const fs::path& current) { return !fs::is_directory(current); }, output); From c60c9de6e2371b31a79c58719df1d344b564111c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 13 Feb 2017 14:01:27 -0800 Subject: [PATCH 362/561] Restore dependency check in build_package() --- toolsrc/include/vcpkg_Commands.h | 15 ++++---- toolsrc/src/commands_build.cpp | 47 ++++++++++++++++--------- toolsrc/src/commands_build_external.cpp | 7 ++-- toolsrc/src/commands_install.cpp | 7 ++-- 4 files changed, 43 insertions(+), 33 deletions(-) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 86c77a8bf1..c3cda3d87d 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -12,22 +12,19 @@ namespace vcpkg::Commands namespace Build { - enum class DependencyStatus - { - ALL_DEPENDENCIES_INSTALLED, - MISSING_DEPENDENCIES - }; - enum class BuildResult { BUILD_NOT_STARTED = 0, - SUCCESS, + SUCCEEDED, BUILD_FAILED, POST_BUILD_CHECKS_FAILED, + CASCADED_DUE_TO_MISSING_DEPENDENCIES }; - DependencyStatus check_dependencies(const SourceParagraph& source_paragraph, const package_spec& spec, const StatusParagraphs& status_db); - BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir, const DependencyStatus& dependency_status); + const std::string& to_string(const BuildResult build_result); + std::string create_error_message(const std::string& package_id, const BuildResult build_result); + + BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir, const StatusParagraphs& status_db); void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); } diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index c9292aae9b..8dc4a455d8 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -24,12 +24,19 @@ namespace vcpkg::Commands::Build std::ofstream(binary_control_file) << bpgh; } - BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir, const DependencyStatus& dependency_status) + BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir, const StatusParagraphs& status_db) { Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to build_package()"); - Checks::check_exit(dependency_status == DependencyStatus::ALL_DEPENDENCIES_INSTALLED, "Dependencies must be satisfied before attempting to build a package"); const triplet& target_triplet = spec.target_triplet(); + for (auto&& dep : source_paragraph.depends) + { + if (status_db.find_installed(dep.name, target_triplet) == status_db.end()) + { + return BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES; + } + } + const fs::path ports_cmake_script_path = paths.ports_cmake; const Environment::vcvarsall_and_platform_toolset vcvarsall_bat = Environment::get_vcvarsall_bat(paths); const std::wstring command = Strings::wformat(LR"("%s" %s >nul 2>&1 && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s -DVCPKG_PLATFORM_TOOLSET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", @@ -74,23 +81,31 @@ namespace vcpkg::Commands::Build // const fs::path port_buildtrees_dir = paths.buildtrees / spec.name; // delete_directory(port_buildtrees_dir); - return BuildResult::SUCCESS; + return BuildResult::SUCCEEDED; } - DependencyStatus check_dependencies(const SourceParagraph& source_paragraph, const package_spec& spec, const StatusParagraphs& status_db) + const std::string& to_string(const BuildResult build_result) { - Checks::check_exit(spec.name() == source_paragraph.name, "inconsistent arguments to check_dependencies()"); - const triplet& target_triplet = spec.target_triplet(); + static const std::string BUILD_NOT_STARTED_STRING = "BUILD_NOT_STARTED"; + static const std::string SUCCEEDED_STRING = "SUCCEEDED"; + static const std::string BUILD_FAILED_STRING = "BUILD_FAILED"; + static const std::string POST_BUILD_CHECKS_FAILED_STRING = "POST_BUILD_CHECKS_FAILED"; + static const std::string CASCADED_DUE_TO_MISSING_DEPENDENCIES_STRING = "CASCADED_DUE_TO_MISSING_DEPENDENCIES"; - for (auto&& dep : source_paragraph.depends) + switch (build_result) { - if (status_db.find_installed(dep.name, target_triplet) == status_db.end()) - { - return DependencyStatus::MISSING_DEPENDENCIES; - } + case BuildResult::BUILD_NOT_STARTED: return BUILD_NOT_STARTED_STRING; + case BuildResult::SUCCEEDED: return SUCCEEDED_STRING; + case BuildResult::BUILD_FAILED: return BUILD_FAILED_STRING; + case BuildResult::POST_BUILD_CHECKS_FAILED: return POST_BUILD_CHECKS_FAILED_STRING; + case BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES: return CASCADED_DUE_TO_MISSING_DEPENDENCIES_STRING; + default: Checks::unreachable(); } + } - return DependencyStatus::ALL_DEPENDENCIES_INSTALLED; + std::string create_error_message(const std::string& package_id, const BuildResult build_result) + { + return Strings::format("Error: Building package %s failed with: %s", package_id, Build::to_string(build_result)); } void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) @@ -124,8 +139,8 @@ namespace vcpkg::Commands::Build const SourceParagraph& spgh = *maybe_spgh.get(); Environment::ensure_utilities_on_path(paths); - const DependencyStatus dependency_status = check_dependencies(spgh, spec, status_db); - if (dependency_status == DependencyStatus::MISSING_DEPENDENCIES) + const BuildResult result = build_package(spgh, spec, paths, paths.port_dir(spec), status_db); + if (result == BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES) { std::vector unmet_dependencies = Dependencies::create_install_plan(paths, { spec }, status_db); unmet_dependencies.erase( @@ -147,9 +162,9 @@ namespace vcpkg::Commands::Build exit(EXIT_FAILURE); } - const BuildResult result = build_package(spgh, spec, paths, paths.port_dir(spec), dependency_status); - if (result != BuildResult::SUCCESS) + if (result != BuildResult::SUCCEEDED) { + System::println(System::color::error, Build::create_error_message(spec.toString(), result)); exit(EXIT_FAILURE); } diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index 319e3c3d80..0b2fdc7661 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -23,11 +23,10 @@ namespace vcpkg::Commands::BuildExternal const expected maybe_spgh = try_load_port(port_dir); if (auto spgh = maybe_spgh.get()) { - const Build::DependencyStatus dependency_status = Build::check_dependencies(*spgh, *spec, status_db); - Checks::check_exit(dependency_status == Build::DependencyStatus::ALL_DEPENDENCIES_INSTALLED); - const Build::BuildResult result = Commands::Build::build_package(*spgh, *spec, paths, port_dir, dependency_status); - if (result != Build::BuildResult::SUCCESS) + const Build::BuildResult result = Commands::Build::build_package(*spgh, *spec, paths, port_dir, status_db); + if (result != Build::BuildResult::SUCCEEDED) { + System::println(System::color::error, Build::create_error_message(spec->toString(), result)); exit(EXIT_FAILURE); } diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index a57d2cc6d2..b1a0108b7d 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -214,11 +214,10 @@ namespace vcpkg::Commands::Install } else if (action.plan.plan_type == install_plan_type::BUILD_AND_INSTALL) { - const Build::DependencyStatus dependency_status = Build::check_dependencies(*action.plan.source_pgh, action.spec, status_db); - Checks::check_exit(dependency_status == Build::DependencyStatus::ALL_DEPENDENCIES_INSTALLED); - const Build::BuildResult result = Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec), dependency_status); - if (result != Build::BuildResult::SUCCESS) + const Build::BuildResult result = Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec), status_db); + if (result != Build::BuildResult::SUCCEEDED) { + System::println(System::color::error, Build::create_error_message(action.spec.toString(), result)); exit(EXIT_FAILURE); } const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); From c432b66034a4efe304d79926bf81f92cb6e96ad6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 13 Feb 2017 14:01:56 -0800 Subject: [PATCH 363/561] Introduce ci command: builds all packages of a triplet --- toolsrc/include/vcpkg_Commands.h | 6 ++ toolsrc/src/commands_available_commands.cpp | 1 + toolsrc/src/commands_ci.cpp | 92 +++++++++++++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 1 + toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 3 + 5 files changed, 103 insertions(+) create mode 100644 toolsrc/src/commands_ci.cpp diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index c3cda3d87d..976e66c181 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -34,6 +34,12 @@ namespace vcpkg::Commands } namespace Install + { + void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs* status_db); + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } + + namespace CI { void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); } diff --git a/toolsrc/src/commands_available_commands.cpp b/toolsrc/src/commands_available_commands.cpp index 56056218b9..4c7e0df2c6 100644 --- a/toolsrc/src/commands_available_commands.cpp +++ b/toolsrc/src/commands_available_commands.cpp @@ -7,6 +7,7 @@ namespace vcpkg::Commands { static std::vector> t = { {"install", &Install::perform_and_exit}, + { "ci", &CI::perform_and_exit }, {"remove", &Remove::perform_and_exit}, {"build", &Build::perform_and_exit}, {"build_external", &BuildExternal::perform_and_exit} diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp new file mode 100644 index 0000000000..189a801da8 --- /dev/null +++ b/toolsrc/src/commands_ci.cpp @@ -0,0 +1,92 @@ +#include "pch.h" +#include "vcpkg_Commands.h" +#include "vcpkglib.h" +#include "vcpkg_Environment.h" +#include "vcpkg_Files.h" +#include "vcpkg_System.h" +#include "vcpkg_Dependencies.h" +#include "vcpkg_Input.h" +#include "Stopwatch.h" + +namespace vcpkg::Commands::CI +{ + using Dependencies::package_spec_with_install_plan; + using Dependencies::install_plan_type; + + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + { + static const std::string example = Commands::Help::create_example_string("ci x64-windows"); + args.check_max_arg_count(1, example); + const triplet target_triplet = args.command_arguments.size() == 1 ? triplet::from_canonical_name(args.command_arguments.at(0)) : default_target_triplet; + Input::check_triplet(target_triplet, paths); + + StatusParagraphs status_db = database_load_check(paths); + + std::vector port_folders; + Files::non_recursive_find_matching_paths_in_dir(paths.ports, [](const fs::path& current) + { + return fs::is_directory(current); + }, &port_folders); + + std::vector specs; + for (const fs::path& p : port_folders) + { + specs.push_back(package_spec::from_name_and_triplet(p.filename().generic_string(), target_triplet).get_or_throw()); + } + + std::vector install_plan = Dependencies::create_install_plan(paths, specs, status_db); + Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty"); + + std::vector results; + + Environment::ensure_utilities_on_path(paths); + + Stopwatch stopwatch = Stopwatch::createStarted(); + for (const package_spec_with_install_plan& action : install_plan) + { + System::println(stopwatch.toString()); + try + { + if (action.plan.plan_type == install_plan_type::ALREADY_INSTALLED) + { + results.push_back(Build::BuildResult::SUCCEEDED); + System::println(System::color::success, "Package %s is already installed", action.spec); + } + else if (action.plan.plan_type == install_plan_type::BUILD_AND_INSTALL) + { + const Build::BuildResult result = Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec), status_db); + results.push_back(result); + if (result != Build::BuildResult::SUCCEEDED) + { + System::println(System::color::error, Build::create_error_message(action.spec.toString(), result)); + continue; + } + const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); + Install::install_package(paths, bpgh, &status_db); + System::println(System::color::success, "Package %s is installed", action.spec); + } + else if (action.plan.plan_type == install_plan_type::INSTALL) + { + results.push_back(Build::BuildResult::SUCCEEDED); + Install::install_package(paths, *action.plan.binary_pgh, &status_db); + System::println(System::color::success, "Package %s is installed", action.spec); + } + else + Checks::unreachable(); + } + catch (const std::exception& e) + { + System::println(System::color::error, "Error: Could not install package %s: %s", action.spec, e.what()); + exit(EXIT_FAILURE); + } + } + + for (int i = 0; i < results.size(); i++) + { + System::println("%s: %s", install_plan[i].spec.toString(), Build::to_string(results[i])); + } + + System::println(stopwatch.toString()); + exit(EXIT_SUCCESS); + } +} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 537b2fb0fd..7ca8158dd0 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -180,6 +180,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 519331b497..622544e3d4 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -171,6 +171,9 @@ Source Files + + Source Files + From 6e25bcf7cb1efd6de55f97aa978acd24d90af476 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 13 Feb 2017 14:07:27 -0800 Subject: [PATCH 364/561] Swap parameters of Build::create_error_message() --- toolsrc/include/vcpkg_Commands.h | 2 +- toolsrc/src/commands_build.cpp | 4 ++-- toolsrc/src/commands_build_external.cpp | 2 +- toolsrc/src/commands_ci.cpp | 2 +- toolsrc/src/commands_install.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 976e66c181..1dbc9c3754 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -22,7 +22,7 @@ namespace vcpkg::Commands }; const std::string& to_string(const BuildResult build_result); - std::string create_error_message(const std::string& package_id, const BuildResult build_result); + std::string create_error_message(const BuildResult build_result, const std::string& package_id); BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir, const StatusParagraphs& status_db); void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 8dc4a455d8..afc814451f 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -103,7 +103,7 @@ namespace vcpkg::Commands::Build } } - std::string create_error_message(const std::string& package_id, const BuildResult build_result) + std::string create_error_message(const BuildResult build_result, const std::string& package_id) { return Strings::format("Error: Building package %s failed with: %s", package_id, Build::to_string(build_result)); } @@ -164,7 +164,7 @@ namespace vcpkg::Commands::Build if (result != BuildResult::SUCCEEDED) { - System::println(System::color::error, Build::create_error_message(spec.toString(), result)); + System::println(System::color::error, Build::create_error_message(result, spec.toString())); exit(EXIT_FAILURE); } diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index 0b2fdc7661..42b649dc32 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -26,7 +26,7 @@ namespace vcpkg::Commands::BuildExternal const Build::BuildResult result = Commands::Build::build_package(*spgh, *spec, paths, port_dir, status_db); if (result != Build::BuildResult::SUCCEEDED) { - System::println(System::color::error, Build::create_error_message(spec->toString(), result)); + System::println(System::color::error, Build::create_error_message(result, spec->toString())); exit(EXIT_FAILURE); } diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index 189a801da8..d6239b0801 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -58,7 +58,7 @@ namespace vcpkg::Commands::CI results.push_back(result); if (result != Build::BuildResult::SUCCEEDED) { - System::println(System::color::error, Build::create_error_message(action.spec.toString(), result)); + System::println(System::color::error, Build::create_error_message(result, action.spec.toString())); continue; } const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index b1a0108b7d..76b9e36e4d 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -217,7 +217,7 @@ namespace vcpkg::Commands::Install const Build::BuildResult result = Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec), status_db); if (result != Build::BuildResult::SUCCEEDED) { - System::println(System::color::error, Build::create_error_message(action.spec.toString(), result)); + System::println(System::color::error, Build::create_error_message(result, action.spec.toString())); exit(EXIT_FAILURE); } const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); From 6824cc9264d245ebd1302c27eb714250c5f7ec13 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 13 Feb 2017 16:22:02 -0800 Subject: [PATCH 365/561] Extract create_user_troubleshooting_message(). CI doesn't call it, interactive commands do --- toolsrc/include/vcpkg_Commands.h | 1 + toolsrc/src/commands_build.cpp | 20 ++++++++++++-------- toolsrc/src/commands_build_external.cpp | 1 + toolsrc/src/commands_install.cpp | 1 + 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 1dbc9c3754..1e8b3b9df7 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -23,6 +23,7 @@ namespace vcpkg::Commands const std::string& to_string(const BuildResult build_result); std::string create_error_message(const BuildResult build_result, const std::string& package_id); + std::string create_user_troubleshooting_message(const package_spec& spec); BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir, const StatusParagraphs& status_db); void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index afc814451f..750350a4a8 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -56,14 +56,6 @@ namespace vcpkg::Commands::Build if (return_code != 0) { - System::println(System::color::error, "Error: building package %s failed", spec.toString()); - System::println("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" - "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" - " Package: %s\n" - " Vcpkg version: %s\n" - "\n" - "Additionally, attach any relevant sections from the log files above." - , spec.toString(), Info::version()); TrackProperty("error", "build failed"); TrackProperty("build_error", spec.toString()); return BuildResult::BUILD_FAILED; @@ -108,6 +100,17 @@ namespace vcpkg::Commands::Build return Strings::format("Error: Building package %s failed with: %s", package_id, Build::to_string(build_result)); } + std::string create_user_troubleshooting_message(const package_spec& spec) + { + return Strings::format("Please ensure sure you're using the latest portfiles with `vcpkg update`, then\n" + "submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n" + " Package: %s\n" + " Vcpkg version: %s\n" + "\n" + "Additionally, attach any relevant sections from the log files above." + , spec.toString(), Info::version()); + } + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { static const std::string example = Commands::Help::create_example_string("build zlib:x64-windows"); @@ -165,6 +168,7 @@ namespace vcpkg::Commands::Build if (result != BuildResult::SUCCEEDED) { System::println(System::color::error, Build::create_error_message(result, spec.toString())); + System::println(Build::create_user_troubleshooting_message(spec)); exit(EXIT_FAILURE); } diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index 42b649dc32..fbda74f3f9 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -27,6 +27,7 @@ namespace vcpkg::Commands::BuildExternal if (result != Build::BuildResult::SUCCEEDED) { System::println(System::color::error, Build::create_error_message(result, spec->toString())); + System::println(Build::create_user_troubleshooting_message(*spec)); exit(EXIT_FAILURE); } diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 76b9e36e4d..af068a4fb3 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -218,6 +218,7 @@ namespace vcpkg::Commands::Install if (result != Build::BuildResult::SUCCEEDED) { System::println(System::color::error, Build::create_error_message(result, action.spec.toString())); + System::println(Build::create_user_troubleshooting_message(action.spec)); exit(EXIT_FAILURE); } const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); From 430739c468f7ea3cc513b85339ac51c16073325c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 13 Feb 2017 16:23:21 -0800 Subject: [PATCH 366/561] Change parameter from std::string to package_spec --- toolsrc/include/vcpkg_Commands.h | 2 +- toolsrc/src/commands_build.cpp | 6 +++--- toolsrc/src/commands_build_external.cpp | 2 +- toolsrc/src/commands_ci.cpp | 2 +- toolsrc/src/commands_install.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 1e8b3b9df7..471485e311 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -22,7 +22,7 @@ namespace vcpkg::Commands }; const std::string& to_string(const BuildResult build_result); - std::string create_error_message(const BuildResult build_result, const std::string& package_id); + std::string create_error_message(const BuildResult build_result, const package_spec& spec); std::string create_user_troubleshooting_message(const package_spec& spec); BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir, const StatusParagraphs& status_db); diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 750350a4a8..264f9c06ec 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -95,9 +95,9 @@ namespace vcpkg::Commands::Build } } - std::string create_error_message(const BuildResult build_result, const std::string& package_id) + std::string create_error_message(const BuildResult build_result, const package_spec& spec) { - return Strings::format("Error: Building package %s failed with: %s", package_id, Build::to_string(build_result)); + return Strings::format("Error: Building package %s failed with: %s", spec.toString(), Build::to_string(build_result)); } std::string create_user_troubleshooting_message(const package_spec& spec) @@ -167,7 +167,7 @@ namespace vcpkg::Commands::Build if (result != BuildResult::SUCCEEDED) { - System::println(System::color::error, Build::create_error_message(result, spec.toString())); + System::println(System::color::error, Build::create_error_message(result, spec)); System::println(Build::create_user_troubleshooting_message(spec)); exit(EXIT_FAILURE); } diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index fbda74f3f9..0b40103104 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -26,7 +26,7 @@ namespace vcpkg::Commands::BuildExternal const Build::BuildResult result = Commands::Build::build_package(*spgh, *spec, paths, port_dir, status_db); if (result != Build::BuildResult::SUCCEEDED) { - System::println(System::color::error, Build::create_error_message(result, spec->toString())); + System::println(System::color::error, Build::create_error_message(result, *spec)); System::println(Build::create_user_troubleshooting_message(*spec)); exit(EXIT_FAILURE); } diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index d6239b0801..dd42335dfd 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -58,7 +58,7 @@ namespace vcpkg::Commands::CI results.push_back(result); if (result != Build::BuildResult::SUCCEEDED) { - System::println(System::color::error, Build::create_error_message(result, action.spec.toString())); + System::println(System::color::error, Build::create_error_message(result, action.spec)); continue; } const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index af068a4fb3..d4ec64e09f 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -217,7 +217,7 @@ namespace vcpkg::Commands::Install const Build::BuildResult result = Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec), status_db); if (result != Build::BuildResult::SUCCEEDED) { - System::println(System::color::error, Build::create_error_message(result, action.spec.toString())); + System::println(System::color::error, Build::create_error_message(result, action.spec)); System::println(Build::create_user_troubleshooting_message(action.spec)); exit(EXIT_FAILURE); } From ab2cca3dad9d7efdc87e40554ccb6dc582d22360 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 14:34:03 -0800 Subject: [PATCH 367/561] Add BuildResul_Values and rename NULLVALUE const --- toolsrc/include/vcpkg_Commands.h | 5 ++++- toolsrc/src/commands_build.cpp | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 471485e311..5c643d017e 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -3,6 +3,7 @@ #include "vcpkg_cmd_arguments.h" #include "vcpkg_paths.h" #include "StatusParagraphs.h" +#include namespace vcpkg::Commands { @@ -14,13 +15,15 @@ namespace vcpkg::Commands { enum class BuildResult { - BUILD_NOT_STARTED = 0, + NULLVALUE = 0, SUCCEEDED, BUILD_FAILED, POST_BUILD_CHECKS_FAILED, CASCADED_DUE_TO_MISSING_DEPENDENCIES }; + static constexpr std::array BuildResult_values = { BuildResult::SUCCEEDED, BuildResult::BUILD_FAILED, BuildResult::POST_BUILD_CHECKS_FAILED, BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES }; + const std::string& to_string(const BuildResult build_result); std::string create_error_message(const BuildResult build_result, const package_spec& spec); std::string create_user_troubleshooting_message(const package_spec& spec); diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 264f9c06ec..03a4b944bc 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -9,6 +9,7 @@ #include "vcpkg_Environment.h" #include "metrics.h" #include "vcpkg_info.h" +#include "vcpkg_Enums.h" namespace vcpkg::Commands::Build { @@ -78,7 +79,7 @@ namespace vcpkg::Commands::Build const std::string& to_string(const BuildResult build_result) { - static const std::string BUILD_NOT_STARTED_STRING = "BUILD_NOT_STARTED"; + static const std::string NULLVALUE_STRING = Enums::nullvalue_toString("vcpkg::Commands::Build::BuildResult"); static const std::string SUCCEEDED_STRING = "SUCCEEDED"; static const std::string BUILD_FAILED_STRING = "BUILD_FAILED"; static const std::string POST_BUILD_CHECKS_FAILED_STRING = "POST_BUILD_CHECKS_FAILED"; @@ -86,7 +87,7 @@ namespace vcpkg::Commands::Build switch (build_result) { - case BuildResult::BUILD_NOT_STARTED: return BUILD_NOT_STARTED_STRING; + case BuildResult::NULLVALUE: return NULLVALUE_STRING; case BuildResult::SUCCEEDED: return SUCCEEDED_STRING; case BuildResult::BUILD_FAILED: return BUILD_FAILED_STRING; case BuildResult::POST_BUILD_CHECKS_FAILED: return POST_BUILD_CHECKS_FAILED_STRING; From dbd8e5c56de12beb7626a7782f54b591b6154aa4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 14:34:39 -0800 Subject: [PATCH 368/561] Print only non-SUCCEEDED packages and also show summary --- toolsrc/src/commands_ci.cpp | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index dd42335dfd..496ae6146a 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -12,6 +12,7 @@ namespace vcpkg::Commands::CI { using Dependencies::package_spec_with_install_plan; using Dependencies::install_plan_type; + using Build::BuildResult; void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { @@ -37,10 +38,9 @@ namespace vcpkg::Commands::CI std::vector install_plan = Dependencies::create_install_plan(paths, specs, status_db); Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty"); - std::vector results; - Environment::ensure_utilities_on_path(paths); + std::vector results; Stopwatch stopwatch = Stopwatch::createStarted(); for (const package_spec_with_install_plan& action : install_plan) { @@ -49,14 +49,14 @@ namespace vcpkg::Commands::CI { if (action.plan.plan_type == install_plan_type::ALREADY_INSTALLED) { - results.push_back(Build::BuildResult::SUCCEEDED); + results.push_back(BuildResult::SUCCEEDED); System::println(System::color::success, "Package %s is already installed", action.spec); } else if (action.plan.plan_type == install_plan_type::BUILD_AND_INSTALL) { - const Build::BuildResult result = Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec), status_db); + const BuildResult result = Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec), status_db); results.push_back(result); - if (result != Build::BuildResult::SUCCEEDED) + if (result != BuildResult::SUCCEEDED) { System::println(System::color::error, Build::create_error_message(result, action.spec)); continue; @@ -67,7 +67,7 @@ namespace vcpkg::Commands::CI } else if (action.plan.plan_type == install_plan_type::INSTALL) { - results.push_back(Build::BuildResult::SUCCEEDED); + results.push_back(BuildResult::SUCCEEDED); Install::install_package(paths, *action.plan.binary_pgh, &status_db); System::println(System::color::success, "Package %s is installed", action.spec); } @@ -81,12 +81,35 @@ namespace vcpkg::Commands::CI } } + System::println(stopwatch.toString()); + for (int i = 0; i < results.size(); i++) { + if (results[i] == BuildResult::SUCCEEDED) + { + continue; + } + System::println("%s: %s", install_plan[i].spec.toString(), Build::to_string(results[i])); } - System::println(stopwatch.toString()); + std::map summary; + for (const BuildResult& v : Build::BuildResult_values) + { + summary[v] = 0; + } + + for (const BuildResult& r : results) + { + summary[r]++; + } + + System::println("\n\nSUMMARY"); + for (const std::pair& entry : summary) + { + System::println(" %s: %d", Build::to_string(entry.first), entry.second); + } + exit(EXIT_SUCCESS); } } From fcafe9acea90db01ad059d96aeca82c1880e7da6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 15:22:40 -0800 Subject: [PATCH 369/561] Improve info displayed during the CI command --- toolsrc/src/commands_ci.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index 496ae6146a..b20c204f45 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -35,16 +35,19 @@ namespace vcpkg::Commands::CI specs.push_back(package_spec::from_name_and_triplet(p.filename().generic_string(), target_triplet).get_or_throw()); } - std::vector install_plan = Dependencies::create_install_plan(paths, specs, status_db); + const std::vector install_plan = Dependencies::create_install_plan(paths, specs, status_db); Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty"); Environment::ensure_utilities_on_path(paths); std::vector results; Stopwatch stopwatch = Stopwatch::createStarted(); + size_t counter = 0; + const size_t package_count = install_plan.size(); for (const package_spec_with_install_plan& action : install_plan) { - System::println(stopwatch.toString()); + counter++; + System::println("Starting package %d/%d: %s. Time Elapsed: %s", counter, package_count, action.spec.toString(), stopwatch.toString()); try { if (action.plan.plan_type == install_plan_type::ALREADY_INSTALLED) From b39b2d298d0a1c9e05d0fcaf3e801a0a5bd9cb41 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 18:38:40 -0800 Subject: [PATCH 370/561] Remove unused variable from create_remove_plan() --- toolsrc/include/vcpkg_Dependencies.h | 2 +- toolsrc/src/commands_remove.cpp | 2 +- toolsrc/src/vcpkg_Dependencies.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index b638160891..dca824ee95 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -75,5 +75,5 @@ namespace vcpkg::Dependencies std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); - std::vector create_remove_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + std::vector create_remove_plan(const std::vector& specs, const StatusParagraphs& status_db); } diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index f49104d1ec..92ab56a282 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -176,7 +176,7 @@ namespace vcpkg::Commands::Remove const bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end(); const bool isRecursive = options.find(OPTION_RECURSE) != options.end(); - const std::vector remove_plan = Dependencies::create_remove_plan(paths, specs, status_db); + const std::vector remove_plan = Dependencies::create_remove_plan(specs, status_db); Checks::check_exit(!remove_plan.empty(), "Remove plan cannot be empty"); print_plan(remove_plan); diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 5bd6c3eb9d..957814e6e6 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -97,7 +97,7 @@ namespace vcpkg::Dependencies return ret; } - std::vector create_remove_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db) + std::vector create_remove_plan(const std::vector& specs, const StatusParagraphs& status_db) { std::unordered_set specs_as_set(specs.cbegin(), specs.cend()); From 1f673572ae0df09bf9fe72e5a5e530f99b084114 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 18:40:39 -0800 Subject: [PATCH 371/561] Fix cast to WORD --- toolsrc/src/vcpkg_System.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 0be026b79e..90ec9c99ca 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -68,7 +68,7 @@ namespace vcpkg::System GetConsoleScreenBufferInfo(hConsole, &consoleScreenBufferInfo); auto original_color = consoleScreenBufferInfo.wAttributes; - SetConsoleTextAttribute(hConsole, static_cast(c) | (original_color & 0xF0)); + SetConsoleTextAttribute(hConsole, static_cast(c) | (original_color & 0xF0)); std::cout << message; SetConsoleTextAttribute(hConsole, original_color); } From 809d66c53db89666519a23372c3c26821bc8e4e4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 18:45:26 -0800 Subject: [PATCH 372/561] Remove parameter names to avoid C4100 --- toolsrc/src/vcpkg_metrics_uploader.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/toolsrc/src/vcpkg_metrics_uploader.cpp b/toolsrc/src/vcpkg_metrics_uploader.cpp index 14fc9ae48b..82dcd4b03a 100644 --- a/toolsrc/src/vcpkg_metrics_uploader.cpp +++ b/toolsrc/src/vcpkg_metrics_uploader.cpp @@ -5,13 +5,7 @@ using namespace vcpkg; -int WINAPI -WinMain( - _In_ HINSTANCE hInstance, - _In_opt_ HINSTANCE hPrevInstance, - _In_ LPSTR lpCmdLine, - _In_ int nShowCmd -) +int WINAPI WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPSTR, _In_ int) { LPWSTR* szArgList; int argCount; From 50187c07a73216ae30c26c70bd821e8455c221de Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 18:46:27 -0800 Subject: [PATCH 373/561] Remove disabled post-build check --- toolsrc/src/PostBuildLint.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index a5fd7aa52e..c4ddbc62ee 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -425,24 +425,6 @@ namespace vcpkg::PostBuildLint return lint_status::SUCCESS; } - static lint_status check_no_subdirectories(const fs::path& dir) - { - const std::vector subdirectories = Files::recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current) - { - return fs::is_directory(current); - }); - - if (!subdirectories.empty()) - { - System::println(System::color::warning, "Directory %s should have no subdirectories", dir.generic_string()); - System::println("The following subdirectories were found: "); - Files::print_paths(subdirectories); - return lint_status::ERROR_DETECTED; - } - - return lint_status::SUCCESS; - } - static lint_status check_bin_folders_are_not_present_in_static_build(const fs::path& package_dir) { const fs::path bin = package_dir / "bin"; @@ -700,10 +682,6 @@ namespace vcpkg::PostBuildLint default: Checks::unreachable(); } -#if 0 - error_count += check_no_subdirectories(package_dir / "lib"); - error_count += check_no_subdirectories(package_dir / "debug" / "lib"); -#endif error_count += check_no_empty_folders(package_dir); error_count += check_no_files_in_package_dir_and_debug_dir(package_dir); From e11db4d5da2e471d6066c635cc370f8f9e88670a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 18:48:06 -0800 Subject: [PATCH 374/561] Remove unused function --- toolsrc/src/BinaryParagraph.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/toolsrc/src/BinaryParagraph.cpp b/toolsrc/src/BinaryParagraph.cpp index f949677a38..8605cd2765 100644 --- a/toolsrc/src/BinaryParagraph.cpp +++ b/toolsrc/src/BinaryParagraph.cpp @@ -23,22 +23,6 @@ namespace vcpkg static const std::string DEPENDS = "Depends"; } - static const std::vector& get_list_of_valid_fields() - { - static const std::vector valid_fields = - { - BinaryParagraphRequiredField::PACKAGE, - BinaryParagraphRequiredField::VERSION, - BinaryParagraphRequiredField::ARCHITECTURE, - - BinaryParagraphOptionalField::DESCRIPTION, - BinaryParagraphOptionalField::MAINTAINER, - BinaryParagraphOptionalField::DEPENDS - }; - - return valid_fields; - } - BinaryParagraph::BinaryParagraph() = default; BinaryParagraph::BinaryParagraph(std::unordered_map fields) From c031bda3bd17a465109bdfa3c79146f32382a70b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 18:58:37 -0800 Subject: [PATCH 375/561] Test result of assignment. Avoids C4706 --- toolsrc/src/metrics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp index 263d6eb74c..5ef54f15d1 100644 --- a/toolsrc/src/metrics.cpp +++ b/toolsrc/src/metrics.cpp @@ -357,7 +357,7 @@ true { DWORD availableData = 0, readData = 0, totalData = 0; - while ((bResults = WinHttpQueryDataAvailable(hRequest, &availableData)) && availableData > 0) + while ((bResults = WinHttpQueryDataAvailable(hRequest, &availableData)) == TRUE && availableData > 0) { responseBuffer.resize(responseBuffer.size() + availableData); From ad197b4a742920e42eb7a1a649c07de417a517ad Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 18:58:44 -0800 Subject: [PATCH 376/561] Formatting --- toolsrc/src/metrics.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp index 5ef54f15d1..4ac43c5c6f 100644 --- a/toolsrc/src/metrics.cpp +++ b/toolsrc/src/metrics.cpp @@ -32,7 +32,7 @@ namespace vcpkg static std::string GenerateRandomUUID() { - int partSizes[] = {8, 4, 4, 4, 12}; + int partSizes[] = { 8, 4, 4, 4, 12 }; char uuid[37]; memset(uuid, 0, sizeof(uuid)); int num; @@ -101,7 +101,7 @@ namespace vcpkg // Note: this treats incoming Strings as Latin-1 static constexpr const char hex[16] = { '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; encoded.append("\\u00"); encoded.push_back(hex[ch / 16]); encoded.push_back(hex[ch % 16]); @@ -229,8 +229,10 @@ true { LONG err; - struct RAII_HKEY { + struct RAII_HKEY + { HKEY hkey = nullptr; + ~RAII_HKEY() { if (hkey != nullptr) @@ -244,7 +246,7 @@ true return L"{}"; } - std::array buffer; + std::array buffer; DWORD lType = 0; DWORD dwBufferSize = static_cast(buffer.size() * sizeof(wchar_t)); err = RegQueryValueExW(HKCU_SQMClient.hkey, L"UserId", nullptr, &lType, reinterpret_cast(buffer.data()), &dwBufferSize); @@ -356,7 +358,6 @@ true if (bResults) { DWORD availableData = 0, readData = 0, totalData = 0; - while ((bResults = WinHttpQueryDataAvailable(hRequest, &availableData)) == TRUE && availableData > 0) { responseBuffer.resize(responseBuffer.size() + availableData); From 293fcbec59a147f182a2d7b46a67797dcbf4a258 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 19:19:19 -0800 Subject: [PATCH 377/561] [!] Change the format of the listfile --- toolsrc/src/commands_install.cpp | 6 ++++-- toolsrc/src/vcpkglib.cpp | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index d4ec64e09f..9757e171d0 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -24,7 +24,7 @@ namespace vcpkg::Commands::Install const std::string& target_triplet_as_string = target_triplet.canonical_name(); std::error_code ec; fs::create_directory(paths.installed / target_triplet_as_string, ec); - output.push_back(Strings::format(R"(%s)", target_triplet_as_string)); + output.push_back(Strings::format(R"(%s/)", target_triplet_as_string)); for (auto it = fs::recursive_directory_iterator(package_prefix_path); it != fs::recursive_directory_iterator(); ++it) { @@ -54,7 +54,7 @@ namespace vcpkg::Commands::Install } // Trailing backslash for directories - output.push_back(Strings::format(R"(%s/%s)", target_triplet_as_string, suffix)); + output.push_back(Strings::format(R"(%s/%s/)", target_triplet_as_string, suffix)); continue; } @@ -82,6 +82,8 @@ namespace vcpkg::Commands::Install System::println(System::color::error, "failed: %s: cannot handle file type", it->path().u8string()); } + std::sort(output.begin(), output.end()); + Files::write_all_lines(paths.listfile_path(bpgh), output); } diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkglib.cpp index 06487684c5..78918e62cc 100644 --- a/toolsrc/src/vcpkglib.cpp +++ b/toolsrc/src/vcpkglib.cpp @@ -164,12 +164,10 @@ static void upgrade_to_slash_terminated_sorted_format(std::vector* // The new format is lexicographically sorted std::sort(lines->begin(), lines->end()); -#if 0 // Replace the listfile on disk const fs::path updated_listfile_path = listfile_path.generic_string() + "_updated"; Files::write_all_lines(updated_listfile_path, *lines); fs::rename(updated_listfile_path, listfile_path); -#endif } std::vector vcpkg::get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db) From 0563b293891f5ba475460b6923ec69b886c21b9b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 19:22:53 -0800 Subject: [PATCH 378/561] Raise Warning level for the vcpkg tool to W4 --- toolsrc/vcpkglib/vcpkglib.vcxproj | 2 +- toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj | 2 +- toolsrc/vcpkgtest/vcpkgtest.vcxproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 7ca8158dd0..e01ba925c6 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -85,7 +85,7 @@ - Level3 + Level4 Disabled true ..\include diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index cce816ab04..472d74e309 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -82,7 +82,7 @@ - Level3 + Level4 Disabled true ..\include diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index c0a91ce50b..c12c2dd318 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -108,7 +108,7 @@ NotUsing - Level3 + Level4 Disabled ..\include;$(VCInstallDir)UnitTest\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\UnitTest\include;%(AdditionalIncludeDirectories) _DEBUG;%(PreprocessorDefinitions) From 377f93f3e3ac4e3025837bcfd8cce6c4e6f34b04 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 19:33:18 -0800 Subject: [PATCH 379/561] Update CHANGELOG and bump version to v0.0.73 --- CHANGELOG.md | 19 +++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fa8739dba..ef5995480e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +vcpkg (0.0.73) +-------------- + * Add ports: + - gdk-pixbuf 2.36.5 + - openvr 1.0.5 + * Update ports: + - lmdb 0.9.18-1 -> 0.9.18-2 + - opencv 3.1.0-1 -> 3.2.0 + - sqlite3 3.15.0 -> 3.17.0 + * Add functions to correctly find the "Program Files" folders in all parts of `vcpkg` (C++, CMake, powershell) + * Flush std::cout before launching an external process. Fixes issues when redirecting std::cout to a file + * Update version of the automatically acquired nasm. Resolves build failure with libjpeg-turbo + * Change the format of the listfile. The file is now sorted and directories now have a trailing slash so they can easily be identified. + - Old listfiles will be automatically updated on first access. This will happen to all old listfiles when a new package is installed (`vcpkg install`) or after a call to `vcpkg owns`. + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team WED, 15 Feb 2017 19:30:00 -0800 + + vcpkg (0.0.72) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 204dee5e59..cab1f08efc 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.72" \ No newline at end of file +"0.0.73" \ No newline at end of file From b80cdd1118cec9ad9befdbbdded93a963877b994 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 20:18:39 -0800 Subject: [PATCH 380/561] Fix C4018 warning --- toolsrc/src/commands_ci.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index b20c204f45..f207eeaaac 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -86,7 +86,7 @@ namespace vcpkg::Commands::CI System::println(stopwatch.toString()); - for (int i = 0; i < results.size(); i++) + for (size_t i = 0; i < results.size(); i++) { if (results[i] == BuildResult::SUCCEEDED) { From d86c1ddd6cc2b71d90f5474a9e3e583d9eecae2f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 20:39:49 -0800 Subject: [PATCH 381/561] Use Strings::ascii_to_lowercase() --- toolsrc/src/triplet.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/toolsrc/src/triplet.cpp b/toolsrc/src/triplet.cpp index e1302d9edf..d91e0e68f8 100644 --- a/toolsrc/src/triplet.cpp +++ b/toolsrc/src/triplet.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "triplet.h" #include "vcpkg_Checks.h" +#include "vcpkg_Strings.h" namespace vcpkg { @@ -37,9 +38,7 @@ namespace vcpkg triplet triplet::from_canonical_name(const std::string& triplet_as_string) { - std::string s(triplet_as_string); - std::transform(s.begin(), s.end(), s.begin(), ::tolower); - + const std::string s(Strings::ascii_to_lowercase(triplet_as_string)); auto it = std::find(s.cbegin(), s.cend(), '-'); Checks::check_exit(it != s.cend(), "Invalid triplet: %s", triplet_as_string); From 83fa6a09fb0afdde99ac0b035111777de5813211 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 20:41:03 -0800 Subject: [PATCH 382/561] Add tolower_char(char)->char. Avoids C4244 for char<->int conversion --- toolsrc/src/vcpkg_Strings.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 3b9d6a8598..9cad336105 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -9,6 +9,11 @@ namespace vcpkg::Strings::details return std::isspace(c); }; + static char tolower_char(const char c) + { + return static_cast(std::tolower(c)); + } + std::string format_internal(const char* fmtstr, ...) { va_list lst; @@ -53,17 +58,17 @@ namespace vcpkg::Strings std::string::const_iterator case_insensitive_ascii_find(const std::string& s, const std::string& pattern) { std::string pattern_as_lower_case; - std::transform(pattern.begin(), pattern.end(), back_inserter(pattern_as_lower_case), tolower); + std::transform(pattern.begin(), pattern.end(), back_inserter(pattern_as_lower_case), &details::tolower_char); return search(s.begin(), s.end(), pattern_as_lower_case.begin(), pattern_as_lower_case.end(), [](const char a, const char b) { - return tolower(a) == b; + return details::tolower_char(a) == b; }); } std::string ascii_to_lowercase(const std::string& input) { - std::string output = input; - std::transform(output.begin(), output.end(), output.begin(), ::tolower); + std::string output(input); + std::transform(output.begin(), output.end(), output.begin(), &details::tolower_char); return output; } From 31cda2b3de436109b271c9a9ace42c3eb4d80dc3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Feb 2017 20:44:19 -0800 Subject: [PATCH 383/561] Add comment for tolower_char() --- toolsrc/src/vcpkg_Strings.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 9cad336105..b19d5def09 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -9,6 +9,7 @@ namespace vcpkg::Strings::details return std::isspace(c); }; + // Avoids C4244 warnings because of char<->int conversion that occur when using std::tolower() static char tolower_char(const char c) { return static_cast(std::tolower(c)); From 30a8d6e73084a1379202fa88dc4293d3f9d4dbf3 Mon Sep 17 00:00:00 2001 From: albertziegenhagel Date: Thu, 16 Feb 2017 08:10:54 +0100 Subject: [PATCH 384/561] Fixed some typos --- ports/vtk/portfile.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake index e1a6e772b9..89bda5db95 100644 --- a/ports/vtk/portfile.cmake +++ b/ports/vtk/portfile.cmake @@ -16,9 +16,10 @@ vcpkg_apply_patches( ) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - # HACK: The FindHDF5.cmake script does not seam to detect the HDF5_DEFINITIONS correctly - # if HDF5 has been built without the tools, so we set the BUILT_AS_DYNAMIC_LIB=1 flag - # here explicitly because we now it has been build as dynamic in the current case. + # HACK: The FindHDF5.cmake script does not seem to detect the HDF5_DEFINITIONS correctly + # if HDF5 has been built without the tools (which is the case in the HDF5 port), + # so we set the BUILT_AS_DYNAMIC_LIB=1 flag here explicitly because we know HDF5 + # has been build as dynamic library in the current case. list(APPEND ADDITIONAL_OPTIONS "-DHDF5_DEFINITIONS=-DH5_BUILT_AS_DYNAMIC_LIB=1") endif() From 053608f47b61a972ea35b26dfb4bd858edd2e709 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 00:27:02 -0800 Subject: [PATCH 385/561] Fix build command not printing out the missing dependencies on fail --- toolsrc/src/commands_build.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 03a4b944bc..10e1c75665 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -154,7 +154,7 @@ namespace vcpkg::Commands::Build }), unmet_dependencies.end()); - Checks::check_exit(unmet_dependencies.empty()); + Checks::check_exit(!unmet_dependencies.empty()); System::println(System::color::error, "The build command requires all dependencies to be already installed."); System::println("The following dependencies are missing:"); System::println(""); From 99e369e4a72ab42d78b7d5cb977f2a0d4f8b1724 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 13:02:30 -0800 Subject: [PATCH 386/561] Use ascii_to_lowercase() --- toolsrc/src/vcpkg_Strings.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index b19d5def09..d021aa18c3 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -58,8 +58,7 @@ namespace vcpkg::Strings std::string::const_iterator case_insensitive_ascii_find(const std::string& s, const std::string& pattern) { - std::string pattern_as_lower_case; - std::transform(pattern.begin(), pattern.end(), back_inserter(pattern_as_lower_case), &details::tolower_char); + const std::string pattern_as_lower_case(ascii_to_lowercase(pattern)); return search(s.begin(), s.end(), pattern_as_lower_case.begin(), pattern_as_lower_case.end(), [](const char a, const char b) { return details::tolower_char(a) == b; From 8a37cd9b1d881905e34b281dcab51bc2a94ecf2c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 13:19:43 -0800 Subject: [PATCH 387/561] Specify type explicitly --- toolsrc/src/vcpkg_Strings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index d021aa18c3..35ebcc90f3 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -20,7 +20,7 @@ namespace vcpkg::Strings::details va_list lst; va_start(lst, fmtstr); - auto sz = _vscprintf(fmtstr, lst); + const int sz = _vscprintf(fmtstr, lst); std::string output(sz, '\0'); _vsnprintf_s(&output[0], output.size() + 1, output.size() + 1, fmtstr, lst); va_end(lst); @@ -33,7 +33,7 @@ namespace vcpkg::Strings::details va_list lst; va_start(lst, fmtstr); - auto sz = _vscwprintf(fmtstr, lst); + const int sz = _vscwprintf(fmtstr, lst); std::wstring output(sz, '\0'); _vsnwprintf_s(&output[0], output.size() + 1, output.size() + 1, fmtstr, lst); va_end(lst); From a62558fb793a0c8e31c189f8f5eebe3fc5c83f58 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 16:29:52 -0800 Subject: [PATCH 388/561] Introduce ElapsedTime class --- toolsrc/include/Stopwatch.h | 19 +++++++ toolsrc/src/Stopwatch.cpp | 104 ++++++++++++++++++++---------------- 2 files changed, 78 insertions(+), 45 deletions(-) diff --git a/toolsrc/include/Stopwatch.h b/toolsrc/include/Stopwatch.h index 105a4b1ee4..e4ae121b36 100644 --- a/toolsrc/include/Stopwatch.h +++ b/toolsrc/include/Stopwatch.h @@ -5,6 +5,25 @@ namespace vcpkg { + class ElapsedTime + { + public: + static ElapsedTime createStarted(); + + constexpr ElapsedTime() :m_startTick() {} + + template + TimeUnit elapsed() const + { + return std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - this->m_startTick); + } + + std::string toString() const; + + private: + std::chrono::steady_clock::time_point m_startTick; + }; + class Stopwatch { public: diff --git a/toolsrc/src/Stopwatch.cpp b/toolsrc/src/Stopwatch.cpp index ec7af60b68..4f227bb7c2 100644 --- a/toolsrc/src/Stopwatch.cpp +++ b/toolsrc/src/Stopwatch.cpp @@ -4,6 +4,63 @@ namespace vcpkg { + static std::string format_time_userfriendly(const std::chrono::nanoseconds& nanos) + { + using std::chrono::hours; + using std::chrono::minutes; + using std::chrono::seconds; + using std::chrono::milliseconds; + using std::chrono::microseconds; + using std::chrono::nanoseconds; + using std::chrono::duration_cast; + + const double nanos_as_double = static_cast(nanos.count()); + + if (duration_cast(nanos) > hours()) + { + auto t = nanos_as_double / duration_cast(hours(1)).count(); + return Strings::format("%.4g h", t); + } + + if (duration_cast(nanos) > minutes()) + { + auto t = nanos_as_double / duration_cast(minutes(1)).count(); + return Strings::format("%.4g min", t); + } + + if (duration_cast(nanos) > seconds()) + { + auto t = nanos_as_double / duration_cast(seconds(1)).count(); + return Strings::format("%.4g s", t); + } + + if (duration_cast(nanos) > milliseconds()) + { + auto t = nanos_as_double / duration_cast(milliseconds(1)).count(); + return Strings::format("%.4g ms", t); + } + + if (duration_cast(nanos) > microseconds()) + { + auto t = nanos_as_double / duration_cast(microseconds(1)).count(); + return Strings::format("%.4g us", t); + } + + return Strings::format("%.4g ns", nanos_as_double); + } + + ElapsedTime ElapsedTime::createStarted() + { + ElapsedTime t; + t.m_startTick = std::chrono::high_resolution_clock::now(); + return t; + } + + std::string ElapsedTime::toString() const + { + return format_time_userfriendly(elapsed()); + } + Stopwatch Stopwatch::createUnstarted() { return Stopwatch(); @@ -45,53 +102,10 @@ namespace vcpkg std::string Stopwatch::toString() const { - using std::chrono::hours; - using std::chrono::minutes; - using std::chrono::seconds; - using std::chrono::milliseconds; - using std::chrono::microseconds; - using std::chrono::nanoseconds; - using std::chrono::duration_cast; - - auto nanos = elapsedNanos(); - auto nanos_as_double = static_cast(nanos.count()); - - if (duration_cast(nanos) > hours()) - { - auto t = nanos_as_double / duration_cast(hours(1)).count(); - return Strings::format("%.4g h", t); - } - - if (duration_cast(nanos) > minutes()) - { - auto t = nanos_as_double / duration_cast(minutes(1)).count(); - return Strings::format("%.4g min", t); - } - - if (duration_cast(nanos) > seconds()) - { - auto t = nanos_as_double / duration_cast(seconds(1)).count(); - return Strings::format("%.4g s", t); - } - - if (duration_cast(nanos) > milliseconds()) - { - auto t = nanos_as_double / duration_cast(milliseconds(1)).count(); - return Strings::format("%.4g ms", t); - } - - if (duration_cast(nanos) > microseconds()) - { - auto t = nanos_as_double / duration_cast(microseconds(1)).count(); - return Strings::format("%.4g us", t); - } - - return Strings::format("%.4g ns", nanos_as_double); + return format_time_userfriendly(this->elapsedNanos()); } - Stopwatch::Stopwatch() : m_isRunning(false), m_elapsedNanos(0), m_startTick() - { - } + Stopwatch::Stopwatch() : m_isRunning(false), m_elapsedNanos(0), m_startTick() { } std::chrono::nanoseconds Stopwatch::elapsedNanos() const { From e16084cc8d15b0c042871b0d1cffa6320a1681d4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 16:32:14 -0800 Subject: [PATCH 389/561] Rename Stopwatch.h/cpp to vcpkg_Chrono.h/cpp --- toolsrc/include/{Stopwatch.h => vcpkg_Chrono.h} | 0 toolsrc/src/commands_ci.cpp | 2 +- toolsrc/src/{Stopwatch.cpp => vcpkg_Chrono.cpp} | 2 +- toolsrc/vcpkglib/vcpkglib.vcxproj | 4 ++-- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 12 ++++++------ 5 files changed, 10 insertions(+), 10 deletions(-) rename toolsrc/include/{Stopwatch.h => vcpkg_Chrono.h} (100%) rename toolsrc/src/{Stopwatch.cpp => vcpkg_Chrono.cpp} (99%) diff --git a/toolsrc/include/Stopwatch.h b/toolsrc/include/vcpkg_Chrono.h similarity index 100% rename from toolsrc/include/Stopwatch.h rename to toolsrc/include/vcpkg_Chrono.h diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index f207eeaaac..ea2c707c78 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -6,7 +6,7 @@ #include "vcpkg_System.h" #include "vcpkg_Dependencies.h" #include "vcpkg_Input.h" -#include "Stopwatch.h" +#include "vcpkg_Chrono.h" namespace vcpkg::Commands::CI { diff --git a/toolsrc/src/Stopwatch.cpp b/toolsrc/src/vcpkg_Chrono.cpp similarity index 99% rename from toolsrc/src/Stopwatch.cpp rename to toolsrc/src/vcpkg_Chrono.cpp index 4f227bb7c2..1bcb439bef 100644 --- a/toolsrc/src/Stopwatch.cpp +++ b/toolsrc/src/vcpkg_Chrono.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "Stopwatch.h" +#include "vcpkg_Chrono.h" #include "vcpkg_Checks.h" namespace vcpkg diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index e01ba925c6..4c98380fa1 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -157,7 +157,7 @@ - + @@ -216,7 +216,7 @@ - + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 622544e3d4..70d1b58ace 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -132,9 +132,6 @@ Source Files - - Source Files - Source Files @@ -174,6 +171,9 @@ Source Files + + Source Files + @@ -248,9 +248,6 @@ Header Files - - Header Files - Header Files @@ -299,5 +296,8 @@ Header Files + + Header Files + \ No newline at end of file From 1a6496b49403cb0df959f06fd075f9940089a1f6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 16:37:11 -0800 Subject: [PATCH 390/561] Use ElapsedTime instead of Stopwatch --- toolsrc/src/commands_ci.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index ea2c707c78..178d8ae1b7 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -41,13 +41,13 @@ namespace vcpkg::Commands::CI Environment::ensure_utilities_on_path(paths); std::vector results; - Stopwatch stopwatch = Stopwatch::createStarted(); + const ElapsedTime timer = ElapsedTime::createStarted(); size_t counter = 0; const size_t package_count = install_plan.size(); for (const package_spec_with_install_plan& action : install_plan) { counter++; - System::println("Starting package %d/%d: %s. Time Elapsed: %s", counter, package_count, action.spec.toString(), stopwatch.toString()); + System::println("Starting package %d/%d: %s. Time Elapsed: %s", counter, package_count, action.spec.toString(), timer.toString()); try { if (action.plan.plan_type == install_plan_type::ALREADY_INSTALLED) @@ -84,7 +84,7 @@ namespace vcpkg::Commands::CI } } - System::println(stopwatch.toString()); + System::println(timer.toString()); for (size_t i = 0; i < results.size(); i++) { From 66cc4eed685f586cea4c36c1088632d6bf5feb9c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 18:02:16 -0800 Subject: [PATCH 391/561] CMake: Bump version to 3.8.0 to resolve VS2017 UWP build issues --- scripts/fetchDependency.ps1 | 12 ++++++------ toolsrc/src/vcpkg_Environment.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 1faf5b165d..71f9e10898 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -129,12 +129,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if($Dependency -eq "cmake") { - $requiredVersion = "3.7.2" - $downloadVersion = "3.7.2" - $url = "https://cmake.org/files/v3.7/cmake-3.7.2-win32-x86.zip" - $downloadPath = "$downloadsDir\cmake-3.7.2-win32-x86.zip" - $expectedDownloadedFileHash = "ec5e299d412e0272e01d4de5bf07718f42c96361f83d51cc39f91bf49cc3e5c3" - $executableFromDownload = "$downloadsDir\cmake-3.7.2-win32-x86\bin\cmake.exe" + $requiredVersion = "3.8.0" + $downloadVersion = "3.8.0" + $url = "https://cmake.org/files/v3.8/cmake-3.8.0-rc1-win32-x86.zip" + $downloadPath = "$downloadsDir\cmake-3.8.0-rc1-win32-x86.zip" + $expectedDownloadedFileHash = "ccdbd92fbfb548aa35a545e4e45ff19fd6d13c88c90370acdf940c3cf464e9c9" + $executableFromDownload = "$downloadsDir\cmake-3.8.0-rc1-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP $extractionFolder = $downloadsDir } diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index cc3dba1002..527d8de895 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -74,7 +74,7 @@ namespace vcpkg::Environment static const fs::path default_cmake_installation_dir = Environment::get_ProgramFiles_platform_bitness() / "CMake/bin"; static const fs::path default_cmake_installation_dir_32 = Environment::get_ProgramFiles_32_bit() / "CMake/bin"; - const fs::path downloaded_cmake = paths.downloads / "cmake-3.7.2-win32-x86" / "bin"; + const fs::path downloaded_cmake = paths.downloads / "cmake-3.8.0-rc1-win32-x86" / "bin"; const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s", downloaded_cmake.native(), *System::get_environmental_variable(L"PATH"), @@ -82,7 +82,7 @@ namespace vcpkg::Environment default_cmake_installation_dir_32.native()); System::set_environmental_variable(L"PATH", path_buf.c_str()); - static constexpr std::array cmake_version = { 3,7,2 }; + static constexpr std::array cmake_version = { 3,8,0 }; static const std::wstring version_check_cmd = L"cmake --version 2>&1"; const std::wstring install_cmd = create_default_install_cmd(paths, L"cmake"); ensure_on_path(cmake_version, version_check_cmd, install_cmd); From 82585b25abbad56b53c691dadf04b4cc9677dfd4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 18:11:47 -0800 Subject: [PATCH 392/561] Update CHANGELOG and bump version to v0.0.74 --- CHANGELOG.md | 9 +++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef5995480e..41253f7811 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +vcpkg (0.0.74) +-------------- + * Bump required version & auto-downloaded version of `cmake` to 3.8.0 (was 3.7.x). This fixes UWP builds with Visual Studio 2017 + * Fix `vcpkg build` not printing out the missing dependencies on fail + * Fixes and improvements in the `vcpkg` tool itself + +-- vcpkg team THU, 16 Feb 2017 18:15:00 -0800 + + vcpkg (0.0.73) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index cab1f08efc..723643136e 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.73" \ No newline at end of file +"0.0.74" \ No newline at end of file From 7b4cae57be4e42113b70fd755988623236a95bd7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 18:48:14 -0800 Subject: [PATCH 393/561] fetchDependency.ps1: add option to override prompting for download --- scripts/fetchDependency.ps1 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 71f9e10898..6a40c97588 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -1,8 +1,14 @@ [CmdletBinding()] param( - [string]$Dependency + [string]$Dependency, + [ValidateNotNullOrEmpty()] + [string]$downloadPromptOverride = "0" ) +$downloadPromptOverride_NO_OVERRIDE= 0 +$downloadPromptOverride_DO_NOT_PROMPT = 1 +$downloadPromptOverride_ALWAYS_PROMPT = 2 + Import-Module BitsTransfer $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition @@ -12,9 +18,13 @@ $downloadsDir = "$vcpkgRootDir\downloads" function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { - function promptForDownload([string]$title, [string]$message, [string]$yesDescription, [string]$noDescription) + function promptForDownload([string]$title, [string]$message, [string]$yesDescription, [string]$noDescription, [string]$downloadPromptOverride) { - if ((Test-Path "$downloadsDir\AlwaysAllowEverything") -Or (Test-Path "$downloadsDir\AlwaysAllowDownloads")) + $do_not_prompt = ($downloadPromptOverride -eq $downloadPromptOverride_DO_NOT_PROMPT) -Or + (Test-Path "$downloadsDir\AlwaysAllowEverything") -Or + (Test-Path "$downloadsDir\AlwaysAllowDownloads") + + if (($downloadPromptOverride -ne $downloadPromptOverride_ALWAYS_PROMPT) -And $do_not_prompt) { return $true } @@ -57,7 +67,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $yesDescription = "Downloads " + $Dependency + " v" + $downloadVersion +" app-locally." $noDescription = "Does not download " + $Dependency + "." - $userAllowedDownload = promptForDownload $title $message $yesDescription $noDescription + $userAllowedDownload = promptForDownload $title $message $yesDescription $noDescription $downloadPromptOverride if (!$userAllowedDownload) { throw [System.IO.FileNotFoundException] ("Could not detect suitable version of " + $Dependency + " and download not allowed") From d36b292ae2b7bfb92d7c03d6aa44bb2a74311c36 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 19:13:10 -0800 Subject: [PATCH 394/561] Don't prompt for downloading nuget when finding VS instances This means bootstrap no longer prompts --- scripts/findVisualStudioInstallationInstances.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 9034ddfa8f..8937c6fed1 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -10,7 +10,7 @@ $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" -$nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" +$nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" 1 $nugetPackageDir = "$downloadsDir\nuget-packages" $SetupAPIVersion = "1.5.125-rc" From cf537a2623efa6c892afce3301ffb98ad46a6b1e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 12 Feb 2017 22:18:09 -0800 Subject: [PATCH 395/561] [vcpkg] Use the Registry to find VS2015 --- .../findAnyMSBuildWithCppPlatformToolset.ps1 | 60 +++++++++++++------ 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index d160aea125..15234a2f83 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -1,34 +1,60 @@ [CmdletBinding()] param( + [Parameter(Mandatory=$False)] + [switch]$DisableVS2017 = $False, + [Parameter(Mandatory=$False)] + [switch]$DisableVS2015 = $False ) $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition -# VS2017 -$VisualStudio2017InstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 -foreach ($instance in $VisualStudio2017InstallationInstances) +if (-not $DisableVS2017) { - $VCFolder= "$instance\VC\Tools\MSVC\" - - if (Test-Path $VCFolder) + # VS2017 + $VisualStudio2017InstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 + foreach ($instance in $VisualStudio2017InstallationInstances) { - return "$instance\MSBuild\15.0\Bin\MSBuild.exe","v141" + $VCFolder= "$instance\VC\Tools\MSVC\" + + if (Test-Path $VCFolder) + { + return "$instance\MSBuild\15.0\Bin\MSBuild.exe","v141" + } } } -# VS2015 -$programFiles32 = & $scriptsDir\getProgramFiles32bit.ps1 -$programFilesP = & $scriptsDir\getProgramFilesPlatformBitness.ps1 -$CandidateProgramFiles = $programFiles32, $programFilesP -foreach ($ProgramFiles in $CandidateProgramFiles) +if (-not $DisableVS2015) { - $clExe= "$ProgramFiles\Microsoft Visual Studio 14.0\\VC\bin\cl.exe" - - if (Test-Path $clExe) + # Try to locate VS2015 through the Registry + try { - return "$ProgramFiles\MSBuild\14.0\Bin\MSBuild.exe","v140" + # First ensure the compiler was installed (optional in 2015) + # In 64-bit systems, this is under the Wow6432Node. + try + { + $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % InstallDir) + Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 - Found" + } + catch + { + $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % InstallDir) + Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 - Found" + } + if (!(Test-Path "${VS14InstallDir}..\..\VC\bin\cl.exe")) { throw } + Write-Verbose "${VS14InstallDir}..\..\VC\bin\cl.exe - Found" + + $MSBuild14 = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 MSBuildToolsPath -erroraction Stop | % MSBuildToolsPath) + Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 - Found" + if (!(Test-Path "${MSBuild14}MSBuild.exe")) { throw } + Write-Verbose "${MSBuild14}MSBuild.exe - Found" + + return "${MSBuild14}MSBuild.exe","v140" + } + catch + { + Write-Verbose "Unable to locate a VS2015 installation with C++ support" } } -throw "Could not find MSBuild with C++ support. VS2015 or above with C++ support need to be installed." \ No newline at end of file +throw "Could not find MSBuild version with C++ support. VS2015 or VS2017 (with C++) needs to be installed." \ No newline at end of file From 0dbc59da7a582612171fbc7985f71470265062b9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 20:00:00 -0800 Subject: [PATCH 396/561] Fix script for powershell in Win7 --- .../findAnyMSBuildWithCppPlatformToolset.ps1 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index 15234a2f83..72155b4f5d 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -33,19 +33,28 @@ if (-not $DisableVS2015) # In 64-bit systems, this is under the Wow6432Node. try { - $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % InstallDir) + $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % { $_.InstallDir }) Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 - Found" } catch { - $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % InstallDir) + $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % { $_.InstallDir }) Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 - Found" } if (!(Test-Path "${VS14InstallDir}..\..\VC\bin\cl.exe")) { throw } Write-Verbose "${VS14InstallDir}..\..\VC\bin\cl.exe - Found" - $MSBuild14 = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 MSBuildToolsPath -erroraction Stop | % MSBuildToolsPath) - Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 - Found" + + try + { + $MSBuild14 = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\msbuild\toolsversions\14.0 MSBuildToolsPath -erroraction Stop | % { $_.MSBuildToolsPath }) + Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\msbuild\toolsversions\14.0 - Found" + } + catch + { + $MSBuild14 = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 MSBuildToolsPath -erroraction Stop | % { $_.MSBuildToolsPath }) + Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 - Found" + } if (!(Test-Path "${MSBuild14}MSBuild.exe")) { throw } Write-Verbose "${MSBuild14}MSBuild.exe - Found" From 357591471820647436f2d37fc8b53912bc3f8228 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 20:38:59 -0800 Subject: [PATCH 397/561] Improve message of `vcpkg integrate install` --- toolsrc/src/commands_integrate.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index aa5edeb8a8..12a45c238e 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -214,10 +214,13 @@ namespace vcpkg::Commands::Integrate exit(EXIT_FAILURE); } System::println(System::color::success, "Applied user-wide integration for this vcpkg root."); + const fs::path cmake_toolchain = paths.buildsystems / "vcpkg.cmake"; System::println("\n" - "All C++ projects can now #include any installed libraries.\n" + "All MSBuild C++ projects can now #include any installed libraries.\n" "Linking will be handled automatically.\n" - "Installing new libraries will make them instantly available."); + "Installing new libraries will make them instantly available.\n" + "\n" + "CMake projects should use -DCMAKE_TOOLCHAIN_FILE=%s", cmake_toolchain.generic_string()); exit(EXIT_SUCCESS); } From 5d873f0520092cbc5c2161e4cd093eef24a7f1cf Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 16 Feb 2017 22:53:28 -0800 Subject: [PATCH 398/561] [hdf5] Fix #673 by explicitly specifying the szip libraries --- ports/hdf5/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/hdf5/portfile.cmake b/ports/hdf5/portfile.cmake index 5c421f0c61..f545434181 100644 --- a/ports/hdf5/portfile.cmake +++ b/ports/hdf5/portfile.cmake @@ -30,6 +30,9 @@ vcpkg_configure_cmake( -DHDF5_ENABLE_SZIP_ENCODING=ON -DHDF5_INSTALL_DATA_DIR=share/hdf5/data -DHDF5_INSTALL_CMAKE_DIR=share/hdf5 + "-DSZIP_LIBRARY_DEBUG=${CURRENT_INSTALLED_DIR}\\debug\\lib\\szip_D.lib" + "-DSZIP_LIBRARY_RELEASE=${CURRENT_INSTALLED_DIR}\\lib\\szip.lib" + "-DSZIP_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}\\include" ) vcpkg_install_cmake() From 6d2b407b28417009fec0964b7339280d337dae6c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Feb 2017 23:34:22 -0800 Subject: [PATCH 399/561] [mongo-cxx-driver] Don't delete mongocxx/options/ dir --- ports/mongo-cxx-driver/CONTROL | 2 +- ports/mongo-cxx-driver/portfile.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/mongo-cxx-driver/CONTROL b/ports/mongo-cxx-driver/CONTROL index 41c9584007..57c400bed8 100644 --- a/ports/mongo-cxx-driver/CONTROL +++ b/ports/mongo-cxx-driver/CONTROL @@ -1,4 +1,4 @@ Source: mongo-cxx-driver -Version: 3.0.3 +Version: 3.0.3-1 Build-Depends: boost,libbson,mongo-c-driver Description: MongoDB C++ Driver. \ No newline at end of file diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index 1370881092..4b04af0545 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -53,7 +53,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/mongocxx/test_util ${CURRENT_PACKAGES_DIR}/include/mongocxx/private ${CURRENT_PACKAGES_DIR}/include/mongocxx/exception/private - ${CURRENT_PACKAGES_DIR}/include/mongocxx/options + ${CURRENT_PACKAGES_DIR}/include/mongocxx/options/private ${CURRENT_PACKAGES_DIR}/debug/include) From c1a2c79b6b59bc05df1ce06a7c18f8f14f9a5424 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 00:01:14 -0800 Subject: [PATCH 400/561] [remove-command] Reorder input processing --- toolsrc/src/commands_remove.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 92ab56a282..1daacb9445 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -167,15 +167,13 @@ namespace vcpkg::Commands::Remove { static const std::string example = Commands::Help::create_example_string("remove zlib zlib:x64-windows curl boost"); args.check_min_arg_count(1, example); - - const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_PURGE, OPTION_RECURSE}); - auto status_db = database_load_check(paths); - std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example); Input::check_triplets(specs, paths); + const std::unordered_set options = args.check_and_get_optional_command_arguments({ OPTION_PURGE, OPTION_RECURSE }); const bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end(); const bool isRecursive = options.find(OPTION_RECURSE) != options.end(); + auto status_db = database_load_check(paths); const std::vector remove_plan = Dependencies::create_remove_plan(specs, status_db); Checks::check_exit(!remove_plan.empty(), "Remove plan cannot be empty"); From 4a20c47bec65fc5f4e927b1b8ce513d1d49a912d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 00:05:45 -0800 Subject: [PATCH 401/561] [build-command] Reorder input processing --- toolsrc/src/commands_build.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 10e1c75665..38dd4cfe66 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -115,17 +115,9 @@ namespace vcpkg::Commands::Build void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) { static const std::string example = Commands::Help::create_example_string("build zlib:x64-windows"); - - // Installing multiple packages leads to unintuitive behavior if one of them depends on another. - // Allowing only 1 package for now. - - args.check_exact_arg_count(1, example); - - StatusParagraphs status_db = database_load_check(paths); - + args.check_exact_arg_count(1, example); // Build only takes a single package and all dependencies must already be installed const package_spec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example); Input::check_triplet(spec.target_triplet(), paths); - const std::unordered_set options = args.check_and_get_optional_command_arguments({ OPTION_CHECKS_ONLY }); if (options.find(OPTION_CHECKS_ONLY) != options.end()) { @@ -143,6 +135,7 @@ namespace vcpkg::Commands::Build const SourceParagraph& spgh = *maybe_spgh.get(); Environment::ensure_utilities_on_path(paths); + StatusParagraphs status_db = database_load_check(paths); const BuildResult result = build_package(spgh, spec, paths, paths.port_dir(spec), status_db); if (result == BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES) { From 532c4f6a536ae0952844b39aceef7542204938a9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 00:16:52 -0800 Subject: [PATCH 402/561] Add vcpkg_cmd_arguments::check_no_optional_arguments() --- toolsrc/include/vcpkg_cmd_arguments.h | 1 + toolsrc/src/vcpkg_cmd_arguments.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 91f7de8ac1..58bc460984 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -20,6 +20,7 @@ namespace vcpkg std::string command; std::vector command_arguments; + void vcpkg_cmd_arguments::check_no_optional_command_arguments() const; std::unordered_set check_and_get_optional_command_arguments(const std::vector& valid_options) const; void check_max_arg_count(const size_t expected_arg_count) const; diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index fdeb6e877a..04c381c921 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -135,6 +135,11 @@ namespace vcpkg return args; } + void vcpkg_cmd_arguments::check_no_optional_command_arguments() const + { + this->check_and_get_optional_command_arguments({}); + } + std::unordered_set vcpkg_cmd_arguments::check_and_get_optional_command_arguments(const std::vector& valid_options) const { std::unordered_set output; From 1c3335ed66597e90a1f0b2c393522a28bff1f400 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 17 Feb 2017 01:18:32 -0800 Subject: [PATCH 403/561] [grpc+protobuf] Update to 1.1.2 and 3.2.0 respectively. --- ports/grpc/CONTROL | 2 +- ports/grpc/grpc-fix-cmake-build.patch | 13 ++++++++ ports/grpc/portfile.cmake | 45 ++++++++++----------------- ports/protobuf/CONTROL | 2 +- ports/protobuf/portfile.cmake | 20 ++++++------ 5 files changed, 42 insertions(+), 40 deletions(-) create mode 100644 ports/grpc/grpc-fix-cmake-build.patch diff --git a/ports/grpc/CONTROL b/ports/grpc/CONTROL index 3de78c477d..3a248b4487 100644 --- a/ports/grpc/CONTROL +++ b/ports/grpc/CONTROL @@ -1,4 +1,4 @@ Source: grpc -Version: 1.1.0-dev-1674f65-2 +Version: 1.1.2-1 Build-Depends: zlib, openssl, protobuf Description: An RPC library and framework \ No newline at end of file diff --git a/ports/grpc/grpc-fix-cmake-build.patch b/ports/grpc/grpc-fix-cmake-build.patch new file mode 100644 index 0000000000..95e3450369 --- /dev/null +++ b/ports/grpc/grpc-fix-cmake-build.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d52e199..30ed816 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2072,6 +2072,8 @@ foreach(_hdr + include/grpc/impl/codegen/sync_generic.h + include/grpc/impl/codegen/sync_posix.h + include/grpc/impl/codegen/sync_windows.h ++ include/grpc++/impl/codegen/proto_utils.h ++ include/grpc++/impl/codegen/config_protobuf.h + ) + string(REPLACE "include/" "" _path ${_hdr}) + get_filename_component(_path ${_path} PATH) diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index ba511a0043..c6239d8c36 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -3,39 +3,28 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) set(VCPKG_LIBRARY_LINKAGE static) endif() include(vcpkg_common_functions) -find_program(GIT git) -set(GIT_URL "https://github.com/grpc/grpc.git") -set(GIT_REV "1674f650ad9411448a35b7c19c5dbdaf0ebd8916") +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/grpc-1.1.2) -if(NOT EXISTS "${DOWNLOADS}/grpc.git") - message(STATUS "Cloning") - vcpkg_execute_required_process( - COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/grpc.git - WORKING_DIRECTORY ${DOWNLOADS} - LOGNAME clone - ) +if(EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/src) endif() -message(STATUS "Cloning done") -if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") - message(STATUS "Adding worktree") - vcpkg_execute_required_process( - COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_REV} - WORKING_DIRECTORY ${DOWNLOADS}/grpc.git - LOGNAME worktree - ) - message(STATUS "Updating sumbodules") - vcpkg_execute_required_process( - COMMAND ${GIT} submodule update --init third_party/nanopb - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src - LOGNAME submodule - ) -endif() -message(STATUS "Adding worktree and updating sumbodules done") +vcpkg_download_distfile(ARCHIVE_FILE + URLS "https://github.com/grpc/grpc/archive/v1.1.2.zip" + FILENAME "grpc-v1.1.2.tar.gz" + SHA512 6e0666ecb72f0a78148fadf627e05b5ba0f1c893919f1e691775d09374e7c4b9b05ff1d276e716ac2a81eb2a3fb88c4a095928589286d2f083bd60539050f5d9 +) +vcpkg_extract_source_archive(${ARCHIVE_FILE}) + +# patch is from https://github.com/grpc/grpc/commit/a5fac1f8a00b0ba6ca784baa4783ab947579693b +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/grpc-fix-cmake-build.patch +) vcpkg_configure_cmake( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src + SOURCE_PATH ${SOURCE_PATH} OPTIONS -DgRPC_INSTALL=ON -DgRPC_ZLIB_PROVIDER=package @@ -66,7 +55,7 @@ string(REPLACE "\${_IMPORT_PREFIX}/bin/" "\${_IMPORT_PREFIX}/tools/" _contents " string(REPLACE "\${_IMPORT_PREFIX}/lib/" "\${_IMPORT_PREFIX}/debug/lib/" _contents "${_contents}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-debug.cmake "${_contents}") -file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/grpc_cpp_plugin.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) diff --git a/ports/protobuf/CONTROL b/ports/protobuf/CONTROL index 795213a330..95e7e367c4 100644 --- a/ports/protobuf/CONTROL +++ b/ports/protobuf/CONTROL @@ -1,4 +1,4 @@ Source: protobuf -Version: 3.0.2 +Version: 3.2.0 Build-Depends: zlib Description: Protocol Buffers - Google's data interchange format \ No newline at end of file diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index 5853c1e4ac..2d7cecf657 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -1,20 +1,20 @@ #tool include(vcpkg_common_functions) vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://github.com/google/protobuf/releases/download/v3.0.2/protobuf-cpp-3.0.2.tar.gz" - FILENAME "protobuf-cpp-3.0.2.tar.gz" - SHA512 5c99fa5d20815f9333a1e30d4da7621375e179abab6e4369ef0827b6ea6a679afbfec445dda21a72b4ab11e1bdd72c0f17a4e86b153ea8e2d3298dc3bcfcd643 + URLS "https://github.com/google/protobuf/releases/download/v3.2.0/protobuf-cpp-3.2.0.tar.gz" + FILENAME "protobuf-cpp-3.2.0.tar.gz" + SHA512 dd005f5e862ff24bb233b9eaed1d7f44c42f1cc8c647c0839fe2ecc2d91178845195d79776cfa2e31d224c16eed11b05ad824b66b743e685334057d8180f17aa ) vcpkg_download_distfile(TOOL_ARCHIVE_FILE - URLS "https://github.com/google/protobuf/releases/download/v3.0.2/protoc-3.0.2-win32.zip" - FILENAME "protoc-3.0.2-win32.zip" - SHA512 51c67bd8bdc35810da70786d873935814679c58b74e653923671bdf06b8b69a1c9a0793d090b17d25e91ddafff1726bcfcdd243373dd47c4aeb9ea83fbabaeb0 + URLS "https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-win32.zip" + FILENAME "protoc-3.2.0-win32.zip" + SHA512 985c86a04cebacfba96f3985d1b3d6ef341470171b809c6f6362bc13a07a3df9c8962d912857bb764bf8634cf676c5f8453c43b4e0a6398f2ff314708975d1e4 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -vcpkg_extract_source_archive(${TOOL_ARCHIVE_FILE} ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.0.2-win32) +vcpkg_extract_source_archive(${TOOL_ARCHIVE_FILE} ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.2.0-win32) vcpkg_configure_cmake( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.0.2/cmake + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.2.0/cmake OPTIONS -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF @@ -52,6 +52,6 @@ protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/share) protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/bin) protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/bin) -file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.0.2/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/protobuf RENAME copyright) -file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.0.2-win32/bin/protoc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) +file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.2.0/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/protobuf RENAME copyright) +file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/protobuf-3.2.0-win32/bin/protoc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) vcpkg_copy_pdbs() From ff222fac454449b2fc108bf5271e1823db54d3da Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 14:55:37 -0800 Subject: [PATCH 404/561] [build_command] Extract function for calculations after Input processing --- toolsrc/include/vcpkg_Commands.h | 1 + toolsrc/src/commands_build.cpp | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 5c643d017e..7956cdab8d 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -29,6 +29,7 @@ namespace vcpkg::Commands std::string create_user_troubleshooting_message(const package_spec& spec); BuildResult build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir, const StatusParagraphs& status_db); + void perform_and_exit(const package_spec& spec, const fs::path& port_dir, const std::unordered_set& options, const vcpkg_paths& paths); void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); } diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 38dd4cfe66..eaba531cb8 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -112,13 +112,8 @@ namespace vcpkg::Commands::Build , spec.toString(), Info::version()); } - void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + void perform_and_exit(const package_spec& spec, const fs::path& port_dir, const std::unordered_set& options, const vcpkg_paths& paths) { - static const std::string example = Commands::Help::create_example_string("build zlib:x64-windows"); - args.check_exact_arg_count(1, example); // Build only takes a single package and all dependencies must already be installed - const package_spec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example); - Input::check_triplet(spec.target_triplet(), paths); - const std::unordered_set options = args.check_and_get_optional_command_arguments({ OPTION_CHECKS_ONLY }); if (options.find(OPTION_CHECKS_ONLY) != options.end()) { const size_t error_count = PostBuildLint::perform_all_checks(spec, paths); @@ -129,8 +124,7 @@ namespace vcpkg::Commands::Build exit(EXIT_SUCCESS); } - // Explicitly load and use the portfile's build dependencies when resolving the build command (instead of a cached package's dependencies). - const expected maybe_spgh = try_load_port(paths, spec.name()); + const expected maybe_spgh = try_load_port(port_dir); Checks::check_exit(!maybe_spgh.error_code(), "Could not find package named %s: %s", spec, maybe_spgh.error_code().message()); const SourceParagraph& spgh = *maybe_spgh.get(); @@ -168,4 +162,14 @@ namespace vcpkg::Commands::Build exit(EXIT_SUCCESS); } + + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + { + static const std::string example = Commands::Help::create_example_string("build zlib:x64-windows"); + args.check_exact_arg_count(1, example); // Build only takes a single package and all dependencies must already be installed + const package_spec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example); + Input::check_triplet(spec.target_triplet(), paths); + const std::unordered_set options = args.check_and_get_optional_command_arguments({ OPTION_CHECKS_ONLY }); + perform_and_exit(spec, paths.port_dir(spec), options, paths); + } } From b4304c9c995d7984566ed28294836bccbdfc24b2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 15:09:15 -0800 Subject: [PATCH 405/561] `build-external` now calls code from `build` after input processing --- toolsrc/src/commands_build_external.cpp | 32 ++++--------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index 0b40103104..06bd1374c5 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -3,7 +3,6 @@ #include "vcpkg_System.h" #include "vcpkg_Environment.h" #include "vcpkg_Input.h" -#include "vcpkglib.h" namespace vcpkg::Commands::BuildExternal { @@ -11,32 +10,11 @@ namespace vcpkg::Commands::BuildExternal { static const std::string example = Commands::Help::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); args.check_exact_arg_count(2, example); + const package_spec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example); + Input::check_triplet(spec.target_triplet(), paths); + const std::unordered_set options = args.check_and_get_optional_command_arguments({}); - StatusParagraphs status_db = database_load_check(paths); - - expected maybe_current_spec = package_spec::from_string(args.command_arguments[0], default_target_triplet); - if (auto spec = maybe_current_spec.get()) - { - Input::check_triplet(spec->target_triplet(), paths); - Environment::ensure_utilities_on_path(paths); - const fs::path port_dir = args.command_arguments.at(1); - const expected maybe_spgh = try_load_port(port_dir); - if (auto spgh = maybe_spgh.get()) - { - const Build::BuildResult result = Commands::Build::build_package(*spgh, *spec, paths, port_dir, status_db); - if (result != Build::BuildResult::SUCCEEDED) - { - System::println(System::color::error, Build::create_error_message(result, *spec)); - System::println(Build::create_user_troubleshooting_message(*spec)); - exit(EXIT_FAILURE); - } - - exit(EXIT_SUCCESS); - } - } - - System::println(System::color::error, "Error: %s: %s", maybe_current_spec.error_code().message(), args.command_arguments[0]); - Commands::Help::print_example(Strings::format("%s zlib:x64-windows", args.command)); - exit(EXIT_FAILURE); + const fs::path port_dir = args.command_arguments.at(1); + Build::perform_and_exit(spec, port_dir, options, paths); } } From 71b985dd032c37fd88010b70fd03dc4a5cfa9cf9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 15:10:43 -0800 Subject: [PATCH 406/561] Remove try_load_port() overload --- toolsrc/include/vcpkglib.h | 5 ----- toolsrc/src/vcpkg_Dependencies.cpp | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/toolsrc/include/vcpkglib.h b/toolsrc/include/vcpkglib.h index b1653d1977..50635589a2 100644 --- a/toolsrc/include/vcpkglib.h +++ b/toolsrc/include/vcpkglib.h @@ -22,10 +22,5 @@ namespace vcpkg expected try_load_port(const fs::path& control_path); - inline expected try_load_port(const vcpkg_paths& paths, const std::string& name) - { - return try_load_port(paths.ports / name); - } - expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec); } // namespace vcpkg diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 957814e6e6..b255cc77b6 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -80,7 +80,7 @@ namespace vcpkg::Dependencies continue; } - expected maybe_spgh = try_load_port(paths, spec.name()); + expected maybe_spgh = try_load_port(paths.port_dir(spec)); SourceParagraph* spgh = maybe_spgh.get(); Checks::check_exit(spgh != nullptr, "Cannot find package %s", spec.name()); process_dependencies(filter_dependencies(spgh->depends, spec.target_triplet())); From e99e577dc937bfca09ccb2afff92c1bb1be457bf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 15:22:49 -0800 Subject: [PATCH 407/561] `install`: check for --options and delay loading of status_db --- toolsrc/src/commands_install.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 9757e171d0..4ae311f836 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -187,10 +187,11 @@ namespace vcpkg::Commands::Install { static const std::string example = Commands::Help::create_example_string("install zlib zlib:x64-windows curl boost"); args.check_min_arg_count(1, example); - StatusParagraphs status_db = database_load_check(paths); - std::vector specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example); Input::check_triplets(specs, paths); + args.check_and_get_optional_command_arguments({}); + + StatusParagraphs status_db = database_load_check(paths); std::vector install_plan = Dependencies::create_install_plan(paths, specs, status_db); Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty"); From 4cbd4e0cc8e315b65641a2a796b45f6af14c9c0b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 15:29:32 -0800 Subject: [PATCH 408/561] `ci`: Check for --options, delay loading status_db, refactor --- toolsrc/src/commands_ci.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index 178d8ae1b7..db37db1236 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -14,17 +14,10 @@ namespace vcpkg::Commands::CI using Dependencies::install_plan_type; using Build::BuildResult; - void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + static std::vector load_all_package_specs(const fs::path& directory, const triplet& target_triplet) { - static const std::string example = Commands::Help::create_example_string("ci x64-windows"); - args.check_max_arg_count(1, example); - const triplet target_triplet = args.command_arguments.size() == 1 ? triplet::from_canonical_name(args.command_arguments.at(0)) : default_target_triplet; - Input::check_triplet(target_triplet, paths); - - StatusParagraphs status_db = database_load_check(paths); - std::vector port_folders; - Files::non_recursive_find_matching_paths_in_dir(paths.ports, [](const fs::path& current) + Files::non_recursive_find_matching_paths_in_dir(directory, [](const fs::path& current) { return fs::is_directory(current); }, &port_folders); @@ -35,6 +28,19 @@ namespace vcpkg::Commands::CI specs.push_back(package_spec::from_name_and_triplet(p.filename().generic_string(), target_triplet).get_or_throw()); } + return specs; + } + + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet) + { + static const std::string example = Commands::Help::create_example_string("ci x64-windows"); + args.check_max_arg_count(1, example); + const triplet target_triplet = args.command_arguments.size() == 1 ? triplet::from_canonical_name(args.command_arguments.at(0)) : default_target_triplet; + Input::check_triplet(target_triplet, paths); + args.check_and_get_optional_command_arguments({}); + const std::vector specs = load_all_package_specs(paths.ports, target_triplet); + + StatusParagraphs status_db = database_load_check(paths); const std::vector install_plan = Dependencies::create_install_plan(paths, specs, status_db); Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty"); From e47f62aceae3a2478cb852d22fa8d7eb7412f117 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 15:32:10 -0800 Subject: [PATCH 409/561] `update`: check for --options --- toolsrc/src/commands_update.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index a42ae5341d..3aa7a499fa 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -11,6 +11,7 @@ namespace vcpkg::Commands::Update void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { args.check_exact_arg_count(0); + args.check_and_get_optional_command_arguments({}); System::println("Using local portfile versions. To update the local portfiles, use `git pull`."); auto status_db = database_load_check(paths); From 21729d3d43a1369014b60e2af368a3e48ae5c82f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 15:33:14 -0800 Subject: [PATCH 410/561] `create`/`edit`: check for --options --- toolsrc/src/commands_create.cpp | 3 ++- toolsrc/src/commands_edit.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/toolsrc/src/commands_create.cpp b/toolsrc/src/commands_create.cpp index 5042ab97b6..494c2aa08d 100644 --- a/toolsrc/src/commands_create.cpp +++ b/toolsrc/src/commands_create.cpp @@ -12,8 +12,9 @@ namespace vcpkg::Commands::Create static const std::string example = Commands::Help::create_example_string(R"###(create zlib2 http://zlib.net/zlib128.zip "zlib128-2.zip")###"); args.check_max_arg_count(3, example); args.check_min_arg_count(2, example); - + args.check_and_get_optional_command_arguments({}); const std::string port_name = args.command_arguments.at(0); + Environment::ensure_utilities_on_path(paths); // Space OR define the FILENAME with proper spacing diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index 50308cec91..5a2433e5ac 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -10,6 +10,7 @@ namespace vcpkg::Commands::Edit { static const std::string example = Commands::Help::create_example_string("edit zlib"); args.check_exact_arg_count(1, example); + args.check_and_get_optional_command_arguments({}); const std::string port_name = args.command_arguments.at(0); const fs::path portpath = paths.ports / port_name; From 02eeb834b1b62957191f3ff8b318af0837e3fd96 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 15:38:02 -0800 Subject: [PATCH 411/561] `cache`/`list`/`own`/`search`: check for --options --- toolsrc/src/commands_cache.cpp | 1 + toolsrc/src/commands_list.cpp | 1 + toolsrc/src/commands_owns.cpp | 1 + toolsrc/src/commands_search.cpp | 1 + 4 files changed, 4 insertions(+) diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/commands_cache.cpp index fa49a647ff..e255b5dff7 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/commands_cache.cpp @@ -40,6 +40,7 @@ namespace vcpkg::Commands::Cache static const std::string example = Strings::format( "The argument should be a substring to search for, or no argument to display all cached libraries.\n%s", Commands::Help::create_example_string("cache png")); args.check_max_arg_count(1, example); + args.check_and_get_optional_command_arguments({}); const std::vector binary_paragraphs = read_all_binary_paragraphs(paths); if (binary_paragraphs.empty()) diff --git a/toolsrc/src/commands_list.cpp b/toolsrc/src/commands_list.cpp index 34a9c2fc83..7bfc11f1b0 100644 --- a/toolsrc/src/commands_list.cpp +++ b/toolsrc/src/commands_list.cpp @@ -19,6 +19,7 @@ namespace vcpkg::Commands::List static const std::string example = Strings::format( "The argument should be a substring to search for, or no argument to display all installed libraries.\n%s", Commands::Help::create_example_string("list png")); args.check_max_arg_count(1, example); + args.check_and_get_optional_command_arguments({}); const StatusParagraphs status_paragraphs = database_load_check(paths); std::vector installed_packages; diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp index 6c4c20c445..16bb986e2f 100644 --- a/toolsrc/src/commands_owns.cpp +++ b/toolsrc/src/commands_owns.cpp @@ -26,6 +26,7 @@ namespace vcpkg::Commands::Owns { static const std::string example = Strings::format("The argument should be a pattern to search for. %s", Commands::Help::create_example_string("owns zlib.dll")); args.check_exact_arg_count(1, example); + args.check_and_get_optional_command_arguments({}); StatusParagraphs status_db = database_load_check(paths); search_file(paths, args.command_arguments[0], status_db); diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index 3a3226e4b2..5dba711492 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -46,6 +46,7 @@ namespace vcpkg::Commands::Search static const std::string example = Strings::format("The argument should be a substring to search for, or no argument to display all libraries.\n%s", Commands::Help::create_example_string("search png")); args.check_max_arg_count(1, example); + args.check_and_get_optional_command_arguments({}); const std::vector source_paragraphs = read_all_source_paragraphs(paths); From 4313d8f398e12093b866fa8029b712c86f1bc127 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 15:38:39 -0800 Subject: [PATCH 412/561] `owns`: check for --options --- toolsrc/include/vcpkg_Commands.h | 10 +++++----- toolsrc/src/commands_import.cpp | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 7956cdab8d..907190bfce 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -79,11 +79,6 @@ namespace vcpkg::Commands void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); } - namespace Import - { - void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - } - namespace Owns { void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); @@ -94,6 +89,11 @@ namespace vcpkg::Commands void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); } + namespace Import + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + namespace Integrate { extern const char*const INTEGRATE_COMMAND_HELPSTRING; diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp index 7af2c7185d..4b71fc2901 100644 --- a/toolsrc/src/commands_import.cpp +++ b/toolsrc/src/commands_import.cpp @@ -79,6 +79,7 @@ namespace vcpkg::Commands::Import { static const std::string example = Commands::Help::create_example_string(R"(import C:\path\to\CONTROLfile C:\path\to\includedir C:\path\to\projectdir)"); args.check_exact_arg_count(3, example); + args.check_and_get_optional_command_arguments({}); const fs::path control_file_path(args.command_arguments[0]); const fs::path include_directory(args.command_arguments[1]); From 6b9222f166aed28b6ee7bfba1de6f400c1643857 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 15:45:38 -0800 Subject: [PATCH 413/561] `integrate`: checks for --options --- toolsrc/src/commands_integrate.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 12a45c238e..94af19e963 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -296,6 +296,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console static const std::string example = Strings::format("Commands:\n" "%s", INTEGRATE_COMMAND_HELPSTRING); args.check_exact_arg_count(1, example); + args.check_and_get_optional_command_arguments({}); if (args.command_arguments[0] == "install") { From 4e44b8533d1df94dd2405674086377d06b3690a7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 15:46:35 -0800 Subject: [PATCH 414/561] `portsdiff`: Check for --options --- toolsrc/src/commands_portsdiff.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index e75633b3cb..119997485c 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -98,6 +98,7 @@ namespace vcpkg::Commands::PortsDiff static const std::string example = Strings::format("The argument should be a branch/tag/hash to checkout.\n%s", Commands::Help::create_example_string("portsdiff mybranchname")); args.check_min_arg_count(1, example); args.check_max_arg_count(2, example); + args.check_and_get_optional_command_arguments({}); Environment::ensure_git_on_path(paths); const std::wstring git_commit_id_for_previous_snapshot = Strings::utf8_to_utf16(args.command_arguments.at(0)); From b890a9033cde8844566c0f4b8f986f8c44008ebb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 15:52:45 -0800 Subject: [PATCH 415/561] `contact`/`help`/`version`: Check for --options --- toolsrc/src/commands_contact.cpp | 2 ++ toolsrc/src/commands_help.cpp | 2 ++ toolsrc/src/commands_version.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/toolsrc/src/commands_contact.cpp b/toolsrc/src/commands_contact.cpp index 2be468fb8c..c5b8cab7e8 100644 --- a/toolsrc/src/commands_contact.cpp +++ b/toolsrc/src/commands_contact.cpp @@ -8,6 +8,8 @@ namespace vcpkg::Commands::Contact void perform_and_exit(const vcpkg_cmd_arguments& args) { args.check_exact_arg_count(0); + args.check_and_get_optional_command_arguments({}); + System::println("Send an email to %s with any feedback.", Info::email()); exit(EXIT_SUCCESS); } diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/commands_help.cpp index 6068c22fb5..49b5697c32 100644 --- a/toolsrc/src/commands_help.cpp +++ b/toolsrc/src/commands_help.cpp @@ -67,6 +67,8 @@ namespace vcpkg::Commands::Help void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { args.check_max_arg_count(1); + args.check_and_get_optional_command_arguments({}); + if (args.command_arguments.empty()) { print_usage(); diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/commands_version.cpp index a521b2567c..3dd90e6300 100644 --- a/toolsrc/src/commands_version.cpp +++ b/toolsrc/src/commands_version.cpp @@ -8,6 +8,8 @@ namespace vcpkg::Commands::Version void perform_and_exit(const vcpkg_cmd_arguments& args) { args.check_exact_arg_count(0); + args.check_and_get_optional_command_arguments({}); + System::println("Vcpkg package management program version %s\n" "\n" "See LICENSE.txt for license information.", Info::version() From 573fc23f64fa5d3193d8331484d88864c2a0f237 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 15:53:05 -0800 Subject: [PATCH 416/561] `hash` check for --options --- toolsrc/src/commands_hash.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index 4c0028f53d..805da4153a 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -30,6 +30,7 @@ namespace vcpkg::Commands::Hash "The argument should be a file path\n%s", Commands::Help::create_example_string("hash boost_1_62_0.tar.bz2")); args.check_min_arg_count(1, example); args.check_max_arg_count(2, example); + args.check_and_get_optional_command_arguments({}); if (args.command_arguments.size() == 1) { From 39772adbfe37b03f7302b3a0d974404519c643ce Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 15:53:18 -0800 Subject: [PATCH 417/561] Remove unused function --- toolsrc/include/vcpkg_cmd_arguments.h | 1 - toolsrc/src/vcpkg_cmd_arguments.cpp | 5 ----- 2 files changed, 6 deletions(-) diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 58bc460984..91f7de8ac1 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -20,7 +20,6 @@ namespace vcpkg std::string command; std::vector command_arguments; - void vcpkg_cmd_arguments::check_no_optional_command_arguments() const; std::unordered_set check_and_get_optional_command_arguments(const std::vector& valid_options) const; void check_max_arg_count(const size_t expected_arg_count) const; diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp index 04c381c921..fdeb6e877a 100644 --- a/toolsrc/src/vcpkg_cmd_arguments.cpp +++ b/toolsrc/src/vcpkg_cmd_arguments.cpp @@ -135,11 +135,6 @@ namespace vcpkg return args; } - void vcpkg_cmd_arguments::check_no_optional_command_arguments() const - { - this->check_and_get_optional_command_arguments({}); - } - std::unordered_set vcpkg_cmd_arguments::check_and_get_optional_command_arguments(const std::vector& valid_options) const { std::unordered_set output; From 536e18c7cffe7394099ab48160a0dc2619a5e24f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 16:54:29 -0800 Subject: [PATCH 418/561] [libmysql] Disable installer project Fixes build failure when you have WiX installed in your system and you are using the VS2017 toolset --- ports/libmysql/CONTROL | 2 +- ports/libmysql/portfile.cmake | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/libmysql/CONTROL b/ports/libmysql/CONTROL index 4e5564972d..9062499366 100644 --- a/ports/libmysql/CONTROL +++ b/ports/libmysql/CONTROL @@ -1,3 +1,3 @@ Source: libmysql -Version: 5.7.17 +Version: 5.7.17-1 Description: A MySQL client library for C development. \ No newline at end of file diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake index 4d711fef57..530732b71a 100644 --- a/ports/libmysql/portfile.cmake +++ b/ports/libmysql/portfile.cmake @@ -24,6 +24,7 @@ vcpkg_configure_cmake( -DWITHOUT_SERVER=ON -DWITH_UNIT_TESTS=OFF -DENABLED_PROFILING=OFF + -DWIX_DIR=OFF ) vcpkg_install_cmake() From 7ae6c2152686467ab81663e6d7d259f475c0229d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 17:46:34 -0800 Subject: [PATCH 419/561] [clockutils] Update to fix build issue. Resolves #677 --- ports/clockutils/CONTROL | 2 +- ports/clockutils/portfile.cmake | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ports/clockutils/CONTROL b/ports/clockutils/CONTROL index 4ade8d5f0c..8f88e71ec8 100644 --- a/ports/clockutils/CONTROL +++ b/ports/clockutils/CONTROL @@ -1,3 +1,3 @@ Source: clockutils -Version: 1.1.1 +Version: 1.1.1-3651f232c27074c4ceead169e223edf5f00247c5 Description: A lightweight c++ library for commonly needed tasks. Optimized for simplicity and speed. diff --git a/ports/clockutils/portfile.cmake b/ports/clockutils/portfile.cmake index 2c75495d9d..33f0b1f834 100644 --- a/ports/clockutils/portfile.cmake +++ b/ports/clockutils/portfile.cmake @@ -1,9 +1,10 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/clockUtils-1.1.1) +set(VERSION 3651f232c27074c4ceead169e223edf5f00247c5) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/clockUtils-${VERSION}) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/ClockworkOrigins/clockUtils/archive/1.1.1.tar.gz" - FILENAME "clockUtils-1.1.1.tar.gz" - SHA512 6b0c57862baf04c0c5529549ba13983e53445172d9a272571aa20968ba6dba15f1cf480096ca100d450218fef090805366d0564c77a4aa4721a4fe694a0481c9 + URLS "https://github.com/ClockworkOrigins/clockUtils/archive/${VERSION}.tar.gz" + FILENAME "clockUtils-${VERSION}.tar.gz" + SHA512 ddb70cae9ced25de77a2df1854dac15e58a77347042ba3ee9c691f85f49edbc6539c84929a7477d429fb9161ba24c57d24d767793b8b1180216d5ddfc5d3ed6a ) vcpkg_extract_source_archive(${ARCHIVE}) From ac2ec94129ae0bdbcb16c0c2333fbfc52844d6c6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 20:08:29 -0800 Subject: [PATCH 420/561] Change Info::version() to Version::version() --- toolsrc/include/vcpkg_Commands.h | 1 + toolsrc/include/vcpkg_info.h | 2 -- toolsrc/src/commands_build.cpp | 2 +- toolsrc/src/commands_update.cpp | 2 +- toolsrc/src/commands_version.cpp | 27 +++++++++++++++++++++++++-- toolsrc/src/vcpkg.cpp | 4 ++-- toolsrc/src/vcpkg_info.cpp | 24 ------------------------ 7 files changed, 30 insertions(+), 32 deletions(-) diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 907190bfce..3c3ae03c6a 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -121,6 +121,7 @@ namespace vcpkg::Commands namespace Version { + const std::string& version(); void perform_and_exit(const vcpkg_cmd_arguments& args); } diff --git a/toolsrc/include/vcpkg_info.h b/toolsrc/include/vcpkg_info.h index 5380e01588..ebd87fd86e 100644 --- a/toolsrc/include/vcpkg_info.h +++ b/toolsrc/include/vcpkg_info.h @@ -4,7 +4,5 @@ namespace vcpkg::Info { - const std::string& version(); - const std::string& email(); } diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index eaba531cb8..d01d40ef44 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -109,7 +109,7 @@ namespace vcpkg::Commands::Build " Vcpkg version: %s\n" "\n" "Additionally, attach any relevant sections from the log files above." - , spec.toString(), Info::version()); + , spec.toString(), Version::version()); } void perform_and_exit(const package_spec& spec, const fs::path& port_dir, const std::unordered_set& options, const vcpkg_paths& paths) diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index 3aa7a499fa..3ac6694b94 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -80,7 +80,7 @@ namespace vcpkg::Commands::Update auto num1 = sscanf_s(version_contents->c_str(), "\"%d.%d.%d\"", &maj1, &min1, &rev1); int maj2, min2, rev2; - auto num2 = sscanf_s(Info::version().c_str(), "%d.%d.%d-", &maj2, &min2, &rev2); + auto num2 = sscanf_s(Version::version().c_str(), "%d.%d.%d-", &maj2, &min2, &rev2); if (num1 == 3 && num2 == 3) { diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/commands_version.cpp index 3dd90e6300..462c31c904 100644 --- a/toolsrc/src/commands_version.cpp +++ b/toolsrc/src/commands_version.cpp @@ -1,10 +1,33 @@ #include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" -#include "vcpkg_info.h" +#include "metrics.h" + +#define STRINGIFY(X) #X +#define MACRO_TO_STRING(X) STRINGIFY(X) + +#define VCPKG_VERSION_AS_STRING MACRO_TO_STRING(VCPKG_VERSION)"" // Double quotes needed at the end to prevent blank token namespace vcpkg::Commands::Version { + const std::string& version() + { + static const std::string s_version = +#include "../VERSION.txt" + + +#pragma warning( push ) +#pragma warning( disable : 4003) + // VCPKG_VERSION can be defined but have no value, which yields C4003. + + std::string(VCPKG_VERSION_AS_STRING) +#pragma warning( pop ) +#ifndef NDEBUG + + std::string("-debug") +#endif + + std::string(GetCompiledMetricsEnabled() ? "" : "-external"); + return s_version; + } + void perform_and_exit(const vcpkg_cmd_arguments& args) { args.check_exact_arg_count(0); @@ -12,7 +35,7 @@ namespace vcpkg::Commands::Version System::println("Vcpkg package management program version %s\n" "\n" - "See LICENSE.txt for license information.", Info::version() + "See LICENSE.txt for license information.", version() ); exit(EXIT_SUCCESS); } diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 1531090536..16c9cb0773 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -192,7 +192,7 @@ int wmain(const int argc, const wchar_t* const* const argv) Flush(); }); - TrackProperty("version", Info::version()); + TrackProperty("version", Commands::Version::version()); const std::string trimmed_command_line = trim_path_from_command_line(Strings::utf16_to_utf8(GetCommandLineW())); TrackProperty("cmdline", trimmed_command_line); @@ -238,7 +238,7 @@ int wmain(const int argc, const wchar_t* const* const argv) << " " << Info::email() << "\n" << "containing a brief summary of what you were trying to do and the following data blob:\n" << "\n" - << "Version=" << Info::version() << "\n" + << "Version=" << Commands::Version::version() << "\n" << "EXCEPTION='" << exc_msg << "'\n" << "CMD=\n"; for (int x = 0; x < argc; ++x) diff --git a/toolsrc/src/vcpkg_info.cpp b/toolsrc/src/vcpkg_info.cpp index f8e214998b..fa2077177a 100644 --- a/toolsrc/src/vcpkg_info.cpp +++ b/toolsrc/src/vcpkg_info.cpp @@ -1,32 +1,8 @@ #include "pch.h" #include "vcpkg_info.h" -#include "metrics.h" - -#define STRINGIFY(X) #X -#define MACRO_TO_STRING(X) STRINGIFY(X) - -#define VCPKG_VERSION_AS_STRING MACRO_TO_STRING(VCPKG_VERSION)"" // Double quotes needed at the end to prevent blank token namespace vcpkg::Info { - const std::string& version() - { - static const std::string s_version = -#include "../VERSION.txt" - - -#pragma warning( push ) -#pragma warning( disable : 4003) - // VCPKG_VERSION can be defined but have no value, which yields C4003. - + std::string(VCPKG_VERSION_AS_STRING) -#pragma warning( pop ) -#ifndef NDEBUG - + std::string("-debug") -#endif - + std::string(GetCompiledMetricsEnabled() ? "" : "-external"); - return s_version; - } - const std::string& email() { static const std::string s_email = R"(vcpkg@microsoft.com)"; From 43eb772d9475b4e9ec06eb54dca078a4793ab9e4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 20:13:36 -0800 Subject: [PATCH 421/561] Change Info::email() to Contact::email(). Remove vcpkg_info.h/cpp --- toolsrc/include/vcpkg_Commands.h | 1 + toolsrc/include/vcpkg_info.h | 8 -------- toolsrc/src/commands_build.cpp | 1 - toolsrc/src/commands_contact.cpp | 11 ++++++++--- toolsrc/src/commands_update.cpp | 1 - toolsrc/src/vcpkg.cpp | 3 +-- toolsrc/src/vcpkg_info.cpp | 11 ----------- toolsrc/vcpkglib/vcpkglib.vcxproj | 2 -- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 ------ 9 files changed, 10 insertions(+), 34 deletions(-) delete mode 100644 toolsrc/include/vcpkg_info.h delete mode 100644 toolsrc/src/vcpkg_info.cpp diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 3c3ae03c6a..544dffe721 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -127,6 +127,7 @@ namespace vcpkg::Commands namespace Contact { + const std::string& email(); void perform_and_exit(const vcpkg_cmd_arguments& args); } diff --git a/toolsrc/include/vcpkg_info.h b/toolsrc/include/vcpkg_info.h deleted file mode 100644 index ebd87fd86e..0000000000 --- a/toolsrc/include/vcpkg_info.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Info -{ - const std::string& email(); -} diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index d01d40ef44..aae30efd15 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -8,7 +8,6 @@ #include "vcpkg_System.h" #include "vcpkg_Environment.h" #include "metrics.h" -#include "vcpkg_info.h" #include "vcpkg_Enums.h" namespace vcpkg::Commands::Build diff --git a/toolsrc/src/commands_contact.cpp b/toolsrc/src/commands_contact.cpp index c5b8cab7e8..29f0d4d274 100644 --- a/toolsrc/src/commands_contact.cpp +++ b/toolsrc/src/commands_contact.cpp @@ -1,16 +1,21 @@ #include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" -#include "vcpkg_info.h" namespace vcpkg::Commands::Contact { - void perform_and_exit(const vcpkg_cmd_arguments& args) + const std::string& email() + { + static const std::string s_email = R"(vcpkg@microsoft.com)"; + return s_email; + } + + void perform_and_exit(const vcpkg_cmd_arguments& args) { args.check_exact_arg_count(0); args.check_and_get_optional_command_arguments({}); - System::println("Send an email to %s with any feedback.", Info::email()); + System::println("Send an email to %s with any feedback.", email()); exit(EXIT_SUCCESS); } } diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index 3ac6694b94..d4519ca141 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -4,7 +4,6 @@ #include "vcpkg_System.h" #include "vcpkg_Files.h" #include "Paragraphs.h" -#include "vcpkg_info.h" namespace vcpkg::Commands::Update { diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 16c9cb0773..f40126ecfe 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -12,7 +12,6 @@ #include "vcpkg_System.h" #include "vcpkg_Input.h" #include "Paragraphs.h" -#include "vcpkg_info.h" #include "vcpkg_Strings.h" using namespace vcpkg; @@ -235,7 +234,7 @@ int wmain(const int argc, const wchar_t* const* const argv) std::cerr << "vcpkg.exe has crashed.\n" << "Please send an email to:\n" - << " " << Info::email() << "\n" + << " " << Commands::Contact::email() << "\n" << "containing a brief summary of what you were trying to do and the following data blob:\n" << "\n" << "Version=" << Commands::Version::version() << "\n" diff --git a/toolsrc/src/vcpkg_info.cpp b/toolsrc/src/vcpkg_info.cpp deleted file mode 100644 index fa2077177a..0000000000 --- a/toolsrc/src/vcpkg_info.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "pch.h" -#include "vcpkg_info.h" - -namespace vcpkg::Info -{ - const std::string& email() - { - static const std::string s_email = R"(vcpkg@microsoft.com)"; - return s_email; - } -} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 4c98380fa1..b96dd10500 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -173,7 +173,6 @@ - @@ -234,7 +233,6 @@ - diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 70d1b58ace..aefba7a490 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -45,9 +45,6 @@ Source Files - - Source Files - Source Files @@ -206,9 +203,6 @@ Header Files - - Header Files - Header Files From 128ba92feeba2f474d19a5fc738fb60338b5e70a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Feb 2017 21:53:14 -0800 Subject: [PATCH 422/561] STRINGIFY: use __VA_ARGS__ to avoid C4003 and double quote hack --- toolsrc/src/commands_version.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/commands_version.cpp index 462c31c904..4789e2409c 100644 --- a/toolsrc/src/commands_version.cpp +++ b/toolsrc/src/commands_version.cpp @@ -3,10 +3,10 @@ #include "vcpkg_System.h" #include "metrics.h" -#define STRINGIFY(X) #X +#define STRINGIFY(...) #__VA_ARGS__ #define MACRO_TO_STRING(X) STRINGIFY(X) -#define VCPKG_VERSION_AS_STRING MACRO_TO_STRING(VCPKG_VERSION)"" // Double quotes needed at the end to prevent blank token +#define VCPKG_VERSION_AS_STRING MACRO_TO_STRING(VCPKG_VERSION) namespace vcpkg::Commands::Version { @@ -15,12 +15,7 @@ namespace vcpkg::Commands::Version static const std::string s_version = #include "../VERSION.txt" - -#pragma warning( push ) -#pragma warning( disable : 4003) - // VCPKG_VERSION can be defined but have no value, which yields C4003. + std::string(VCPKG_VERSION_AS_STRING) -#pragma warning( pop ) #ifndef NDEBUG + std::string("-debug") #endif From 2ab8eb3ef05eaf840389e0ea1a78489490e37983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Herrmann?= Date: Sat, 18 Feb 2017 13:11:48 +0100 Subject: [PATCH 423/561] dlib port Initial commit for dlib port --- ports/dlib/CONTROL | 3 +++ ports/dlib/portfile.cmake | 45 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 ports/dlib/CONTROL create mode 100644 ports/dlib/portfile.cmake diff --git a/ports/dlib/CONTROL b/ports/dlib/CONTROL new file mode 100644 index 0000000000..91ce3eb575 --- /dev/null +++ b/ports/dlib/CONTROL @@ -0,0 +1,3 @@ +Source: dlib +Version: 19.2 +Description: Modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ diff --git a/ports/dlib/portfile.cmake b/ports/dlib/portfile.cmake new file mode 100644 index 0000000000..3ef3f840ef --- /dev/null +++ b/ports/dlib/portfile.cmake @@ -0,0 +1,45 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/dlib-19.2) +vcpkg_download_distfile(ARCHIVE + URLS "http://dlib.net/files/dlib-19.2.tar.bz2" + FILENAME "dlib-19.2.tar.bz2" + SHA512 dcef5c8be52fe2650c1eccac6c7ac4050075dc07ee504a8bf3df6c9a597da5fdc09506e631abfa979d71c74940ce39ec5267be4c3a676a01ac66fcb14cbfe854 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() + +# There is no way to suppress installation of the headers and resource files in debug build. +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/test) + +# Remove other files not required in package +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/all) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/external/libpng/arm) + +# Handle copyright +#file(COPY ${SOURCE_PATH}/docs/license.html DESTINATION ${CURRENT_PACKAGES_DIR}/share/dlib) +file(COPY ${CURRENT_PACKAGES_DIR}/share/doc/dlib/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/dlib) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/dlib/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/dlib/COPYRIGHT) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) \ No newline at end of file From 01ff055cc5f583707075f876c4b80b8c4b2a2ed9 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 19 Feb 2017 12:18:08 +0100 Subject: [PATCH 424/561] [gtk] initial commit --- ports/gtk/CMakeLists.txt | 171 ++++++++++++ ports/gtk/CONTROL | 4 + ports/gtk/cmake/install_headers.cmake | 376 ++++++++++++++++++++++++++ ports/gtk/portfile.cmake | 34 +++ 4 files changed, 585 insertions(+) create mode 100644 ports/gtk/CMakeLists.txt create mode 100644 ports/gtk/CONTROL create mode 100644 ports/gtk/cmake/install_headers.cmake create mode 100644 ports/gtk/portfile.cmake diff --git a/ports/gtk/CMakeLists.txt b/ports/gtk/CMakeLists.txt new file mode 100644 index 0000000000..94bf37abb6 --- /dev/null +++ b/ports/gtk/CMakeLists.txt @@ -0,0 +1,171 @@ +cmake_minimum_required(VERSION 3.0) +project(gtk+ C) + +configure_file(config.h.win32 ${CMAKE_CURRENT_SOURCE_DIR}/config.h COPYONLY) +configure_file(gdk/gdkconfig.h.win32_broadway ${CMAKE_CURRENT_SOURCE_DIR}/gdk/gdkconfig.h COPYONLY) + +set(GTK_VERSION 3.22.8) + +set(GLIB_LIB_SUFFIX 2.0) +set(PANGO_LIB_SUFFIX 1.0) +set(ATK_LIB_SUFFIX 1.0) +set(GDK_PIXBUF_LIB_SUFFIX 2.0) +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CAIRO_LIB_SUFFIX d) +endif() + +# find dependencies +# glib +find_path(GLIB_INCLUDE_DIR glib.h) +find_library(GLIB_GLIB_LIBRARY glib-${GLIB_LIB_SUFFIX}) +find_library(GLIB_GIO_LIBRARY gio-${GLIB_LIB_SUFFIX}) +find_library(GLIB_GMODULE_LIBRARY gmodule-${GLIB_LIB_SUFFIX}) +find_library(GLIB_GOBJECT_LIBRARY gobject-${GLIB_LIB_SUFFIX}) +set(GLIB_LIBRARIES ${GLIB_GLIB_LIBRARY} ${GLIB_GIO_LIBRARY} ${GLIB_GMODULE_LIBRARY} ${GLIB_GOBJECT_LIBRARY}) + +# pango +find_path(PANGO_INCLUDE_DIR pango/pango.h) +find_library(PANGO_LIBRARY pango-${PANGO_LIB_SUFFIX}) +find_library(PANGO_CAIRO_LIBRARY pangocairo-${PANGO_LIB_SUFFIX}) +find_library(PANGO_WIN32_LIBRARY pangowin32-${PANGO_LIB_SUFFIX}) +set(PANGO_LIBRARIES ${PANGO_LIBRARY} ${PANGO_CAIRO_LIBRARY} ${PANGO_WIN32_LIBRARY}) +# cairo +find_library(CAIRO_LIBRARY cairo${CAIRO_LIB_SUFFIX}) +find_library(CAIRO_GOBJECT_LIBRARY cairo-gobject${CAIRO_LIB_SUFFIX}) +set(CAIRO_LIBRARIES ${CAIRO_LIBRARY} ${CAIRO_GOBJECT_LIBRARY}) +find_path(CAIRO_INCLUDE_DIR cairo.h) + +# atk +find_path(ATK_INCLUDE_DIR atk/atk.h) +find_library(ATK_LIBRARY atk-${ATK_LIB_SUFFIX}) + +# gdk-pixbuf +find_path(GDK_PIXBUF_INCLUDE_DIR gdk-pixbuf/gdk-pixbuf.h) +find_library(GDK_PIXBUF_LIBRARY gdk_pixbuf-${GDK_PIXBUF_LIB_SUFFIX}) + +# epoxy +find_path(EPOXY_INCLUDE_DIR epoxy/common.h) +find_library(EPOXY_LIBRARY epoxy) + +# gettext +find_path(LIBINTL_INCLUDE_DIR libintl.h) +find_library(LIBINTL_LIBRARY NAMES intl libintl) + +set(GTK_REQUIRED_LIBRARIES + ${LIBINTL_LIBRARY} + ${EPOXY_LIBRARY} + ${GLIB_LIBRARIES} + ${CAIRO_LIBRARIES} + ${PANGO_LIBRARIES} + ${GDK_PIXBUF_LIBRARY} + ${ATK_LIBRARY}) + +set(GTK_REQUIRED_INCLUDE_DIR + ${LIBINTL_INCLUDE_DIR} + ${EPOXY_INCLUDE_DIR} + ${GLIB_INCLUDE_DIR} + ${GDK_PIXBUF_INCLUDE_DIR} + ${CAIRO_INCLUDE_DIR} + ${PANGO_INCLUDE_DIR} + ${ATK_INCLUDE_DIR}) + +# defines expected by all modules +add_definitions( + -DHAVE_CONFIG_H + -DG_DISABLE_SINGLE_INCLUDES + -DATK_DISABLE_SINGLE_INCLUDES + -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES + -DGTK_DISABLE_SINGLE_INCLUDES + -D_USE_MATH_DEFINES) + +if(CMAKE_BUILD_TYPE STREQUAL Debug) + add_definitions(-DG_ENABLE_DEBUG) +endif() + +macro(extract_vcproj_sources VC_PROJECT OUT_VAR) + file(READ ${VC_PROJECT} ${VC_PROJECT}-CONTENTS) + STRING(REPLACE "\n" ";" ${VC_PROJECT}-CONTENTS "${${VC_PROJECT}-CONTENTS}") # split by lines + foreach(LINE ${${VC_PROJECT}-CONTENTS}) + if(LINE MATCHES "") + string(REPLACE "" "" LINE ${LINE}) + string(STRIP ${LINE} LINE) + file(TO_CMAKE_PATH ${LINE} LINE) + list(APPEND ${OUT_VAR} ${LINE}) + endif() + endforeach() +endmacro() + +# build 'win32' gdk backend +extract_vcproj_sources(build/win32/vs14/gdk3-win32.vcxproj GDK_WIN32_SOURCES) +add_library(gdk-3-win32 STATIC ${GDK_WIN32_SOURCES}) +target_compile_definitions(gdk-3-win32 PRIVATE + GDK_COMPILATION G_LOG_DOMAIN="Gdk" INSIDE_GDK_WIN32) +target_include_directories(gdk-3-win32 PRIVATE . ./gdk ./gdk/win32 ${GTK_REQUIRED_INCLUDE_DIR}) + +# build 'broadway' gdk backend +extract_vcproj_sources(build/win32/vs14/gdk3-broadway.vcxproj GDK_BROADWAY_SOURCES) +add_library(gdk-3-broadway STATIC ${GDK_BROADWAY_SOURCES}) +target_compile_definitions(gdk-3-broadway PRIVATE + GDK_COMPILATION G_LOG_DOMAIN="Gdk") +target_include_directories(gdk-3-broadway PRIVATE . ./gdk ./gdk/broadway ${GTK_REQUIRED_INCLUDE_DIR}) + +macro(gtk_add_module MODULE_NAME) + add_library(${MODULE_NAME} ${ARGN}) + target_include_directories(${MODULE_NAME} PRIVATE . ./gdk ./gtk ${GTK_REQUIRED_INCLUDE_DIR}) + target_link_libraries(${MODULE_NAME} ${GTK_REQUIRED_LIBRARIES}) + set_target_properties(${MODULE_NAME} PROPERTIES + ARCHIVE_OUTPUT_NAME ${MODULE_NAME}.0) + install(TARGETS ${MODULE_NAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) +endmacro() + +extract_vcproj_sources(build/win32/vs14/gdk-3.vcxproj GDK_SOURCES) +gtk_add_module(gdk-3 ${GDK_SOURCES}) +target_compile_definitions(gdk-3 PRIVATE GDK_COMPILATION) +target_include_directories(gdk-3 PRIVATE ./gdk/win32 ./gdk/broadway) +target_link_libraries(gdk-3 gdk-3-win32 gdk-3-broadway winmm dwmapi setupapi imm32 ws2_32) + +extract_vcproj_sources(build/win32/vs14/gtk-3.vcxproj GTK_SOURCES) +set_source_files_properties(gtk/inspector/visual.c PROPERTIES COMPILE_FLAGS "/FImath.h") +gtk_add_module(gtk-3 ${GTK_SOURCES}) +target_compile_definitions(gtk-3 PRIVATE + GTK_COMPILATION + G_LOG_DOMAIN="Gtk" + GTK_HOST="i686-pc" + GTK_PRINT_BACKENDS="file" + GTK_PRINT_BACKEND_ENABLE_UNSUPPORTED + INCLUDE_IM_am_et + INCLUDE_IM_cedilla + INCLUDE_IM_cyrillic_translit + INCLUDE_IM_ime + INCLUDE_IM_inuktitut + INCLUDE_IM_ipa + INCLUDE_IM_multipress + INCLUDE_IM_thai + INCLUDE_IM_ti_er + INCLUDE_IM_ti_et + INCLUDE_IM_viqr + GTK_LIBDIR="/dummy/lib" + GTK_DATADIR="/dummy/share" + GTK_DATA_PREFIX="/dummy" + GTK_SYSCONFDIR="/dummy/etc" + MULTIPRESS_CONFDIR="/dummy/etc/gtk-3.0" + MULTIPRESS_LOCALEDIR="/dummy/share/locale" + GTK_VERSION="${GTK_VERSION}/etc" + GTK_BINARY_VERSION="3.0.0/etc" + GDK_DISABLE_DEPRECATED + ISOLATION_AWARE_ENABLED) +target_link_libraries(gtk-3 gdk-3 winspool comctl32 imm32) +target_compile_options(gtk-3 PRIVATE "/wd4828" PRIVATE "/wd4244" PRIVATE "/wd4305" PRIVATE "/wd4018") + +extract_vcproj_sources(build/win32/vs14/gailutil-3.vcxproj GAILUTIL_SOURCES) +gtk_add_module(gailutil-3 ${GAILUTIL_SOURCES}) +target_compile_definitions(gailutil-3 PRIVATE GTK_DISABLE_DEPRECATED GDK_DISABLE_DEPRECATED) +target_link_libraries(gailutil-3 gtk-3 gdk-3) +set_target_properties(gailutil-3 PROPERTIES + LINK_FLAGS \"/DEF:${CMAKE_CURRENT_SOURCE_DIR}/libgail-util/gailutil.def\") + +if(NOT GTK_SKIP_HEADERS) + set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) + include(install_headers) +endif() diff --git a/ports/gtk/CONTROL b/ports/gtk/CONTROL new file mode 100644 index 0000000000..01eee28cf0 --- /dev/null +++ b/ports/gtk/CONTROL @@ -0,0 +1,4 @@ +Source: gtk +Version: 3.22.8 +Description: Portable library for creating graphical user interfaces. +Build-Depends: glib, atk, gdk-pixbuf, pango, cairo, libepoxy, gettext diff --git a/ports/gtk/cmake/install_headers.cmake b/ports/gtk/cmake/install_headers.cmake new file mode 100644 index 0000000000..ca2a273e44 --- /dev/null +++ b/ports/gtk/cmake/install_headers.cmake @@ -0,0 +1,376 @@ +install(FILES gdk/win32/gdkwin32.h DESTINATION include/gdk) +install(FILES gdk/gdk.h DESTINATION include/gdk) +install(FILES gdk/gdk-autocleanup.h DESTINATION include/gdk) +install(FILES gdk/gdkapplaunchcontext.h DESTINATION include/gdk) +install(FILES gdk/gdkcairo.h DESTINATION include/gdk) +install(FILES gdk/gdkcursor.h DESTINATION include/gdk) +install(FILES gdk/gdkdevice.h DESTINATION include/gdk) +install(FILES gdk/gdkdevicepad.h DESTINATION include/gdk) +install(FILES gdk/gdkdevicetool.h DESTINATION include/gdk) +install(FILES gdk/gdkdevicemanager.h DESTINATION include/gdk) +install(FILES gdk/gdkdisplay.h DESTINATION include/gdk) +install(FILES gdk/gdkdisplaymanager.h DESTINATION include/gdk) +install(FILES gdk/gdkdnd.h DESTINATION include/gdk) +install(FILES gdk/gdkdrawingcontext.h DESTINATION include/gdk) +install(FILES gdk/gdkevents.h DESTINATION include/gdk) +install(FILES gdk/gdkframetimings.h DESTINATION include/gdk) +install(FILES gdk/gdkglcontext.h DESTINATION include/gdk) +install(FILES gdk/gdkkeys.h DESTINATION include/gdk) +install(FILES gdk/gdkkeysyms.h DESTINATION include/gdk) +install(FILES gdk/gdkkeysyms-compat.h DESTINATION include/gdk) +install(FILES gdk/gdkmain.h DESTINATION include/gdk) +install(FILES gdk/gdkmonitor.h DESTINATION include/gdk) +install(FILES gdk/gdkpango.h DESTINATION include/gdk) +install(FILES gdk/gdkframeclock.h DESTINATION include/gdk) +install(FILES gdk/gdkpixbuf.h DESTINATION include/gdk) +install(FILES gdk/gdkprivate.h DESTINATION include/gdk) +install(FILES gdk/gdkproperty.h DESTINATION include/gdk) +install(FILES gdk/gdkrectangle.h DESTINATION include/gdk) +install(FILES gdk/gdkrgba.h DESTINATION include/gdk) +install(FILES gdk/gdkscreen.h DESTINATION include/gdk) +install(FILES gdk/gdkseat.h DESTINATION include/gdk) +install(FILES gdk/gdkselection.h DESTINATION include/gdk) +install(FILES gdk/gdktestutils.h DESTINATION include/gdk) +install(FILES gdk/gdkthreads.h DESTINATION include/gdk) +install(FILES gdk/gdktypes.h DESTINATION include/gdk) +install(FILES gdk/gdkvisual.h DESTINATION include/gdk) +install(FILES gdk/gdkwindow.h DESTINATION include/gdk) +install(FILES gdk/deprecated/gdkcolor.h DESTINATION include/gdk/deprecated) +install(FILES gdk/gdkconfig.h DESTINATION include/gdk) +install(FILES gdk/gdkenumtypes.h DESTINATION include/gdk) +install(FILES gdk/gdkversionmacros.h DESTINATION include/gdk) +install(FILES gdk/win32/gdkwin32cursor.h DESTINATION include/gdk/win32) +install(FILES gdk/win32/gdkwin32display.h DESTINATION include/gdk/win32) +install(FILES gdk/win32/gdkwin32displaymanager.h DESTINATION include/gdk/win32) +install(FILES gdk/win32/gdkwin32dnd.h DESTINATION include/gdk/win32) +install(FILES gdk/win32/gdkwin32glcontext.h DESTINATION include/gdk/win32) +install(FILES gdk/win32/gdkwin32keys.h DESTINATION include/gdk/win32) +install(FILES gdk/win32/gdkwin32misc.h DESTINATION include/gdk/win32) +install(FILES gdk/win32/gdkwin32monitor.h DESTINATION include/gdk/win32) +install(FILES gdk/win32/gdkwin32screen.h DESTINATION include/gdk/win32) +install(FILES gdk/win32/gdkwin32window.h DESTINATION include/gdk/win32) +install(FILES gtk/gtk.h DESTINATION include/gtk) +install(FILES gtk/gtk-autocleanups.h DESTINATION include/gtk) +install(FILES gtk/gtkx.h DESTINATION include/gtk) +install(FILES gtk/gtkx-autocleanups.h DESTINATION include/gtk) +install(FILES gtk/gtk-a11y.h DESTINATION include/gtk) +install(FILES gtk/gtkaboutdialog.h DESTINATION include/gtk) +install(FILES gtk/gtkaccelgroup.h DESTINATION include/gtk) +install(FILES gtk/gtkaccellabel.h DESTINATION include/gtk) +install(FILES gtk/gtkaccelmap.h DESTINATION include/gtk) +install(FILES gtk/gtkaccessible.h DESTINATION include/gtk) +install(FILES gtk/gtkactionable.h DESTINATION include/gtk) +install(FILES gtk/gtkactionbar.h DESTINATION include/gtk) +install(FILES gtk/gtkadjustment.h DESTINATION include/gtk) +install(FILES gtk/gtkappchooser.h DESTINATION include/gtk) +install(FILES gtk/gtkappchooserbutton.h DESTINATION include/gtk) +install(FILES gtk/gtkappchooserdialog.h DESTINATION include/gtk) +install(FILES gtk/gtkappchooserwidget.h DESTINATION include/gtk) +install(FILES gtk/gtkapplication.h DESTINATION include/gtk) +install(FILES gtk/gtkapplicationwindow.h DESTINATION include/gtk) +install(FILES gtk/gtkaspectframe.h DESTINATION include/gtk) +install(FILES gtk/gtkassistant.h DESTINATION include/gtk) +install(FILES gtk/gtkbbox.h DESTINATION include/gtk) +install(FILES gtk/gtkbin.h DESTINATION include/gtk) +install(FILES gtk/gtkbindings.h DESTINATION include/gtk) +install(FILES gtk/gtkborder.h DESTINATION include/gtk) +install(FILES gtk/gtkbox.h DESTINATION include/gtk) +install(FILES gtk/gtkbuilder.h DESTINATION include/gtk) +install(FILES gtk/gtkbuildable.h DESTINATION include/gtk) +install(FILES gtk/gtkbutton.h DESTINATION include/gtk) +install(FILES gtk/gtkcalendar.h DESTINATION include/gtk) +install(FILES gtk/gtkcellarea.h DESTINATION include/gtk) +install(FILES gtk/gtkcellareacontext.h DESTINATION include/gtk) +install(FILES gtk/gtkcellareabox.h DESTINATION include/gtk) +install(FILES gtk/gtkcelleditable.h DESTINATION include/gtk) +install(FILES gtk/gtkcelllayout.h DESTINATION include/gtk) +install(FILES gtk/gtkcellrenderer.h DESTINATION include/gtk) +install(FILES gtk/gtkcellrendereraccel.h DESTINATION include/gtk) +install(FILES gtk/gtkcellrenderercombo.h DESTINATION include/gtk) +install(FILES gtk/gtkcellrendererpixbuf.h DESTINATION include/gtk) +install(FILES gtk/gtkcellrendererprogress.h DESTINATION include/gtk) +install(FILES gtk/gtkcellrendererspin.h DESTINATION include/gtk) +install(FILES gtk/gtkcellrendererspinner.h DESTINATION include/gtk) +install(FILES gtk/gtkcellrenderertext.h DESTINATION include/gtk) +install(FILES gtk/gtkcellrenderertoggle.h DESTINATION include/gtk) +install(FILES gtk/gtkcellview.h DESTINATION include/gtk) +install(FILES gtk/gtkcheckbutton.h DESTINATION include/gtk) +install(FILES gtk/gtkcheckmenuitem.h DESTINATION include/gtk) +install(FILES gtk/gtkclipboard.h DESTINATION include/gtk) +install(FILES gtk/gtkcolorbutton.h DESTINATION include/gtk) +install(FILES gtk/gtkcolorchooser.h DESTINATION include/gtk) +install(FILES gtk/gtkcolorchooserwidget.h DESTINATION include/gtk) +install(FILES gtk/gtkcolorchooserdialog.h DESTINATION include/gtk) +install(FILES gtk/gtkcolorutils.h DESTINATION include/gtk) +install(FILES gtk/gtkcombobox.h DESTINATION include/gtk) +install(FILES gtk/gtkcomboboxtext.h DESTINATION include/gtk) +install(FILES gtk/gtkcontainer.h DESTINATION include/gtk) +install(FILES gtk/gtkcssprovider.h DESTINATION include/gtk) +install(FILES gtk/gtkcsssection.h DESTINATION include/gtk) +install(FILES gtk/gtkdebug.h DESTINATION include/gtk) +install(FILES gtk/gtkdialog.h DESTINATION include/gtk) +install(FILES gtk/gtkdnd.h DESTINATION include/gtk) +install(FILES gtk/gtkdragdest.h DESTINATION include/gtk) +install(FILES gtk/gtkdragsource.h DESTINATION include/gtk) +install(FILES gtk/gtkdrawingarea.h DESTINATION include/gtk) +install(FILES gtk/gtkeditable.h DESTINATION include/gtk) +install(FILES gtk/gtkentry.h DESTINATION include/gtk) +install(FILES gtk/gtkentrybuffer.h DESTINATION include/gtk) +install(FILES gtk/gtkentrycompletion.h DESTINATION include/gtk) +install(FILES gtk/gtkenums.h DESTINATION include/gtk) +install(FILES gtk/gtkeventbox.h DESTINATION include/gtk) +install(FILES gtk/gtkeventcontroller.h DESTINATION include/gtk) +install(FILES gtk/gtkexpander.h DESTINATION include/gtk) +install(FILES gtk/gtkfilechooser.h DESTINATION include/gtk) +install(FILES gtk/gtkfilechooserbutton.h DESTINATION include/gtk) +install(FILES gtk/gtkfilechooserdialog.h DESTINATION include/gtk) +install(FILES gtk/gtkfilechoosernative.h DESTINATION include/gtk) +install(FILES gtk/gtkfilechooserwidget.h DESTINATION include/gtk) +install(FILES gtk/gtkfilefilter.h DESTINATION include/gtk) +install(FILES gtk/gtkfixed.h DESTINATION include/gtk) +install(FILES gtk/gtkflowbox.h DESTINATION include/gtk) +install(FILES gtk/gtkfontbutton.h DESTINATION include/gtk) +install(FILES gtk/gtkfontchooser.h DESTINATION include/gtk) +install(FILES gtk/gtkfontchooserdialog.h DESTINATION include/gtk) +install(FILES gtk/gtkfontchooserwidget.h DESTINATION include/gtk) +install(FILES gtk/gtkframe.h DESTINATION include/gtk) +install(FILES gtk/gtkgesture.h DESTINATION include/gtk) +install(FILES gtk/gtkgesturedrag.h DESTINATION include/gtk) +install(FILES gtk/gtkgesturelongpress.h DESTINATION include/gtk) +install(FILES gtk/gtkgesturemultipress.h DESTINATION include/gtk) +install(FILES gtk/gtkgesturepan.h DESTINATION include/gtk) +install(FILES gtk/gtkgesturerotate.h DESTINATION include/gtk) +install(FILES gtk/gtkgesturesingle.h DESTINATION include/gtk) +install(FILES gtk/gtkgestureswipe.h DESTINATION include/gtk) +install(FILES gtk/gtkgesturezoom.h DESTINATION include/gtk) +install(FILES gtk/gtkglarea.h DESTINATION include/gtk) +install(FILES gtk/gtkgrid.h DESTINATION include/gtk) +install(FILES gtk/gtkheaderbar.h DESTINATION include/gtk) +install(FILES gtk/gtkicontheme.h DESTINATION include/gtk) +install(FILES gtk/gtkiconview.h DESTINATION include/gtk) +install(FILES gtk/gtkimage.h DESTINATION include/gtk) +install(FILES gtk/gtkimcontext.h DESTINATION include/gtk) +install(FILES gtk/gtkimcontextinfo.h DESTINATION include/gtk) +install(FILES gtk/gtkimcontextsimple.h DESTINATION include/gtk) +install(FILES gtk/gtkimmodule.h DESTINATION include/gtk) +install(FILES gtk/gtkimmulticontext.h DESTINATION include/gtk) +install(FILES gtk/gtkinfobar.h DESTINATION include/gtk) +install(FILES gtk/gtkinvisible.h DESTINATION include/gtk) +install(FILES gtk/gtklabel.h DESTINATION include/gtk) +install(FILES gtk/gtklayout.h DESTINATION include/gtk) +install(FILES gtk/gtklevelbar.h DESTINATION include/gtk) +install(FILES gtk/gtklinkbutton.h DESTINATION include/gtk) +install(FILES gtk/gtklistbox.h DESTINATION include/gtk) +install(FILES gtk/gtkliststore.h DESTINATION include/gtk) +install(FILES gtk/gtklockbutton.h DESTINATION include/gtk) +install(FILES gtk/gtkmain.h DESTINATION include/gtk) +install(FILES gtk/gtkmenu.h DESTINATION include/gtk) +install(FILES gtk/gtkmenubar.h DESTINATION include/gtk) +install(FILES gtk/gtkmenubutton.h DESTINATION include/gtk) +install(FILES gtk/gtkmenuitem.h DESTINATION include/gtk) +install(FILES gtk/gtkmenushell.h DESTINATION include/gtk) +install(FILES gtk/gtkmenutoolbutton.h DESTINATION include/gtk) +install(FILES gtk/gtkmessagedialog.h DESTINATION include/gtk) +install(FILES gtk/gtkmodelbutton.h DESTINATION include/gtk) +install(FILES gtk/gtkmodules.h DESTINATION include/gtk) +install(FILES gtk/gtkmountoperation.h DESTINATION include/gtk) +install(FILES gtk/gtknativedialog.h DESTINATION include/gtk) +install(FILES gtk/gtknotebook.h DESTINATION include/gtk) +install(FILES gtk/gtkoffscreenwindow.h DESTINATION include/gtk) +install(FILES gtk/gtkorientable.h DESTINATION include/gtk) +install(FILES gtk/gtkoverlay.h DESTINATION include/gtk) +install(FILES gtk/gtkpadcontroller.h DESTINATION include/gtk) +install(FILES gtk/gtkpagesetup.h DESTINATION include/gtk) +install(FILES gtk/gtkpaned.h DESTINATION include/gtk) +install(FILES gtk/gtkpapersize.h DESTINATION include/gtk) +install(FILES gtk/gtkplacessidebar.h DESTINATION include/gtk) +install(FILES gtk/gtkplug.h DESTINATION include/gtk) +install(FILES gtk/gtkpopover.h DESTINATION include/gtk) +install(FILES gtk/gtkpopovermenu.h DESTINATION include/gtk) +install(FILES gtk/gtkprintcontext.h DESTINATION include/gtk) +install(FILES gtk/gtkprintoperation.h DESTINATION include/gtk) +install(FILES gtk/gtkprintoperationpreview.h DESTINATION include/gtk) +install(FILES gtk/gtkprintsettings.h DESTINATION include/gtk) +install(FILES gtk/gtkprogressbar.h DESTINATION include/gtk) +install(FILES gtk/gtkradiobutton.h DESTINATION include/gtk) +install(FILES gtk/gtkradiomenuitem.h DESTINATION include/gtk) +install(FILES gtk/gtkradiotoolbutton.h DESTINATION include/gtk) +install(FILES gtk/gtkrange.h DESTINATION include/gtk) +install(FILES gtk/gtkrecentchooser.h DESTINATION include/gtk) +install(FILES gtk/gtkrecentchooserdialog.h DESTINATION include/gtk) +install(FILES gtk/gtkrecentchoosermenu.h DESTINATION include/gtk) +install(FILES gtk/gtkrecentchooserwidget.h DESTINATION include/gtk) +install(FILES gtk/gtkrecentfilter.h DESTINATION include/gtk) +install(FILES gtk/gtkrecentmanager.h DESTINATION include/gtk) +install(FILES gtk/gtkrender.h DESTINATION include/gtk) +install(FILES gtk/gtkrevealer.h DESTINATION include/gtk) +install(FILES gtk/gtkscale.h DESTINATION include/gtk) +install(FILES gtk/gtkscalebutton.h DESTINATION include/gtk) +install(FILES gtk/gtkscrollable.h DESTINATION include/gtk) +install(FILES gtk/gtkscrollbar.h DESTINATION include/gtk) +install(FILES gtk/gtkscrolledwindow.h DESTINATION include/gtk) +install(FILES gtk/gtksearchbar.h DESTINATION include/gtk) +install(FILES gtk/gtksearchentry.h DESTINATION include/gtk) +install(FILES gtk/gtkselection.h DESTINATION include/gtk) +install(FILES gtk/gtkseparator.h DESTINATION include/gtk) +install(FILES gtk/gtkseparatormenuitem.h DESTINATION include/gtk) +install(FILES gtk/gtkseparatortoolitem.h DESTINATION include/gtk) +install(FILES gtk/gtksettings.h DESTINATION include/gtk) +install(FILES gtk/gtkshortcutlabel.h DESTINATION include/gtk) +install(FILES gtk/gtkshortcutsgroup.h DESTINATION include/gtk) +install(FILES gtk/gtkshortcutssection.h DESTINATION include/gtk) +install(FILES gtk/gtkshortcutsshortcut.h DESTINATION include/gtk) +install(FILES gtk/gtkshortcutswindow.h DESTINATION include/gtk) +install(FILES gtk/gtkshow.h DESTINATION include/gtk) +install(FILES gtk/gtkstacksidebar.h DESTINATION include/gtk) +install(FILES gtk/gtksizegroup.h DESTINATION include/gtk) +install(FILES gtk/gtksizerequest.h DESTINATION include/gtk) +install(FILES gtk/gtksocket.h DESTINATION include/gtk) +install(FILES gtk/gtkspinbutton.h DESTINATION include/gtk) +install(FILES gtk/gtkspinner.h DESTINATION include/gtk) +install(FILES gtk/gtkstack.h DESTINATION include/gtk) +install(FILES gtk/gtkstackswitcher.h DESTINATION include/gtk) +install(FILES gtk/gtkstatusbar.h DESTINATION include/gtk) +install(FILES gtk/gtkstylecontext.h DESTINATION include/gtk) +install(FILES gtk/gtkstyleprovider.h DESTINATION include/gtk) +install(FILES gtk/gtkswitch.h DESTINATION include/gtk) +install(FILES gtk/gtktestutils.h DESTINATION include/gtk) +install(FILES gtk/gtktextattributes.h DESTINATION include/gtk) +install(FILES gtk/gtktextbuffer.h DESTINATION include/gtk) +install(FILES gtk/gtktextbufferrichtext.h DESTINATION include/gtk) +install(FILES gtk/gtktextchild.h DESTINATION include/gtk) +install(FILES gtk/gtktextdisplay.h DESTINATION include/gtk) +install(FILES gtk/gtktextiter.h DESTINATION include/gtk) +install(FILES gtk/gtktextmark.h DESTINATION include/gtk) +install(FILES gtk/gtktexttag.h DESTINATION include/gtk) +install(FILES gtk/gtktexttagtable.h DESTINATION include/gtk) +install(FILES gtk/gtktextview.h DESTINATION include/gtk) +install(FILES gtk/gtktogglebutton.h DESTINATION include/gtk) +install(FILES gtk/gtktoggletoolbutton.h DESTINATION include/gtk) +install(FILES gtk/gtktoolbar.h DESTINATION include/gtk) +install(FILES gtk/gtktoolbutton.h DESTINATION include/gtk) +install(FILES gtk/gtktoolitem.h DESTINATION include/gtk) +install(FILES gtk/gtktoolitemgroup.h DESTINATION include/gtk) +install(FILES gtk/gtktoolpalette.h DESTINATION include/gtk) +install(FILES gtk/gtktoolshell.h DESTINATION include/gtk) +install(FILES gtk/gtktooltip.h DESTINATION include/gtk) +install(FILES gtk/gtktreednd.h DESTINATION include/gtk) +install(FILES gtk/gtktreemodel.h DESTINATION include/gtk) +install(FILES gtk/gtktreemodelfilter.h DESTINATION include/gtk) +install(FILES gtk/gtktreemodelsort.h DESTINATION include/gtk) +install(FILES gtk/gtktreeselection.h DESTINATION include/gtk) +install(FILES gtk/gtktreesortable.h DESTINATION include/gtk) +install(FILES gtk/gtktreestore.h DESTINATION include/gtk) +install(FILES gtk/gtktreeview.h DESTINATION include/gtk) +install(FILES gtk/gtktreeviewcolumn.h DESTINATION include/gtk) +install(FILES gtk/gtktypes.h DESTINATION include/gtk) +install(FILES gtk/gtkviewport.h DESTINATION include/gtk) +install(FILES gtk/gtkvolumebutton.h DESTINATION include/gtk) +install(FILES gtk/gtkwidget.h DESTINATION include/gtk) +install(FILES gtk/gtkwidgetpath.h DESTINATION include/gtk) +install(FILES gtk/gtkwindow.h DESTINATION include/gtk) +install(FILES gtk/gtkwindowgroup.h DESTINATION include/gtk) +install(FILES gtk/gtktextlayout.h DESTINATION include/gtk) +install(FILES gtk/gtktypebuiltins.h DESTINATION include/gtk) +install(FILES gtk/gtkversion.h DESTINATION include/gtk) +install(FILES gtk/a11y/gtk-a11y-autocleanups.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkarrowaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkbooleancellaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkbuttonaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkcellaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkcellaccessibleparent.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkcheckmenuitemaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkcomboboxaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkcontaineraccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkcontainercellaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkentryaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkexpanderaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkflowboxaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkflowboxchildaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkframeaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkiconviewaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkimageaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkimagecellaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtklabelaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtklevelbaraccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtklinkbuttonaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtklistboxaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtklistboxrowaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtklockbuttonaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkmenuaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkmenubuttonaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkmenuitemaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkmenushellaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtknotebookaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtknotebookpageaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkpanedaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkpopoveraccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkprogressbaraccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkradiobuttonaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkradiomenuitemaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkrangeaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkrenderercellaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkscaleaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkscalebuttonaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkscrolledwindowaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkspinbuttonaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkspinneraccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkstatusbaraccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkstackaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkswitchaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtktextcellaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtktextviewaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtktogglebuttonaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtktoplevelaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtktreeviewaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkwidgetaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/a11y/gtkwindowaccessible.h DESTINATION include/gtk/a11y) +install(FILES gtk/deprecated/gtkactivatable.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkaction.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkactiongroup.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkalignment.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkarrow.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkcolorsel.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkcolorseldialog.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkfontsel.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkgradient.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkhandlebox.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkhbbox.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkhbox.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkhpaned.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkhscale.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkhscrollbar.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkhseparator.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkhsv.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkiconfactory.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkimagemenuitem.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkmisc.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtknumerableicon.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkradioaction.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkrc.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkrecentaction.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkstatusicon.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkstock.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkstyle.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkstyleproperties.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtksymboliccolor.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtktable.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtktearoffmenuitem.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkthemingengine.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtktoggleaction.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkuimanager.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkvbbox.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkvbox.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkvscale.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkvscrollbar.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkvseparator.h DESTINATION include/gtk/deprecated) +install(FILES gtk/deprecated/gtkvpaned.h DESTINATION include/gtk/deprecated) +install(FILES libgail-util/gailmisc.h DESTINATION include/libgail-util) +install(FILES libgail-util/gailtextutil.h DESTINATION include/libgail-util) +install(FILES libgail-util/gail-util.h DESTINATION include/libgail-util) +install(FILES gdk/broadway/gdkbroadway.h DESTINATION include/gdk) +install(FILES gdk/broadway/gdkbroadwaydisplay.h DESTINATION include/gdk/broadway) +install(FILES gdk/broadway/gdkbroadwaywindow.h DESTINATION include/gdk/broadway) +install(FILES gdk/broadway/gdkbroadwaycursor.h DESTINATION include/gdk/broadway) +install(FILES gdk/broadway/gdkbroadwaymonitor.h DESTINATION include/gdk/broadway) +install(FILES gdk/broadway/gdkbroadwayvisual.h DESTINATION include/gdk/broadway) diff --git a/ports/gtk/portfile.cmake b/ports/gtk/portfile.cmake new file mode 100644 index 0000000000..cd36690e5e --- /dev/null +++ b/ports/gtk/portfile.cmake @@ -0,0 +1,34 @@ + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gtk+-3.22.8) +vcpkg_download_distfile(ARCHIVE + URLS "https://ftp.gnome.org/pub/gnome/sources/gtk+/3.22/gtk+-3.22.8.tar.xz" + FILENAME "gtk+-3.22.8.tar.xz" + SHA512 e8c887d73a29982e8db1be6b101367326b4691905bd28e244f05435f34dfaddb054badb0b0b01a47a4c939c7f87985b7203db5d0cd499a0868c25eba44ed002c) + +vcpkg_extract_source_archive(${ARCHIVE}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH}) + +# generate sources using python script installed with glib +if(NOT EXISTS ${SOURCE_PATH}/gtk/gtkdbusgenerated.h OR NOT EXISTS ${SOURCE_PATH}/gtk/gtkdbusgenerated.c) + vcpkg_find_acquire_program(PYTHON3) + set(GLIB_TOOL_DIR ${CURRENT_INSTALLED_DIR}/tools/glib) + + vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${GLIB_TOOL_DIR}/gdbus-codegen --interface-prefix org.Gtk. --c-namespace _Gtk --generate-c-code gtkdbusgenerated ./gtkdbusinterfaces.xml + WORKING_DIRECTORY ${SOURCE_PATH}/gtk + LOGNAME source-gen) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS_DEBUG + -DGTK_SKIP_HEADERS=ON) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/gtk) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/gtk/COPYING ${CURRENT_PACKAGES_DIR}/share/gtk/copyright) From f9eb4f98dfcfd23a7cfc2b721ad2273ccdf64158 Mon Sep 17 00:00:00 2001 From: Tobias Kohlbau Date: Mon, 20 Feb 2017 15:41:59 +0100 Subject: [PATCH 425/561] [pqp] Add PQP portfile Signed-off-by: Tobias Kohlbau --- ports/pqp/CMakeLists.txt | 21 +++++++++++++++++++++ ports/pqp/CONTROL | 3 +++ ports/pqp/LICENSE | 32 ++++++++++++++++++++++++++++++++ ports/pqp/portfile.cmake | 27 +++++++++++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 ports/pqp/CMakeLists.txt create mode 100644 ports/pqp/CONTROL create mode 100644 ports/pqp/LICENSE create mode 100644 ports/pqp/portfile.cmake diff --git a/ports/pqp/CMakeLists.txt b/ports/pqp/CMakeLists.txt new file mode 100644 index 0000000000..e46f17895f --- /dev/null +++ b/ports/pqp/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.0) +project(pqp) + +include_directories(${SOURCE}/src) + +file(GLOB SRCS + "${SOURCE}/src/*.cpp") +file(GLOB HDRS + "${SOURCE}/src/*.h") + +add_library(pqp STATIC ${SRCS}) + +install(TARGETS pqp EXPORT pqpConfig + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + +foreach (file ${HDRS}) + get_filename_component(dir ${file} DIRECTORY) + install(FILES ${file} DESTINATION include/ CONFIGURATIONS Release) +endforeach() \ No newline at end of file diff --git a/ports/pqp/CONTROL b/ports/pqp/CONTROL new file mode 100644 index 0000000000..89995bb92f --- /dev/null +++ b/ports/pqp/CONTROL @@ -0,0 +1,3 @@ +Source: pqp +Version: 1.3 +Description: a proximity query package diff --git a/ports/pqp/LICENSE b/ports/pqp/LICENSE new file mode 100644 index 0000000000..2d4e4817a7 --- /dev/null +++ b/ports/pqp/LICENSE @@ -0,0 +1,32 @@ +Copyright 1999 University of North Carolina at Chapel Hill. +All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for educational, research, and non-profit purposes, without fee, +and without a written agreement is hereby granted, provided that the above +copyright notice and the following three paragraphs appear in all copies. + +IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL BE LIABLE TO +ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS +DOCUMENTATION, EVEN IF THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL HAS +BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL SPECIFICALLY DISCLAIMS ANY +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED +HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF NORTH CAROLINA AT +CHAPEL HILL HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, +ENHANCEMENTS, OR MODIFICATIONS. + +The authors may be contacted via: + +US Mail: Eric Larsen, Stefan Gottschalk + Department of Computer Science + Sitterson Hall, CB #3175 + University of North Carolina + Chapel Hill, NC 27599-3175 + +Phone: (919) 962-1749 + +Email: geom@cs.unc.edu \ No newline at end of file diff --git a/ports/pqp/portfile.cmake b/ports/pqp/portfile.cmake new file mode 100644 index 0000000000..3ce8514002 --- /dev/null +++ b/ports/pqp/portfile.cmake @@ -0,0 +1,27 @@ +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) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pqp-1.3/PQP_v1.3) +vcpkg_download_distfile(ARCHIVE + URLS "http://gamma.cs.unc.edu/software/downloads/SSV/pqp-1.3.tar.gz" + FILENAME "pqp-1.3.tar.gz" + SHA512 baad7b050b13a6d13de5110cdec443048a3543b65b0d3b30d1b5f737b46715052661f762ef71345d39978c0c788a30a3a935717664806b4729722ee3594ebdc1 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DSOURCE=${SOURCE_PATH} +) + +vcpkg_install_cmake() + +# Handle copyright +file(COPY ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/pqp) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/pqp/LICENSE ${CURRENT_PACKAGES_DIR}/share/pqp/copyright) From 9aa7c944f21b8adec37b1da04145708ff621dcd7 Mon Sep 17 00:00:00 2001 From: pravic Date: Tue, 21 Feb 2017 08:24:14 +0300 Subject: [PATCH 426/561] Allow to use git.cmd in addition to git.exe In respect of #682 and https://cmake.org/Bug/bug_relationship_graph.php?bug_id=9879. --- scripts/cmake/vcpkg_apply_patches.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index e17d53b087..1ef138a1e7 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -22,7 +22,7 @@ function(vcpkg_apply_patches) cmake_parse_arguments(_ap "QUIET" "SOURCE_PATH" "PATCHES" ${ARGN}) - find_program(GIT git) + find_program(GIT NAMES git git.cmd) set(PATCHNUM 0) foreach(PATCH ${_ap_PATCHES}) message(STATUS "Applying patch ${PATCH}") From 5c8d362b2210f7efcd91cb342da8b992cf927566 Mon Sep 17 00:00:00 2001 From: Max Smolens Date: Mon, 20 Feb 2017 17:59:02 -0500 Subject: [PATCH 427/561] [gtest] Support static build --- ports/gtest/portfile.cmake | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/ports/gtest/portfile.cmake b/ports/gtest/portfile.cmake index d1ba722d7a..33db3b2bac 100644 --- a/ports/gtest/portfile.cmake +++ b/ports/gtest/portfile.cmake @@ -1,7 +1,3 @@ -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) find_program(GIT git) @@ -42,16 +38,19 @@ vcpkg_configure_cmake( vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/googletest/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/gtest RENAME copyright) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin/) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gtest.dll ${CURRENT_PACKAGES_DIR}/bin/gtest.dll) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gtest_main.dll ${CURRENT_PACKAGES_DIR}/bin/gtest_main.dll) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gmock.dll ${CURRENT_PACKAGES_DIR}/bin/gmock.dll) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gmock_main.dll ${CURRENT_PACKAGES_DIR}/bin/gmock_main.dll) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin/) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gtest.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gtest.dll) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gtest_main.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gtest_main.dll) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gmock.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gmock.dll) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gmock_main.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gmock_main.dll) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin/) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gtest.dll ${CURRENT_PACKAGES_DIR}/bin/gtest.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gtest_main.dll ${CURRENT_PACKAGES_DIR}/bin/gtest_main.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gmock.dll ${CURRENT_PACKAGES_DIR}/bin/gmock.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gmock_main.dll ${CURRENT_PACKAGES_DIR}/bin/gmock_main.dll) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin/) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gtest.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gtest.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gtest_main.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gtest_main.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gmock.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gmock.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gmock_main.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gmock_main.dll) +endif() file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gtest.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/gtest.lib) From 2906ad00d3d85b33bf6dda6145c1a97ba8d3cb32 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 21 Feb 2017 15:21:11 -0800 Subject: [PATCH 428/561] [nana] Update version to fix build error. Resolves #688 --- ports/nana/CONTROL | 2 +- ports/nana/portfile.cmake | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ports/nana/CONTROL b/ports/nana/CONTROL index e7692526ff..96d79560f9 100644 --- a/ports/nana/CONTROL +++ b/ports/nana/CONTROL @@ -1,4 +1,4 @@ Source: nana -Version: 1.4.1 +Version: 1.4.1-66be23c9204c5567d1c51e6f57ba23bffa517a7c Description: Cross-platform library for GUI programming in modern C++ style. Build-Depends: zlib, libpng, libjpeg-turbo diff --git a/ports/nana/portfile.cmake b/ports/nana/portfile.cmake index 66fca68fa5..9705906086 100644 --- a/ports/nana/portfile.cmake +++ b/ports/nana/portfile.cmake @@ -1,10 +1,11 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/nana) +set(VERSION 66be23c9204c5567d1c51e6f57ba23bffa517a7c) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/nana-${VERSION}) vcpkg_download_distfile(ARCHIVE - URLS "http://downloads.sourceforge.net/project/nanapro/Nana/Nana 1.x/nana 1.4.1.zip" - FILENAME "nana 1.4.1.zip" - SHA512 38a4fe4c9f932d0e69753c0c1e28d0c8f7cc1ab73c639b87dd5ba102ed25da1ee04c93ec5d6bb79945f7bc118cc131022604c75c1bb6eaced3a071eb137115cd) + URLS "https://github.com/cnjinhao/nana/archive/${VERSION}.zip" + FILENAME "nana-${VERSION}.zip" + SHA512 07a611850ebdd3be29fcc5dd199511af859da9e6ad9365b41900ab669e2c1c506c9c264a13a35d60b2d7906b577c8412f2423d67595b75f4de6f6c65b1db1f37) vcpkg_extract_source_archive(${ARCHIVE}) @@ -32,5 +33,5 @@ endif() vcpkg_copy_pdbs() -file(COPY ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/nana) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/nana/LICENSE_1_0.txt ${CURRENT_PACKAGES_DIR}/share/nana/copyright) +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/nana) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/nana/LICENSE ${CURRENT_PACKAGES_DIR}/share/nana/copyright) From de288d5a4c224b4a461c13e4a30a108e2562760e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 21 Feb 2017 17:32:10 -0800 Subject: [PATCH 429/561] Add `search --graph` option This functionality should eventually be moved elsewhere --- toolsrc/src/commands_search.cpp | 49 ++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index 5dba711492..824c426ced 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -7,6 +7,43 @@ namespace vcpkg::Commands::Search { + static const std::string OPTION_GRAPH = "--graph"; //TODO: This should find a better home, eventually + + static std::string replace_dashes_with_underscore(const std::string& input) + { + std::string output = input; + std::replace(output.begin(), output.end(), '-', '_'); + return output; + } + + static std::string create_graph_as_string(const std::vector& source_paragraphs) + { + int empty_node_count = 0; + + std::string s; + s.append("digraph G{ rankdir=LR; edge [minlen=3]; overlap=false;"); + + for (const SourceParagraph& source_paragraph : source_paragraphs) + { + if (source_paragraph.depends.empty()) + { + empty_node_count++; + continue; + } + + const std::string name = replace_dashes_with_underscore(source_paragraph.name); + s.append(Strings::format("%s;", name)); + for (const dependency& d : source_paragraph.depends) + { + const std::string dependency_name = replace_dashes_with_underscore(d.name); + s.append(Strings::format("%s -> %s;", name, dependency_name)); + } + } + + s.append(Strings::format("empty [label=\"%d singletons...\"]; }", empty_node_count)); + return s; + } + static std::vector read_all_source_paragraphs(const vcpkg_paths& paths) { std::vector output; @@ -25,9 +62,7 @@ namespace vcpkg::Commands::Search auto srcpgh = SourceParagraph(pghs[0]); output.push_back(srcpgh); } - catch (std::runtime_error const&) - { - } + catch (std::runtime_error const&) { } } return output; @@ -46,9 +81,15 @@ namespace vcpkg::Commands::Search static const std::string example = Strings::format("The argument should be a substring to search for, or no argument to display all libraries.\n%s", Commands::Help::create_example_string("search png")); args.check_max_arg_count(1, example); - args.check_and_get_optional_command_arguments({}); + const std::unordered_set options = args.check_and_get_optional_command_arguments({ OPTION_GRAPH }); const std::vector source_paragraphs = read_all_source_paragraphs(paths); + if (options.find(OPTION_GRAPH) != options.cend()) + { + const std::string graph_as_string = create_graph_as_string(source_paragraphs); + System::println(graph_as_string); + exit(EXIT_SUCCESS); + } if (args.command_arguments.size() == 0) { From 1dd675a785ddce82b2ff4b164ed10f8b9789a5c7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 21 Feb 2017 17:32:53 -0800 Subject: [PATCH 430/561] Use std::vector.empty() instead of checking for size() = 0 --- toolsrc/src/commands_search.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index 824c426ced..56485ac02a 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -91,7 +91,7 @@ namespace vcpkg::Commands::Search exit(EXIT_SUCCESS); } - if (args.command_arguments.size() == 0) + if (args.command_arguments.empty()) { for (const SourceParagraph& source_paragraph : source_paragraphs) { From a2cebceafec8341fcab0236a3c81a27f935aeb38 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 21 Feb 2017 17:42:39 -0800 Subject: [PATCH 431/561] Rename findTargetPlatformVersion to getWindowsSDK --- scripts/bootstrap.ps1 | 4 ++-- scripts/{findTargetPlatformVersion.ps1 => getWindowsSDK.ps1} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename scripts/{findTargetPlatformVersion.ps1 => getWindowsSDK.ps1} (100%) diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 9907e31fbc..fea05964b6 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -26,8 +26,8 @@ try{ $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $msbuildExe = $msbuildExeWithPlatformToolset[0] $platformToolset = $msbuildExeWithPlatformToolset[1] - $targetPlatformVersion = & $scriptsDir\findTargetPlatformVersion.ps1 - & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /p:TargetPlatformVersion=$targetPlatformVersion /m dirs.proj + $windowsSDK = & $scriptsDir\getWindowsSDK.ps1 + & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /p:TargetPlatformVersion=$windowsSDK /m dirs.proj Write-Verbose("Placing vcpkg.exe in the correct location") diff --git a/scripts/findTargetPlatformVersion.ps1 b/scripts/getWindowsSDK.ps1 similarity index 100% rename from scripts/findTargetPlatformVersion.ps1 rename to scripts/getWindowsSDK.ps1 From c44c085e8ba5b3129126a9765132c1d756323c52 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 21 Feb 2017 18:09:32 -0800 Subject: [PATCH 432/561] Add vcpkg_get_windows_sdk.cmake --- scripts/cmake/vcpkg_common_functions.cmake | 1 + scripts/cmake/vcpkg_get_windows_sdk.cmake | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 scripts/cmake/vcpkg_get_windows_sdk.cmake diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 50c4ed2dcb..44278ebba9 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -16,3 +16,4 @@ include(vcpkg_copy_pdbs) include(vcpkg_copy_tool_dependencies) include(vcpkg_get_program_files_32_bit) include(vcpkg_get_program_files_platform_bitness) +include(vcpkg_get_windows_sdk) diff --git a/scripts/cmake/vcpkg_get_windows_sdk.cmake b/scripts/cmake/vcpkg_get_windows_sdk.cmake new file mode 100644 index 0000000000..6dde6f0c76 --- /dev/null +++ b/scripts/cmake/vcpkg_get_windows_sdk.cmake @@ -0,0 +1,15 @@ +function(vcpkg_get_windows_sdk ret) + execute_process( + COMMAND powershell.exe ${VCPKG_ROOT_DIR}/scripts/getWindowsSDK.ps1 + OUTPUT_VARIABLE WINDOWS_SDK + RESULT_VARIABLE error_code) + + if (${error_code}) + message(FATAL_ERROR "Could not find Windows SDK") + endif() + + # Remove trailing newline + string(REGEX REPLACE "\n$" "" WINDOWS_SDK "${WINDOWS_SDK}") + + set(${ret} ${WINDOWS_SDK} PARENT_SCOPE) +endfunction() \ No newline at end of file From 3ae8349d1be989c82ec7577537429de5a2993c0c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 21 Feb 2017 19:06:30 -0800 Subject: [PATCH 433/561] [opengl] Use the latest installed version of WinSDK Resolves #697, #99 --- ports/opengl/CONTROL | 2 +- ports/opengl/portfile.cmake | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ports/opengl/CONTROL b/ports/opengl/CONTROL index 05546ae5c6..5a9e200cae 100644 --- a/ports/opengl/CONTROL +++ b/ports/opengl/CONTROL @@ -1,3 +1,3 @@ Source: opengl -Version: 10.0.10240.0 +Version: 0.0-1 Description: Open Graphics Library (OpenGL)[3][4][5] is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. \ No newline at end of file diff --git a/ports/opengl/portfile.cmake b/ports/opengl/portfile.cmake index 8c2ac722bb..b29fef60a2 100644 --- a/ports/opengl/portfile.cmake +++ b/ports/opengl/portfile.cmake @@ -1,9 +1,19 @@ -set(OPENGLPATH "C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.10240.0\\um\\${TRIPLET_SYSTEM_ARCH}\\OpenGL32.Lib") -set(LICENSEPATH "C:\\Program Files (x86)\\Windows Kits\\10\\Licenses\\10.0.10240.0\\sdk_license.rtf") -set(HEADERSPATH "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.10240.0\\um") +include(vcpkg_common_functions) + +vcpkg_get_program_files_32_bit(PROGRAM_FILES_32_BIT) +vcpkg_get_windows_sdk(WINDOWS_SDK) + +if (${WINDOWS_SDK} STREQUAL "10") + set(OPENGLPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Lib\\${WINDOWS_SDK}\\um\\${TRIPLET_SYSTEM_ARCH}\\OpenGL32.Lib") + set(LICENSEPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Licenses\\${WINDOWS_SDK}\\sdk_license.rtf") + set(HEADERSPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Include\\${WINDOWS_SDK}\\um") +else() + message(FATAL_ERROR "Portfile not yet configured for Windows SDK with version: ${WINDOWS_SDK}") +endif() + if (NOT EXISTS "${OPENGLPATH}") - message(FATAL_ERROR "Cannot find Windows 10.0.10240.0 SDK. File does not exist: ${OPENGLPATH}") + message(FATAL_ERROR "Cannot find Windows ${WINDOWS_SDK} SDK. File does not exist: ${OPENGLPATH}") endif() file(MAKE_DIRECTORY From 4dc8f546f6a9aa3b182de33907c4c0744ca61c83 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 21 Feb 2017 19:31:52 -0800 Subject: [PATCH 434/561] [find/acquire python] Use 32-bit versions and bump to latest patch version --- scripts/cmake/vcpkg_find_acquire_program.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 7e4f1ba9c1..da909c6193 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -32,9 +32,9 @@ function(vcpkg_find_acquire_program VAR) elseif(VAR MATCHES "PYTHON3") set(PROGNAME python) set(PATHS ${DOWNLOADS}/tools/python) - set(URL "https://www.python.org/ftp/python/3.5.2/python-3.5.2-embed-amd64.zip") - set(ARCHIVE "python-3.5.2-embed-amd64.zip") - set(HASH 48bdcb6f94c993acad6782ee33ad4a07a0ea3b9b1bfcdeadf446d459a9224336837e2e7b518d54d8d99c5c3f4e9f8877ea1789cae513fa2eda2a3cad9e4dfd8f) + set(URL "https://www.python.org/ftp/python/3.5.3/python-3.5.3-embed-win32.zip") + set(ARCHIVE "python-3.5.3-embed-win32.zip") + set(HASH c8cfdc09d052dc27e4380e8e4bf0d32a4c0def7e03896c1fa6cabc26dde78bb74dbb04e3673cc36e3e307d65a1ef284d69174f0cc80008c83bc6178f192ac5cf) elseif(VAR MATCHES "PYTHON2") find_program(PYTHON2 NAMES python2 python PATHS C:/python27 ENV PYTHON) if(NOT PYTHON2 MATCHES "NOTFOUND") @@ -53,7 +53,7 @@ function(vcpkg_find_acquire_program VAR) if(PYTHON2 MATCHES "NOTFOUND") message(FATAL_ERROR "Python 2.7 was not found in the path or by searching inside C:\\Python27.\n" "There is no portable redistributable for Python 2.7, so you will need to install the MSI located at:\n" - " https://www.python.org/ftp/python/2.7.11/python-2.7.11.amd64.msi\n" + " https://www.python.org/ftp/python/2.7.13/python-2.7.13.msi\n" ) endif() elseif(VAR MATCHES "JOM") From b831a7d9ee5f97df506b14058d5fc970260d692a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 21 Feb 2017 19:39:53 -0800 Subject: [PATCH 435/561] [find/acquire python] Update to v1.1.2 from v1.1.1 --- scripts/cmake/vcpkg_find_acquire_program.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index da909c6193..c81779ef37 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -59,9 +59,9 @@ function(vcpkg_find_acquire_program VAR) elseif(VAR MATCHES "JOM") set(PROGNAME jom) set(PATHS ${DOWNLOADS}/tools/jom) - set(URL "http://download.qt.io/official_releases/jom/jom_1_1_1.zip") - set(ARCHIVE "jom_1_1_1.zip") - set(HASH 23a26dc7e29979bec5dcd3bfcabf76397b93ace64f5d46f2254d6420158bac5eff1c1a8454e3427e7a2fe2c233c5f2cffc87b376772399e12e40b51be2c065f4) + set(URL "http://download.qt.io/official_releases/jom/jom_1_1_2.zip") + set(ARCHIVE "jom_1_1_2.zip") + 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) From fa3f9dd9628ebafd3ba65fb3abde6c1d6f0448fc Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 21 Feb 2017 23:22:56 -0800 Subject: [PATCH 436/561] [opengl] Add -ExecutionPolicy Bypass when invoking powershell as a child process. --- ports/opengl/CONTROL | 2 +- ports/opengl/portfile.cmake | 5 ++--- scripts/cmake/vcpkg_get_windows_sdk.cmake | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ports/opengl/CONTROL b/ports/opengl/CONTROL index 5a9e200cae..db748df59a 100644 --- a/ports/opengl/CONTROL +++ b/ports/opengl/CONTROL @@ -1,3 +1,3 @@ Source: opengl -Version: 0.0-1 +Version: 0.0-2 Description: Open Graphics Library (OpenGL)[3][4][5] is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. \ No newline at end of file diff --git a/ports/opengl/portfile.cmake b/ports/opengl/portfile.cmake index b29fef60a2..cc27570e6f 100644 --- a/ports/opengl/portfile.cmake +++ b/ports/opengl/portfile.cmake @@ -3,7 +3,7 @@ include(vcpkg_common_functions) vcpkg_get_program_files_32_bit(PROGRAM_FILES_32_BIT) vcpkg_get_windows_sdk(WINDOWS_SDK) -if (${WINDOWS_SDK} STREQUAL "10") +if (WINDOWS_SDK MATCHES "10.") set(OPENGLPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Lib\\${WINDOWS_SDK}\\um\\${TRIPLET_SYSTEM_ARCH}\\OpenGL32.Lib") set(LICENSEPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Licenses\\${WINDOWS_SDK}\\sdk_license.rtf") set(HEADERSPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Include\\${WINDOWS_SDK}\\um") @@ -23,11 +23,10 @@ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/opengl ) -file(COPY ${LICENSEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/include/gl) file(COPY "${HEADERSPATH}\\gl\\GL.h" "${HEADERSPATH}\\gl\\GLU.h" - DESTINATION ${CURRENT_PACKAGES_DIR}/include + DESTINATION ${CURRENT_PACKAGES_DIR}/include/gl ) file(COPY ${OPENGLPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) file(COPY ${OPENGLPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) diff --git a/scripts/cmake/vcpkg_get_windows_sdk.cmake b/scripts/cmake/vcpkg_get_windows_sdk.cmake index 6dde6f0c76..7a8014eb25 100644 --- a/scripts/cmake/vcpkg_get_windows_sdk.cmake +++ b/scripts/cmake/vcpkg_get_windows_sdk.cmake @@ -1,6 +1,6 @@ function(vcpkg_get_windows_sdk ret) execute_process( - COMMAND powershell.exe ${VCPKG_ROOT_DIR}/scripts/getWindowsSDK.ps1 + COMMAND powershell.exe -ExecutionPolicy Bypass ${VCPKG_ROOT_DIR}/scripts/getWindowsSDK.ps1 OUTPUT_VARIABLE WINDOWS_SDK RESULT_VARIABLE error_code) From 42ac9bbe1e6440dd9e84b6fdd28a4f61792a73f3 Mon Sep 17 00:00:00 2001 From: Mikhail Klimenko Date: Wed, 22 Feb 2017 14:51:05 +0300 Subject: [PATCH 437/561] Add proxy credential support --- scripts/fetchDependency.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 6a40c97588..7c5c2a989d 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -81,6 +81,14 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if ($Dependency -ne "git") # git fails with BITS { try { + $WC = New-Object System.Net.WebClient + $ProxyAuth = !$WC.Proxy.IsBypassed($url) + If($ProxyAuth){ + $ProxyCred = Get-Credential -Message "Enter credentials for Proxy Authentication" + $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyAuthentication","Basic") + $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyCredential",$ProxyCred) + } + Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop } catch [System.Exception] { From f6e4c2968a63b5b90c5bf27d5bcc7be25faa6968 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 22 Feb 2017 15:41:09 -0800 Subject: [PATCH 438/561] Improve error message and use check_exit() instead of check_throw() --- toolsrc/src/commands_import.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp index 4b71fc2901..33cf8a4f46 100644 --- a/toolsrc/src/commands_import.cpp +++ b/toolsrc/src/commands_import.cpp @@ -86,7 +86,7 @@ namespace vcpkg::Commands::Import const fs::path project_directory(args.command_arguments[2]); auto pghs = Paragraphs::get_paragraphs(control_file_path); - Checks::check_throw(pghs.size() == 1, "Invalid control file for package"); + Checks::check_exit(pghs.size() == 1, "Invalid control file %s for package", control_file_path.generic_string()); StatusParagraph spgh; spgh.package = BinaryParagraph(pghs[0]); From db59fd0b099e1419d788b665a4fc06dbab06efd2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 22 Feb 2017 15:42:04 -0800 Subject: [PATCH 439/561] Use check_exit() instead of check_throw() --- toolsrc/src/Paragraphs.cpp | 4 ++-- toolsrc/src/StatusParagraphs.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp index 6dde5da7c9..0c41e0b5c3 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/Paragraphs.cpp @@ -101,7 +101,7 @@ namespace vcpkg::Paragraphs auto begin_fieldname = cur; while (is_alphanum(ch) || ch == '-') next(ch); - Checks::check_throw(ch == ':', "Expected ':'"); + Checks::check_exit(ch == ':', "Expected ':'"); fieldname = std::string(begin_fieldname, cur); // skip ': ' @@ -119,7 +119,7 @@ namespace vcpkg::Paragraphs get_fieldname(ch, fieldname); auto it = fields.find(fieldname); - Checks::check_throw(it == fields.end(), "Duplicate field"); + Checks::check_exit(it == fields.end(), "Duplicate field"); get_fieldvalue(ch, fieldvalue); diff --git a/toolsrc/src/StatusParagraphs.cpp b/toolsrc/src/StatusParagraphs.cpp index 48bc0b0624..9a440fbb89 100644 --- a/toolsrc/src/StatusParagraphs.cpp +++ b/toolsrc/src/StatusParagraphs.cpp @@ -42,7 +42,7 @@ namespace vcpkg StatusParagraphs::iterator StatusParagraphs::insert(std::unique_ptr pgh) { - Checks::check_throw(pgh != nullptr, "Inserted null paragraph"); + Checks::check_exit(pgh != nullptr, "Inserted null paragraph"); const package_spec& spec = pgh->package.spec; auto ptr = find(spec.name(), spec.target_triplet()); if (ptr == end()) From 7dd7490468019b696859331f1f686890d8aaf556 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 23 Feb 2017 03:29:25 -0800 Subject: [PATCH 440/561] [vcpkg] Force JOM to be updated to 1.1.2 --- scripts/cmake/vcpkg_find_acquire_program.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index c81779ef37..d6bd34b212 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -58,7 +58,8 @@ function(vcpkg_find_acquire_program VAR) endif() elseif(VAR MATCHES "JOM") set(PROGNAME jom) - set(PATHS ${DOWNLOADS}/tools/jom) + set(SUBDIR "jom-1.1.2") + set(PATHS ${DOWNLOADS}/tools/jom/${SUBDIR}) set(URL "http://download.qt.io/official_releases/jom/jom_1_1_2.zip") set(ARCHIVE "jom_1_1_2.zip") set(HASH 830cd94ed6518fbe4604a0f5a3322671b4674b87d25a71349c745500d38e85c0fac4f6995242fc5521eb048e3966bb5ec2a96a06b041343ed8da9bba78124f34) From dd6d1aa560985c4b508f6f0f5259e03ddfaba262 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 23 Feb 2017 03:34:21 -0800 Subject: [PATCH 441/561] [qt5] Exercise full control over build configuration. Bumps version to 5.7.1-2 This fixes several issues: - Prevents a hang for user input during the build. - Moves the tools into a subdirectory so their DLLs do not interfere with other packages. - Adds the currently installed DLLs to the path so that tools compiled during the build can be run. - Uses our system's copy of double-conversion. - No longer uses looped builds; I haven't seen issues since the update to JOM 1.1.2 - Works around an issue with Qt5Bootstrap (QTBUG-55499) Regressions to fix: - Disables many subcomponents --- ports/qt5/CONTROL | 4 +-- ports/qt5/fixcmake.py | 2 +- ports/qt5/portfile.cmake | 69 +++++++++++++++++++++++++++++----------- 3 files changed, 54 insertions(+), 21 deletions(-) diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index 40bde5f2a0..c912dad3d0 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 -Version: 5.7.1-2 +Version: 5.7.1-3 Description: Qt5 application framework main components. Webengine, examples and tests not included. -Build-Depends: sqlite3, libpq +Build-Depends: sqlite3, libpq, double-conversion diff --git a/ports/qt5/fixcmake.py b/ports/qt5/fixcmake.py index bd37c1e549..41b74606c8 100644 --- a/ports/qt5/fixcmake.py +++ b/ports/qt5/fixcmake.py @@ -36,7 +36,7 @@ for f in files: builder += "\n " + line.replace("/plugins/", "/debug/plugins/") builder += " endif()\n" elif exepattern.search(line) != None: - builder += line.replace("/bin/", "/tools/") + builder += line.replace("/bin/", "/tools/qt5/") else: builder += line new_file = open(f, "w") diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index df17621f18..39a031581a 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -12,7 +12,7 @@ vcpkg_find_acquire_program(PYTHON3) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY) -set(ENV{PATH} "${JOM_EXE_PATH};${PYTHON3_EXE_PATH};$ENV{PATH};${PERL_EXE_PATH}") +set(ENV{PATH} "${JOM_EXE_PATH};${PYTHON3_EXE_PATH};${CURRENT_INSTALLED_DIR}/bin;$ENV{PATH};${PERL_EXE_PATH}") set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}") set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;$ENV{LIB}") vcpkg_download_distfile(ARCHIVE_FILE @@ -25,6 +25,12 @@ if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.1) file(RENAME ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.1 ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.1) endif() +if(EXISTS ${OUTPUT_PATH}) + file(REMOVE_RECURSE ${OUTPUT_PATH}) + if(EXISTS ${OUTPUT_PATH}) + message(FATAL_ERROR "Could not clean output directory.") + endif() +endif() file(MAKE_DIRECTORY ${OUTPUT_PATH}) if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) list(APPEND QT_RUNTIME_LINKAGE "-static") @@ -48,13 +54,26 @@ vcpkg_execute_required_process( -confirm-license -opensource -platform win32-msvc2015 -debug-and-release -force-debug-info ${QT_RUNTIME_LINKAGE} -qt-zlib - -qt-libjpeg + -no-libjpeg -no-libpng -no-freetype -qt-pcre -no-harfbuzz + -no-angle + -no-inotify + -no-mtdev + -no-evdev + -system-doubleconversion + -no-iconv -system-sqlite - -nomake examples -nomake tests -skip webengine + -no-opengl + -no-style-windowsxp + -no-style-windowsvista + -no-style-fusion + -mp + -nomake examples -nomake tests + -skip webengine -skip 3d -skip activeqt -skip androidextras -skip canvas3d -skip charts -skip connectivity -skip datavis3d -skip declarative + -skip graphicaleffects -skip wayland -skip webchannel -skip webview -skip translations -skip script -skip multimedia -skip purchasing -qt-sql-sqlite -qt-sql-psql -prefix ${CURRENT_PACKAGES_DIR} -bindir ${CURRENT_PACKAGES_DIR}/bin @@ -68,8 +87,7 @@ vcpkg_execute_required_process( message(STATUS "Configure ${TARGET_TRIPLET} done") message(STATUS "Building ${TARGET_TRIPLET}") -vcpkg_execute_required_process_repeat( - COUNT 5 +vcpkg_execute_required_process( COMMAND ${JOM} WORKING_DIRECTORY ${OUTPUT_PATH} LOGNAME build-${TARGET_TRIPLET} @@ -103,7 +121,9 @@ if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) file(REMOVE ${DEBUG_BIN_FILES}) file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.pdb") file(REMOVE ${DEBUG_BIN_FILES}) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/Qt5Gamepad.dll ${CURRENT_PACKAGES_DIR}/bin/Qt5Gamepad.dll) + if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/bin/Qt5Gamepad.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/Qt5Gamepad.dll ${CURRENT_PACKAGES_DIR}/bin/Qt5Gamepad.dll) + endif() endif() file(INSTALL ${CURRENT_PACKAGES_DIR}/lib @@ -126,10 +146,14 @@ file(GLOB DEBUG_LIB_FILES "${CURRENT_PACKAGES_DIR}/lib/*d.pdb") if(DEBUG_LIB_FILES) file(REMOVE ${DEBUG_LIB_FILES}) endif() -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.lib) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl) +if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.lib) +endif() +if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl) +endif() file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") -file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) +file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) file(REMOVE ${BINARY_TOOLS}) file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins") file(GLOB_RECURSE DEBUG_PLUGINS @@ -143,17 +167,26 @@ foreach(file ${DEBUG_PLUGINS}) file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}") file(RENAME ${file} "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}/${file_n}") endforeach() -file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepad.dll - ${CURRENT_PACKAGES_DIR}/plugins/gamepads/xinputgamepad.dll) -file(RENAME - ${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepad.pdb - ${CURRENT_PACKAGES_DIR}/plugins/gamepads/xinputgamepad.pdb) -if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) - file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/bin/*.dll") - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) +if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepad.dll) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepad.dll + ${CURRENT_PACKAGES_DIR}/plugins/gamepads/xinputgamepad.dll) endif() +if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepad.pdb) + file(RENAME + ${CURRENT_PACKAGES_DIR}/debug/plugins/gamepads/xinputgamepad.pdb + ${CURRENT_PACKAGES_DIR}/plugins/gamepads/xinputgamepad.pdb) +endif() + +if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/lib/Qt5Bootstrap.lib AND EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrapd.lib) + # QT bug: https://bugreports.qt.io/browse/QTBUG-55499 + # The release copy of Qt5Bootstrap.lib is not created when using -debug-and-release + # Comments from Oswald Buddenhagen indicate this is an internal library, so simply removing the mismatch should be safe. + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrapd.lib) +endif() + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/qt5) vcpkg_execute_required_process( COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py From 4b9f258c70d78a9e2d954eea7017bfb0f371cfbb Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 23 Feb 2017 04:35:00 -0800 Subject: [PATCH 442/561] [vcpkg] Fix bug when building v141@64-bit from a v140@32-bit prompt --- toolsrc/src/commands_build.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index ec4124922f..2159cec2c1 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -37,6 +37,10 @@ namespace vcpkg::Commands::Build } } + // If these environment variables are set while running the VS2017 developer prompt, it will not correctly initialize the build environment. + _wputenv_s(L"VSINSTALLDIR", L""); + _wputenv_s(L"DevEnvDir", L""); + const fs::path ports_cmake_script_path = paths.ports_cmake; const Environment::vcvarsall_and_platform_toolset vcvarsall_bat = Environment::get_vcvarsall_bat(paths); const std::wstring command = Strings::wformat(LR"("%s" %s >nul 2>&1 && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s -DVCPKG_PLATFORM_TOOLSET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", From 1a502849292953514d3094f25ba0f2a3327addcc Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 23 Feb 2017 15:47:00 -0800 Subject: [PATCH 443/561] Use System::set_environmental_variable() --- toolsrc/src/commands_build.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 2159cec2c1..98f0cbbb0e 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -38,8 +38,8 @@ namespace vcpkg::Commands::Build } // If these environment variables are set while running the VS2017 developer prompt, it will not correctly initialize the build environment. - _wputenv_s(L"VSINSTALLDIR", L""); - _wputenv_s(L"DevEnvDir", L""); + System::set_environmental_variable(L"VSINSTALLDIR", L""); + System::set_environmental_variable(L"DevEnvDir", L""); const fs::path ports_cmake_script_path = paths.ports_cmake; const Environment::vcvarsall_and_platform_toolset vcvarsall_bat = Environment::get_vcvarsall_bat(paths); From b5dc358d49a31269a5b0648acdaf6c015e609387 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 23 Feb 2017 15:50:28 -0800 Subject: [PATCH 444/561] Remove unneeded Import-Module directive --- scripts/findVisualStudioInstallationInstances.ps1 | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 8937c6fed1..e572b60976 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -3,8 +3,6 @@ param( ) -Import-Module BitsTransfer - $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root From 6367924964403b32f7c562ababcec0ff42b17f24 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 23 Feb 2017 15:50:52 -0800 Subject: [PATCH 445/561] Disable Verbose-level messages for imported module --- scripts/fetchDependency.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 6a40c97588..4f1799d0b4 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -9,7 +9,7 @@ $downloadPromptOverride_NO_OVERRIDE= 0 $downloadPromptOverride_DO_NOT_PROMPT = 1 $downloadPromptOverride_ALWAYS_PROMPT = 2 -Import-Module BitsTransfer +Import-Module BitsTransfer -Verbose:$false $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root From 984f710c3f4fc8a5a54a17fe7c7992ef5c7ed0ff Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 23 Feb 2017 15:57:22 -0800 Subject: [PATCH 446/561] Tweak Verbose messages --- scripts/findFileRecursivelyUp.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/findFileRecursivelyUp.ps1 b/scripts/findFileRecursivelyUp.ps1 index 788adbf08c..4b6409e8cf 100644 --- a/scripts/findFileRecursivelyUp.ps1 +++ b/scripts/findFileRecursivelyUp.ps1 @@ -11,8 +11,8 @@ $currentDir = $startingDir while (!($currentDir -eq "") -and !(Test-Path "$currentDir\$filename")) { - Write-Verbose "Examining: $currentDir" + Write-Verbose "Examining $currentDir for $filename" $currentDir = Split-path $currentDir -Parent } -Write-Verbose "Found: $currentDir" +Write-Verbose "Examining $currentDir for $filename - Found" return $currentDir \ No newline at end of file From a018ade610783fcb1511c118192bb24f7fe20f4b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 23 Feb 2017 18:36:47 -0800 Subject: [PATCH 447/561] [aws-sdk-cpp] Switch build to use Ninja to improve performance. --- ports/aws-sdk-cpp/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index 21219c3c99..93c7a72654 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -22,6 +22,7 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA OPTIONS -DENABLE_TESTING=OFF -DFORCE_SHARED_CRT=${FORCE_SHARED_CRT} From e4ff363f5c4732235c288496e1c6798968a158ce Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 23 Feb 2017 19:01:01 -0800 Subject: [PATCH 448/561] [qt5] Reduce number of skipped components. --- ports/qt5/CONTROL | 2 +- ports/qt5/portfile.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index c912dad3d0..f42021c540 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 -Version: 5.7.1-3 +Version: 5.7.1-4 Description: Qt5 application framework main components. Webengine, examples and tests not included. Build-Depends: sqlite3, libpq, double-conversion diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 39a031581a..33a1182d1f 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -72,8 +72,8 @@ vcpkg_execute_required_process( -no-style-fusion -mp -nomake examples -nomake tests - -skip webengine -skip 3d -skip activeqt -skip androidextras -skip canvas3d -skip charts -skip connectivity -skip datavis3d -skip declarative - -skip graphicaleffects -skip wayland -skip webchannel -skip webview -skip translations -skip script -skip multimedia -skip purchasing + # Doesn't work: only -skip webengine + -skip webengine -skip connectivity -skip declarative -qt-sql-sqlite -qt-sql-psql -prefix ${CURRENT_PACKAGES_DIR} -bindir ${CURRENT_PACKAGES_DIR}/bin From 60e67651c32060ada2a2bfd0d52366cf91ef86cb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 24 Feb 2017 14:30:56 -0800 Subject: [PATCH 449/561] Improve functions that detect ProgramFiles in powershell --- scripts/getProgramFiles32bit.ps1 | 12 +++++++++--- scripts/getProgramFilesPlatformBitness.ps1 | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/getProgramFiles32bit.ps1 b/scripts/getProgramFiles32bit.ps1 index fd71671914..6b71915b19 100644 --- a/scripts/getProgramFiles32bit.ps1 +++ b/scripts/getProgramFiles32bit.ps1 @@ -3,9 +3,15 @@ param( ) -if (Test-Path env:PROGRAMFILES`(X86`)) +$out = ${env:PROGRAMFILES(X86)} +if ($out -eq $null) { - return ${env:PROGRAMFILES(X86)} + $out = ${env:PROGRAMFILES} } -return ${env:PROGRAMFILES} \ No newline at end of file +if ($out -eq $null) +{ + throw "Could not find [Program Files 32-bit]" +} + +return $out \ No newline at end of file diff --git a/scripts/getProgramFilesPlatformBitness.ps1 b/scripts/getProgramFilesPlatformBitness.ps1 index 6d0a513ca2..2be4c11371 100644 --- a/scripts/getProgramFilesPlatformBitness.ps1 +++ b/scripts/getProgramFilesPlatformBitness.ps1 @@ -3,9 +3,15 @@ param( ) -if (Test-Path env:ProgramW6432) +$out = ${env:ProgramW6432} +if ($out -eq $null) { - return ${env:ProgramW6432} + $out = ${env:PROGRAMFILES} } -return ${env:PROGRAMFILES} \ No newline at end of file +if ($out -eq $null) +{ + throw "Could not find [Program Files Platform Bitness]" +} + +return $out \ No newline at end of file From 95a9a98edefe91fbcfffd53bfc4501955553de33 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 24 Feb 2017 14:44:37 -0800 Subject: [PATCH 450/561] Throw error is PROGRAMFILES env variable is not found --- toolsrc/src/vcpkg_Environment.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 527d8de895..8f3030269d 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -231,6 +231,19 @@ namespace vcpkg::Environment return vcvarsall_bat; } + static fs::path find_ProgramFiles() + { + const optional program_files = System::get_environmental_variable(L"PROGRAMFILES"); + Checks::check_exit(program_files.get() != nullptr, "Could not detect the PROGRAMFILES environmental variable"); + return *program_files; + } + + static const fs::path& get_ProgramFiles() + { + static const fs::path p = find_ProgramFiles(); + return p; + } + static fs::path find_ProgramFiles_32_bit() { const optional program_files_X86 = System::get_environmental_variable(L"ProgramFiles(x86)"); @@ -239,7 +252,7 @@ namespace vcpkg::Environment return *program_files_X86; } - return *System::get_environmental_variable(L"PROGRAMFILES"); + return get_ProgramFiles(); } const fs::path& get_ProgramFiles_32_bit() @@ -256,7 +269,7 @@ namespace vcpkg::Environment return *program_files_W6432; } - return *System::get_environmental_variable(L"PROGRAMFILES"); + return get_ProgramFiles(); } const fs::path& get_ProgramFiles_platform_bitness() From beb1250fe486cfdd11ee003cb9a2d7faeb4bf9da Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 24 Feb 2017 15:02:10 -0800 Subject: [PATCH 451/561] Improve functions that detect ProgramFiles in CMake --- scripts/cmake/vcpkg_get_program_files_32_bit.cmake | 11 +++++++---- .../vcpkg_get_program_files_platform_bitness.cmake | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/scripts/cmake/vcpkg_get_program_files_32_bit.cmake b/scripts/cmake/vcpkg_get_program_files_32_bit.cmake index 386e59c759..6f43454739 100644 --- a/scripts/cmake/vcpkg_get_program_files_32_bit.cmake +++ b/scripts/cmake/vcpkg_get_program_files_32_bit.cmake @@ -1,7 +1,10 @@ function(vcpkg_get_program_files_32_bit ret) - if(DEFINED ENV{ProgramFiles\(X86\)}) - set(${ret} $ENV{ProgramFiles\(X86\)} PARENT_SCOPE) - else() - set(${ret} $ENV{PROGRAMFILES} PARENT_SCOPE) + + set(ret_temp $ENV{ProgramFiles\(X86\)}) + if (NOT DEFINED ret_temp) + set(ret_temp $ENV{PROGRAMFILES}) endif() + + set(${ret} ${ret_temp} PARENT_SCOPE) + endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake b/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake index 44fba4d628..ed51b74010 100644 --- a/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake +++ b/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake @@ -1,7 +1,10 @@ function(vcpkg_get_program_files_platform_bitness ret) - if(DEFINED ENV{ProgramW6432}) - set(${ret} $ENV{ProgramW6432} PARENT_SCOPE) - else() - set(${ret} $ENV{PROGRAMFILES} PARENT_SCOPE) + + set(ret_temp $ENV{ProgramW6432}) + if (NOT DEFINED ret_temp) + set(ret_temp $ENV{PROGRAMFILES}) endif() + + set(${ret} ${ret_temp} PARENT_SCOPE) + endfunction() \ No newline at end of file From 8f89f41a065902222b1d349fcdf307c2223ba094 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 24 Feb 2017 15:17:18 -0800 Subject: [PATCH 452/561] Inline variables --- scripts/getWindowsSDK.ps1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/getWindowsSDK.ps1 b/scripts/getWindowsSDK.ps1 index 650e0b4edc..7aeb532b58 100644 --- a/scripts/getWindowsSDK.ps1 +++ b/scripts/getWindowsSDK.ps1 @@ -4,9 +4,7 @@ param( ) $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition -$programFiles32 = & $scriptsDir\getProgramFiles32bit.ps1 -$programFilesP = & $scriptsDir\getProgramFilesPlatformBitness.ps1 -$CandidateProgramFiles = $programFiles32, $programFilesP +$CandidateProgramFiles = $(& $scriptsDir\getProgramFiles32bit.ps1), $(& $scriptsDir\getProgramFilesPlatformBitness.ps1) # Windows 10 SDK foreach ($ProgramFiles in $CandidateProgramFiles) From df4d385d3d88c3b4fdd46d9e9f580b5d902accbd Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 24 Feb 2017 15:57:41 -0800 Subject: [PATCH 453/561] [qt5] Further reduce regressions. Fix issue where generated cmake points at the wrong tools folder. --- ports/qt5/CONTROL | 2 +- ports/qt5/portfile.cmake | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index f42021c540..cd49d30ab3 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 -Version: 5.7.1-4 +Version: 5.7.1-5 Description: Qt5 application framework main components. Webengine, examples and tests not included. Build-Depends: sqlite3, libpq, double-conversion diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 33a1182d1f..bbb171fd53 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -71,13 +71,12 @@ vcpkg_execute_required_process( -no-style-windowsvista -no-style-fusion -mp - -nomake examples -nomake tests - # Doesn't work: only -skip webengine - -skip webengine -skip connectivity -skip declarative + -nomake examples -nomake tests -no-compile-examples + -skip webengine -skip declarative -qt-sql-sqlite -qt-sql-psql -prefix ${CURRENT_PACKAGES_DIR} -bindir ${CURRENT_PACKAGES_DIR}/bin - -hostbindir ${CURRENT_PACKAGES_DIR}/tools + -hostbindir ${CURRENT_PACKAGES_DIR}/tools/qt5 -archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5 -datadir ${CURRENT_PACKAGES_DIR}/share/qt5 -plugindir ${CURRENT_PACKAGES_DIR}/plugins From c81edf75928e01d11bbffbec3ec549e903c37fef Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 24 Feb 2017 16:11:48 -0800 Subject: [PATCH 454/561] Rewrite MSBuild detection Add -Verbose messages. Look for VS2015 in Program files as well as registry --- .../findAnyMSBuildWithCppPlatformToolset.ps1 | 181 +++++++++++++----- 1 file changed, 137 insertions(+), 44 deletions(-) diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index 72155b4f5d..6ee368a54f 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -7,63 +7,156 @@ param( [switch]$DisableVS2015 = $False ) +if ($DisableVS2017 -and $DisableVS2015) +{ + throw "Both VS2015 and VS2017 were disabled." +} + +function New-MSBuildInstance() +{ + param ($msbuildExePath, $toolsetVersion) + + $instance = new-object PSObject + $instance | add-member -type NoteProperty -Name msbuildExePath -Value $msbuildExePath + $instance | add-member -type NoteProperty -Name toolsetVersion -Value $toolsetVersion + + return $instance +} + +Write-Verbose "Executing $($MyInvocation.MyCommand.Name) with DisableVS2017=$DisableVS2017, DisableVS2015=$DisableVS2015" $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition -if (-not $DisableVS2017) -{ - # VS2017 - $VisualStudio2017InstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 - foreach ($instance in $VisualStudio2017InstallationInstances) - { - $VCFolder= "$instance\VC\Tools\MSVC\" +$validInstances = New-Object System.Collections.ArrayList - if (Test-Path $VCFolder) - { - return "$instance\MSBuild\15.0\Bin\MSBuild.exe","v141" - } +# VS2017 +Write-Verbose "`n`n" +Write-Verbose "Checking for MSBuild from VS2017 instances..." +$VisualStudio2017InstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 +Write-Verbose "VS2017 Candidates: $([system.String]::Join(',', $VisualStudio2017InstallationInstances))" +foreach ($instanceCandidate in $VisualStudio2017InstallationInstances) +{ + $VCFolder= "$instanceCandidate\VC\Tools\MSVC\" + + if (Test-Path $VCFolder) + { + $instance = New-MSBuildInstance "$instanceCandidate\MSBuild\15.0\Bin\MSBuild.exe" "v141" + Write-Verbose "Found $instance" + $validInstances.Add($instance) > $null } } -if (-not $DisableVS2015) +# VS2015 - in Program Files +Write-Verbose "`n`n" +Write-Verbose "Checking for MSBuild from VS2015 in Program Files..." +$CandidateProgramFiles = $(& $scriptsDir\getProgramFiles32bit.ps1), $(& $scriptsDir\getProgramFilesPlatformBitness.ps1) +Write-Verbose "Program Files Candidate locations: $([system.String]::Join(',', $CandidateProgramFiles))" +foreach ($ProgramFiles in $CandidateProgramFiles) { - # Try to locate VS2015 through the Registry + $clExe= "$ProgramFiles\Microsoft Visual Studio 14.0\VC\bin\cl.exe" + + if (Test-Path $clExe) + { + $instance = New-MSBuildInstance "$ProgramFiles\MSBuild\14.0\Bin\MSBuild.exe" "v140" + Write-Verbose "Found $instance" + $validInstances.Add($instance) > $null + } +} + +# VS2015 - through the registry +function NewCppRegistryPair() +{ + param ($visualStudioEntry, $msBuildEntry) + + $instance = new-object PSObject + $instance | add-member -type NoteProperty -Name visualStudioEntry -Value $visualStudioEntry + $instance | add-member -type NoteProperty -Name msBuildEntry -Value $msBuildEntry + + return $instance +} + +Write-Verbose "`n`n" +Write-Verbose "Checking for MSBuild from VS2015 through the registry..." + +$registryPairs = +$(NewCppRegistryPair "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0" "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\msbuild\toolsversions\14.0"), +$(NewCppRegistryPair "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0" "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0") + +foreach ($pair in $registryPairs) +{ + $vsEntry = $pair.visualStudioEntry + Write-Verbose "$vsEntry - Checking" try { - # First ensure the compiler was installed (optional in 2015) - # In 64-bit systems, this is under the Wow6432Node. - try - { - $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % { $_.InstallDir }) - Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0 - Found" - } - catch - { - $VS14InstallDir = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 InstallDir -erroraction Stop | % { $_.InstallDir }) - Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0 - Found" - } - if (!(Test-Path "${VS14InstallDir}..\..\VC\bin\cl.exe")) { throw } - Write-Verbose "${VS14InstallDir}..\..\VC\bin\cl.exe - Found" - - - try - { - $MSBuild14 = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\msbuild\toolsversions\14.0 MSBuildToolsPath -erroraction Stop | % { $_.MSBuildToolsPath }) - Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\msbuild\toolsversions\14.0 - Found" - } - catch - { - $MSBuild14 = $(gp Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 MSBuildToolsPath -erroraction Stop | % { $_.MSBuildToolsPath }) - Write-Verbose "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0 - Found" - } - if (!(Test-Path "${MSBuild14}MSBuild.exe")) { throw } - Write-Verbose "${MSBuild14}MSBuild.exe - Found" - - return "${MSBuild14}MSBuild.exe","v140" + $VS14InstallDir = $(gp $vsEntry InstallDir -erroraction Stop | % { $_.InstallDir }) + Write-Verbose "$vsEntry - Found" } catch { - Write-Verbose "Unable to locate a VS2015 installation with C++ support" + Write-Verbose "$vsEntry - Not Found" + continue + } + + Write-Verbose "$VS14InstallDir - Obtained from registry" + # We want "${VS14InstallDir}..\..\VC\bin\cl.exe" + # Doing Split-path to avoid the ..\.. from appearing in the output + $clExePath = Split-path $VS14InstallDir -Parent + $clExePath = Split-path $clExePath -Parent + $clExePath = "$clExePath\VC\bin\cl.exe" + + if (!(Test-Path $clExePath)) + { + Write-Verbose "$clExePath - Not Found" + continue + } + + Write-Verbose "$clExePath - Found" + + $msbuildEntry = $pair.msBuildEntry + Write-Verbose "$msbuildEntry - Checking" + try + { + $MSBuild14 = $(gp $msbuildEntry MSBuildToolsPath -erroraction Stop | % { $_.MSBuildToolsPath }) + Write-Verbose "$msbuildEntry - Found" + } + catch + { + Write-Verbose "$msbuildEntry - Not Found" + continue + } + + Write-Verbose "${MSBuild14} - Obtained from registry" + $msbuildPath = "${MSBuild14}MSBuild.exe" + if (!(Test-Path $msbuildPath)) + { + Write-Verbose "$msbuildPath - Not Found" + continue + } + + $instance = New-MSBuildInstance $msbuildPath "v140" + Write-Verbose "Found $instance" + $validInstances.Add($instance) > $null +} + +Write-Verbose "`n`n`n" +Write-Verbose "The following MSBuild instances were found:" +foreach ($instance in $validInstances) +{ + Write-Verbose $instance +} + +# Selecting +foreach ($instance in $validInstances) +{ + if (!$DisableVS2017 -and $instance.toolsetVersion -eq "v141") + { + return $instance.msbuildExePath, $instance.toolsetVersion + } + + if (!$DisableVS2015 -and $instance.toolsetVersion -eq "v140") + { + return $instance.msbuildExePath, $instance.toolsetVersion } } + throw "Could not find MSBuild version with C++ support. VS2015 or VS2017 (with C++) needs to be installed." \ No newline at end of file From 789f26c741b1a02d4fc2a6ed5a3910b2853f6e3a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 24 Feb 2017 16:27:53 -0800 Subject: [PATCH 455/561] Rewrite WindowsSDK detection --- scripts/getWindowsSDK.ps1 | 65 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/scripts/getWindowsSDK.ps1 b/scripts/getWindowsSDK.ps1 index 7aeb532b58..cc21886532 100644 --- a/scripts/getWindowsSDK.ps1 +++ b/scripts/getWindowsSDK.ps1 @@ -1,39 +1,96 @@ [CmdletBinding()] param( + [Parameter(Mandatory=$False)] + [switch]$DisableWin10SDK = $False, + [Parameter(Mandatory=$False)] + [switch]$DisableWin81SDK = $False ) +if ($DisableWin10SDK -and $DisableWin81SDK) +{ + throw "Both Win10SDK and Win81SDK were disabled." +} + +Write-Verbose "Executing $($MyInvocation.MyCommand.Name)" $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition + +$validInstances = New-Object System.Collections.ArrayList + $CandidateProgramFiles = $(& $scriptsDir\getProgramFiles32bit.ps1), $(& $scriptsDir\getProgramFilesPlatformBitness.ps1) +Write-Verbose "Program Files Candidate locations: $([system.String]::Join(',', $CandidateProgramFiles))" # Windows 10 SDK +Write-Verbose "`n" +Write-Verbose "Looking for Windows 10 SDK" foreach ($ProgramFiles in $CandidateProgramFiles) { $folder = "$ProgramFiles\Windows Kits\10\Include" + Write-Verbose "$folder - Checking" if (!(Test-Path $folder)) { + Write-Verbose "$folder - Not Found" continue } + Write-Verbose "$folder - Found" $win10sdkVersions = @(Get-ChildItem $folder | Where-Object {$_.Name -match "^10"} | Sort-Object) [array]::Reverse($win10sdkVersions) # Newest SDK first foreach ($win10sdkV in $win10sdkVersions) { - if (Test-Path "$folder\$win10sdkV\um\windows.h") + $windowsheader = "$folder\$win10sdkV\um\windows.h" + Write-Verbose "$windowsheader - Checking" + if (!(Test-Path $windowsheader)) { - return $win10sdkV.ToString() + Write-Verbose "$windowsheader - Not Found" + continue } + + Write-Verbose "$windowsheader - Found" + $win10sdkVersionString = $win10sdkV.ToString() + Write-Verbose "Found $win10sdkVersionString" + $validInstances.Add($win10sdkVersionString) > $null } } # Windows 8.1 SDK +Write-Verbose "`n" +Write-Verbose "Looking for Windows 8.1 SDK" foreach ($ProgramFiles in $CandidateProgramFiles) { $folder = "$ProgramFiles\Windows Kits\8.1\Include" - if (Test-Path $folder) + Write-Verbose "$folder - Checking" + if (!(Test-Path $folder)) { - return "8.1" + Write-Verbose "$folder - Not Found" + continue + } + + Write-Verbose "$folder - Found" + $win81sdkVersionString = "8.1" + Write-Verbose "Found $win81sdkVersionString" + $validInstances.Add($win81sdkVersionString) > $null +} + +Write-Verbose "`n`n`n" +Write-Verbose "The following Windows SDKs were found:" +foreach ($instance in $validInstances) +{ + Write-Verbose $instance +} + +# Selecting +foreach ($instance in $validInstances) +{ + if (!$DisableWin10SDK -and $instance -match "10.") + { + return $instance + } + + if (!$DisableWin81SDK -and $instance -match "8.1") + { + return $instance } } From 58002f62392f15a42a8b30352aa007bbd82e74a9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 24 Feb 2017 16:36:10 -0800 Subject: [PATCH 456/561] Tweak -Verbose messages --- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 14 ++++++++------ scripts/getWindowsSDK.ps1 | 3 --- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index 6ee368a54f..f1ef1ae6b3 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -54,12 +54,16 @@ foreach ($ProgramFiles in $CandidateProgramFiles) { $clExe= "$ProgramFiles\Microsoft Visual Studio 14.0\VC\bin\cl.exe" - if (Test-Path $clExe) + if (!(Test-Path $clExe)) { - $instance = New-MSBuildInstance "$ProgramFiles\MSBuild\14.0\Bin\MSBuild.exe" "v140" - Write-Verbose "Found $instance" - $validInstances.Add($instance) > $null + Write-Verbose "$clExe - Not Found" + continue } + + Write-Verbose "$clExe - Found" + $instance = New-MSBuildInstance "$ProgramFiles\MSBuild\14.0\Bin\MSBuild.exe" "v140" + Write-Verbose "Found $instance" + $validInstances.Add($instance) > $null } # VS2015 - through the registry @@ -84,7 +88,6 @@ $(NewCppRegistryPair "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstud foreach ($pair in $registryPairs) { $vsEntry = $pair.visualStudioEntry - Write-Verbose "$vsEntry - Checking" try { $VS14InstallDir = $(gp $vsEntry InstallDir -erroraction Stop | % { $_.InstallDir }) @@ -112,7 +115,6 @@ foreach ($pair in $registryPairs) Write-Verbose "$clExePath - Found" $msbuildEntry = $pair.msBuildEntry - Write-Verbose "$msbuildEntry - Checking" try { $MSBuild14 = $(gp $msbuildEntry MSBuildToolsPath -erroraction Stop | % { $_.MSBuildToolsPath }) diff --git a/scripts/getWindowsSDK.ps1 b/scripts/getWindowsSDK.ps1 index cc21886532..90ca1b06bd 100644 --- a/scripts/getWindowsSDK.ps1 +++ b/scripts/getWindowsSDK.ps1 @@ -26,7 +26,6 @@ Write-Verbose "Looking for Windows 10 SDK" foreach ($ProgramFiles in $CandidateProgramFiles) { $folder = "$ProgramFiles\Windows Kits\10\Include" - Write-Verbose "$folder - Checking" if (!(Test-Path $folder)) { Write-Verbose "$folder - Not Found" @@ -40,7 +39,6 @@ foreach ($ProgramFiles in $CandidateProgramFiles) foreach ($win10sdkV in $win10sdkVersions) { $windowsheader = "$folder\$win10sdkV\um\windows.h" - Write-Verbose "$windowsheader - Checking" if (!(Test-Path $windowsheader)) { Write-Verbose "$windowsheader - Not Found" @@ -60,7 +58,6 @@ Write-Verbose "Looking for Windows 8.1 SDK" foreach ($ProgramFiles in $CandidateProgramFiles) { $folder = "$ProgramFiles\Windows Kits\8.1\Include" - Write-Verbose "$folder - Checking" if (!(Test-Path $folder)) { Write-Verbose "$folder - Not Found" From ec02f5bb264af821369fd6de9028758ae12447f1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 24 Feb 2017 17:27:12 -0800 Subject: [PATCH 457/561] [opengl] Add branch for Windows 8.1 SDK --- ports/opengl/CONTROL | 2 +- ports/opengl/portfile.cmake | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ports/opengl/CONTROL b/ports/opengl/CONTROL index db748df59a..e2db823cf4 100644 --- a/ports/opengl/CONTROL +++ b/ports/opengl/CONTROL @@ -1,3 +1,3 @@ Source: opengl -Version: 0.0-2 +Version: 0.0-3 Description: Open Graphics Library (OpenGL)[3][4][5] is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. \ No newline at end of file diff --git a/ports/opengl/portfile.cmake b/ports/opengl/portfile.cmake index cc27570e6f..2af9e6e3ba 100644 --- a/ports/opengl/portfile.cmake +++ b/ports/opengl/portfile.cmake @@ -7,11 +7,13 @@ if (WINDOWS_SDK MATCHES "10.") set(OPENGLPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Lib\\${WINDOWS_SDK}\\um\\${TRIPLET_SYSTEM_ARCH}\\OpenGL32.Lib") set(LICENSEPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Licenses\\${WINDOWS_SDK}\\sdk_license.rtf") set(HEADERSPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\10\\Include\\${WINDOWS_SDK}\\um") +elseif(WINDOWS_SDK MATCHES "8.") + set(OPENGLPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\${TRIPLET_SYSTEM_ARCH}\\OpenGL32.Lib") + set(HEADERSPATH "${PROGRAM_FILES_32_BIT}\\Windows Kits\\8.1\\Include\\um") else() message(FATAL_ERROR "Portfile not yet configured for Windows SDK with version: ${WINDOWS_SDK}") endif() - if (NOT EXISTS "${OPENGLPATH}") message(FATAL_ERROR "Cannot find Windows ${WINDOWS_SDK} SDK. File does not exist: ${OPENGLPATH}") endif() @@ -30,5 +32,10 @@ file(COPY ) file(COPY ${OPENGLPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) file(COPY ${OPENGLPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(COPY ${LICENSEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/opengl) -file(WRITE ${CURRENT_PACKAGES_DIR}/share/opengl/copyright "See the accompanying sdk_license.rtf") + +if (DEFINED LICENSEPATH) + file(COPY ${LICENSEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/opengl) + file(WRITE ${CURRENT_PACKAGES_DIR}/share/opengl/copyright "See the accompanying sdk_license.rtf") +else() + file(WRITE ${CURRENT_PACKAGES_DIR}/share/opengl/copyright "See https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk for the Windows 8.1 SDK license") +endif() \ No newline at end of file From 533c60fcca8ed6580ddf6d32b254efd4ec68ffc3 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 25 Feb 2017 15:25:20 +0100 Subject: [PATCH 458/561] [libflac] update to 1.3.2 --- ports/libflac/CMakeLists.txt | 3 ++- ports/libflac/portfile.cmake | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ports/libflac/CMakeLists.txt b/ports/libflac/CMakeLists.txt index afe55f55e9..978de28897 100644 --- a/ports/libflac/CMakeLists.txt +++ b/ports/libflac/CMakeLists.txt @@ -26,13 +26,14 @@ if(LIBFLAC_ARCHITECTURE MATCHES x86) add_definitions(-DFLAC__CPU_IA32) elseif(LIBFLAC_ARCHITECTURE MATCHES x64) add_definitions(-DFLAC__CPU_X86_64) + add_definitions(-DENABLE_64_BIT_WORDS) endif() if(CMAKE_BUILD_TYPE MATCHES Debug) add_definitions(-DFLAC__OVERFLOW_DETECT) endif() -add_definitions(-DVERSION="1.3.1") +add_definitions(-DPACKAGE_VERSION="1.3.2") add_definitions(-DFLAC__HAS_OGG) add_definitions(-DFLAC__ALIGN_MALLOC_DATA) # 32 byte boundary add_definitions(-D_CRT_SECURE_NO_WARNINGS) diff --git a/ports/libflac/portfile.cmake b/ports/libflac/portfile.cmake index 4ed496fb88..4bf66bfdf5 100644 --- a/ports/libflac/portfile.cmake +++ b/ports/libflac/portfile.cmake @@ -1,14 +1,14 @@ # libFLAC uses winapi functions not available in WindowsStore -if (VCPKG_TARGET_ARCHITECTURE STREQUAL arm OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) +if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) message(FATAL_ERROR "Error: UWP builds are currently not supported.") endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/flac-1.3.1) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/flac-1.3.2) vcpkg_download_distfile(ARCHIVE - URLS "http://downloads.xiph.org/releases/flac/flac-1.3.1.tar.xz" - FILENAME "flac-1.3.1.tar.xz" - SHA512 923cd0ffe2155636febf2b4633791bc83370d57080461b97ebb69ea21a4b1be7c0ff376c7fc8ca3979af4714e761112114a24b49ff6c80228b58b929db6e96d5) + URLS "http://downloads.xiph.org/releases/flac/flac-1.3.2.tar.xz" + FILENAME "flac-1.3.2.tar.xz" + SHA512 63910e8ebbe508316d446ffc9eb6d02efbd5f47d29d2ea7864da9371843c8e671854db6e89ba043fe08aef1845b8ece70db80f1cce853f591ca30d56ef7c3a15) vcpkg_extract_source_archive(${ARCHIVE}) @@ -16,17 +16,18 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DLIBFLAC_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE} - OPTIONS_DEBUG - -DLIBFLAC_SKIP_HEADERS=ON) + PREFER_NINJA + OPTIONS + -DLIBFLAC_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE} + OPTIONS_DEBUG + -DLIBFLAC_SKIP_HEADERS=ON) vcpkg_install_cmake() vcpkg_copy_pdbs() if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(APPEND ${CURRENT_PACKAGES_DIR}/include/FLAC/export.h "#undef FLAC_API\n#define FLAC_API\n") - file(APPEND ${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h "#undef FLAC_API\n#define FLAC_API\n") + file(APPEND ${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h "#undef FLACPP_API\n#define FLACPP_API\n") endif() # This license (BSD) is relevant only for library - if someone would want to install From 099df5267ed1832c62c87a4cbddf2c9ef876190e Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 25 Feb 2017 15:28:48 +0100 Subject: [PATCH 459/561] [libflac] bum version in CONTROL file --- ports/libflac/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/libflac/CONTROL b/ports/libflac/CONTROL index 9b1a37531b..555cfc492a 100644 --- a/ports/libflac/CONTROL +++ b/ports/libflac/CONTROL @@ -1,4 +1,4 @@ Source: libflac -Version: 1.3.1-1 +Version: 1.3.2 Description: Library for manipulating FLAC files Build-Depends: libogg From 058c8a825e04f8ce90ee2865cf11813f6ad2a37e Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 25 Feb 2017 15:46:19 +0100 Subject: [PATCH 460/561] [lz4] update to 1.7.5 --- ports/lz4/CONTROL | 2 +- ports/lz4/portfile.cmake | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ports/lz4/CONTROL b/ports/lz4/CONTROL index 90be24a5b3..b48ba54241 100644 --- a/ports/lz4/CONTROL +++ b/ports/lz4/CONTROL @@ -1,3 +1,3 @@ Source: lz4 -Version: 1.7.4.2 +Version: 1.7.5 Description: Lossless compression algorithm, providing compression speed at 400 MB/s per core. diff --git a/ports/lz4/portfile.cmake b/ports/lz4/portfile.cmake index 9e2153e4b5..dc6f80ed92 100644 --- a/ports/lz4/portfile.cmake +++ b/ports/lz4/portfile.cmake @@ -1,10 +1,10 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lz4-1.7.4.2) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lz4-1.7.5) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/lz4/lz4/archive/v1.7.4.2.zip" - FILENAME "lz4-1.7.4.2.zip" - SHA512 c9a65031225ccda43ad4c7622e9f36762c18e58b4aaf43b1a33f219186fb55c43ca354f574a1591188db39f57631351b1b90f96e0c150e28de08dcb65c6759d0) + URLS "https://github.com/lz4/lz4/archive/v1.7.5.zip" + FILENAME "lz4-1.7.5.zip" + SHA512 09968b67a5cd8555f6e1d95b99971a82d228c6d8d9f9dd9e9a33c9633bed9bcf1e370c2ff44e58c6ca72d103c149585b3e83061c690f3e857eb5f53d586f86a4) vcpkg_extract_source_archive(${ARCHIVE}) @@ -12,6 +12,7 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA OPTIONS_DEBUG -DLZ4_SKIP_INCLUDES=ON) From 39a59a82a9079de94fef416898930ee76ff28dc2 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 25 Feb 2017 15:55:57 +0100 Subject: [PATCH 461/561] [liblzma] update to 5.2.3 --- ports/liblzma/CONTROL | 2 +- ports/liblzma/portfile.cmake | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ports/liblzma/CONTROL b/ports/liblzma/CONTROL index 648316130f..754d767bca 100644 --- a/ports/liblzma/CONTROL +++ b/ports/liblzma/CONTROL @@ -1,3 +1,3 @@ Source: liblzma -Version: 5.2.2 +Version: 5.2.3 Description: Compression library with an API similar to that of zlib. diff --git a/ports/liblzma/portfile.cmake b/ports/liblzma/portfile.cmake index bb2b6e0836..6185815f43 100644 --- a/ports/liblzma/portfile.cmake +++ b/ports/liblzma/portfile.cmake @@ -1,10 +1,10 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/xz-5.2.2) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/xz-5.2.3) vcpkg_download_distfile(ARCHIVE - URLS "http://tukaani.org/xz/xz-5.2.2.tar.gz" - FILENAME "xz-5.2.2.tar.gz" - SHA512 8d6249f93c5c43e1c8eeb21f93b22330fd54575e20bbb4af3d06721192d9f0ca3351878964c9640238ac410b7dd9f16329793c7be7355c7ca0db92c6db6ab813) + URLS "http://tukaani.org/xz/xz-5.2.3.tar.gz" + FILENAME "xz-5.2.3.tar.gz" + SHA512 a5eb4f707cf31579d166a6f95dbac45cf7ea181036d1632b4f123a4072f502f8d57cd6e7d0588f0bf831a07b8fc4065d26589a25c399b95ddcf5f73435163da6) vcpkg_extract_source_archive(${ARCHIVE}) @@ -12,6 +12,7 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA OPTIONS_DEBUG -DLIBLZMA_SKIP_HEADERS=ON) From 59a70d372915336b8da0a133f0876d1fa5b6f852 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 25 Feb 2017 16:52:57 +0100 Subject: [PATCH 462/561] [spdlog] update to 0.12.0 --- ports/spdlog/CONTROL | 3 ++- ports/spdlog/portfile.cmake | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ports/spdlog/CONTROL b/ports/spdlog/CONTROL index dea187f2e2..e4e9a7fc34 100644 --- a/ports/spdlog/CONTROL +++ b/ports/spdlog/CONTROL @@ -1,3 +1,4 @@ Source: spdlog -Version: 0.11.0 +Version: 0.12.0 Description: Very fast, header only, C++ logging library +Build-Depends: fmt diff --git a/ports/spdlog/portfile.cmake b/ports/spdlog/portfile.cmake index f8a4c61fff..2354a0be73 100644 --- a/ports/spdlog/portfile.cmake +++ b/ports/spdlog/portfile.cmake @@ -1,15 +1,18 @@ #header-only library include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/spdlog-0.11.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/spdlog-0.12.0) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/gabime/spdlog/archive/v0.11.0.zip" - FILENAME "v0.11.0.zip" - SHA512 4e759b8a18d0e3f256d974920260ebb6c6792885651290637a8a7210731e1d24a6f662d7dc7d3ae165a78c6e738229bd4b6922f36df26581bf43c8bca7c90314 + URLS "https://github.com/gabime/spdlog/archive/v0.12.0.zip" + FILENAME "v0.12.0.zip" + SHA512 2ef251bf4496b3a17ca055f8ee087864b95eb1eb50d43cbe675bdb6f7cb2e5386460c222f4ed9b95d0f21fdb811f43e3b6a1cfaa45523760ff6125a329d8a02a ) vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DSPDLOG_BUILD_TESTING=OFF ) vcpkg_install_cmake() @@ -23,6 +26,12 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/spdlog/ ${CURRENT_PACKAGES_DIR}/sh file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +# use vcpkg-provided fmt library +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/spdlog/fmt/bundled) +file(READ ${CURRENT_PACKAGES_DIR}/include/spdlog/tweakme.h SPDLOG_TWEAKME_CONTENTS) +string(REPLACE "// #define SPDLOG_FMT_EXTERNAL" "#define SPDLOG_FMT_EXTERNAL" SPDLOG_TWEAKME_CONTENTS ${SPDLOG_TWEAKME_CONTENTS}) +file(WRITE ${CURRENT_PACKAGES_DIR}/include/spdlog/tweakme.h ${SPDLOG_TWEAKME_CONTENTS}) + # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/spdlog) file(RENAME ${CURRENT_PACKAGES_DIR}/share/spdlog/LICENSE ${CURRENT_PACKAGES_DIR}/share/spdlog/copyright) From b4fa5bca114b30df6086467297cee79a0b6b0826 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sat, 25 Feb 2017 16:57:03 +0100 Subject: [PATCH 463/561] [spdlog] fix indentation --- ports/spdlog/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/spdlog/portfile.cmake b/ports/spdlog/portfile.cmake index 2354a0be73..230695a52a 100644 --- a/ports/spdlog/portfile.cmake +++ b/ports/spdlog/portfile.cmake @@ -10,7 +10,7 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA + PREFER_NINJA OPTIONS -DSPDLOG_BUILD_TESTING=OFF ) From 1b0fd3880fd3795b70235029c0c218cefff158db Mon Sep 17 00:00:00 2001 From: ab Date: Mon, 27 Feb 2017 10:17:59 +0100 Subject: [PATCH 464/561] Adding pugixml version 1.8.1 --- ports/pugixml/CONTROL | 3 +++ ports/pugixml/portfile.cmake | 28 ++++++++++++++++++++++++++++ ports/pugixml/pugixmlapi.patch | 13 +++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 ports/pugixml/CONTROL create mode 100644 ports/pugixml/portfile.cmake create mode 100644 ports/pugixml/pugixmlapi.patch diff --git a/ports/pugixml/CONTROL b/ports/pugixml/CONTROL new file mode 100644 index 0000000000..298d433b29 --- /dev/null +++ b/ports/pugixml/CONTROL @@ -0,0 +1,3 @@ +Source: pugixml +Version: 1.8.1 +Description: C++ XML processing library diff --git a/ports/pugixml/portfile.cmake b/ports/pugixml/portfile.cmake new file mode 100644 index 0000000000..4fcbec84ba --- /dev/null +++ b/ports/pugixml/portfile.cmake @@ -0,0 +1,28 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pugixml-1.8) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/zeux/pugixml/releases/download/v1.8.1/pugixml-1.8.1.zip" + FILENAME "pugixml-1.8.1.zip" + SHA512 683fe224a9bcac032d78cb44d03915a3766d2faa588f3a8486b5719f26eeba3e17d447edf70e1907f51f8649ffb4607b6badd1365e4c15cf24279bf577dc853e +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/pugixmlapi.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_DEFINES="PUGIXML_API=__declspec\(dllexport\)" +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(INSTALL ${SOURCE_PATH}/readme.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/pugixml RENAME copyright) \ No newline at end of file diff --git a/ports/pugixml/pugixmlapi.patch b/ports/pugixml/pugixmlapi.patch new file mode 100644 index 0000000000..177664dbe0 --- /dev/null +++ b/ports/pugixml/pugixmlapi.patch @@ -0,0 +1,13 @@ +diff --git a/src/pugixml.hpp b/src/pugixml.hpp +index 4d76bfa..75a4f8a 100644 +--- a/src/pugixml.hpp ++++ b/src/pugixml.hpp +@@ -50,7 +50,7 @@ + + // If no API is defined, assume default + #ifndef PUGIXML_API +-# define PUGIXML_API ++# define PUGIXML_API __declspec(dllimport) + #endif + + // If no API for classes is defined, assume default From d63b6ce27539602270953403a4dc3f36cd614b07 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 27 Feb 2017 14:05:04 -0800 Subject: [PATCH 465/561] Update CHANGELOG and bump version to v0.0.75 --- CHANGELOG.md | 31 +++++++++++++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41253f7811..69d024caa2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,34 @@ +vcpkg (0.0.75) +-------------- + * Add ports: + - dlib 19.2 + - gtk 3.22.8 + - pqp 1.3 + - pugixml 1.8.1 + * Update ports: + - clockutils 1.1.1 -> 1.1.1-3651f232c27074c4ceead169e223edf5f00247c5 + - grpc 1.1.0-dev-1674f65-2 -> 1.1.2-1 + - libflac 1.3.1-1 -> 1.3.2 + - liblzma 5.2.2 -> 5.2.3 + - libmysql 5.7.17 -> 5.7.17-1 + - lz4 1.7.4.2 -> 1.7.5 + - mongo-cxx-driver 3.0.3 -> 3.0.3-1 + - nana 1.4.1 -> 1.4.1-66be23c9204c5567d1c51e6f57ba23bffa517a7c + - opengl 10.0.10240.0 -> 0.0-3 + - protobuf 3.0.2 -> 3.2.0 + - qt5 5.7.1-2 -> 5.7.1-5 + - spdlog 0.11.0 -> 0.12.0 + * Numerous improvements in Visual Studio, MSBuild and Windows SDK auto-detection + * `vcpkg integrate install` now outputs the specific toolchain file to use for CMake integration + * All commands now checks for `--options` and will issue an error on unknown options. + - Previously only commands with options would do this (for example `vcpkg remove --purge `) and commands with no options would ignore them, for example `vcpkg install --purge ` + * Update version of the automatically acquired JOM, python + - Also, for python: automatically acquire the 32-bit versions instead of the 64-bit ones + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team MON, 27 Feb 2017 14:00:00 -0800 + + vcpkg (0.0.74) -------------- * Bump required version & auto-downloaded version of `cmake` to 3.8.0 (was 3.7.x). This fixes UWP builds with Visual Studio 2017 diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 723643136e..2afbd0edd3 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.74" \ No newline at end of file +"0.0.75" \ No newline at end of file From eb07291f0c504d56e6def13cd730bd210f5e4c1e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 27 Feb 2017 14:59:56 -0800 Subject: [PATCH 466/561] Enclose cpp file into namespace --- toolsrc/src/vcpkglib.cpp | 391 +++++++++++++++++++-------------------- 1 file changed, 194 insertions(+), 197 deletions(-) diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkglib.cpp index 78918e62cc..0c71a4d88d 100644 --- a/toolsrc/src/vcpkglib.cpp +++ b/toolsrc/src/vcpkglib.cpp @@ -4,235 +4,232 @@ #include "Paragraphs.h" #include "metrics.h" -using namespace vcpkg; - -static StatusParagraphs load_current_database(const fs::path& vcpkg_dir_status_file, const fs::path& vcpkg_dir_status_file_old) +namespace vcpkg { - if (!fs::exists(vcpkg_dir_status_file)) + static StatusParagraphs load_current_database(const fs::path& vcpkg_dir_status_file, const fs::path& vcpkg_dir_status_file_old) { - if (!fs::exists(vcpkg_dir_status_file_old)) + if (!fs::exists(vcpkg_dir_status_file)) { - // no status file, use empty db - return StatusParagraphs(); + if (!fs::exists(vcpkg_dir_status_file_old)) + { + // no status file, use empty db + return StatusParagraphs(); + } + + fs::rename(vcpkg_dir_status_file_old, vcpkg_dir_status_file); } - fs::rename(vcpkg_dir_status_file_old, vcpkg_dir_status_file); + auto text = Files::read_contents(vcpkg_dir_status_file).get_or_throw(); + auto pghs = Paragraphs::parse_paragraphs(text); + + std::vector> status_pghs; + for (auto&& p : pghs) + { + status_pghs.push_back(std::make_unique(p)); + } + + return StatusParagraphs(std::move(status_pghs)); } - auto text = Files::read_contents(vcpkg_dir_status_file).get_or_throw(); - auto pghs = Paragraphs::parse_paragraphs(text); - - std::vector> status_pghs; - for (auto&& p : pghs) + StatusParagraphs database_load_check(const vcpkg_paths& paths) { - status_pghs.push_back(std::make_unique(p)); - } + auto updates_dir = paths.vcpkg_dir_updates; - return StatusParagraphs(std::move(status_pghs)); -} + std::error_code ec; + fs::create_directory(paths.installed, ec); + fs::create_directory(paths.vcpkg_dir, ec); + fs::create_directory(paths.vcpkg_dir_info, ec); + fs::create_directory(updates_dir, ec); -StatusParagraphs vcpkg::database_load_check(const vcpkg_paths& paths) -{ - auto updates_dir = paths.vcpkg_dir_updates; + const fs::path& status_file = paths.vcpkg_dir_status_file; + const fs::path status_file_old = status_file.parent_path() / "status-old"; + const fs::path status_file_new = status_file.parent_path() / "status-new"; - std::error_code ec; - fs::create_directory(paths.installed, ec); - fs::create_directory(paths.vcpkg_dir, ec); - fs::create_directory(paths.vcpkg_dir_info, ec); - fs::create_directory(updates_dir, ec); + StatusParagraphs current_status_db = load_current_database(status_file, status_file_old); - const fs::path& status_file = paths.vcpkg_dir_status_file; - const fs::path status_file_old = status_file.parent_path() / "status-old"; - const fs::path status_file_new = status_file.parent_path() / "status-new"; + auto b = fs::directory_iterator(updates_dir); + auto e = fs::directory_iterator(); + if (b == e) + { + // updates directory is empty, control file is up-to-date. + return current_status_db; + } - StatusParagraphs current_status_db = load_current_database(status_file, status_file_old); + for (; b != e; ++b) + { + if (!fs::is_regular_file(b->status())) + continue; + if (b->path().filename() == "incomplete") + continue; + + auto text = Files::read_contents(b->path()).get_or_throw(); + auto pghs = Paragraphs::parse_paragraphs(text); + for (auto&& p : pghs) + { + current_status_db.insert(std::make_unique(p)); + } + } + + std::fstream(status_file_new, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc) << current_status_db; + + if (fs::exists(status_file_old)) + fs::remove(status_file_old); + if (fs::exists(status_file)) + fs::rename(status_file, status_file_old); + fs::rename(status_file_new, status_file); + fs::remove(status_file_old); + + b = fs::directory_iterator(updates_dir); + for (; b != e; ++b) + { + if (!fs::is_regular_file(b->status())) + continue; + fs::remove(b->path()); + } - auto b = fs::directory_iterator(updates_dir); - auto e = fs::directory_iterator(); - if (b == e) - { - // updates directory is empty, control file is up-to-date. return current_status_db; } - for (; b != e; ++b) + void write_update(const vcpkg_paths& paths, const StatusParagraph& p) { - if (!fs::is_regular_file(b->status())) - continue; - if (b->path().filename() == "incomplete") - continue; + static int update_id = 0; + auto my_update_id = update_id++; + auto tmp_update_filename = paths.vcpkg_dir_updates / "incomplete"; + auto update_filename = paths.vcpkg_dir_updates / std::to_string(my_update_id); + std::fstream fs(tmp_update_filename, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); + fs << p; + fs.close(); + fs::rename(tmp_update_filename, update_filename); + } - auto text = Files::read_contents(b->path()).get_or_throw(); - auto pghs = Paragraphs::parse_paragraphs(text); - for (auto&& p : pghs) + static void upgrade_to_slash_terminated_sorted_format(std::vector* lines, const fs::path& listfile_path) + { + static bool was_tracked = false; + + if (lines->empty()) { - current_status_db.insert(std::make_unique(p)); - } - } - - std::fstream(status_file_new, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc) << current_status_db; - - if (fs::exists(status_file_old)) - fs::remove(status_file_old); - if (fs::exists(status_file)) - fs::rename(status_file, status_file_old); - fs::rename(status_file_new, status_file); - fs::remove(status_file_old); - - b = fs::directory_iterator(updates_dir); - for (; b != e; ++b) - { - if (!fs::is_regular_file(b->status())) - continue; - fs::remove(b->path()); - } - - return current_status_db; -} - -void vcpkg::write_update(const vcpkg_paths& paths, const StatusParagraph& p) -{ - static int update_id = 0; - auto my_update_id = update_id++; - auto tmp_update_filename = paths.vcpkg_dir_updates / "incomplete"; - auto update_filename = paths.vcpkg_dir_updates / std::to_string(my_update_id); - std::fstream fs(tmp_update_filename, std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); - fs << p; - fs.close(); - fs::rename(tmp_update_filename, update_filename); -} - -static void upgrade_to_slash_terminated_sorted_format(std::vector* lines, const fs::path& listfile_path) -{ - static bool was_tracked = false; - - if (lines->empty()) - { - return; - } - - if (lines->at(0).back() == '/') - { - return; // File already in the new format - } - - if (!was_tracked) - { - was_tracked = true; - TrackProperty("listfile", "update to new format"); - } - - // The files are sorted such that directories are placed just before the files they contain - // (They are not necessarily sorted alphabetically, e.g. libflac) - // Therefore we can detect the entries that represent directories by comparing every element with the next one - // and checking if the next has a slash immediately after the current one's length - for (size_t i = 0; i < lines->size() - 1; i++) - { - std::string& current_string = lines->at(i); - const std::string& next_string = lines->at(i + 1); - - const size_t potential_slash_char_index = current_string.length(); - // Make sure the index exists first - if (next_string.size() > potential_slash_char_index && next_string.at(potential_slash_char_index) == '/') - { - current_string += '/'; // Mark as a directory - } - } - - // After suffixing the directories with a slash, we can now sort. - // We cannot sort before adding the suffixes because the following (actual example): - /* - x86-windows/include/FLAC <<<<<< This would be separated from its group due to sorting - x86-windows/include/FLAC/all.h - x86-windows/include/FLAC/assert.h - x86-windows/include/FLAC/callback.h - x86-windows/include/FLAC++ - x86-windows/include/FLAC++/all.h - x86-windows/include/FLAC++/decoder.h - x86-windows/include/FLAC++/encoder.h - * - x86-windows/include/FLAC/ <<<<<< This will now be kept with its group when sorting - x86-windows/include/FLAC/all.h - x86-windows/include/FLAC/assert.h - x86-windows/include/FLAC/callback.h - x86-windows/include/FLAC++/ - x86-windows/include/FLAC++/all.h - x86-windows/include/FLAC++/decoder.h - x86-windows/include/FLAC++/encoder.h - */ - // Note that after sorting, the FLAC++/ group will be placed before the FLAC/ group - // The new format is lexicographically sorted - std::sort(lines->begin(), lines->end()); - - // Replace the listfile on disk - const fs::path updated_listfile_path = listfile_path.generic_string() + "_updated"; - Files::write_all_lines(updated_listfile_path, *lines); - fs::rename(updated_listfile_path, listfile_path); -} - -std::vector vcpkg::get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db) -{ - std::vector installed_files; - - for (const std::unique_ptr& pgh : status_db) - { - if (pgh->state != install_state_t::installed) - { - continue; + return; } - const fs::path listfile_path = paths.listfile_path(pgh->package); - std::vector installed_files_of_current_pgh = Files::read_all_lines(listfile_path).get_or_throw(); - Strings::trim_all_and_remove_whitespace_strings(&installed_files_of_current_pgh); - upgrade_to_slash_terminated_sorted_format(&installed_files_of_current_pgh, listfile_path); + if (lines->at(0).back() == '/') + { + return; // File already in the new format + } - // Remove the directories - installed_files_of_current_pgh.erase( - std::remove_if(installed_files_of_current_pgh.begin(), installed_files_of_current_pgh.end(), [](const std::string& file) -> bool - { - return file.back() == '/'; - } - ), installed_files_of_current_pgh.end()); + if (!was_tracked) + { + was_tracked = true; + TrackProperty("listfile", "update to new format"); + } - StatusParagraph_and_associated_files pgh_and_files = {*pgh, ImmutableSortedVector::create(std::move(installed_files_of_current_pgh))}; - installed_files.push_back(std::move(pgh_and_files)); + // The files are sorted such that directories are placed just before the files they contain + // (They are not necessarily sorted alphabetically, e.g. libflac) + // Therefore we can detect the entries that represent directories by comparing every element with the next one + // and checking if the next has a slash immediately after the current one's length + for (size_t i = 0; i < lines->size() - 1; i++) + { + std::string& current_string = lines->at(i); + const std::string& next_string = lines->at(i + 1); + + const size_t potential_slash_char_index = current_string.length(); + // Make sure the index exists first + if (next_string.size() > potential_slash_char_index && next_string.at(potential_slash_char_index) == '/') + { + current_string += '/'; // Mark as a directory + } + } + + // After suffixing the directories with a slash, we can now sort. + // We cannot sort before adding the suffixes because the following (actual example): + /* + x86-windows/include/FLAC <<<<<< This would be separated from its group due to sorting + x86-windows/include/FLAC/all.h + x86-windows/include/FLAC/assert.h + x86-windows/include/FLAC/callback.h + x86-windows/include/FLAC++ + x86-windows/include/FLAC++/all.h + x86-windows/include/FLAC++/decoder.h + x86-windows/include/FLAC++/encoder.h + * + x86-windows/include/FLAC/ <<<<<< This will now be kept with its group when sorting + x86-windows/include/FLAC/all.h + x86-windows/include/FLAC/assert.h + x86-windows/include/FLAC/callback.h + x86-windows/include/FLAC++/ + x86-windows/include/FLAC++/all.h + x86-windows/include/FLAC++/decoder.h + x86-windows/include/FLAC++/encoder.h + */ + // Note that after sorting, the FLAC++/ group will be placed before the FLAC/ group + // The new format is lexicographically sorted + std::sort(lines->begin(), lines->end()); + + // Replace the listfile on disk + const fs::path updated_listfile_path = listfile_path.generic_string() + "_updated"; + Files::write_all_lines(updated_listfile_path, *lines); + fs::rename(updated_listfile_path, listfile_path); } - return installed_files; -} + std::vector get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db) + { + std::vector installed_files; -expected vcpkg::try_load_port(const fs::path& path) -{ - try - { - auto pghs = Paragraphs::get_paragraphs(path / "CONTROL"); - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s\\CONTROL", path.string()); - return SourceParagraph(pghs[0]); - } - catch (std::runtime_error const&) - { + for (const std::unique_ptr& pgh : status_db) + { + if (pgh->state != install_state_t::installed) + { + continue; + } + + const fs::path listfile_path = paths.listfile_path(pgh->package); + std::vector installed_files_of_current_pgh = Files::read_all_lines(listfile_path).get_or_throw(); + Strings::trim_all_and_remove_whitespace_strings(&installed_files_of_current_pgh); + upgrade_to_slash_terminated_sorted_format(&installed_files_of_current_pgh, listfile_path); + + // Remove the directories + installed_files_of_current_pgh.erase( + std::remove_if(installed_files_of_current_pgh.begin(), installed_files_of_current_pgh.end(), [](const std::string& file) -> bool + { + return file.back() == '/'; + } + ), installed_files_of_current_pgh.end()); + + StatusParagraph_and_associated_files pgh_and_files = { *pgh, ImmutableSortedVector::create(std::move(installed_files_of_current_pgh)) }; + installed_files.push_back(std::move(pgh_and_files)); + } + + return installed_files; } - return std::errc::no_such_file_or_directory; -} - -expected vcpkg::try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec) -{ - const fs::path path = paths.package_dir(spec) / "CONTROL"; - - auto control_contents_maybe = Files::read_contents(path); - if (auto control_contents = control_contents_maybe.get()) + expected try_load_port(const fs::path& path) { - std::vector> pghs; try { - pghs = Paragraphs::parse_paragraphs(*control_contents); + auto pghs = Paragraphs::get_paragraphs(path / "CONTROL"); + Checks::check_exit(pghs.size() == 1, "Invalid control file at %s\\CONTROL", path.string()); + return SourceParagraph(pghs[0]); } - catch (std::runtime_error) - { - } - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", path.string()); - return BinaryParagraph(pghs[0]); + catch (std::runtime_error const&) { } + + return std::errc::no_such_file_or_directory; + } + + expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec) + { + const fs::path path = paths.package_dir(spec) / "CONTROL"; + + auto control_contents_maybe = Files::read_contents(path); + if (auto control_contents = control_contents_maybe.get()) + { + std::vector> pghs; + try + { + pghs = Paragraphs::parse_paragraphs(*control_contents); + } + catch (std::runtime_error) { } + Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", path.string()); + return BinaryParagraph(pghs[0]); + } + return control_contents_maybe.error_code(); } - return control_contents_maybe.error_code(); } From 33952d2dd29208b0a28d3e058e33222ef454f04d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 27 Feb 2017 15:13:13 -0800 Subject: [PATCH 467/561] Introduce function: load_all_ports() --- toolsrc/include/vcpkglib.h | 2 ++ toolsrc/src/commands_search.cpp | 27 ++------------------------- toolsrc/src/vcpkglib.cpp | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/toolsrc/include/vcpkglib.h b/toolsrc/include/vcpkglib.h index 50635589a2..69cde7ea20 100644 --- a/toolsrc/include/vcpkglib.h +++ b/toolsrc/include/vcpkglib.h @@ -23,4 +23,6 @@ namespace vcpkg expected try_load_port(const fs::path& control_path); expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec); + + std::vector load_all_ports(const fs::path& ports_dir); } // namespace vcpkg diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index 56485ac02a..c5f2210c8a 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -4,6 +4,7 @@ #include "Paragraphs.h" #include "vcpkglib_helpers.h" #include "SourceParagraph.h" +#include "vcpkglib.h" namespace vcpkg::Commands::Search { @@ -44,30 +45,6 @@ namespace vcpkg::Commands::Search return s; } - static std::vector read_all_source_paragraphs(const vcpkg_paths& paths) - { - std::vector output; - for (auto it = fs::directory_iterator(paths.ports); it != fs::directory_iterator(); ++it) - { - const fs::path& path = it->path(); - - try - { - auto pghs = Paragraphs::get_paragraphs(path / "CONTROL"); - if (pghs.empty()) - { - continue; - } - - auto srcpgh = SourceParagraph(pghs[0]); - output.push_back(srcpgh); - } - catch (std::runtime_error const&) { } - } - - return output; - } - static void do_print(const SourceParagraph& source_paragraph) { System::println("%-20s %-16s %s", @@ -83,7 +60,7 @@ namespace vcpkg::Commands::Search args.check_max_arg_count(1, example); const std::unordered_set options = args.check_and_get_optional_command_arguments({ OPTION_GRAPH }); - const std::vector source_paragraphs = read_all_source_paragraphs(paths); + const std::vector source_paragraphs = load_all_ports(paths.ports); if (options.find(OPTION_GRAPH) != options.cend()) { const std::string graph_as_string = create_graph_as_string(source_paragraphs); diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkglib.cpp index 0c71a4d88d..d3356d68df 100644 --- a/toolsrc/src/vcpkglib.cpp +++ b/toolsrc/src/vcpkglib.cpp @@ -232,4 +232,24 @@ namespace vcpkg } return control_contents_maybe.error_code(); } + + std::vector load_all_ports(const fs::path& ports_dir) + { + std::vector output; + for (auto it = fs::directory_iterator(ports_dir); it != fs::directory_iterator(); ++it) + { + const fs::path& path = it->path(); + expected source_paragraph = try_load_port(path); + if (auto srcpgh = source_paragraph.get()) + { + output.emplace_back(*srcpgh); + } + else + { + Checks::exit_with_message("Error loading port from %s: %s", path.generic_string(), source_paragraph.error_code().message()); + } + } + + return output; + } } From 7e12f5599d77d8610a28b3493c55eb49de6fb132 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 27 Feb 2017 15:32:43 -0800 Subject: [PATCH 468/561] Use std::move to avoid a copy --- toolsrc/src/vcpkglib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkglib.cpp index d3356d68df..d453f1dc9f 100644 --- a/toolsrc/src/vcpkglib.cpp +++ b/toolsrc/src/vcpkglib.cpp @@ -242,7 +242,7 @@ namespace vcpkg expected source_paragraph = try_load_port(path); if (auto srcpgh = source_paragraph.get()) { - output.emplace_back(*srcpgh); + output.emplace_back(std::move(*srcpgh)); } else { From 00737588cc6155776734c5a5261c9b08f9446eb4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 27 Feb 2017 15:40:06 -0800 Subject: [PATCH 469/561] Use load_all_ports() in `portsdiff` --- toolsrc/src/commands_portsdiff.cpp | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 119997485c..2edb3fb3f1 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -2,9 +2,9 @@ #include "vcpkg_Commands.h" #include "vcpkg_System.h" #include "vcpkg_Maps.h" -#include "Paragraphs.h" #include "SourceParagraph.h" #include "vcpkg_Environment.h" +#include "vcpkglib.h" namespace vcpkg::Commands::PortsDiff { @@ -40,25 +40,14 @@ namespace vcpkg::Commands::PortsDiff } } - static std::map read_all_ports(const fs::path& ports_folder_path) + static std::map read_port_names_and_versions(const fs::path& ports_folder_path) { std::map names_and_versions; - for (auto it = fs::directory_iterator(ports_folder_path); it != fs::directory_iterator(); ++it) + std::vector ports = load_all_ports(ports_folder_path); + for (SourceParagraph& port : ports) { - const fs::path& path = it->path(); - - try - { - auto pghs = Paragraphs::get_paragraphs(path / "CONTROL"); - if (pghs.empty()) - continue; - auto srcpgh = SourceParagraph(pghs[0]); - names_and_versions.emplace(srcpgh.name, srcpgh.version); - } - catch (std::runtime_error const&) - { - } + names_and_versions.emplace(std::move(port.name), std::move(port.version)); } return names_and_versions; @@ -79,7 +68,7 @@ namespace vcpkg::Commands::PortsDiff checkout_this_dir, L".vcpkg-root"); System::cmd_execute(cmd); - std::map names_and_versions = read_all_ports(temp_checkout_path / ports_dir_name_as_string); + std::map names_and_versions = read_port_names_and_versions(temp_checkout_path / ports_dir_name_as_string); fs::remove_all(temp_checkout_path); return names_and_versions; } From c0ae9fee7e30cdd4898df22aecf5412b2d8f8ee6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 27 Feb 2017 15:45:56 -0800 Subject: [PATCH 470/561] Move some functions from vcpkglib.h to Paragraphs.h --- toolsrc/include/Paragraphs.h | 9 +++++ toolsrc/include/vcpkglib.h | 8 ----- toolsrc/src/Paragraphs.cpp | 56 ++++++++++++++++++++++++++++-- toolsrc/src/commands_build.cpp | 3 +- toolsrc/src/commands_ci.cpp | 3 +- toolsrc/src/commands_install.cpp | 3 +- toolsrc/src/commands_portsdiff.cpp | 4 +-- toolsrc/src/commands_search.cpp | 3 +- toolsrc/src/vcpkg_Dependencies.cpp | 6 ++-- toolsrc/src/vcpkglib.cpp | 52 --------------------------- 10 files changed, 74 insertions(+), 73 deletions(-) diff --git a/toolsrc/include/Paragraphs.h b/toolsrc/include/Paragraphs.h index 761b497590..9564d2290b 100644 --- a/toolsrc/include/Paragraphs.h +++ b/toolsrc/include/Paragraphs.h @@ -2,9 +2,18 @@ #include "filesystem_fs.h" #include +#include "expected.h" +#include "BinaryParagraph.h" +#include "vcpkg_paths.h" namespace vcpkg::Paragraphs { std::vector> get_paragraphs(const fs::path& control_path); std::vector> parse_paragraphs(const std::string& str); + + expected try_load_port(const fs::path& control_path); + + expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec); + + std::vector load_all_ports(const fs::path& ports_dir); } diff --git a/toolsrc/include/vcpkglib.h b/toolsrc/include/vcpkglib.h index 69cde7ea20..1ce55bd8ac 100644 --- a/toolsrc/include/vcpkglib.h +++ b/toolsrc/include/vcpkglib.h @@ -1,7 +1,5 @@ #pragma once -#include "package_spec.h" -#include "BinaryParagraph.h" #include "StatusParagraphs.h" #include "vcpkg_paths.h" #include "ImmutableSortedVector.h" @@ -19,10 +17,4 @@ namespace vcpkg }; std::vector get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db); - - expected try_load_port(const fs::path& control_path); - - expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec); - - std::vector load_all_ports(const fs::path& ports_dir); } // namespace vcpkg diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp index 0c41e0b5c3..fdb583bcca 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/Paragraphs.cpp @@ -6,9 +6,7 @@ namespace vcpkg::Paragraphs { struct Parser { - Parser(const char* c, const char* e) : cur(c), end(e) - { - } + Parser(const char* c, const char* e) : cur(c), end(e) { } private: const char* cur; @@ -167,4 +165,56 @@ namespace vcpkg::Paragraphs { return Parser(str.c_str(), str.c_str() + str.size()).get_paragraphs(); } + + expected try_load_port(const fs::path& path) + { + try + { + auto pghs = get_paragraphs(path / "CONTROL"); + Checks::check_exit(pghs.size() == 1, "Invalid control file at %s\\CONTROL", path.string()); + return SourceParagraph(pghs[0]); + } + catch (std::runtime_error const&) {} + + return std::errc::no_such_file_or_directory; + } + + expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec) + { + const fs::path path = paths.package_dir(spec) / "CONTROL"; + + auto control_contents_maybe = Files::read_contents(path); + if (auto control_contents = control_contents_maybe.get()) + { + std::vector> pghs; + try + { + pghs = parse_paragraphs(*control_contents); + } + catch (std::runtime_error) {} + Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", path.string()); + return BinaryParagraph(pghs[0]); + } + return control_contents_maybe.error_code(); + } + + std::vector load_all_ports(const fs::path& ports_dir) + { + std::vector output; + for (auto it = fs::directory_iterator(ports_dir); it != fs::directory_iterator(); ++it) + { + const fs::path& path = it->path(); + expected source_paragraph = try_load_port(path); + if (auto srcpgh = source_paragraph.get()) + { + output.emplace_back(std::move(*srcpgh)); + } + else + { + Checks::exit_with_message("Error loading port from %s: %s", path.generic_string(), source_paragraph.error_code().message()); + } + } + + return output; + } } diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 98f0cbbb0e..310a9c8295 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -9,6 +9,7 @@ #include "vcpkg_Environment.h" #include "metrics.h" #include "vcpkg_Enums.h" +#include "PostBuildLint_BuildInfo.h" namespace vcpkg::Commands::Build { @@ -127,7 +128,7 @@ namespace vcpkg::Commands::Build exit(EXIT_SUCCESS); } - const expected maybe_spgh = try_load_port(port_dir); + const expected maybe_spgh = Paragraphs::try_load_port(port_dir); Checks::check_exit(!maybe_spgh.error_code(), "Could not find package named %s: %s", spec, maybe_spgh.error_code().message()); const SourceParagraph& spgh = *maybe_spgh.get(); diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index db37db1236..d75d4b787a 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -7,6 +7,7 @@ #include "vcpkg_Dependencies.h" #include "vcpkg_Input.h" #include "vcpkg_Chrono.h" +#include "PostBuildLint_BuildInfo.h" namespace vcpkg::Commands::CI { @@ -70,7 +71,7 @@ namespace vcpkg::Commands::CI System::println(System::color::error, Build::create_error_message(result, action.spec)); continue; } - const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); + const BinaryParagraph bpgh = Paragraphs::try_load_cached_package(paths, action.spec).get_or_throw(); Install::install_package(paths, bpgh, &status_db); System::println(System::color::success, "Package %s is installed", action.spec); } diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 4ae311f836..283de87857 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -7,6 +7,7 @@ #include "vcpkg_System.h" #include "vcpkg_Dependencies.h" #include "vcpkg_Input.h" +#include "PostBuildLint_BuildInfo.h" namespace vcpkg::Commands::Install { @@ -224,7 +225,7 @@ namespace vcpkg::Commands::Install System::println(Build::create_user_troubleshooting_message(action.spec)); exit(EXIT_FAILURE); } - const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw(); + const BinaryParagraph bpgh = Paragraphs::try_load_cached_package(paths, action.spec).get_or_throw(); install_package(paths, bpgh, &status_db); System::println(System::color::success, "Package %s is installed", action.spec); } diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 2edb3fb3f1..a927f145da 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -4,7 +4,7 @@ #include "vcpkg_Maps.h" #include "SourceParagraph.h" #include "vcpkg_Environment.h" -#include "vcpkglib.h" +#include "PostBuildLint_BuildInfo.h" namespace vcpkg::Commands::PortsDiff { @@ -44,7 +44,7 @@ namespace vcpkg::Commands::PortsDiff { std::map names_and_versions; - std::vector ports = load_all_ports(ports_folder_path); + std::vector ports = Paragraphs::load_all_ports(ports_folder_path); for (SourceParagraph& port : ports) { names_and_versions.emplace(std::move(port.name), std::move(port.version)); diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp index c5f2210c8a..8bac858f14 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/commands_search.cpp @@ -4,7 +4,6 @@ #include "Paragraphs.h" #include "vcpkglib_helpers.h" #include "SourceParagraph.h" -#include "vcpkglib.h" namespace vcpkg::Commands::Search { @@ -60,7 +59,7 @@ namespace vcpkg::Commands::Search args.check_max_arg_count(1, example); const std::unordered_set options = args.check_and_get_optional_command_arguments({ OPTION_GRAPH }); - const std::vector source_paragraphs = load_all_ports(paths.ports); + const std::vector source_paragraphs = Paragraphs::load_all_ports(paths.ports); if (options.find(OPTION_GRAPH) != options.cend()) { const std::string graph_as_string = create_graph_as_string(source_paragraphs); diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index b255cc77b6..e9c88523e3 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -5,7 +5,7 @@ #include "package_spec.h" #include "StatusParagraphs.h" #include "vcpkg_Files.h" -#include "vcpkglib.h" +#include "PostBuildLint_BuildInfo.h" namespace vcpkg::Dependencies { @@ -72,7 +72,7 @@ namespace vcpkg::Dependencies continue; } - expected maybe_bpgh = try_load_cached_package(paths, spec); + expected maybe_bpgh = Paragraphs::try_load_cached_package(paths, spec); if (BinaryParagraph* bpgh = maybe_bpgh.get()) { process_dependencies(bpgh->depends); @@ -80,7 +80,7 @@ namespace vcpkg::Dependencies continue; } - expected maybe_spgh = try_load_port(paths.port_dir(spec)); + expected maybe_spgh = Paragraphs::try_load_port(paths.port_dir(spec)); SourceParagraph* spgh = maybe_spgh.get(); Checks::check_exit(spgh != nullptr, "Cannot find package %s", spec.name()); process_dependencies(filter_dependencies(spgh->depends, spec.target_triplet())); diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkglib.cpp index d453f1dc9f..2415372db3 100644 --- a/toolsrc/src/vcpkglib.cpp +++ b/toolsrc/src/vcpkglib.cpp @@ -200,56 +200,4 @@ namespace vcpkg return installed_files; } - - expected try_load_port(const fs::path& path) - { - try - { - auto pghs = Paragraphs::get_paragraphs(path / "CONTROL"); - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s\\CONTROL", path.string()); - return SourceParagraph(pghs[0]); - } - catch (std::runtime_error const&) { } - - return std::errc::no_such_file_or_directory; - } - - expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec) - { - const fs::path path = paths.package_dir(spec) / "CONTROL"; - - auto control_contents_maybe = Files::read_contents(path); - if (auto control_contents = control_contents_maybe.get()) - { - std::vector> pghs; - try - { - pghs = Paragraphs::parse_paragraphs(*control_contents); - } - catch (std::runtime_error) { } - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", path.string()); - return BinaryParagraph(pghs[0]); - } - return control_contents_maybe.error_code(); - } - - std::vector load_all_ports(const fs::path& ports_dir) - { - std::vector output; - for (auto it = fs::directory_iterator(ports_dir); it != fs::directory_iterator(); ++it) - { - const fs::path& path = it->path(); - expected source_paragraph = try_load_port(path); - if (auto srcpgh = source_paragraph.get()) - { - output.emplace_back(std::move(*srcpgh)); - } - else - { - Checks::exit_with_message("Error loading port from %s: %s", path.generic_string(), source_paragraph.error_code().message()); - } - } - - return output; - } } From b7bd8c3251dcb9ecf3f6c0201c2a513596ab09b1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 27 Feb 2017 15:52:57 -0800 Subject: [PATCH 471/561] Fix #include of Paragraph.h --- toolsrc/include/PostBuildLint_BuildInfo.h | 3 +-- toolsrc/src/PostBuildLint_BuildInfo.cpp | 1 + toolsrc/src/commands_build.cpp | 2 +- toolsrc/src/commands_ci.cpp | 1 + toolsrc/src/commands_install.cpp | 2 +- toolsrc/src/commands_portsdiff.cpp | 2 +- toolsrc/src/vcpkg_Dependencies.cpp | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index 7dbadb1478..bac024e017 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -1,7 +1,6 @@ #pragma once -#include -#include "Paragraphs.h" +#include "filesystem_fs.h" #include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" #include "PostBuildLint_LinkageType.h" diff --git a/toolsrc/src/PostBuildLint_BuildInfo.cpp b/toolsrc/src/PostBuildLint_BuildInfo.cpp index 7308c9bac0..0d1d480b8c 100644 --- a/toolsrc/src/PostBuildLint_BuildInfo.cpp +++ b/toolsrc/src/PostBuildLint_BuildInfo.cpp @@ -3,6 +3,7 @@ #include "vcpkg_Checks.h" #include "opt_bool.h" #include "vcpkglib_helpers.h" +#include "Paragraphs.h" namespace vcpkg::PostBuildLint { diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 310a9c8295..e51d519f8c 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -9,7 +9,7 @@ #include "vcpkg_Environment.h" #include "metrics.h" #include "vcpkg_Enums.h" -#include "PostBuildLint_BuildInfo.h" +#include "Paragraphs.h" namespace vcpkg::Commands::Build { diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index d75d4b787a..a1a0f053de 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -8,6 +8,7 @@ #include "vcpkg_Input.h" #include "vcpkg_Chrono.h" #include "PostBuildLint_BuildInfo.h" +#include "Paragraphs.h" namespace vcpkg::Commands::CI { diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 283de87857..24fa5edc0b 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -7,7 +7,7 @@ #include "vcpkg_System.h" #include "vcpkg_Dependencies.h" #include "vcpkg_Input.h" -#include "PostBuildLint_BuildInfo.h" +#include "Paragraphs.h" namespace vcpkg::Commands::Install { diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index a927f145da..06a1f6c60e 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -4,7 +4,7 @@ #include "vcpkg_Maps.h" #include "SourceParagraph.h" #include "vcpkg_Environment.h" -#include "PostBuildLint_BuildInfo.h" +#include "Paragraphs.h" namespace vcpkg::Commands::PortsDiff { diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index e9c88523e3..e8bf10617f 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -5,7 +5,7 @@ #include "package_spec.h" #include "StatusParagraphs.h" #include "vcpkg_Files.h" -#include "PostBuildLint_BuildInfo.h" +#include "Paragraphs.h" namespace vcpkg::Dependencies { From 54859c0f1f201dfcc78e783c77c3b477d0c86c92 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 27 Feb 2017 16:14:36 -0800 Subject: [PATCH 472/561] Introduce extract_port_names_and_versions() --- toolsrc/include/Paragraphs.h | 4 +++- toolsrc/src/Paragraphs.cpp | 11 +++++++++++ toolsrc/src/commands_portsdiff.cpp | 16 ++-------------- toolsrc/src/commands_update.cpp | 21 ++------------------- 4 files changed, 18 insertions(+), 34 deletions(-) diff --git a/toolsrc/include/Paragraphs.h b/toolsrc/include/Paragraphs.h index 9564d2290b..79b66a67f7 100644 --- a/toolsrc/include/Paragraphs.h +++ b/toolsrc/include/Paragraphs.h @@ -1,7 +1,7 @@ #pragma once #include "filesystem_fs.h" -#include +#include #include "expected.h" #include "BinaryParagraph.h" #include "vcpkg_paths.h" @@ -16,4 +16,6 @@ namespace vcpkg::Paragraphs expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec); std::vector load_all_ports(const fs::path& ports_dir); + + std::map extract_port_names_and_versions(const std::vector& source_paragraphs); } diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp index fdb583bcca..1d8106750c 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/Paragraphs.cpp @@ -217,4 +217,15 @@ namespace vcpkg::Paragraphs return output; } + + std::map extract_port_names_and_versions(const std::vector& source_paragraphs) + { + std::map names_and_versions; + for (const SourceParagraph& port : source_paragraphs) + { + names_and_versions.emplace(port.name, port.version); + } + + return names_and_versions; + } } diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 06a1f6c60e..ff17a7086a 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -40,19 +40,6 @@ namespace vcpkg::Commands::PortsDiff } } - static std::map read_port_names_and_versions(const fs::path& ports_folder_path) - { - std::map names_and_versions; - - std::vector ports = Paragraphs::load_all_ports(ports_folder_path); - for (SourceParagraph& port : ports) - { - names_and_versions.emplace(std::move(port.name), std::move(port.version)); - } - - return names_and_versions; - } - static std::map read_ports_from_commit(const vcpkg_paths& paths, const std::wstring& git_commit_id) { const fs::path dot_git_dir = paths.root / ".git"; @@ -68,7 +55,8 @@ namespace vcpkg::Commands::PortsDiff checkout_this_dir, L".vcpkg-root"); System::cmd_execute(cmd); - std::map names_and_versions = read_port_names_and_versions(temp_checkout_path / ports_dir_name_as_string); + const std::vector source_paragraphs = Paragraphs::load_all_ports(temp_checkout_path / ports_dir_name_as_string); + const std::map names_and_versions = Paragraphs::extract_port_names_and_versions(source_paragraphs); fs::remove_all(temp_checkout_path); return names_and_versions; } diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index d4519ca141..8131d9a73c 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -15,25 +15,8 @@ namespace vcpkg::Commands::Update auto status_db = database_load_check(paths); - std::unordered_map src_names_to_versions; - - auto begin_it = fs::directory_iterator(paths.ports); - auto end_it = fs::directory_iterator(); - for (; begin_it != end_it; ++begin_it) - { - const auto& path = begin_it->path(); - try - { - auto pghs = Paragraphs::get_paragraphs(path / "CONTROL"); - if (pghs.empty()) - continue; - auto srcpgh = SourceParagraph(pghs[0]); - src_names_to_versions.emplace(srcpgh.name, srcpgh.version); - } - catch (std::runtime_error const&) - { - } - } + const std::vector source_paragraphs = Paragraphs::load_all_ports(paths.ports); + const std::map src_names_to_versions = Paragraphs::extract_port_names_and_versions(source_paragraphs); std::string packages_list; From f75177b64bd2d0d964469d94cded33ad890b28f0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 27 Feb 2017 16:58:53 -0800 Subject: [PATCH 473/561] Use load_all_ports() in `ci` --- toolsrc/src/commands_ci.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index a1a0f053de..2b7ba89d69 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -7,7 +7,6 @@ #include "vcpkg_Dependencies.h" #include "vcpkg_Input.h" #include "vcpkg_Chrono.h" -#include "PostBuildLint_BuildInfo.h" #include "Paragraphs.h" namespace vcpkg::Commands::CI @@ -16,18 +15,13 @@ namespace vcpkg::Commands::CI using Dependencies::install_plan_type; using Build::BuildResult; - static std::vector load_all_package_specs(const fs::path& directory, const triplet& target_triplet) + static std::vector load_all_package_specs(const fs::path& ports_directory, const triplet& target_triplet) { - std::vector port_folders; - Files::non_recursive_find_matching_paths_in_dir(directory, [](const fs::path& current) - { - return fs::is_directory(current); - }, &port_folders); - + std::vector ports = Paragraphs::load_all_ports(ports_directory); std::vector specs; - for (const fs::path& p : port_folders) + for (const SourceParagraph& p : ports) { - specs.push_back(package_spec::from_name_and_triplet(p.filename().generic_string(), target_triplet).get_or_throw()); + specs.push_back(package_spec::from_name_and_triplet(p.name, target_triplet).get_or_throw()); } return specs; From 2d3fa9d7f4f101be62e5ff54885982e8f49ac099 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 27 Feb 2017 17:53:24 -0800 Subject: [PATCH 474/561] Remove unnecessary branch --- toolsrc/src/commands_portsdiff.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index ff17a7086a..400689b47c 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -26,11 +26,6 @@ namespace vcpkg::Commands::PortsDiff { for (const std::string& name : ports_to_print) { - if (name == "") - { - continue; - } - const std::string& previous_version = previous_names_and_versions.at(name); const std::string& current_version = current_names_and_versions.at(name); std::cout << std::left From 20c92a800ff3e89641abff80b7b5ef828e43b0c6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 27 Feb 2017 23:23:23 -0800 Subject: [PATCH 475/561] [szip] Change default component to match build type --- ports/szip/CONTROL | 2 +- ports/szip/default-component-shared.patch | 37 +++++++++++++++++++++++ ports/szip/portfile.cmake | 1 + 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 ports/szip/default-component-shared.patch diff --git a/ports/szip/CONTROL b/ports/szip/CONTROL index cabcb582b0..acc3648106 100644 --- a/ports/szip/CONTROL +++ b/ports/szip/CONTROL @@ -1,3 +1,3 @@ Source: szip -Version: 2.1 +Version: 2.1-1 Description: Szip compression software, providing lossless compression of scientific data diff --git a/ports/szip/default-component-shared.patch b/ports/szip/default-component-shared.patch new file mode 100644 index 0000000000..3db94c5032 --- /dev/null +++ b/ports/szip/default-component-shared.patch @@ -0,0 +1,37 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d4163a0..4e2a312 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -267,6 +267,14 @@ set (SZIP_VERSION_MAJOR ${SZIP_PACKAGE_VERSION_MAJOR}) + set (SZIP_VERSION_MINOR ${SZIP_PACKAGE_VERSION_MINOR}) + + #----------------------------------------------------------------------------- ++# Set default component ++#----------------------------------------------------------------------------- ++set (SZIP_DEFAULT_COMPONENT static) ++if (BUILD_SHARED_LIBS) ++ set (SZIP_DEFAULT_COMPONENT shared) ++endif () ++ ++#----------------------------------------------------------------------------- + # Configure the szip-config.cmake file for the build directory + #----------------------------------------------------------------------------- + set(INCLUDE_INSTALL_DIR ${SZIP_INSTALL_INCLUDE_DIR} ) +diff --git a/config/cmake/szip-config.cmake.in b/config/cmake/szip-config.cmake.in +index 4a7fec7..ad54287 100644 +--- a/config/cmake/szip-config.cmake.in ++++ b/config/cmake/szip-config.cmake.in +@@ -37,10 +37,10 @@ if (NOT TARGET "@SZIP_PACKAGE@") + include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) + endif () + +-# Handle default component(static) : ++# Handle default component(@SZIP_DEFAULT_COMPONENT@) : + if (NOT ${SZIP_PACKAGE_NAME}_FIND_COMPONENTS) +- set (${SZIP_PACKAGE_NAME}_FIND_COMPONENTS static) +- set (${SZIP_PACKAGE_NAME}_FIND_REQUIRED_static true) ++ set (${SZIP_PACKAGE_NAME}_FIND_COMPONENTS @SZIP_DEFAULT_COMPONENT@) ++ set (${SZIP_PACKAGE_NAME}_FIND_REQUIRED_@SZIP_DEFAULT_COMPONENT@ true) + endif () + + # Handle requested components: diff --git a/ports/szip/portfile.cmake b/ports/szip/portfile.cmake index 06040cedc3..0edee4dc42 100644 --- a/ports/szip/portfile.cmake +++ b/ports/szip/portfile.cmake @@ -25,6 +25,7 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/disable-static-lib-in-shared-build.patch + ${CMAKE_CURRENT_LIST_DIR}/default-component-shared.patch ) vcpkg_configure_cmake( From 601b167610ef53a5f3e9240cd315cdab533aa1f8 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 28 Feb 2017 01:09:04 -0800 Subject: [PATCH 476/561] [hdf5] Update to 1.10, enable disabling of static libs --- ports/hdf5/CONTROL | 2 +- ports/hdf5/disable-static-libs.patch | 90 ++++++++++++++++++++++++++++ ports/hdf5/portfile.cmake | 31 +++++++--- ports/hdf5/use-szip-config.patch | 21 +++++++ 4 files changed, 136 insertions(+), 8 deletions(-) create mode 100644 ports/hdf5/disable-static-libs.patch create mode 100644 ports/hdf5/use-szip-config.patch diff --git a/ports/hdf5/CONTROL b/ports/hdf5/CONTROL index 46049af870..b2364c3783 100644 --- a/ports/hdf5/CONTROL +++ b/ports/hdf5/CONTROL @@ -1,4 +1,4 @@ Source: hdf5 -Version: 1.8.18 +Version: 1.10.0-patch1 Description: HDF5 is a data model, library, and file format for storing and managing data Build-Depends: zlib, szip, msmpi \ No newline at end of file diff --git a/ports/hdf5/disable-static-libs.patch b/ports/hdf5/disable-static-libs.patch new file mode 100644 index 0000000000..4b7b440ec7 --- /dev/null +++ b/ports/hdf5/disable-static-libs.patch @@ -0,0 +1,90 @@ +diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt +index 872e42d..146d0a9 100644 +--- a/hl/src/CMakeLists.txt ++++ b/hl/src/CMakeLists.txt +@@ -29,16 +29,20 @@ set (HL_HEADERS + ${HDF5_HL_SRC_SOURCE_DIR}/hdf5_hl.h + ) + +-add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SRCS} ${HL_HEADERS}) +-TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC " " " ") +-target_link_libraries (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) +-H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC) +-set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES +- FOLDER libraries/hl +- INTERFACE_INCLUDE_DIRECTORIES "$/include>" +-) +-set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") +-set (install_targets ${HDF5_HL_LIB_TARGET}) ++set (install_targets) ++ ++if (NOT DISABLE_STATIC_LIBS) ++ add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SRCS} ${HL_HEADERS}) ++ TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC " " " ") ++ target_link_libraries (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) ++ H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC) ++ set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES ++ FOLDER libraries/hl ++ INTERFACE_INCLUDE_DIRECTORIES "$/include>" ++ ) ++ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") ++ set (install_targets ${install_targets} ${HDF5_HL_LIB_TARGET}) ++endif (NOT DISABLE_STATIC_LIBS) + + if (BUILD_SHARED_LIBS) + add_library (${HDF5_HL_LIBSH_TARGET} SHARED ${HL_SRCS} ${HL_HEADERS}) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index d93612b..a63cc3a 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -851,30 +851,33 @@ add_custom_command ( + #----------------------------------------------------------------------------- + set (gen_SRCS ${HDF5_BINARY_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) + +-add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) +-TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") +-target_link_libraries (${HDF5_LIB_TARGET} ${LINK_LIBS}) +-if (NOT WIN32) ++set (install_targets) ++if (NOT DISABLE_STATIC_LIBS) ++ add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) ++ TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") ++ target_link_libraries (${HDF5_LIB_TARGET} ${LINK_LIBS}) ++ if (NOT WIN32) + target_link_libraries (${HDF5_LIB_TARGET} dl) +-endif (NOT WIN32) +-if (H5_HAVE_PARALLEL AND MPI_C_FOUND) ++ endif (NOT WIN32) ++ if (H5_HAVE_PARALLEL AND MPI_C_FOUND) + target_link_libraries (${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) +-endif (H5_HAVE_PARALLEL AND MPI_C_FOUND) +-set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) +-H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) +-set_target_properties (${HDF5_LIB_TARGET} PROPERTIES +- FOLDER libraries +- INTERFACE_INCLUDE_DIRECTORIES "$/include>" +-) ++ endif (H5_HAVE_PARALLEL AND MPI_C_FOUND) ++ set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) ++ H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) ++ set_target_properties (${HDF5_LIB_TARGET} PROPERTIES ++ FOLDER libraries ++ INTERFACE_INCLUDE_DIRECTORIES "$/include>" ++ ) + +-option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF) +-if (HDF5_ENABLE_DEBUG_APIS) ++ option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF) ++ if (HDF5_ENABLE_DEBUG_APIS) + set_target_properties (${HDF5_LIB_TARGET} PROPERTIES + COMPILE_DEFINITIONS + "H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG" + ) +-endif (HDF5_ENABLE_DEBUG_APIS) +-set (install_targets ${HDF5_LIB_TARGET}) ++ endif (HDF5_ENABLE_DEBUG_APIS) ++ set (install_targets ${install_targets} ${HDF5_LIB_TARGET}) ++endif (NOT DISABLE_STATIC_LIBS) + + if (BUILD_SHARED_LIBS) + file (MAKE_DIRECTORY "${HDF5_BINARY_DIR}/shared") diff --git a/ports/hdf5/portfile.cmake b/ports/hdf5/portfile.cmake index f545434181..6eb8a6b28e 100644 --- a/ports/hdf5/portfile.cmake +++ b/ports/hdf5/portfile.cmake @@ -7,20 +7,40 @@ # include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/hdf5-1.8.18) +# set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/hdf5-1.8.18) +# vcpkg_download_distfile(ARCHIVE +# URLS "https://support.hdfgroup.org/ftp/HDF5/current18/src/hdf5-1.8.18.tar.bz2" +# FILENAME "hdf5-1.8.18.tar.bz2" +# SHA512 01f6d14bdd3be2ced9c63cc9e1820cd7ea11db649ff9f3a3055c18c4b0fffe777fd23baad536e3bce31c4d76fe17db64a3972762e1bb4d232927c1ca140e72b2 +# ) +# vcpkg_extract_source_archive(${ARCHIVE}) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/CMake-hdf5-1.10.0-patch1/hdf5-1.10.0-patch1) vcpkg_download_distfile(ARCHIVE - URLS "https://support.hdfgroup.org/ftp/HDF5/current18/src/hdf5-1.8.18.tar.bz2" - FILENAME "hdf5-1.8.18.tar.bz2" - SHA512 01f6d14bdd3be2ced9c63cc9e1820cd7ea11db649ff9f3a3055c18c4b0fffe777fd23baad536e3bce31c4d76fe17db64a3972762e1bb4d232927c1ca140e72b2 + URLS "http://hdf4.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.0-patch1/src/CMake-hdf5-1.10.0-patch1.zip" + FILENAME "CMake-hdf5-1.10.0-patch1.zip" + SHA512 ec2edb43438661323be5998ecf64c4dd537ddc7451e31f89390260d16883e60a1ccc1bf745bcb809af22f2bf7157d50331a33910b8ebf5c59cd50693dfb2ef8f ) vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/use-szip-config.patch + ${CMAKE_CURRENT_LIST_DIR}/disable-static-libs.patch +) + +set(DISABLE_STATIC_LIBS OFF) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(DISABLE_STATIC_LIBS ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=1 -DBUILD_TESTING=OFF + -DDISABLE_STATIC_LIBS=${DISABLE_STATIC_LIBS} -DHDF5_BUILD_EXAMPLES=OFF -DHDF5_BUILD_TOOLS=OFF -DHDF5_BUILD_CPP_LIB=OFF @@ -30,9 +50,6 @@ vcpkg_configure_cmake( -DHDF5_ENABLE_SZIP_ENCODING=ON -DHDF5_INSTALL_DATA_DIR=share/hdf5/data -DHDF5_INSTALL_CMAKE_DIR=share/hdf5 - "-DSZIP_LIBRARY_DEBUG=${CURRENT_INSTALLED_DIR}\\debug\\lib\\szip_D.lib" - "-DSZIP_LIBRARY_RELEASE=${CURRENT_INSTALLED_DIR}\\lib\\szip.lib" - "-DSZIP_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}\\include" ) vcpkg_install_cmake() diff --git a/ports/hdf5/use-szip-config.patch b/ports/hdf5/use-szip-config.patch new file mode 100644 index 0000000000..d7cd6748b6 --- /dev/null +++ b/ports/hdf5/use-szip-config.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake +index c2b81dc..a86d2d5 100644 +--- a/CMakeFilters.cmake ++++ b/CMakeFilters.cmake +@@ -81,6 +81,16 @@ if (HDF5_ENABLE_SZIP_SUPPORT) + if (NOT SZIP_USE_EXTERNAL) + find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT SZIP_FOUND) ++ find_package (SZIP CONFIG) ++ if (SZIP_FOUND) ++ if (TARGET szip-shared) ++ set(SZIP_LIBRARIES szip-shared) ++ else (TARGET szip-shared) ++ set(SZIP_LIBRARIES szip-static) ++ endif (TARGET szip-shared) ++ endif (SZIP_FOUND) ++ endif (NOT SZIP_FOUND) ++ if (NOT SZIP_FOUND) + find_package (SZIP) # Legacy find + if (SZIP_FOUND) + set (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) From 2c9cf2a520ca704e40f51756497f3bd833d45359 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 28 Feb 2017 01:48:24 -0800 Subject: [PATCH 477/561] [hdf5] Mark linked libraries as private --- ports/hdf5/CONTROL | 2 +- ports/hdf5/link-libraries-private.patch | 29 +++++++++++++++++++++++++ ports/hdf5/portfile.cmake | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 ports/hdf5/link-libraries-private.patch diff --git a/ports/hdf5/CONTROL b/ports/hdf5/CONTROL index b2364c3783..70d1f9979e 100644 --- a/ports/hdf5/CONTROL +++ b/ports/hdf5/CONTROL @@ -1,4 +1,4 @@ Source: hdf5 -Version: 1.10.0-patch1 +Version: 1.10.0-patch1-1 Description: HDF5 is a data model, library, and file format for storing and managing data Build-Depends: zlib, szip, msmpi \ No newline at end of file diff --git a/ports/hdf5/link-libraries-private.patch b/ports/hdf5/link-libraries-private.patch new file mode 100644 index 0000000000..15db78a2d0 --- /dev/null +++ b/ports/hdf5/link-libraries-private.patch @@ -0,0 +1,29 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index a63cc3a..aea963d 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -900,12 +900,12 @@ if (BUILD_SHARED_LIBS) + set (shared_gen_SRCS ${HDF5_BINARY_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c) + add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) + TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") +- target_link_libraries (${HDF5_LIBSH_TARGET} ${LINK_SHARED_LIBS}) ++ target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_SHARED_LIBS}) + if (NOT WIN32) +- target_link_libraries (${HDF5_LIBSH_TARGET} dl) ++ target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE dl) + endif (NOT WIN32) + if (H5_HAVE_PARALLEL AND MPI_C_FOUND) +- target_link_libraries (${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) ++ target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${MPI_C_LIBRARIES}) + endif (H5_HAVE_PARALLEL AND MPI_C_FOUND) + set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}") + H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) +@@ -920,7 +920,7 @@ if (BUILD_SHARED_LIBS) + APPEND PROPERTY COMPILE_DEFINITIONS + "H5_HAVE_THREADSAFE" + ) +- target_link_libraries (${HDF5_LIBSH_TARGET} Threads::Threads) ++ target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE Threads::Threads) + endif (HDF5_ENABLE_THREADSAFE) + + if (HDF5_ENABLE_DEBUG_APIS) diff --git a/ports/hdf5/portfile.cmake b/ports/hdf5/portfile.cmake index 6eb8a6b28e..b2d32a322c 100644 --- a/ports/hdf5/portfile.cmake +++ b/ports/hdf5/portfile.cmake @@ -27,6 +27,7 @@ vcpkg_apply_patches( PATCHES ${CMAKE_CURRENT_LIST_DIR}/use-szip-config.patch ${CMAKE_CURRENT_LIST_DIR}/disable-static-libs.patch + ${CMAKE_CURRENT_LIST_DIR}/link-libraries-private.patch ) set(DISABLE_STATIC_LIBS OFF) From 3cc5cb8bca033f980fa22f8792a12abc4e962df9 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 28 Feb 2017 02:09:59 -0800 Subject: [PATCH 478/561] [netcdf-c] Initial commit of version 4.4.1.1 --- ports/netcdf-c/CONTROL | 4 ++ ports/netcdf-c/config-pkg-location.patch | 15 +++++++ ports/netcdf-c/no-install-deps.patch | 13 ++++++ ports/netcdf-c/portfile.cmake | 52 ++++++++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 ports/netcdf-c/CONTROL create mode 100644 ports/netcdf-c/config-pkg-location.patch create mode 100644 ports/netcdf-c/no-install-deps.patch create mode 100644 ports/netcdf-c/portfile.cmake diff --git a/ports/netcdf-c/CONTROL b/ports/netcdf-c/CONTROL new file mode 100644 index 0000000000..4a9be91325 --- /dev/null +++ b/ports/netcdf-c/CONTROL @@ -0,0 +1,4 @@ +Source: netcdf-c +Version: 4.4.1.1 +Build-Depends: hdf5, curl +Description: a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. diff --git a/ports/netcdf-c/config-pkg-location.patch b/ports/netcdf-c/config-pkg-location.patch new file mode 100644 index 0000000000..532082ccb6 --- /dev/null +++ b/ports/netcdf-c/config-pkg-location.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 46892ee..803ff46 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1742,7 +1742,9 @@ FILE(COPY ${netCDF_SOURCE_DIR}/include/netcdf_meta.h + # Create CMake package configuration files. With these, other packages using + # cmake should be able to find netcdf using find_package and find_library. + # The EXPORT call is paired with one in liblib. +-set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/netCDF) ++if(NOT DEFINED ConfigPackageLocation) ++ set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/netCDF) ++endif(NOT DEFINED ConfigPackageLocation) + + install(EXPORT netCDFTargets + DESTINATION ${ConfigPackageLocation} diff --git a/ports/netcdf-c/no-install-deps.patch b/ports/netcdf-c/no-install-deps.patch new file mode 100644 index 0000000000..3d44b383ec --- /dev/null +++ b/ports/netcdf-c/no-install-deps.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e87f3de..46892ee 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1570,7 +1570,7 @@ ADD_SUBDIRECTORY(docs) + # install them in the binary dir. Grab all of the .libs, put them + # in the libdir. + ## +-IF(MSVC) ++IF(MSVC AND NOT DISABLE_INSTALL_DEPENDENCIES) + FILE(GLOB COPY_FILES ${CMAKE_PREFIX_PATH}/lib/*.lib) + INSTALL(FILES ${COPY_FILES} + DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/ports/netcdf-c/portfile.cmake b/ports/netcdf-c/portfile.cmake new file mode 100644 index 0000000000..5b798f2661 --- /dev/null +++ b/ports/netcdf-c/portfile.cmake @@ -0,0 +1,52 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/netcdf-c-4.4.1.1) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Unidata/netcdf-c/archive/v4.4.1.1.zip" + FILENAME "netcdf-c-v4.4.1.1.zip" + SHA512 8d31e47f0bd4d5c8640d3444c5c83425862ed1e8283aa78419e86b18d33fd93bfeb0067e8e9630457cb9c334d6fedf630283b5227a15137a3e153d57b22364a8 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/no-install-deps.patch + ${CMAKE_CURRENT_LIST_DIR}/config-pkg-location.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja + OPTIONS + -DBUILD_UTILITIES=OFF + -DBUILD_TESTING=OFF + -DENABLE_EXAMPLES=OFF + -DENABLE_TESTS=OFF + -DUSE_HDF5=ON + -DENABLE_DAP_REMOTE_TESTS=OFF + -DDISABLE_INSTALL_DEPENDENCIES=ON + -DConfigPackageLocation=share/netcdf + + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() + +file(READ ${CURRENT_PACKAGES_DIR}/debug/share/netcdf/netCDFTargets-debug.cmake NETCDF_TARGETS_DEBUG_MODULE) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" NETCDF_TARGETS_DEBUG_MODULE "${NETCDF_TARGETS_DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/netcdf/netCDFTargets-debug.cmake "${NETCDF_TARGETS_DEBUG_MODULE}") + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/netcdf-c) From e1e0b7a6a9a0dac912b7857dea879a69bb782911 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 28 Feb 2017 02:30:36 -0800 Subject: [PATCH 479/561] [netcdf-c] Add transitive cmake dependency on hdf5 --- ports/netcdf-c/CONTROL | 2 +- ports/netcdf-c/portfile.cmake | 1 + ports/netcdf-c/transitive-hdf5.patch | 13 +++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 ports/netcdf-c/transitive-hdf5.patch diff --git a/ports/netcdf-c/CONTROL b/ports/netcdf-c/CONTROL index 4a9be91325..1303cb517a 100644 --- a/ports/netcdf-c/CONTROL +++ b/ports/netcdf-c/CONTROL @@ -1,4 +1,4 @@ Source: netcdf-c -Version: 4.4.1.1 +Version: 4.4.1.1-1 Build-Depends: hdf5, curl Description: a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. diff --git a/ports/netcdf-c/portfile.cmake b/ports/netcdf-c/portfile.cmake index 5b798f2661..75a3611061 100644 --- a/ports/netcdf-c/portfile.cmake +++ b/ports/netcdf-c/portfile.cmake @@ -20,6 +20,7 @@ vcpkg_apply_patches( PATCHES ${CMAKE_CURRENT_LIST_DIR}/no-install-deps.patch ${CMAKE_CURRENT_LIST_DIR}/config-pkg-location.patch + ${CMAKE_CURRENT_LIST_DIR}/transitive-hdf5.patch ) vcpkg_configure_cmake( diff --git a/ports/netcdf-c/transitive-hdf5.patch b/ports/netcdf-c/transitive-hdf5.patch new file mode 100644 index 0000000000..220640366e --- /dev/null +++ b/ports/netcdf-c/transitive-hdf5.patch @@ -0,0 +1,13 @@ +diff --git a/netCDFConfig.cmake.in b/netCDFConfig.cmake.in +index 6f4ccf8..14a3743 100644 +--- a/netCDFConfig.cmake.in ++++ b/netCDFConfig.cmake.in +@@ -11,6 +11,8 @@ set_and_check(netCDF_LIB_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@") + + set(netCDF_LIBRARIES netcdf) + ++find_package(HDF5 REQUIRED) ++ + # include target information + include("${CMAKE_CURRENT_LIST_DIR}/netCDFTargets.cmake") + From a92230f9c8bc1eae1fdf24b49aa49d02ac2c9ad6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 28 Feb 2017 03:23:20 -0800 Subject: [PATCH 480/561] [netcdf-cxx4] Initial commit of version 4.3.0 --- ports/netcdf-cxx4/CONTROL | 4 ++ ports/netcdf-cxx4/install-destination.patch | 33 ++++++++++++++++ ports/netcdf-cxx4/portfile.cmake | 44 +++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 ports/netcdf-cxx4/CONTROL create mode 100644 ports/netcdf-cxx4/install-destination.patch create mode 100644 ports/netcdf-cxx4/portfile.cmake diff --git a/ports/netcdf-cxx4/CONTROL b/ports/netcdf-cxx4/CONTROL new file mode 100644 index 0000000000..9fcda54685 --- /dev/null +++ b/ports/netcdf-cxx4/CONTROL @@ -0,0 +1,4 @@ +Source: netcdf-cxx4 +Version: 4.3.0 +Build-Depends: netcdf-c +Description: a set of machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. diff --git a/ports/netcdf-cxx4/install-destination.patch b/ports/netcdf-cxx4/install-destination.patch new file mode 100644 index 0000000000..7ff4e08c7f --- /dev/null +++ b/ports/netcdf-cxx4/install-destination.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6673282..d6c7a78 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -522,10 +522,14 @@ write_basic_package_version_file( + COMPATIBILITY SameMajorVersion + ) + ++if(NOT DEFINED CMAKE_INSTALL_CMAKECONFIGDIR) ++ set(CMAKE_INSTALL_CMAKECONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/netCDFCxx) ++endif() ++ + install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/netCDF/netCDFCxxConfigVersion.cmake" +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/netCDFCxx ++ DESTINATION ${CMAKE_INSTALL_CMAKECONFIGDIR} + COMPONENT headers + ) + +diff --git a/cxx4/CMakeLists.txt b/cxx4/CMakeLists.txt +index 431eb45..0423594 100644 +--- a/cxx4/CMakeLists.txt ++++ b/cxx4/CMakeLists.txt +@@ -43,5 +43,7 @@ INSTALL( + ) + INSTALL( + TARGETS netcdf-cxx4 +- DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) diff --git a/ports/netcdf-cxx4/portfile.cmake b/ports/netcdf-cxx4/portfile.cmake new file mode 100644 index 0000000000..92ae59675c --- /dev/null +++ b/ports/netcdf-cxx4/portfile.cmake @@ -0,0 +1,44 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + message(STATUS "Warning: DLLs not supported yet. Building static.") + set(VCPKG_LIBRARY_LINKAGE static) +endif() + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/netcdf-cxx4-4.3.0) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Unidata/netcdf-cxx4/archive/v4.3.0.zip" + FILENAME "netcdf-cxx4-4.3.0.zip" + SHA512 c0ae933446c5bb019ab90c097787cefe15a0161b6b768e0251e9e0b21c92ca8d42d98babcbe07b81b8db08cd1e9fba7befb853611a76debfdfba0aee4fb4b0bc +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/install-destination.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja + OPTIONS + -DNCXX_ENABLE_TESTS=OFF + -DCMAKE_INSTALL_CMAKECONFIGDIR=share/netCDFCxx + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/netcdf-cxx4) From 3ee7045070ee3de2dc12033a78a94e58aed4ce89 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 28 Feb 2017 05:45:42 -0800 Subject: [PATCH 481/561] [vtk] Don't define size_t. Override HDF5 library detection (bug in FindHDF5) --- ports/vtk/dont-define-ssize_t.patch | 13 +++++++++++++ ports/vtk/portfile.cmake | 10 ++++++++++ 2 files changed, 23 insertions(+) create mode 100644 ports/vtk/dont-define-ssize_t.patch diff --git a/ports/vtk/dont-define-ssize_t.patch b/ports/vtk/dont-define-ssize_t.patch new file mode 100644 index 0000000000..ba9b5e6058 --- /dev/null +++ b/ports/vtk/dont-define-ssize_t.patch @@ -0,0 +1,13 @@ +diff --git a/ThirdParty/netcdf/vtknetcdf/ncconfig.h.in b/ThirdParty/netcdf/vtknetcdf/ncconfig.h.in +index 0a19c41..0d92371 100644 +--- a/ThirdParty/netcdf/vtknetcdf/ncconfig.h.in ++++ b/ThirdParty/netcdf/vtknetcdf/ncconfig.h.in +@@ -110,7 +110,7 @@ + #cmakedefine HAVE_LIBHDF5_HL + + /* Define to `int' if system doesn't define. */ +-#cmakedefine ssize_t @ssize_t@ ++/* #cmakedefine ssize_t @ssize_t@ */ + + /* Define to `int' if system doesn't define. */ + #cmakedefine ptrdiff_t @ptrdiff_t@ diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake index 89bda5db95..611023a616 100644 --- a/ports/vtk/portfile.cmake +++ b/ports/vtk/portfile.cmake @@ -13,6 +13,7 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/transfer-3rd-party-module-definitions.patch ${CMAKE_CURRENT_LIST_DIR}/transfer-hdf5-definitions.patch ${CMAKE_CURRENT_LIST_DIR}/netcdf-use-hdf5-definitions.patch + ${CMAKE_CURRENT_LIST_DIR}/dont-define-ssize_t.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) @@ -25,8 +26,10 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA OPTIONS -DBUILD_TESTING=OFF + -DBUILD_EXAMPLES=OFF -DVTK_Group_MPI=ON -DVTK_Group_Qt=ON -DVTK_QT_VERSION=5 @@ -50,7 +53,14 @@ vcpkg_configure_cmake( -DVTK_INSTALL_DATA_DIR=share/vtk/data -DVTK_INSTALL_DOC_DIR=share/vtk/doc -DVTK_INSTALL_PACKAGE_DIR=share/vtk + -DVTK_FORBID_DOWNLOADS=ON ${ADDITIONAL_OPTIONS} + OPTIONS_RELEASE + -DHDF5_C_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/hdf5.lib + -DHDF5_C_HL_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/hdf5_hl.lib + OPTIONS_DEBUG + -DHDF5_C_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/hdf5_D.lib + -DHDF5_C_HL_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/hdf5_hl_D.lib ) vcpkg_install_cmake() From b6007c9ea50f4619499899895420ce43e2349f29 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 28 Feb 2017 11:03:39 -0800 Subject: [PATCH 482/561] [boost] Support for VS2017 --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 23 +++++++++++++++++++---- ports/boost/user-config.jam | 10 ---------- ports/boost/uwp/user-config.jam | 23 +++++++++++++++++++++++ ports/boost/vs2017/user-config.jam | 7 +++++++ 5 files changed, 50 insertions(+), 15 deletions(-) delete mode 100644 ports/boost/user-config.jam create mode 100644 ports/boost/uwp/user-config.jam create mode 100644 ports/boost/vs2017/user-config.jam diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 2cc98f16b3..ca9ae9ac1a 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost -Version: 1.63 +Version: 1.63-1 Description: Peer-reviewed portable C++ source libraries Build-Depends: zlib, bzip2 diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index 81424078eb..c4183d3188 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -36,9 +36,9 @@ set(B2_OPTIONS -j$ENV{NUMBER_OF_PROCESSORS} --debug-configuration --hash + -q --without-python - toolset=msvc threading=multi ) @@ -57,9 +57,23 @@ endif() if(TRIPLET_SYSTEM_ARCH MATCHES "x64") list(APPEND B2_OPTIONS address-model=64) endif() + +if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + message(WARNING "Combination of VS2017 and UWP is partially supported; using reference Winmd's from VS2015") +endif() if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") list(APPEND B2_OPTIONS windows-api=store) - set(ENV{BOOST_BUILD_PATH} ${CMAKE_CURRENT_LIST_DIR}) + set(ENV{BOOST_BUILD_PATH} ${CMAKE_CURRENT_LIST_DIR}/uwp) +else() + set(ENV{BOOST_BUILD_PATH} ${CMAKE_CURRENT_LIST_DIR}/vs2017) +endif() + +if(VCPKG_PLATFORM_TOOLSET MATCHES "v141") + list(APPEND B2_OPTIONS toolset=msvc-14.1) +elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v140") + list(APPEND B2_OPTIONS toolset=msvc-14.0) +else() + message(FATAL_ERROR "Unsupported value for VCPKG_PLATFORM_TOOLSET: '${VCPKG_PLATFORM_TOOLSET}'") endif() # Add build type specific options @@ -147,6 +161,7 @@ function(boost_rename_libs LIBS) get_filename_component(DIRECTORY_OF_LIB_FILE ${LIB} DIRECTORY) string(REPLACE "libboost_" "boost_" NEW_FILENAME ${OLD_FILENAME}) string(REPLACE "-s-" "-" NEW_FILENAME ${NEW_FILENAME}) # For Release libs + string(REPLACE "-vc141-" "-vc140-" NEW_FILENAME ${NEW_FILENAME}) # To merge VS2017 and VS2015 binaries string(REPLACE "-sgd-" "-gd-" NEW_FILENAME ${NEW_FILENAME}) # For Debug libs if (EXISTS ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) file(REMOVE ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME}) @@ -165,7 +180,7 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") endif() -file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/libboost*.lib) +file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*.lib) boost_rename_libs(RELEASE_LIBS) message(STATUS "Packaging ${TARGET_TRIPLET}-rel done") @@ -178,7 +193,7 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dll") endif() -file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/debug/lib/libboost*.lib) +file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/debug/lib/*.lib) boost_rename_libs(DEBUG_LIBS) message(STATUS "Packaging ${TARGET_TRIPLET}-dbg done") diff --git a/ports/boost/user-config.jam b/ports/boost/user-config.jam deleted file mode 100644 index 58184920a6..0000000000 --- a/ports/boost/user-config.jam +++ /dev/null @@ -1,10 +0,0 @@ -using msvc : 14.0 : : -"\"/AIC:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\LIB\\store\\references\"" -/appcontainer -/nodefaultlibs -WindowsApp.lib -release:vcruntime.lib -debug:vcruntimed.lib -release:ucrt.lib -debug:ucrtd.lib -; diff --git a/ports/boost/uwp/user-config.jam b/ports/boost/uwp/user-config.jam new file mode 100644 index 0000000000..9dbbb352f3 --- /dev/null +++ b/ports/boost/uwp/user-config.jam @@ -0,0 +1,23 @@ +using msvc : 14.0 : : +echo +"\"/AIC:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\LIB\\store\\references\"" +/appcontainer +/nodefaultlibs +WindowsApp.lib +release:vcruntime.lib +debug:vcruntimed.lib +release:ucrt.lib +debug:ucrtd.lib +; + +using msvc : 14.1 : cl.exe : +echo +"\"/AIC:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\LIB\\store\\references\"" +/appcontainer +/nodefaultlibs +WindowsApp.lib +release:vcruntime.lib +debug:vcruntimed.lib +release:ucrt.lib +debug:ucrtd.lib +; diff --git a/ports/boost/vs2017/user-config.jam b/ports/boost/vs2017/user-config.jam new file mode 100644 index 0000000000..8faba6d72d --- /dev/null +++ b/ports/boost/vs2017/user-config.jam @@ -0,0 +1,7 @@ +using msvc : 14.0 : cl.exe : +echo +; + +using msvc : 14.1 : cl.exe : +echo +; From ab0d61b77947591e62006a92633c1411bdefa6e5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 28 Feb 2017 17:51:26 -0800 Subject: [PATCH 483/561] Re-use variable instead of re-calling function returning it --- toolsrc/src/commands_integrate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 94af19e963..595cf3914d 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -227,14 +227,14 @@ namespace vcpkg::Commands::Integrate static void integrate_remove() { - auto path = get_appdata_targets_path(); + const fs::path path = get_appdata_targets_path(); if (!fs::exists(path)) { System::println(System::color::success, "User-wide integration is not installed"); exit(EXIT_SUCCESS); } - const std::wstring cmd_line = Strings::wformat(LR"(DEL "%s")", get_appdata_targets_path().native()); + const std::wstring cmd_line = Strings::wformat(LR"(DEL "%s")", path.native()); const int exit_code = System::cmd_execute(cmd_line); if (exit_code) { From 56d322dcb12dfaf95cd3cb9976110aa7d0cc9a15 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 28 Feb 2017 18:23:48 -0800 Subject: [PATCH 484/561] Improve implementation of `vcpkg integrate remove` --- toolsrc/src/commands_integrate.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 595cf3914d..3d5a9daeb1 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -228,20 +228,25 @@ namespace vcpkg::Commands::Integrate static void integrate_remove() { const fs::path path = get_appdata_targets_path(); - if (!fs::exists(path)) + + std::error_code ec; + bool was_deleted = fs::remove(path, ec); + + if (ec) { - System::println(System::color::success, "User-wide integration is not installed"); - exit(EXIT_SUCCESS); + System::println(System::color::error, "Error: Unable to remove user-wide integration: %d", ec.message()); + exit(EXIT_FAILURE); } - const std::wstring cmd_line = Strings::wformat(LR"(DEL "%s")", path.native()); - const int exit_code = System::cmd_execute(cmd_line); - if (exit_code) + if (was_deleted) { - System::println(System::color::error, "Error: Unable to remove user-wide integration: %d", exit_code); - exit(exit_code); + System::println(System::color::success, "User-wide integration was removed"); } - System::println(System::color::success, "User-wide integration was removed"); + else + { + System::println(System::color::success, "User-wide integration is not installed"); + } + exit(EXIT_SUCCESS); } From b2cf02b2d6ccbe1e86620ce712501e8a173a701d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 28 Feb 2017 18:36:37 -0800 Subject: [PATCH 485/561] Remove fs::exists() call --- toolsrc/src/commands_integrate.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 3d5a9daeb1..edb35d33aa 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -166,20 +166,17 @@ namespace vcpkg::Commands::Integrate fs::create_directory(tmp_dir); bool should_install_system = true; - if (fs::exists(system_wide_targets_file)) + const expected system_wide_file_contents = Files::read_contents(system_wide_targets_file); + if (auto contents_data = system_wide_file_contents.get()) { - auto system_wide_file_contents = Files::read_contents(system_wide_targets_file); - if (auto contents_data = system_wide_file_contents.get()) + std::regex re(R"###()###"); + std::match_results match; + auto found = std::regex_search(*contents_data, match, re); + if (found) { - std::regex re(R"###()###"); - std::match_results match; - auto found = std::regex_search(*contents_data, match, re); - if (found) - { - int ver = atoi(match[1].str().c_str()); - if (ver >= 1) - should_install_system = false; - } + int ver = atoi(match[1].str().c_str()); + if (ver >= 1) + should_install_system = false; } } From 9e43dbb184785d48d9b5eca0ff60410b68663289 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 28 Feb 2017 18:52:32 -0800 Subject: [PATCH 486/561] [flatbuffers] Initial commit of v1.6.0. Fixes #35. --- ports/flatbuffers/CONTROL | 4 ++ ports/flatbuffers/portfile.cmake | 65 ++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 ports/flatbuffers/CONTROL create mode 100644 ports/flatbuffers/portfile.cmake diff --git a/ports/flatbuffers/CONTROL b/ports/flatbuffers/CONTROL new file mode 100644 index 0000000000..1fbe5d6283 --- /dev/null +++ b/ports/flatbuffers/CONTROL @@ -0,0 +1,4 @@ +Source: flatbuffers +Version: 1.6.0 +Description: Memory Efficient Serialization Library http://google.github.io/flatbuffers/ + FlatBuffers is an efficient cross platform serialization library for games and other memory constrained apps. It allows you to directly access serialized data without unpacking/parsing it first, while still having great forwards/backwards compatibility. \ No newline at end of file diff --git a/ports/flatbuffers/portfile.cmake b/ports/flatbuffers/portfile.cmake new file mode 100644 index 0000000000..5d52fc2a8f --- /dev/null +++ b/ports/flatbuffers/portfile.cmake @@ -0,0 +1,65 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + message("Building DLLs not supported. Building static instead.") + set(VCPKG_LIBRARY_LINKAGE static) +endif() + + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/flatbuffers-1.6.0) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/google/flatbuffers/archive/v1.6.0.zip" + FILENAME "flatbuffers-1.6.0.zip" + SHA512 c23043a54d7055f4e0a0164fdafd3f1d60292e57d62d20d30f641c9da90935d14da847f86239a19f777e68b707cfb25452da9192607a3a399ab25ce06b31c282 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +set(OPTIONS) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + list(APPEND OPTIONS -DFLATBUFFERS_BUILD_SHAREDLIB=ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja + OPTIONS + -DFLATBUFFERS_BUILD_TESTS=OFF + -DFLATBUFFERS_BUILD_GRPCTEST=OFF + ${OPTIONS} + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() + +if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() +if(EXISTS ${CURRENT_PACKAGES_DIR}/bin/flatc.exe) + make_directory(${CURRENT_PACKAGES_DIR}/tools/flatbuffers) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/flatc.exe ${CURRENT_PACKAGES_DIR}/tools/flatbuffers/flatc.exe) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) +endif() +if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/flatbuffers.dll) + make_directory(${CURRENT_PACKAGES_DIR}/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/flatbuffers.dll ${CURRENT_PACKAGES_DIR}/bin/flatbuffers.dll) +endif() +if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/flatbuffers.dll) + make_directory(${CURRENT_PACKAGES_DIR}/debug/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/flatbuffers.dll ${CURRENT_PACKAGES_DIR}/debug/bin/flatbuffers.dll) +endif() + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/flatbuffers) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/flatbuffers) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/flatbuffers/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/flatbuffers/copyright) From b6907f417b33d089c509516ca09961623860d06e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 28 Feb 2017 19:58:19 -0800 Subject: [PATCH 487/561] Use Checks::check_exit() --- toolsrc/src/commands_integrate.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index edb35d33aa..6d28da6abd 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -272,12 +272,7 @@ namespace vcpkg::Commands::Integrate const int exit_code = System::cmd_execute(cmd_line); const fs::path nuget_package = buildsystems_dir / Strings::format("%s.%s.nupkg", nuget_id, nupkg_version); - if (exit_code != 0 || !fs::exists(nuget_package)) - { - System::println(System::color::error, "Error: NuGet package creation failed"); - exit(EXIT_FAILURE); - } - + Checks::check_exit(exit_code == 0 && fs::exists(nuget_package), "Error: NuGet package creation failed"); System::println(System::color::success, "Created nupkg: %s", nuget_package.string()); System::println(R"( From 35edd4ee4fada8401f90d07f02dab7c3474aebbf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Mar 2017 13:59:19 -0800 Subject: [PATCH 488/561] load_all_ports() no longer aborts when a port fails --- toolsrc/src/Paragraphs.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp index 1d8106750c..cb90ed1ecb 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/Paragraphs.cpp @@ -209,10 +209,6 @@ namespace vcpkg::Paragraphs { output.emplace_back(std::move(*srcpgh)); } - else - { - Checks::exit_with_message("Error loading port from %s: %s", path.generic_string(), source_paragraph.error_code().message()); - } } return output; From b6b4f9325f7ab0a6e29d6b9c14a1ddff9cd3db4c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Mar 2017 16:22:06 -0800 Subject: [PATCH 489/561] Reuse functions for finding dlls/libs --- toolsrc/src/commands_import.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp index 33cf8a4f46..11924b4b25 100644 --- a/toolsrc/src/commands_import.cpp +++ b/toolsrc/src/commands_import.cpp @@ -12,26 +12,13 @@ namespace vcpkg::Commands::Import std::vector libs; }; - static Binaries detect_files_in_directory_ending_with(const fs::path& path) + static Binaries find_binaries_in_dir(const fs::path& path) { Files::check_is_directory(path); Binaries binaries; - - for (auto it = fs::recursive_directory_iterator(path); it != fs::recursive_directory_iterator(); ++it) - { - fs::path file = *it; - // Skip if directory ????? - if (file.extension() == ".dll") - { - binaries.dlls.push_back(file); - } - else if (file.extension() == ".lib") - { - binaries.libs.push_back(file); - } - } - + binaries.dlls = Files::recursive_find_files_with_extension_in_dir(path, ".dll"); + binaries.libs = Files::recursive_find_files_with_extension_in_dir(path, ".lib"); return binaries; } @@ -51,8 +38,8 @@ namespace vcpkg::Commands::Import Files::check_is_directory(include_directory); Files::check_is_directory(project_directory); Files::check_is_directory(destination_path); - Binaries debug_binaries = detect_files_in_directory_ending_with(project_directory / "Debug"); - Binaries release_binaries = detect_files_in_directory_ending_with(project_directory / "Release"); + Binaries debug_binaries = find_binaries_in_dir(project_directory / "Debug"); + Binaries release_binaries = find_binaries_in_dir(project_directory / "Release"); fs::path destination_include_directory = destination_path / "include"; fs::copy(include_directory, destination_include_directory, fs::copy_options::recursive | fs::copy_options::overwrite_existing); From b11ab655e2543faec126b8a813ff5dc171958cad Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 2 Mar 2017 02:56:35 -0800 Subject: [PATCH 490/561] [boost] Hotfix for building on VS2015 --- ports/boost/CONTROL | 2 +- ports/boost/portfile.cmake | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index ca9ae9ac1a..3f1127ab01 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,4 +1,4 @@ Source: boost -Version: 1.63-1 +Version: 1.63-2 Description: Peer-reviewed portable C++ source libraries Build-Depends: zlib, bzip2 diff --git a/ports/boost/portfile.cmake b/ports/boost/portfile.cmake index c4183d3188..343e0c5b05 100644 --- a/ports/boost/portfile.cmake +++ b/ports/boost/portfile.cmake @@ -163,7 +163,9 @@ function(boost_rename_libs LIBS) string(REPLACE "-s-" "-" NEW_FILENAME ${NEW_FILENAME}) # For Release libs string(REPLACE "-vc141-" "-vc140-" NEW_FILENAME ${NEW_FILENAME}) # To merge VS2017 and VS2015 binaries string(REPLACE "-sgd-" "-gd-" NEW_FILENAME ${NEW_FILENAME}) # For Debug libs - if (EXISTS ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) + if ("${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}" STREQUAL "${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME}") + # nothing to do + elseif (EXISTS ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) file(REMOVE ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME}) else() file(RENAME ${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME} ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) From 1551d9942e5b2ddd98edd246cb1fc99d9f7c07a7 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 2 Mar 2017 14:59:32 +0100 Subject: [PATCH 491/561] [lua] update to 5.3.4 --- ports/lua/CMakeLists.txt | 8 +++++++- ports/lua/CONTROL | 2 +- ports/lua/portfile.cmake | 17 +++++++++++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ports/lua/CMakeLists.txt b/ports/lua/CMakeLists.txt index 68de76788f..c43b3b47bb 100644 --- a/ports/lua/CMakeLists.txt +++ b/ports/lua/CMakeLists.txt @@ -22,6 +22,10 @@ src/lopcodes.c src/loslib.c src/lparser.c src/lstate.c src/lstring.c src/lstrlib src/ltable.c src/ltablib.c src/ltm.c src/lundump.c src/lutf8lib.c src/lvm.c src/lzio.c ) +IF (COMPILE_AS_CPP) + SET_SOURCE_FILES_PROPERTIES(${SRC_LIBLUA} src/lua.c src/luac.c PROPERTIES LANGUAGE CXX) +ENDIF () + # append headers to sources to make them show up in MSVC GUI LIST(APPEND SRC_LIBLUA ${HDR_LIBLUA}) @@ -54,8 +58,10 @@ IF (NOT DEFINED SKIP_INSTALL_HEADERS) src/lualib.h src/lua.h src/luaconf.h - src/lua.hpp src/lauxlib.h DESTINATION include ) + IF (NOT COMPILE_AS_CPP) + INSTALL(FILES src/lua.hpp DESTINATION include) + ENDIF () ENDIF () diff --git a/ports/lua/CONTROL b/ports/lua/CONTROL index b284bfa85a..266bd153c8 100644 --- a/ports/lua/CONTROL +++ b/ports/lua/CONTROL @@ -1,3 +1,3 @@ Source: lua -Version: 5.3.3-2 +Version: 5.3.4 Description: a powerful, fast, lightweight, embeddable scripting language diff --git a/ports/lua/portfile.cmake b/ports/lua/portfile.cmake index 0778a77f9f..beda8362ee 100644 --- a/ports/lua/portfile.cmake +++ b/ports/lua/portfile.cmake @@ -7,11 +7,11 @@ # include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lua-5.3.3) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lua-5.3.4) vcpkg_download_distfile(ARCHIVE - URLS "http://www.lua.org/ftp/lua-5.3.3.tar.gz" - FILENAME "lua-5.3.3.tar.gz" - SHA512 7b8122ed48ea2a9faa47d1b69b4a5b1523bb7be67e78f252bb4339bf75e957a88c5405156e22b4b63ccf607a5407bf017a4cee1ce12b1aa5262047655960a3cc + URLS "http://www.lua.org/ftp/lua-5.3.4.tar.gz" + FILENAME "lua-5.3.4.tar.gz" + SHA512 739e31f82e6a60fa99910c2005e991b3a1e21339af52847f653cb190b30842054d189ca116ffcfdf9b36e07888c9ce5642b1dd2988cc7eff9f8789f9a2e34997 ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -19,6 +19,9 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DCOMPILE_AS_CPP=OFF OPTIONS_DEBUG -DSKIP_INSTALL_HEADERS=ON -DSKIP_INSTALL_TOOLS=ON @@ -26,6 +29,12 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(READ ${CURRENT_PACKAGES_DIR}/include/luaconf.h LUA_CONF_H) + string(REPLACE "defined(LUA_BUILD_AS_DLL)" "1" LUA_CONF_H "${LUA_CONF_H}") + file(WRITE ${CURRENT_PACKAGES_DIR}/include/luaconf.h "${LUA_CONF_H}") +endif() + # Handle copyright file(COPY ${CMAKE_CURRENT_LIST_DIR}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/lua) vcpkg_copy_pdbs() From b9b27e72d31106ec6b159590a77014d02a655f93 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 2 Mar 2017 16:02:45 +0100 Subject: [PATCH 492/561] [lua] add comment about new option --- ports/lua/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/lua/CMakeLists.txt b/ports/lua/CMakeLists.txt index c43b3b47bb..b82c63e42b 100644 --- a/ports/lua/CMakeLists.txt +++ b/ports/lua/CMakeLists.txt @@ -1,3 +1,7 @@ +# Lua can be compiled as either C or C++. +# Default configuration is C, set COMPILE_AS_CPP to ON to use C++. +# See http://stackoverflow.com/questions/13560945/c-and-c-library-using-longjmp for why would you want to do that. + PROJECT ( lua ) IF( NOT WIN32 ) @@ -61,7 +65,8 @@ IF (NOT DEFINED SKIP_INSTALL_HEADERS) src/lauxlib.h DESTINATION include ) + # If using C++, don't install extern "C" wrapper. IF (NOT COMPILE_AS_CPP) - INSTALL(FILES src/lua.hpp DESTINATION include) + INSTALL(FILES src/lua.hpp DESTINATION include) ENDIF () ENDIF () From 3e0dc1e81e0fa0960abca18bba6c560df4317adb Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 2 Mar 2017 07:16:46 -0800 Subject: [PATCH 493/561] [lua] Expanded comment on COMPILE_AS_CPP --- ports/lua/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/lua/CMakeLists.txt b/ports/lua/CMakeLists.txt index b82c63e42b..faef8018b3 100644 --- a/ports/lua/CMakeLists.txt +++ b/ports/lua/CMakeLists.txt @@ -1,6 +1,11 @@ # Lua can be compiled as either C or C++. # Default configuration is C, set COMPILE_AS_CPP to ON to use C++. # See http://stackoverflow.com/questions/13560945/c-and-c-library-using-longjmp for why would you want to do that. +# Primary differences: +# - Exceptions will be used instead of setjmp/longjmp +# - The name mangling for functions will be C++ instead of C. +# - This is a source-incompatible change because extern "C" is chosen by the including application. +# - The lua.hpp header will not be available. PROJECT ( lua ) From 2f8d8d8b18f8a6dd7dad6e3290074dc6044395ce Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 2 Mar 2017 07:29:00 -0800 Subject: [PATCH 494/561] [ffmpeg] Initial commit of version 3.2.4 --- ports/ffmpeg/CONTROL | 4 + ports/ffmpeg/build.sh | 17 ++++ ports/ffmpeg/portfile.cmake | 97 ++++++++++++++++++++++ scripts/cmake/vcpkg_acquire_msys.cmake | 30 +++++++ scripts/cmake/vcpkg_common_functions.cmake | 3 +- 5 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 ports/ffmpeg/CONTROL create mode 100644 ports/ffmpeg/build.sh create mode 100644 ports/ffmpeg/portfile.cmake create mode 100644 scripts/cmake/vcpkg_acquire_msys.cmake diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL new file mode 100644 index 0000000000..30d957b6c8 --- /dev/null +++ b/ports/ffmpeg/CONTROL @@ -0,0 +1,4 @@ +Source: ffmpeg +Version: 3.2.4 +Description: a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. + FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations. \ No newline at end of file diff --git a/ports/ffmpeg/build.sh b/ports/ffmpeg/build.sh new file mode 100644 index 0000000000..3474a111ee --- /dev/null +++ b/ports/ffmpeg/build.sh @@ -0,0 +1,17 @@ +#!/usr/bin/bash +set -e +export PATH=/usr/bin:$PATH +pacman -Sy --noconfirm --needed diffutils make + +PATH_TO_BUILD_DIR="`cygpath "$1"`" +PATH_TO_SRC_DIR="`cygpath "$2"`" +PATH_TO_PACKAGE_DIR="`cygpath "$3"`" +# Note: $4 is extra configure options + +cd "$PATH_TO_BUILD_DIR" +echo "=== CONFIGURING ===" +"$PATH_TO_SRC_DIR/configure" --toolchain=msvc "--prefix=$PATH_TO_PACKAGE_DIR" $4 +echo "=== BUILDING ===" +make -j6 +echo "=== INSTALLING ===" +make install diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake new file mode 100644 index 0000000000..4bd8ea4bcc --- /dev/null +++ b/ports/ffmpeg/portfile.cmake @@ -0,0 +1,97 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ffmpeg-3.2.4) +vcpkg_download_distfile(ARCHIVE + URLS "http://ffmpeg.org/releases/ffmpeg-3.2.4.tar.bz2" + FILENAME "ffmpeg-3.2.4.tar.bz2" + SHA512 ba5004d0f2659faa139c7dbf2f0fc6bab1d4e017d919f4ac271a5d2e8e4a3478909176e3a4d1ad33ddf2f62ab28dd9e00ce9be1399efb7cb3276dde79134cdaa +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_find_acquire_program(YASM) +get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) +set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH}") + +vcpkg_acquire_msys(MSYS_ROOT) +set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) + +set(_csc_PROJECT_PATH ffmpeg) + +file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + +set(OPTIONS "--disable-ffmpeg --disable-ffprobe --disable-doc --enable-debug") +set(OPTIONS "${OPTIONS} --enable-runtime-cpudetect") +set(OPTIONS_DEBUG "") # Note: --disable-optimizations can't be used due to http://ffmpeg.org/pipermail/libav-user/2013-March/003945.html + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(OPTIONS "${OPTIONS} --disable-static --enable-shared") +endif() + +if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") + set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MDd --extra-cxxflags=-MDd --extra-ldflags=-NODEFAULTLIB:libcmt") +else() + set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MTd --extra-cxxflags=-MTd --extra-ldflags=-NODEFAULTLIB:libcmt") +endif() + +message(STATUS "Building ${_csc_PROJECT_PATH} for Release") +file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) +vcpkg_execute_required_process( + COMMAND ${BASH} --noprofile --norc "${CMAKE_CURRENT_LIST_DIR}\\build.sh" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" # BUILD DIR + "${SOURCE_PATH}" # SOURCE DIR + "${CURRENT_PACKAGES_DIR}" # PACKAGE DIR + "${OPTIONS}" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME build-${TARGET_TRIPLET}-rel +) + +message(STATUS "Building ${_csc_PROJECT_PATH} for Debug") +file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) +vcpkg_execute_required_process( + COMMAND ${BASH} --noprofile --norc "${CMAKE_CURRENT_LIST_DIR}\\build.sh" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" # BUILD DIR + "${SOURCE_PATH}" # SOURCE DIR + "${CURRENT_PACKAGES_DIR}/debug" # PACKAGE DIR + "${OPTIONS} ${OPTIONS_DEBUG}" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME build-${TARGET_TRIPLET}-dbg +) + +file(GLOB DEF_FILES ${CURRENT_PACKAGES_DIR}/lib/*.def ${CURRENT_PACKAGES_DIR}/debug/lib/*.def) + +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + set(LIB_MACHINE_ARG /machine:ARM) +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(LIB_MACHINE_ARG /machine:x86) +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(LIB_MACHINE_ARG /machine:x64) +else() + message(FATAL_ERROR "Unsupported target architecture") +endif() + +foreach(DEF_FILE ${DEF_FILES}) + get_filename_component(DEF_FILE_DIR "${DEF_FILE}" DIRECTORY) + get_filename_component(DEF_FILE_NAME "${DEF_FILE}" NAME) + string(REGEX REPLACE "-[0-9]*\\.def" ".lib" OUT_FILE_NAME "${DEF_FILE_NAME}") + file(TO_NATIVE_PATH "${DEF_FILE}" DEF_FILE_NATIVE) + file(TO_NATIVE_PATH "${DEF_FILE_DIR}/${OUT_FILE_NAME}" OUT_FILE_NATIVE) + message(STATUS "Generating ${OUT_FILE_NATIVE}") + vcpkg_execute_required_process( + COMMAND lib.exe /def:${DEF_FILE_NATIVE} /out:${OUT_FILE_NATIVE} ${LIB_MACHINE_ARG} + WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR} + LOGNAME libconvert-${TARGET_TRIPLET} + ) +endforeach() + +file(GLOB EXP_FILES ${CURRENT_PACKAGES_DIR}/lib/*.exp ${CURRENT_PACKAGES_DIR}/debug/lib/*.exp) +file(GLOB LIB_FILES ${CURRENT_PACKAGES_DIR}/bin/*.lib ${CURRENT_PACKAGES_DIR}/debug/bin/*.lib) +file(GLOB EXE_FILES ${CURRENT_PACKAGES_DIR}/bin/*.exe ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) + +file(REMOVE ${EXP_FILES} ${LIB_FILES} ${DEF_FILES} ${EXE_FILES}) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) + +vcpkg_copy_pdbs() + +# Handle copyright +# TODO: Examine build log and confirm that this license matches the build output +file(COPY ${SOURCE_PATH}/COPYING.LGPLv2.1 DESTINATION ${CURRENT_PACKAGES_DIR}/share/ffmpeg) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/ffmpeg/COPYING.LGPLv2.1 ${CURRENT_PACKAGES_DIR}/share/ffmpeg/copyright) diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake new file mode 100644 index 0000000000..20e249c8b0 --- /dev/null +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -0,0 +1,30 @@ +function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) + set(TOOLPATH ${DOWNLOADS}/tools/msys2) + set(TOOLSUBPATH msys32) + set(URL "https://sourceforge.net/projects/msys2/files/Base/i686/msys2-base-i686-20161025.tar.xz/download") + set(ARCHIVE "msys2-base-i686-20161025.tar.xz") + set(HASH c9260a38e0c6bf963adeaea098c4e376449c1dd0afe07480741d6583a1ac4c138951ccb0c5388bd148e04255a5c1a23bf5ee2d58dcd6607c14f1eaa5639a7c85) + + set(PATH_TO_ROOT ${TOOLPATH}/${TOOLSUBPATH}) + + if(NOT EXISTS "${TOOLPATH}/initialized-msys2.stamp") + message(STATUS "Acquiring MSYS2...") + file(DOWNLOAD ${URL} ${DOWNLOADS}/${ARCHIVE} + EXPECTED_HASH SHA512=${HASH} + ) + file(REMOVE_RECURSE ${TOOLPATH}) + file(MAKE_DIRECTORY ${TOOLPATH}) + execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE} + WORKING_DIRECTORY ${TOOLPATH} + ) + execute_process( + COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin:\$PATH;pacman-key --init;pacman-key --populate" + WORKING_DIRECTORY ${TOOLPATH} + ) + file(WRITE "${TOOLPATH}/initialized-msys2.stamp" "0") + message(STATUS "Acquiring MSYS2... OK") + endif() + + set(${PATH_TO_ROOT_OUT} ${PATH_TO_ROOT} PARENT_SCOPE) +endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 44278ebba9..a003548d5b 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -1,3 +1,4 @@ +include(vcpkg_acquire_msys) include(vcpkg_download_distfile) include(vcpkg_extract_source_archive) include(vcpkg_execute_required_process) @@ -16,4 +17,4 @@ include(vcpkg_copy_pdbs) include(vcpkg_copy_tool_dependencies) include(vcpkg_get_program_files_32_bit) include(vcpkg_get_program_files_platform_bitness) -include(vcpkg_get_windows_sdk) +include(vcpkg_get_windows_sdk) \ No newline at end of file From 782fa3000b42fafc5ed96adbeaa5295b1fb776db Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 2 Mar 2017 08:26:39 -0800 Subject: [PATCH 495/561] [ffmpeg] Hotfix accounting for new flags --- ports/ffmpeg/CONTROL | 2 +- ports/ffmpeg/portfile.cmake | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index 30d957b6c8..d1db97c20a 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,4 +1,4 @@ Source: ffmpeg -Version: 3.2.4 +Version: 3.2.4-1 Description: a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations. \ No newline at end of file diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 4bd8ea4bcc..b9d795b20f 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -85,8 +85,11 @@ endforeach() file(GLOB EXP_FILES ${CURRENT_PACKAGES_DIR}/lib/*.exp ${CURRENT_PACKAGES_DIR}/debug/lib/*.exp) file(GLOB LIB_FILES ${CURRENT_PACKAGES_DIR}/bin/*.lib ${CURRENT_PACKAGES_DIR}/debug/bin/*.lib) file(GLOB EXE_FILES ${CURRENT_PACKAGES_DIR}/bin/*.exe ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) - -file(REMOVE ${EXP_FILES} ${LIB_FILES} ${DEF_FILES} ${EXE_FILES}) +set(FILES_TO_REMOVE ${EXP_FILES} ${LIB_FILES} ${DEF_FILES} ${EXE_FILES}) +list(LENGTH FILES_TO_REMOVE FILES_TO_REMOVE_LEN) +if(FILES_TO_REMOVE_LEN GREATER 0) + file(REMOVE ${FILES_TO_REMOVE}) +endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) vcpkg_copy_pdbs() From 6c26a42d54e30a22bc1c3a455646242e23e2f0df Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 2 Mar 2017 10:35:27 -0800 Subject: [PATCH 496/561] [ffmpeg] Disable static building. --- ports/ffmpeg/CONTROL | 2 +- ports/ffmpeg/portfile.cmake | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index d1db97c20a..eea91d5689 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,4 +1,4 @@ Source: ffmpeg -Version: 3.2.4-1 +Version: 3.2.4-2 Description: a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations. \ No newline at end of file diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index b9d795b20f..7b45fc898d 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -1,3 +1,8 @@ +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + message(STATUS "Building as static libraries not currently supported. Building as DLLs instead.") + set(VCPKG_LIBRARY_LINKAGE "dynamic") +endif() + include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ffmpeg-3.2.4) vcpkg_download_distfile(ARCHIVE From 2054f964fd6ab4edd0fcf30d56c2de20387d3077 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 2 Mar 2017 18:52:15 -0800 Subject: [PATCH 497/561] Add __declspec(noreturn) in the definitions too ...to match the declarations --- toolsrc/src/vcpkg_Checks.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toolsrc/src/vcpkg_Checks.cpp b/toolsrc/src/vcpkg_Checks.cpp index f02addc081..02d3480a25 100644 --- a/toolsrc/src/vcpkg_Checks.cpp +++ b/toolsrc/src/vcpkg_Checks.cpp @@ -4,7 +4,7 @@ namespace vcpkg::Checks { - void unreachable() + __declspec(noreturn) void unreachable() { System::println(System::color::error, "Error: Unreachable code was reached"); #ifndef NDEBUG @@ -14,13 +14,13 @@ namespace vcpkg::Checks #endif } - void exit_with_message(const char* errorMessage) + __declspec(noreturn) void exit_with_message(const char* errorMessage) { System::println(System::color::error, errorMessage); exit(EXIT_FAILURE); } - void throw_with_message(const char* errorMessage) + __declspec(noreturn) void throw_with_message(const char* errorMessage) { throw std::runtime_error(errorMessage); } From 6e094c089151de165d3a78ec573a5c32db5e0b56 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Mar 2017 14:55:33 -0800 Subject: [PATCH 498/561] Enclose path in quotes --- toolsrc/src/vcpkg_Environment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 8f3030269d..94a672e2a2 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -44,7 +44,7 @@ namespace vcpkg::Environment { const fs::path script = paths.scripts / "fetchDependency.ps1"; // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - return Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency %s", script.native(), tool_name); + return Strings::wformat(LR"(powershell -ExecutionPolicy Bypass "%s" -Dependency %s)", script.native(), tool_name); } void ensure_git_on_path(const vcpkg_paths& paths) From e44aae7210a5c13e8748854dff478905c371defa Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Mar 2017 18:42:57 -0800 Subject: [PATCH 499/561] Formatting --- toolsrc/src/PostBuildLint.cpp | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index c4ddbc62ee..bc02a16a8b 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -29,24 +29,24 @@ namespace vcpkg::PostBuildLint const std::vector& get_outdated_dynamic_crts() { static const std::vector v = { - {"msvcp100.dll", R"(msvcp100\.dll)"}, - {"msvcp100d.dll", R"(msvcp100d\.dll)"}, - {"msvcp110.dll", R"(msvcp110\.dll)"}, - {"msvcp110_win.dll", R"(msvcp110_win\.dll)"}, - {"msvcp120.dll", R"(msvcp120\.dll)"}, - {"msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"}, - {"msvcp60.dll", R"(msvcp60\.dll)"}, - {"msvcp60.dll", R"(msvcp60\.dll)"}, + { "msvcp100.dll", R"(msvcp100\.dll)" }, + { "msvcp100d.dll", R"(msvcp100d\.dll)" }, + { "msvcp110.dll", R"(msvcp110\.dll)" }, + { "msvcp110_win.dll", R"(msvcp110_win\.dll)" }, + { "msvcp120.dll", R"(msvcp120\.dll)" }, + { "msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)" }, + { "msvcp60.dll", R"(msvcp60\.dll)" }, + { "msvcp60.dll", R"(msvcp60\.dll)" }, - {"msvcr100.dll", R"(msvcr100\.dll)"}, - {"msvcr100d.dll", R"(msvcr100d\.dll)"}, - {"msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"}, - {"msvcr110.dll", R"(msvcr110\.dll)"}, - {"msvcr120.dll", R"(msvcr120\.dll)"}, - {"msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"}, - {"msvcrt.dll", R"(msvcrt\.dll)"}, - {"msvcrt20.dll", R"(msvcrt20\.dll)"}, - {"msvcrt40.dll", R"(msvcrt40\.dll)"} + { "msvcr100.dll", R"(msvcr100\.dll)" }, + { "msvcr100d.dll", R"(msvcr100d\.dll)" }, + { "msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)" }, + { "msvcr110.dll", R"(msvcr110\.dll)" }, + { "msvcr120.dll", R"(msvcr120\.dll)" }, + { "msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)" }, + { "msvcrt.dll", R"(msvcrt\.dll)" }, + { "msvcrt20.dll", R"(msvcrt20\.dll)" }, + { "msvcrt40.dll", R"(msvcrt40\.dll)" } }; return v; @@ -324,7 +324,7 @@ namespace vcpkg::PostBuildLint if (expected_architecture != actual_architecture) { - binaries_with_invalid_architecture.push_back({file, actual_architecture}); + binaries_with_invalid_architecture.push_back({ file, actual_architecture }); } } @@ -350,7 +350,7 @@ namespace vcpkg::PostBuildLint const std::string actual_architecture = get_actual_architecture(info.machine_types.at(0)); if (expected_architecture != actual_architecture) { - binaries_with_invalid_architecture.push_back({file, actual_architecture}); + binaries_with_invalid_architecture.push_back({ file, actual_architecture }); } } @@ -502,7 +502,7 @@ namespace vcpkg::PostBuildLint { if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), bad_build_type.crt_regex())) { - libs_with_invalid_crt.push_back({lib, bad_build_type}); + libs_with_invalid_crt.push_back({ lib, bad_build_type }); break; } } @@ -549,7 +549,7 @@ namespace vcpkg::PostBuildLint { if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), outdated_crt.regex)) { - dlls_with_outdated_crt.push_back({dll, outdated_crt}); + dlls_with_outdated_crt.push_back({ dll, outdated_crt }); break; } } From c2a368976dcd42640290a6ef30c5a4fc8a4a825d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Mar 2017 19:00:48 -0800 Subject: [PATCH 500/561] Add policy: NoDebugBinaries --- scripts/ports.cmake | 3 +++ toolsrc/include/PostBuildLint_BuildPolicies.h | 6 ++++-- toolsrc/src/PostBuildLint.cpp | 19 ++++++++++++++++--- toolsrc/src/PostBuildLint_BuildPolicies.cpp | 11 +++++++++++ 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/scripts/ports.cmake b/scripts/ports.cmake index c03b005ead..dbc547676d 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -82,6 +82,9 @@ if(CMD MATCHES "^BUILD$") if (DEFINED VCPKG_POLICY_EMPTY_PACKAGE) file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyEmptyPackage: ${VCPKG_POLICY_EMPTY_PACKAGE}\n") endif() + if (DEFINED VCPKG_POLICY_NO_DEBUG_BINARIES) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyNoDebugBinaries: ${VCPKG_POLICY_NO_DEBUG_BINARIES}\n") + endif() elseif(CMD MATCHES "^CREATE$") file(TO_NATIVE_PATH ${VCPKG_ROOT_DIR} NATIVE_VCPKG_ROOT_DIR) file(TO_NATIVE_PATH ${DOWNLOADS} NATIVE_DOWNLOADS) diff --git a/toolsrc/include/PostBuildLint_BuildPolicies.h b/toolsrc/include/PostBuildLint_BuildPolicies.h index 082de31d00..42bd3d718f 100644 --- a/toolsrc/include/PostBuildLint_BuildPolicies.h +++ b/toolsrc/include/PostBuildLint_BuildPolicies.h @@ -8,7 +8,8 @@ namespace vcpkg::PostBuildLint::BuildPolicies { NULLVALUE = 0, EMPTY_PACKAGE, - DLLS_WITHOUT_LIBS + DLLS_WITHOUT_LIBS, + NO_DEBUG_BINARIES }; struct type @@ -29,8 +30,9 @@ namespace vcpkg::PostBuildLint::BuildPolicies static constexpr type NULLVALUE(backing_enum_t::NULLVALUE); static constexpr type EMPTY_PACKAGE(backing_enum_t::EMPTY_PACKAGE); static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); + static constexpr type NO_DEBUG_BINARIES(backing_enum_t::NO_DEBUG_BINARIES); - static constexpr std::array values = { EMPTY_PACKAGE, DLLS_WITHOUT_LIBS }; + static constexpr std::array values = { EMPTY_PACKAGE, DLLS_WITHOUT_LIBS, NO_DEBUG_BINARIES }; type parse(const std::string& s); } diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index bc02a16a8b..b0edaf805a 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -601,6 +601,17 @@ namespace vcpkg::PostBuildLint left += static_cast(right); } + template + static bool contains_and_enabled(const std::map map, const T& key) + { + auto it = map.find(key); + if (it != map.cend() && it->second == opt_bool_t::ENABLED) + { + return true; + } + + return false; + } static size_t perform_all_checks_and_return_error_count(const package_spec& spec, const vcpkg_paths& paths) { @@ -611,8 +622,7 @@ namespace vcpkg::PostBuildLint size_t error_count = 0; - auto it = build_info.policies.find(BuildPolicies::EMPTY_PACKAGE); - if (it != build_info.policies.cend() && it->second == opt_bool_t::ENABLED) + if (contains_and_enabled(build_info.policies, BuildPolicies::EMPTY_PACKAGE)) { return error_count; } @@ -674,7 +684,10 @@ namespace vcpkg::PostBuildLint error_count += check_bin_folders_are_not_present_in_static_build(package_dir); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, build_info.crt_linkage), debug_libs, dumpbin_exe); + if (!contains_and_enabled(build_info.policies, BuildPolicies::NO_DEBUG_BINARIES)) + { + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, build_info.crt_linkage), debug_libs, dumpbin_exe); + } error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, build_info.crt_linkage), release_libs, dumpbin_exe); break; } diff --git a/toolsrc/src/PostBuildLint_BuildPolicies.cpp b/toolsrc/src/PostBuildLint_BuildPolicies.cpp index 53dfcf95a3..2e0a1713bf 100644 --- a/toolsrc/src/PostBuildLint_BuildPolicies.cpp +++ b/toolsrc/src/PostBuildLint_BuildPolicies.cpp @@ -8,6 +8,7 @@ namespace vcpkg::PostBuildLint::BuildPolicies static const std::string NAME_EMPTY_PACKAGE = "PolicyEmptyPackage"; static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs"; + static const std::string NAME_NO_DEBUG_BINARIES = "PolicyNoDebugBinaries"; const std::string& type::toString() const { @@ -17,6 +18,8 @@ namespace vcpkg::PostBuildLint::BuildPolicies return NAME_EMPTY_PACKAGE; case DLLS_WITHOUT_LIBS: return NAME_DLLS_WITHOUT_LIBS; + case NO_DEBUG_BINARIES: + return NAME_NO_DEBUG_BINARIES; case NULLVALUE: return NULLVALUE_STRING; default: @@ -28,6 +31,7 @@ namespace vcpkg::PostBuildLint::BuildPolicies { static const std::string CMAKE_VARIABLE_EMPTY_PACKAGE = "VCPKG_POLICY_EMPTY_PACKAGE"; static const std::string CMAKE_VARIABLE_DLLS_WITHOUT_LIBS = "VCPKG_POLICY_DLLS_WITHOUT_LIBS"; + static const std::string CMAKE_VARIABLE_NO_DEBUG_BINARIES = "VCPKG_POLICY_NO_DEBUG_BINARIES"; switch (this->backing_enum) { @@ -35,6 +39,8 @@ namespace vcpkg::PostBuildLint::BuildPolicies return CMAKE_VARIABLE_EMPTY_PACKAGE; case DLLS_WITHOUT_LIBS: return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS; + case NO_DEBUG_BINARIES: + return CMAKE_VARIABLE_NO_DEBUG_BINARIES; case NULLVALUE: Enums::nullvalue_used(ENUM_NAME); default: @@ -54,6 +60,11 @@ namespace vcpkg::PostBuildLint::BuildPolicies return BuildPolicies::DLLS_WITHOUT_LIBS; } + if (s == NAME_NO_DEBUG_BINARIES) + { + return BuildPolicies::NO_DEBUG_BINARIES; + } + return BuildPolicies::NULLVALUE; } } From d7fb7b7736cd7cd67cedab31772c60430fecb927 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Mar 2017 19:01:11 -0800 Subject: [PATCH 501/561] [msmpi] Enable NoDebugBinaries policy. Resolves #728 --- ports/msmpi/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/msmpi/portfile.cmake b/ports/msmpi/portfile.cmake index faf0123963..7d79068d79 100644 --- a/ports/msmpi/portfile.cmake +++ b/ports/msmpi/portfile.cmake @@ -96,6 +96,7 @@ endif() # Install debug libraries # NOTE: since the binary distribution does not include any debug libraries we simply install the release libraries +SET(VCPKG_POLICY_NO_DEBUG_BINARIES enabled) file(INSTALL "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpi.lib" "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifec.lib" From b03b578ffc27a9f0d4d9c7a8edc8edeea487dce3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Mar 2017 19:09:24 -0800 Subject: [PATCH 502/561] Rename policy to OnlyReleaseCRT --- ports/msmpi/CONTROL | 2 +- ports/msmpi/portfile.cmake | 2 +- scripts/ports.cmake | 4 ++-- toolsrc/include/PostBuildLint_BuildPolicies.h | 6 +++--- toolsrc/src/PostBuildLint.cpp | 2 +- toolsrc/src/PostBuildLint_BuildPolicies.cpp | 16 ++++++++-------- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ports/msmpi/CONTROL b/ports/msmpi/CONTROL index 44752712a8..e17fd1c001 100644 --- a/ports/msmpi/CONTROL +++ b/ports/msmpi/CONTROL @@ -1,3 +1,3 @@ Source: msmpi -Version: 8.0 +Version: 8.0-1 Description: Microsoft MPI diff --git a/ports/msmpi/portfile.cmake b/ports/msmpi/portfile.cmake index 7d79068d79..38c90778eb 100644 --- a/ports/msmpi/portfile.cmake +++ b/ports/msmpi/portfile.cmake @@ -96,7 +96,7 @@ endif() # Install debug libraries # NOTE: since the binary distribution does not include any debug libraries we simply install the release libraries -SET(VCPKG_POLICY_NO_DEBUG_BINARIES enabled) +SET(VCPKG_POLICY_ONLY_RELEASE_CRT enabled) file(INSTALL "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpi.lib" "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifec.lib" diff --git a/scripts/ports.cmake b/scripts/ports.cmake index dbc547676d..e83b83d886 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -82,8 +82,8 @@ if(CMD MATCHES "^BUILD$") if (DEFINED VCPKG_POLICY_EMPTY_PACKAGE) file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyEmptyPackage: ${VCPKG_POLICY_EMPTY_PACKAGE}\n") endif() - if (DEFINED VCPKG_POLICY_NO_DEBUG_BINARIES) - file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyNoDebugBinaries: ${VCPKG_POLICY_NO_DEBUG_BINARIES}\n") + if (DEFINED VCPKG_POLICY_ONLY_RELEASE_CRT) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyOnlyReleaseCRT: ${VCPKG_POLICY_ONLY_RELEASE_CRT}\n") endif() elseif(CMD MATCHES "^CREATE$") file(TO_NATIVE_PATH ${VCPKG_ROOT_DIR} NATIVE_VCPKG_ROOT_DIR) diff --git a/toolsrc/include/PostBuildLint_BuildPolicies.h b/toolsrc/include/PostBuildLint_BuildPolicies.h index 42bd3d718f..d815c6d275 100644 --- a/toolsrc/include/PostBuildLint_BuildPolicies.h +++ b/toolsrc/include/PostBuildLint_BuildPolicies.h @@ -9,7 +9,7 @@ namespace vcpkg::PostBuildLint::BuildPolicies NULLVALUE = 0, EMPTY_PACKAGE, DLLS_WITHOUT_LIBS, - NO_DEBUG_BINARIES + ONLY_RELEASE_CRT }; struct type @@ -30,9 +30,9 @@ namespace vcpkg::PostBuildLint::BuildPolicies static constexpr type NULLVALUE(backing_enum_t::NULLVALUE); static constexpr type EMPTY_PACKAGE(backing_enum_t::EMPTY_PACKAGE); static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); - static constexpr type NO_DEBUG_BINARIES(backing_enum_t::NO_DEBUG_BINARIES); + static constexpr type ONLY_RELEASE_CRT(backing_enum_t::ONLY_RELEASE_CRT); - static constexpr std::array values = { EMPTY_PACKAGE, DLLS_WITHOUT_LIBS, NO_DEBUG_BINARIES }; + static constexpr std::array values = { EMPTY_PACKAGE, DLLS_WITHOUT_LIBS, ONLY_RELEASE_CRT }; type parse(const std::string& s); } diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index b0edaf805a..8abf71bb36 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -684,7 +684,7 @@ namespace vcpkg::PostBuildLint error_count += check_bin_folders_are_not_present_in_static_build(package_dir); - if (!contains_and_enabled(build_info.policies, BuildPolicies::NO_DEBUG_BINARIES)) + if (!contains_and_enabled(build_info.policies, BuildPolicies::ONLY_RELEASE_CRT)) { error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, build_info.crt_linkage), debug_libs, dumpbin_exe); } diff --git a/toolsrc/src/PostBuildLint_BuildPolicies.cpp b/toolsrc/src/PostBuildLint_BuildPolicies.cpp index 2e0a1713bf..f070a2a429 100644 --- a/toolsrc/src/PostBuildLint_BuildPolicies.cpp +++ b/toolsrc/src/PostBuildLint_BuildPolicies.cpp @@ -8,7 +8,7 @@ namespace vcpkg::PostBuildLint::BuildPolicies static const std::string NAME_EMPTY_PACKAGE = "PolicyEmptyPackage"; static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs"; - static const std::string NAME_NO_DEBUG_BINARIES = "PolicyNoDebugBinaries"; + static const std::string NAME_ONLY_RELEASE_CRT = "PolicyOnlyReleaseCRT"; const std::string& type::toString() const { @@ -18,8 +18,8 @@ namespace vcpkg::PostBuildLint::BuildPolicies return NAME_EMPTY_PACKAGE; case DLLS_WITHOUT_LIBS: return NAME_DLLS_WITHOUT_LIBS; - case NO_DEBUG_BINARIES: - return NAME_NO_DEBUG_BINARIES; + case ONLY_RELEASE_CRT: + return NAME_ONLY_RELEASE_CRT; case NULLVALUE: return NULLVALUE_STRING; default: @@ -31,7 +31,7 @@ namespace vcpkg::PostBuildLint::BuildPolicies { static const std::string CMAKE_VARIABLE_EMPTY_PACKAGE = "VCPKG_POLICY_EMPTY_PACKAGE"; static const std::string CMAKE_VARIABLE_DLLS_WITHOUT_LIBS = "VCPKG_POLICY_DLLS_WITHOUT_LIBS"; - static const std::string CMAKE_VARIABLE_NO_DEBUG_BINARIES = "VCPKG_POLICY_NO_DEBUG_BINARIES"; + static const std::string CMAKE_VARIABLE_ONLY_RELEASE_CRT = "VCPKG_POLICY_ONLY_RELEASE_CRT"; switch (this->backing_enum) { @@ -39,8 +39,8 @@ namespace vcpkg::PostBuildLint::BuildPolicies return CMAKE_VARIABLE_EMPTY_PACKAGE; case DLLS_WITHOUT_LIBS: return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS; - case NO_DEBUG_BINARIES: - return CMAKE_VARIABLE_NO_DEBUG_BINARIES; + case ONLY_RELEASE_CRT: + return CMAKE_VARIABLE_ONLY_RELEASE_CRT; case NULLVALUE: Enums::nullvalue_used(ENUM_NAME); default: @@ -60,9 +60,9 @@ namespace vcpkg::PostBuildLint::BuildPolicies return BuildPolicies::DLLS_WITHOUT_LIBS; } - if (s == NAME_NO_DEBUG_BINARIES) + if (s == NAME_ONLY_RELEASE_CRT) { - return BuildPolicies::NO_DEBUG_BINARIES; + return BuildPolicies::ONLY_RELEASE_CRT; } return BuildPolicies::NULLVALUE; From c055def45369d89c3b3fca3e57b57a9547d3b6a6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 23 Feb 2017 05:33:21 -0800 Subject: [PATCH 503/561] [vcpkg] Switch printing functions to use fputs and putchar directly. --- toolsrc/src/vcpkg_System.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 90ec9c99ca..2b37da685b 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -51,13 +51,13 @@ namespace vcpkg::System void print(const char* message) { - std::cout << message; + fputs(message, stdout); } void println(const char* message) { print(message); - std::cout << "\n"; + putchar('\n'); } void print(const color c, const char* message) @@ -69,14 +69,14 @@ namespace vcpkg::System auto original_color = consoleScreenBufferInfo.wAttributes; SetConsoleTextAttribute(hConsole, static_cast(c) | (original_color & 0xF0)); - std::cout << message; + print(message); SetConsoleTextAttribute(hConsole, original_color); } void println(const color c, const char* message) { print(c, message); - std::cout << "\n"; + putchar('\n'); } optional get_environmental_variable(const wchar_t* varname) noexcept From 4806aaf460465b972ad1b6203ca744431b296ade Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 4 Mar 2017 06:10:59 -0800 Subject: [PATCH 504/561] [vcpkg] Remove more uses of iostreams. Force 'C' locale -- localization is TODO. --- toolsrc/src/vcpkg.cpp | 32 +++++++++++++++++--------------- toolsrc/src/vcpkg_Strings.cpp | 14 ++++++++++---- toolsrc/src/vcpkg_System.cpp | 8 ++++---- 3 files changed, 31 insertions(+), 23 deletions(-) diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index f40126ecfe..a263be8bce 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -180,9 +180,6 @@ int wmain(const int argc, const wchar_t* const* const argv) if (argc == 0) std::abort(); - std::cout.sync_with_stdio(false); - std::cout.imbue(std::locale::classic()); - g_timer.start(); atexit([]() { @@ -231,17 +228,22 @@ int wmain(const int argc, const wchar_t* const* const argv) exc_msg = "unknown error(...)"; } TrackProperty("error", exc_msg); - std::cerr - << "vcpkg.exe has crashed.\n" - << "Please send an email to:\n" - << " " << Commands::Contact::email() << "\n" - << "containing a brief summary of what you were trying to do and the following data blob:\n" - << "\n" - << "Version=" << Commands::Version::version() << "\n" - << "EXCEPTION='" << exc_msg << "'\n" - << "CMD=\n"; + + fflush(stdout); + System::print( + "vcpkg.exe has crashed.\n" + "Please send an email to:\n" + " %s\n" + "containing a brief summary of what you were trying to do and the following data blob:\n" + "\n" + "Version=%s\n" + "EXCEPTION='%s'\n" + "CMD=\n", + Commands::Contact::email(), + Commands::Version::version(), + exc_msg); + fflush(stdout); for (int x = 0; x < argc; ++x) - std::cerr << Strings::utf16_to_utf8(argv[x]) << "|\n"; - std::cerr - << "\n"; + System::println("%s|", Strings::utf16_to_utf8(argv[x])); + fflush(stdout); } diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 35ebcc90f3..a7805f2114 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -15,14 +15,20 @@ namespace vcpkg::Strings::details return static_cast(std::tolower(c)); } + static _locale_t& c_locale() + { + static _locale_t c_locale_impl = _create_locale(LC_ALL, "C"); + return c_locale_impl; + } + std::string format_internal(const char* fmtstr, ...) { va_list lst; va_start(lst, fmtstr); - const int sz = _vscprintf(fmtstr, lst); + const int sz = _vscprintf_l(fmtstr, c_locale(), lst); std::string output(sz, '\0'); - _vsnprintf_s(&output[0], output.size() + 1, output.size() + 1, fmtstr, lst); + _vsnprintf_s_l(&output[0], output.size() + 1, output.size() + 1, fmtstr, c_locale(), lst); va_end(lst); return output; @@ -33,9 +39,9 @@ namespace vcpkg::Strings::details va_list lst; va_start(lst, fmtstr); - const int sz = _vscwprintf(fmtstr, lst); + const int sz = _vscwprintf_l(fmtstr, c_locale(), lst); std::wstring output(sz, '\0'); - _vsnwprintf_s(&output[0], output.size() + 1, output.size() + 1, fmtstr, lst); + _vsnwprintf_s_l(&output[0], output.size() + 1, output.size() + 1, fmtstr, c_locale(), lst); va_end(lst); return output; diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 2b37da685b..9c849e8d85 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -14,8 +14,8 @@ namespace vcpkg::System int cmd_execute(const wchar_t* cmd_line) { - // Flush cout before launching external process - std::cout << std::flush; + // Flush stdout before launching external process + fflush(stdout); // Basically we are wrapping it in quotes const std::wstring& actual_cmd_line = Strings::wformat(LR"###("%s")###", cmd_line); @@ -25,8 +25,8 @@ namespace vcpkg::System exit_code_and_output cmd_execute_and_capture_output(const wchar_t* cmd_line) { - // Flush cout before launching external process - std::cout << std::flush; + // Flush stdout before launching external process + fflush(stdout); const std::wstring& actual_cmd_line = Strings::wformat(LR"###("%s")###", cmd_line); From 19695fc832f289e2e5ae08335d49bca568af8e27 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 4 Mar 2017 06:25:05 -0800 Subject: [PATCH 505/561] [vcpkg] Deduplicate all timer classes. --- toolsrc/include/vcpkg_Chrono.h | 36 +++------------------- toolsrc/include/vcpkg_System.h | 9 ------ toolsrc/src/commands_build.cpp | 9 +++--- toolsrc/src/vcpkg.cpp | 11 ++++--- toolsrc/src/vcpkg_Chrono.cpp | 56 ---------------------------------- toolsrc/src/vcpkg_System.cpp | 19 ------------ 6 files changed, 15 insertions(+), 125 deletions(-) diff --git a/toolsrc/include/vcpkg_Chrono.h b/toolsrc/include/vcpkg_Chrono.h index e4ae121b36..a9d1bbbede 100644 --- a/toolsrc/include/vcpkg_Chrono.h +++ b/toolsrc/include/vcpkg_Chrono.h @@ -10,7 +10,7 @@ namespace vcpkg public: static ElapsedTime createStarted(); - constexpr ElapsedTime() :m_startTick() {} + constexpr ElapsedTime() : m_startTick() {} template TimeUnit elapsed() const @@ -18,42 +18,14 @@ namespace vcpkg return std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - this->m_startTick); } - std::string toString() const; - - private: - std::chrono::steady_clock::time_point m_startTick; - }; - - class Stopwatch - { - public: - static Stopwatch createUnstarted(); - - static Stopwatch createStarted(); - - bool isRunning() const; - - const Stopwatch& start(); - - const Stopwatch& stop(); - - Stopwatch& reset(); - - template - TimeUnit elapsed() const + double microseconds() const { - return std::chrono::duration_cast(elapsedNanos()); + return elapsed>().count(); } std::string toString() const; private: - Stopwatch(); - - std::chrono::nanoseconds elapsedNanos() const; - - bool m_isRunning; - std::chrono::nanoseconds m_elapsedNanos; - std::chrono::steady_clock::time_point m_startTick; + std::chrono::high_resolution_clock::time_point m_startTick; }; } diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index 7634034ab9..a414ba0d4b 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -84,15 +84,6 @@ namespace vcpkg::System return println(c, Strings::format(messageTemplate, messageArgs...).c_str()); } - struct Stopwatch2 - { - int64_t start_time, end_time, freq; - - void start(); - void stop(); - double microseconds() const; - }; - optional get_environmental_variable(const wchar_t* varname) noexcept; void set_environmental_variable(const wchar_t* varname, const wchar_t* varvalue) noexcept; diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index e51d519f8c..02b98e28d0 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -6,6 +6,7 @@ #include "PostBuildLint.h" #include "vcpkg_Dependencies.h" #include "vcpkg_System.h" +#include "vcpkg_Chrono.h" #include "vcpkg_Environment.h" #include "metrics.h" #include "vcpkg_Enums.h" @@ -53,11 +54,11 @@ namespace vcpkg::Commands::Build port_dir.generic_wstring(), ports_cmake_script_path.generic_wstring()); - System::Stopwatch2 timer; - timer.start(); + ElapsedTime timer = ElapsedTime::createStarted(); + int return_code = System::cmd_execute(command); - timer.stop(); - TrackMetric("buildtimeus-" + spec.toString(), timer.microseconds()); + auto buildtimeus = timer.microseconds(); + TrackMetric("buildtimeus-" + spec.toString(), buildtimeus); if (return_code != 0) { diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index a263be8bce..e94d2538b6 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -13,6 +13,7 @@ #include "vcpkg_Input.h" #include "Paragraphs.h" #include "vcpkg_Strings.h" +#include "vcpkg_Chrono.h" using namespace vcpkg; @@ -153,8 +154,6 @@ static void loadConfig() } } -static System::Stopwatch2 g_timer; - static std::string trim_path_from_command_line(const std::string& full_command_line) { Checks::check_exit(full_command_line.size() > 0, "Internal failure - cannot have empty command line"); @@ -175,16 +174,18 @@ static std::string trim_path_from_command_line(const std::string& full_command_l return std::string(it, full_command_line.cend()); } +static ElapsedTime g_timer; + int wmain(const int argc, const wchar_t* const* const argv) { if (argc == 0) std::abort(); - g_timer.start(); + g_timer = ElapsedTime::createStarted(); atexit([]() { - g_timer.stop(); - TrackMetric("elapsed_us", g_timer.microseconds()); + auto elapsed_us = g_timer.microseconds(); + TrackMetric("elapsed_us", elapsed_us); Flush(); }); diff --git a/toolsrc/src/vcpkg_Chrono.cpp b/toolsrc/src/vcpkg_Chrono.cpp index 1bcb439bef..e39842df94 100644 --- a/toolsrc/src/vcpkg_Chrono.cpp +++ b/toolsrc/src/vcpkg_Chrono.cpp @@ -60,60 +60,4 @@ namespace vcpkg { return format_time_userfriendly(elapsed()); } - - Stopwatch Stopwatch::createUnstarted() - { - return Stopwatch(); - } - - Stopwatch Stopwatch::createStarted() - { - return Stopwatch().start(); - } - - bool Stopwatch::isRunning() const - { - return this->m_isRunning; - } - - const Stopwatch& Stopwatch::start() - { - Checks::check_exit(!this->m_isRunning, "This stopwatch is already running."); - this->m_isRunning = true; - this->m_startTick = std::chrono::high_resolution_clock::now(); - return *this; - } - - const Stopwatch& Stopwatch::stop() - { - auto tick = std::chrono::high_resolution_clock::now(); - Checks::check_exit(this->m_isRunning, "This stopwatch is already stopped."); - this->m_isRunning = false; - this->m_elapsedNanos += tick - this->m_startTick; - return *this; - } - - Stopwatch& Stopwatch::reset() - { - this->m_elapsedNanos = std::chrono::nanoseconds(); - this->m_isRunning = false; - return *this; - } - - std::string Stopwatch::toString() const - { - return format_time_userfriendly(this->elapsedNanos()); - } - - Stopwatch::Stopwatch() : m_isRunning(false), m_elapsedNanos(0), m_startTick() { } - - std::chrono::nanoseconds Stopwatch::elapsedNanos() const - { - if (this->m_isRunning) - { - return std::chrono::high_resolution_clock::now() - this->m_startTick + this->m_elapsedNanos; - } - - return this->m_elapsedNanos; - } } diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 9c849e8d85..679318768b 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -96,23 +96,4 @@ namespace vcpkg::System { _wputenv_s(varname, varvalue); } - - void Stopwatch2::start() - { - static_assert(sizeof(start_time) == sizeof(LARGE_INTEGER), ""); - - QueryPerformanceCounter(reinterpret_cast(&start_time)); - } - - void Stopwatch2::stop() - { - QueryPerformanceCounter(reinterpret_cast(&end_time)); - QueryPerformanceFrequency(reinterpret_cast(&freq)); - } - - double Stopwatch2::microseconds() const - { - return (reinterpret_cast(&end_time)->QuadPart - - reinterpret_cast(&start_time)->QuadPart) * 1000000.0 / reinterpret_cast(&freq)->QuadPart; - } } From 914664bf27b7bd339d09e3243fdbe4e5d54ef785 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 4 Mar 2017 06:48:59 -0800 Subject: [PATCH 506/561] [vcpkg-ci] Display per-package timing information. --- toolsrc/include/vcpkg_Strings.h | 5 +++++ toolsrc/src/commands_ci.cpp | 24 ++++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 8d5d7135bc..5b536e5e1e 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -19,6 +19,11 @@ namespace vcpkg::Strings::details return s; } + inline long long to_printf_arg(const long long s) + { + return s; + } + inline double to_printf_arg(const double s) { return s; diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index 2b7ba89d69..ac5aaecc23 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -43,24 +43,31 @@ namespace vcpkg::Commands::CI Environment::ensure_utilities_on_path(paths); std::vector results; + std::vector timing; const ElapsedTime timer = ElapsedTime::createStarted(); size_t counter = 0; const size_t package_count = install_plan.size(); for (const package_spec_with_install_plan& action : install_plan) { + const ElapsedTime build_timer = ElapsedTime::createStarted(); counter++; - System::println("Starting package %d/%d: %s. Time Elapsed: %s", counter, package_count, action.spec.toString(), timer.toString()); + System::println("Starting package %d/%d: %s", counter, package_count, action.spec.toString()); + + timing.push_back(-1); + results.push_back(BuildResult::NULLVALUE); + try { if (action.plan.plan_type == install_plan_type::ALREADY_INSTALLED) { - results.push_back(BuildResult::SUCCEEDED); + results.back() = BuildResult::SUCCEEDED; System::println(System::color::success, "Package %s is already installed", action.spec); } else if (action.plan.plan_type == install_plan_type::BUILD_AND_INSTALL) { const BuildResult result = Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec), status_db); - results.push_back(result); + timing.back() = build_timer.elapsed().count(); + results.back() = result; if (result != BuildResult::SUCCEEDED) { System::println(System::color::error, Build::create_error_message(result, action.spec)); @@ -72,9 +79,9 @@ namespace vcpkg::Commands::CI } else if (action.plan.plan_type == install_plan_type::INSTALL) { - results.push_back(BuildResult::SUCCEEDED); + results.back() = BuildResult::SUCCEEDED; Install::install_package(paths, *action.plan.binary_pgh, &status_db); - System::println(System::color::success, "Package %s is installed", action.spec); + System::println(System::color::success, "Package %s is installed from cache", action.spec); } else Checks::unreachable(); @@ -82,11 +89,12 @@ namespace vcpkg::Commands::CI catch (const std::exception& e) { System::println(System::color::error, "Error: Could not install package %s: %s", action.spec, e.what()); - exit(EXIT_FAILURE); + results.back() = BuildResult::NULLVALUE; } + System::println("Elapsed time for package %s: %s", action.spec, build_timer.toString()); } - System::println(timer.toString()); + System::println("Total time taken: %s", timer.toString()); for (size_t i = 0; i < results.size(); i++) { @@ -95,7 +103,7 @@ namespace vcpkg::Commands::CI continue; } - System::println("%s: %s", install_plan[i].spec.toString(), Build::to_string(results[i])); + System::println("%s: %s: %dms", install_plan[i].spec.toString(), Build::to_string(results[i]), timing[i]); } std::map summary; From 829e831232cf4fab8dd07ee0ecc73f43cf5e97b7 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 5 Mar 2017 01:33:27 -0800 Subject: [PATCH 507/561] [msmpi] Increase logging of msiexec extraction --- ports/msmpi/portfile.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/msmpi/portfile.cmake b/ports/msmpi/portfile.cmake index 38c90778eb..6125a20f65 100644 --- a/ports/msmpi/portfile.cmake +++ b/ports/msmpi/portfile.cmake @@ -54,9 +54,10 @@ endif() file(TO_NATIVE_PATH "${SDK_ARCHIVE}" SDK_ARCHIVE) file(TO_NATIVE_PATH "${SOURCE_PATH}/sdk" SDK_SOURCE_DIR) +file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/msiexec-${TARGET_TRIPLET}.log" MSIEXEC_LOG_PATH) vcpkg_execute_required_process( - COMMAND msiexec /a ${SDK_ARCHIVE} /qn TARGETDIR=${SDK_SOURCE_DIR} + COMMAND msiexec /a ${SDK_ARCHIVE} /qn TARGETDIR=${SDK_SOURCE_DIR} /log "${MSIEXEC_LOG_PATH}" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME extract-sdk ) From 2825c305e3e8c0b80b40a259d28ac318b819e7c3 Mon Sep 17 00:00:00 2001 From: codicodi Date: Sun, 5 Mar 2017 12:52:49 +0100 Subject: [PATCH 508/561] [poco & openjpeg] Prevent installation of CRT redistributables --- ports/openjpeg/CONTROL | 2 +- ports/openjpeg/portfile.cmake | 15 +++-------- ports/poco/CONTROL | 4 +-- ports/poco/portfile.cmake | 50 ++++++++++++++++------------------- 4 files changed, 29 insertions(+), 42 deletions(-) diff --git a/ports/openjpeg/CONTROL b/ports/openjpeg/CONTROL index f137d0ebc2..cd2f0aaa8d 100644 --- a/ports/openjpeg/CONTROL +++ b/ports/openjpeg/CONTROL @@ -1,3 +1,3 @@ Source: openjpeg -Version: 2.1.2 +Version: 2.1.2-1 Description: JPEG 2000 image library diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake index dfa25881d4..efda08313b 100644 --- a/ports/openjpeg/portfile.cmake +++ b/ports/openjpeg/portfile.cmake @@ -9,8 +9,10 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA OPTIONS -DBUILD_CODEC:BOOL=OFF -DOPENJPEG_INSTALL_PACKAGE_DIR=share/openjpeg + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() @@ -23,19 +25,8 @@ string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" OPENJPEG_DEBUG_MO file(WRITE ${CURRENT_PACKAGES_DIR}/share/openjpeg/OpenJPEGTargets-debug.cmake "${OPENJPEG_DEBUG_MODULE}") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -# Cleanup bin directories in static builds -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) -endif() - -# Cleanup Visual C++ Redistributable runtime -file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/msvcp140.dll) -file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/vcruntime140.dll) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/msvcp140.dll) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vcruntime140.dll) - # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openjpeg) file(RENAME ${CURRENT_PACKAGES_DIR}/share/openjpeg/LICENSE ${CURRENT_PACKAGES_DIR}/share/openjpeg/copyright) -vcpkg_copy_pdbs() \ No newline at end of file +vcpkg_copy_pdbs() diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL index ae2758c1f3..555be3a5dc 100644 --- a/ports/poco/CONTROL +++ b/ports/poco/CONTROL @@ -1,4 +1,4 @@ Source: poco -Version: 1.7.6-3 +Version: 1.7.6-4 Build-Depends: zlib, pcre, sqlite3, expat -Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. \ No newline at end of file +Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index e774c3c17c..f61ce16d97 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -11,24 +11,26 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES - ${CMAKE_CURRENT_LIST_DIR}/config_h.patch - ${CMAKE_CURRENT_LIST_DIR}/find_pcre.patch - ${CMAKE_CURRENT_LIST_DIR}/foundation-public-include-pcre.patch + ${CMAKE_CURRENT_LIST_DIR}/config_h.patch + ${CMAKE_CURRENT_LIST_DIR}/find_pcre.patch + ${CMAKE_CURRENT_LIST_DIR}/foundation-public-include-pcre.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(POCO_STATIC ON) + set(POCO_STATIC ON) else() - set(POCO_STATIC OFF) + set(POCO_STATIC OFF) endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DPOCO_STATIC=${POCO_STATIC} - -DENABLE_SEVENZIP=ON - -DENABLE_TESTS=OFF - -DPOCO_UNBUNDLED=ON # OFF means: using internal copy of sqlite, libz, pcre, expat, ... + PREFER_NINJA + OPTIONS + -DPOCO_STATIC=${POCO_STATIC} + -DENABLE_SEVENZIP=ON + -DENABLE_TESTS=OFF + -DPOCO_UNBUNDLED=ON # OFF means: using internal copy of sqlite, libz, pcre, expat, ... + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() @@ -38,23 +40,17 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/bin/cpspc.exe ${CURRENT_PACKAGES_DIR}/tools/ file(RENAME ${CURRENT_PACKAGES_DIR}/bin/f2cpsp.exe ${CURRENT_PACKAGES_DIR}/tools/f2cpsp.exe) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/debug/bin) else() - file(REMOVE - ${CURRENT_PACKAGES_DIR}/bin/cpspc.pdb - ${CURRENT_PACKAGES_DIR}/bin/f2cpsp.pdb - ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.exe - ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.pdb - ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.exe - ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.pdb) - - file(REMOVE - ${CURRENT_PACKAGES_DIR}/bin/vcruntime140.dll - ${CURRENT_PACKAGES_DIR}/bin/msvcp140.dll - ${CURRENT_PACKAGES_DIR}/debug/bin/vcruntime140.dll - ${CURRENT_PACKAGES_DIR}/debug/bin/msvcp140.dll) + file(REMOVE + ${CURRENT_PACKAGES_DIR}/bin/cpspc.pdb + ${CURRENT_PACKAGES_DIR}/bin/f2cpsp.pdb + ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.pdb + ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.pdb) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) @@ -63,4 +59,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) # copy license file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/poco) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/poco/LICENSE ${CURRENT_PACKAGES_DIR}/share/poco/copyright) \ No newline at end of file +file(RENAME ${CURRENT_PACKAGES_DIR}/share/poco/LICENSE ${CURRENT_PACKAGES_DIR}/share/poco/copyright) From 329822c210a9473ac4d84c276d90472de89177ea Mon Sep 17 00:00:00 2001 From: Nicolas Riebesel Date: Fri, 24 Feb 2017 06:16:23 +0100 Subject: [PATCH 509/561] Add initial fftw3 support --- ports/fftw3/CMakeLists.txt | 93 ++++++++ ports/fftw3/CONTROL | 3 + ports/fftw3/config.h | 393 ++++++++++++++++++++++++++++++++++ ports/fftw3/fix-dynamic.patch | 11 + ports/fftw3/portfile.cmake | 42 ++++ 5 files changed, 542 insertions(+) create mode 100644 ports/fftw3/CMakeLists.txt create mode 100644 ports/fftw3/CONTROL create mode 100644 ports/fftw3/config.h create mode 100644 ports/fftw3/fix-dynamic.patch create mode 100644 ports/fftw3/portfile.cmake diff --git a/ports/fftw3/CMakeLists.txt b/ports/fftw3/CMakeLists.txt new file mode 100644 index 0000000000..fb9a9680fb --- /dev/null +++ b/ports/fftw3/CMakeLists.txt @@ -0,0 +1,93 @@ +cmake_minimum_required ( VERSION 3.0 ) +PROJECT ( fftw3 ) + +# From: http://stackoverflow.com/questions/10252336/fftw-in-visual-studio-2010 + +# Standard: /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR +IF (WIN32) + SET(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W4 /Zi /EHsc /GR- /MP /openmp /bigobj") + ADD_DEFINITIONS(-D_OPENMP -DFFTW_DLL -DLIBFFTWF33_EXPORTS) # Visual Studio 2005 and up supports OpenMP +ENDIF (WIN32) + + +file(GLOB fftw_api_SOURCE api/*.c api/*.h) +file(GLOB fftw_dft_SOURCE dft/*.c dft/*.h) +file(GLOB fftw_dft_scalar_SOURCE dft/scalar/*.c dft/scalar/*.h) +file(GLOB fftw_dft_scalar_codelets_SOURCE dft/scalar/codelets/*.c dft/scalar/codelets/*.h) +file(GLOB fftw_dft_simd_SOURCE dft/simd/*.c dft/simd/*.h) + +file(GLOB fftw_dft_simd_sse2_SOURCE dft/simd/sse2/*.c dft/simd/sse2/*.h) +file(GLOB fftw_kernel_SOURCE kernel/*.c kernel/*.h) +file(GLOB fftw_rdft_SOURCE rdft/*.c rdft/*.h) +file(GLOB fftw_rdft_scalar_SOURCE rdft/scalar/*.c rdft/scalar/*.h) + +file(GLOB fftw_rdft_scalar_r2cb_SOURCE rdft/scalar/r2cb/*.c + rdft/scalar/r2cb/*.h) +file(GLOB fftw_rdft_scalar_r2cf_SOURCE rdft/scalar/r2cf/*.c + rdft/scalar/r2cf/*.h) +file(GLOB fftw_rdft_scalar_r2r_SOURCE rdft/scalar/r2r/*.c + rdft/scalar/r2r/*.h) + +file(GLOB fftw_rdft_simd_SOURCE rdft/simd/*.c rdft/simd/*.h) +file(GLOB fftw_rdft_simd_sse2_SOURCE rdft/simd/sse2/*.c rdft/simd/sse2/*.h) + +file(GLOB fftw_reodft_SOURCE reodft/*.c reodft/*.h) +file(GLOB fftw_simd_support_SOURCE simd-support/*.c simd-support/*.h) +#file(GLOB fftw_threads_SOURCE threads/*.c threads/*.h) + + +set(${fftw_threads_SOURCE} + threads/api.c + threads/conf.c + threads/ct.c + threads/dft-vrank-qeq1.c + threads/f77api.c + threads/hc2hc.c + threads/openmp.c + threads/rdft-vrank-geq1.c + threads/vrank-geq1-rdft2.c) + + +include_directories( + kernel + api + dft + dft/scalar + dft/scalar/codelets # rellay needed? + dft/simd + dft/simd/sse2 + rdft + rdft/scalar + rdft/simd + reodft + ${CMAKE_CURRENT_SOURCE_DIR} # thats where the config.h is located + simd-support +) + +# Create a target for the library +ADD_LIBRARY(fftw3 SHARED + ${fftw_api_SOURCE} + ${fftw_dft_SOURCE} + ${fftw_dft_scalar_SOURCE} + ${fftw_dft_scalar_codelets_SOURCE} + ${fftw_dft_simd_SOURCE} + ${fftw_dft_simd_sse2_SOURCE} + ${fftw_kernel_SOURCE} + ${fftw_rdft_SOURCE} + ${fftw_rdft_scalar_SOURCE} + + ${fftw_rdft_scalar_r2cb_SOURCE} + ${fftw_rdft_scalar_r2cf_SOURCE} + ${fftw_rdft_scalar_r2r_SOURCE} + + ${fftw_rdft_simd_SOURCE} + ${fftw_rdft_simd_sse2_SOURCE} + ${fftw_reodft_SOURCE} + ${fftw_simd_support_SOURCE} + ${fftw_threads_SOURCE} +) + +install(TARGETS fftw3 + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) \ No newline at end of file diff --git a/ports/fftw3/CONTROL b/ports/fftw3/CONTROL new file mode 100644 index 0000000000..e7a464d65d --- /dev/null +++ b/ports/fftw3/CONTROL @@ -0,0 +1,3 @@ +Source: fftw3 +Version: 3.3.6-p11 +Description: FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST). diff --git a/ports/fftw3/config.h b/ports/fftw3/config.h new file mode 100644 index 0000000000..0b543354e8 --- /dev/null +++ b/ports/fftw3/config.h @@ -0,0 +1,393 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to compile in long-double precision. */ +#undef BENCHFFT_LDOUBLE + +/* Define to compile in quad precision. */ +#undef BENCHFFT_QUAD + +/* Define to compile in single precision. */ +#undef BENCHFFT_SINGLE + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define to disable Fortran wrappers. */ +#define DISABLE_FORTRAN 1 + +/* Define to dummy `main' function (if any) required to link to the Fortran + libraries. */ +#undef F77_DUMMY_MAIN + +/* Define to a macro mangling the given C identifier (in lower and upper + case), which must not contain underscores, for linking with Fortran. */ +#undef F77_FUNC + +/* As F77_FUNC, but for C identifiers containing underscores. */ +#undef F77_FUNC_ + +/* Define if F77_FUNC and F77_FUNC_ are equivalent. */ +#undef F77_FUNC_EQUIV + +/* Define if F77 and FC dummy `main' functions are identical. */ +#undef FC_DUMMY_MAIN_EQ_F77 + +/* C compiler name and flags */ +#define FFTW_CC "cl" + +/* Define to enable extra FFTW debugging code. */ +#undef FFTW_DEBUG + +/* Define to enable alignment debugging hacks. */ +#undef FFTW_DEBUG_ALIGNMENT + +/* Define to enable debugging malloc. */ +#undef FFTW_DEBUG_MALLOC + +/* Define to enable the use of alloca(). */ +#undef FFTW_ENABLE_ALLOCA + +/* Define to compile in long-double precision. */ +#undef FFTW_LDOUBLE + +/* Define to compile in quad precision. */ +#undef FFTW_QUAD + +/* Define to enable pseudorandom estimate planning for debugging. */ +#undef FFTW_RANDOM_ESTIMATOR + +/* Define to compile in single precision. */ +#undef FFTW_SINGLE + +/* Define to 1 if you have the `abort' function. */ +#define HAVE_ABORT 1 + +/* Define to 1 if you have `alloca', as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#undef HAVE_ALLOCA_H + +/* Define to enable Altivec optimizations. */ +#undef HAVE_ALTIVEC + +/* Define to 1 if you have the header file. */ +#undef HAVE_ALTIVEC_H + +/* Define to enable AVX optimizations. */ +#undef HAVE_AVX + +/* Define to 1 if you have the `BSDgettimeofday' function. */ +#undef HAVE_BSDGETTIMEOFDAY + +/* Define to 1 if you have the `clock_gettime' function. */ +#undef HAVE_CLOCK_GETTIME + +/* Define to 1 if you have the `cosl' function. */ +#define HAVE_COSL 1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_C_ASM_H + +/* Define to 1 if you have the declaration of `cosl', and to 0 if you don't. + */ +#define HAVE_DECL_COSL 1 + +/* Define to 1 if you have the declaration of `cosq', and to 0 if you don't. */ +#define HAVE_DECL_COSQ 0 + +/* Define to 1 if you have the declaration of `drand48', and to 0 if you don't. */ +#define HAVE_DECL_DRAND48 0 + +/* Define to 1 if you have the declaration of `memalign', and to 0 if you don't. */ +#define HAVE_DECL_MEMALIGN 0 + +/* Define to 1 if you have the declaration of `posix_memalign', and to 0 if you don't. */ +#define HAVE_DECL_POSIX_MEMALIGN 0 + +/* Define to 1 if you have the declaration of `sinl', and to 0 if you don't. */ +#define HAVE_DECL_SINL 1 + +/* Define to 1 if you have the declaration of `sinq', and to 0 if you don't. + */ +#define HAVE_DECL_SINQ 0 + +/* Define to 1 if you have the declaration of `srand48', and to 0 if you + don't. */ +#define HAVE_DECL_SRAND48 0 + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT + +/* Define to 1 if you have the `drand48' function. */ +#undef HAVE_DRAND48 + +/* Define if you have a machine with fused multiply-add */ +#undef HAVE_FMA + +/* Define to 1 if you have the `gethrtime' function. */ +#undef HAVE_GETHRTIME + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if hrtime_t is defined in */ +#undef HAVE_HRTIME_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTRINSICS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if the isnan() function/macro is available. */ +#undef HAVE_ISNAN + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBINTL_H + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if you have the `quadmath' library (-lquadmath). */ +#undef HAVE_LIBQUADMATH + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if the compiler supports `long double' */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if you have the `mach_absolute_time' function. */ +#undef HAVE_MACH_ABSOLUTE_TIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_MACH_MACH_TIME_H + +/* Define to 1 if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the `memalign' function. */ +#undef HAVE_MEMALIGN + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to enable MIPS paired-single optimizations. */ +#undef HAVE_MIPS_PS + +/* Define to enable use of MIPS ZBus cycle-counter. */ +#undef HAVE_MIPS_ZBUS_TIMER + +/* Define if you have the MPI library. */ +#undef HAVE_MPI + +/* Define if OpenMP is enabled */ +#define HAVE_OPENMP 1 + +/* Define to 1 if you have the `posix_memalign' function. */ +#undef HAVE_POSIX_MEMALIGN + +/* Define if you have POSIX threads libraries and header files. */ +#undef HAVE_PTHREAD + +/* Define to 1 if you have the `read_real_time' function. */ +#undef HAVE_READ_REAL_TIME + +/* Define to 1 if you have the `sinl' function. */ +#define HAVE_SINL 1 + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define to 1 if you have the `sqrt' function. */ +#define HAVE_SQRT 1 + +/* Define to enable SSE/SSE2 optimizations. */ +#define HAVE_SSE2 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `sysctl' function. */ +#undef HAVE_SYSCTL + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SYSCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `tanl' function. */ +#define HAVE_TANL 1 + +/* Define if we have a threads library. */ +#undef HAVE_THREADS + +/* Define to 1 if you have the `time_base_to_time' function. */ +#undef HAVE_TIME_BASE_TO_TIME + +/* Define to 1 if the system has the type `uintptr_t'. */ +#define HAVE_UINTPTR_T 1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Define to 1 if you have the `_mm_free' function. */ +#undef HAVE__MM_FREE + +/* Define to 1 if you have the `_mm_malloc' function. */ +#undef HAVE__MM_MALLOC + +/* Define if you have the UNICOS _rtc() intrinsic. */ +#undef HAVE__RTC + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + +/* Name of package */ +#define PACKAGE "fftw" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "fftw@fftw.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "fftw" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "fftw-3.3" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "fftw" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "http://www.fftw.org" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "3.3" + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + +/* The size of `double', as computed by sizeof. */ +#define SIZEOF_DOUBLE 8 + +/* The size of `fftw_r2r_kind', as computed by sizeof. */ +#undef SIZEOF_FFTW_R2R_KIND + +/* The size of `float', as computed by sizeof. */ +#define SIZEOF_FLOAT 4 + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `MPI_Fint', as computed by sizeof. */ +#undef SIZEOF_MPI_FINT + +/* The size of `ptrdiff_t', as computed by sizeof. */ +#define SIZEOF_PTRDIFF_T 4 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + +/* The size of `unsigned int', as computed by sizeof. */ +#define SIZEOF_UNSIGNED_INT 4 + +/* The size of `unsigned long', as computed by sizeof. */ +#define SIZEOF_UNSIGNED_LONG 4 + +/* The size of `unsigned long long', as computed by sizeof. */ +#define SIZEOF_UNSIGNED_LONG_LONG 8 + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 4 + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define if we have and are using POSIX threads. */ +#undef USING_POSIX_THREADS + +/* Version number of package */ +#define VERSION "3.3" + +/* Use common Windows Fortran mangling styles for the Fortran interfaces. */ +#undef WINDOWS_F77_MANGLING + +/* Include g77-compatible wrappers in addition to any other Fortran wrappers. + */ +#undef WITH_G77_WRAPPERS + +/* Use our own aligned malloc routine; mainly helpful for Windows systems + lacking aligned allocation system-library routines. */ +#define WITH_OUR_MALLOC 1 + +/* Use low-precision timers, making planner very slow */ +#undef WITH_SLOW_TIMER + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#define inline __inline +#endif + +/* Define to `unsigned int' if does not define. */ +#undef size_t \ No newline at end of file diff --git a/ports/fftw3/fix-dynamic.patch b/ports/fftw3/fix-dynamic.patch new file mode 100644 index 0000000000..0ebbc87a4f --- /dev/null +++ b/ports/fftw3/fix-dynamic.patch @@ -0,0 +1,11 @@ +--- a/api/fftw3.h 2017-01-15 13:03:24.000000000 +0100 ++++ b/api/fftw3.h 2017-02-24 04:05:36.051091700 +0100 +@@ -47,6 +47,8 @@ + #ifndef FFTW3_H + #define FFTW3_H + ++#define FFTW_DLL ++ + #include + + #ifdef __cplusplus diff --git a/ports/fftw3/portfile.cmake b/ports/fftw3/portfile.cmake new file mode 100644 index 0000000000..c41be908db --- /dev/null +++ b/ports/fftw3/portfile.cmake @@ -0,0 +1,42 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (x86-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/fftw-3.3.6-pl1) +vcpkg_download_distfile(ARCHIVE + URLS "http://www.fftw.org/fftw-3.3.6-pl1.tar.gz" + FILENAME "fftw-3.3.6-pl1.tar.gz" + SHA512 e2ed33fcb068a36a841bbd898d12ceec74f4e9a0a349e7c55959878b50224a69a0f87656347dad7d7e1448ebc50d28d8f34f6da7992c43072d26942fd97c0134 +) + +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/fix-dynamic.patch) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(COPY ${SOURCE_PATH}/api/fftw3.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fftw3) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/fftw3/COPYING ${CURRENT_PACKAGES_DIR}/share/fftw3/copyright) From e89d6f54a3931834991baf69b7289104305bd415 Mon Sep 17 00:00:00 2001 From: Nicolas Riebesel Date: Mon, 6 Mar 2017 08:19:08 +0100 Subject: [PATCH 510/561] Make use of static and dynamic linking --- ports/fftw3/CMakeLists.txt | 28 ++++++++++++++-------------- ports/fftw3/portfile.cmake | 10 ++++++---- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/ports/fftw3/CMakeLists.txt b/ports/fftw3/CMakeLists.txt index fb9a9680fb..e2ce63b30d 100644 --- a/ports/fftw3/CMakeLists.txt +++ b/ports/fftw3/CMakeLists.txt @@ -1,13 +1,13 @@ -cmake_minimum_required ( VERSION 3.0 ) -PROJECT ( fftw3 ) +cmake_minimum_required (VERSION 3.0) +project (fftw3) # From: http://stackoverflow.com/questions/10252336/fftw-in-visual-studio-2010 # Standard: /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR -IF (WIN32) - SET(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W4 /Zi /EHsc /GR- /MP /openmp /bigobj") - ADD_DEFINITIONS(-D_OPENMP -DFFTW_DLL -DLIBFFTWF33_EXPORTS) # Visual Studio 2005 and up supports OpenMP -ENDIF (WIN32) +if (WIN32) + set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W4 /Zi /EHsc /GR- /MP /openmp /bigobj") + add_definitions(-D_OPENMP -DFFTW_DLL -DLIBFFTWF33_EXPORTS) # Visual Studio 2005 and up supports OpenMP +endif (WIN32) file(GLOB fftw_api_SOURCE api/*.c api/*.h) @@ -21,11 +21,11 @@ file(GLOB fftw_kernel_SOURCE kernel/*.c kernel/* file(GLOB fftw_rdft_SOURCE rdft/*.c rdft/*.h) file(GLOB fftw_rdft_scalar_SOURCE rdft/scalar/*.c rdft/scalar/*.h) -file(GLOB fftw_rdft_scalar_r2cb_SOURCE rdft/scalar/r2cb/*.c +file(GLOB fftw_rdft_scalar_r2cb_SOURCE rdft/scalar/r2cb/*.c rdft/scalar/r2cb/*.h) -file(GLOB fftw_rdft_scalar_r2cf_SOURCE rdft/scalar/r2cf/*.c +file(GLOB fftw_rdft_scalar_r2cf_SOURCE rdft/scalar/r2cf/*.c rdft/scalar/r2cf/*.h) -file(GLOB fftw_rdft_scalar_r2r_SOURCE rdft/scalar/r2r/*.c +file(GLOB fftw_rdft_scalar_r2r_SOURCE rdft/scalar/r2r/*.c rdft/scalar/r2r/*.h) file(GLOB fftw_rdft_simd_SOURCE rdft/simd/*.c rdft/simd/*.h) @@ -37,9 +37,9 @@ file(GLOB fftw_simd_support_SOURCE simd-support/*.c simd-sup set(${fftw_threads_SOURCE} - threads/api.c - threads/conf.c - threads/ct.c + threads/api.c + threads/conf.c + threads/ct.c threads/dft-vrank-qeq1.c threads/f77api.c threads/hc2hc.c @@ -65,7 +65,7 @@ include_directories( ) # Create a target for the library -ADD_LIBRARY(fftw3 SHARED +add_library(fftw3 ${fftw_api_SOURCE} ${fftw_dft_SOURCE} ${fftw_dft_scalar_SOURCE} @@ -90,4 +90,4 @@ ADD_LIBRARY(fftw3 SHARED install(TARGETS fftw3 RUNTIME DESTINATION bin ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib) \ No newline at end of file + LIBRARY DESTINATION lib) diff --git a/ports/fftw3/portfile.cmake b/ports/fftw3/portfile.cmake index c41be908db..f982e85f08 100644 --- a/ports/fftw3/portfile.cmake +++ b/ports/fftw3/portfile.cmake @@ -16,10 +16,12 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/fix-dynamic.patch) +if (VCPKG_CRT_LINKAGE STREQUAL dynamic) + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/fix-dynamic.patch) +endif() file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h DESTINATION ${SOURCE_PATH}) From cb1cf039d80c126b654ebb1c68a69c29a5f7b61b Mon Sep 17 00:00:00 2001 From: Nicolas Riebesel Date: Mon, 6 Mar 2017 09:17:07 +0100 Subject: [PATCH 511/561] Improve the static vs dynamic handling of fftw3 --- ports/fftw3/CMakeLists.txt | 6 +++++- ports/fftw3/fix-dynamic.patch | 4 ++-- ports/fftw3/portfile.cmake | 19 ++++++++----------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/ports/fftw3/CMakeLists.txt b/ports/fftw3/CMakeLists.txt index e2ce63b30d..88f7a2517a 100644 --- a/ports/fftw3/CMakeLists.txt +++ b/ports/fftw3/CMakeLists.txt @@ -6,9 +6,13 @@ project (fftw3) # Standard: /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR if (WIN32) set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W4 /Zi /EHsc /GR- /MP /openmp /bigobj") - add_definitions(-D_OPENMP -DFFTW_DLL -DLIBFFTWF33_EXPORTS) # Visual Studio 2005 and up supports OpenMP + add_definitions(-D_OPENMP -DLIBFFTWF33_EXPORTS) # Visual Studio 2005 and up supports OpenMP endif (WIN32) +if (BUILD_SHARED_LIBS) + add_definitions(-DFFTW_DLL) +endif() + file(GLOB fftw_api_SOURCE api/*.c api/*.h) file(GLOB fftw_dft_SOURCE dft/*.c dft/*.h) diff --git a/ports/fftw3/fix-dynamic.patch b/ports/fftw3/fix-dynamic.patch index 0ebbc87a4f..a39d1b9680 100644 --- a/ports/fftw3/fix-dynamic.patch +++ b/ports/fftw3/fix-dynamic.patch @@ -1,5 +1,5 @@ ---- a/api/fftw3.h 2017-01-15 13:03:24.000000000 +0100 -+++ b/api/fftw3.h 2017-02-24 04:05:36.051091700 +0100 +--- a/fftw3.h 2017-01-15 13:03:24.000000000 +0100 ++++ b/fftw3.h 2017-02-24 04:05:36.051091700 +0100 @@ -47,6 +47,8 @@ #ifndef FFTW3_H #define FFTW3_H diff --git a/ports/fftw3/portfile.cmake b/ports/fftw3/portfile.cmake index f982e85f08..fe97533b46 100644 --- a/ports/fftw3/portfile.cmake +++ b/ports/fftw3/portfile.cmake @@ -16,22 +16,12 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) -if (VCPKG_CRT_LINKAGE STREQUAL dynamic) - vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/fix-dynamic.patch) -endif() - file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA # Disable this option if project cannot be built with Ninja - # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 - # OPTIONS_RELEASE -DOPTIMIZE=1 - # OPTIONS_DEBUG -DDEBUGGABLE=1 + PREFER_NINJA ) vcpkg_install_cmake() @@ -39,6 +29,13 @@ vcpkg_copy_pdbs() file(COPY ${SOURCE_PATH}/api/fftw3.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) +if (VCPKG_CRT_LINKAGE STREQUAL dynamic) + vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/fix-dynamic.patch) +endif() + # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fftw3) file(RENAME ${CURRENT_PACKAGES_DIR}/share/fftw3/COPYING ${CURRENT_PACKAGES_DIR}/share/fftw3/copyright) From 09794f2b24c6e3cc79f47b91cbb4ecb55fcbae93 Mon Sep 17 00:00:00 2001 From: Nicolas Riebesel Date: Mon, 6 Mar 2017 13:49:05 +0100 Subject: [PATCH 512/561] Undef everything unneeded in config.h --- ports/fftw3/config.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ports/fftw3/config.h b/ports/fftw3/config.h index 0b543354e8..3fbe33864b 100644 --- a/ports/fftw3/config.h +++ b/ports/fftw3/config.h @@ -210,7 +210,7 @@ #define HAVE_SINL 1 /* Define to 1 if you have the `snprintf' function. */ -#undef HAVE_SNPRINTF +#define HAVE_SNPRINTF 1 /* Define to 1 if you have the `sqrt' function. */ #define HAVE_SQRT 1 @@ -308,43 +308,43 @@ #undef PTHREAD_CREATE_JOINABLE /* The size of `double', as computed by sizeof. */ -#define SIZEOF_DOUBLE 8 +#undef SIZEOF_DOUBLE /* The size of `fftw_r2r_kind', as computed by sizeof. */ #undef SIZEOF_FFTW_R2R_KIND /* The size of `float', as computed by sizeof. */ -#define SIZEOF_FLOAT 4 +#undef SIZEOF_FLOAT /* The size of `int', as computed by sizeof. */ -#define SIZEOF_INT 4 +#undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ -#define SIZEOF_LONG 4 +#undef SIZEOF_LONG /* The size of `long long', as computed by sizeof. */ -#define SIZEOF_LONG_LONG 8 +#undef SIZEOF_LONG_LONG /* The size of `MPI_Fint', as computed by sizeof. */ #undef SIZEOF_MPI_FINT /* The size of `ptrdiff_t', as computed by sizeof. */ -#define SIZEOF_PTRDIFF_T 4 +#undef SIZEOF_PTRDIFF_T /* The size of `size_t', as computed by sizeof. */ -#define SIZEOF_SIZE_T 4 +#undef SIZEOF_SIZE_T /* The size of `unsigned int', as computed by sizeof. */ -#define SIZEOF_UNSIGNED_INT 4 +#undef SIZEOF_UNSIGNED_INT /* The size of `unsigned long', as computed by sizeof. */ -#define SIZEOF_UNSIGNED_LONG 4 +#undef SIZEOF_UNSIGNED_LONG /* The size of `unsigned long long', as computed by sizeof. */ -#define SIZEOF_UNSIGNED_LONG_LONG 8 +#undef SIZEOF_UNSIGNED_LONG_LONG /* The size of `void *', as computed by sizeof. */ -#define SIZEOF_VOID_P 4 +#undef SIZEOF_VOID_P /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be From 883b865f8e8e15877b83f22797ed347ad36beeb1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 6 Mar 2017 10:35:03 -0800 Subject: [PATCH 513/561] [vcpkg-configure-cmake] Alwasy set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP to TRUE --- scripts/cmake/vcpkg_configure_cmake.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 85a67a4019..daf9dfd6f1 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -65,6 +65,9 @@ function(vcpkg_configure_cmake) "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DBoost_COMPILER=-vc140" + "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" + "-DCMAKE_VERBOSE_MAKEFILE=ON" + "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TRIPLET_FILE}" ) if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) list(APPEND _csc_OPTIONS_DEBUG @@ -95,9 +98,7 @@ function(vcpkg_configure_cmake) vcpkg_execute_required_process( COMMAND ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} -G ${GENERATOR} - -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release - -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TRIPLET_FILE} -DCMAKE_PREFIX_PATH=${CURRENT_INSTALLED_DIR} -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel @@ -110,9 +111,7 @@ function(vcpkg_configure_cmake) vcpkg_execute_required_process( COMMAND ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} -G ${GENERATOR} - -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Debug - -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TRIPLET_FILE} -DCMAKE_PREFIX_PATH=${CURRENT_INSTALLED_DIR}/debug\\\\\\\;${CURRENT_INSTALLED_DIR} -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg From 6e44495b2fe83d6bde89bd5bed017d5b28fa245e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 6 Mar 2017 10:46:45 -0800 Subject: [PATCH 514/561] [vcpkg-configure-cmake] Centralize application of CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP --- ports/hdf5/portfile.cmake | 1 - ports/libbson/portfile.cmake | 1 - ports/mongo-c-driver/portfile.cmake | 1 - ports/mongo-cxx-driver/portfile.cmake | 1 - ports/openjpeg/portfile.cmake | 1 - ports/poco/portfile.cmake | 1 - ports/szip/portfile.cmake | 1 - 7 files changed, 7 deletions(-) diff --git a/ports/hdf5/portfile.cmake b/ports/hdf5/portfile.cmake index b2d32a322c..9801ec44ab 100644 --- a/ports/hdf5/portfile.cmake +++ b/ports/hdf5/portfile.cmake @@ -39,7 +39,6 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=1 -DBUILD_TESTING=OFF -DDISABLE_STATIC_LIBS=${DISABLE_STATIC_LIBS} -DHDF5_BUILD_EXAMPLES=OFF diff --git a/ports/libbson/portfile.cmake b/ports/libbson/portfile.cmake index ce2ccea403..6116f1f8c8 100644 --- a/ports/libbson/portfile.cmake +++ b/ports/libbson/portfile.cmake @@ -12,7 +12,6 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DENABLE_TESTS=OFF - -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake index 3d551e0841..0db81f8d3f 100644 --- a/ports/mongo-c-driver/portfile.cmake +++ b/ports/mongo-c-driver/portfile.cmake @@ -20,7 +20,6 @@ vcpkg_configure_cmake( -DBSON_ROOT_DIR=${CURRENT_INSTALLED_DIR} -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF - -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() diff --git a/ports/mongo-cxx-driver/portfile.cmake b/ports/mongo-cxx-driver/portfile.cmake index 4b04af0545..4f3ed9dca5 100644 --- a/ports/mongo-cxx-driver/portfile.cmake +++ b/ports/mongo-cxx-driver/portfile.cmake @@ -20,7 +20,6 @@ vcpkg_configure_cmake( OPTIONS -DLIBBSON_DIR=${CURRENT_INSTALLED_DIR} -DLIBMONGOC_DIR=${CURRENT_INSTALLED_DIR} - -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake index efda08313b..f48395997c 100644 --- a/ports/openjpeg/portfile.cmake +++ b/ports/openjpeg/portfile.cmake @@ -12,7 +12,6 @@ vcpkg_configure_cmake( PREFER_NINJA OPTIONS -DBUILD_CODEC:BOOL=OFF -DOPENJPEG_INSTALL_PACKAGE_DIR=share/openjpeg - -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index f61ce16d97..7ef484cdb9 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -30,7 +30,6 @@ vcpkg_configure_cmake( -DENABLE_SEVENZIP=ON -DENABLE_TESTS=OFF -DPOCO_UNBUNDLED=ON # OFF means: using internal copy of sqlite, libz, pcre, expat, ... - -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ) vcpkg_install_cmake() diff --git a/ports/szip/portfile.cmake b/ports/szip/portfile.cmake index 0edee4dc42..957d91ea14 100644 --- a/ports/szip/portfile.cmake +++ b/ports/szip/portfile.cmake @@ -31,7 +31,6 @@ vcpkg_apply_patches( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=1 -DSZIP_INSTALL_DATA_DIR=share/szip/data -DSZIP_INSTALL_CMAKE_DIR=share/szip ) From c1d6454952b24f8bec815c35f599e7509f6812b6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 6 Mar 2017 12:29:06 -0800 Subject: [PATCH 515/561] [fftw3] Avoid replacing CMAKE_CXX_FLAGS -- just add the definitions needed. --- ports/fftw3/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ports/fftw3/CMakeLists.txt b/ports/fftw3/CMakeLists.txt index 88f7a2517a..6e0626f4b5 100644 --- a/ports/fftw3/CMakeLists.txt +++ b/ports/fftw3/CMakeLists.txt @@ -5,8 +5,7 @@ project (fftw3) # Standard: /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR if (WIN32) - set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W4 /Zi /EHsc /GR- /MP /openmp /bigobj") - add_definitions(-D_OPENMP -DLIBFFTWF33_EXPORTS) # Visual Studio 2005 and up supports OpenMP + add_definitions(-D_OPENMP -DLIBFFTWF33_EXPORTS /openmp /bigobj) # Visual Studio 2005 and up supports OpenMP endif (WIN32) if (BUILD_SHARED_LIBS) @@ -57,7 +56,7 @@ include_directories( api dft dft/scalar - dft/scalar/codelets # rellay needed? + dft/scalar/codelets # really needed? dft/simd dft/simd/sse2 rdft From 3eb0526468d07824900c462ccfacdeffd7fa1969 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 6 Mar 2017 16:16:56 -0800 Subject: [PATCH 516/561] Properly handle spaces in path when calling powershell script --- toolsrc/include/vcpkg_System.h | 4 ++++ toolsrc/src/vcpkg_Environment.cpp | 5 ++--- toolsrc/src/vcpkg_System.cpp | 11 +++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index a414ba0d4b..14f39ca40d 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -28,6 +28,10 @@ namespace vcpkg::System return cmd_execute_and_capture_output(cmd_line.c_str()); } + std::wstring create_powershell_script_cmd(const fs::path& script_path); + + std::wstring create_powershell_script_cmd(const fs::path& script_path, const std::wstring& args); + enum class color { success = 10, diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 94a672e2a2..93953f92bb 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -43,8 +43,7 @@ namespace vcpkg::Environment static std::wstring create_default_install_cmd(const vcpkg_paths& paths, const std::wstring& tool_name) { const fs::path script = paths.scripts / "fetchDependency.ps1"; - // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - return Strings::wformat(LR"(powershell -ExecutionPolicy Bypass "%s" -Dependency %s)", script.native(), tool_name); + return System::create_powershell_script_cmd(script, Strings::wformat(L"-Dependency %s", tool_name)); } void ensure_git_on_path(const vcpkg_paths& paths) @@ -103,7 +102,7 @@ namespace vcpkg::Environment static std::vector get_VS2017_installation_instances(const vcpkg_paths& paths) { const fs::path script = paths.scripts / "findVisualStudioInstallationInstances.ps1"; - const std::wstring cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s", script.native()); + const std::wstring cmd = System::create_powershell_script_cmd(script); System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd); Checks::check_exit(ec_data.exit_code == 0, "Could not run script to detect VS 2017 instances"); return Strings::split(ec_data.output, "\n"); diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 679318768b..9609d819be 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -49,6 +49,17 @@ namespace vcpkg::System return { ec, output }; } + std::wstring create_powershell_script_cmd(const fs::path& script_path) + { + return create_powershell_script_cmd(script_path, L""); + } + + std::wstring create_powershell_script_cmd(const fs::path& script_path, const std::wstring& args) + { + // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned + return Strings::wformat(LR"(powershell -ExecutionPolicy Bypass -Command "& {& '%s' %s}")", script_path.native(), args); + } + void print(const char* message) { fputs(message, stdout); From 38d2bd4d5e11d945cbc3f2186494e0a122587269 Mon Sep 17 00:00:00 2001 From: Nicolas Riebesel Date: Mon, 6 Mar 2017 11:41:45 +0100 Subject: [PATCH 517/561] Add portaudio to ports --- ports/portaudio/CONTROL | 3 ++ ports/portaudio/cmakelists-install.patch | 11 +++++ ports/portaudio/portfile.cmake | 54 ++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 ports/portaudio/CONTROL create mode 100644 ports/portaudio/cmakelists-install.patch create mode 100644 ports/portaudio/portfile.cmake diff --git a/ports/portaudio/CONTROL b/ports/portaudio/CONTROL new file mode 100644 index 0000000000..987154e36f --- /dev/null +++ b/ports/portaudio/CONTROL @@ -0,0 +1,3 @@ +Source: portaudio +Version: +Description: diff --git a/ports/portaudio/cmakelists-install.patch b/ports/portaudio/cmakelists-install.patch new file mode 100644 index 0000000000..42fe505def --- /dev/null +++ b/ports/portaudio/cmakelists-install.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt 2016-10-30 02:23:04.000000000 +0100 ++++ b/CMakeLists.txt 2017-03-06 11:10:51.125636200 +0100 +@@ -372,6 +372,8 @@ + ENDIF() + SET_TARGET_PROPERTIES(portaudio PROPERTIES OUTPUT_NAME portaudio_${TARGET_POSTFIX} FOLDER "Portaudio") + SET_TARGET_PROPERTIES(portaudio_static PROPERTIES OUTPUT_NAME portaudio_static_${TARGET_POSTFIX} FOLDER "Portaudio") ++ INSTALL(FILES ${PA_PUBLIC_INCLUDES} DESTINATION include) ++ INSTALL(TARGETS portaudio portaudio_static RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + ELSE() + IF(APPLE AND CMAKE_VERSION VERSION_GREATER 3.4.2) + OPTION(PA_OUTPUT_OSX_FRAMEWORK "Generate an OS X framework instead of the simple library" OFF) diff --git a/ports/portaudio/portfile.cmake b/ports/portaudio/portfile.cmake new file mode 100644 index 0000000000..c91335465f --- /dev/null +++ b/ports/portaudio/portfile.cmake @@ -0,0 +1,54 @@ +# Common Ambient Variables: +# VCPKG_ROOT_DIR = +# TARGET_TRIPLET is the current triplet (${VCPKG_TARGET_ARCHITECTURE}-windows, etc) +# PORT is the current port name (zlib, etc) +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}/buildtrees/${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}/packages/${PORT}_${TARGET_TRIPLET} +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/portaudio) +vcpkg_download_distfile(ARCHIVE + URLS "http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz" + FILENAME "pa_stable_v190600_20161030.tgz" + SHA512 7ec692cbd8c23878b029fad9d9fd63a021f57e60c4921f602995a2fca070c29f17a280c7f2da5966c4aad29d28434538452f4c822eacf3a60af59a6dc8e9704c +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/cmakelists-install.patch) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +# Remove static builds from dynamic builds and otherwise +# Remove x86 and x64 from resulting files +if (VCPKG_CRT_LINKAGE STREQUAL dynamic) + file (REMOVE ${CURRENT_PACKAGES_DIR}/lib/portaudio_static_${VCPKG_TARGET_ARCHITECTURE}.lib) + file (REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/portaudio_static_${VCPKG_TARGET_ARCHITECTURE}.lib) + + file (RENAME ${CURRENT_PACKAGES_DIR}/lib/portaudio_${VCPKG_TARGET_ARCHITECTURE}.lib ${CURRENT_PACKAGES_DIR}/lib/portaudio.lib) + file (RENAME ${CURRENT_PACKAGES_DIR}/bin/portaudio_${VCPKG_TARGET_ARCHITECTURE}.dll ${CURRENT_PACKAGES_DIR}/bin/portaudio.dll) + file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/portaudio_${VCPKG_TARGET_ARCHITECTURE}.lib ${CURRENT_PACKAGES_DIR}/debug/lib/portaudio.lib) + file (RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/portaudio_${VCPKG_TARGET_ARCHITECTURE}.dll ${CURRENT_PACKAGES_DIR}/debug/bin/portaudio.dll) +else () + file (RENAME ${CURRENT_PACKAGES_DIR}/lib/portaudio_static_${VCPKG_TARGET_ARCHITECTURE}.lib ${CURRENT_PACKAGES_DIR}/lib/portaudio.lib) + file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/portaudio_static_${VCPKG_TARGET_ARCHITECTURE}.lib ${CURRENT_PACKAGES_DIR}/debug/lib/portaudio.lib) + + file (REMOVE ${CURRENT_PACKAGES_DIR}/lib/portaudio_${VCPKG_TARGET_ARCHITECTURE}.lib) + file (REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file (REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/portaudio_${VCPKG_TARGET_ARCHITECTURE}.lib) + file (REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +endif () + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/portaudio) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/portaudio/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/portaudio/copyright) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) From 459fa4b009be8b95dabf9d746397757b9192f6fe Mon Sep 17 00:00:00 2001 From: Nicolas Riebesel Date: Mon, 6 Mar 2017 11:49:37 +0100 Subject: [PATCH 518/561] [portaudio] Insert version and description --- ports/portaudio/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/portaudio/CONTROL b/ports/portaudio/CONTROL index 987154e36f..b2fb68b842 100644 --- a/ports/portaudio/CONTROL +++ b/ports/portaudio/CONTROL @@ -1,3 +1,3 @@ Source: portaudio -Version: -Description: +Version: 19.0.6.00 +Description: PortAudio Portable Cross-platform Audio I/O API PortAudio is a free, cross-platform, open-source, audio I/O library. It lets you write simple audio programs in 'C' or C++ that will compile and run on many platforms including Windows, Macintosh OS X, and Unix (OSS/ALSA). It is intended to promote the exchange of audio software between developers on different platforms. Many applications use PortAudio for Audio I/O. From e3d962775771a00044ab9af9c7dc9b8df3e05a7e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 6 Mar 2017 17:52:25 -0800 Subject: [PATCH 519/561] [qt5] Fix regression from dd6d1aa5. When building a static triplet, repeat the build on failure. --- ports/qt5/portfile.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index bbb171fd53..ecdc9b8dfe 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -86,7 +86,14 @@ vcpkg_execute_required_process( message(STATUS "Configure ${TARGET_TRIPLET} done") message(STATUS "Building ${TARGET_TRIPLET}") -vcpkg_execute_required_process( +# Multiple executions are required due to https://bugreports.qt.io/browse/QTBUG-53393 +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(COUNT 1) +else() + set(COUNT 3) +endif() +vcpkg_execute_required_process_repeat( + COUNT ${COUNT} COMMAND ${JOM} WORKING_DIRECTORY ${OUTPUT_PATH} LOGNAME build-${TARGET_TRIPLET} From 49c96dee1fa5ef97b2a6bb17f4701498f2d065fb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 6 Mar 2017 11:50:53 -0800 Subject: [PATCH 520/561] [`ci`] Print time for succeeded builds too --- toolsrc/src/commands_ci.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index ac5aaecc23..4a66b77d1f 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -98,11 +98,6 @@ namespace vcpkg::Commands::CI for (size_t i = 0; i < results.size(); i++) { - if (results[i] == BuildResult::SUCCEEDED) - { - continue; - } - System::println("%s: %s: %dms", install_plan[i].spec.toString(), Build::to_string(results[i]), timing[i]); } From 06272de6b48447834c8821aa1b169a056a114cec Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 7 Mar 2017 13:30:38 -0800 Subject: [PATCH 521/561] [portaudio] Do not rename DLLs. Fix patchfile. --- ports/portaudio/cmakelists-install.patch | 4 ++-- ports/portaudio/portfile.cmake | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ports/portaudio/cmakelists-install.patch b/ports/portaudio/cmakelists-install.patch index 42fe505def..88c95260da 100644 --- a/ports/portaudio/cmakelists-install.patch +++ b/ports/portaudio/cmakelists-install.patch @@ -1,5 +1,5 @@ ---- a/CMakeLists.txt 2016-10-30 02:23:04.000000000 +0100 -+++ b/CMakeLists.txt 2017-03-06 11:10:51.125636200 +0100 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt @@ -372,6 +372,8 @@ ENDIF() SET_TARGET_PROPERTIES(portaudio PROPERTIES OUTPUT_NAME portaudio_${TARGET_POSTFIX} FOLDER "Portaudio") diff --git a/ports/portaudio/portfile.cmake b/ports/portaudio/portfile.cmake index c91335465f..b243d5a6d1 100644 --- a/ports/portaudio/portfile.cmake +++ b/ports/portaudio/portfile.cmake @@ -34,9 +34,7 @@ if (VCPKG_CRT_LINKAGE STREQUAL dynamic) file (REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/portaudio_static_${VCPKG_TARGET_ARCHITECTURE}.lib) file (RENAME ${CURRENT_PACKAGES_DIR}/lib/portaudio_${VCPKG_TARGET_ARCHITECTURE}.lib ${CURRENT_PACKAGES_DIR}/lib/portaudio.lib) - file (RENAME ${CURRENT_PACKAGES_DIR}/bin/portaudio_${VCPKG_TARGET_ARCHITECTURE}.dll ${CURRENT_PACKAGES_DIR}/bin/portaudio.dll) file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/portaudio_${VCPKG_TARGET_ARCHITECTURE}.lib ${CURRENT_PACKAGES_DIR}/debug/lib/portaudio.lib) - file (RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/portaudio_${VCPKG_TARGET_ARCHITECTURE}.dll ${CURRENT_PACKAGES_DIR}/debug/bin/portaudio.dll) else () file (RENAME ${CURRENT_PACKAGES_DIR}/lib/portaudio_static_${VCPKG_TARGET_ARCHITECTURE}.lib ${CURRENT_PACKAGES_DIR}/lib/portaudio.lib) file (RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/portaudio_static_${VCPKG_TARGET_ARCHITECTURE}.lib ${CURRENT_PACKAGES_DIR}/debug/lib/portaudio.lib) From 50162c75426144944888b7a24a28705feaaaebd6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 7 Mar 2017 17:18:24 -0800 Subject: [PATCH 522/561] [uwebsockets] Update to v0.13.0. Resolves #738 --- ports/uwebsockets/0001_cmake.patch | 25 +++++++++++++------------ ports/uwebsockets/portfile.cmake | 9 +++++---- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ports/uwebsockets/0001_cmake.patch b/ports/uwebsockets/0001_cmake.patch index f4004a5bbc..f0879d659a 100644 --- a/ports/uwebsockets/0001_cmake.patch +++ b/ports/uwebsockets/0001_cmake.patch @@ -1,22 +1,24 @@ +commit 2b244f92ddf5e58bf81ccb40a8f23a3f94d9941b +Author: Alexander Karatarakis +Date: Tue Mar 7 17:13:52 2017 -0800 + + Fixes + diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1fadf72..6ee984d 100644 +index 33a8ae0..0b9c006 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -18,7 +18,11 @@ if(NOT LIBUV_INCLUDE_DIR) +@@ -12,7 +12,7 @@ if(NOT LIBUV_INCLUDE_DIR) find_path(LIBUV_INCLUDE_DIR uv.h) endif() if(NOT LIBUV_LIBRARY) - find_library(LIBUV_LIBRARY NAMES uv uv1) -+ if(WIN32) -+ find_library(LIBUV_LIBRARY NAMES libuv) -+ else() -+ find_library(LIBUV_LIBRARY NAMES uv uv1) -+ endif() ++ find_library(LIBUV_LIBRARY NAMES libuv uv uv1) endif() - add_library(uWS src/Extensions.cpp src/Group.cpp src/WebSocketImpl.cpp src/Networking.cpp src/Hub.cpp src/Node.cpp src/WebSocket.cpp src/HTTPSocket.cpp src/Socket.cpp) -@@ -38,4 +42,20 @@ install (TARGETS uWS DESTINATION /usr/lib64) - install (FILES src/Extensions.h src/WebSocketProtocol.h src/Networking.h src/WebSocket.h src/Hub.h src/Group.h src/Node.h src/Socket.h src/HTTPSocket.h src/uWS.h DESTINATION /usr/include/uWS) + add_library(uWS src/Extensions.cpp src/Group.cpp src/WebSocketImpl.cpp src/Networking.cpp src/Hub.cpp src/Node.cpp src/WebSocket.cpp src/HTTPSocket.cpp src/Socket.cpp src/uUV.cpp) +@@ -38,4 +38,20 @@ install (TARGETS uWS DESTINATION /usr/lib64) + install (FILES src/Extensions.h src/WebSocketProtocol.h src/Networking.h src/WebSocket.h src/Hub.h src/Group.h src/Node.h src/Socket.h src/HTTPSocket.h src/uWS.h src/uUV.h DESTINATION /usr/include/uWS) endif (UNIX) -add_subdirectory(examples) @@ -25,7 +27,7 @@ index 1fadf72..6ee984d 100644 +if(WIN32) + target_link_libraries (uWS PUBLIC psapi.lib iphlpapi.lib userenv.lib) + install (FILES src/Extensions.h src/WebSocketProtocol.h src/Networking.h src/WebSocket.h src/Hub.h src/Group.h src/Node.h src/Socket.h src/HTTPSocket.h src/uWS.h DESTINATION include/uWS) -+ ++ + if(BUILD_SHARED_LIBS) + target_link_libraries (uWS PUBLIC ws2_32.lib) + endif() @@ -37,4 +39,3 @@ index 1fadf72..6ee984d 100644 + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) -\ No newline at end of file \ No newline at end of file diff --git a/ports/uwebsockets/portfile.cmake b/ports/uwebsockets/portfile.cmake index 881f350868..1049e761d1 100644 --- a/ports/uwebsockets/portfile.cmake +++ b/ports/uwebsockets/portfile.cmake @@ -1,9 +1,10 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/uwebsockets-0.12.0) +set(VERSION 0.13.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/uwebsockets-${VERSION}) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/uWebSockets/uWebSockets/archive/v0.12.0.zip" - FILENAME "uwebsockets-v0.12.0.zip" - SHA512 ea10682608d5f6c8b246f186dfc2f14f496858cc7e468880b96b111f10058daf529f1aa9662a851e21494dde9a4faadf2b9904483dac5350d0ca8736500cdda8 + URLS "https://github.com/uWebSockets/uWebSockets/archive/v${VERSION}.zip" + FILENAME "uwebsockets-v${VERSION}.zip" + SHA512 d3912296ed9e20900dc401e841238b84fe273e2e828500347d311948b8cb9dc3a08039b87f82d32a5844e39782201fe39641f336040a4a0493787760f1b5c618 ) vcpkg_extract_source_archive(${ARCHIVE}) From 937ab708e652b75ded67b7c5c079bfd912324848 Mon Sep 17 00:00:00 2001 From: Achie Liang Date: Wed, 8 Mar 2017 10:04:52 +0800 Subject: [PATCH 523/561] Upgrade azure-storage-cpp to v3.0.0 --- ports/azure-storage-cpp/CONTROL | 2 +- ports/azure-storage-cpp/portfile.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/azure-storage-cpp/CONTROL b/ports/azure-storage-cpp/CONTROL index 29c80c703d..fd32755383 100644 --- a/ports/azure-storage-cpp/CONTROL +++ b/ports/azure-storage-cpp/CONTROL @@ -1,5 +1,5 @@ Source: azure-storage-cpp -Version: 2.6.0 +Version: 3.0.0 Build-Depends: cpprestsdk Description: Microsoft Azure Storage Client SDK for C++ A client library for working with Microsoft Azure storage services including blobs, files, tables, and queues. This client library enables working with the Microsoft Azure storage services which include the blob service for storing binary and text data, the file service for storing binary and text data, the table service for storing structured non-relational data, and the queue service for storing messages that may be accessed by a client. Microsoft Azure Storage team's blog - http://blogs.msdn.com/b/windowsazurestorage/ \ No newline at end of file diff --git a/ports/azure-storage-cpp/portfile.cmake b/ports/azure-storage-cpp/portfile.cmake index d83a6d854f..06df886acb 100644 --- a/ports/azure-storage-cpp/portfile.cmake +++ b/ports/azure-storage-cpp/portfile.cmake @@ -1,10 +1,10 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/azure-storage-cpp-2.6.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/azure-storage-cpp-3.0.0) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/Azure/azure-storage-cpp/archive/v2.6.0.tar.gz" - FILENAME "azure-storage-cpp/v2.6.0.tar.gz" - SHA512 383fc709b04b7a116b553575f27a95b95a66105fe9b96d412fc4f1938e51288f81e49a9578c02993d0bc2a4771265694117b82fd5beaeaf4c32f81eeb8f9be6a + URLS "https://github.com/Azure/azure-storage-cpp/archive/v3.0.0.tar.gz" + FILENAME "azure-storage-cpp/v3.0.0.tar.gz" + SHA512 45d0d7f8cc350a16cff0371cdd442e851912c89061acfec559482e8f79cebafffd8681b32a30b878e329235cd3aaad5d2ff797d1148302e3109cf5111df14b97 ) vcpkg_extract_source_archive(${ARCHIVE}) From 7c89415a6f4ee418e912744fb2a519f62c22f163 Mon Sep 17 00:00:00 2001 From: Lee Berger Date: Tue, 7 Mar 2017 21:11:25 -0500 Subject: [PATCH 524/561] [catch] update to version 1.8.1 --- ports/catch/CONTROL | 2 +- ports/catch/portfile.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/catch/CONTROL b/ports/catch/CONTROL index 893563e15d..148369addc 100644 --- a/ports/catch/CONTROL +++ b/ports/catch/CONTROL @@ -1,3 +1,3 @@ Source: catch -Version: 1.5.7 +Version: 1.8.1 Description: C++ Automated Test Cases in Headers diff --git a/ports/catch/portfile.cmake b/ports/catch/portfile.cmake index 5575af742e..1f3472c34f 100644 --- a/ports/catch/portfile.cmake +++ b/ports/catch/portfile.cmake @@ -10,9 +10,9 @@ include(vcpkg_common_functions) vcpkg_download_distfile(HEADER - URLS "https://raw.githubusercontent.com/philsquared/Catch/e27c4ee04282f60aefcc9b1062a74f92cf6c1a2b/single_include/catch.hpp" + URLS "https://github.com/philsquared/Catch/releases/download/v1.8.1/catch.hpp" FILENAME "catch.hpp" - SHA512 c2fec38227bb1725c30f955583dbd012f86eef83512a0c154e91b77249df372db067710ae110463eb07adec722d214114fd6a2cebff7ee43c5fd567a6a1ba221 + SHA512 942acee9ac54d170a79f4624ce62bc5d9327a863f5565352eb71f2c028d35c2042bf0416530cb8288b27ed78a46d0d02dfaba47e1d79ae9b394943771543ea3f ) vcpkg_download_distfile(LICENSE From ad30f9dbe6a0946abfcc00532dfcb839c1e32710 Mon Sep 17 00:00:00 2001 From: Jiri Hruska Date: Wed, 8 Mar 2017 18:53:04 +0100 Subject: [PATCH 525/561] [openssl] Consistently use OPENSSL_VERSION instead of just VERSION The inner CMakeLists.txt used to reference ${VERSION} everywhere except as the working directory for patching, where ${OPENSSL_VERSION} was used and the patches did not get applied because of that. This changes it to use ${OPENSSL_VERSION} everywhere instead, consistent with the name of this variable in the parent portfile.cmake. --- ports/openssl/CMakeLists.txt | 8 ++++---- ports/openssl/portfile.cmake | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/openssl/CMakeLists.txt b/ports/openssl/CMakeLists.txt index a82f14d609..ca1de18c08 100644 --- a/ports/openssl/CMakeLists.txt +++ b/ports/openssl/CMakeLists.txt @@ -58,25 +58,25 @@ endif() vcpkg_execute_required_process( COMMAND ${CONFIGURE_COMMAND} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/openssl-${VERSION} + WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME configure-perl-${TARGET_TRIPLET}-${CMAKE_BUILD_TYPE} ) vcpkg_execute_required_process( COMMAND ${OPENSSL_DO} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/openssl-${VERSION} + WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME configure-do-${TARGET_TRIPLET}-${CMAKE_BUILD_TYPE} ) if(BUILD_SHARED_LIBS) add_custom_command(OUTPUT ${OPENSSLDIR}/bin/ssleay32.dll ${OPENSSLDIR}/bin/libeay32.dll COMMAND ${NMAKE} -f ms\\ntdll.mak install - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/openssl-${VERSION} + WORKING_DIRECTORY ${SOURCE_PATH} ) add_custom_target(openssl ALL DEPENDS ${OPENSSLDIR}/bin/ssleay32.dll ${OPENSSLDIR}/bin/libeay32.dll) else() add_custom_command(OUTPUT ${OPENSSLDIR}/bin/ssleay32.lib ${OPENSSLDIR}/bin/libeay32.lib COMMAND ${NMAKE} -f ms\\nt.mak install - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/openssl-${VERSION} + WORKING_DIRECTORY ${SOURCE_PATH} ) add_custom_target(openssl ALL DEPENDS ${OPENSSLDIR}/bin/ssleay32.lib ${OPENSSLDIR}/bin/libeay32.lib) endif() diff --git a/ports/openssl/portfile.cmake b/ports/openssl/portfile.cmake index 0422789431..2a18fb6546 100644 --- a/ports/openssl/portfile.cmake +++ b/ports/openssl/portfile.cmake @@ -35,7 +35,7 @@ vcpkg_configure_cmake( -DOPENSSL_SOURCE_ARCHIVE=${OPENSSL_SOURCE_ARCHIVE} -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} -DTRIPLET_SYSTEM_ARCH=${TRIPLET_SYSTEM_ARCH} - -DVERSION=${OPENSSL_VERSION} + -DOPENSSL_VERSION=${OPENSSL_VERSION} -DTARGET_TRIPLET=${TARGET_TRIPLET} ) From 109a8b90584aa561bd5528c4a5b3de0d5864a140 Mon Sep 17 00:00:00 2001 From: Jiri Hruska Date: Wed, 8 Mar 2017 19:01:56 +0100 Subject: [PATCH 526/561] [openssl] Make sure to use our own trusted copy of Perl The build could have exhibited inconsistent behavior or simply failed if there was another "perl" program already in path - either because it was too old or too new, from some broken installation, or just a batch file instead of a plain executable (which would require changing OpenSSL's scripts to do "call perl x.pl" instead of just "perl x.pl"). This change resolves the ambiguity by putting the downloaded Perl first in path, so that the same working version is used on all systems. --- ports/openssl/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/openssl/portfile.cmake b/ports/openssl/portfile.cmake index 2a18fb6546..ca3bb7ff65 100644 --- a/ports/openssl/portfile.cmake +++ b/ports/openssl/portfile.cmake @@ -10,7 +10,7 @@ vcpkg_find_acquire_program(PERL) find_program(NMAKE nmake) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) -set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}") +set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}") vcpkg_download_distfile(OPENSSL_SOURCE_ARCHIVE URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" From a3b86f77a7faee7b50c28869c9488ba279513926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81oskot?= Date: Thu, 9 Mar 2017 00:29:10 +0100 Subject: [PATCH 527/561] Add requirement of CMake 3.8.0 or higher --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ee0d65eda4..911ad0e565 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ For short description of available commands, run `vcpkg help`. Prerequisites: - Visual Studio 2015 Update 3 or - Visual Studio 2017 +- CMake 3.8.0 or higher (note: downloaded automatically if not found) - `git.exe` available in your path Clone this repository, then run From 50129fba99a973efdf063de742f5ef2c3b792870 Mon Sep 17 00:00:00 2001 From: Felix Bytow Date: Thu, 9 Mar 2017 18:29:51 +0100 Subject: [PATCH 528/561] Updated libpng port to version 1.6.28 --- ports/libpng/portfile.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index f7be6cca1c..759601e510 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -1,10 +1,10 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libpng-1.6.24) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libpng-1.6.28) vcpkg_download_distfile(ARCHIVE - URLS "http://download.sourceforge.net/libpng/libpng-1.6.24.tar.xz" - FILENAME "libpng-1.6.24.tar.xz" - SHA512 7eccb90f530a9c728e280b2b1776304a808b5deea559632e7bcf4ea219c7cb5e453aa810215465304501127595000717d4b7c5b26a9f8e22e236ec04af53a90f + URLS "https://downloads.sourceforge.net/project/libpng/libpng16/1.6.28/libpng-1.6.28.tar.xz" + FILENAME "libpng-1.6.28.tar.xz" + SHA512 3541139062a1c6cded7abe378ae73519835ec68561006ba33b3fe34f65676e4f91f2561b11d890ac20255dbf2e691e0b3d4fbf11db77b47b67979ba45b8af655 ) vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( From 7a00b2b96e5a321f9aab7c8ded31ae7e073fd038 Mon Sep 17 00:00:00 2001 From: Toby Chen Date: Thu, 9 Mar 2017 12:40:03 -0500 Subject: [PATCH 529/561] [bullet3] update to 2.86.1 --- ports/bullet3/CONTROL | 2 +- ports/bullet3/portfile.cmake | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ports/bullet3/CONTROL b/ports/bullet3/CONTROL index fbbec84941..6320c6578b 100644 --- a/ports/bullet3/CONTROL +++ b/ports/bullet3/CONTROL @@ -1,3 +1,3 @@ Source: bullet3 -Version: 2.83.7.98d4780 +Version: 2.86.1 Description: Bullet Physics is a professional collision detection, rigid body, and soft body dynamics library diff --git a/ports/bullet3/portfile.cmake b/ports/bullet3/portfile.cmake index 2cd60a45f7..17d6f8ea7c 100644 --- a/ports/bullet3/portfile.cmake +++ b/ports/bullet3/portfile.cmake @@ -1,9 +1,9 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/bullet3-98d47809b4273d97ea06c9b2137ada10af581bb9) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/bullet3-2.86.1) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/bulletphysics/bullet3/archive/98d47809b4273d97ea06c9b2137ada10af581bb9.zip" - FILENAME "bullet3-98d47809b4273d97ea06c9b2137ada10af581bb9.zip" - SHA512 eaa3aa5ff124c87f153a9faeabe00955aaa2d87ed5d2297a96e02531eb7fd1286f2b654bd45401690747ca4391dd7c18486f4cbac0da7e835d52874345b9811d + URLS "https://github.com/bulletphysics/bullet3/archive/2.86.1.zip" + FILENAME "bullet3-2.86.1.zip" + SHA512 96c67bed63db4b7d46196cebda57b80543ea37bd19f013adcfe19ee6c2c3319ed007bcd1ebbe345d8c75b7e80588f4a7d85cb6a07e1a5eea759d97ce4d94f972 ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -32,4 +32,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/bullet3) file(RENAME ${CURRENT_PACKAGES_DIR}/share/bullet3/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/bullet3/copyright) -vcpkg_copy_pdbs() \ No newline at end of file +vcpkg_copy_pdbs() From 1e93a5f187fede5b96860568e31e696abec1100e Mon Sep 17 00:00:00 2001 From: Felix Bytow Date: Thu, 9 Mar 2017 20:42:59 +0100 Subject: [PATCH 530/561] Updated the libpng CONTROL file for version 1.6.28 --- ports/libpng/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/libpng/CONTROL b/ports/libpng/CONTROL index 239fa0cb29..2d111607e7 100644 --- a/ports/libpng/CONTROL +++ b/ports/libpng/CONTROL @@ -1,4 +1,4 @@ Source: libpng -Version: 1.6.24-1 +Version: 1.6.28 Build-Depends: zlib -Description: libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files. \ No newline at end of file +Description: libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files. From da09a8136d32890ab5f3804d9abcc5f9685a30e0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 9 Mar 2017 14:17:00 -0800 Subject: [PATCH 531/561] [eigen3] Update to 3.3.3. Resolves #754 --- ports/eigen3/portfile.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/eigen3/portfile.cmake b/ports/eigen3/portfile.cmake index 0a1e88e47f..5b80225d8f 100644 --- a/ports/eigen3/portfile.cmake +++ b/ports/eigen3/portfile.cmake @@ -1,10 +1,10 @@ #header-only library include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/eigen-eigen-26667be4f70b) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/eigen-eigen-67e894c6cd8f) vcpkg_download_distfile(ARCHIVE - URLS "http://bitbucket.org/eigen/eigen/get/3.3.0.tar.bz2" - FILENAME "eigen-3.3.0.tar.bz2" - SHA512 a1919accc9fcf64eca17b3e60a78eefeb1a187c261c28b8480604f36cf366cd6323e966d6b948f8a4ce0ae3213a3815bccd34661d1d8fb33315def4304bf163e + URLS "http://bitbucket.org/eigen/eigen/get/3.3.3.tar.bz2" + FILENAME "eigen-3.3.3.tar.bz2" + SHA512 bb5a8b761371e516f0a344a7c9f6e369e21c2907c8548227933ca6010fc607a66c8d6ff7c41b1aec3dea7d482ce8c2a09e38ae5c7a2c5b16bdd8007e7a81ecc3 ) vcpkg_extract_source_archive(${ARCHIVE}) From c24afa97a20600048a249eb74184031ee6b6de24 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 9 Mar 2017 23:52:45 +0100 Subject: [PATCH 532/561] [flac] use nasm --- ports/libflac/CMakeLists.txt | 7 +++++++ ports/libflac/CONTROL | 2 +- ports/libflac/portfile.cmake | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ports/libflac/CMakeLists.txt b/ports/libflac/CMakeLists.txt index 978de28897..a9f1afc5e8 100644 --- a/ports/libflac/CMakeLists.txt +++ b/ports/libflac/CMakeLists.txt @@ -24,6 +24,13 @@ endif() if(LIBFLAC_ARCHITECTURE MATCHES x86) add_definitions(-DFLAC__CPU_IA32) + add_definitions(-DFLAC__HAS_NASM) + enable_language(ASM_NASM) + list(APPEND LIBFLAC_SOURCES + src/libFLAC/ia32/cpu_asm.nasm + src/libFLAC/ia32/fixed_asm.nasm + src/libFLAC/ia32/lpc_asm.nasm) + set(CMAKE_ASM_NASM_FLAGS "-i${PROJECT_SOURCE_DIR}/src/libFLAC/ia32/ -f win32 -d OBJ_FORMAT_win32") elseif(LIBFLAC_ARCHITECTURE MATCHES x64) add_definitions(-DFLAC__CPU_X86_64) add_definitions(-DENABLE_64_BIT_WORDS) diff --git a/ports/libflac/CONTROL b/ports/libflac/CONTROL index 555cfc492a..52878673de 100644 --- a/ports/libflac/CONTROL +++ b/ports/libflac/CONTROL @@ -1,4 +1,4 @@ Source: libflac -Version: 1.3.2 +Version: 1.3.2-1 Description: Library for manipulating FLAC files Build-Depends: libogg diff --git a/ports/libflac/portfile.cmake b/ports/libflac/portfile.cmake index 4bf66bfdf5..cbf7d6fd3f 100644 --- a/ports/libflac/portfile.cmake +++ b/ports/libflac/portfile.cmake @@ -12,6 +12,12 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) +if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + vcpkg_find_acquire_program(NASM) + get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) + set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}") +endif() + file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( From 241a1021adc98169d1b900da2db6c92ca2df242e Mon Sep 17 00:00:00 2001 From: Per-Arne Andersen Date: Fri, 10 Mar 2017 00:50:21 +0100 Subject: [PATCH 533/561] Removed flatbuffers tools directory I propose a change in how flatbuffers flatc.exe are placed in the tools directory after installation. Currently flatc.exe is placed in a sub directory "flatbuffers" which scopes it out from PATH Tested ok on my end, however i'm not 100% sure that i did this formally correct. --- ports/flatbuffers/portfile.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/flatbuffers/portfile.cmake b/ports/flatbuffers/portfile.cmake index 5d52fc2a8f..03e0e9c280 100644 --- a/ports/flatbuffers/portfile.cmake +++ b/ports/flatbuffers/portfile.cmake @@ -43,8 +43,7 @@ if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) endif() if(EXISTS ${CURRENT_PACKAGES_DIR}/bin/flatc.exe) - make_directory(${CURRENT_PACKAGES_DIR}/tools/flatbuffers) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/flatc.exe ${CURRENT_PACKAGES_DIR}/tools/flatbuffers/flatc.exe) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/flatc.exe ${CURRENT_PACKAGES_DIR}/tools/flatc.exe) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) endif() if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/flatbuffers.dll) @@ -56,8 +55,6 @@ if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/flatbuffers.dll) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/flatbuffers.dll ${CURRENT_PACKAGES_DIR}/debug/bin/flatbuffers.dll) endif() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/flatbuffers) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright From eb3916453787f9c2750d80612bbb5cc8ed93ef46 Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Fri, 10 Mar 2017 16:08:20 +0300 Subject: [PATCH 534/561] [zeromq] update to 4.2.2. Resolves #760 --- ports/zeromq/CONTROL | 2 +- ports/zeromq/portfile.cmake | 33 +++++++++++++++++++++------------ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/ports/zeromq/CONTROL b/ports/zeromq/CONTROL index 8274ec0fdf..6b82f310a6 100644 --- a/ports/zeromq/CONTROL +++ b/ports/zeromq/CONTROL @@ -1,3 +1,3 @@ Source: zeromq -Version: 4.2.0 +Version: 4.2.2 Description: The ZeroMQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised messaging middleware products diff --git a/ports/zeromq/portfile.cmake b/ports/zeromq/portfile.cmake index 9abd4ed748..a530598ebe 100644 --- a/ports/zeromq/portfile.cmake +++ b/ports/zeromq/portfile.cmake @@ -1,9 +1,12 @@ +set(ZEROMQ_VERSION 4.2.2) +set(ZEROMQ_HASH 4069813374d4e8d4c0f8debbe85472d0bd24cf644fb1bce748920eadffb81c429d28f523ef424df84fcaa7082b984fab8da57192802585811d37cff066f4e40c) + include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zeromq-4.2.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libzmq-${ZEROMQ_VERSION}) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/zeromq/libzmq/releases/download/v4.2.0/zeromq-4.2.0.tar.gz" - FILENAME "zeromq-4.2.0.tar.gz" - SHA512 3b6f0a1869fb1663ea40b3c3aa088b81399a35c051e4ade2b30bbac60bfceefe6b4403248a4635fb31d33767c1e478342f61c47b0ffdb4501419c13590ebeb96 + URLS "https://github.com/zeromq/libzmq/archive/v${ZEROMQ_VERSION}.tar.gz" + FILENAME "libzmq-${ZEROMQ_VERSION}.tar.gz" + SHA512 ${ZEROMQ_HASH} ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -14,42 +17,48 @@ else () set(MSBUILD_PLATFORM ${TRIPLET_SYSTEM_ARCH}) endif() +if(VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(MSVS_VERSION 2017) +else() + set(MSVS_VERSION 2015) +endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/builds/msvc/vs2015/libzmq/libzmq.vcxproj + PROJECT_PATH ${SOURCE_PATH}/builds/msvc/vs${MSVS_VERSION}/libzmq/libzmq.vcxproj RELEASE_CONFIGURATION ReleaseDLL DEBUG_CONFIGURATION DebugDLL ) file(INSTALL - ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Debug/v140/dynamic/libzmq.dll + ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Debug/${VCPKG_PLATFORM_TOOLSET}/dynamic/libzmq.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin ) file(INSTALL - ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Release/v140/dynamic/libzmq.dll + ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Release/${VCPKG_PLATFORM_TOOLSET}/dynamic/libzmq.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin ) file(INSTALL - ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Debug/v140/dynamic/libzmq.lib + ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Debug/${VCPKG_PLATFORM_TOOLSET}/dynamic/libzmq.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib ) file(INSTALL - ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Release/v140/dynamic/libzmq.lib + ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Release/${VCPKG_PLATFORM_TOOLSET}/dynamic/libzmq.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib ) vcpkg_copy_pdbs() else() vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/builds/msvc/vs2015/libzmq/libzmq.vcxproj + PROJECT_PATH ${SOURCE_PATH}/builds/msvc/vs${MSVS_VERSION}/libzmq/libzmq.vcxproj RELEASE_CONFIGURATION ReleaseLIB DEBUG_CONFIGURATION DebugLIB ) file(INSTALL - ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Debug/v140/static/libzmq.lib + ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Debug/${VCPKG_PLATFORM_TOOLSET}/static/libzmq.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib ) file(INSTALL - ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Release/v140/static/libzmq.lib + ${SOURCE_PATH}/bin/${MSBUILD_PLATFORM}/Release/${VCPKG_PLATFORM_TOOLSET}/static/libzmq.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib ) endif() From 71f1e117af2c92123fae9311b9b23f3955e9831d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 10 Mar 2017 11:15:11 -0800 Subject: [PATCH 535/561] [cppwinrt] Update to february 2017 refresh --- ports/cppwinrt/CONTROL | 2 +- ports/cppwinrt/portfile.cmake | 33 +++++++-------------------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/ports/cppwinrt/CONTROL b/ports/cppwinrt/CONTROL index 7833d33ee4..e49eefe99f 100644 --- a/ports/cppwinrt/CONTROL +++ b/ports/cppwinrt/CONTROL @@ -1,3 +1,3 @@ Source: cppwinrt -Version: 1.010.0.14393.0 +Version: feb2017_refresh-14393 Description: C++/WinRT is a standard C++ language projection for the Windows Runtime. diff --git a/ports/cppwinrt/portfile.cmake b/ports/cppwinrt/portfile.cmake index 4529111720..b0e808c84c 100644 --- a/ports/cppwinrt/portfile.cmake +++ b/ports/cppwinrt/portfile.cmake @@ -1,32 +1,13 @@ -#header-only library include(vcpkg_common_functions) find_program(GIT git) -set(GIT_URL "https://github.com/Microsoft/cppwinrt") -set(GIT_REF "9e01842") - -if(NOT EXISTS "${DOWNLOADS}/cppwinrt.git") - message(STATUS "Cloning") - vcpkg_execute_required_process( - COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/cppwinrt.git - WORKING_DIRECTORY ${DOWNLOADS} - LOGNAME clone - ) -endif() -message(STATUS "Cloning done") - -if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git") - message(STATUS "Adding worktree") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}) - vcpkg_execute_required_process( - COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_REF} - WORKING_DIRECTORY ${DOWNLOADS}/cppwinrt.git - LOGNAME worktree - ) -endif() -message(STATUS "Adding worktree done") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cppwinrt-february_2017_refresh) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/Microsoft/cppwinrt/archive/february_2017_refresh.tar.gz" + FILENAME "cppwinrt-february_2017_refresh.tar.gz" + SHA512 0e2ed94d65ae4c7297ae4d82d64a43fa59fac7b35fbe42ea939f135f0f6eb867f57fac70b6a9cc9a78912de75aa4482d48007f83a3781b147d237ae637fdaa0e +) +vcpkg_extract_source_archive(${ARCHIVE}) # Put the licence file where vcpkg expects it file(COPY ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/cppwinrt/license.txt) From bfa5812a6bd9dd108317491111bbdb68d4d2c9a8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 14:10:14 -0800 Subject: [PATCH 536/561] Update version of VS SetupAPI nuget package --- scripts/findVisualStudioInstallationInstances.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index e572b60976..0f685c6a9b 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -11,7 +11,7 @@ $downloadsDir = "$vcpkgRootDir\downloads" $nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" 1 $nugetPackageDir = "$downloadsDir\nuget-packages" -$SetupAPIVersion = "1.5.125-rc" +$SetupAPIVersion = "1.8.24" $nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Version $SetupAPIVersion -OutputDirectory $nugetPackageDir -Source "https://api.nuget.org/v3/index.json" -nocache 2>&1 $SetupConsoleExe = "$nugetPackageDir\Microsoft.VisualStudio.Setup.Configuration.Native.$SetupAPIVersion\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Console.exe" From 4d0abd5841b9639c20126a5a25e2b0d4a9eb98d2 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 10 Mar 2017 15:43:54 -0800 Subject: [PATCH 537/561] [vcpkg] Refactor RAII registry key manipulation --- toolsrc/include/vcpkg_System.h | 3 +++ toolsrc/src/metrics.cpp | 34 ++++------------------------------ toolsrc/src/vcpkg_System.cpp | 28 ++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 30 deletions(-) diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index 14f39ca40d..ecb98aba73 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -1,11 +1,14 @@ #pragma once +#include #include "vcpkg_Strings.h" #include "filesystem_fs.h" #include "vcpkg_optional.h" namespace vcpkg::System { + optional get_registry_string(HKEY base, const wchar_t* subkey, const wchar_t* valuename); + fs::path get_exe_path_of_current_process(); struct exit_code_and_output diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp index 4ac43c5c6f..b8e469f6ed 100644 --- a/toolsrc/src/metrics.cpp +++ b/toolsrc/src/metrics.cpp @@ -227,38 +227,12 @@ true std::wstring GetSQMUser() { - LONG err; + auto hkcu_sqmclient = System::get_registry_string(HKEY_CURRENT_USER, LR"(Software\Microsoft\SQMClient)", L"UserId"); - struct RAII_HKEY - { - HKEY hkey = nullptr; - - ~RAII_HKEY() - { - if (hkey != nullptr) - RegCloseKey(hkey); - } - } HKCU_SQMClient; - - err = RegOpenKeyExW(HKEY_CURRENT_USER, LR"(Software\Microsoft\SQMClient)", NULL, KEY_READ, &HKCU_SQMClient.hkey); - if (err != ERROR_SUCCESS) - { + if (hkcu_sqmclient) + return std::move(*hkcu_sqmclient); + else return L"{}"; - } - - std::array buffer; - DWORD lType = 0; - DWORD dwBufferSize = static_cast(buffer.size() * sizeof(wchar_t)); - err = RegQueryValueExW(HKCU_SQMClient.hkey, L"UserId", nullptr, &lType, reinterpret_cast(buffer.data()), &dwBufferSize); - if (err == ERROR_SUCCESS && lType == REG_SZ && dwBufferSize >= sizeof(wchar_t)) - { - size_t sz = dwBufferSize / sizeof(wchar_t); - if (buffer[sz - 1] == '\0') - --sz; - return std::wstring(buffer.begin(), buffer.begin() + sz); - } - - return L"{}"; } void SetUserInformation(const std::string& user_id, const std::string& first_use_time) diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 9609d819be..1730ff3ade 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -107,4 +107,32 @@ namespace vcpkg::System { _wputenv_s(varname, varvalue); } + + static bool is_string_keytype(DWORD hkey_type) + { + return hkey_type == REG_SZ || hkey_type == REG_MULTI_SZ || hkey_type == REG_EXPAND_SZ; + } + + optional get_registry_string(HKEY base, const wchar_t* subKey, const wchar_t* valuename) + { + HKEY k = nullptr; + LSTATUS ec = RegOpenKeyExW(base, subKey, NULL, KEY_READ, &k); + if (ec != ERROR_SUCCESS) + return nullptr; + + DWORD dwBufferSize = 0; + DWORD dwType = 0; + auto rc = RegQueryValueExW(k, valuename, nullptr, &dwType, nullptr, &dwBufferSize); + if (rc != ERROR_SUCCESS || !is_string_keytype(dwType) || dwBufferSize == 0 || dwBufferSize % sizeof(wchar_t) != 0) + return nullptr; + std::wstring ret; + ret.resize(dwBufferSize / sizeof(wchar_t)); + + rc = RegQueryValueExW(k, valuename, nullptr, &dwType, reinterpret_cast(ret.data()), &dwBufferSize); + if (rc != ERROR_SUCCESS || !is_string_keytype(dwType) || dwBufferSize != sizeof(wchar_t) * ret.size()) + return nullptr; + + ret.pop_back(); // remove extra trailing null byte + return std::make_unique(std::move(ret)); + } } From 07e43a7cae217f91808402020e19da2147f5d72b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Mar 2017 22:33:28 -0800 Subject: [PATCH 538/561] Nuke Joiner. Add wjoin() --- toolsrc/include/vcpkg_Strings.h | 43 ++++++++++++++++---------------- toolsrc/src/SourceParagraph.cpp | 4 +-- toolsrc/src/commands_install.cpp | 2 +- toolsrc/src/commands_remove.cpp | 10 ++++---- toolsrc/src/vcpkg_Strings.cpp | 32 +++--------------------- 5 files changed, 33 insertions(+), 58 deletions(-) diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 5b536e5e1e..abf3651e5e 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -74,7 +74,7 @@ namespace vcpkg::Strings std::string ascii_to_lowercase(const std::string& input); template - static std::string join(const std::vector& v, const std::string& prefix, const std::string& delimiter, const std::string& suffix, Transformer transformer) + std::string join(const std::string& delimiter, const std::vector& v, Transformer transformer) { if (v.empty()) { @@ -84,7 +84,6 @@ namespace vcpkg::Strings std::string output; size_t size = v.size(); - output.append(prefix); output.append(transformer(v.at(0))); for (size_t i = 1; i < size; ++i) @@ -93,35 +92,35 @@ namespace vcpkg::Strings output.append(transformer(v.at(i))); } - output.append(suffix); return output; } - static std::string join(const std::vector& v, const std::string& prefix, const std::string& delimiter, const std::string& suffix); + std::string join(const std::string& delimiter, const std::vector& v); - class Joiner + template + std::wstring wjoin(const std::wstring& delimiter, const std::vector& v, Transformer transformer) { - public: - static Joiner on(const std::string& delimiter); - - Joiner& prefix(const std::string& prefix); - Joiner& suffix(const std::string& suffix); - - std::string join(const std::vector& v) const; - - template - std::string join(const std::vector& v, Transformer transformer) const + if (v.empty()) { - return Strings::join(v, this->m_prefix, this->m_delimiter, this->m_suffix, transformer); + return std::wstring(); } - private: - explicit Joiner(const std::string& delimiter); + std::wstring output; + size_t size = v.size(); + + output.append(transformer(v.at(0))); + + for (size_t i = 1; i < size; ++i) + { + output.append(delimiter); + output.append(transformer(v.at(i))); + } + + return output; + } + + std::wstring wjoin(const std::wstring& delimiter, const std::vector& v); - std::string m_prefix; - std::string m_delimiter; - std::string m_suffix; - }; void trim(std::string* s); diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/SourceParagraph.cpp index 8bfe8e84dc..4d144191ff 100644 --- a/toolsrc/src/SourceParagraph.cpp +++ b/toolsrc/src/SourceParagraph.cpp @@ -53,8 +53,8 @@ namespace vcpkg const std::vector remaining_fields = Maps::extract_keys(fields); const std::vector& valid_fields = get_list_of_valid_fields(); - const std::string remaining_fields_as_string = Strings::Joiner::on("\n ").join(remaining_fields); - const std::string valid_fields_as_string = Strings::Joiner::on("\n ").join(valid_fields); + const std::string remaining_fields_as_string = Strings::join("\n ", remaining_fields); + const std::string valid_fields_as_string = Strings::join("\n ", valid_fields); System::println(System::color::error, "Error: There are invalid fields in the Source Paragraph of %s", this->name); System::println("The following fields were not expected:\n\n %s\n\n", remaining_fields_as_string); diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 24fa5edc0b..ad341c8479 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -158,7 +158,7 @@ namespace vcpkg::Commands::Install triplet_install_path.generic_string(), binary_paragraph.spec); System::print("\n "); - System::println(Strings::Joiner::on("\n ").join(intersection)); + System::println(Strings::join("\n ", intersection)); System::println(""); exit(EXIT_FAILURE); } diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 1daacb9445..1b7b7923a3 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -136,17 +136,17 @@ namespace vcpkg::Commands::Remove { sort_packages_by_name(¬_installed); System::println("The following packages are not installed, so not removed:\n%s", - Strings::Joiner::on("\n ").prefix(" ").join(not_installed, [](const package_spec_with_remove_plan* p) - { - return p->spec.toString(); - })); + Strings::join("\n ", not_installed, [](const package_spec_with_remove_plan* p) + { + return " " + p->spec.toString(); + })); } if (!remove.empty()) { sort_packages_by_name(&remove); System::println("The following packages will be removed:\n%s", - Strings::Joiner::on("\n").join(remove, [](const package_spec_with_remove_plan* p) + Strings::join("\n", remove, [](const package_spec_with_remove_plan* p) { if (p->plan.request_type == Dependencies::request_type::AUTO_SELECTED) { diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index a7805f2114..044fd3c05e 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -78,38 +78,14 @@ namespace vcpkg::Strings return output; } - std::string join(const std::vector& v, const std::string& prefix, const std::string& delimiter, const std::string& suffix) + std::string join(const std::string& delimiter, const std::vector& v) { - return join(v, prefix, delimiter, suffix, [](const std::string& i) -> std::string - { - return i; - }); + return join(delimiter, v, [](const std::string& p) -> const std::string& { return p; }); } - Joiner Joiner::on(const std::string& delimiter) - { - return Joiner(delimiter); - } - - Joiner& Joiner::prefix(const std::string& prefix) - { - this->m_prefix = prefix; - return *this; - } - - Joiner& Joiner::suffix(const std::string& suffix) - { - this->m_suffix = suffix; - return *this; - } - - std::string Joiner::join(const std::vector& v) const - { - return Strings::join(v, this->m_prefix, this->m_delimiter, this->m_suffix); - } - - Joiner::Joiner(const std::string& delimiter) : m_prefix(""), m_delimiter(delimiter), m_suffix("") + std::wstring wjoin(const std::wstring& delimiter, const std::vector& v) { + return wjoin(delimiter, v, [](const std::wstring& p) -> const std::wstring&{ return p; }); } void trim(std::string* s) From f81fc894124bbeb709799f6117c01654be8df07f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 15:31:45 -0800 Subject: [PATCH 539/561] Use System::println() instead of std::cout --- toolsrc/src/commands_portsdiff.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 400689b47c..25559c2ca5 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -13,10 +13,7 @@ namespace vcpkg::Commands::PortsDiff for (const std::string& name : ports_to_print) { const std::string& version = names_and_versions.at(name); - std::cout << std::left - << std::setw(20) << name << ' ' - << std::setw(16) << version << ' ' - << '\n'; + System::println("%-20s %-16s", name, version); } } @@ -28,10 +25,7 @@ namespace vcpkg::Commands::PortsDiff { const std::string& previous_version = previous_names_and_versions.at(name); const std::string& current_version = current_names_and_versions.at(name); - std::cout << std::left - << std::setw(20) << name << ' ' - << std::setw(16) << previous_version << " -> " << current_version - << '\n'; + System::println("%-20s %-16s -> %s", name, previous_version, current_version); } } From 5ba6f1725da1d11fbe1103dbafb6729107cec629 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 10 Mar 2017 16:36:39 -0800 Subject: [PATCH 540/561] [vcpkg] Also search registry keys for VSCode. Prefer insider version if available. Fixes #764. --- toolsrc/src/commands_edit.cpp | 44 ++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index 5a2433e5ac..ce0557e090 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -16,27 +16,55 @@ namespace vcpkg::Commands::Edit const fs::path portpath = paths.ports / port_name; Checks::check_exit(fs::is_directory(portpath), R"(Could not find port named "%s")", port_name); - // Find editor - const optional env_EDITOR_optional = System::get_environmental_variable(L"EDITOR"); + // Find the user's selected editor std::wstring env_EDITOR; - if (env_EDITOR_optional) + if (env_EDITOR.empty()) { - env_EDITOR = *env_EDITOR_optional; + const optional env_EDITOR_optional = System::get_environmental_variable(L"EDITOR"); + if (env_EDITOR_optional) + { + env_EDITOR = *env_EDITOR_optional; + } } - else + + if (env_EDITOR.empty()) { - static const fs::path CODE_EXE_PATH = Environment::get_ProgramFiles_32_bit() / "Microsoft VS Code/Code.exe"; + const fs::path CODE_EXE_PATH = Environment::get_ProgramFiles_32_bit() / "Microsoft VS Code/Code.exe"; if (fs::exists(CODE_EXE_PATH)) { env_EDITOR = CODE_EXE_PATH; } - else + } + + if (env_EDITOR.empty()) + { + static const std::array regkeys = { + LR"(SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{C26E74D1-022E-4238-8B9D-1E7564A36CC9}_is1)", + LR"(SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C26E74D1-022E-4238-8B9D-1E7564A36CC9}_is1)", + LR"(SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{F8A2A208-72B3-4D61-95FC-8A65D340689B}_is1)", + LR"(SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F8A2A208-72B3-4D61-95FC-8A65D340689B}_is1)", + }; + for (auto&& keypath : regkeys) { - Checks::exit_with_message("Visual Studio Code was not found and the environmental variable EDITOR is not set"); + auto code_installpath = System::get_registry_string(HKEY_LOCAL_MACHINE, keypath, L"InstallLocation"); + if (code_installpath) + { + auto p = fs::path(*code_installpath) / "Code.exe"; + if (fs::exists(p)) + { + env_EDITOR = p.native(); + break; + } + } } } + if (env_EDITOR.empty()) + { + Checks::exit_with_message("Visual Studio Code was not found and the environment variable EDITOR is not set"); + } + std::wstring cmdLine = Strings::wformat(LR"("%s" "%s" "%s" -n)", env_EDITOR, portpath.native(), (portpath / "portfile.cmake").native()); exit(System::cmd_execute(cmdLine)); } From 47b53b9015deaa2f569d788447254c8bc3de96a9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 9 Mar 2017 18:24:04 -0800 Subject: [PATCH 541/561] Add lazy.h --- toolsrc/include/lazy.h | 26 +++++++++++++++++++++++ toolsrc/vcpkglib/vcpkglib.vcxproj | 1 + toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 toolsrc/include/lazy.h diff --git a/toolsrc/include/lazy.h b/toolsrc/include/lazy.h new file mode 100644 index 0000000000..f9dbd8dc7c --- /dev/null +++ b/toolsrc/include/lazy.h @@ -0,0 +1,26 @@ +#pragma once + +namespace vcpkg +{ + template + class lazy + { + public: + lazy() : value(T()), initialized(false) {} + + template + T const& get_lazy(F& f) const + { + if (!initialized) + { + value = f(); + initialized = true; + } + return value; + } + + private: + mutable T value; + mutable bool initialized; + }; +} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index b96dd10500..dd5dd124a7 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -137,6 +137,7 @@ + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index aefba7a490..d701321be2 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -293,5 +293,8 @@ Header Files + + Header Files + \ No newline at end of file From 7b14894dc75b720434e0a7095c05a11cfa308cc4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 16:30:44 -0800 Subject: [PATCH 542/561] [vcpkg_paths] Add get_cmake/git/nuget_exe() functions --- toolsrc/include/vcpkg_paths.h | 10 +++ toolsrc/src/vcpkg_paths.cpp | 160 ++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+) diff --git a/toolsrc/include/vcpkg_paths.h b/toolsrc/include/vcpkg_paths.h index ba6defb9f2..99fd149058 100644 --- a/toolsrc/include/vcpkg_paths.h +++ b/toolsrc/include/vcpkg_paths.h @@ -3,6 +3,7 @@ #include "expected.h" #include "package_spec.h" #include "BinaryParagraph.h" +#include "lazy.h" namespace vcpkg { @@ -35,5 +36,14 @@ namespace vcpkg fs::path vcpkg_dir_updates; fs::path ports_cmake; + + const fs::path& get_cmake_exe() const; + const fs::path& get_git_exe() const; + const fs::path& get_nuget_exe() const; + + private: + lazy cmake_exe; + lazy git_exe; + lazy nuget_exe; }; } diff --git a/toolsrc/src/vcpkg_paths.cpp b/toolsrc/src/vcpkg_paths.cpp index 8d7060a022..34bab1dda2 100644 --- a/toolsrc/src/vcpkg_paths.cpp +++ b/toolsrc/src/vcpkg_paths.cpp @@ -4,9 +4,153 @@ #include "metrics.h" #include "vcpkg_System.h" #include "package_spec.h" +#include "vcpkg_Environment.h" namespace vcpkg { + static bool exists_and_has_equal_or_greater_version(const std::wstring& version_cmd, const std::array& expected_version) + { + static const std::regex re(R"###((\d+)\.(\d+)\.(\d+))###"); + + auto rc = System::cmd_execute_and_capture_output(Strings::wformat(LR"(%s 2>&1)", version_cmd)); + if (rc.exit_code != 0) + { + return false; + } + + std::match_results match; + auto found = std::regex_search(rc.output, match, re); + if (!found) + { + return false; + } + + int d1 = atoi(match[1].str().c_str()); + int d2 = atoi(match[2].str().c_str()); + int d3 = atoi(match[3].str().c_str()); + if (d1 > expected_version[0] || (d1 == expected_version[0] && d2 > expected_version[1]) || (d1 == expected_version[0] && d2 == expected_version[1] && d3 >= expected_version[2])) + { + // satisfactory version found + return true; + } + + return false; + } + + static optional find_if_has_equal_or_greater_version(const std::vector& candidate_paths, const std::wstring& version_check_arguments, const std::array& expected_version) + { + auto it = std::find_if(candidate_paths.cbegin(), candidate_paths.cend(), [&](const fs::path& p) + { + const std::wstring cmd = Strings::wformat(LR"("%s" %s)", p.native(), version_check_arguments); + return exists_and_has_equal_or_greater_version(cmd, expected_version); + }); + + if (it != candidate_paths.cend()) + { + return std::make_unique(std::move(*it)); + } + + return nullptr; + } + + static std::vector find_from_PATH(const std::wstring& name) + { + const std::wstring cmd = Strings::wformat(L"where.exe %s", name); + auto out = System::cmd_execute_and_capture_output(cmd); + if (out.exit_code != 0) + { + return {}; + } + + const std::vector paths_to_add = Strings::split(out.output, "\n"); + std::vector v; + v.insert(v.end(), paths_to_add.cbegin(), paths_to_add.cend()); + return v; + } + + static fs::path fetch_dependency(const fs::path scripts_folder, const std::wstring& tool_name, const fs::path& expected_downloaded_path) + { + const fs::path script = scripts_folder / "fetchDependency.ps1"; + auto install_cmd = System::create_powershell_script_cmd(script, Strings::wformat(L"-Dependency %s", tool_name)); + System::exit_code_and_output rc = System::cmd_execute_and_capture_output(install_cmd); + if (rc.exit_code) + { + System::println(System::color::error, "Launching powershell failed or was denied"); + TrackProperty("error", "powershell install failed"); + TrackProperty("installcmd", install_cmd); + exit(rc.exit_code); + } + + const fs::path actual_downloaded_path = rc.output; + Checks::check_exit(expected_downloaded_path == actual_downloaded_path, "Expected dependency downloaded path to be %s, but was %s", + expected_downloaded_path.generic_string(), actual_downloaded_path.generic_string()); + return actual_downloaded_path; + } + + static fs::path get_cmake_path(const fs::path& downloads_folder, const fs::path scripts_folder) + { + static constexpr std::array expected_version = { 3,8,0 }; + static const std::wstring version_check_arguments = L"--version"; + + const fs::path downloaded_copy = downloads_folder / "cmake-3.8.0-rc1-win32-x86" / "bin" / "cmake.exe"; + const std::vector from_path = find_from_PATH(L"cmake"); + + std::vector candidate_paths; + candidate_paths.push_back(downloaded_copy); + candidate_paths.insert(candidate_paths.end(), from_path.cbegin(), from_path.cend()); + candidate_paths.push_back(Environment::get_ProgramFiles_platform_bitness() / "CMake" / "bin" / "cmake.exe"); + candidate_paths.push_back(Environment::get_ProgramFiles_32_bit() / "CMake" / "bin"); + + if (auto ret = find_if_has_equal_or_greater_version(candidate_paths, version_check_arguments, expected_version)) + { + return *ret; + } + + return fetch_dependency(scripts_folder, L"cmake", downloaded_copy); + } + + fs::path get_nuget_path(const fs::path& downloads_folder, const fs::path scripts_folder) + { + static constexpr std::array expected_version = { 3,3,0 }; + static const std::wstring version_check_arguments = L""; + + const fs::path downloaded_copy = downloads_folder / "nuget-3.5.0" / "nuget.exe"; + const std::vector from_path = find_from_PATH(L"nuget"); + + std::vector candidate_paths; + candidate_paths.push_back(downloaded_copy); + candidate_paths.insert(candidate_paths.end(), from_path.cbegin(), from_path.cend()); + + if (auto ret = find_if_has_equal_or_greater_version(candidate_paths, version_check_arguments, expected_version)) + { + return *ret; + } + + return fetch_dependency(scripts_folder, L"nuget", downloaded_copy); + } + + fs::path get_git_path(const fs::path& downloads_folder, const fs::path scripts_folder) + { + static constexpr std::array expected_version = { 2,0,0 }; + static const std::wstring version_check_arguments = L"--version"; + + const fs::path downloaded_copy = downloads_folder / "MinGit-2.11.1-32-bit" / "cmd" / "git.exe"; + const std::vector from_path = find_from_PATH(L"git"); + + std::vector candidate_paths; + candidate_paths.push_back(downloaded_copy); + candidate_paths.insert(candidate_paths.end(), from_path.cbegin(), from_path.cend()); + candidate_paths.push_back(Environment::get_ProgramFiles_platform_bitness() / "git" / "cmd" / "git.exe"); + candidate_paths.push_back(Environment::get_ProgramFiles_32_bit() / "git" / "cmd" / "git.exe"); + + if (auto ret = find_if_has_equal_or_greater_version(candidate_paths, version_check_arguments, expected_version)) + { + return *ret; + } + + return fetch_dependency(scripts_folder, L"git", downloaded_copy); + } + expected vcpkg_paths::create(const fs::path& vcpkg_root_dir) { std::error_code ec; @@ -43,6 +187,7 @@ namespace vcpkg paths.vcpkg_dir_updates = paths.vcpkg_dir / "updates"; paths.ports_cmake = paths.scripts / "ports.cmake"; + return paths; } @@ -80,4 +225,19 @@ namespace vcpkg } return false; } + + const fs::path& vcpkg_paths::get_cmake_exe() const + { + return this->cmake_exe.get_lazy([this]() { return get_cmake_path(this->downloads, this->scripts); }); + } + + const fs::path& vcpkg_paths::get_git_exe() const + { + return this->git_exe.get_lazy([this]() { return get_git_path(this->downloads, this->scripts); }); + } + + const fs::path& vcpkg_paths::get_nuget_exe() const + { + return this->nuget_exe.get_lazy([this]() { return get_nuget_path(this->downloads, this->scripts); }); + } } From 0b30bc7243b7caf3cfce9130f3862607efe715bd Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 16:34:24 -0800 Subject: [PATCH 543/561] `portsdiff`: Use paths.get_git_exe(); --- toolsrc/src/commands_portsdiff.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 25559c2ca5..065a35345d 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -31,18 +31,21 @@ namespace vcpkg::Commands::PortsDiff static std::map read_ports_from_commit(const vcpkg_paths& paths, const std::wstring& git_commit_id) { + const fs::path& git_exe = paths.get_git_exe(); const fs::path dot_git_dir = paths.root / ".git"; const std::wstring ports_dir_name_as_string = paths.ports.filename().native(); const fs::path temp_checkout_path = paths.root / Strings::wformat(L"%s-%s", ports_dir_name_as_string, git_commit_id); fs::create_directory(temp_checkout_path); const std::wstring checkout_this_dir = Strings::wformat(LR"(.\%s)", ports_dir_name_as_string); // Must be relative to the root of the repository - const std::wstring cmd = Strings::wformat(LR"(git --git-dir="%s" --work-tree="%s" checkout %s -f -q -- %s %s & git reset >NUL)", + const std::wstring cmd = Strings::wformat(LR"("%s" --git-dir="%s" --work-tree="%s" checkout %s -f -q -- %s %s & "%s" reset >NUL)", + git_exe.native(), dot_git_dir.native(), temp_checkout_path.native(), git_commit_id, checkout_this_dir, - L".vcpkg-root"); + L".vcpkg-root", + git_exe.native()); System::cmd_execute(cmd); const std::vector source_paragraphs = Paragraphs::load_all_ports(temp_checkout_path / ports_dir_name_as_string); const std::map names_and_versions = Paragraphs::extract_port_names_and_versions(source_paragraphs); @@ -50,11 +53,11 @@ namespace vcpkg::Commands::PortsDiff return names_and_versions; } - static void check_commit_exists(const std::wstring& git_commit_id) + static void check_commit_exists(const fs::path& git_exe, const std::wstring& git_commit_id) { static const std::string VALID_COMMIT_OUTPUT = "commit\n"; - const std::wstring cmd = Strings::wformat(LR"(git cat-file -t %s 2>NUL)", git_commit_id); + const std::wstring cmd = Strings::wformat(LR"("%s" cat-file -t %s 2>NUL)", git_exe.native(), git_commit_id); const System::exit_code_and_output output = System::cmd_execute_and_capture_output(cmd); Checks::check_exit(output.output == VALID_COMMIT_OUTPUT, "Invalid commit id %s", Strings::utf16_to_utf8(git_commit_id)); } @@ -66,12 +69,13 @@ namespace vcpkg::Commands::PortsDiff args.check_max_arg_count(2, example); args.check_and_get_optional_command_arguments({}); - Environment::ensure_git_on_path(paths); + const fs::path& git_exe = paths.get_git_exe(); + const std::wstring git_commit_id_for_previous_snapshot = Strings::utf8_to_utf16(args.command_arguments.at(0)); const std::wstring git_commit_id_for_current_snapshot = args.command_arguments.size() < 2 ? L"HEAD" : Strings::utf8_to_utf16(args.command_arguments.at(1)); - check_commit_exists(git_commit_id_for_current_snapshot); - check_commit_exists(git_commit_id_for_previous_snapshot); + check_commit_exists(git_exe, git_commit_id_for_current_snapshot); + check_commit_exists(git_exe, git_commit_id_for_previous_snapshot); const std::map current_names_and_versions = read_ports_from_commit(paths, git_commit_id_for_current_snapshot); const std::map previous_names_and_versions = read_ports_from_commit(paths, git_commit_id_for_previous_snapshot); From f93b3ccc4fb85bb9ef3f3f15d240647b44769fc4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 16:39:04 -0800 Subject: [PATCH 544/561] Introduce make_cmake_cmd() helper function --- toolsrc/include/vcpkglib.h | 14 ++++++++++++++ toolsrc/src/vcpkglib.cpp | 14 +++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/toolsrc/include/vcpkglib.h b/toolsrc/include/vcpkglib.h index 1ce55bd8ac..353bfb0a0d 100644 --- a/toolsrc/include/vcpkglib.h +++ b/toolsrc/include/vcpkglib.h @@ -17,4 +17,18 @@ namespace vcpkg }; std::vector get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db); + + + struct CMakeVariable + { + CMakeVariable(const std::wstring& varname, const wchar_t* varvalue); + CMakeVariable(const std::wstring& varname, const std::string& varvalue); + CMakeVariable(const std::wstring& varname, const std::wstring& varvalue); + CMakeVariable(const std::wstring& varname, const fs::path& path); + + std::wstring s; + }; + + std::wstring make_cmake_cmd(const fs::path& cmake_exe, const fs::path& cmake_script, const std::vector& pass_variables); + } // namespace vcpkg diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkglib.cpp index 2415372db3..7ea33da0ac 100644 --- a/toolsrc/src/vcpkglib.cpp +++ b/toolsrc/src/vcpkglib.cpp @@ -3,6 +3,7 @@ #include "vcpkg_Files.h" #include "Paragraphs.h" #include "metrics.h" +#include "vcpkg_Strings.h" namespace vcpkg { @@ -159,7 +160,7 @@ namespace vcpkg x86-windows/include/FLAC++/all.h x86-windows/include/FLAC++/decoder.h x86-windows/include/FLAC++/encoder.h - */ + */ // Note that after sorting, the FLAC++/ group will be placed before the FLAC/ group // The new format is lexicographically sorted std::sort(lines->begin(), lines->end()); @@ -200,4 +201,15 @@ namespace vcpkg return installed_files; } + + CMakeVariable::CMakeVariable(const std::wstring& varname, const wchar_t* varvalue) : s(Strings::wformat(LR"("-D%s=%s")", varname, varvalue)) { } + CMakeVariable::CMakeVariable(const std::wstring& varname, const std::string& varvalue) : CMakeVariable(varname, Strings::utf8_to_utf16(varvalue).c_str()) { } + CMakeVariable::CMakeVariable(const std::wstring& varname, const std::wstring& varvalue) : CMakeVariable(varname, varvalue.c_str()) {} + CMakeVariable::CMakeVariable(const std::wstring& varname, const fs::path& path) : CMakeVariable(varname, path.generic_wstring()) {} + + std::wstring make_cmake_cmd(const fs::path& cmake_exe, const fs::path& cmake_script, const std::vector& pass_variables) + { + std::wstring cmd_cmake_pass_variables = Strings::wjoin(L" ", pass_variables, [](auto&& v) { return v.s; }); + return Strings::wformat(LR"("%s" %s -P "%s")", cmake_exe.native(), cmd_cmake_pass_variables, cmake_script.generic_wstring()); + } } From f7f471c04afd1063b9150ee24789138f104ff5ba Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 16:40:43 -0800 Subject: [PATCH 545/561] `build`: Use make_cmake_cmd() and paths.get_cmake/git_exe() --- toolsrc/src/commands_build.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 02b98e28d0..f2dabe25ef 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -39,22 +39,26 @@ namespace vcpkg::Commands::Build } } - // If these environment variables are set while running the VS2017 developer prompt, it will not correctly initialize the build environment. - System::set_environmental_variable(L"VSINSTALLDIR", L""); - System::set_environmental_variable(L"DevEnvDir", L""); + const fs::path& cmake_exe_path = paths.get_cmake_exe(); + const fs::path& git_exe_path = paths.get_git_exe(); const fs::path ports_cmake_script_path = paths.ports_cmake; const Environment::vcvarsall_and_platform_toolset vcvarsall_bat = Environment::get_vcvarsall_bat(paths); - const std::wstring command = Strings::wformat(LR"("%s" %s >nul 2>&1 && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s -DVCPKG_PLATFORM_TOOLSET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", - vcvarsall_bat.path.native(), - Strings::utf8_to_utf16(target_triplet.architecture()), - Strings::utf8_to_utf16(source_paragraph.name), - Strings::utf8_to_utf16(target_triplet.canonical_name()), - vcvarsall_bat.platform_toolset, - port_dir.generic_wstring(), - ports_cmake_script_path.generic_wstring()); + const std::wstring cmd_set_environment = Strings::wformat(LR"("%s" %s >nul 2>&1)", vcvarsall_bat.path.native(), Strings::utf8_to_utf16(target_triplet.architecture())); - ElapsedTime timer = ElapsedTime::createStarted(); + const std::wstring cmd_launch_cmake = make_cmake_cmd(cmake_exe_path, ports_cmake_script_path, + { + { L"CMD", L"BUILD" }, + { L"PORT", source_paragraph.name }, + { L"CURRENT_PORT_DIR", port_dir / "/." }, + { L"TARGET_TRIPLET", target_triplet.canonical_name() }, + { L"VCPKG_PLATFORM_TOOLSET", vcvarsall_bat.platform_toolset }, + { L"GIT", git_exe_path } + }); + + const std::wstring command = Strings::wformat(LR"(%s && %s)", cmd_set_environment, cmd_launch_cmake); + + const ElapsedTime timer = ElapsedTime::createStarted(); int return_code = System::cmd_execute(command); auto buildtimeus = timer.microseconds(); @@ -133,7 +137,6 @@ namespace vcpkg::Commands::Build Checks::check_exit(!maybe_spgh.error_code(), "Could not find package named %s: %s", spec, maybe_spgh.error_code().message()); const SourceParagraph& spgh = *maybe_spgh.get(); - Environment::ensure_utilities_on_path(paths); StatusParagraphs status_db = database_load_check(paths); const BuildResult result = build_package(spgh, spec, paths, paths.port_dir(spec), status_db); if (result == BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES) From 9ca839390e8ada8080a25ac92435a11c52ae41e6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 16:41:50 -0800 Subject: [PATCH 546/561] `create`: Use make_cmake_cmd() and paths.get_cmake_exe() --- toolsrc/src/commands_create.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/toolsrc/src/commands_create.cpp b/toolsrc/src/commands_create.cpp index 494c2aa08d..fc795c621b 100644 --- a/toolsrc/src/commands_create.cpp +++ b/toolsrc/src/commands_create.cpp @@ -4,36 +4,38 @@ #include "vcpkg_Environment.h" #include "vcpkg_Files.h" #include "vcpkg_Input.h" +#include "vcpkglib.h" namespace vcpkg::Commands::Create { void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths) { - static const std::string example = Commands::Help::create_example_string(R"###(create zlib2 http://zlib.net/zlib128.zip "zlib128-2.zip")###"); + static const std::string example = Commands::Help::create_example_string(R"###(create zlib2 http://zlib.net/zlib1211.zip "zlib1211-2.zip")###"); args.check_max_arg_count(3, example); args.check_min_arg_count(2, example); args.check_and_get_optional_command_arguments({}); const std::string port_name = args.command_arguments.at(0); + const std::string url = args.command_arguments.at(1); - Environment::ensure_utilities_on_path(paths); + const fs::path& cmake_exe = paths.get_cmake_exe(); + + std::vector cmake_args + { + { L"CMD", L"CREATE" }, + { L"PORT", port_name }, + { L"URL", url } + }; - // Space OR define the FILENAME with proper spacing - std::wstring custom_filename = L" "; if (args.command_arguments.size() >= 3) { const std::string& zip_file_name = args.command_arguments.at(2); Checks::check_exit(!Files::has_invalid_chars_for_filesystem(zip_file_name), - R"(Filename cannot contain invalid chars %s, but was %s)", - Files::FILESYSTEM_INVALID_CHARACTERS, zip_file_name); - custom_filename = Strings::wformat(LR"( -DFILENAME="%s" )", Strings::utf8_to_utf16(zip_file_name)); + R"(Filename cannot contain invalid chars %s, but was %s)", + Files::FILESYSTEM_INVALID_CHARACTERS, zip_file_name); + cmake_args.push_back({ L"FILENAME", zip_file_name }); } - const std::wstring cmdline = Strings::wformat(LR"(cmake -DCMD=CREATE -DPORT=%s -DURL=%s%s-P "%s")", - Strings::utf8_to_utf16(port_name), - Strings::utf8_to_utf16(args.command_arguments.at(1)), - custom_filename, - paths.ports_cmake.generic_wstring()); - - exit(System::cmd_execute(cmdline)); + const std::wstring cmd_launch_cmake = make_cmake_cmd(cmake_exe, paths.ports_cmake, cmake_args); + exit(System::cmd_execute(cmd_launch_cmake)); } } From 62fcffff856aa2b6ef61601ecaf025166111bb02 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 16:43:28 -0800 Subject: [PATCH 547/561] `integrate`: Use paths.get_nuget_exe() --- toolsrc/src/commands_integrate.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 6d28da6abd..4ccd6d4359 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -213,11 +213,11 @@ namespace vcpkg::Commands::Integrate System::println(System::color::success, "Applied user-wide integration for this vcpkg root."); const fs::path cmake_toolchain = paths.buildsystems / "vcpkg.cmake"; System::println("\n" - "All MSBuild C++ projects can now #include any installed libraries.\n" - "Linking will be handled automatically.\n" - "Installing new libraries will make them instantly available.\n" - "\n" - "CMake projects should use -DCMAKE_TOOLCHAIN_FILE=%s", cmake_toolchain.generic_string()); + "All MSBuild C++ projects can now #include any installed libraries.\n" + "Linking will be handled automatically.\n" + "Installing new libraries will make them instantly available.\n" + "\n" + "CMake projects should use -DCMAKE_TOOLCHAIN_FILE=%s", cmake_toolchain.generic_string()); exit(EXIT_SUCCESS); } @@ -249,7 +249,7 @@ namespace vcpkg::Commands::Integrate static void integrate_project(const vcpkg_paths& paths) { - Environment::ensure_nuget_on_path(paths); + const fs::path& nuget_exe = paths.get_nuget_exe(); const fs::path& buildsystems_dir = paths.buildsystems; const fs::path tmp_dir = buildsystems_dir / "tmp"; @@ -267,7 +267,7 @@ namespace vcpkg::Commands::Integrate std::ofstream(nuspec_file_path) << create_nuspec_file(paths.root, nuget_id, nupkg_version); // Using all forward slashes for the command line - const std::wstring cmd_line = Strings::wformat(LR"(nuget.exe pack -OutputDirectory "%s" "%s" > nul)", buildsystems_dir.native(), nuspec_file_path.native()); + const std::wstring cmd_line = Strings::wformat(LR"("%s" pack -OutputDirectory "%s" "%s" > nul)", nuget_exe.native(), buildsystems_dir.native(), nuspec_file_path.native()); const int exit_code = System::cmd_execute(cmd_line); From 40419c768ab30c6ca802e5dae2ec727ed1b2df0e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 16:44:44 -0800 Subject: [PATCH 548/561] `ci`: Remove call to Environment::ensure_utilities_on_path(); --- toolsrc/src/commands_ci.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index 4a66b77d1f..315308a625 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -1,7 +1,6 @@ #include "pch.h" #include "vcpkg_Commands.h" #include "vcpkglib.h" -#include "vcpkg_Environment.h" #include "vcpkg_Files.h" #include "vcpkg_System.h" #include "vcpkg_Dependencies.h" @@ -40,8 +39,6 @@ namespace vcpkg::Commands::CI const std::vector install_plan = Dependencies::create_install_plan(paths, specs, status_db); Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty"); - Environment::ensure_utilities_on_path(paths); - std::vector results; std::vector timing; const ElapsedTime timer = ElapsedTime::createStarted(); From ed21cde02a30418c0069a2c0556c01fb5aa505fa Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 16:46:23 -0800 Subject: [PATCH 549/561] `install`: Remove call to Environment::ensure_utilities_on_path(); --- toolsrc/src/commands_install.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index ad341c8479..bb3df943c7 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -1,7 +1,6 @@ #include "pch.h" #include "vcpkg_Commands.h" #include "vcpkglib.h" -#include "vcpkg_Environment.h" #include "metrics.h" #include "vcpkg_Files.h" #include "vcpkg_System.h" @@ -203,7 +202,6 @@ namespace vcpkg::Commands::Install specs_string.append(install_plan[i].spec.toString()); } TrackProperty("installplan", specs_string); - Environment::ensure_utilities_on_path(paths); for (const package_spec_with_install_plan& action : install_plan) { From b364239d0711a9749a61f16f2b101801e863b5c2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 16:47:13 -0800 Subject: [PATCH 550/561] Remove all Environment::ensure_X_on_path() --- toolsrc/include/vcpkg_Environment.h | 12 ---- toolsrc/src/vcpkg_Environment.cpp | 104 ++-------------------------- 2 files changed, 6 insertions(+), 110 deletions(-) diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index c2d2ed7ae6..5d12c8f6cb 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -3,18 +3,6 @@ namespace vcpkg::Environment { - void ensure_nuget_on_path(const vcpkg_paths& paths); - - void ensure_git_on_path(const vcpkg_paths& paths); - - void ensure_cmake_on_path(const vcpkg_paths& paths); - - inline void ensure_utilities_on_path(const vcpkg_paths& paths) - { - ensure_cmake_on_path(paths); - ensure_git_on_path(paths); - } - const fs::path& get_dumpbin_exe(const vcpkg_paths& paths); struct vcvarsall_and_platform_toolset diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 93953f92bb..98d1357e4a 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -1,104 +1,12 @@ #include "pch.h" #include "vcpkg_Environment.h" #include "vcpkg_Commands.h" -#include "metrics.h" #include "vcpkg_System.h" #include "vcpkg_Strings.h" #include "vcpkg_Files.h" namespace vcpkg::Environment { - static void ensure_on_path(const std::array& version, const std::wstring& version_check_cmd, const std::wstring& install_cmd) - { - System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(version_check_cmd); - if (ec_data.exit_code == 0) - { - // version check - std::regex re(R"###((\d+)\.(\d+)\.(\d+))###"); - std::match_results match; - auto found = std::regex_search(ec_data.output, match, re); - if (found) - { - int d1 = atoi(match[1].str().c_str()); - int d2 = atoi(match[2].str().c_str()); - int d3 = atoi(match[3].str().c_str()); - if (d1 > version[0] || (d1 == version[0] && d2 > version[1]) || (d1 == version[0] && d2 == version[1] && d3 >= version[2])) - { - // satisfactory version found - return; - } - } - } - - auto rc = System::cmd_execute(install_cmd); - if (rc) - { - System::println(System::color::error, "Launching powershell failed or was denied"); - TrackProperty("error", "powershell install failed"); - TrackProperty("installcmd", install_cmd); - exit(rc); - } - } - - static std::wstring create_default_install_cmd(const vcpkg_paths& paths, const std::wstring& tool_name) - { - const fs::path script = paths.scripts / "fetchDependency.ps1"; - return System::create_powershell_script_cmd(script, Strings::wformat(L"-Dependency %s", tool_name)); - } - - void ensure_git_on_path(const vcpkg_paths& paths) - { - static const fs::path default_git_installation_dir = Environment::get_ProgramFiles_platform_bitness() / "git/cmd"; - static const fs::path default_git_installation_dir_32 = Environment::get_ProgramFiles_32_bit() / "git/cmd"; - - const fs::path portable_git = paths.downloads / "PortableGit" / "cmd"; // TODO: Remove next time we bump the version - const fs::path min_git = paths.downloads / "MinGit-2.11.1-32-bit" / "cmd"; - const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s;%s", - min_git.native(), - portable_git.native(), - *System::get_environmental_variable(L"PATH"), - default_git_installation_dir.native(), - default_git_installation_dir_32.native()); - - System::set_environmental_variable(L"PATH", path_buf.c_str()); - - static constexpr std::array git_version = { 2,0,0 }; - static const std::wstring version_check_cmd = L"git --version 2>&1"; - const std::wstring install_cmd = create_default_install_cmd(paths, L"git"); - ensure_on_path(git_version, version_check_cmd, install_cmd); - } - - void ensure_cmake_on_path(const vcpkg_paths& paths) - { - static const fs::path default_cmake_installation_dir = Environment::get_ProgramFiles_platform_bitness() / "CMake/bin"; - static const fs::path default_cmake_installation_dir_32 = Environment::get_ProgramFiles_32_bit() / "CMake/bin"; - - const fs::path downloaded_cmake = paths.downloads / "cmake-3.8.0-rc1-win32-x86" / "bin"; - const std::wstring path_buf = Strings::wformat(L"%s;%s;%s;%s", - downloaded_cmake.native(), - *System::get_environmental_variable(L"PATH"), - default_cmake_installation_dir.native(), - default_cmake_installation_dir_32.native()); - System::set_environmental_variable(L"PATH", path_buf.c_str()); - - static constexpr std::array cmake_version = { 3,8,0 }; - static const std::wstring version_check_cmd = L"cmake --version 2>&1"; - const std::wstring install_cmd = create_default_install_cmd(paths, L"cmake"); - ensure_on_path(cmake_version, version_check_cmd, install_cmd); - } - - void ensure_nuget_on_path(const vcpkg_paths& paths) - { - const fs::path downloaded_nuget = paths.downloads / "nuget-3.5.0"; - const std::wstring path_buf = Strings::wformat(L"%s;%s", downloaded_nuget.native(), *System::get_environmental_variable(L"PATH")); - System::set_environmental_variable(L"PATH", path_buf.c_str()); - - static constexpr std::array nuget_version = { 3,3,0 }; - static const std::wstring version_check_cmd = L"nuget 2>&1"; - const std::wstring install_cmd = create_default_install_cmd(paths, L"nuget"); - ensure_on_path(nuget_version, version_check_cmd, install_cmd); - } - static std::vector get_VS2017_installation_instances(const vcpkg_paths& paths) { const fs::path script = paths.scripts / "findVisualStudioInstallationInstances.ps1"; @@ -138,15 +46,15 @@ namespace vcpkg::Environment const fs::path msvc_path = Strings::format(R"(%s\VC\Tools\MSVC)", instance); std::vector msvc_subdirectories; Files::non_recursive_find_matching_paths_in_dir(msvc_path, [&](const fs::path& current) - { - return fs::is_directory(current); - }, &msvc_subdirectories); + { + return fs::is_directory(current); + }, &msvc_subdirectories); // Sort them so that latest comes first std::sort(msvc_subdirectories.begin(), msvc_subdirectories.end(), [&](const fs::path& left, const fs::path& right) - { - return left.filename() > right.filename(); - }); + { + return left.filename() > right.filename(); + }); for (const fs::path& subdir : msvc_subdirectories) { From 5f39474a17aefc754dcba7d07b2c6ec8a03fc07c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 16:54:08 -0800 Subject: [PATCH 551/561] Rework System::get_environmental_variable() --- toolsrc/src/vcpkg_System.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 1730ff3ade..b333f36b0d 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -1,5 +1,6 @@ #include "pch.h" #include "vcpkg_System.h" +#include "vcpkg_Checks.h" namespace vcpkg::System { @@ -92,15 +93,16 @@ namespace vcpkg::System optional get_environmental_variable(const wchar_t* varname) noexcept { - wchar_t* buffer; - _wdupenv_s(&buffer, nullptr, varname); - - if (buffer == nullptr) - { + auto sz = GetEnvironmentVariableW(varname, nullptr, 0); + if (sz == 0) return nullptr; - } - std::unique_ptr bufptr(buffer, free); - return std::make_unique(buffer); + + auto ret = std::make_unique(sz, L'\0'); + Checks::check_exit(MAXDWORD >= ret->size()); + auto sz2 = GetEnvironmentVariableW(varname, ret->data(), static_cast(ret->size())); + Checks::check_exit(sz2 + 1 == sz); + ret->pop_back(); + return ret; } void set_environmental_variable(const wchar_t* varname, const wchar_t* varvalue) noexcept From 6860b461a1fc3a910cb64b0b55402685043237dd Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 16:55:59 -0800 Subject: [PATCH 552/561] Introduce System::cmd_execute_clean() for sanitized executions --- toolsrc/include/pch.h | 1 + toolsrc/include/vcpkg_System.h | 7 +++ toolsrc/src/vcpkg_System.cpp | 80 ++++++++++++++++++++++++++++++++-- 3 files changed, 85 insertions(+), 3 deletions(-) diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index 56f24f161c..e78f17237b 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index ecb98aba73..71caeed5ef 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -17,6 +17,13 @@ namespace vcpkg::System std::string output; }; + int cmd_execute_clean(const wchar_t* cmd_line); + + inline int cmd_execute_clean(const std::wstring& cmd_line) + { + return cmd_execute_clean(cmd_line.c_str()); + } + int cmd_execute(const wchar_t* cmd_line); inline int cmd_execute(const std::wstring& cmd_line) diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index b333f36b0d..472f8450f7 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -6,17 +6,91 @@ namespace vcpkg::System { fs::path get_exe_path_of_current_process() { - wchar_t buf[_MAX_PATH ]; + wchar_t buf[_MAX_PATH]; int bytes = GetModuleFileNameW(nullptr, buf, _MAX_PATH); if (bytes == 0) std::abort(); return fs::path(buf, buf + bytes); } + int cmd_execute_clean(const wchar_t* cmd_line) + { + static const std::wstring system_root = *get_environmental_variable(L"SystemRoot"); + static const std::wstring system_32 = system_root + LR"(\system32)"; + static const std::wstring new_PATH = Strings::wformat(LR"(Path=%s;%s;%s\WindowsPowerShell\v1.0\)", system_32, system_root, system_32); + + std::vector env_wstrings = + { + L"ALLUSERSPROFILE", + L"APPDATA", + L"CommonProgramFiles", + L"CommonProgramFiles(x86)", + L"CommonProgramW6432", + L"COMPUTERNAME", + L"ComSpec", + L"HOMEDRIVE", + L"HOMEPATH", + L"LOCALAPPDATA", + L"LOGONSERVER", + L"NUMBER_OF_PROCESSORS", + L"OS", + L"PATHEXT", + L"PROCESSOR_ARCHITECTURE", + L"PROCESSOR_IDENTIFIER", + L"PROCESSOR_LEVEL", + L"PROCESSOR_REVISION", + L"ProgramData", + L"ProgramFiles", + L"ProgramFiles(x86)", + L"ProgramW6432", + L"PROMPT", + L"PSModulePath", + L"PUBLIC", + L"SystemDrive", + L"SystemRoot", + L"TEMP", + L"TMP", + L"USERDNSDOMAIN", + L"USERDOMAIN", + L"USERDOMAIN_ROAMINGPROFILE", + L"USERNAME", + L"USERPROFILE", + L"windir", + // Enables proxy information to be passed to Curl, the underlying download library in cmake.exe + L"HTTP_PROXY", + L"HTTPS_PROXY", + }; + + // Flush stdout before launching external process + _flushall(); + + std::vector env_cstr; + env_cstr.reserve(env_wstrings.size() + 2); + + for (auto&& env_wstring : env_wstrings) + { + auto v = System::get_environmental_variable(env_wstring.c_str()); + if (v == nullptr || v->empty()) + continue; + + env_wstring.push_back(L'='); + env_wstring.append(*v); + env_cstr.push_back(env_wstring.c_str()); + } + + env_cstr.push_back(new_PATH.c_str()); + env_cstr.push_back(nullptr); + + // Basically we are wrapping it in quotes + const std::wstring& actual_cmd_line = Strings::wformat(LR"###("%s")###", cmd_line); + auto exit_code = _wspawnlpe(_P_WAIT, L"cmd.exe", L"cmd.exe", L"/c", actual_cmd_line.c_str(), nullptr, env_cstr.data()); + return static_cast(exit_code); + } + int cmd_execute(const wchar_t* cmd_line) { // Flush stdout before launching external process - fflush(stdout); + _flushall(); // Basically we are wrapping it in quotes const std::wstring& actual_cmd_line = Strings::wformat(LR"###("%s")###", cmd_line); @@ -58,7 +132,7 @@ namespace vcpkg::System std::wstring create_powershell_script_cmd(const fs::path& script_path, const std::wstring& args) { // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - return Strings::wformat(LR"(powershell -ExecutionPolicy Bypass -Command "& {& '%s' %s}")", script_path.native(), args); + return Strings::wformat(LR"(powershell -ExecutionPolicy Bypass -Command "& {& '%s' %s}")", script_path.native(), args); } void print(const char* message) From c59ac4e344fb96b0ab09189345519d7cf237577c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 17:01:41 -0800 Subject: [PATCH 553/561] Formatting --- toolsrc/src/vcpkg_Environment.cpp | 12 ++++++------ toolsrc/src/vcpkg_paths.cpp | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 98d1357e4a..8aaaba8a82 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -46,15 +46,15 @@ namespace vcpkg::Environment const fs::path msvc_path = Strings::format(R"(%s\VC\Tools\MSVC)", instance); std::vector msvc_subdirectories; Files::non_recursive_find_matching_paths_in_dir(msvc_path, [&](const fs::path& current) - { - return fs::is_directory(current); - }, &msvc_subdirectories); + { + return fs::is_directory(current); + }, &msvc_subdirectories); // Sort them so that latest comes first std::sort(msvc_subdirectories.begin(), msvc_subdirectories.end(), [&](const fs::path& left, const fs::path& right) - { - return left.filename() > right.filename(); - }); + { + return left.filename() > right.filename(); + }); for (const fs::path& subdir : msvc_subdirectories) { diff --git a/toolsrc/src/vcpkg_paths.cpp b/toolsrc/src/vcpkg_paths.cpp index 34bab1dda2..fa6fca3702 100644 --- a/toolsrc/src/vcpkg_paths.cpp +++ b/toolsrc/src/vcpkg_paths.cpp @@ -40,10 +40,10 @@ namespace vcpkg static optional find_if_has_equal_or_greater_version(const std::vector& candidate_paths, const std::wstring& version_check_arguments, const std::array& expected_version) { auto it = std::find_if(candidate_paths.cbegin(), candidate_paths.cend(), [&](const fs::path& p) - { - const std::wstring cmd = Strings::wformat(LR"("%s" %s)", p.native(), version_check_arguments); - return exists_and_has_equal_or_greater_version(cmd, expected_version); - }); + { + const std::wstring cmd = Strings::wformat(LR"("%s" %s)", p.native(), version_check_arguments); + return exists_and_has_equal_or_greater_version(cmd, expected_version); + }); if (it != candidate_paths.cend()) { @@ -83,7 +83,7 @@ namespace vcpkg const fs::path actual_downloaded_path = rc.output; Checks::check_exit(expected_downloaded_path == actual_downloaded_path, "Expected dependency downloaded path to be %s, but was %s", - expected_downloaded_path.generic_string(), actual_downloaded_path.generic_string()); + expected_downloaded_path.generic_string(), actual_downloaded_path.generic_string()); return actual_downloaded_path; } From ea52c29e9af701c4a2e070f836bb1ffb7e092760 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 17:03:47 -0800 Subject: [PATCH 554/561] Use System::cmd_execute_clean() for `build`, `create`, `portsdiff` --- toolsrc/src/commands_build.cpp | 2 +- toolsrc/src/commands_create.cpp | 6 +++--- toolsrc/src/commands_portsdiff.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index f2dabe25ef..a47083cbd1 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -60,7 +60,7 @@ namespace vcpkg::Commands::Build const ElapsedTime timer = ElapsedTime::createStarted(); - int return_code = System::cmd_execute(command); + int return_code = System::cmd_execute_clean(command); auto buildtimeus = timer.microseconds(); TrackMetric("buildtimeus-" + spec.toString(), buildtimeus); diff --git a/toolsrc/src/commands_create.cpp b/toolsrc/src/commands_create.cpp index fc795c621b..b74693ed53 100644 --- a/toolsrc/src/commands_create.cpp +++ b/toolsrc/src/commands_create.cpp @@ -30,12 +30,12 @@ namespace vcpkg::Commands::Create { const std::string& zip_file_name = args.command_arguments.at(2); Checks::check_exit(!Files::has_invalid_chars_for_filesystem(zip_file_name), - R"(Filename cannot contain invalid chars %s, but was %s)", - Files::FILESYSTEM_INVALID_CHARACTERS, zip_file_name); + R"(Filename cannot contain invalid chars %s, but was %s)", + Files::FILESYSTEM_INVALID_CHARACTERS, zip_file_name); cmake_args.push_back({ L"FILENAME", zip_file_name }); } const std::wstring cmd_launch_cmake = make_cmake_cmd(cmake_exe, paths.ports_cmake, cmake_args); - exit(System::cmd_execute(cmd_launch_cmake)); + exit(System::cmd_execute_clean(cmd_launch_cmake)); } } diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 065a35345d..4d5a589f67 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -46,7 +46,7 @@ namespace vcpkg::Commands::PortsDiff checkout_this_dir, L".vcpkg-root", git_exe.native()); - System::cmd_execute(cmd); + System::cmd_execute_clean(cmd); const std::vector source_paragraphs = Paragraphs::load_all_ports(temp_checkout_path / ports_dir_name_as_string); const std::map names_and_versions = Paragraphs::extract_port_names_and_versions(source_paragraphs); fs::remove_all(temp_checkout_path); From f2edc1256181fef986e7e23f5cd7fc1f169c12ed Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 16:13:32 -0800 Subject: [PATCH 555/561] [libuv] Fix usage of GIT --- ports/libuv/portfile.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/libuv/portfile.cmake b/ports/libuv/portfile.cmake index 173d3bcdc4..fbc71854e4 100644 --- a/ports/libuv/portfile.cmake +++ b/ports/libuv/portfile.cmake @@ -16,8 +16,11 @@ if(NOT EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src) ) endif() -vcpkg_find_acquire_program(PYTHON2) +find_program(GIT git) +get_filename_component(GIT_EXE_PATH ${GIT} DIRECTORY) +set(ENV{PATH} "$ENV{PATH};${GIT_EXE_PATH}") +vcpkg_find_acquire_program(PYTHON2) set(ENV{PYTHON} ${PYTHON2}) set(ENV{GYP_MSVS_VERSION} 2015) From 78ca952d76b351d5c0478dbcfc223c773c58996c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 17:33:23 -0800 Subject: [PATCH 556/561] Use System::cmd_executeClean() --- toolsrc/src/commands_integrate.cpp | 2 +- toolsrc/src/metrics.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 4ccd6d4359..f98b9f77cd 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -269,7 +269,7 @@ namespace vcpkg::Commands::Integrate // Using all forward slashes for the command line const std::wstring cmd_line = Strings::wformat(LR"("%s" pack -OutputDirectory "%s" "%s" > nul)", nuget_exe.native(), buildsystems_dir.native(), nuspec_file_path.native()); - const int exit_code = System::cmd_execute(cmd_line); + const int exit_code = System::cmd_execute_clean(cmd_line); const fs::path nuget_package = buildsystems_dir / Strings::format("%s.%s.nupkg", nuget_id, nupkg_version); Checks::check_exit(exit_code == 0 && fs::exists(nuget_package), "Error: NuGet package creation failed"); diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp index b8e469f6ed..d0e20fe2d6 100644 --- a/toolsrc/src/metrics.cpp +++ b/toolsrc/src/metrics.cpp @@ -417,6 +417,6 @@ true std::ofstream(vcpkg_metrics_txt_path) << payload; const std::wstring cmdLine = Strings::wformat(L"start %s %s", temp_folder_path_exe.native(), vcpkg_metrics_txt_path.native()); - System::cmd_execute(cmdLine); + System::cmd_execute_clean(cmdLine); } } From 56465aabe5e2722d69f58a9af80535697d8c075b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 10 Mar 2017 17:44:36 -0800 Subject: [PATCH 557/561] Update CHANGELOG and bump version to v0.0.76 --- CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69d024caa2..2cf843111d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,36 @@ +vcpkg (0.0.76) +-------------- + * Add ports: + - ffmpeg 3.2.4-2 + - fftw3 3.3.6-p11 + - flatbuffers 1.6.0 + - netcdf-c 4.4.1.1-1 + - netcdf-cxx4 4.3.0 + - portaudio 19.0.6.00 + - vtk 7.1.0 + * Update ports: + - azure-storage-cpp 2.6.0 -> 3.0.0 + - boost 1.63 -> 1.63-2 + - bullet3 2.83.7.98d4780 -> 2.86.1 + - catch 1.5.7 -> 1.8.1 + - cppwinrt 1.010.0.14393.0 -> feb2017_refresh-14393 + - hdf5 1.8.18 -> 1.10.0-patch1-1 + - libflac 1.3.2 -> 1.3.2-1 + - libpng 1.6.24-1 -> 1.6.28 + - lua 5.3.3-2 -> 5.3.4 + - msmpi 8.0 -> 8.0-1 + - openjpeg 2.1.2 -> 2.1.2-1 + - poco 1.7.6-3 -> 1.7.6-4 + - szip 2.1 -> 2.1-1 + - zeromq 4.2.0 -> 4.2.2 + * `vcpkg` now launches external commands (most notably builds) in a sanitized environment + * Better proxy handling when fetching dependencies (cmake/git/nuget) + * Fix more VS2017 issues + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team MON, 10 Mar 2017 17:45:00 -0800 + + vcpkg (0.0.75) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 2afbd0edd3..efe1fb7ee5 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.75" \ No newline at end of file +"0.0.76" \ No newline at end of file From 534438a00abd8b1a1aaa14f3cce61d699923a193 Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Sat, 11 Mar 2017 17:02:30 +0300 Subject: [PATCH 558/561] [libjpeg-turbo] update to 1.5.1. Resolves #767 --- ports/libjpeg-turbo/CONTROL | 2 +- ports/libjpeg-turbo/portfile.cmake | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ports/libjpeg-turbo/CONTROL b/ports/libjpeg-turbo/CONTROL index 9c5ee1d075..d9df1c43d7 100644 --- a/ports/libjpeg-turbo/CONTROL +++ b/ports/libjpeg-turbo/CONTROL @@ -1,3 +1,3 @@ Source: libjpeg-turbo -Version: 1.4.90-1 +Version: 1.5.1-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/portfile.cmake b/ports/libjpeg-turbo/portfile.cmake index b58ba01ede..6c30c0a081 100644 --- a/ports/libjpeg-turbo/portfile.cmake +++ b/ports/libjpeg-turbo/portfile.cmake @@ -1,10 +1,14 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libjpeg-turbo-1.4.90) + +set(LIBJPEGTURBO_VERSION 1.5.1) +set(LIBJPEGTURBO_HASH "7b89f3c707daa98b0ed19ec417aab5273a1248ce7f98722a671ea80558a8eb0e73b136ce7be7c059f9f42262e682743abcab64e325f82cd4bd1531e0a4035209") + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libjpeg-turbo-${LIBJPEGTURBO_VERSION}) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/libjpeg-turbo/libjpeg-turbo/archive/1.4.90.zip" - FILENAME "libjpeg-turbo-1.4.90.zip" - SHA512 43c3d26c70a7356bb0832276fe82eead040c3f4aa17df118f91a38615bfacfdfb25fab41965f9ca2b69d18e0b937a1bb753e93fa2c114e01d5174fc1100010b4 + URLS "https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${LIBJPEGTURBO_VERSION}.zip" + FILENAME "libjpeg-turbo-${LIBJPEGTURBO_VERSION}.zip" + SHA512 ${LIBJPEGTURBO_HASH} ) vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches( From c598aa8fd8c18f775055f3113bfb766a03fc7c63 Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Sat, 11 Mar 2017 17:32:14 +0300 Subject: [PATCH 559/561] [msgpack] add version 2.1.1. Resolves #744 --- ports/msgpack/CONTROL | 3 +++ ports/msgpack/portfile.cmake | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 ports/msgpack/CONTROL create mode 100644 ports/msgpack/portfile.cmake diff --git a/ports/msgpack/CONTROL b/ports/msgpack/CONTROL new file mode 100644 index 0000000000..de50a55750 --- /dev/null +++ b/ports/msgpack/CONTROL @@ -0,0 +1,3 @@ +Source: msgpack +Version: 2.1.1 +Description: MessagePack is an efficient binary serialization format, which lets you exchange data among multiple languages like JSON, except that it's faster and smaller. diff --git a/ports/msgpack/portfile.cmake b/ports/msgpack/portfile.cmake new file mode 100644 index 0000000000..3beb72c5d3 --- /dev/null +++ b/ports/msgpack/portfile.cmake @@ -0,0 +1,32 @@ +include(vcpkg_common_functions) + +set(MSGPACK_VERSION 2.1.1) +set(MSGPACK_HASH 31ed6fda498d43da6fdbbe000ce36c40e4cf886f00d879c57d406def7f5bba4eaf66f02f221398cb50f6f4c748d5cde9c97eca0cfa21b368c7c933c3301cf9b5) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/msgpack-${MSGPACK_VERSION}) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/msgpack/msgpack-c/releases/download/cpp-${MSGPACK_VERSION}/msgpack-${MSGPACK_VERSION}.tar.gz" + FILENAME "msgpack-${MSGPACK_VERSION}.tar.gz" + SHA512 ${MSGPACK_HASH} +) +vcpkg_extract_source_archive(${ARCHIVE}) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(MSGPACK_ENABLE_SHARED OFF) +else() + set(MSGPACK_ENABLE_SHARED ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS -DMSGPACK_ENABLE_SHARED=${MSGPACK_ENABLE_SHARED} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/msgpack) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/msgpack/COPYING ${CURRENT_PACKAGES_DIR}/share/msgpack/copyright) From 6aafae15fbf6885e014f487dd3c0656567500853 Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Sat, 11 Mar 2017 20:35:54 +0300 Subject: [PATCH 560/561] [mpir] update to 3.0.0. Resolves #720 --- ports/mpir/CONTROL | 2 +- ports/mpir/portfile.cmake | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ports/mpir/CONTROL b/ports/mpir/CONTROL index 0a1f1601ba..2b67c7c987 100644 --- a/ports/mpir/CONTROL +++ b/ports/mpir/CONTROL @@ -1,3 +1,3 @@ Source: mpir -Version: 2.7.2-1 +Version: 3.0.0-1 Description: Multiple Precision Integers and Rationals. \ No newline at end of file diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index a57c53328a..96bfa9454d 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -1,19 +1,29 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpir-2.7.2) + +set(MPIR_VERSION 3.0.0) +set(MPIR_HASH "c735105db8b86db739fd915bf16064e6bc82d0565ad8858059e4e93f62c9d72d9a1c02a5ca9859b184346a8dc64fa714d4d61404cff1e405dc548cbd54d0a88e") +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpir-${MPIR_VERSION}) + vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://mpir.org/mpir-2.7.2.tar.bz2" - FILENAME "mpir-2.7.2.tar.bz2" - SHA512 8436a0123201f9e30130ea340331c5a6445dddb58ce1f6c6a3a8303c310ac5b3c279c83b5c520a757cba82c2b14e92da44583e0eec287090cf69cbb29d516a9c + URLS "http://mpir.org/mpir-${MPIR_VERSION}.tar.bz2" + FILENAME "mpir-${MPIR_VERSION}.tar.bz2" + SHA512 ${MPIR_HASH} ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) +if(VCPKG_PLATFORM_TOOLSET MATCHES "v141*") + set(MSVC_VERSION 15) +else() + set(MSVC_VERSION 14) +endif() + if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/build.vc14/dll_mpir_gc/dll_mpir_gc.vcxproj + PROJECT_PATH ${SOURCE_PATH}/build.vc${MSVC_VERSION}/dll_mpir_gc/dll_mpir_gc.vcxproj ) else() vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/build.vc14/lib_mpir_gc/lib_mpir_gc.vcxproj + PROJECT_PATH ${SOURCE_PATH}/build.vc${MSVC_VERSION}/lib_mpir_gc/lib_mpir_gc.vcxproj ) endif() From a2a558bd0359f9bbc8be713315a00c948c4d77bd Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 11 Mar 2017 19:08:16 -0800 Subject: [PATCH 561/561] [vcpkg] Fix regression in 7b14894d. Fixes #772. --- scripts/fetchDependency.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 712993ca52..3c98f7247d 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -232,7 +232,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) throw [System.IO.FileNotFoundException] ("Could not detect or download " + $Dependency) } - return $downloadPath + return $executableFromDownload } SelectProgram $Dependency \ No newline at end of file