From 051a6fd5b3d83fedc83592236413c9b8c0015c6d Mon Sep 17 00:00:00 2001 From: Phil Christensen Date: Wed, 21 Aug 2019 13:48:47 -0700 Subject: [boost] split Build-Depends on multipls lines --- ports/boost/CONTROL | 28 +++++++++++++++++++++++++++- toolsrc/src/vcpkg/parse.cpp | 7 ++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 54dfc3c7a..44c44fbf0 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -3,7 +3,33 @@ Source: boost Version: 1.70.0 Homepage: https://boost.org Description: Peer-reviewed portable C++ source libraries -Build-Depends: boost-accumulators, boost-algorithm, boost-align, boost-any, boost-array, boost-asio, boost-assert, boost-assign, boost-atomic, boost-beast, boost-bimap, boost-bind, boost-callable-traits, boost-chrono, boost-circular-buffer, boost-compatibility, boost-compute, boost-concept-check, boost-config, boost-container, boost-container-hash, boost-context (!uwp), boost-contract (!arm), boost-conversion, boost-convert, boost-core, boost-coroutine (!uwp), boost-coroutine2, boost-crc, boost-date-time, boost-detail, boost-disjoint-sets, boost-dll, boost-dynamic-bitset, boost-endian, boost-exception, boost-fiber (windows), boost-filesystem (!uwp), boost-flyweight, boost-foreach, boost-format, boost-function, boost-functional, boost-function-types, boost-fusion, boost-geometry, boost-gil, boost-graph, boost-graph-parallel, boost-hana, boost-heap, boost-histogram, boost-hof, boost-icl, boost-integer, boost-interprocess, boost-intrusive, boost-io, boost-iostreams (!uwp), boost-iterator, boost-lambda, boost-lexical-cast, boost-locale (!uwp), boost-local-function, boost-lockfree, boost-log (!uwp), boost-logic, boost-math, boost-metaparse, boost-move, boost-mp11, boost-mpl, boost-msm, boost-multiprecision, boost-multi-array, boost-multi-index, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-safe-numerics, boost-optional, boost-outcome, boost-parameter, boost-parameter-python (windows), boost-phoenix, boost-polygon, boost-poly-collection, boost-pool, boost-predef, boost-preprocessor, boost-process, boost-program-options, boost-property-map, boost-property-tree, boost-proto, boost-ptr-container, boost-python (windows), boost-qvm, boost-random, boost-range, boost-ratio, boost-rational, boost-regex, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-safe-numerics, boost-scope-exit, boost-serialization, boost-signals2, boost-smart-ptr, boost-sort, boost-spirit, boost-stacktrace (!uwp), boost-statechart, boost-static-assert, boost-system, boost-test (!uwp), boost-thread (!arm), boost-throw-exception, boost-timer, boost-tokenizer, boost-tti, boost-tuple, boost-typeof, boost-type-erasure (!arm), boost-type-index, boost-type-traits, boost-units, boost-unordered, boost-utility, boost-uuid, boost-variant, boost-vmd, boost-wave (!uwp), boost-winapi, boost-xpressive, boost-yap +Build-Depends: boost-accumulators, boost-algorithm, boost-align, boost-any, boost-array, + boost-asio, boost-assert, boost-assign, boost-atomic, boost-beast, boost-bimap, boost-bind, + boost-callable-traits, boost-chrono, boost-circular-buffer, boost-compatibility, + boost-compute, boost-concept-check, boost-config, boost-container, boost-container-hash, + boost-context (!uwp), boost-contract (!arm), boost-conversion, boost-convert, boost-core, + boost-coroutine (!uwp), boost-coroutine2, boost-crc, boost-date-time, boost-detail, + boost-disjoint-sets, boost-dll, boost-dynamic-bitset, boost-endian, boost-exception, + boost-fiber (windows), boost-filesystem (!uwp), boost-flyweight, boost-foreach, boost-format, + boost-function, boost-functional, boost-function-types, boost-fusion, boost-geometry, + boost-gil, boost-graph, boost-graph-parallel, boost-hana, boost-heap, boost-histogram, + boost-hof, boost-icl, boost-integer, boost-interprocess, boost-intrusive, boost-io, + boost-iostreams (!uwp), boost-iterator, boost-lambda, boost-lexical-cast, boost-locale (!uwp), + boost-local-function, boost-lockfree, boost-log (!uwp), boost-logic, boost-math, + boost-metaparse, boost-move, boost-mp11, boost-mpl, boost-msm, boost-multiprecision, + boost-multi-array, boost-multi-index, boost-numeric-conversion, boost-interval, boost-odeint, + boost-ublas, boost-safe-numerics, boost-optional, boost-outcome, boost-parameter, + boost-parameter-python (windows), boost-phoenix, boost-polygon, boost-poly-collection, + boost-pool, boost-predef, boost-preprocessor, boost-process, boost-program-options, + boost-property-map, boost-property-tree, boost-proto, boost-ptr-container, + boost-python (windows), boost-qvm, boost-random, boost-range, boost-ratio, boost-rational, + boost-regex, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, + boost-safe-numerics, boost-scope-exit, boost-serialization, boost-signals2, boost-smart-ptr, + boost-sort, boost-spirit, boost-stacktrace (!uwp), boost-statechart, boost-static-assert, + boost-system, boost-test (!uwp), boost-thread (!arm), boost-throw-exception, boost-timer, + boost-tokenizer, boost-tti, boost-tuple, boost-typeof, boost-type-erasure (!arm), + boost-type-index, boost-type-traits, boost-units, boost-unordered, boost-utility, boost-uuid, + boost-variant, boost-vmd, boost-wave (!uwp), boost-winapi, boost-xpressive, boost-yap Feature: mpi Description: Build with MPI support diff --git a/toolsrc/src/vcpkg/parse.cpp b/toolsrc/src/vcpkg/parse.cpp index 0509339c5..8f90aef15 100644 --- a/toolsrc/src/vcpkg/parse.cpp +++ b/toolsrc/src/vcpkg/parse.cpp @@ -44,6 +44,11 @@ namespace vcpkg::Parse return nullptr; } + static bool is_whitespace(char c) + { + return c == ' ' || c == '\t' || c == '\n' || c == '\r'; + } + std::vector parse_comma_list(const std::string& str) { if (str.empty()) @@ -66,7 +71,7 @@ namespace vcpkg::Parse // skip comma and space ++pos; - while (str[pos] == ' ') + while (is_whitespace(str[pos])) { ++pos; } -- cgit v1.2.3 From 13c95f16bfab4e516d088e15a1e77733b3f8745f Mon Sep 17 00:00:00 2001 From: Phil Christensen Date: Fri, 23 Aug 2019 10:20:18 -0700 Subject: clean up list parsing logic and add clear warnings --- ports/cpprestsdk/CONTROL | 11 +++--- toolsrc/src/vcpkg/parse.cpp | 88 ++++++++++++++++++++++++++++++++++----------- 2 files changed, 75 insertions(+), 24 deletions(-) diff --git a/ports/cpprestsdk/CONTROL b/ports/cpprestsdk/CONTROL index 877164673..6f6a2a307 100644 --- a/ports/cpprestsdk/CONTROL +++ b/ports/cpprestsdk/CONTROL @@ -1,13 +1,16 @@ Source: cpprestsdk Version: 2.10.14-1 -Build-Depends: openssl (!uwp&!windows), boost-system (!uwp&!windows), boost-date-time (!uwp&!windows), boost-regex (!uwp&!windows), boost-thread (!uwp&!windows), boost-filesystem (!uwp&!windows), boost-random (!uwp&!windows), boost-chrono (!uwp&!windows), boost-asio (!uwp&!windows) +Build-Depends: openssl (!uwp&!windows), boost-system (!uwp&!windows), + boost-date-time (!uwp&!windows), boost-regex (!uwp&!windows), boost-thread (!uwp&!windows), + boost-filesystem (!uwp&!windows), boost-random (!uwp&!windows), boost-chrono (!uwp&!windows), + boost-asio (!uwp&!windows) Homepage: https://github.com/Microsoft/cpprestsdk 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. Default-Features: default-features Feature: default-features -Build-Depends: cpprestsdk[brotli] (windows), cpprestsdk[core], cpprestsdk[compression], cpprestsdk[websockets] +Build-Depends: cpprestsdk[brotli] (windows), cpprestsdk[core,compression,websockets] Description: Features installed by default Feature: compression @@ -15,9 +18,9 @@ Build-Depends: zlib Description: HTTP Compression support Feature: websockets -Build-Depends: cpprestsdk[core], cpprestsdk[compression], websocketpp (!uwp), openssl (!uwp), boost-system (!uwp), boost-date-time (!uwp), boost-regex (!uwp) +Build-Depends: cpprestsdk[core,compression], websocketpp (!uwp), openssl (!uwp), boost-system (!uwp), boost-date-time (!uwp), boost-regex (!uwp) Description: Websockets support Feature: brotli -Build-Depends: cpprestsdk[core], cpprestsdk[compression], brotli +Build-Depends: cpprestsdk[core,compression], brotli Description: Brotli compression support diff --git a/toolsrc/src/vcpkg/parse.cpp b/toolsrc/src/vcpkg/parse.cpp index 8f90aef15..91b2b2786 100644 --- a/toolsrc/src/vcpkg/parse.cpp +++ b/toolsrc/src/vcpkg/parse.cpp @@ -3,6 +3,7 @@ #include #include +#include namespace vcpkg::Parse { @@ -58,26 +59,73 @@ namespace vcpkg::Parse std::vector out; - size_t cur = 0; - do - { - auto pos = str.find(',', cur); - if (pos == std::string::npos) - { - out.push_back(str.substr(cur)); - break; - } - out.push_back(str.substr(cur, pos - cur)); - - // skip comma and space - ++pos; - while (is_whitespace(str[pos])) - { - ++pos; - } - - cur = pos; - } while (cur != std::string::npos); + auto iter = str.cbegin(); + + do { + // Trim leading whitespace of each element + while (iter != str.cend() && is_whitespace(*iter)) + { + ++iter; + } + + // Allow commas inside of []. + bool bracket_nesting = false; + + auto element_begin = iter; + auto element_end = iter; + while (iter != str.cend() && (*iter != ',' || bracket_nesting)) + { + char value = *iter; + + // do not support nested [] + if (value == '[') + { + bracket_nesting = true; + } + else if (value == ']') + { + bracket_nesting = false; + } + + ++iter; + + // Trim ending whitespace + if (!is_whitespace(value)) + { + // Update element_end after iter is incremented so it will be one past. + element_end = iter; + } + } + + if (element_begin == element_end) + { + System::print2( System::Color::warning, + "Warning: empty element in list\n" + "> '", str, "'\n" + "> ", std::string(static_cast(element_begin - str.cbegin()), ' '), "^\n" + ); + } + else + { + out.push_back({ element_begin, element_end }); + } + + if (iter != str.cend()) + { + //Not at the end, must be at a comma that needs to be stepped over + ++iter; + + if (iter == str.end()) + { + System::print2(System::Color::warning, + "Warning: empty element in list\n" + "> '", str, "'\n" + "> ", std::string(str.length(), ' '), "^\n" + ); + } + } + + } while (iter != str.cend()); return out; } -- cgit v1.2.3 From 1245f1dbfc383d33b2fa576f010644de9687280e Mon Sep 17 00:00:00 2001 From: Phil Christensen Date: Fri, 23 Aug 2019 11:05:56 -0700 Subject: [vcpkg] bump version --- toolsrc/VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 0342c24ab..66247baf7 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"2019.07.19" +"2019.08.23" -- cgit v1.2.3 From 6c7635d7ae30a708cebc95177a036575c091f6ae Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Sun, 25 Aug 2019 19:59:35 -0700 Subject: [libwebp]Fix two dependent windows library link conditions. --- ports/libwebp/0006-fix-dependecies-platform.patch | 16 ++++++++++++++++ ports/libwebp/CONTROL | 2 +- ports/libwebp/portfile.cmake | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 ports/libwebp/0006-fix-dependecies-platform.patch diff --git a/ports/libwebp/0006-fix-dependecies-platform.patch b/ports/libwebp/0006-fix-dependecies-platform.patch new file mode 100644 index 000000000..fdb5ec0b3 --- /dev/null +++ b/ports/libwebp/0006-fix-dependecies-platform.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 83edb3a..f634094 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -540,7 +540,10 @@ if(WEBP_BUILD_EXTRAS) + find_package(SDL) + if(SDL_FOUND) + add_executable(vwebp_sdl ${VWEBP_SDL_SRCS}) +- target_link_libraries(vwebp_sdl ${SDL_LIBRARY} imageioutil webp dxguid winmm) ++ target_link_libraries(vwebp_sdl ${SDL_LIBRARY} imageioutil webp) ++ if (MSVC) ++ target_link_libraries(vwebp_sdl dxguid winmm) ++ endif() + target_include_directories(vwebp_sdl + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/src diff --git a/ports/libwebp/CONTROL b/ports/libwebp/CONTROL index 90dffdc77..02a65e5c0 100644 --- a/ports/libwebp/CONTROL +++ b/ports/libwebp/CONTROL @@ -1,5 +1,5 @@ Source: libwebp -Version: 1.0.2-6 +Version: 1.0.2-7 Homepage: https://github.com/webmproject/libwebp Description: Lossy compression of digital photographic images. Build-Depends: opengl diff --git a/ports/libwebp/portfile.cmake b/ports/libwebp/portfile.cmake index 11b0b7904..9fb26d532 100644 --- a/ports/libwebp/portfile.cmake +++ b/ports/libwebp/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( 0003-remove-missing-symbol.patch 0004-add-missing-linked-library.patch 0005-fix-static-build.patch + 0006-fix-dependecies-platform.patch ) set(WEBP_BUILD_ANIM_UTILS OFF) -- cgit v1.2.3 From 782723959399a1a0725ac4921b1b7a7c9d10baf7 Mon Sep 17 00:00:00 2001 From: Nicole Mazzuca Date: Thu, 8 Aug 2019 16:14:59 -0700 Subject: =?UTF-8?q?(#7757)=20[vcpkg]=20Switch=20to=20internal=20hash=20alg?= =?UTF-8?q?orithms=20=F0=9F=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On non-Windows platforms, there is no standard way to get the hash of an item -- before this PR, what we did was check for the existence of a few common utility names (shasum, sha1, sha256, sha512), and then call that utility on a file we created containing the contents we wish to hash. This PR adds internal hashers for sha1, sha256, and sha512, and standardizes the interface to allow anyone to implement hashers in the future. These hashers are not extremely optimized, so it's likely that in the future we could get more optimized, but for now we just call out to BCryptHasher on Windows, since it's standard and easy to use (and about 2x faster for sha1 and sha256, and 1.5x faster for sha512). However, they are reasonably fast for being unoptimized. I attempted a few minor optimizations, which actually made the code slower! So as of right now, it's implemented as just a basic conversion of the code on Wikipedia to C++. I have tested these on the standard NIST test vectors (and those test vectors are located in vcpkg-test/hash.cpp). --- toolsrc/include/vcpkg/base/hash.h | 44 +- toolsrc/include/vcpkg/base/strings.h | 12 +- toolsrc/include/vcpkg/base/stringview.h | 5 +- toolsrc/src/vcpkg-test/hash.cpp | 276 +++++++++++ toolsrc/src/vcpkg/base/downloads.cpp | 2 +- toolsrc/src/vcpkg/base/hash.cpp | 830 ++++++++++++++++++++++++++------ toolsrc/src/vcpkg/base/stringview.cpp | 6 +- toolsrc/src/vcpkg/build.cpp | 29 +- toolsrc/src/vcpkg/commands.cpp | 11 +- toolsrc/src/vcpkg/metrics.cpp | 2 +- 10 files changed, 1040 insertions(+), 177 deletions(-) create mode 100644 toolsrc/src/vcpkg-test/hash.cpp diff --git a/toolsrc/include/vcpkg/base/hash.h b/toolsrc/include/vcpkg/base/hash.h index 9e6f118c0..d62fd3921 100644 --- a/toolsrc/include/vcpkg/base/hash.h +++ b/toolsrc/include/vcpkg/base/hash.h @@ -6,6 +6,46 @@ namespace vcpkg::Hash { - std::string get_string_hash(const std::string& s, const std::string& hash_type); - std::string get_file_hash(const Files::Filesystem& fs, const fs::path& path, const std::string& hash_type); + enum class Algorithm + { + Sha1, + Sha256, + Sha512, + }; + + const char* to_string(Algorithm algo) noexcept; + Optional algorithm_from_string(StringView sv) noexcept; + + struct Hasher + { + virtual void add_bytes(const void* start, const void* end) noexcept = 0; + + // one may only call this once before calling `clear()` or the dtor + virtual std::string get_hash() noexcept = 0; + virtual void clear() noexcept = 0; + virtual ~Hasher() = default; + }; + + std::unique_ptr get_hasher_for(Algorithm algo) noexcept; + + std::string get_bytes_hash(const void* first, const void* last, Algorithm algo) noexcept; + std::string get_string_hash(StringView s, Algorithm algo) noexcept; + std::string get_file_hash(const Files::Filesystem& fs, + const fs::path& path, + Algorithm algo, + std::error_code& ec) noexcept; + inline std::string get_file_hash(LineInfo li, + const Files::Filesystem& fs, + const fs::path& path, + Algorithm algo) noexcept + { + std::error_code ec; + const auto result = get_file_hash(fs, path, algo, ec); + if (ec) + { + Checks::exit_with_message(li, "Failure to read file for hashing: %s", ec.message()); + } + + return result; + } } diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index 0f25607df..481e686d1 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -12,15 +12,25 @@ namespace vcpkg::Strings::details { template - auto to_printf_arg(const T& t) -> decltype(t.to_string()) + auto to_string(const T& t) -> decltype(t.to_string()) { return t.to_string(); } + // first looks up to_string on `T` using ADL; then, if that isn't found, + // uses the above definition which returns t.to_string() + template::value>> + auto to_printf_arg(const T& t) -> decltype(to_string(t)) + { + return to_string(t); + } + inline const char* to_printf_arg(const std::string& s) { return s.c_str(); } inline const char* to_printf_arg(const char* s) { return s; } + inline const wchar_t* to_printf_arg(const wchar_t* s) { return s; } + template::value>> T to_printf_arg(T s) { diff --git a/toolsrc/include/vcpkg/base/stringview.h b/toolsrc/include/vcpkg/base/stringview.h index fef5bef4e..8503f5f10 100644 --- a/toolsrc/include/vcpkg/base/stringview.h +++ b/toolsrc/include/vcpkg/base/stringview.h @@ -40,10 +40,11 @@ namespace vcpkg std::string to_string() const; void to_string(std::string& out) const; - bool operator==(StringView other) const; - private: const char* m_ptr = 0; size_t m_size = 0; }; + + bool operator==(StringView lhs, StringView rhs) noexcept; + bool operator!=(StringView lhs, StringView rhs) noexcept; } diff --git a/toolsrc/src/vcpkg-test/hash.cpp b/toolsrc/src/vcpkg-test/hash.cpp new file mode 100644 index 000000000..9f3ccc25e --- /dev/null +++ b/toolsrc/src/vcpkg-test/hash.cpp @@ -0,0 +1,276 @@ +#include + +#include + +#include +#include +#include +#include + +namespace Hash = vcpkg::Hash; +using vcpkg::StringView; + +// Require algorithm: Hash::Algorithm::Tag to be in scope +#define CHECK_HASH(size, value, real_hash) \ + do \ + { \ + unsigned char data[size]; \ + std::fill(std::begin(data), std::end(data), static_cast(value)); \ + const auto hash = Hash::get_bytes_hash(data, data + size, algorithm); \ + REQUIRE(hash == real_hash); \ + } while (0) + +#define CHECK_HASH_OF(data, real_hash) \ + do \ + { \ + const auto hash = Hash::get_bytes_hash(std::begin(data), std::end(data), algorithm); \ + REQUIRE(hash == real_hash); \ + } while (0) + +#define CHECK_HASH_STRING(data, real_hash) \ + do \ + { \ + const auto hash = Hash::get_string_hash(data, algorithm); \ + REQUIRE(hash == real_hash); \ + } while (0) + +// Requires hasher: std::unique_ptr to be in scope +#define CHECK_HASH_LARGE(size, value, real_hash) \ + do \ + { \ + hasher->clear(); \ + std::uint64_t remaining = size; \ + unsigned char buffer[512]; \ + std::fill(std::begin(buffer), std::end(buffer), static_cast(value)); \ + while (remaining) \ + { \ + if (remaining < 512) \ + { \ + hasher->add_bytes(std::begin(buffer), std::begin(buffer) + remaining); \ + remaining = 0; \ + } \ + else \ + { \ + hasher->add_bytes(std::begin(buffer), std::end(buffer)); \ + remaining -= 512; \ + } \ + } \ + REQUIRE(hasher->get_hash() == real_hash); \ + } while (0) + +TEST_CASE ("SHA1: basic tests", "[hash][sha1]") +{ + const auto algorithm = Hash::Algorithm::Sha1; + + CHECK_HASH_STRING("", "da39a3ee5e6b4b0d3255bfef95601890afd80709"); + CHECK_HASH_STRING(";", "2d14ab97cc3dc294c51c0d6814f4ea45f4b4e312"); + CHECK_HASH_STRING("asdifasdfnas", "b77eb8a1b4c2ef6716d7d302647e4511b1a638a6"); + CHECK_HASH_STRING("asdfanvoinaoifawenflawenfiwnofvnasfjvnaslkdfjlkasjdfanm," + "werflawoienfowanevoinwai32910u2740918741o;j;wejfqwioaher9283hrpf;asd", + "c69bcd30c196c7050906d212722dd7a7659aad04"); +} + +TEST_CASE ("SHA1: NIST test cases (small)", "[hash][sha1]") +{ + const auto algorithm = Hash::Algorithm::Sha1; + + CHECK_HASH_STRING("abc", "a9993e364706816aba3e25717850c26c9cd0d89d"); + CHECK_HASH_STRING("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", + "84983e441c3bd26ebaae4aa1f95129e5e54670f1"); +} + +TEST_CASE ("SHA256: basic tests", "[hash][sha256]") +{ + const auto algorithm = Hash::Algorithm::Sha256; + + CHECK_HASH_STRING("", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"); + CHECK_HASH_STRING(";", "41b805ea7ac014e23556e98bb374702a08344268f92489a02f0880849394a1e4"); + CHECK_HASH_STRING("asdifasdfnas", "2bb1fb910831fdc11d5a3996425a84ace27aeb81c9c20ace9f60ac1b3218b291"); + CHECK_HASH_STRING("asdfanvoinaoifawenflawenfiwnofvnasfjvnaslkdfjlkasjdfanm," + "werflawoienfowanevoinwai32910u2740918741o;j;wejfqwioaher9283hrpf;asd", + "10c98034b424d4e40ca933bc524ea38b4e53290d76e8b38edc4ea2fec7f529aa"); +} + +TEST_CASE ("SHA256: NIST test cases (small)", "[hash][sha256]") +{ + const auto algorithm = Hash::Algorithm::Sha256; + + CHECK_HASH(1, 0xbd, "68325720aabd7c82f30f554b313d0570c95accbb7dc4b5aae11204c08ffe732b"); + { + const unsigned char data[] = {0xc9, 0x8c, 0x8e, 0x55}; + CHECK_HASH_OF(data, "7abc22c0ae5af26ce93dbb94433a0e0b2e119d014f8e7f65bd56c61ccccd9504"); + } + CHECK_HASH(55, 0, "02779466cdec163811d078815c633f21901413081449002f24aa3e80f0b88ef7"); + CHECK_HASH(56, 0, "d4817aa5497628e7c77e6b606107042bbba3130888c5f47a375e6179be789fbb"); + CHECK_HASH(57, 0, "65a16cb7861335d5ace3c60718b5052e44660726da4cd13bb745381b235a1785"); + CHECK_HASH(64, 0, "f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b"); + CHECK_HASH(1000, 0, "541b3e9daa09b20bf85fa273e5cbd3e80185aa4ec298e765db87742b70138a53"); + CHECK_HASH(1000, 'A', "c2e686823489ced2017f6059b8b239318b6364f6dcd835d0a519105a1eadd6e4"); + CHECK_HASH(1005, 'U', "f4d62ddec0f3dd90ea1380fa16a5ff8dc4c54b21740650f24afc4120903552b0"); +} + +TEST_CASE ("SHA512: NIST test cases (small)", "[hash][sha512]") +{ + const auto algorithm = Hash::Algorithm::Sha512; + + CHECK_HASH_STRING("", + "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f" + "63b931bd47417a81a538327af927da3e"); + + CHECK_HASH(111, + 0, + "77ddd3a542e530fd047b8977c657ba6ce72f1492e360b2b2212cd264e75ec03882e4ff0525517ab4207d14c70c2259ba88d4d33" + "5ee0e7e20543d22102ab1788c"); + CHECK_HASH(112, + 0, + "2be2e788c8a8adeaa9c89a7f78904cacea6e39297d75e0573a73c756234534d6627ab4156b48a6657b29ab8beb73334040ad39e" + "ad81446bb09c70704ec707952"); + CHECK_HASH(113, + 0, + "0e67910bcf0f9ccde5464c63b9c850a12a759227d16b040d98986d54253f9f34322318e56b8feb86c5fb2270ed87f31252f7f68" + "493ee759743909bd75e4bb544"); + CHECK_HASH(122, + 0, + "4f3f095d015be4a7a7cc0b8c04da4aa09e74351e3a97651f744c23716ebd9b3e822e5077a01baa5cc0ed45b9249e88ab343d433" + "3539df21ed229da6f4a514e0f"); + CHECK_HASH(1000, + 0, + "ca3dff61bb23477aa6087b27508264a6f9126ee3a004f53cb8db942ed345f2f2d229b4b59c859220a1cf1913f34248e3803bab6" + "50e849a3d9a709edc09ae4a76"); + CHECK_HASH(1000, + 'A', + "329c52ac62d1fe731151f2b895a00475445ef74f50b979c6f7bb7cae349328c1d4cb4f7261a0ab43f936a24b000651d4a824fcd" + "d577f211aef8f806b16afe8af"); + CHECK_HASH(1005, + 'U', + "59f5e54fe299c6a8764c6b199e44924a37f59e2b56c3ebad939b7289210dc8e4c21b9720165b0f4d4374c90f1bf4fb4a5ace17a" + "1161798015052893a48c3d161"); +} + +TEST_CASE ("SHA256: NIST test cases (large)", "[.][hash-expensive][sha256-expensive]") +{ + auto hasher = Hash::get_hasher_for(Hash::Algorithm::Sha256); + CHECK_HASH_LARGE(1'000'000, 0, "d29751f2649b32ff572b5e0a9f541ea660a50f94ff0beedfb0b692b924cc8025"); + CHECK_HASH_LARGE(0x2000'0000, 'Z', "15a1868c12cc53951e182344277447cd0979536badcc512ad24c67e9b2d4f3dd"); + CHECK_HASH_LARGE(0x4100'0000, 0, "461c19a93bd4344f9215f5ec64357090342bc66b15a148317d276e31cbc20b53"); + CHECK_HASH_LARGE(0x6000'003E, 'B', "c23ce8a7895f4b21ec0daf37920ac0a262a220045a03eb2dfed48ef9b05aabea"); +} + +TEST_CASE ("SHA512: NIST test cases (large)", "[.][hash-expensive][sha512-expensive]") +{ + auto hasher = Hash::get_hasher_for(Hash::Algorithm::Sha512); + CHECK_HASH_LARGE(1'000'000, + 0, + "ce044bc9fd43269d5bbc946cbebc3bb711341115cc4abdf2edbc3ff2c57ad4b15deb699bda257fea5aef9c6e55fcf4cf9" + "dc25a8c3ce25f2efe90908379bff7ed"); + CHECK_HASH_LARGE(0x2000'0000, + 'Z', + "da172279f3ebbda95f6b6e1e5f0ebec682c25d3d93561a1624c2fa9009d64c7e9923f3b46bcaf11d39a531f43297992ba" + "4155c7e827bd0f1e194ae7ed6de4cac"); + CHECK_HASH_LARGE(0x4100'0000, + 0, + "14b1be901cb43549b4d831e61e5f9df1c791c85b50e85f9d6bc64135804ad43ce8402750edbe4e5c0fc170b99cf78b9f4" + "ecb9c7e02a157911d1bd1832d76784f"); + CHECK_HASH_LARGE(0x6000'003E, + 'B', + "fd05e13eb771f05190bd97d62647157ea8f1f6949a52bb6daaedbad5f578ec59b1b8d6c4a7ecb2feca6892b4dc1387716" + "70a0f3bd577eea326aed40ab7dd58b1"); +} + +#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING) +using Catch::Benchmark::Chronometer; +void benchmark_hasher(Chronometer& meter, Hash::Hasher& hasher, std::uint64_t size, unsigned char byte) noexcept +{ + unsigned char buffer[1024]; + std::fill(std::begin(buffer), std::end(buffer), byte); + + meter.measure([&] { + hasher.clear(); + std::uint64_t remaining = size; + while (remaining) + { + if (remaining < 512) + { + hasher.add_bytes(std::begin(buffer), std::begin(buffer) + remaining); + remaining = 0; + } + else + { + hasher.add_bytes(std::begin(buffer), std::end(buffer)); + remaining -= 512; + } + } + hasher.get_hash(); + }); +} + +TEST_CASE ("SHA1: benchmark", "[.][hash][sha256][!benchmark]") +{ + using Catch::Benchmark::Chronometer; + + auto hasher = Hash::get_hasher_for(Hash::Algorithm::Sha1); + + BENCHMARK_ADVANCED("0 x 1'000'000")(Catch::Benchmark::Chronometer meter) + { + benchmark_hasher(meter, *hasher, 1'000'000, 0); + }; + BENCHMARK_ADVANCED("'Z' x 0x2000'0000")(Catch::Benchmark::Chronometer meter) + { + benchmark_hasher(meter, *hasher, 0x2000'0000, 'Z'); + }; + BENCHMARK_ADVANCED("0 x 0x4100'0000")(Catch::Benchmark::Chronometer meter) + { + benchmark_hasher(meter, *hasher, 0x4100'0000, 0); + }; + BENCHMARK_ADVANCED("'B' x 0x6000'003E")(Catch::Benchmark::Chronometer meter) + { + benchmark_hasher(meter, *hasher, 0x6000'003E, 'B'); + }; +} + +TEST_CASE ("SHA256: benchmark", "[.][hash][sha256][!benchmark]") +{ + using Catch::Benchmark::Chronometer; + + auto hasher = Hash::get_hasher_for(Hash::Algorithm::Sha256); + + BENCHMARK_ADVANCED("0 x 1'000'000")(Catch::Benchmark::Chronometer meter) + { + benchmark_hasher(meter, *hasher, 1'000'000, 0); + }; + BENCHMARK_ADVANCED("'Z' x 0x2000'0000")(Catch::Benchmark::Chronometer meter) + { + benchmark_hasher(meter, *hasher, 0x2000'0000, 'Z'); + }; + BENCHMARK_ADVANCED("0 x 0x4100'0000")(Catch::Benchmark::Chronometer meter) + { + benchmark_hasher(meter, *hasher, 0x4100'0000, 0); + }; + BENCHMARK_ADVANCED("'B' x 0x6000'003E")(Catch::Benchmark::Chronometer meter) + { + benchmark_hasher(meter, *hasher, 0x6000'003E, 'B'); + }; +} + +TEST_CASE ("SHA512: large -- benchmark", "[.][hash][sha512][!benchmark]") +{ + auto hasher = Hash::get_hasher_for(Hash::Algorithm::Sha512); + + BENCHMARK_ADVANCED("0 x 1'000'000")(Catch::Benchmark::Chronometer meter) + { + benchmark_hasher(meter, *hasher, 1'000'000, 0); + }; + BENCHMARK_ADVANCED("'Z' x 0x2000'0000")(Catch::Benchmark::Chronometer meter) + { + benchmark_hasher(meter, *hasher, 0x2000'0000, 'Z'); + }; + BENCHMARK_ADVANCED("0 x 0x4100'0000")(Catch::Benchmark::Chronometer meter) + { + benchmark_hasher(meter, *hasher, 0x4100'0000, 0); + }; + BENCHMARK_ADVANCED("'B' x 0x6000'003E")(Catch::Benchmark::Chronometer meter) + { + benchmark_hasher(meter, *hasher, 0x6000'003E, 'B'); + }; +} +#endif diff --git a/toolsrc/src/vcpkg/base/downloads.cpp b/toolsrc/src/vcpkg/base/downloads.cpp index 4bb2178e5..df6b1be09 100644 --- a/toolsrc/src/vcpkg/base/downloads.cpp +++ b/toolsrc/src/vcpkg/base/downloads.cpp @@ -127,7 +127,7 @@ namespace vcpkg::Downloads const fs::path& path, const std::string& sha512) { - std::string actual_hash = vcpkg::Hash::get_file_hash(fs, path, "SHA512"); + std::string actual_hash = vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, fs, path, Hash::Algorithm::Sha512); // // This is the NEW hash for 7zip diff --git a/toolsrc/src/vcpkg/base/hash.cpp b/toolsrc/src/vcpkg/base/hash.cpp index 62a01ed17..11df3e329 100644 --- a/toolsrc/src/vcpkg/base/hash.cpp +++ b/toolsrc/src/vcpkg/base/hash.cpp @@ -14,238 +14,758 @@ #ifndef NT_SUCCESS #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) #endif + #endif namespace vcpkg::Hash { - static void verify_has_only_allowed_chars(const std::string& s) + using uchar = unsigned char; + + Optional algorithm_from_string(StringView sv) noexcept + { + if (Strings::case_insensitive_ascii_equals(sv, "SHA1")) + { + return {Algorithm::Sha1}; + } + if (Strings::case_insensitive_ascii_equals(sv, "SHA256")) + { + return {Algorithm::Sha256}; + } + if (Strings::case_insensitive_ascii_equals(sv, "SHA512")) + { + return {Algorithm::Sha512}; + } + + return {}; + } + + const char* to_string(Algorithm algo) noexcept { - static const std::regex ALLOWED_CHARS{"^[a-zA-Z0-9-]*$"}; - Checks::check_exit(VCPKG_LINE_INFO, - std::regex_match(s, ALLOWED_CHARS), - "Only alphanumeric chars and dashes are currently allowed. String was:\n" - " % s", - s); + switch (algo) + { + case Algorithm::Sha1: return "SHA1"; + case Algorithm::Sha256: return "SHA256"; + case Algorithm::Sha512: return "SHA512"; + default: vcpkg::Checks::exit_fail(VCPKG_LINE_INFO); + } } -#if defined(_WIN32) + namespace { - std::string to_hex(const unsigned char* string, const size_t bytes) + struct UInt128 { - static constexpr char HEX_MAP[] = "0123456789abcdef"; + std::uint64_t top; + std::uint64_t bottom; - std::string output; - output.resize(2 * bytes); + UInt128() = default; + UInt128(std::uint64_t value) : top(0), bottom(value) {} - size_t current_char = 0; - for (size_t i = 0; i < bytes; i++) + UInt128& operator<<=(int by) noexcept + { + if (by == 0) + { + return *this; + } + + if (by < 64) + { + top <<= by; + const auto shift_up = bottom >> (64 - by); + top |= shift_up; + bottom <<= by; + } + else + { + top = bottom; + top <<= (by - 64); + } + + return *this; + } + + UInt128& operator>>=(int by) noexcept + { + if (by == 0) + { + return *this; + } + + if (by < 64) + { + bottom >>= by; + const auto shift_down = top << (64 - by); + bottom |= shift_down; + top >>= by; + } + else + { + bottom = top; + bottom >>= (by - 64); + } + + return *this; + } + + UInt128& operator+=(std::size_t lhs) noexcept + { + // bottom + lhs > uint64::max + if (bottom > std::numeric_limits::max() - lhs) + { + top += 1; + } + bottom += lhs; + return *this; + } + }; + + } + template + void top_bits(T) = delete; + + static constexpr uchar top_bits(uchar x) noexcept { return x; } + static constexpr uchar top_bits(std::uint32_t x) noexcept { return (x >> 24) & 0xFF; } + static constexpr uchar top_bits(std::uint64_t x) noexcept { return (x >> 56) & 0xFF; } + static constexpr uchar top_bits(UInt128 x) noexcept { return top_bits(x.top); } + + // treats UIntTy as big endian for the purpose of this mapping + template + static std::string to_hex(const UIntTy* start, const UIntTy* end) noexcept + { + static constexpr char HEX_MAP[] = "0123456789abcdef"; + + std::string output; + output.resize(2 * sizeof(UIntTy) * (end - start)); + + std::size_t output_index = 0; + for (const UIntTy* it = start; it != end; ++it) + { + // holds *it in a big-endian buffer, for copying into output + uchar buff[sizeof(UIntTy)]; + UIntTy tmp = *it; + for (uchar& ch : buff) + { + ch = top_bits(tmp); + tmp <<= 8; + } + + for (const auto byte : buff) { // high - output[current_char] = HEX_MAP[(string[i] & 0xF0) >> 4]; - ++current_char; + output[output_index] = HEX_MAP[(byte & 0xF0) >> 4]; + ++output_index; // low - output[current_char] = HEX_MAP[(string[i] & 0x0F)]; - ++current_char; + output[output_index] = HEX_MAP[byte & 0x0F]; + ++output_index; } - - return output; } - class BCryptHasher + return output; + } + + namespace + { +#if defined(_WIN32) + BCRYPT_ALG_HANDLE get_alg_handle(LPCWSTR algorithm_identifier) noexcept { - struct BCryptAlgorithmHandle : Util::ResourceBase + BCRYPT_ALG_HANDLE result; + auto error = BCryptOpenAlgorithmProvider(&result, algorithm_identifier, nullptr, 0); + if (!NT_SUCCESS(error)) { - BCRYPT_ALG_HANDLE handle = nullptr; + Checks::exit_with_message(VCPKG_LINE_INFO, "Failure to open algorithm: %ls", algorithm_identifier); + } + + return result; + } - ~BCryptAlgorithmHandle() + struct BCryptHasher : Hasher + { + static const BCRYPT_ALG_HANDLE sha1_alg_handle; + static const BCRYPT_ALG_HANDLE sha256_alg_handle; + static const BCRYPT_ALG_HANDLE sha512_alg_handle; + + explicit BCryptHasher(Algorithm algo) noexcept + { + switch (algo) { - if (handle) BCryptCloseAlgorithmProvider(handle, 0); + case Algorithm::Sha1: alg_handle = sha1_alg_handle; break; + case Algorithm::Sha256: alg_handle = sha256_alg_handle; break; + case Algorithm::Sha512: alg_handle = sha512_alg_handle; break; + default: Checks::exit_with_message(VCPKG_LINE_INFO, "Unknown algorithm"); } - }; - struct BCryptHashHandle : Util::ResourceBase + clear(); + } + + virtual void add_bytes(const void* start_, const void* end_) noexcept override { - BCRYPT_HASH_HANDLE handle = nullptr; + // BCryptHashData takes its input as non-const, but does not modify it + uchar* start = const_cast(static_cast(start_)); + const uchar* end = static_cast(end_); + Checks::check_exit(VCPKG_LINE_INFO, end - start >= 0); + + // only matters on 64-bit -- BCryptHasher takes an unsigned long + // length, so if you have an array bigger than 2**32-1 elements, + // you have a problem. +#if defined(_M_AMD64) || defined(_M_ARM64) + constexpr std::ptrdiff_t max = std::numeric_limits::max(); + Checks::check_exit(VCPKG_LINE_INFO, end - start <= max); +#endif - ~BCryptHashHandle() - { - if (handle) BCryptDestroyHash(handle); - } - }; + const auto length = static_cast(end - start); + const NTSTATUS error_code = BCryptHashData(hash_handle, start, length, 0); + Checks::check_exit(VCPKG_LINE_INFO, NT_SUCCESS(error_code), "Failed to process a chunk"); + } - static void initialize_hash_handle(BCryptHashHandle& hash_handle, - const BCryptAlgorithmHandle& algorithm_handle) + virtual void clear() noexcept override { - const NTSTATUS error_code = - BCryptCreateHash(algorithm_handle.handle, &hash_handle.handle, nullptr, 0, nullptr, 0, 0); + if (hash_handle) BCryptDestroyHash(hash_handle); + const NTSTATUS error_code = BCryptCreateHash(alg_handle, &hash_handle, nullptr, 0, nullptr, 0, 0); Checks::check_exit(VCPKG_LINE_INFO, NT_SUCCESS(error_code), "Failed to initialize the hasher"); } - static void hash_data(BCryptHashHandle& hash_handle, const unsigned char* buffer, const size_t& data_size) + virtual std::string get_hash() noexcept override { - const NTSTATUS error_code = BCryptHashData( - hash_handle.handle, const_cast(buffer), static_cast(data_size), 0); - Checks::check_exit(VCPKG_LINE_INFO, NT_SUCCESS(error_code), "Failed to hash data"); + const auto hash_size = get_hash_buffer_size(); + const auto buffer = std::make_unique(hash_size); + const auto hash = buffer.get(); + + const NTSTATUS error_code = BCryptFinishHash(hash_handle, hash, hash_size, 0); + Checks::check_exit(VCPKG_LINE_INFO, NT_SUCCESS(error_code), "Failed to finalize the hash"); + return to_hex(hash, hash + hash_size); } - static std::string finalize_hash_handle(const BCryptHashHandle& hash_handle, const ULONG length_in_bytes) + ~BCryptHasher() { BCryptDestroyHash(hash_handle); } + + private: + unsigned long get_hash_buffer_size() const { - std::unique_ptr hash_buffer = std::make_unique(length_in_bytes); - const NTSTATUS error_code = BCryptFinishHash(hash_handle.handle, hash_buffer.get(), length_in_bytes, 0); - Checks::check_exit(VCPKG_LINE_INFO, NT_SUCCESS(error_code), "Failed to finalize the hash"); - return to_hex(hash_buffer.get(), length_in_bytes); - } - - public: - explicit BCryptHasher(std::string hash_type) - { - NTSTATUS error_code = BCryptOpenAlgorithmProvider( - &this->algorithm_handle.handle, - Strings::to_utf16(Strings::ascii_to_uppercase(std::move(hash_type))).c_str(), - nullptr, - 0); - Checks::check_exit(VCPKG_LINE_INFO, NT_SUCCESS(error_code), "Failed to open the algorithm provider"); - - DWORD hash_buffer_bytes; - DWORD cb_data; - error_code = BCryptGetProperty(this->algorithm_handle.handle, - BCRYPT_HASH_LENGTH, - reinterpret_cast(&hash_buffer_bytes), - sizeof(DWORD), - &cb_data, - 0); + unsigned long hash_buffer_bytes; + unsigned long cb_data; + const NTSTATUS error_code = BCryptGetProperty(alg_handle, + BCRYPT_HASH_LENGTH, + reinterpret_cast(&hash_buffer_bytes), + sizeof(hash_buffer_bytes), + &cb_data, + 0); Checks::check_exit(VCPKG_LINE_INFO, NT_SUCCESS(error_code), "Failed to get hash length"); - this->length_in_bytes = hash_buffer_bytes; + + return hash_buffer_bytes; } - std::string hash_file(const fs::path& path) const - { - BCryptHashHandle hash_handle; - initialize_hash_handle(hash_handle, this->algorithm_handle); + BCRYPT_HASH_HANDLE hash_handle = nullptr; + BCRYPT_ALG_HANDLE alg_handle = nullptr; + }; + + const BCRYPT_ALG_HANDLE BCryptHasher::sha1_alg_handle = get_alg_handle(BCRYPT_SHA1_ALGORITHM); + const BCRYPT_ALG_HANDLE BCryptHasher::sha256_alg_handle = get_alg_handle(BCRYPT_SHA256_ALGORITHM); + const BCRYPT_ALG_HANDLE BCryptHasher::sha512_alg_handle = get_alg_handle(BCRYPT_SHA512_ALGORITHM); +#else + + template + static WordTy shl(WordTy value, int by) noexcept + { + return value << by; + } + + static std::uint32_t shr32(std::uint32_t value, int by) noexcept { return value >> by; } + static std::uint32_t rol32(std::uint32_t value, int by) noexcept + { + return (value << by) | (value >> (32 - by)); + } + static std::uint32_t ror32(std::uint32_t value, int by) noexcept + { + return (value >> by) | (value << (32 - by)); + } + + static std::uint64_t shr64(std::uint64_t value, int by) noexcept { return value >> by; } + static std::uint64_t ror64(std::uint64_t value, int by) noexcept + { + return (value >> by) | (value << (64 - by)); + } + + template + struct ShaHasher final : Hasher + { + ShaHasher() = default; - FILE* file = nullptr; - const auto ec = _wfopen_s(&file, path.c_str(), L"rb"); - Checks::check_exit(VCPKG_LINE_INFO, ec == 0, "Failed to open file: %s", path.u8string()); - if (file != nullptr) + virtual void add_bytes(const void* start, const void* end) noexcept override + { + for (;;) { - unsigned char buffer[4096]; - while (const auto actual_size = fread(buffer, 1, sizeof(buffer), file)) + start = add_to_unprocessed(start, end); + if (!start) { - hash_data(hash_handle, buffer, actual_size); + break; // done } - fclose(file); + + m_impl.process_full_chunk(m_chunk); + m_current_chunk_size = 0; } + } + + virtual void clear() noexcept override + { + m_impl.clear(); - return finalize_hash_handle(hash_handle, length_in_bytes); + // m_chunk is theoretically uninitialized, so no need to reset it + m_current_chunk_size = 0; + m_message_length = 0; } - std::string hash_string(const std::string& s) const + virtual std::string get_hash() noexcept override { - BCryptHashHandle hash_handle; - initialize_hash_handle(hash_handle, this->algorithm_handle); - hash_data(hash_handle, reinterpret_cast(s.c_str()), s.size()); - return finalize_hash_handle(hash_handle, length_in_bytes); + process_last_chunk(); + return to_hex(m_impl.begin(), m_impl.end()); } private: - BCryptAlgorithmHandle algorithm_handle; - ULONG length_in_bytes; - }; - } + // if unprocessed gets filled, + // returns a pointer to the remainder of the block (which might be end) + // else, returns nullptr + const void* add_to_unprocessed(const void* start_, const void* end_) noexcept + { + const uchar* start = static_cast(start_); + const uchar* end = static_cast(end_); - std::string get_file_hash(const Files::Filesystem& fs, const fs::path& path, const std::string& hash_type) - { - Checks::check_exit(VCPKG_LINE_INFO, fs.exists(path), "File %s does not exist", path.u8string()); - return BCryptHasher{hash_type}.hash_file(path); - } + const auto remaining = chunk_size - m_current_chunk_size; - std::string get_string_hash(const std::string& s, const std::string& hash_type) - { - verify_has_only_allowed_chars(s); - return BCryptHasher{hash_type}.hash_string(s); - } + const std::size_t message_length = end - start; + if (message_length >= remaining) + { + std::copy(start, start + remaining, chunk_begin()); + m_current_chunk_size += remaining; + m_message_length += remaining * 8; + return start + remaining; + } + else + { + std::copy(start, end, chunk_begin()); + m_current_chunk_size += message_length; + m_message_length += message_length * 8; + return nullptr; + } + } -#else - static std::string get_digest_size(const std::string& hash_type) - { - if (!Strings::case_insensitive_ascii_starts_with(hash_type, "SHA")) + // called before `get_hash` + void process_last_chunk() noexcept + { + const auto message_length = m_message_length; + + // append the bit '1' to the message + { + const uchar temp = 0x80; + add_to_unprocessed(&temp, &temp + 1); + } + + // append 0 to the message so that the resulting length is just enough + // to add the message length + if (chunk_size - m_current_chunk_size < sizeof(m_message_length)) + { + // not enough space to add the message length + // just resize and process full chunk + std::fill(chunk_begin(), m_chunk.end(), static_cast(0)); + m_impl.process_full_chunk(m_chunk); + m_current_chunk_size = 0; + } + + const auto before_length = m_chunk.end() - sizeof(m_message_length); + std::fill(chunk_begin(), before_length, static_cast(0)); + std::generate(before_length, m_chunk.end(), [length = message_length]() mutable { + const auto result = top_bits(length); + length <<= 8; + return result; + }); + + m_impl.process_full_chunk(m_chunk); + } + + auto chunk_begin() { return m_chunk.begin() + m_current_chunk_size; } + + using underlying_type = typename ShaAlgorithm::underlying_type; + using message_length_type = typename ShaAlgorithm::message_length_type; + constexpr static std::size_t chunk_size = ShaAlgorithm::chunk_size; + + ShaAlgorithm m_impl{}; + + std::array m_chunk{}; + std::size_t m_current_chunk_size = 0; + message_length_type m_message_length = 0; + }; + template + inline void sha_fill_initial_words(const uchar* chunk, WordTy* words) { - Checks::exit_with_message( - VCPKG_LINE_INFO, "shasum only supports SHA hashes, but %s was provided", hash_type); + // break chunk into 16 N-bit words + for (std::size_t word = 0; word < 16; ++word) + { + words[word] = 0; + // big-endian -- so the earliest i becomes the most significant + for (std::size_t byte = 0; byte < sizeof(WordTy); ++byte) + { + const auto bits_to_shift = static_cast(8 * (sizeof(WordTy) - 1 - byte)); + words[word] |= shl(chunk[word * sizeof(WordTy) + byte], bits_to_shift); + } + } } - return hash_type.substr(3, hash_type.length() - 3); - } + struct Sha1Algorithm + { + using underlying_type = std::uint32_t; + using message_length_type = std::uint64_t; + constexpr static std::size_t chunk_size = 64; // = 512 / 8 + constexpr static std::size_t number_of_rounds = 80; - static std::string parse_shasum_output(const std::string& shasum_output) - { - std::vector split = Strings::split(shasum_output, " "); - // Checking if >= 3 because filenames with spaces will show up as multiple tokens. - // The hash is the first token so we don't need to parse the filename anyway. - Checks::check_exit(VCPKG_LINE_INFO, - split.size() >= 3, - "Expected output of the form [hash filename\n] (3+ tokens), but got\n" - "[%s] (%s tokens)", - shasum_output, - std::to_string(split.size())); - - return split[0]; - } + Sha1Algorithm() noexcept { clear(); } - std::string get_file_hash(const Files::Filesystem& fs, const fs::path& path, const std::string& hash_type) - { - const std::string digest_size = get_digest_size(hash_type); - Checks::check_exit(VCPKG_LINE_INFO, fs.exists(path), "File %s does not exist", path.u8string()); + void process_full_chunk(const std::array& chunk) noexcept + { + std::uint32_t words[80]; + + sha_fill_initial_words(&chunk[0], words); + for (std::size_t i = 16; i < number_of_rounds; ++i) + { + const auto sum = words[i - 3] ^ words[i - 8] ^ words[i - 14] ^ words[i - 16]; + words[i] = rol32(sum, 1); + } + + std::uint32_t a = m_digest[0]; + std::uint32_t b = m_digest[1]; + std::uint32_t c = m_digest[2]; + std::uint32_t d = m_digest[3]; + std::uint32_t e = m_digest[4]; + + for (std::size_t i = 0; i < number_of_rounds; ++i) + { + std::uint32_t f; + std::uint32_t k; + + if (i < 20) + { + f = (b & c) | (~b & d); + k = 0x5A827999; + } + else if (i < 40) + { + f = b ^ c ^ d; + k = 0x6ED9EBA1; + } + else if (i < 60) + { + f = (b & c) | (b & d) | (c & d); + k = 0x8F1BBCDC; + } + else + { + f = b ^ c ^ d; + k = 0xCA62C1D6; + } + + auto tmp = rol32(a, 5) + f + e + k + words[i]; + e = d; + d = c; + c = rol32(b, 30); + b = a; + a = tmp; + } + + m_digest[0] += a; + m_digest[1] += b; + m_digest[2] += c; + m_digest[3] += d; + m_digest[4] += e; + } - // Try hash-specific tools, like sha512sum + void clear() noexcept + { + m_digest[0] = 0x67452301; + m_digest[1] = 0xEFCDAB89; + m_digest[2] = 0x98BADCFE; + m_digest[3] = 0x10325476; + m_digest[4] = 0xC3D2E1F0; + } + + const std::uint32_t* begin() const noexcept { return &m_digest[0]; } + const std::uint32_t* end() const noexcept { return &m_digest[5]; } + + std::uint32_t m_digest[5]; + }; + + struct Sha256Algorithm { - const auto ec_data = System::cmd_execute_and_capture_output( - Strings::format(R"(sha%ssum "%s")", digest_size, path.u8string())); - if (ec_data.exit_code == 0) + using underlying_type = std::uint32_t; + using message_length_type = std::uint64_t; + constexpr static std::size_t chunk_size = 64; + + constexpr static std::size_t number_of_rounds = 64; + + Sha256Algorithm() noexcept { clear(); } + + void process_full_chunk(const std::array& chunk) noexcept { - return parse_shasum_output(ec_data.output); + std::uint32_t words[64]; + + sha_fill_initial_words(&chunk[0], words); + + for (std::size_t i = 16; i < number_of_rounds; ++i) + { + const auto w0 = words[i - 15]; + const auto s0 = ror32(w0, 7) ^ ror32(w0, 18) ^ shr32(w0, 3); + const auto w1 = words[i - 2]; + const auto s1 = ror32(w1, 17) ^ ror32(w1, 19) ^ shr32(w1, 10); + words[i] = words[i - 16] + s0 + words[i - 7] + s1; + } + + std::uint32_t local[8]; + std::copy(begin(), end(), std::begin(local)); + + for (std::size_t i = 0; i < number_of_rounds; ++i) + { + const auto a = local[0]; + const auto b = local[1]; + const auto c = local[2]; + + const auto s0 = ror32(a, 2) ^ ror32(a, 13) ^ ror32(a, 22); + const auto maj = (a & b) ^ (a & c) ^ (b & c); + const auto tmp1 = s0 + maj; + + const auto e = local[4]; + + const auto s1 = ror32(e, 6) ^ ror32(e, 11) ^ ror32(e, 25); + const auto ch = (e & local[5]) ^ (~e & local[6]); + const auto tmp2 = local[7] + s1 + ch + round_constants[i] + words[i]; + + for (std::size_t j = 7; j > 0; --j) + { + local[j] = local[j - 1]; + } + local[4] += tmp2; + local[0] = tmp1 + tmp2; + } + + for (std::size_t i = 0; i < 8; ++i) + { + m_digest[i] += local[i]; + } } - } - // Try shasum + void clear() noexcept + { + m_digest[0] = 0x6a09e667; + m_digest[1] = 0xbb67ae85; + m_digest[2] = 0x3c6ef372; + m_digest[3] = 0xa54ff53a; + m_digest[4] = 0x510e527f; + m_digest[5] = 0x9b05688c; + m_digest[6] = 0x1f83d9ab; + m_digest[7] = 0x5be0cd19; + } + + constexpr static std::array round_constants = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2}; + + std::uint32_t* begin() noexcept { return &m_digest[0]; } + std::uint32_t* end() noexcept { return &m_digest[8]; } + + std::uint32_t m_digest[8]; + }; + + struct Sha512Algorithm { - const auto ec_data = System::cmd_execute_and_capture_output( - Strings::format(R"(shasum -a %s "%s")", digest_size, path.u8string())); - if (ec_data.exit_code == 0) + using underlying_type = std::uint64_t; + using message_length_type = UInt128; + constexpr static std::size_t chunk_size = 128; // = 1024 / 8 + + constexpr static std::size_t number_of_rounds = 80; + + Sha512Algorithm() noexcept { clear(); } + + void process_full_chunk(const std::array& chunk) noexcept + { + std::uint64_t words[80]; + + sha_fill_initial_words(&chunk[0], words); + + for (std::size_t i = 16; i < number_of_rounds; ++i) + { + const auto w0 = words[i - 15]; + const auto s0 = ror64(w0, 1) ^ ror64(w0, 8) ^ shr64(w0, 7); + const auto w1 = words[i - 2]; + const auto s1 = ror64(w1, 19) ^ ror64(w1, 61) ^ shr64(w1, 6); + words[i] = words[i - 16] + s0 + words[i - 7] + s1; + } + + std::uint64_t local[8]; + std::copy(begin(), end(), std::begin(local)); + + for (std::size_t i = 0; i < number_of_rounds; ++i) + { + const auto a = local[0]; + const auto b = local[1]; + const auto c = local[2]; + + const auto s0 = ror64(a, 28) ^ ror64(a, 34) ^ ror64(a, 39); + const auto maj = (a & b) ^ (a & c) ^ (b & c); + const auto tmp0 = s0 + maj; + + const auto e = local[4]; + + const auto s1 = ror64(e, 14) ^ ror64(e, 18) ^ ror64(e, 41); + const auto ch = (e & local[5]) ^ (~e & local[6]); + const auto tmp1 = local[7] + s1 + ch + round_constants[i] + words[i]; + + for (std::size_t j = 7; j > 0; --j) + { + local[j] = local[j - 1]; + } + local[4] += tmp1; + local[0] = tmp0 + tmp1; + } + + for (std::size_t i = 0; i < 8; ++i) + { + m_digest[i] += local[i]; + } + } + + void clear() noexcept { - return parse_shasum_output(ec_data.output); + m_digest[0] = 0x6a09e667f3bcc908; + m_digest[1] = 0xbb67ae8584caa73b; + m_digest[2] = 0x3c6ef372fe94f82b; + m_digest[3] = 0xa54ff53a5f1d36f1; + m_digest[4] = 0x510e527fade682d1; + m_digest[5] = 0x9b05688c2b3e6c1f; + m_digest[6] = 0x1f83d9abfb41bd6b; + m_digest[7] = 0x5be0cd19137e2179; } - } - Checks::exit_with_message(VCPKG_LINE_INFO, "Could not hash file %s with %s", path.u8string(), hash_type); + constexpr static std::array round_constants = { + 0x428a2f98d728ae22, 0x7137449123ef65cd, 0xb5c0fbcfec4d3b2f, 0xe9b5dba58189dbbc, 0x3956c25bf348b538, + 0x59f111f1b605d019, 0x923f82a4af194f9b, 0xab1c5ed5da6d8118, 0xd807aa98a3030242, 0x12835b0145706fbe, + 0x243185be4ee4b28c, 0x550c7dc3d5ffb4e2, 0x72be5d74f27b896f, 0x80deb1fe3b1696b1, 0x9bdc06a725c71235, + 0xc19bf174cf692694, 0xe49b69c19ef14ad2, 0xefbe4786384f25e3, 0x0fc19dc68b8cd5b5, 0x240ca1cc77ac9c65, + 0x2de92c6f592b0275, 0x4a7484aa6ea6e483, 0x5cb0a9dcbd41fbd4, 0x76f988da831153b5, 0x983e5152ee66dfab, + 0xa831c66d2db43210, 0xb00327c898fb213f, 0xbf597fc7beef0ee4, 0xc6e00bf33da88fc2, 0xd5a79147930aa725, + 0x06ca6351e003826f, 0x142929670a0e6e70, 0x27b70a8546d22ffc, 0x2e1b21385c26c926, 0x4d2c6dfc5ac42aed, + 0x53380d139d95b3df, 0x650a73548baf63de, 0x766a0abb3c77b2a8, 0x81c2c92e47edaee6, 0x92722c851482353b, + 0xa2bfe8a14cf10364, 0xa81a664bbc423001, 0xc24b8b70d0f89791, 0xc76c51a30654be30, 0xd192e819d6ef5218, + 0xd69906245565a910, 0xf40e35855771202a, 0x106aa07032bbd1b8, 0x19a4c116b8d2d0c8, 0x1e376c085141ab53, + 0x2748774cdf8eeb99, 0x34b0bcb5e19b48a8, 0x391c0cb3c5c95a63, 0x4ed8aa4ae3418acb, 0x5b9cca4f7763e373, + 0x682e6ff3d6b2b8a3, 0x748f82ee5defb2fc, 0x78a5636f43172f60, 0x84c87814a1f0ab72, 0x8cc702081a6439ec, + 0x90befffa23631e28, 0xa4506cebde82bde9, 0xbef9a3f7b2c67915, 0xc67178f2e372532b, 0xca273eceea26619c, + 0xd186b8c721c0c207, 0xeada7dd6cde0eb1e, 0xf57d4f7fee6ed178, 0x06f067aa72176fba, 0x0a637dc5a2c898a6, + 0x113f9804bef90dae, 0x1b710b35131c471b, 0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc, + 0x431d67c49c100d4c, 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817}; + + std::uint64_t* begin() noexcept { return &m_digest[0]; } + std::uint64_t* end() noexcept { return &m_digest[8]; } + + std::uint64_t m_digest[8]; + }; + + // This is required on older compilers, since it was required in C++14 + constexpr std::array Sha256Algorithm::round_constants; + constexpr std::array Sha512Algorithm::round_constants; +#endif } - std::string get_string_hash(const std::string& s, const std::string& hash_type) + std::unique_ptr get_hasher_for(Algorithm algo) noexcept { - const std::string digest_size = get_digest_size(hash_type); - verify_has_only_allowed_chars(s); +#if defined(_WIN32) + return std::make_unique(algo); +#else + switch (algo) + { + case Algorithm::Sha1: return std::make_unique>(); + case Algorithm::Sha256: return std::make_unique>(); + case Algorithm::Sha512: return std::make_unique>(); + default: vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, "Unknown hashing algorithm: %s", algo); + } +#endif + } - // Try hash-specific tools, like sha512sum + template + static std::string do_hash(Algorithm algo, const F& f) noexcept + { +#if defined(_WIN32) + auto hasher = BCryptHasher(algo); + return f(hasher); +#else + switch (algo) { - const auto ec_data = - System::cmd_execute_and_capture_output(Strings::format(R"(echo -n "%s" | sha%ssum)", s, digest_size)); - if (ec_data.exit_code == 0) + case Algorithm::Sha1: + { + auto hasher = ShaHasher(); + return f(hasher); + } + case Algorithm::Sha256: + { + auto hasher = ShaHasher(); + return f(hasher); + } + case Algorithm::Sha512: { - return parse_shasum_output(ec_data.output); + auto hasher = ShaHasher(); + return f(hasher); } + default: vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, "Unknown hashing algorithm: %s", algo); } +#endif + } + + std::string get_bytes_hash(const void* first, const void* last, Algorithm algo) noexcept + { + return do_hash(algo, [first, last](Hasher& hasher) { + hasher.add_bytes(first, last); + return hasher.get_hash(); + }); + } - // Try shasum + std::string get_string_hash(StringView sv, Algorithm algo) noexcept + { + return get_bytes_hash(sv.data(), sv.data() + sv.size(), algo); + } + + // TODO: use Files::Filesystem to open a file + std::string get_file_hash(const Files::Filesystem&, + const fs::path& path, + Algorithm algo, + std::error_code& ec) noexcept + { + auto file = std::fstream(path.c_str(), std::ios_base::in | std::ios_base::binary); + if (!file) { - const auto ec_data = System::cmd_execute_and_capture_output( - Strings::format(R"(echo -n "%s" | shasum -a %s)", s, digest_size)); - if (ec_data.exit_code == 0) - { - return parse_shasum_output(ec_data.output); - } + ec.assign(ENOENT, std::system_category()); + return {}; } - Checks::exit_with_message(VCPKG_LINE_INFO, "Could not hash input string with %s", hash_type); + return do_hash(algo, [&file, &ec](Hasher& hasher) { + constexpr std::size_t buffer_size = 4096; + auto buffer = std::make_unique(buffer_size); + for (;;) + { + file.read(buffer.get(), buffer_size); + if (file.eof()) + { + hasher.add_bytes(buffer.get(), buffer.get() + file.gcount()); + return hasher.get_hash(); + } + else if (file) + { + hasher.add_bytes(buffer.get(), buffer.get() + buffer_size); + } + else + { + ec = std::io_errc::stream; + return std::string(); + } + } + }); } -#endif } diff --git a/toolsrc/src/vcpkg/base/stringview.cpp b/toolsrc/src/vcpkg/base/stringview.cpp index d0b2cd43a..839d72ce8 100644 --- a/toolsrc/src/vcpkg/base/stringview.cpp +++ b/toolsrc/src/vcpkg/base/stringview.cpp @@ -76,8 +76,10 @@ namespace vcpkg std::string StringView::to_string() const { return std::string(m_ptr, m_size); } void StringView::to_string(std::string& s) const { s.append(m_ptr, m_size); } - bool StringView::operator==(StringView other) const + bool operator==(StringView lhs, StringView rhs) noexcept { - return other.size() == size() && memcmp(data(), other.data(), size()) == 0; + return lhs.size() == lhs.size() && memcmp(lhs.data(), rhs.data(), lhs.size()) == 0; } + + bool operator!=(StringView lhs, StringView rhs) noexcept { return !(lhs == rhs); } } diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index a2e90f33b..9245ddfbc 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -486,32 +486,33 @@ namespace vcpkg::Build } else { - hash = Hash::get_file_hash(fs, triplet_file_path, "SHA1"); + const auto algo = Hash::Algorithm::Sha1; + hash = Hash::get_file_hash(VCPKG_LINE_INFO, fs, triplet_file_path, algo); if (auto p = pre_build_info.external_toolchain_file.get()) { hash += "-"; - hash += Hash::get_file_hash(fs, *p, "SHA1"); + hash += Hash::get_file_hash(VCPKG_LINE_INFO, fs, *p, algo); } else if (pre_build_info.cmake_system_name == "Linux") { hash += "-"; - hash += Hash::get_file_hash(fs, paths.scripts / "toolchains" / "linux.cmake", "SHA1"); + hash += Hash::get_file_hash(VCPKG_LINE_INFO, fs, paths.scripts / "toolchains" / "linux.cmake", algo); } else if (pre_build_info.cmake_system_name == "Darwin") { hash += "-"; - hash += Hash::get_file_hash(fs, paths.scripts / "toolchains" / "osx.cmake", "SHA1"); + hash += Hash::get_file_hash(VCPKG_LINE_INFO, fs, paths.scripts / "toolchains" / "osx.cmake", algo); } else if (pre_build_info.cmake_system_name == "FreeBSD") { hash += "-"; - hash += Hash::get_file_hash(fs, paths.scripts / "toolchains" / "freebsd.cmake", "SHA1"); + hash += Hash::get_file_hash(VCPKG_LINE_INFO, fs, paths.scripts / "toolchains" / "freebsd.cmake", algo); } else if (pre_build_info.cmake_system_name == "Android") { hash += "-"; - hash += Hash::get_file_hash(fs, paths.scripts / "toolchains" / "android.cmake", "SHA1"); + hash += Hash::get_file_hash(VCPKG_LINE_INFO, fs, paths.scripts / "toolchains" / "android.cmake", algo); } s_hash_cache.emplace(triplet_file_path, hash); @@ -651,8 +652,9 @@ namespace vcpkg::Build { if (fs::is_regular_file(fs.status(VCPKG_LINE_INFO, port_file))) { - port_files.emplace_back(port_file.path().filename().u8string(), - vcpkg::Hash::get_file_hash(fs, port_file, "SHA1")); + port_files.emplace_back( + port_file.path().filename().u8string(), + vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, fs, port_file, Hash::Algorithm::Sha1)); if (port_files.size() > max_port_file_count) { @@ -679,7 +681,10 @@ namespace vcpkg::Build abi_tag_entries.emplace_back( "vcpkg_fixup_cmake_targets", - vcpkg::Hash::get_file_hash(fs, paths.scripts / "cmake" / "vcpkg_fixup_cmake_targets.cmake", "SHA1")); + vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, + fs, + paths.scripts / "cmake" / "vcpkg_fixup_cmake_targets.cmake", + Hash::Algorithm::Sha1)); abi_tag_entries.emplace_back("triplet", pre_build_info.triplet_abi_tag); abi_tag_entries.emplace_back("features", Strings::join(";", config.feature_list)); @@ -688,7 +693,8 @@ namespace vcpkg::Build { abi_tag_entries.emplace_back( "public_abi_override", - Hash::get_string_hash(pre_build_info.public_abi_override.value_or_exit(VCPKG_LINE_INFO), "SHA1")); + Hash::get_string_hash(pre_build_info.public_abi_override.value_or_exit(VCPKG_LINE_INFO), + Hash::Algorithm::Sha1)); } if (config.build_package_options.use_head_version == UseHeadVersion::YES) @@ -717,7 +723,8 @@ namespace vcpkg::Build const auto abi_file_path = paths.buildtrees / name / (triplet.canonical_name() + ".vcpkg_abi_info.txt"); fs.write_contents(abi_file_path, full_abi_info, VCPKG_LINE_INFO); - return AbiTagAndFile{Hash::get_file_hash(fs, abi_file_path, "SHA1"), abi_file_path}; + return AbiTagAndFile{Hash::get_file_hash(VCPKG_LINE_INFO, fs, abi_file_path, Hash::Algorithm::Sha1), + abi_file_path}; } System::print2( diff --git a/toolsrc/src/vcpkg/commands.cpp b/toolsrc/src/vcpkg/commands.cpp index 3ac568979..962dbd48b 100644 --- a/toolsrc/src/vcpkg/commands.cpp +++ b/toolsrc/src/vcpkg/commands.cpp @@ -99,8 +99,15 @@ namespace vcpkg::Commands::Hash Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); const fs::path file_to_hash = args.command_arguments[0]; - const std::string algorithm = args.command_arguments.size() == 2 ? args.command_arguments[1] : "SHA512"; - const std::string hash = vcpkg::Hash::get_file_hash(paths.get_filesystem(), file_to_hash, algorithm); + + auto algorithm = vcpkg::Hash::Algorithm::Sha512; + if (args.command_arguments.size() == 2) + { + algorithm = vcpkg::Hash::algorithm_from_string(args.command_arguments[1]).value_or_exit(VCPKG_LINE_INFO); + } + + const std::string hash = + vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, paths.get_filesystem(), file_to_hash, algorithm); System::print2(hash, '\n'); Checks::exit_success(VCPKG_LINE_INFO); } diff --git a/toolsrc/src/vcpkg/metrics.cpp b/toolsrc/src/vcpkg/metrics.cpp index 11f613830..b8c55919e 100644 --- a/toolsrc/src/vcpkg/metrics.cpp +++ b/toolsrc/src/vcpkg/metrics.cpp @@ -266,7 +266,7 @@ namespace vcpkg::Metrics const auto match = *next; if (match[0] != "00-00-00-00-00-00") { - return vcpkg::Hash::get_string_hash(match[0], "SHA256"); + return vcpkg::Hash::get_string_hash(match[0].str(), Hash::Algorithm::Sha256); } ++next; } -- cgit v1.2.3 From c3b5fd0b18d0b688e5d3fbf16fe77ffeda221dcb Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Tue, 27 Aug 2019 00:09:53 +0300 Subject: Add homepage for beast (#7909) --- ports/beast/CONTROL | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/beast/CONTROL b/ports/beast/CONTROL index 0c889b941..d2f2fd896 100644 --- a/ports/beast/CONTROL +++ b/ports/beast/CONTROL @@ -1,4 +1,5 @@ Source: beast Version: 0 +Homepage: https://www.boost.org/doc/libs/release/libs/beast/ Build-Depends: boost-beast Description: HTTP/1 and WebSocket, header-only using Boost.Asio and C++11 -- cgit v1.2.3 From c446b0621a67c781971a4b4359e77bd6a72f6db7 Mon Sep 17 00:00:00 2001 From: Kevin Lu <6320810+kevinlul@users.noreply.github.com> Date: Mon, 26 Aug 2019 17:32:35 -0400 Subject: [fmt] Update to 6.0.0 (#7910) --- ports/fmt/CONTROL | 2 +- ports/fmt/portfile.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/fmt/CONTROL b/ports/fmt/CONTROL index c789e86f8..bc6de38f8 100644 --- a/ports/fmt/CONTROL +++ b/ports/fmt/CONTROL @@ -1,4 +1,4 @@ Source: fmt -Version: 5.3.0-2 +Version: 6.0.0 Homepage: https://github.com/fmtlib/fmt 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 f1778d985..18fb2c4fc 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -2,8 +2,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO fmtlib/fmt - REF 5.3.0 - SHA512 9ef0f3d328681253c1e1776576d54d67dec49c19fd7fc422ae63c3610b01a3f05f6e83cdf5e913dfd09bac42e52fe35c38ebe1ea91f4207d226a32aaf69eb4a8 + REF 6.0.0 + SHA512 7deb5bd843ae6b9d4b58dca9c68c1cfe7b55a41040f358247f5309655188d1ae194ff414437c068f74367f078faa214b5883e8c9e634c7623dcda50850e24766 HEAD_REF master ) vcpkg_configure_cmake( -- cgit v1.2.3 From 6d8e66ff4fe40ef0937e33e809287476e2c04ee5 Mon Sep 17 00:00:00 2001 From: Phil Christensen Date: Mon, 26 Aug 2019 16:21:57 -0700 Subject: Run clang-format and add more error messages --- toolsrc/src/vcpkg/parse.cpp | 154 +++++++++++++++++++++++--------------------- 1 file changed, 82 insertions(+), 72 deletions(-) diff --git a/toolsrc/src/vcpkg/parse.cpp b/toolsrc/src/vcpkg/parse.cpp index 91b2b2786..a3f4186fc 100644 --- a/toolsrc/src/vcpkg/parse.cpp +++ b/toolsrc/src/vcpkg/parse.cpp @@ -2,8 +2,8 @@ #include -#include #include +#include namespace vcpkg::Parse { @@ -45,10 +45,7 @@ namespace vcpkg::Parse return nullptr; } - static bool is_whitespace(char c) - { - return c == ' ' || c == '\t' || c == '\n' || c == '\r'; - } + static bool is_whitespace(char c) { return c == ' ' || c == '\t' || c == '\n' || c == '\r'; } std::vector parse_comma_list(const std::string& str) { @@ -59,73 +56,86 @@ namespace vcpkg::Parse std::vector out; - auto iter = str.cbegin(); - - do { - // Trim leading whitespace of each element - while (iter != str.cend() && is_whitespace(*iter)) - { - ++iter; - } - - // Allow commas inside of []. - bool bracket_nesting = false; - - auto element_begin = iter; - auto element_end = iter; - while (iter != str.cend() && (*iter != ',' || bracket_nesting)) - { - char value = *iter; - - // do not support nested [] - if (value == '[') - { - bracket_nesting = true; - } - else if (value == ']') - { - bracket_nesting = false; - } - - ++iter; - - // Trim ending whitespace - if (!is_whitespace(value)) - { - // Update element_end after iter is incremented so it will be one past. - element_end = iter; - } - } - - if (element_begin == element_end) - { - System::print2( System::Color::warning, - "Warning: empty element in list\n" - "> '", str, "'\n" - "> ", std::string(static_cast(element_begin - str.cbegin()), ' '), "^\n" - ); - } - else - { - out.push_back({ element_begin, element_end }); - } - - if (iter != str.cend()) - { - //Not at the end, must be at a comma that needs to be stepped over - ++iter; - - if (iter == str.end()) - { - System::print2(System::Color::warning, - "Warning: empty element in list\n" - "> '", str, "'\n" - "> ", std::string(str.length(), ' '), "^\n" - ); - } - } - - } while (iter != str.cend()); + auto iter = str.cbegin(); + + do + { + // Trim leading whitespace of each element + while (iter != str.cend() && is_whitespace(*iter)) + { + ++iter; + } + + // Allow commas inside of []. + bool bracket_nesting = false; + + auto element_begin = iter; + auto element_end = iter; + while (iter != str.cend() && (*iter != ',' || bracket_nesting)) + { + char value = *iter; + + // do not support nested [] + if (value == '[') + { + Checks::check_exit(VCPKG_LINE_INFO, + !bracket_nesting, + "Lists do not support nested brackets, Did you forget a ']'?\n" + "> '%s'\n" + "> %s^\n", + str, + std::string(static_cast(iter - str.cbegin()), ' ')); + bracket_nesting = true; + } + else if (value == ']') + { + Checks::check_exit(VCPKG_LINE_INFO, + bracket_nesting, + "Found unmatched ']'. Did you forget a '['?\n" + "> '%s'\n" + "> %s^\n", + str, + std::string(static_cast(iter - str.cbegin()), ' ')); + bracket_nesting = false; + } + + ++iter; + + // Trim ending whitespace + if (!is_whitespace(value)) + { + // Update element_end after iter is incremented so it will be one past. + element_end = iter; + } + } + + Checks::check_exit(VCPKG_LINE_INFO, + element_begin != element_end, + "Empty element in list\n" + "> '%s'\n" + "> %s^\n", + str, + std::string(static_cast(element_begin - str.cbegin()), ' ')); + + out.push_back({element_begin, element_end}); + + if (iter != str.cend()) + { + Checks::check_exit(VCPKG_LINE_INFO, *iter == ',', "Internal parsing error - expected comma"); + + // Not at the end, must be at a comma that needs to be stepped over + ++iter; + + Checks::check_exit(VCPKG_LINE_INFO, + iter != str.end(), + "Empty element in list\n" + "> '%s'\n" + "> %s^\n", + str, + std::string(str.length(), ' ')); + } + + } while (iter != str.cend()); return out; } -- cgit v1.2.3 From 8bae937e1725a85cb7829ad3113debbeef43674a Mon Sep 17 00:00:00 2001 From: Phil Christensen Date: Mon, 26 Aug 2019 16:39:38 -0700 Subject: avoid assembling error strings unless there is an error --- toolsrc/src/vcpkg/parse.cpp | 65 +++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/toolsrc/src/vcpkg/parse.cpp b/toolsrc/src/vcpkg/parse.cpp index a3f4186fc..6015d9927 100644 --- a/toolsrc/src/vcpkg/parse.cpp +++ b/toolsrc/src/vcpkg/parse.cpp @@ -78,24 +78,28 @@ namespace vcpkg::Parse // do not support nested [] if (value == '[') { - Checks::check_exit(VCPKG_LINE_INFO, - !bracket_nesting, - "Lists do not support nested brackets, Did you forget a ']'?\n" - "> '%s'\n" - "> %s^\n", - str, - std::string(static_cast(iter - str.cbegin()), ' ')); + if (bracket_nesting) + { + Checks::exit_with_message(VCPKG_LINE_INFO, + "Lists do not support nested brackets, Did you forget a ']'?\n" + "> '%s'\n" + "> %s^\n", + str, + std::string(static_cast(iter - str.cbegin()), ' ')); + } bracket_nesting = true; } else if (value == ']') { - Checks::check_exit(VCPKG_LINE_INFO, - bracket_nesting, - "Found unmatched ']'. Did you forget a '['?\n" - "> '%s'\n" - "> %s^\n", - str, - std::string(static_cast(iter - str.cbegin()), ' ')); + if (!bracket_nesting) + { + Checks::exit_with_message(VCPKG_LINE_INFO, + "Found unmatched ']'. Did you forget a '['?\n" + "> '%s'\n" + "> %s^\n", + str, + std::string(static_cast(iter - str.cbegin()), ' ')); + } bracket_nesting = false; } @@ -109,14 +113,15 @@ namespace vcpkg::Parse } } - Checks::check_exit(VCPKG_LINE_INFO, - element_begin != element_end, - "Empty element in list\n" - "> '%s'\n" - "> %s^\n", - str, - std::string(static_cast(element_begin - str.cbegin()), ' ')); - + if (element_begin == element_end) + { + Checks::exit_with_message(VCPKG_LINE_INFO, + "Empty element in list\n" + "> '%s'\n" + "> %s^\n", + str, + std::string(static_cast(element_begin - str.cbegin()), ' ')); + } out.push_back({element_begin, element_end}); if (iter != str.cend()) @@ -126,13 +131,15 @@ namespace vcpkg::Parse // Not at the end, must be at a comma that needs to be stepped over ++iter; - Checks::check_exit(VCPKG_LINE_INFO, - iter != str.end(), - "Empty element in list\n" - "> '%s'\n" - "> %s^\n", - str, - std::string(str.length(), ' ')); + if (iter == str.end()) + { + Checks::exit_with_message(VCPKG_LINE_INFO, + "Empty element in list\n" + "> '%s'\n" + "> %s^\n", + str, + std::string(str.length(), ' ')); + } } } while (iter != str.cend()); -- cgit v1.2.3 From b4e61b548fa01bfbd27ac1fe7fdc2b1f46303c1e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Aug 2019 05:36:04 -0700 Subject: [magic-enum] Update to v0.6.0 (#7916) --- ports/magic-enum/CONTROL | 2 +- ports/magic-enum/portfile.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/magic-enum/CONTROL b/ports/magic-enum/CONTROL index 590b8d758..ad6ccddd9 100644 --- a/ports/magic-enum/CONTROL +++ b/ports/magic-enum/CONTROL @@ -1,3 +1,3 @@ Source: magic-enum -Version: 2019-06-07 +Version: 0.6.0 Description: Header-only C++17 library provides static reflection for enums, work with any enum type without any macro or boilerplate code. diff --git a/ports/magic-enum/portfile.cmake b/ports/magic-enum/portfile.cmake index 95be6cc27..683f7f354 100644 --- a/ports/magic-enum/portfile.cmake +++ b/ports/magic-enum/portfile.cmake @@ -3,8 +3,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO "Neargye/magic_enum" - REF 4dfaa4b7b4814c2cf85b08ad3084fc28c8b129c6 - SHA512 924e5a134f4200652fdc3f3d676b49efa8c30b5577d638f60134ce81092b23f7976a494ce50b58b25ed7bce0653a7e29206acf9e512408c4701ec6822ab2d176 + REF v0.6.0 + SHA512 3079155509f0141e9a50b2a773e33e3ebda1a4c1a7d0b78f093e2d0e8a4b78ef108876e63ef986a55c03bb712a494943b7c4c37bcbe08d932035106f4afe3bd2 ) vcpkg_configure_cmake( -- cgit v1.2.3 From 9609b2a61590ef578a0751cd04c27ce86a371484 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Tue, 27 Aug 2019 20:45:31 +0300 Subject: Add homepage for orc (#7908) * Add homepage for orc * [orc] Fix build by updating tzdata url The build fails as is tries to fetch tzdata-2018c-1.tar.xz which is gone from FTPs. Fix it by updating to tzdata-2019b-1. This is the same as upstream commit 51a26ab85fc33a7d765dc1f500d43e6ae4ceb0d1 --- ports/orc/0004-update-tzdata.patch | 15 +++++++++++++++ ports/orc/CONTROL | 1 + ports/orc/portfile.cmake | 1 + 3 files changed, 17 insertions(+) create mode 100644 ports/orc/0004-update-tzdata.patch diff --git a/ports/orc/0004-update-tzdata.patch b/ports/orc/0004-update-tzdata.patch new file mode 100644 index 000000000..fa9ae2fad --- /dev/null +++ b/ports/orc/0004-update-tzdata.patch @@ -0,0 +1,15 @@ +diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake +index 1a28b1ae..74f0e61c 100644 +--- a/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cmake_modules/ThirdpartyToolchain.cmake +@@ -228,8 +228,8 @@ endif () + + if (WIN32) + ExternalProject_Add(tzdata_ep +- URL "ftp://cygwin.osuosl.org/pub/cygwin/noarch/release/tzdata/tzdata-2018c-1.tar.xz" +- URL_HASH MD5=F69FCA5C906FAFF02462D3D06F28267C ++ URL "ftp://cygwin.osuosl.org/pub/cygwin/noarch/release/tzdata/tzdata-2019b-1.tar.xz" ++ URL_HASH MD5=17D8AB346BB1009D4EB35BC08040E51D + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "") diff --git a/ports/orc/CONTROL b/ports/orc/CONTROL index 53d4a55c4..3ab0d5903 100644 --- a/ports/orc/CONTROL +++ b/ports/orc/CONTROL @@ -1,4 +1,5 @@ Source: orc Version: 1.5.6 +Homepage: https://orc.apache.org/ Build-Depends: zlib, protobuf, lz4, snappy, zstd, gtest Description: The smallest, fastest columnar storage for Hadoop workloads. diff --git a/ports/orc/portfile.cmake b/ports/orc/portfile.cmake index 40af08ac8..b3f52729f 100644 --- a/ports/orc/portfile.cmake +++ b/ports/orc/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( HEAD_REF master PATCHES 0003-dependencies-from-vcpkg.patch + 0004-update-tzdata.patch no-werror.patch ) -- cgit v1.2.3 From 0011fd9e5ec210851bf93584214a8d4e30245a73 Mon Sep 17 00:00:00 2001 From: zi-m <53815290+zi-m@users.noreply.github.com> Date: Tue, 27 Aug 2019 19:45:58 +0200 Subject: json5-parser (#7915) --- ports/json5-parser/00001-fix-build.patch | 27 +++++++++++++++++++++++++++ ports/json5-parser/CONTROL | 5 +++++ ports/json5-parser/portfile.cmake | 27 +++++++++++++++++++++++++++ ports/json5-parser/usage | 4 ++++ 4 files changed, 63 insertions(+) create mode 100644 ports/json5-parser/00001-fix-build.patch create mode 100644 ports/json5-parser/CONTROL create mode 100644 ports/json5-parser/portfile.cmake create mode 100644 ports/json5-parser/usage diff --git a/ports/json5-parser/00001-fix-build.patch b/ports/json5-parser/00001-fix-build.patch new file mode 100644 index 000000000..74f34a298 --- /dev/null +++ b/ports/json5-parser/00001-fix-build.patch @@ -0,0 +1,27 @@ +diff --git a/json5_parser/CMakeLists.txt b/json5_parser/CMakeLists.txt +index e83fb38..b193c97 100644 +--- a/json5_parser/CMakeLists.txt ++++ b/json5_parser/CMakeLists.txt +@@ -15,3 +15,22 @@ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) + + ADD_LIBRARY(json5_parser STATIC ${JSON_SPIRIT_SRCS}) + ++if(MSVC) ++ target_compile_options(json5_parser PRIVATE "/bigobj") ++endif() ++ ++target_include_directories(json5_parser PUBLIC $) ++ ++install(TARGETS json5_parser EXPORT json5_parser-config ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++) ++install(EXPORT json5_parser-config DESTINATION share/cmake/json5_parser) ++ ++file(GLOB HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} json5_parser*.h) ++foreach (HEADER ${HEADERS} ) ++ get_filename_component(HEADER_DIR ${HEADER} DIRECTORY) ++ install(FILES ${HEADER} DESTINATION include/${HEADER_DIR}) ++endforeach() ++ diff --git a/ports/json5-parser/CONTROL b/ports/json5-parser/CONTROL new file mode 100644 index 000000000..1c740dd3d --- /dev/null +++ b/ports/json5-parser/CONTROL @@ -0,0 +1,5 @@ +Source: json5-parser +Version: 1.0.0 +Homepage: https://bitbucket.org/wlandry/json5_parser +Description: An enhancement of the JSON Spirit C++ library to understand json5. +Build-Depends: boost-spirit diff --git a/ports/json5-parser/portfile.cmake b/ports/json5-parser/portfile.cmake new file mode 100644 index 000000000..083947621 --- /dev/null +++ b/ports/json5-parser/portfile.cmake @@ -0,0 +1,27 @@ +include(vcpkg_common_functions) + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_bitbucket( + OUT_SOURCE_PATH SOURCE_PATH + REPO wlandry/json5_parser + REF 1.0.0 + SHA512 105d0cccb28dd9045c06d73ab1e98a5e744ffdb38310a4581b8f1517b0edffb2cba424dc557a3490dfdcd4627d3bd1c6850eb38f588e1627dcab1de120d70717 + HEAD_REF master + PATCHES 00001-fix-build.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH}/json5_parser + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/json5_parser) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +configure_file(${SOURCE_PATH}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/json5-parser/copyright COPYONLY) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/json5-parser) diff --git a/ports/json5-parser/usage b/ports/json5-parser/usage new file mode 100644 index 000000000..950e637a0 --- /dev/null +++ b/ports/json5-parser/usage @@ -0,0 +1,4 @@ +The package json5-parser provides CMake targets: + + find_package(json5_parser CONFIG REQUIRED) + target_link_libraries(main PRIVATE json5_parser) -- cgit v1.2.3 From ef336e07a79547c1081d2a453c73cf6f444f1bbe Mon Sep 17 00:00:00 2001 From: Ehsan Date: Tue, 27 Aug 2019 22:20:50 +0430 Subject: [casclib] Update library to 1.50b (#7907) * [casclib] Update library to 1.50b * Fix ctype_for_mac.patch --- ports/casclib/CONTROL | 2 +- ports/casclib/ctype_for_mac.patch | 15 +++++---------- ports/casclib/portfile.cmake | 4 ++-- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/ports/casclib/CONTROL b/ports/casclib/CONTROL index 4622f5200..9c0a083ba 100644 --- a/ports/casclib/CONTROL +++ b/ports/casclib/CONTROL @@ -1,4 +1,4 @@ Source: casclib -Version: 1.50-1 +Version: 1.50b-1 Build-Depends: zlib Description: An open-source implementation of library for reading CASC storage from Blizzard games since 2014 diff --git a/ports/casclib/ctype_for_mac.patch b/ports/casclib/ctype_for_mac.patch index 30f790c1f..dc1a67dff 100644 --- a/ports/casclib/ctype_for_mac.patch +++ b/ports/casclib/ctype_for_mac.patch @@ -1,16 +1,11 @@ diff --git a/src/CascPort.h b/src/CascPort.h -index 87a2f2f..da74aef 100644 +index 3bd08d4..201f7dd 100644 --- a/src/CascPort.h +++ b/src/CascPort.h -@@ -79,14 +79,19 @@ - #include - #include - #include -- #include - #include -- #include +@@ -85,10 +85,17 @@ + #include #include -- #include + #include + #include #include + #include @@ -18,7 +13,7 @@ index 87a2f2f..da74aef 100644 + #include + #include #include -+ #include + #include + #include #include + #include diff --git a/ports/casclib/portfile.cmake b/ports/casclib/portfile.cmake index 9604ac618..fb2fd77eb 100644 --- a/ports/casclib/portfile.cmake +++ b/ports/casclib/portfile.cmake @@ -3,8 +3,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ladislav-zezula/CascLib - REF 1.50 - SHA512 7e95e314f09e504566e6fa2b1742f986d17526fb0283af8ffb77681338c9a852d369cbd863512a20ddd3a277d10a9bf701d745f500a717826dd08e201eb6d80e + REF 1.50b + SHA512 f32cc592f454db4815c0dfd18a9c0076d85b1582e6974d241d1d4094269c42a978fa42186504988ced2c8f4a0b598f41e3ec8a95ddc3c0551af997e37708b1f5 HEAD_REF master PATCHES ctype_for_mac.patch -- cgit v1.2.3 From 8b7f940d82f829bb7d6dbf986225d69b07cbcb40 Mon Sep 17 00:00:00 2001 From: Dmitry Makarov <4341162+dimiboi@users.noreply.github.com> Date: Tue, 27 Aug 2019 20:52:40 +0300 Subject: fmt port VCPKG_BUILD_TYPE support (#7884) --- ports/fmt/portfile.cmake | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index 18fb2c4fc..0809aaeb9 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -19,10 +19,14 @@ vcpkg_install_cmake() file(INSTALL ${SOURCE_PATH}/LICENSE.rst DESTINATION ${CURRENT_PACKAGES_DIR}/share/fmt RENAME copyright) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NAME) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fmt.dll ${CURRENT_PACKAGES_DIR}/bin/fmt.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fmtd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fmtd.dll) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fmtd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fmtd.dll) + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fmt.dll ${CURRENT_PACKAGES_DIR}/bin/fmt.dll) + endif() endif() # Force FMT_SHARED to 1 @@ -35,12 +39,16 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_fixup_cmake_targets() if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NAME) - file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake FMT_DEBUG_MODULE) - string(REPLACE "lib/fmtd.dll" "bin/fmtd.dll" FMT_DEBUG_MODULE ${FMT_DEBUG_MODULE}) - file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake "${FMT_DEBUG_MODULE}") - file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake FMT_RELEASE_MODULE) - string(REPLACE "lib/fmt.dll" "bin/fmt.dll" FMT_RELEASE_MODULE ${FMT_RELEASE_MODULE}) - file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake "${FMT_RELEASE_MODULE}") + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake FMT_DEBUG_MODULE) + string(REPLACE "lib/fmtd.dll" "bin/fmtd.dll" FMT_DEBUG_MODULE ${FMT_DEBUG_MODULE}) + file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake "${FMT_DEBUG_MODULE}") + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake FMT_RELEASE_MODULE) + string(REPLACE "lib/fmt.dll" "bin/fmt.dll" FMT_RELEASE_MODULE ${FMT_RELEASE_MODULE}) + file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake "${FMT_RELEASE_MODULE}") + endif() endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -- cgit v1.2.3 From 693d05fa965b28fded96d0ded7b1cda84189ff48 Mon Sep 17 00:00:00 2001 From: zi-m <53815290+zi-m@users.noreply.github.com> Date: Tue, 27 Aug 2019 19:56:45 +0200 Subject: [gppanel] Add new port (#7868) * gppanel * fix Homepage * use GLOB_RECURSE instead of GLOB * use FindwxWidgets.cmake from CaeruleusAqua/vcpkg-wx-find --- ports/gppanel/00001-fix-build.patch | 24 +++++++++++++++++++++ ports/gppanel/CMakeLists.txt | 32 ++++++++++++++++++++++++++++ ports/gppanel/CONTROL | 5 +++++ ports/gppanel/portfile.cmake | 42 +++++++++++++++++++++++++++++++++++++ ports/gppanel/usage | 4 ++++ 5 files changed, 107 insertions(+) create mode 100644 ports/gppanel/00001-fix-build.patch create mode 100644 ports/gppanel/CMakeLists.txt create mode 100644 ports/gppanel/CONTROL create mode 100644 ports/gppanel/portfile.cmake create mode 100644 ports/gppanel/usage diff --git a/ports/gppanel/00001-fix-build.patch b/ports/gppanel/00001-fix-build.patch new file mode 100644 index 000000000..bf394d63f --- /dev/null +++ b/ports/gppanel/00001-fix-build.patch @@ -0,0 +1,24 @@ +diff --git a/gpPanel/gpPanel.cpp b/gpPanel/gpPanel.cpp +index 7af20b5..908523c 100644 +--- a/gpPanel/gpPanel.cpp ++++ b/gpPanel/gpPanel.cpp +@@ -720,8 +720,8 @@ void gpPanel::OnMenuItemPrintPreview(wxCommandEvent& event) + gpLayer_s *gp = GetLayerByMenuId(event.GetId() ); + if(gp==NULL)return; + +- mpPrintout *plotPrint = new mpPrintout(gp->m_plot, gp->layer->GetName()); +- mpPrintout *plotPrintPreview = new mpPrintout(gp->m_plot, gp->layer->GetName()); ++ mpPrintout *plotPrint = new mpPrintout(gp->m_plot, gp->layer->GetName().c_str()); ++ mpPrintout *plotPrintPreview = new mpPrintout(gp->m_plot, gp->layer->GetName().c_str()); + + wxPrintPreview *preview = new wxPrintPreview(plotPrintPreview, plotPrint); + +@@ -765,7 +765,7 @@ void gpPanel::OnMenuItemSaveScreenshot(wxCommandEvent& event) + if(index!=-1) + { + wxString reso = aChoices.Item(index); +- if( reso.CompareTo(_("custom")) == 0 ){ ++ if( reso.CompareTo(_("custom").c_str()) == 0 ){ + reso = wxGetTextFromUser(_("Write image resolution (format: [width]x[height]"), _("Custom resolution for image"), _("640x480"), this); + } + if(reso.Find('x') != -1) diff --git a/ports/gppanel/CMakeLists.txt b/ports/gppanel/CMakeLists.txt new file mode 100644 index 000000000..ba3f22f7a --- /dev/null +++ b/ports/gppanel/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 3.13) +project(gpPanel CXX) + +set(wxWidgets_EXCLUDE_COMMON_LIBRARIES TRUE) +find_package(wxWidgets REQUIRED COMPONENTS core base) +include(${wxWidgets_USE_FILE}) + +file(GLOB_RECURSE SOURCES "gpPanel/*.cpp") +file(GLOB HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/include" "include/*.h") + +add_library(gpPanel STATIC ${SOURCES}) +target_compile_definitions(gpPanel PRIVATE _CRT_SECURE_NO_WARNINGS) + +target_include_directories(gpPanel PUBLIC + $ + $ +) + +target_link_libraries(gpPanel PRIVATE ${wxWidgets_LIBRARIES}) + +install(TARGETS gpPanel EXPORT gpPanel-config + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +) + +install(EXPORT gpPanel-config DESTINATION share/cmake/gpPanel) + +foreach (HEADER ${HEADERS} ) + get_filename_component(HEADER_DIR ${HEADER} DIRECTORY) + install(FILES include/${HEADER} DESTINATION include/gpPanel/${HEADER_DIR}) +endforeach() diff --git a/ports/gppanel/CONTROL b/ports/gppanel/CONTROL new file mode 100644 index 000000000..580f233d2 --- /dev/null +++ b/ports/gppanel/CONTROL @@ -0,0 +1,5 @@ +Source: gppanel +Version: 2018-04-06 +Build-Depends: wxwidgets +Homepage: https://github.com/woollybah/gppanel +Description: gpPanel is chart libary for wxWidget. It inheritance from wxPanel and use modified wxMathPlot library at chart engine. diff --git a/ports/gppanel/portfile.cmake b/ports/gppanel/portfile.cmake new file mode 100644 index 000000000..04ef9be56 --- /dev/null +++ b/ports/gppanel/portfile.cmake @@ -0,0 +1,42 @@ +include(vcpkg_common_functions) + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO woollybah/gppanel + REF 5ef9674d893bbf5e17da66841cbc6aeeef051b25 + SHA512 a52eb5c4d9065e29d84374e9c484bae14cf7ff9a80fe6b025be108942a6c4683dd7f64830f78f0f7d45971f930df68f58dadf7c3915178e8908dd220d06a1e2c + HEAD_REF master + PATCHES 00001-fix-build.patch +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_from_github( + OUT_SOURCE_PATH VCPKG_WX_FIND_SOURCE_PATH + REPO CaeruleusAqua/vcpkg-wx-find + REF 17993e942f677799b488a06ca659a8e46ff272c9 + SHA512 0fe07d3669f115c9b6a761abd7743f87e67f24d1eae3f3abee4715fa4d6b76af0d1ea3a4bd82dbdbed430ae50295e1722615ce0ee7d46182125f5048185ee153 + HEAD_REF master +) + +file(COPY ${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake DESTINATION ${VCPKG_WX_FIND_SOURCE_PATH}) +file(COPY ${CMAKE_ROOT}/Modules/FindPackageMessage.cmake DESTINATION ${VCPKG_WX_FIND_SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DCMAKE_MODULE_PATH=${VCPKG_WX_FIND_SOURCE_PATH} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/gpPanel) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/gpPanel/copyright COPYONLY) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/gpPanel) diff --git a/ports/gppanel/usage b/ports/gppanel/usage new file mode 100644 index 000000000..1ad1e6c42 --- /dev/null +++ b/ports/gppanel/usage @@ -0,0 +1,4 @@ +The package gppanel provides CMake targets: + + find_package(gpPanel CONFIG REQUIRED) + target_link_libraries(main PRIVATE gpPanel) -- cgit v1.2.3 From 32a53e1f3755960b09fc228dce23885aa7efcb8f Mon Sep 17 00:00:00 2001 From: nicole mazzuca Date: Tue, 27 Aug 2019 14:03:49 -0700 Subject: =?UTF-8?q?[vcpkg]=20fix=20bug=20in=20StringView::operator=3D=3D?= =?UTF-8?q?=20=F0=9F=98=B1=20(#7930)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this change, `lhs == rhs` missed the check for `lhs.size() == rhs.size()`, and then did a `memcmp` on the buffers up to `lhs.size()`. This means that, if `lhs.size() < rhs.size()`, it would allow two unequal strings to compare equal if, up to `lhs.size()` they are the same; and if `lhs.size() > rhs.size()`, then it would read out of bounds. --- toolsrc/src/vcpkg-test/stringview.cpp | 17 +++++++++++++++++ toolsrc/src/vcpkg/base/stringview.cpp | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 toolsrc/src/vcpkg-test/stringview.cpp diff --git a/toolsrc/src/vcpkg-test/stringview.cpp b/toolsrc/src/vcpkg-test/stringview.cpp new file mode 100644 index 000000000..4df8e6be5 --- /dev/null +++ b/toolsrc/src/vcpkg-test/stringview.cpp @@ -0,0 +1,17 @@ +#include + +#include + +template +static vcpkg::StringView sv(const char (&cstr)[N]) { + return cstr; +} + +TEST_CASE("string view operator==", "[stringview]") { + // these are due to a bug in operator== + // see commit 782723959399a1a0725ac49 + REQUIRE(sv("hey") != sv("heys")); + REQUIRE(sv("heys") != sv("hey")); + REQUIRE(sv("hey") == sv("hey")); + REQUIRE(sv("hey") != sv("hex")); +} diff --git a/toolsrc/src/vcpkg/base/stringview.cpp b/toolsrc/src/vcpkg/base/stringview.cpp index 839d72ce8..6b159db48 100644 --- a/toolsrc/src/vcpkg/base/stringview.cpp +++ b/toolsrc/src/vcpkg/base/stringview.cpp @@ -78,7 +78,7 @@ namespace vcpkg bool operator==(StringView lhs, StringView rhs) noexcept { - return lhs.size() == lhs.size() && memcmp(lhs.data(), rhs.data(), lhs.size()) == 0; + return lhs.size() == rhs.size() && memcmp(lhs.data(), rhs.data(), lhs.size()) == 0; } bool operator!=(StringView lhs, StringView rhs) noexcept { return !(lhs == rhs); } -- cgit v1.2.3 From 6f7ef0f142a86c3cc99d59aab090b05bd18ae156 Mon Sep 17 00:00:00 2001 From: Jonathan Hale Date: Tue, 27 Aug 2019 23:07:28 +0200 Subject: magnum: Fix KHR/khrplatform.h not found on vcpkg in VS (#7926) Signed-off-by: Squareys --- ports/magnum/004-khrplatform-include.patch | 13 +++++++++++++ ports/magnum/portfile.cmake | 1 + 2 files changed, 14 insertions(+) create mode 100644 ports/magnum/004-khrplatform-include.patch diff --git a/ports/magnum/004-khrplatform-include.patch b/ports/magnum/004-khrplatform-include.patch new file mode 100644 index 000000000..04d21e0ef --- /dev/null +++ b/ports/magnum/004-khrplatform-include.patch @@ -0,0 +1,13 @@ +diff --git a/src/MagnumExternal/OpenGL/GL/flextGL.h b/src/MagnumExternal/OpenGL/GL/flextGL.h +index 7d36f26e3..69cc8c82f 100644 +--- a/src/MagnumExternal/OpenGL/GL/flextGL.h ++++ b/src/MagnumExternal/OpenGL/GL/flextGL.h +@@ -118,7 +118,7 @@ void flextGLInit(Magnum::GL::Context& context); + + /* Data types */ + +-#include ++#include "MagnumExternal/OpenGL/KHR/khrplatform.h" + typedef unsigned int GLenum; + typedef unsigned char GLboolean; + typedef unsigned int GLbitfield; diff --git a/ports/magnum/portfile.cmake b/ports/magnum/portfile.cmake index 9b8d3b424..29d8ea733 100644 --- a/ports/magnum/portfile.cmake +++ b/ports/magnum/portfile.cmake @@ -13,6 +13,7 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/001-sdl-includes.patch ${CMAKE_CURRENT_LIST_DIR}/002-tools-path.patch ${CMAKE_CURRENT_LIST_DIR}/003-glfw-find-module.patch + ${CMAKE_CURRENT_LIST_DIR}/004-khrplatform-include.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) -- cgit v1.2.3 From 3b2bd689ed7975214219b433b7564375a01e3720 Mon Sep 17 00:00:00 2001 From: JackBoosY <47264268+JackBoosY@users.noreply.github.com> Date: Wed, 28 Aug 2019 05:09:02 +0800 Subject: [opencv3]Add feature option ${FEATURE_OPTIONS} to vcpkg_configure_cmake. (#7925) --- ports/opencv3/CONTROL | 2 +- ports/opencv3/portfile.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/opencv3/CONTROL b/ports/opencv3/CONTROL index d564e24a8..16776381d 100644 --- a/ports/opencv3/CONTROL +++ b/ports/opencv3/CONTROL @@ -1,5 +1,5 @@ Source: opencv3 -Version: 3.4.7 +Version: 3.4.7-1 Build-Depends: protobuf, zlib Homepage: https://github.com/opencv/opencv Description: computer vision library diff --git a/ports/opencv3/portfile.cmake b/ports/opencv3/portfile.cmake index f7ef27973..9f1e4788d 100644 --- a/ports/opencv3/portfile.cmake +++ b/ports/opencv3/portfile.cmake @@ -204,7 +204,7 @@ endif() vcpkg_configure_cmake( PREFER_NINJA SOURCE_PATH ${SOURCE_PATH} - OPTIONS + OPTIONS ${FEATURE_OPTIONS} ###### ocv_options -DOpenCV_INSTALL_BINARIES_PREFIX= -DOPENCV_LIB_INSTALL_PATH=lib -- cgit v1.2.3 From 8cf2067e571a070d6847c2bddb5d0f0a55934609 Mon Sep 17 00:00:00 2001 From: Ehsan Date: Wed, 28 Aug 2019 01:39:47 +0430 Subject: [liblsl] Update library to 1.13.0-b11 (#7906) * [liblsl] Update library to 1.13.0-b11 * Remove additional comments * Change version in vcpkg_configure_cmake --- ports/liblsl/CONTROL | 2 +- ports/liblsl/fix-install.patch | 13 +++++++++++++ ports/liblsl/portfile.cmake | 11 +++++++---- 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 ports/liblsl/fix-install.patch diff --git a/ports/liblsl/CONTROL b/ports/liblsl/CONTROL index 995b9fbd6..924dd3236 100644 --- a/ports/liblsl/CONTROL +++ b/ports/liblsl/CONTROL @@ -1,3 +1,3 @@ Source: liblsl -Version: 1.13.0-b6 +Version: 1.13.0-b11-1 Description: C++ lsl library for multi-modal time-synched data transmission over the local network diff --git a/ports/liblsl/fix-install.patch b/ports/liblsl/fix-install.patch new file mode 100644 index 000000000..66bfe0b18 --- /dev/null +++ b/ports/liblsl/fix-install.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6f2b0ff..c22360f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -184,7 +184,7 @@ else() + set(LSLPREFIX "LSL/") + endif() + +-add_executable(lslver testing/lslver.c) ++add_library(lslver STATIC testing/lslver.c) + target_link_libraries(lslver PRIVATE lsl) + + install(TARGETS lsl lslver diff --git a/ports/liblsl/portfile.cmake b/ports/liblsl/portfile.cmake index 1b6890a14..8009f37de 100644 --- a/ports/liblsl/portfile.cmake +++ b/ports/liblsl/portfile.cmake @@ -1,13 +1,15 @@ include(vcpkg_common_functions) -vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) +set(VCPKG_LIBRARY_LINKAGE dynamic) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO sccn/liblsl - REF 1.13.0-b6 # NOTE: when updating version, also change it in the parameter to vcpkg_configure_cmake - SHA512 fb98cdd73de5f13e97f639ba3f2f836d46ce28cdcb2246584728f296eb647e2c9c069534470a603b10d7dc34ab8978bf246e2187428ab231a925feb0b7024c89 + REF 1.13.0-b11 # NOTE: when updating version, also change it in the parameter to vcpkg_configure_cmake + SHA512 212f28070b8239dc176d2e35bf4091896babbf7688e4cbe1c2bb0c3788f317ce2a80f92d4b008c6e577b01a09e8faf65228d396ff13e9ade0c1ffdc5e08cb9e5 HEAD_REF master + PATCHES + fix-install.patch ) vcpkg_configure_cmake( @@ -17,7 +19,7 @@ vcpkg_configure_cmake( -DLSL_BUILD_STATIC=OFF -DLSL_UNIXFOLDERS=ON -DLSL_NO_FANCY_LIBNAME=ON - -Dlslgitrevision="1.13.0-b6" + -Dlslgitrevision="1.13.0-b11" -Dlslgitbranch="master" ) @@ -26,5 +28,6 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblsl RENAME copyright) file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblsl) -- cgit v1.2.3 From 34c65d521d83112bec4fc12bcc5768204ebac974 Mon Sep 17 00:00:00 2001 From: JackBoosY <47264268+JackBoosY@users.noreply.github.com> Date: Wed, 28 Aug 2019 05:23:02 +0800 Subject: [poco]Fix conflicts with libharu. (#7892) --- ports/poco/CONTROL | 6 +++++- ports/poco/portfile.cmake | 11 +++++++---- ports/poco/unbundled_pdf.patch | 30 ------------------------------ ports/poco/use-vcpkg-libharu.patch | 18 ++++++++++++++++++ 4 files changed, 30 insertions(+), 35 deletions(-) delete mode 100644 ports/poco/unbundled_pdf.patch create mode 100644 ports/poco/use-vcpkg-libharu.patch diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL index e7e1656bb..9ea94f496 100644 --- a/ports/poco/CONTROL +++ b/ports/poco/CONTROL @@ -1,5 +1,5 @@ Source: poco -Version: 1.9.2 +Version: 1.9.2-1 Build-Depends: expat, libpq, pcre, sqlite3, zlib, libpng Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. Homepage: https://github.com/pocoproject/poco @@ -15,3 +15,7 @@ Description: MariaDB support for POCO Feature: postgresql Build-Depends: libpqxx Description: PostgreSQL support for POCO + +Feature: pdf +Build-Depends: libharu +Description: Haru support for POCO diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index 6d53a0048..518106030 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -13,8 +13,8 @@ vcpkg_from_github( include_pcre.patch # Fix embedded copy of pcre in static linking mode static_pcre.patch - # Fix source path of PDF - unbundled_pdf.patch + # Use vcpkg installed libharu for feature pdf + use-vcpkg-libharu.patch # Add the support of arm64-windows arm64_pcre.patch fix_foundation_link.patch @@ -24,6 +24,10 @@ vcpkg_from_github( string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" POCO_STATIC) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" POCO_MT) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + pdf ENABLE_PDF +) + # MySQL / MariaDDB feature if("mysql" IN_LIST FEATURES OR "mariadb" IN_LIST FEATURES) if("mysql" IN_LIST FEATURES) @@ -43,7 +47,7 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} #PREFER_NINJA - OPTIONS + OPTIONS ${FEATURE_OPTIONS} # Set to OFF|ON (default is OFF) to control linking dependencies as external -DPOCO_UNBUNDLED=ON # Define linking feature @@ -63,7 +67,6 @@ vcpkg_configure_cmake( -DENABLE_MONGODB=ON # -DPOCO_ENABLE_SQL_SQLITE=ON # SQLITE are not supported. -DENABLE_REDIS=ON - -DENABLE_PDF=ON -DENABLE_UTIL=ON -DENABLE_NET=ON -DENABLE_SEVENZIP=ON diff --git a/ports/poco/unbundled_pdf.patch b/ports/poco/unbundled_pdf.patch deleted file mode 100644 index e7f88f035..000000000 --- a/ports/poco/unbundled_pdf.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/PDF/CMakeLists.txt b/PDF/CMakeLists.txt -index 3e44906..ae8fe6e 100644 ---- a/PDF/CMakeLists.txt -+++ b/PDF/CMakeLists.txt -@@ -97,6 +97,8 @@ POCO_SOURCES(SRCS hpdf - - # TODO: Currently only bundled is supported, in future this should also be possible - # with an unbundled version of libpng -+find_package(PNG REQUIRED) -+if (0) - POCO_SOURCES( SRCS libpng - src/png.c - src/pngerror.c -@@ -117,6 +119,7 @@ POCO_SOURCES( SRCS libpng - src/pngwtran.c - src/pngwutil.c - ) -+endif(0) - - # Version Resource - if(MSVC AND NOT POCO_STATIC) -@@ -136,7 +139,7 @@ set_target_properties( "${LIBNAME}" - DEFINE_SYMBOL PDF_EXPORTS - ) - --target_link_libraries( "${LIBNAME}" ${SYSLIBS} XML Util Foundation ) -+target_link_libraries( "${LIBNAME}" ${SYSLIBS} XML Util Foundation ${PNG_LIBRARIES}) - target_include_directories( "${LIBNAME}" - PUBLIC - $ diff --git a/ports/poco/use-vcpkg-libharu.patch b/ports/poco/use-vcpkg-libharu.patch new file mode 100644 index 000000000..e43b3c9cd --- /dev/null +++ b/ports/poco/use-vcpkg-libharu.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5f8a2a6..1ffd0a0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -195,8 +195,11 @@ if(EXISTS ${PROJECT_SOURCE_DIR}/Redis AND ENABLE_REDIS) + add_subdirectory(Redis) + list(APPEND Poco_COMPONENTS "Redis") + endif() +-if(EXISTS ${PROJECT_SOURCE_DIR}/PDF AND ENABLE_PDF) +-add_subdirectory(PDF) ++if(ENABLE_PDF) ++include(SelectLibraryConfigurations) ++find_library(PocoPDF_LIBRARY_RELEASE NAMES libhpdf) ++find_library(PocoPDF_LIBRARY_DEBUG NAMES libhpdfd) ++select_library_configurations(PocoPDF) + list(APPEND Poco_COMPONENTS "PDF") + endif() + -- cgit v1.2.3 From 55063d6405cb36d42b2bb76a1d7c09dbf65069fb Mon Sep 17 00:00:00 2001 From: Phoebe <925731795@qq.com> Date: Wed, 28 Aug 2019 05:26:31 +0800 Subject: [libguarded] Add new port (#7924) --- ports/libguarded/CONTROL | 4 ++++ ports/libguarded/portfile.cmake | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 ports/libguarded/CONTROL create mode 100644 ports/libguarded/portfile.cmake diff --git a/ports/libguarded/CONTROL b/ports/libguarded/CONTROL new file mode 100644 index 000000000..c37866406 --- /dev/null +++ b/ports/libguarded/CONTROL @@ -0,0 +1,4 @@ +Source: libguarded +Version: 2019-08-27 +Homepage: https://github.com/copperspice/libguarded +Description: The libGuarded library is a standalone header-only library for multithreaded programming. \ No newline at end of file diff --git a/ports/libguarded/portfile.cmake b/ports/libguarded/portfile.cmake new file mode 100644 index 000000000..d195774c3 --- /dev/null +++ b/ports/libguarded/portfile.cmake @@ -0,0 +1,15 @@ +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO copperspice/libguarded + REF 1f159aa866a50f5d2952de41d8a99821b8ec37df + SHA512 3ff138719b895a9c45492aee0a30e9f9eff2c3b3510de01dad59123fac6bdc1c7479518f5a81a61e4d25c0f9679b21b5018953d99809f52aafa7729599a3282a + HEAD_REF master +) + +File(COPY ${SOURCE_PATH}/src/libguarded DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) + -- cgit v1.2.3 From e64f2a493ac96b649487d387c6e2af7d9f95efe7 Mon Sep 17 00:00:00 2001 From: JackBoosY <47264268+JackBoosY@users.noreply.github.com> Date: Wed, 28 Aug 2019 05:47:32 +0800 Subject: [yaml-cpp]Fix include path in yaml-cpp-config.cmake (#7847) * [yaml-cpp]Fix include path in yaml-cpp-config.cmake * [yaml-cpp]Remove useless code. --- ports/yaml-cpp/0002-fix-include-path.patch | 13 +++++++++++++ ports/yaml-cpp/CONTROL | 2 +- ports/yaml-cpp/portfile.cmake | 29 ++--------------------------- 3 files changed, 16 insertions(+), 28 deletions(-) create mode 100644 ports/yaml-cpp/0002-fix-include-path.patch diff --git a/ports/yaml-cpp/0002-fix-include-path.patch b/ports/yaml-cpp/0002-fix-include-path.patch new file mode 100644 index 000000000..78c260831 --- /dev/null +++ b/ports/yaml-cpp/0002-fix-include-path.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d2d8810..c4d4be1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -326,7 +326,7 @@ else() + set(INSTALL_CMAKE_DIR ${LIB_INSTALL_DIR}/cmake/yaml-cpp) + endif() + +-file(RELATIVE_PATH REL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_ROOT_DIR}") ++set(REL_INCLUDE_DIR "../../include") + set(CONFIG_INCLUDE_DIRS "\${YAML_CPP_CMAKE_DIR}/${REL_INCLUDE_DIR}") + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config.cmake.in + "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/yaml-cpp-config.cmake" @ONLY) diff --git a/ports/yaml-cpp/CONTROL b/ports/yaml-cpp/CONTROL index 93988ece9..1e0a781e2 100644 --- a/ports/yaml-cpp/CONTROL +++ b/ports/yaml-cpp/CONTROL @@ -1,4 +1,4 @@ Source: yaml-cpp -Version: 0.6.2-2 +Version: 0.6.2-3 Homepage: https://github.com/jbeder/yaml-cpp Description: yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec. diff --git a/ports/yaml-cpp/portfile.cmake b/ports/yaml-cpp/portfile.cmake index 6233bc076..ff2892bde 100644 --- a/ports/yaml-cpp/portfile.cmake +++ b/ports/yaml-cpp/portfile.cmake @@ -6,7 +6,8 @@ vcpkg_from_github( SHA512 fea8ce0a20a00cbc75023d1db442edfcd32d0ac57a3c41b32ec8d56f87cc1d85d7dd7a923ce662f5d3a315f91a736d6be0d649997acd190915c1d68cc93795e4 HEAD_REF master PATCHES - ${CMAKE_CURRENT_LIST_DIR}/0001-noexcept.patch + 0001-noexcept.patch + 0002-fix-include-path.patch ) vcpkg_configure_cmake( @@ -26,32 +27,6 @@ if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake/yaml-cpp) vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/yaml-cpp) endif() -# Adjust paths and remove hardcoded ones from the config files -file(READ ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/yaml-cpp-config.cmake YAML_CONFIG) -string(REPLACE "set(YAML_CPP_INCLUDE_DIR \"\${YAML_CPP_CMAKE_DIR}/../include\")" - "set(YAML_CPP_INCLUDE_DIR \"\${YAML_CPP_CMAKE_DIR}/../../include\")" YAML_CONFIG "${YAML_CONFIG}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/yaml-cpp-config.cmake "${YAML_CONFIG}") - -file(READ ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/yaml-cpp-targets.cmake YAML_CONFIG) -string(REPLACE "set(_IMPORT_PREFIX \"${CURRENT_PACKAGES_DIR}\")" -"get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH) -get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH) -get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" YAML_CONFIG "${YAML_CONFIG}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/yaml-cpp-targets.cmake "${YAML_CONFIG}") - -set(_targets_cmake_conf) -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - list(APPEND _targets_cmake_conf "debug") -endif() -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - list(APPEND _targets_cmake_conf "release") -endif() -foreach(CONF ${_targets_cmake_conf}) - file(READ ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/yaml-cpp-targets-${CONF}.cmake YAML_CONFIG) - string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${_IMPORT_PREFIX}" YAML_CONFIG "${YAML_CONFIG}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/yaml-cpp-targets-${CONF}.cmake "${YAML_CONFIG}") -endforeach() - # Remove debug include files file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -- cgit v1.2.3 From ef30526658b3b95111f9244b07ca07344960fdbb Mon Sep 17 00:00:00 2001 From: driver1998 Date: Wed, 28 Aug 2019 05:48:58 +0800 Subject: [fluidsynth] add Windows ARM support (#7837) * [fluidsynth] add Windows ARM support * [fluidysnth] use target architecture instead of triplet --- ports/fluidsynth/CONTROL | 4 ++-- ports/fluidsynth/force-x86-gentables.patch | 34 ++++++++++++++++++++++++++++++ ports/fluidsynth/portfile.cmake | 3 ++- 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 ports/fluidsynth/force-x86-gentables.patch diff --git a/ports/fluidsynth/CONTROL b/ports/fluidsynth/CONTROL index fc79995bc..4532fa60e 100644 --- a/ports/fluidsynth/CONTROL +++ b/ports/fluidsynth/CONTROL @@ -1,4 +1,4 @@ Source: fluidsynth -Version: 2.0.5 +Version: 2.0.5-1 Description: FluidSynth reads and handles MIDI events from the MIDI input device. It is the software analogue of a MIDI synthesizer. FluidSynth can also play midifiles using a Soundfont. -Build-Depends: glib \ No newline at end of file +Build-Depends: glib diff --git a/ports/fluidsynth/force-x86-gentables.patch b/ports/fluidsynth/force-x86-gentables.patch new file mode 100644 index 000000000..d477ebd36 --- /dev/null +++ b/ports/fluidsynth/force-x86-gentables.patch @@ -0,0 +1,34 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index f731632..226f408 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -368,10 +368,23 @@ endif ( MACOSX_FRAMEWORK ) + # ******* Auto Generated Lookup Tables ****** + + include(ExternalProject) +-ExternalProject_Add(gentables +- DOWNLOAD_COMMAND "" +- SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gentables +- BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gentables +- INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gentables/make_tables.exe "${CMAKE_BINARY_DIR}/" +-) ++if(VCPKG_TARGET_ARCHITECTURE STREQUAL arm OR VCPKG_TARGET_ARCHITECTURE STREQUAL arm64) ++ ExternalProject_Add(gentables ++ DOWNLOAD_COMMAND "" ++ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gentables ++ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gentables ++ CONFIGURE_COMMAND ++ "${CMAKE_COMMAND}" "${CMAKE_CURRENT_SOURCE_DIR}/gentables" -G "${CMAKE_GENERATOR}" -A Win32 -B "${CMAKE_CURRENT_BINARY_DIR}/gentables" ++ BUILD_COMMAND ++ "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}/gentables" ++ INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gentables/make_tables.exe "${CMAKE_BINARY_DIR}/" ++ ) ++else() ++ ExternalProject_Add(gentables ++ DOWNLOAD_COMMAND "" ++ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gentables ++ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gentables ++ INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gentables/make_tables.exe "${CMAKE_BINARY_DIR}/" ++ ) ++endif() + add_dependencies(libfluidsynth-OBJ gentables) diff --git a/ports/fluidsynth/portfile.cmake b/ports/fluidsynth/portfile.cmake index 5060faa8e..3427180a3 100644 --- a/ports/fluidsynth/portfile.cmake +++ b/ports/fluidsynth/portfile.cmake @@ -7,11 +7,12 @@ vcpkg_from_github( REF v2.0.5 SHA512 5344ac889d2927dc2465bae40096d756a9bf9b1100e287ba0621c55ffc76f9cb8fa763f6bc832d701cd0ad2997965cf344f58ae4b3dd445eb3491e3659c093d9 HEAD_REF master + PATCHES + force-x86-gentables.patch ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS -Denable-pkgconfig=0 ) -- cgit v1.2.3 From 24049959f2428f27c41dd08848f92c9775a8b77e Mon Sep 17 00:00:00 2001 From: JackBoosY <47264268+JackBoosY@users.noreply.github.com> Date: Wed, 28 Aug 2019 05:50:15 +0800 Subject: [nmap]Fix build error. (#7811) * [nmap]Fix build error. * [nmap]Use msvc project to build. * [nmap]Re-fix ssize_t and fix linux build. * [nmap]Delete useless file. --- ports/nmap/CONTROL | 4 +- ports/nmap/build.sh | 24 - ports/nmap/detect-crypto-library.patch | 75 -- ports/nmap/fix-msvc-prj.patch | 1986 ++++++++++++++++++++++++++++++++ ports/nmap/fix-snprintf.patch | 39 + ports/nmap/fix-ssize_t.patch | 16 + ports/nmap/portfile.cmake | 219 ++-- 7 files changed, 2144 insertions(+), 219 deletions(-) delete mode 100644 ports/nmap/build.sh delete mode 100644 ports/nmap/detect-crypto-library.patch create mode 100644 ports/nmap/fix-msvc-prj.patch create mode 100644 ports/nmap/fix-snprintf.patch create mode 100644 ports/nmap/fix-ssize_t.patch diff --git a/ports/nmap/CONTROL b/ports/nmap/CONTROL index 8dcace63e..3ce86d4a9 100644 --- a/ports/nmap/CONTROL +++ b/ports/nmap/CONTROL @@ -1,4 +1,4 @@ Source: nmap -Version: 7.70 -Build-Depends: winpcap, lua, openssl, python2, libssh2 +Version: 7.70-1 +Build-Depends: winpcap (windows), libpcap (!windows), lua, openssl, python2 (windows), libssh2, zlib, pcre Description: A library for scanning network ports. diff --git a/ports/nmap/build.sh b/ports/nmap/build.sh deleted file mode 100644 index f4e5d4b29..000000000 --- a/ports/nmap/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/bash -set -e -export PATH=/usr/bin:$PATH -# Export HTTP(S)_PROXY as http(s)_proxy: -if [ "$HTTP_PROXY" ]; then - export http_proxy=$HTTP_PROXY -fi -if [ "$HTTPS_PROXY" ]; then - export https_proxy=$HTTPS_PROXY -fi - -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 ===" -echo "building nmap package $PATH_TO_SRC_DIR" -"$PATH_TO_SRC_DIR/configure" CC=cl.exe LD=link.exe CXX=lc.exe "--prefix=$PATH_TO_PACKAGE_DIR" $4 -echo "=== BUILDING ===" -make -j6 -echo "=== INSTALLING ===" -make install diff --git a/ports/nmap/detect-crypto-library.patch b/ports/nmap/detect-crypto-library.patch deleted file mode 100644 index 243735b9e..000000000 --- a/ports/nmap/detect-crypto-library.patch +++ /dev/null @@ -1,75 +0,0 @@ ---- a/configure 2017-11-01 23:55:49.000000000 +0100 -+++ b/configure 2019-03-05 03:35:21.753268300 +0100 -@@ -5989,13 +5989,13 @@ - - # use_openssl="yes" given explicitly in next 2 rules to avoid adding lib to $LIBS - if test "$use_openssl" = "yes"; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BIO_int_ctrl in -lcrypto" >&5 --$as_echo_n "checking for BIO_int_ctrl in -lcrypto... " >&6; } -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BIO_int_ctrl in -llibeay32" >&5 -+$as_echo_n "checking for BIO_int_ctrl in -llibeay32... " >&6; } - if ${ac_cv_lib_crypto_BIO_int_ctrl+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lcrypto $LIBS" -+LIBS="-llibeay32 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -6030,23 +6030,23 @@ - else - use_openssl="no" - if test "$with_openssl" = "yes"; then -- as_fn_error $? "OpenSSL was explicitly requested but libcrypto was not found. Try the --with-openssl=DIR argument to give the location of OpenSSL or run configure with --without-openssl." "$LINENO" 5 -+ as_fn_error $? "OpenSSL was explicitly requested but libeay32 was not found. Try the --with-openssl=DIR argument to give the location of OpenSSL or run configure with --without-openssl." "$LINENO" 5 - fi -- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed to find libcrypto so OpenSSL will not be used. If it is installed you can try the --with-openssl=DIR argument" >&5 --$as_echo "$as_me: WARNING: Failed to find libcrypto so OpenSSL will not be used. If it is installed you can try the --with-openssl=DIR argument" >&2;} -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed to find libeay32 so OpenSSL will not be used. If it is installed you can try the --with-openssl=DIR argument" >&5 -+$as_echo "$as_me: WARNING: Failed to find libeay32 so OpenSSL will not be used. If it is installed you can try the --with-openssl=DIR argument" >&2;} - - fi - - fi - - if test "$use_openssl" = "yes"; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl" >&5 --$as_echo_n "checking for SSL_new in -lssl... " >&6; } -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssleay32" >&5 -+$as_echo_n "checking for SSL_new in -lssleay32... " >&6; } - if ${ac_cv_lib_ssl_SSL_new+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lssl -lcrypto $LIBS" -+LIBS="-lssleay32 -llibeay32 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -6090,13 +6090,13 @@ - fi - - if test "$use_openssl" = "yes"; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_PKEY_get1_EC_KEY in -lcrypto" >&5 --$as_echo_n "checking for EVP_PKEY_get1_EC_KEY in -lcrypto... " >&6; } -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_PKEY_get1_EC_KEY in -llibeay32" >&5 -+$as_echo_n "checking for EVP_PKEY_get1_EC_KEY in -llibeay32... " >&6; } - if ${ac_cv_lib_crypto_EVP_PKEY_get1_EC_KEY+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lcrypto $LIBS" -+LIBS="-llibeay32 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -6144,7 +6144,7 @@ - - $as_echo "#define HAVE_OPENSSL 1" >>confdefs.h - -- OPENSSL_LIBS="-lssl -lcrypto" -+ OPENSSL_LIBS="-lssleay32 -llibeay32" - else - trace_no_use="$trace_no_use openssl" - fi diff --git a/ports/nmap/fix-msvc-prj.patch b/ports/nmap/fix-msvc-prj.patch new file mode 100644 index 000000000..cfb9d52ff --- /dev/null +++ b/ports/nmap/fix-msvc-prj.patch @@ -0,0 +1,1986 @@ +diff --git a/libdnet-stripped/libdnet-stripped.vcxproj b/libdnet-stripped/libdnet-stripped.vcxproj +index 1f2b760..1756c5c 100644 +--- a/libdnet-stripped/libdnet-stripped.vcxproj ++++ b/libdnet-stripped/libdnet-stripped.vcxproj +@@ -5,10 +5,18 @@ + Debug + Win32 + ++ ++ Debug ++ x64 ++ + + Release + Win32 + ++ ++ Release ++ x64 ++ + + + libdnet-stripped +@@ -22,11 +30,21 @@ + MultiByte + v120 + ++ ++ StaticLibrary ++ MultiByte ++ v120 ++ + + StaticLibrary + MultiByte + v120 + ++ ++ StaticLibrary ++ MultiByte ++ v120 ++ + + + +@@ -34,10 +52,18 @@ + + + ++ ++ ++ ++ + + + + ++ ++ ++ ++ + + + <_ProjectFileVersion>10.0.30319.1 +@@ -64,6 +90,23 @@ + $(OutDir)libdnet-stripped.lib + + ++ ++ ++ /D "_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions) ++ Disabled ++ include;..\mswin32\pcap-include;%(AdditionalIncludeDirectories) ++ WIN32;_LIB;BPF_MAJOR_VERSION;%(PreprocessorDefinitions) ++ EnableFastChecks ++ MultiThreadedDebugDLL ++ ++ ++ Level3 ++ ProgramDatabase ++ ++ ++ $(OutDir)libdnet-stripped.lib ++ ++ + + + /D "_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions) +@@ -78,6 +121,20 @@ + $(OutDir)libdnet-stripped.lib + + ++ ++ ++ /D "_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions) ++ include;..\mswin32\pcap-include;%(AdditionalIncludeDirectories) ++ WIN32;_LIB;BPF_MAJOR_VERSION;%(PreprocessorDefinitions) ++ ++ ++ Level3 ++ ProgramDatabase ++ ++ ++ $(OutDir)libdnet-stripped.lib ++ ++ + + + +diff --git a/liblinear/liblinear.vcxproj b/liblinear/liblinear.vcxproj +index cf99e3d..ac5ff7c 100644 +--- a/liblinear/liblinear.vcxproj ++++ b/liblinear/liblinear.vcxproj +@@ -5,10 +5,18 @@ + Debug + Win32 + ++ ++ Debug ++ x64 ++ + + Release + Win32 + ++ ++ Release ++ x64 ++ + + + +@@ -36,6 +44,12 @@ + Unicode + v120 + ++ ++ StaticLibrary ++ true ++ Unicode ++ v120 ++ + + StaticLibrary + false +@@ -43,19 +57,33 @@ + Unicode + v120 + ++ ++ StaticLibrary ++ false ++ true ++ Unicode ++ v120 ++ + + + + + + ++ ++ ++ + + + ++ ++ ++ + + + .\ + ++ + + .\ + +@@ -75,6 +103,21 @@ + true + + ++ ++ ++ ++ ++ Level3 ++ Disabled ++ WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) ++ MultiThreadedDebugDLL ++ /D_CRT_SECURE_NO_WARNINGS=1 %(AdditionalOptions) ++ ++ ++ Windows ++ true ++ ++ + + + Level3 +@@ -93,6 +136,24 @@ + true + + ++ ++ ++ Level3 ++ ++ ++ MaxSpeed ++ true ++ true ++ WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) ++ /D_CRT_SECURE_NO_WARNINGS=1 %(AdditionalOptions) ++ ++ ++ Windows ++ true ++ true ++ true ++ ++ + + + +diff --git a/liblua/liblua.vcxproj b/liblua/liblua.vcxproj +index 8e80221..db6b1ea 100644 +--- a/liblua/liblua.vcxproj ++++ b/liblua/liblua.vcxproj +@@ -5,10 +5,18 @@ + Debug + Win32 + ++ ++ Debug ++ x64 ++ + + Release + Win32 + ++ ++ Release ++ x64 ++ + + + {31FB0767-A71F-4575-8379-002D72B8AF86} +@@ -22,20 +30,37 @@ + true + v120 + ++ ++ StaticLibrary ++ NotSet ++ true ++ v120 ++ + + StaticLibrary + NotSet + v120 + ++ ++ StaticLibrary ++ NotSet ++ v120 ++ + + + + + + ++ ++ ++ + + + ++ ++ ++ + + + <_ProjectFileVersion>10.0.30319.1 +@@ -68,6 +93,29 @@ + $(OutDir)liblua.lib + + ++ ++ ++ /D "_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions) ++ Disabled ++ WIN32;_LIB;%(PreprocessorDefinitions) ++ ++ ++ Default ++ MultiThreadedDebugDLL ++ false ++ false ++ false ++ ++ ++ Level3 ++ ProgramDatabase ++ Cdecl ++ CompileAsC ++ ++ ++ $(OutDir)liblua.lib ++ ++ + + + /D "_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions) +@@ -91,6 +139,29 @@ + $(OutDir)liblua.lib + + ++ ++ ++ /D "_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions) ++ false ++ WIN32;_LIB;%(PreprocessorDefinitions) ++ false ++ ++ ++ Default ++ false ++ false ++ false ++ ++ ++ Level3 ++ ++ ++ CompileAsC ++ ++ ++ $(OutDir)liblua.lib ++ ++ + + + +diff --git a/libnetutil/libnetutil.vcxproj b/libnetutil/libnetutil.vcxproj +index 8f4fbb5..00cc7c2 100644 +--- a/libnetutil/libnetutil.vcxproj ++++ b/libnetutil/libnetutil.vcxproj +@@ -5,10 +5,18 @@ + Debug + Win32 + ++ ++ Debug ++ x64 ++ + + Release + Win32 + ++ ++ Release ++ x64 ++ + + + {99157C3F-39F6-4663-99D7-1D9C1484494E} +@@ -22,20 +30,37 @@ + true + v120 + ++ ++ StaticLibrary ++ Unicode ++ true ++ v120 ++ + + StaticLibrary + Unicode + v120 + ++ ++ StaticLibrary ++ Unicode ++ v120 ++ + + + + + + ++ ++ ++ + + + ++ ++ ++ + + + <_ProjectFileVersion>10.0.30319.1 +@@ -61,6 +86,22 @@ + $(OutDir)libnetutil.lib + + ++ ++ ++ Disabled ++ ..;../mswin32;../nbase;../mswin32/pcap-include;../libdnet-stripped/include;%(AdditionalIncludeDirectories) ++ WIN32;BPF_MAJOR_VERSION;_DEBUG;_LIB;%(PreprocessorDefinitions) ++ EnableFastChecks ++ MultiThreadedDebugDLL ++ ++ ++ Level3 ++ ProgramDatabase ++ ++ ++ $(OutDir)libnetutil.lib ++ ++ + + + MaxSpeed +@@ -74,6 +115,19 @@ + ProgramDatabase + + ++ ++ ++ MaxSpeed ++ true ++ ..;../mswin32;../nbase;../mswin32/pcap-include;../libdnet-stripped/include;%(AdditionalIncludeDirectories) ++ WIN32;BPF_MAJOR_VERSION;NDEBUG;_LIB;%(PreprocessorDefinitions) ++ true ++ ++ ++ Level3 ++ ProgramDatabase ++ ++ + + + +diff --git a/mswin32/nmap.sln b/mswin32/nmap.sln +index 3f9fa22..4484bbd 100644 +--- a/mswin32/nmap.sln ++++ b/mswin32/nmap.sln +@@ -5,14 +5,11 @@ MinimumVisualStudioVersion = 10.0.40219.1 + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nmap", "nmap.vcxproj", "{361719F0-AB42-4C93-9DE8-7D2144B96625}" + ProjectSection(ProjectDependencies) = postProject + {99157C3F-39F6-4663-99D7-1D9C1484494E} = {99157C3F-39F6-4663-99D7-1D9C1484494E} +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8} = {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8} + {A7BE3D76-F20C-40C5-8986-DE4028B3B57D} = {A7BE3D76-F20C-40C5-8986-DE4028B3B57D} + EndProjectSection + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nsock", "..\nsock\nsock.vcxproj", "{F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}" + EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpcre", "..\libpcre\libpcre.vcxproj", "{5DE86C7A-DE72-4265-8807-4CA38F94F22A}" +-EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nbase", "..\nbase\nbase.vcxproj", "{B630C8F7-3138-43E8-89ED-78742FA2AC5F}" + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdnet-stripped", "..\libdnet-stripped\libdnet-stripped.vcxproj", "{5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}" +@@ -27,14 +24,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnetutil", "..\libnetutil + EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblinear", "..\liblinear\liblinear.vcxproj", "{A7BE3D76-F20C-40C5-8986-DE4028B3B57D}" + EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nmap-update", "..\nmap-update\nmap-update.vcxproj", "{BBF27339-C7B6-4F52-B742-897796C1F13B}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libz", "..\libz\contrib\vstudio\vc11\zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libssh2", "..\libssh2\win32\libssh2.vcxproj", "{ED957342-E43B-496E-92D9-4C76B525BDF5}" +-EndProject +-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "..\libz\contrib\vstudio\vc11\zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}" +-EndProject + Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 +@@ -49,176 +38,148 @@ Global + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {361719F0-AB42-4C93-9DE8-7D2144B96625}.Debug|Win32.ActiveCfg = Debug|Win32 + {361719F0-AB42-4C93-9DE8-7D2144B96625}.Debug|Win32.Build.0 = Debug|Win32 +- {361719F0-AB42-4C93-9DE8-7D2144B96625}.Debug|x64.ActiveCfg = Debug|Win32 ++ {361719F0-AB42-4C93-9DE8-7D2144B96625}.Debug|x64.ActiveCfg = Debug|x64 ++ {361719F0-AB42-4C93-9DE8-7D2144B96625}.Debug|x64.Build.0 = Debug|x64 + {361719F0-AB42-4C93-9DE8-7D2144B96625}.Ncat Static|Win32.ActiveCfg = Release|Win32 +- {361719F0-AB42-4C93-9DE8-7D2144B96625}.Ncat Static|x64.ActiveCfg = Release|Win32 ++ {361719F0-AB42-4C93-9DE8-7D2144B96625}.Ncat Static|x64.ActiveCfg = Release|x64 ++ {361719F0-AB42-4C93-9DE8-7D2144B96625}.Ncat Static|x64.Build.0 = Release|x64 + {361719F0-AB42-4C93-9DE8-7D2144B96625}.Release|Win32.ActiveCfg = Release|Win32 + {361719F0-AB42-4C93-9DE8-7D2144B96625}.Release|Win32.Build.0 = Release|Win32 +- {361719F0-AB42-4C93-9DE8-7D2144B96625}.Release|x64.ActiveCfg = Release|Win32 ++ {361719F0-AB42-4C93-9DE8-7D2144B96625}.Release|x64.ActiveCfg = Release|x64 ++ {361719F0-AB42-4C93-9DE8-7D2144B96625}.Release|x64.Build.0 = Release|x64 + {361719F0-AB42-4C93-9DE8-7D2144B96625}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {361719F0-AB42-4C93-9DE8-7D2144B96625}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 +- {361719F0-AB42-4C93-9DE8-7D2144B96625}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 ++ {361719F0-AB42-4C93-9DE8-7D2144B96625}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 ++ {361719F0-AB42-4C93-9DE8-7D2144B96625}.ReleaseWithoutAsm|x64.Build.0 = Release|x64 + {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Debug|Win32.ActiveCfg = Debug|Win32 + {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Debug|Win32.Build.0 = Debug|Win32 +- {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Debug|x64.ActiveCfg = Debug|Win32 ++ {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Debug|x64.ActiveCfg = Debug|x64 ++ {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Debug|x64.Build.0 = Debug|x64 + {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Ncat Static|Win32.ActiveCfg = Static|Win32 + {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Ncat Static|Win32.Build.0 = Static|Win32 +- {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Ncat Static|x64.ActiveCfg = Static|Win32 ++ {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Ncat Static|x64.ActiveCfg = Static|x64 ++ {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Ncat Static|x64.Build.0 = Static|x64 + {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Release|Win32.ActiveCfg = Release|Win32 + {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Release|Win32.Build.0 = Release|Win32 +- {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Release|x64.ActiveCfg = Release|Win32 ++ {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Release|x64.ActiveCfg = Release|x64 ++ {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.Release|x64.Build.0 = Release|x64 + {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseNoPcap|Win32 + {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseNoPcap|Win32 +- {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseNoPcap|Win32 +- {5DE86C7A-DE72-4265-8807-4CA38F94F22A}.Debug|Win32.ActiveCfg = Debug|Win32 +- {5DE86C7A-DE72-4265-8807-4CA38F94F22A}.Debug|Win32.Build.0 = Debug|Win32 +- {5DE86C7A-DE72-4265-8807-4CA38F94F22A}.Debug|x64.ActiveCfg = Debug|Win32 +- {5DE86C7A-DE72-4265-8807-4CA38F94F22A}.Ncat Static|Win32.ActiveCfg = Release|Win32 +- {5DE86C7A-DE72-4265-8807-4CA38F94F22A}.Ncat Static|x64.ActiveCfg = Release|Win32 +- {5DE86C7A-DE72-4265-8807-4CA38F94F22A}.Release|Win32.ActiveCfg = Release|Win32 +- {5DE86C7A-DE72-4265-8807-4CA38F94F22A}.Release|Win32.Build.0 = Release|Win32 +- {5DE86C7A-DE72-4265-8807-4CA38F94F22A}.Release|x64.ActiveCfg = Release|Win32 +- {5DE86C7A-DE72-4265-8807-4CA38F94F22A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 +- {5DE86C7A-DE72-4265-8807-4CA38F94F22A}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 +- {5DE86C7A-DE72-4265-8807-4CA38F94F22A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 ++ {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseNoPcap|x64 ++ {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4}.ReleaseWithoutAsm|x64.Build.0 = ReleaseNoPcap|x64 + {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Debug|Win32.ActiveCfg = Debug|Win32 + {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Debug|Win32.Build.0 = Debug|Win32 +- {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Debug|x64.ActiveCfg = Debug|Win32 ++ {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Debug|x64.ActiveCfg = Debug|x64 ++ {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Debug|x64.Build.0 = Debug|x64 + {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Ncat Static|Win32.ActiveCfg = Static|Win32 + {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Ncat Static|Win32.Build.0 = Static|Win32 +- {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Ncat Static|x64.ActiveCfg = Static|Win32 ++ {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Ncat Static|x64.ActiveCfg = Static|x64 ++ {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Ncat Static|x64.Build.0 = Static|x64 + {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Release|Win32.ActiveCfg = Release|Win32 + {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Release|Win32.Build.0 = Release|Win32 +- {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Release|x64.ActiveCfg = Release|Win32 ++ {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Release|x64.ActiveCfg = Release|x64 ++ {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.Release|x64.Build.0 = Release|x64 + {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 +- {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 ++ {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 ++ {B630C8F7-3138-43E8-89ED-78742FA2AC5F}.ReleaseWithoutAsm|x64.Build.0 = Release|x64 + {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.Debug|Win32.ActiveCfg = Debug|Win32 + {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.Debug|Win32.Build.0 = Debug|Win32 +- {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.Debug|x64.ActiveCfg = Debug|Win32 ++ {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.Debug|x64.ActiveCfg = Debug|x64 ++ {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.Debug|x64.Build.0 = Debug|x64 + {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.Ncat Static|Win32.ActiveCfg = Release|Win32 +- {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.Ncat Static|x64.ActiveCfg = Release|Win32 ++ {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.Ncat Static|x64.ActiveCfg = Release|x64 ++ {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.Ncat Static|x64.Build.0 = Release|x64 + {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.Release|Win32.ActiveCfg = Release|Win32 + {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.Release|Win32.Build.0 = Release|Win32 +- {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.Release|x64.ActiveCfg = Release|Win32 ++ {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.Release|x64.ActiveCfg = Release|x64 ++ {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.Release|x64.Build.0 = Release|x64 + {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 +- {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 ++ {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 ++ {5328E0BE-BC0A-4C2A-8CB9-CE00B61B9C4C}.ReleaseWithoutAsm|x64.Build.0 = Release|x64 + {31FB0767-A71F-4575-8379-002D72B8AF86}.Debug|Win32.ActiveCfg = Debug|Win32 + {31FB0767-A71F-4575-8379-002D72B8AF86}.Debug|Win32.Build.0 = Debug|Win32 +- {31FB0767-A71F-4575-8379-002D72B8AF86}.Debug|x64.ActiveCfg = Debug|Win32 ++ {31FB0767-A71F-4575-8379-002D72B8AF86}.Debug|x64.ActiveCfg = Debug|x64 ++ {31FB0767-A71F-4575-8379-002D72B8AF86}.Debug|x64.Build.0 = Debug|x64 + {31FB0767-A71F-4575-8379-002D72B8AF86}.Ncat Static|Win32.ActiveCfg = Release|Win32 +- {31FB0767-A71F-4575-8379-002D72B8AF86}.Ncat Static|x64.ActiveCfg = Release|Win32 ++ {31FB0767-A71F-4575-8379-002D72B8AF86}.Ncat Static|x64.ActiveCfg = Release|x64 ++ {31FB0767-A71F-4575-8379-002D72B8AF86}.Ncat Static|x64.Build.0 = Release|x64 + {31FB0767-A71F-4575-8379-002D72B8AF86}.Release|Win32.ActiveCfg = Release|Win32 + {31FB0767-A71F-4575-8379-002D72B8AF86}.Release|Win32.Build.0 = Release|Win32 +- {31FB0767-A71F-4575-8379-002D72B8AF86}.Release|x64.ActiveCfg = Release|Win32 ++ {31FB0767-A71F-4575-8379-002D72B8AF86}.Release|x64.ActiveCfg = Release|x64 ++ {31FB0767-A71F-4575-8379-002D72B8AF86}.Release|x64.Build.0 = Release|x64 + {31FB0767-A71F-4575-8379-002D72B8AF86}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {31FB0767-A71F-4575-8379-002D72B8AF86}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 +- {31FB0767-A71F-4575-8379-002D72B8AF86}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 ++ {31FB0767-A71F-4575-8379-002D72B8AF86}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 ++ {31FB0767-A71F-4575-8379-002D72B8AF86}.ReleaseWithoutAsm|x64.Build.0 = Release|x64 + {C1E04411-E021-468B-83F1-CB624BBA7589}.Debug|Win32.ActiveCfg = Debug|Win32 + {C1E04411-E021-468B-83F1-CB624BBA7589}.Debug|Win32.Build.0 = Debug|Win32 +- {C1E04411-E021-468B-83F1-CB624BBA7589}.Debug|x64.ActiveCfg = Debug|Win32 ++ {C1E04411-E021-468B-83F1-CB624BBA7589}.Debug|x64.ActiveCfg = Debug|x64 ++ {C1E04411-E021-468B-83F1-CB624BBA7589}.Debug|x64.Build.0 = Debug|x64 + {C1E04411-E021-468B-83F1-CB624BBA7589}.Ncat Static|Win32.ActiveCfg = Static|Win32 + {C1E04411-E021-468B-83F1-CB624BBA7589}.Ncat Static|Win32.Build.0 = Static|Win32 +- {C1E04411-E021-468B-83F1-CB624BBA7589}.Ncat Static|x64.ActiveCfg = Static|Win32 ++ {C1E04411-E021-468B-83F1-CB624BBA7589}.Ncat Static|x64.ActiveCfg = Static|x64 ++ {C1E04411-E021-468B-83F1-CB624BBA7589}.Ncat Static|x64.Build.0 = Static|x64 + {C1E04411-E021-468B-83F1-CB624BBA7589}.Release|Win32.ActiveCfg = Release|Win32 + {C1E04411-E021-468B-83F1-CB624BBA7589}.Release|Win32.Build.0 = Release|Win32 +- {C1E04411-E021-468B-83F1-CB624BBA7589}.Release|x64.ActiveCfg = Release|Win32 ++ {C1E04411-E021-468B-83F1-CB624BBA7589}.Release|x64.ActiveCfg = Release|x64 ++ {C1E04411-E021-468B-83F1-CB624BBA7589}.Release|x64.Build.0 = Release|x64 + {C1E04411-E021-468B-83F1-CB624BBA7589}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {C1E04411-E021-468B-83F1-CB624BBA7589}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 +- {C1E04411-E021-468B-83F1-CB624BBA7589}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 ++ {C1E04411-E021-468B-83F1-CB624BBA7589}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 ++ {C1E04411-E021-468B-83F1-CB624BBA7589}.ReleaseWithoutAsm|x64.Build.0 = Release|x64 + {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Debug|Win32.ActiveCfg = Debug|Win32 + {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Debug|Win32.Build.0 = Debug|Win32 +- {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Debug|x64.ActiveCfg = Debug|Win32 ++ {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Debug|x64.ActiveCfg = Debug|x64 ++ {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Debug|x64.Build.0 = Debug|x64 + {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Ncat Static|Win32.ActiveCfg = Release|Win32 +- {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Ncat Static|x64.ActiveCfg = Release|Win32 ++ {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Ncat Static|x64.ActiveCfg = Release|x64 ++ {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Ncat Static|x64.Build.0 = Release|x64 + {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Release|Win32.ActiveCfg = Release|Win32 + {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Release|Win32.Build.0 = Release|Win32 +- {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Release|x64.ActiveCfg = Release|Win32 ++ {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Release|x64.ActiveCfg = Release|x64 ++ {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.Release|x64.Build.0 = Release|x64 + {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 +- {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 ++ {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 ++ {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36}.ReleaseWithoutAsm|x64.Build.0 = Release|x64 + {99157C3F-39F6-4663-99D7-1D9C1484494E}.Debug|Win32.ActiveCfg = Debug|Win32 + {99157C3F-39F6-4663-99D7-1D9C1484494E}.Debug|Win32.Build.0 = Debug|Win32 +- {99157C3F-39F6-4663-99D7-1D9C1484494E}.Debug|x64.ActiveCfg = Debug|Win32 ++ {99157C3F-39F6-4663-99D7-1D9C1484494E}.Debug|x64.ActiveCfg = Debug|x64 ++ {99157C3F-39F6-4663-99D7-1D9C1484494E}.Debug|x64.Build.0 = Debug|x64 + {99157C3F-39F6-4663-99D7-1D9C1484494E}.Ncat Static|Win32.ActiveCfg = Release|Win32 +- {99157C3F-39F6-4663-99D7-1D9C1484494E}.Ncat Static|x64.ActiveCfg = Release|Win32 ++ {99157C3F-39F6-4663-99D7-1D9C1484494E}.Ncat Static|x64.ActiveCfg = Release|x64 ++ {99157C3F-39F6-4663-99D7-1D9C1484494E}.Ncat Static|x64.Build.0 = Release|x64 + {99157C3F-39F6-4663-99D7-1D9C1484494E}.Release|Win32.ActiveCfg = Release|Win32 + {99157C3F-39F6-4663-99D7-1D9C1484494E}.Release|Win32.Build.0 = Release|Win32 +- {99157C3F-39F6-4663-99D7-1D9C1484494E}.Release|x64.ActiveCfg = Release|Win32 ++ {99157C3F-39F6-4663-99D7-1D9C1484494E}.Release|x64.ActiveCfg = Release|x64 ++ {99157C3F-39F6-4663-99D7-1D9C1484494E}.Release|x64.Build.0 = Release|x64 + {99157C3F-39F6-4663-99D7-1D9C1484494E}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {99157C3F-39F6-4663-99D7-1D9C1484494E}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 +- {99157C3F-39F6-4663-99D7-1D9C1484494E}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 ++ {99157C3F-39F6-4663-99D7-1D9C1484494E}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 ++ {99157C3F-39F6-4663-99D7-1D9C1484494E}.ReleaseWithoutAsm|x64.Build.0 = Release|x64 + {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Debug|Win32.ActiveCfg = Debug|Win32 + {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Debug|Win32.Build.0 = Debug|Win32 +- {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Debug|x64.ActiveCfg = Debug|Win32 ++ {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Debug|x64.ActiveCfg = Debug|x64 ++ {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Debug|x64.Build.0 = Debug|x64 + {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Ncat Static|Win32.ActiveCfg = Release|Win32 + {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Ncat Static|Win32.Build.0 = Release|Win32 +- {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Ncat Static|x64.ActiveCfg = Release|Win32 ++ {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Ncat Static|x64.ActiveCfg = Release|x64 ++ {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Ncat Static|x64.Build.0 = Release|x64 + {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Release|Win32.ActiveCfg = Release|Win32 + {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Release|Win32.Build.0 = Release|Win32 +- {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Release|x64.ActiveCfg = Release|Win32 ++ {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Release|x64.ActiveCfg = Release|x64 ++ {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.Release|x64.Build.0 = Release|x64 + {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 +- {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 +- {BBF27339-C7B6-4F52-B742-897796C1F13B}.Debug|Win32.ActiveCfg = Debug|Win32 +- {BBF27339-C7B6-4F52-B742-897796C1F13B}.Debug|Win32.Build.0 = Debug|Win32 +- {BBF27339-C7B6-4F52-B742-897796C1F13B}.Debug|x64.ActiveCfg = Debug|Win32 +- {BBF27339-C7B6-4F52-B742-897796C1F13B}.Ncat Static|Win32.ActiveCfg = Release|Win32 +- {BBF27339-C7B6-4F52-B742-897796C1F13B}.Ncat Static|Win32.Build.0 = Release|Win32 +- {BBF27339-C7B6-4F52-B742-897796C1F13B}.Ncat Static|x64.ActiveCfg = Release|Win32 +- {BBF27339-C7B6-4F52-B742-897796C1F13B}.Release|Win32.ActiveCfg = Release|Win32 +- {BBF27339-C7B6-4F52-B742-897796C1F13B}.Release|Win32.Build.0 = Release|Win32 +- {BBF27339-C7B6-4F52-B742-897796C1F13B}.Release|x64.ActiveCfg = Release|Win32 +- {BBF27339-C7B6-4F52-B742-897796C1F13B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 +- {BBF27339-C7B6-4F52-B742-897796C1F13B}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 +- {BBF27339-C7B6-4F52-B742-897796C1F13B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.ActiveCfg = Debug|Win32 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.ActiveCfg = Debug|x64 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.Build.0 = Debug|x64 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Ncat Static|Win32.ActiveCfg = Release|Win32 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Ncat Static|Win32.Build.0 = Release|Win32 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Ncat Static|x64.ActiveCfg = Release|x64 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Ncat Static|x64.Build.0 = Release|x64 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = Release|x64 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = Release|x64 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64 +- {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64 +- {ED957342-E43B-496E-92D9-4C76B525BDF5}.Debug|Win32.ActiveCfg = Debug|Win32 +- {ED957342-E43B-496E-92D9-4C76B525BDF5}.Debug|Win32.Build.0 = Debug|Win32 +- {ED957342-E43B-496E-92D9-4C76B525BDF5}.Debug|x64.ActiveCfg = Debug|Win32 +- {ED957342-E43B-496E-92D9-4C76B525BDF5}.Ncat Static|Win32.ActiveCfg = Debug|Win32 +- {ED957342-E43B-496E-92D9-4C76B525BDF5}.Ncat Static|Win32.Build.0 = Debug|Win32 +- {ED957342-E43B-496E-92D9-4C76B525BDF5}.Ncat Static|x64.ActiveCfg = Release|Win32 +- {ED957342-E43B-496E-92D9-4C76B525BDF5}.Release|Win32.ActiveCfg = Release|Win32 +- {ED957342-E43B-496E-92D9-4C76B525BDF5}.Release|Win32.Build.0 = Release|Win32 +- {ED957342-E43B-496E-92D9-4C76B525BDF5}.Release|x64.ActiveCfg = Release|Win32 +- {ED957342-E43B-496E-92D9-4C76B525BDF5}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 +- {ED957342-E43B-496E-92D9-4C76B525BDF5}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 +- {ED957342-E43B-496E-92D9-4C76B525BDF5}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Ncat Static|Win32.ActiveCfg = Release|Win32 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Ncat Static|Win32.Build.0 = Release|Win32 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Ncat Static|x64.ActiveCfg = Release|x64 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Ncat Static|x64.Build.0 = Release|x64 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64 +- {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64 ++ {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 ++ {A7BE3D76-F20C-40C5-8986-DE4028B3B57D}.ReleaseWithoutAsm|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection ++ GlobalSection(ExtensibilityGlobals) = postSolution ++ SolutionGuid = {DAA6BF7B-6F78-4BE7-A3FC-3B1BD73676C3} ++ EndGlobalSection + EndGlobal +diff --git a/mswin32/nmap.vcxproj b/mswin32/nmap.vcxproj +index a3abbc6..d5e1977 100644 +--- a/mswin32/nmap.vcxproj ++++ b/mswin32/nmap.vcxproj +@@ -5,10 +5,18 @@ + Debug + Win32 + ++ ++ Debug ++ x64 ++ + + Release + Win32 + ++ ++ Release ++ x64 ++ + + + {361719F0-AB42-4C93-9DE8-7D2144B96625} +@@ -21,12 +29,24 @@ + MultiByte + v120 + ++ ++ Application ++ false ++ MultiByte ++ v120 ++ + + Application + false + MultiByte + v120 + ++ ++ Application ++ false ++ MultiByte ++ v120 ++ + + + +@@ -34,10 +54,18 @@ + + + ++ ++ ++ ++ + + + + ++ ++ ++ ++ + + + <_ProjectFileVersion>10.0.30319.1 +@@ -76,7 +104,7 @@ + false + + +- liblua.lib;nsock.lib;libpcre.lib;nbase.lib;libdnet-stripped.lib;libssh2.lib;zlibstat.lib;liblinear.lib;ws2_32.lib;IPHlpAPI.Lib;wpcap.lib;packet.lib;advapi32.lib;libeay32.lib;ssleay32.lib;shell32.lib;libnetutil.lib ++ liblua.lib;nsock.lib;pcred.lib;nbase.lib;libdnet-stripped.lib;libssh2.lib;zlibd.lib;liblinear.lib;ws2_32.lib;IPHlpAPI.Lib;wpcap.lib;packet.lib;advapi32.lib;libeay32.lib;ssleay32.lib;shell32.lib;libnetutil.lib + .\Debug\nmap.exe + true + ..\libssh2\win32\Release_dll;lib;..\liblua;..\libpcre;..\nsock;..\nbase;..\libdnet-stripped;../libnetutil;..\..\nmap-mswin32-aux\OpenSSL\lib;..\liblinear;..\libz\contrib\vstudio\vc11\x86\ZlibStatRelease;%(AdditionalLibraryDirectories) +@@ -91,8 +119,57 @@ + MachineX86 + + +- xcopy "$(SolutionDir)..\scripts" ".\$(Configuration)\scripts\" /e /y && xcopy "$(SolutionDir)..\nselib\*.lua" "$(SolutionDir)\$(Configuration)\nselib\" /y && xcopy /s /e "$(SolutionDir)..\nselib\data\*.*" "$(SolutionDir)\$(Configuration)\nselib\data\" /y && xcopy "$(SolutionDir)\..\..\nmap-mswin32-aux\OpenSSL\bin\*.dll" "$(SolutionDir)\$(Configuration)\" /y && xcopy "$(SolutionDir)..\nse_main.lua" "$(SolutionDir)\$(Configuration)\" /y +-xcopy /y /d "$(ProjectDir)..\libssh2\win32\$(Configuration)_dll\*.dll" "$(ProjectDir)$(OutDir)" ++ xcopy "$(SolutionDir)..\scripts" ".\$(Configuration)\scripts\" /e /y && xcopy "$(SolutionDir)..\nselib\*.lua" "$(SolutionDir)\$(Configuration)\nselib\" /y && xcopy /s /e "$(SolutionDir)..\nselib\data\*.*" "$(SolutionDir)\$(Configuration)\nselib\data\" /y && xcopy "$(SolutionDir)..\nse_main.lua" "$(SolutionDir)\$(Configuration)\" /y ++ ++ ++ $(IntDir)%(Filename).res ++ ++ ++ ++ ++ .\Debug/nmap.tlb ++ ++ ++ ++ ++ Disabled ++ .;..;..\liblua;..\nbase;..\libpcre;..\nsock\include;pcap-include;..\libdnet-stripped\include;..\..\nmap-mswin32-aux\OpenSSL\include;..\liblinear;..\libssh2\include;..\libz;%(AdditionalIncludeDirectories) ++ WIN32;_CONSOLE;%(PreprocessorDefinitions) ++ ..\libssh2\include;.;..;..\liblua;..\nbase;..\libpcre;..\nsock\include;pcap-include;..\libdnet-stripped\include;..\..\nmap-mswin32-aux\OpenSSL\include;..\liblinear;%(AdditionalIncludeDirectories) ++ WIN32;_CONSOLE;BPF_MAJOR_VERSION;%(PreprocessorDefinitions) ++ false ++ false ++ false ++ EnableFastChecks ++ ++ ++ .\Debug/nmap.pch ++ .\Debug/ ++ .\Debug/ ++ .\Debug/ ++ Level2 ++ true ++ ProgramDatabase ++ CompileAsCpp ++ MultiThreadedDebugDLL ++ false ++ ++ ++ liblua.lib;nsock.lib;pcred.lib;nbase.lib;libdnet-stripped.lib;libssh2.lib;zlibd.lib;liblinear.lib;ws2_32.lib;IPHlpAPI.Lib;wpcap.lib;packet.lib;advapi32.lib;libeay32.lib;ssleay32.lib;shell32.lib;libnetutil.lib ++ .\Debug\nmap.exe ++ true ++ ..\libssh2\win32\Release_dll;lib;..\liblua\x64\Debug;..\libpcre\x64\Debug;..\nsock\x64\Debug;..\nbase\x64\Debug;..\libdnet-stripped\x64\Debug;..\libnetutil\x64\Debug;..\..\nmap-mswin32-aux\OpenSSL\lib;..\liblinear\x64\Debug;..\libz\contrib\vstudio\vc11\x86\ZlibStatRelease;%(AdditionalLibraryDirectories) ++ %(IgnoreSpecificDefaultLibraries) ++ packet.dll;wpcap.dll;iphlpapi.dll;%(DelayLoadDLLs) ++ true ++ .\Debug/nmap.pdb ++ Console ++ false ++ ++ ++ ++ ++ xcopy "$(SolutionDir)..\scripts" ".\$(Configuration)\scripts\" /e /y && xcopy "$(SolutionDir)..\nselib\*.lua" "$(SolutionDir)\$(Configuration)\nselib\" /y && xcopy /s /e "$(SolutionDir)..\nselib\data\*.*" "$(SolutionDir)\$(Configuration)\nselib\data\" /y && xcopy "$(SolutionDir)..\nse_main.lua" "$(SolutionDir)\$(Configuration)\" /y + + + $(IntDir)%(Filename).res +@@ -121,7 +198,7 @@ xcopy /y /d "$(ProjectDir)..\libssh2\win32\$(Configuration)_dll\*.dll" "$(Proje + CompileAsCpp + + +- liblua.lib;nsock.lib;libpcre.lib;nbase.lib;libdnet-stripped.lib;libssh2.lib;zlibstat.lib;liblinear.lib;ws2_32.lib;IPHlpAPI.Lib;wpcap.lib;packet.lib;advapi32.lib;libeay32.lib;ssleay32.lib;shell32.lib;libnetutil.lib ++ liblua.lib;nsock.lib;pcre.lib;nbase.lib;libdnet-stripped.lib;libssh2.lib;zlib.lib;liblinear.lib;ws2_32.lib;IPHlpAPI.Lib;wpcap.lib;packet.lib;advapi32.lib;libeay32.lib;ssleay32.lib;shell32.lib;libnetutil.lib + .\Release/nmap.exe + true + ..\libssh2\win32\Release_dll;lib;..\liblua;..\libpcre;..\nsock;..\nbase;..\libdnet-stripped;../libnetutil;..\..\nmap-mswin32-aux\OpenSSL\lib;..\liblinear;..\libz\contrib\vstudio\vc11\x86\ZlibStatRelease;%(AdditionalLibraryDirectories) +@@ -135,8 +212,46 @@ xcopy /y /d "$(ProjectDir)..\libssh2\win32\$(Configuration)_dll\*.dll" "$(Proje + /LTCG %(AdditionalOptions) + + +- xcopy "$(SolutionDir)..\scripts" ".\$(Configuration)\scripts\" /e /y && xcopy "$(SolutionDir)..\nselib\*.lua" "$(SolutionDir)\$(Configuration)\nselib\" /y && xcopy /s /e "$(SolutionDir)..\nselib\data\*.*" "$(SolutionDir)\$(Configuration)\nselib\data\" /y && xcopy "$(SolutionDir)\..\..\nmap-mswin32-aux\OpenSSL\bin\*.dll" "$(SolutionDir)\$(Configuration)\" /y && xcopy "$(SolutionDir)..\nse_main.lua" "$(SolutionDir)\$(Configuration)\" /y +-xcopy /y /d "$(ProjectDir)..\libssh2\win32\$(Configuration)_dll\*.dll" "$(ProjectDir)$(OutDir)" ++ xcopy "$(SolutionDir)..\scripts" ".\$(Configuration)\scripts\" /e /y && xcopy "$(SolutionDir)..\nselib\*.lua" "$(SolutionDir)\$(Configuration)\nselib\" /y && xcopy /s /e "$(SolutionDir)..\nselib\data\*.*" "$(SolutionDir)\$(Configuration)\nselib\data\" /y && xcopy "$(SolutionDir)..\nse_main.lua" "$(SolutionDir)\$(Configuration)\" /y ++ ++ ++ ++ ++ .\Release/nmap.tlb ++ ++ ++ ++ ++ MaxSpeed ++ OnlyExplicitInline ++ .;..;..\liblua;..\nbase;..\libpcre;..\nsock\include;pcap-include;..\libdnet-stripped\include;..\..\nmap-mswin32-aux\OpenSSL\include;..\liblinear;..\libssh2\include;..\libz;%(AdditionalIncludeDirectories) ++ WIN32;_CONSOLE;BPF_MAJOR_VERSION;%(PreprocessorDefinitions) ++ true ++ true ++ ++ ++ .\Release/nmap.pch ++ .\Release/ ++ .\Release/ ++ .\Release/ ++ true ++ CompileAsCpp ++ ++ ++ liblua.lib;nsock.lib;pcre.lib;nbase.lib;libdnet-stripped.lib;libssh2.lib;zlib.lib;liblinear.lib;ws2_32.lib;IPHlpAPI.Lib;wpcap.lib;packet.lib;advapi32.lib;libeay32.lib;ssleay32.lib;shell32.lib;libnetutil.lib ++ .\Release/nmap.exe ++ true ++ ..\libssh2\win32\Release_dll;lib;..\liblua\x64\Release;..\libpcre;..\nsock\x64\Release;..\nbase\x64\Release;..\libdnet-stripped\x64\Release;..\libnetutil\x64\Release;..\..\nmap-mswin32-aux\OpenSSL\lib;..\liblinear\x64\Release;..\libz\contrib\vstudio\vc11\x86\ZlibStatRelease;%(AdditionalLibraryDirectories) ++ %(IgnoreSpecificDefaultLibraries) ++ packet.dll;wpcap.dll;iphlpapi.dll;%(DelayLoadDLLs) ++ .\Release/nmap.pdb ++ Console ++ true ++ true ++ /LTCG %(AdditionalOptions) ++ ++ ++ xcopy "$(SolutionDir)..\scripts" ".\$(Configuration)\scripts\" /e /y && xcopy "$(SolutionDir)..\nselib\*.lua" "$(SolutionDir)\$(Configuration)\nselib\" /y && xcopy /s /e "$(SolutionDir)..\nselib\data\*.*" "$(SolutionDir)\$(Configuration)\nselib\data\" /y && xcopy "$(SolutionDir)..\nse_main.lua" "$(SolutionDir)\$(Configuration)\" /y + + + +@@ -191,7 +306,9 @@ xcopy /y /d "$(ProjectDir)..\libssh2\win32\$(Configuration)_dll\*.dll" "$(Proje + + + Sync ++ Sync + Sync ++ Sync + + + +@@ -251,83 +368,147 @@ xcopy /y /d "$(ProjectDir)..\libssh2\win32\$(Configuration)_dll\*.dll" "$(Proje + + + Copying %(Filename) to output directory... ++ Copying %(Filename) to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul + + $(TargetDir)%(Filename);%(Outputs) ++ $(TargetDir)%(Filename);%(Outputs) + Copying %(Filename) to output directory... ++ Copying %(Filename) to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul + + $(TargetDir)%(Filename);%(Outputs) ++ $(TargetDir)%(Filename);%(Outputs) + + + Copying %(Filename) to output directory... ++ Copying %(Filename) to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul + + $(TargetDir)%(Filename);%(Outputs) ++ $(TargetDir)%(Filename);%(Outputs) + Copying %(Filename) to output directory... ++ Copying %(Filename) to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul + + $(TargetDir)%(Filename);%(Outputs) ++ $(TargetDir)%(Filename);%(Outputs) + + + Copying %(Filename) to output directory... ++ Copying %(Filename) to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul + + $(TargetDir)%(Filename);%(Outputs) ++ $(TargetDir)%(Filename);%(Outputs) + Copying %(Filename) to output directory... ++ Copying %(Filename) to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul + + $(TargetDir)%(Filename);%(Outputs) ++ $(TargetDir)%(Filename);%(Outputs) + + + Copying %(Filename) to output directory... ++ Copying %(Filename) to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul + + $(TargetDir)%(Filename);%(Outputs) ++ $(TargetDir)%(Filename);%(Outputs) + Copying %(Filename) to output directory... ++ Copying %(Filename) to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul + + $(TargetDir)%(Filename);%(Outputs) ++ $(TargetDir)%(Filename);%(Outputs) + + + Copying %(Filename) to output directory... ++ Copying %(Filename) to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul + + $(TargetDir)%(Filename);%(Outputs) ++ $(TargetDir)%(Filename);%(Outputs) + Copying %(Filename) to output directory... ++ Copying %(Filename) to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul + + $(TargetDir)%(Filename);%(Outputs) ++ $(TargetDir)%(Filename);%(Outputs) + + + Copying %(Filename) to output directory... ++ Copying %(Filename) to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul + + $(TargetDir)%(Filename);%(Outputs) ++ $(TargetDir)%(Filename);%(Outputs) + Copying %(Filename) to output directory... ++ Copying %(Filename) to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul + + $(TargetDir)%(Filename);%(Outputs) ++ $(TargetDir)%(Filename);%(Outputs) + + + Copying %(Filename) to output directory... ++ Copying %(Filename) to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul + + $(TargetDir)%(Filename);%(Outputs) ++ $(TargetDir)%(Filename);%(Outputs) + Copying %(Filename) to output directory... ++ Copying %(Filename) to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename)" > nul + + $(TargetDir)%(Filename);%(Outputs) ++ $(TargetDir)%(Filename);%(Outputs) + + + Copying %(Filename).xsl to output directory... ++ Copying %(Filename).xsl to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename).xsl" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename).xsl" > nul + + $(TargetDir)%(Filename).xsl;%(Outputs) ++ $(TargetDir)%(Filename).xsl;%(Outputs) + Copying %(Filename).xsl to output directory... ++ Copying %(Filename).xsl to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename).xsl" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename).xsl" > nul + + $(TargetDir)%(Filename).xsl;%(Outputs) ++ $(TargetDir)%(Filename).xsl;%(Outputs) + + + +@@ -339,18 +520,6 @@ xcopy /y /d "$(ProjectDir)..\libssh2\win32\$(Configuration)_dll\*.dll" "$(Proje + {31fb0767-a71f-4575-8379-002d72b8af86} + false + +- +- {5de86c7a-de72-4265-8807-4ca38f94f22a} +- false +- +- +- {ed957342-e43b-496e-92d9-4c76b525bdf5} +- false +- false +- false +- true +- false +- + + {b630c8f7-3138-43e8-89ed-78742fa2ac5f} + false +diff --git a/nbase/nbase.vcxproj b/nbase/nbase.vcxproj +index 948d7c8..b600c7b 100644 +--- a/nbase/nbase.vcxproj ++++ b/nbase/nbase.vcxproj +@@ -5,14 +5,26 @@ + Debug + Win32 + ++ ++ Debug ++ x64 ++ + + Release + Win32 + ++ ++ Release ++ x64 ++ + + Static + Win32 + ++ ++ Static ++ x64 ++ + + + {B630C8F7-3138-43E8-89ED-78742FA2AC5F} +@@ -25,16 +37,31 @@ + MultiByte + v120 + ++ ++ StaticLibrary ++ MultiByte ++ v120 ++ + + StaticLibrary + MultiByte + v120 + ++ ++ StaticLibrary ++ MultiByte ++ v120 ++ + + StaticLibrary + MultiByte + v120 + ++ ++ StaticLibrary ++ MultiByte ++ v120 ++ + + + +@@ -42,14 +69,26 @@ + + + ++ ++ ++ ++ + + + + ++ ++ ++ ++ + + + + ++ ++ ++ ++ + + + <_ProjectFileVersion>10.0.30319.1 +@@ -76,6 +115,21 @@ + $(OutDir)nbase.lib + + ++ ++ ++ Disabled ++ WIN32;_LIB;%(PreprocessorDefinitions) ++ EnableFastChecks ++ MultiThreadedDebugDLL ++ ++ ++ Level3 ++ ProgramDatabase ++ ++ ++ $(OutDir)nbase.lib ++ ++ + + + /D "_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions) +@@ -89,6 +143,19 @@ + $(OutDir)nbase.lib + + ++ ++ ++ /D "_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions) ++ WIN32;_LIB;%(PreprocessorDefinitions) ++ ++ ++ Level3 ++ ProgramDatabase ++ ++ ++ $(OutDir)nbase.lib ++ ++ + + + /D "_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions) +@@ -103,6 +170,20 @@ + $(OutDir)nbase.lib + + ++ ++ ++ /D "_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions) ++ WIN32;_LIB;%(PreprocessorDefinitions) ++ MultiThreaded ++ ++ ++ Level3 ++ ProgramDatabase ++ ++ ++ $(OutDir)nbase.lib ++ ++ + + + +diff --git a/ncat/ncat.vcxproj b/ncat/ncat.vcxproj +index fc44dfa..e066b29 100644 +--- a/ncat/ncat.vcxproj ++++ b/ncat/ncat.vcxproj +@@ -5,14 +5,26 @@ + Debug + Win32 + ++ ++ Debug ++ x64 ++ + + Release + Win32 + ++ ++ Release ++ x64 ++ + + Static + Win32 + ++ ++ Static ++ x64 ++ + + + {C1E04411-E021-468B-83F1-CB624BBA7589} +@@ -25,18 +37,36 @@ + MultiByte + v120 + ++ ++ Application ++ false ++ MultiByte ++ v120 ++ + + Application + false + MultiByte + v120 + ++ ++ Application ++ false ++ MultiByte ++ v120 ++ + + Application + false + MultiByte + v120 + ++ ++ Application ++ false ++ MultiByte ++ v120 ++ + + + +@@ -44,26 +74,41 @@ + + + ++ ++ ++ ++ + + + + ++ ++ ++ ++ + + + + ++ ++ ++ ++ + + + <_ProjectFileVersion>10.0.30319.1 + .\$(Configuration)\ + .\$(Configuration)\ + true ++ true + .\Release\ + .\Release\ + .\Release\ + .\Release\ + true ++ true + true ++ true + + + +@@ -111,6 +156,51 @@ + xcopy "..\..\nmap-mswin32-aux\OpenSSL\bin\*.dll" "$(Configuration)\" /y + + ++ ++ ++ .\Debug/ncat.tlb ++ ++ ++ ++ ++ Disabled ++ .;..;../nbase;..\nsock\include;..\mswin32\pcap-include;..\..\nmap-mswin32-aux\OpenSSL\include;..\liblua;%(AdditionalIncludeDirectories) ++ WIN32;_CONSOLE;%(PreprocessorDefinitions) ++ EnableFastChecks ++ MultiThreadedDebugDLL ++ ++ ++ .\Debug/ncat.pch ++ .\Debug/ ++ .\Debug/ ++ .\Debug/ ++ Level2 ++ true ++ ProgramDatabase ++ CompileAsCpp ++ ++ ++ ++ ++ ++ ++ nbase.lib;ws2_32.lib;IPHlpAPI.Lib;wpcap.lib;nsock.lib;advapi32.lib;libeay32.lib;ssleay32.lib;liblua.lib ++ .\Debug\ncat.exe ++ true ++ ..\mswin32\lib;..\nsock;..\nbase;..\..\nmap-mswin32-aux\OpenSSL\lib;..\liblua;%(AdditionalLibraryDirectories) ++ %(IgnoreSpecificDefaultLibraries) ++ wpcap.dll;%(DelayLoadDLLs) ++ true ++ .\Debug/ncat.pdb ++ Console ++ false ++ ++ ++ ++ ++ xcopy "..\..\nmap-mswin32-aux\OpenSSL\bin\*.dll" "$(Configuration)\" /y ++ ++ + + + .\Release/ncat.tlb +@@ -151,6 +241,45 @@ + xcopy "..\..\nmap-mswin32-aux\OpenSSL\bin\*.dll" "$(Configuration)\" /y + + ++ ++ ++ .\Release/ncat.tlb ++ ++ ++ ++ ++ MaxSpeed ++ OnlyExplicitInline ++ .;..;../nbase;..\nsock\include;..\mswin32\pcap-include;..\..\nmap-mswin32-aux\OpenSSL\include;..\liblua;%(AdditionalIncludeDirectories) ++ WIN32;_CONSOLE;%(PreprocessorDefinitions) ++ true ++ true ++ ++ ++ .\Release/ncat.pch ++ .\Release/ ++ .\Release/ ++ .\Release/ ++ Level2 ++ true ++ CompileAsCpp ++ ++ ++ nsock.lib;nbase.lib;ws2_32.lib;IPHlpAPI.Lib;wpcap.lib;advapi32.lib;libeay32.lib;ssleay32.lib ++ .\Release/ncat.exe ++ true ++ ..\mswin32\lib;..\nsock;..\nbase;..\..\nmap-mswin32-aux\OpenSSL\lib;%(AdditionalLibraryDirectories) ++ %(IgnoreSpecificDefaultLibraries) ++ wpcap.dll;%(DelayLoadDLLs) ++ .\Release/ncat.pdb ++ Console ++ true ++ true ++ ++ ++ xcopy "..\..\nmap-mswin32-aux\OpenSSL\bin\*.dll" "$(Configuration)\" /y ++ ++ + + + .\Release/ncat.tlb +@@ -193,6 +322,47 @@ + + + ++ ++ ++ .\Release/ncat.tlb ++ ++ ++ ++ ++ MaxSpeed ++ OnlyExplicitInline ++ .;..;../nbase;..\nsock\include;..\mswin32\pcap-include;..\..\nmap-mswin32-aux\OpenSSL\include;%(AdditionalIncludeDirectories) ++ WIN32;_CONSOLE;%(PreprocessorDefinitions) ++ true ++ MultiThreaded ++ true ++ ++ ++ .\Release/ncat.pch ++ .\Release/ ++ .\Release/ ++ .\Release/ ++ Level2 ++ true ++ CompileAsCpp ++ ++ ++ nsock.lib;nbase.lib;ws2_32.lib;IPHlpAPI.Lib;advapi32.lib;libeay32.lib;ssleay32.lib;user32.lib;gdi32.lib ++ .\Release/ncat.exe ++ true ++ ..\mswin32\lib;..\nsock;..\nbase;..\..\nmap-mswin32-aux\OpenSSL\lib;%(AdditionalLibraryDirectories) ++ %(IgnoreSpecificDefaultLibraries) ++ %(DelayLoadDLLs) ++ .\Release/ncat.pdb ++ Console ++ true ++ true ++ ++ ++ ++ ++ ++ + + + +@@ -230,17 +400,29 @@ + + + Copying %(Filename).crt to output directory... ++ Copying %(Filename).crt to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename).crt" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename).crt" > nul + + $(TargetDir)%(Filename).crt;%(Outputs) ++ $(TargetDir)%(Filename).crt;%(Outputs) + Copying %(Filename).crt to output directory... ++ Copying %(Filename).crt to output directory... + Copying %(Filename).crt to output directory... ++ Copying %(Filename).crt to output directory... + copy /y "%(FullPath)" "$(TargetDir)%(Filename).crt" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename).crt" > nul + + copy /y "%(FullPath)" "$(TargetDir)%(Filename).crt" > nul ++ ++ copy /y "%(FullPath)" "$(TargetDir)%(Filename).crt" > nul + + $(TargetDir)%(Filename).crt;%(Outputs) ++ $(TargetDir)%(Filename).crt;%(Outputs) + $(TargetDir)%(Filename).crt;%(Outputs) ++ $(TargetDir)%(Filename).crt;%(Outputs) + + + +diff --git a/nping/nping.vcxproj b/nping/nping.vcxproj +index 57bd4ed..fa7a604 100644 +--- a/nping/nping.vcxproj ++++ b/nping/nping.vcxproj +@@ -5,10 +5,18 @@ + Debug + Win32 + ++ ++ Debug ++ x64 ++ + + Release + Win32 + ++ ++ Release ++ x64 ++ + + + {CDB10BBA-9085-4B9B-AC8F-BA31D3906B36} +@@ -21,12 +29,24 @@ + MultiByte + v120 + ++ ++ Application ++ false ++ MultiByte ++ v120 ++ + + Application + false + MultiByte + v120 + ++ ++ Application ++ false ++ MultiByte ++ v120 ++ + + + +@@ -34,19 +54,29 @@ + + + ++ ++ ++ ++ + + + + ++ ++ ++ ++ + + + <_ProjectFileVersion>10.0.30319.1 + .\$(Configuration)\ + .\$(Configuration)\ + true ++ true + .\Release\ + .\Release\ + true ++ true + + + +@@ -93,6 +123,50 @@ + xcopy "..\..\nmap-mswin32-aux\OpenSSL\bin\*.dll" "$(SolutionDir)\$(Configuration)\" /y + + ++ ++ ++ .\Debug/nmap.tlb ++ ++ ++ ++ ++ Disabled ++ .;..;..\mswin32;../nbase;..\nsock\include;..\mswin32\pcap-include;..\libdnet-stripped\include;..\..\nmap-mswin32-aux\OpenSSL\include;%(AdditionalIncludeDirectories) ++ WIN32;_CONSOLE;BPF_MAJOR_VERSION;%(PreprocessorDefinitions) ++ false ++ false ++ false ++ EnableFastChecks ++ MultiThreadedDebugDLL ++ ++ ++ .\Debug/nmap.pch ++ .\Debug/ ++ .\Debug/ ++ .\Debug/ ++ Level2 ++ true ++ ProgramDatabase ++ CompileAsCpp ++ ++ ++ nsock.lib;nbase.lib;libdnet-stripped.lib;ws2_32.lib;IPHlpAPI.Lib;wpcap.lib;packet.lib;advapi32.lib;libeay32.lib;ssleay32.lib;shell32.lib;libnetutil.lib ++ .\Debug\nping.exe ++ true ++ ..\mswin32\lib;..\nsock;..\nbase;..\libdnet-stripped;../libnetutil;..\..\nmap-mswin32-aux\OpenSSL\lib;%(AdditionalLibraryDirectories) ++ %(IgnoreSpecificDefaultLibraries) ++ packet.dll;wpcap.dll;iphlpapi.dll;%(DelayLoadDLLs) ++ true ++ .\Debug/nmap.pdb ++ Console ++ false ++ ++ ++ ++ ++ xcopy "..\..\nmap-mswin32-aux\OpenSSL\bin\*.dll" "$(SolutionDir)\$(Configuration)\" /y ++ ++ + + + .\Release/nmap.tlb +@@ -132,6 +206,44 @@ + xcopy "..\..\nmap-mswin32-aux\OpenSSL\bin\*.dll" "$(SolutionDir)\$(Configuration)\" /y + + ++ ++ ++ .\Release/nmap.tlb ++ ++ ++ ++ ++ MaxSpeed ++ OnlyExplicitInline ++ .;..;..\mswin32;../nbase;..\nsock\include;..\mswin32\pcap-include;..\libdnet-stripped\include;..\..\nmap-mswin32-aux\OpenSSL\include;%(AdditionalIncludeDirectories) ++ WIN32;_CONSOLE;BPF_MAJOR_VERSION;%(PreprocessorDefinitions) ++ true ++ true ++ ++ ++ .\Release/nping.pch ++ .\Release/ ++ .\Release/ ++ .\Release/ ++ true ++ CompileAsCpp ++ ++ ++ nsock.lib;nbase.lib;libdnet-stripped.lib;ws2_32.lib;IPHlpAPI.Lib;wpcap.lib;packet.lib;advapi32.lib;libeay32.lib;ssleay32.lib;shell32.lib;libnetutil.lib ++ .\Release/nping.exe ++ true ++ ..\mswin32\lib;..\nsock;..\nbase;..\libdnet-stripped;../libnetutil;..\..\nmap-mswin32-aux\OpenSSL\lib;%(AdditionalLibraryDirectories) ++ %(IgnoreSpecificDefaultLibraries) ++ packet.dll;wpcap.dll;iphlpapi.dll;%(DelayLoadDLLs) ++ .\Release/nping.pdb ++ Console ++ true ++ true ++ ++ ++ xcopy "..\..\nmap-mswin32-aux\OpenSSL\bin\*.dll" "$(SolutionDir)\$(Configuration)\" /y ++ ++ + + + +diff --git a/nsock/nsock.vcxproj b/nsock/nsock.vcxproj +index 36feb48..f720258 100644 +--- a/nsock/nsock.vcxproj ++++ b/nsock/nsock.vcxproj +@@ -5,22 +5,42 @@ + DebugNoPcap + Win32 + ++ ++ DebugNoPcap ++ x64 ++ + + Debug + Win32 + ++ ++ Debug ++ x64 ++ + + ReleaseNoPcap + Win32 + ++ ++ ReleaseNoPcap ++ x64 ++ + + Release + Win32 + ++ ++ Release ++ x64 ++ + + Static + Win32 + ++ ++ Static ++ x64 ++ + + + {F8D6D1E3-D4EA-402C-98AA-168E5309BAF4} +@@ -33,26 +53,51 @@ + MultiByte + v120 + ++ ++ StaticLibrary ++ MultiByte ++ v120 ++ + + StaticLibrary + MultiByte + v120 + ++ ++ StaticLibrary ++ MultiByte ++ v120 ++ + + StaticLibrary + MultiByte + v120 + ++ ++ StaticLibrary ++ MultiByte ++ v120 ++ + + StaticLibrary + MultiByte + v120 + ++ ++ StaticLibrary ++ MultiByte ++ v120 ++ + + StaticLibrary + MultiByte + v120 + ++ ++ StaticLibrary ++ MultiByte ++ v120 ++ + + + +@@ -60,22 +105,42 @@ + + + ++ ++ ++ ++ + + + + ++ ++ ++ ++ + + + + ++ ++ ++ ++ + + + + ++ ++ ++ ++ + + + + ++ ++ ++ ++ + + + <_ProjectFileVersion>10.0.30319.1 +@@ -110,6 +175,25 @@ + $(OutDir)nsock.lib + + ++ ++ ++ Disabled ++ ..\nbase\;include;..\mswin32\pcap-include;..\mswin32;..\;..\..\nmap-mswin32-aux\OpenSSL\include;%(AdditionalIncludeDirectories) ++ WIN32;_LIB;%(PreprocessorDefinitions) ++ ++ ++ EnableFastChecks ++ MultiThreadedDebugDLL ++ ++ ++ Level3 ++ ProgramDatabase ++ CompileAsCpp ++ ++ ++ $(OutDir)nsock.lib ++ ++ + + + /D "_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions) +@@ -127,6 +211,23 @@ + $(OutDir)nsock.lib + + ++ ++ ++ /D "_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions) ++ ..\nbase\;include;..\mswin32\pcap-include;..\mswin32;..\;..\..\nmap-mswin32-aux\OpenSSL\include;%(AdditionalIncludeDirectories) ++ WIN32;_LIB;%(PreprocessorDefinitions) ++ ++ ++ ++ ++ Level3 ++ ProgramDatabase ++ CompileAsCpp ++ ++ ++ $(OutDir)nsock.lib ++ ++ + + + /D "_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions) +@@ -145,6 +246,24 @@ + $(OutDir)nsock.lib + + ++ ++ ++ /D "_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions) ++ ..\nbase\;include;..\mswin32\pcap-include;..\mswin32;..\;..\..\nmap-mswin32-aux\OpenSSL\include;%(AdditionalIncludeDirectories) ++ WIN32;_LIB;%(PreprocessorDefinitions);DISABLE_NSOCK_PCAP ++ ++ ++ MultiThreaded ++ ++ ++ Level3 ++ ProgramDatabase ++ CompileAsCpp ++ ++ ++ $(OutDir)nsock.lib ++ ++ + + + /D "DISABLE_NSOCK_PCAP" %(AdditionalOptions) +@@ -166,9 +285,47 @@ + $(OutDir)nsock.lib + + ++ ++ ++ /D "DISABLE_NSOCK_PCAP" %(AdditionalOptions) ++ Disabled ++ ..\nbase\;include;..\mswin32\pcap-include;..\mswin32;..\;..\..\nmap-mswin32-aux\OpenSSL\include;%(AdditionalIncludeDirectories) ++ WIN32;_LIB;%(PreprocessorDefinitions) ++ ++ ++ EnableFastChecks ++ MultiThreadedDebugDLL ++ ++ ++ Level3 ++ ProgramDatabase ++ CompileAsCpp ++ ++ ++ $(OutDir)nsock.lib ++ ++ + + + /D "_CRT_SECURE_NO_DEPRECATE" ++/D "DISABLE_NSOCK_PCAP" %(AdditionalOptions) ++ ..\nbase\;include;..\mswin32\pcap-include;..\mswin32;..\;..\..\nmap-mswin32-aux\OpenSSL\include;%(AdditionalIncludeDirectories) ++ WIN32;_LIB;%(PreprocessorDefinitions) ++ ++ ++ ++ ++ Level3 ++ ProgramDatabase ++ CompileAsCpp ++ ++ ++ $(OutDir)nsock.lib ++ ++ ++ ++ ++ /D "_CRT_SECURE_NO_DEPRECATE" + /D "DISABLE_NSOCK_PCAP" %(AdditionalOptions) + ..\nbase\;include;..\mswin32\pcap-include;..\mswin32;..\;..\..\nmap-mswin32-aux\OpenSSL\include;%(AdditionalIncludeDirectories) + WIN32;_LIB;%(PreprocessorDefinitions) diff --git a/ports/nmap/fix-snprintf.patch b/ports/nmap/fix-snprintf.patch new file mode 100644 index 000000000..aafd1cfe9 --- /dev/null +++ b/ports/nmap/fix-snprintf.patch @@ -0,0 +1,39 @@ +diff --git a/libdnet-stripped/include/dnet_winconfig.h b/libdnet-stripped/include/dnet_winconfig.h +index e41907c..82bc595 100644 +--- a/libdnet-stripped/include/dnet_winconfig.h ++++ b/libdnet-stripped/include/dnet_winconfig.h +@@ -277,7 +277,7 @@ int strlcpy(char *, const char *, int); + char *strsep(char **, const char *); + #endif + +-#define snprintf _snprintf ++//#define snprintf _snprintf + + /* Without this, Windows will give us all sorts of crap about using functions + like strcpy() even if they are done safely */ +diff --git a/nbase/nbase.h b/nbase/nbase.h +index 0ecd9bc..c0eb395 100644 +--- a/nbase/nbase.h ++++ b/nbase/nbase.h +@@ -359,7 +359,7 @@ extern "C" int vsnprintf (char *, size_t, const char *, va_list); + #define putenv _putenv + + #if !defined(__GNUC__) +-#define snprintf _snprintf ++//#define snprintf _snprintf + #endif + + #define strcasecmp _stricmp +diff --git a/nse_libssh2.cc b/nse_libssh2.cc +index bf721b6..1fafe7f 100644 +--- a/nse_libssh2.cc ++++ b/nse_libssh2.cc +@@ -58,7 +58,7 @@ struct ssh_userdata { + + + #if defined(_MSC_VER) && _MSC_VER < 1900 +-#define snprintf c99_snprintf ++//#define snprintf c99_snprintf + #define vsnprintf c99_vsnprintf + + __inline int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap) { diff --git a/ports/nmap/fix-ssize_t.patch b/ports/nmap/fix-ssize_t.patch new file mode 100644 index 000000000..36103a8c2 --- /dev/null +++ b/ports/nmap/fix-ssize_t.patch @@ -0,0 +1,16 @@ +diff --git a/libdnet-stripped/include/dnet/os.h b/libdnet-stripped/include/dnet/os.h +index 55a21b9..544ebd8 100644 +--- a/libdnet-stripped/include/dnet/os.h ++++ b/libdnet-stripped/include/dnet/os.h +@@ -23,7 +23,11 @@ + typedef u_short uint16_t; + typedef u_int uint32_t; + # ifndef __CYGWIN__ ++#ifdef _WIN64 ++ typedef __int64 ssize_t; ++#else + typedef long ssize_t; ++#endif + # endif + #else + # include diff --git a/ports/nmap/portfile.cmake b/ports/nmap/portfile.cmake index 5e2e05787..3554fb9ad 100644 --- a/ports/nmap/portfile.cmake +++ b/ports/nmap/portfile.cmake @@ -1,134 +1,117 @@ include(vcpkg_common_functions) +# nmap is a tools, so ignor POST_CHECK +SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) + vcpkg_download_distfile(ARCHIVE URLS "https://nmap.org/dist/nmap-7.70.tar.bz2" FILENAME "nmap-7.70.tar.bz2" SHA512 084c148b022ff6550e269d976d0077f7932a10e2ef218236fe13aa3a70b4eb6506df03329868fc68cb3ce78e4360b200f5a7a491d3145028fed679ef1c9ecae5 ) -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - REF ${SQLITE_VERSION} -) - -vcpkg_extract_source_archive(${ARCHIVE}) - -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/detect-crypto-library.patch -) - -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make) -else() - vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make) -endif() -set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) -set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}") -set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;$ENV{LIB}") - -set(_csc_PROJECT_PATH nmap) -file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - set(ENV{LIBPATH} "$ENV{LIBPATH};$ENV{_WKITS10}references\\windows.foundation.foundationcontract\\2.0.0.0\\;$ENV{_WKITS10}references\\windows.foundation.universalapicontract\\3.0.0.0\\") - set(OPTIONS "${OPTIONS} --disable-programs --enable-cross-compile --target-os=win32 --arch=${VCPKG_TARGET_ARCHITECTURE}") - set(OPTIONS "${OPTIONS} --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00") - - if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - vcpkg_find_acquire_program(GASPREPROCESSOR) - foreach(GAS_PATH ${GASPREPROCESSOR}) - get_filename_component(GAS_ITEM_PATH ${GAS_PATH} DIRECTORY) - set(ENV{PATH} "$ENV{PATH};${GAS_ITEM_PATH}") - endforeach(GAS_PATH) - elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - else() - message(FATAL_ERROR "Unsupported architecture") +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + PATCHES + fix-snprintf.patch + fix-ssize_t.patch + fix-msvc-prj.patch + ) + list(APPEND DEL_PROJS "libpcap" "libpcre" "libssh2" "libz") + foreach (DEL_PROJ ${DEL_PROJS}) + file(REMOVE_RECURSE ${SOURCE_PATH}/${DEL_PROJ}) + endforeach() + + # Clear + vcpkg_execute_required_process( + COMMAND "devenv.exe" + "nmap.sln" + /Clean + WORKING_DIRECTORY ${SOURCE_PATH}/mswin32 + ) + + # Uprade + message(STATUS "Upgrade solution...") + vcpkg_execute_required_process( + COMMAND "devenv.exe" + "nmap.sln" + /Upgrade + WORKING_DIRECTORY ${SOURCE_PATH}/mswin32 + LOGNAME upgrade-Packet-${TARGET_TRIPLET} + ) + # Build + vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/mswin32/nmap.vcxproj + PLATFORM ${MSBUILD_PLATFORM} + USE_VCPKG_INTEGRATION + ) + + # Install + if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL Release) + file(INSTALL ${SOURCE_PATH}/mswin32/Release/nmap.exe + ${SOURCE_PATH}/mswin32/Release/nmap.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/tools) endif() -endif() - - -set(OPTIONS "--with-openssl=${VCPKG_ROOT_DIR}/installed/x64-windows/bin/ --with-libssh2=${VCPKG_ROOT_DIR}/installed/x64-windows/bin/") - -message(STATUS "Building Options: ${OPTIONS}") - -set(OPTIONS_DEBUG "") # Note: --disable-optimizations can't be used due to http://ffmpeg.org/pipermail/libav-user/2013-March/003945.html -set(OPTIONS_RELEASE "") - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - set(OPTIONS "${OPTIONS} --disable-static --enable-shared") - if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - set(OPTIONS "${OPTIONS} --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib") + if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL Debug) + file(INSTALL ${SOURCE_PATH}/mswin32/Debug/nmap.exe + ${SOURCE_PATH}/mswin32/Debug/nmap.pdb + DESTINATION ${CURRENT_PACKAGES_DIR}/tools) endif() -endif() - -message(STATUS "Building Options: ${OPTIONS}") - -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} ${OPTIONS_RELEASE}" - 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) -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}) + foreach(BUILD_TYPE rel dbg) + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}) + # Since nmap makefile has strong relationshop with codes, copy codes to obj path + vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}) + endforeach() + set(OPTIONS --without-nmap-update --with-openssl=${CURRENT_INSTALLED_DIR} --with-libssh2=${CURRENT_INSTALLED_DIR} --with-libz=${CURRENT_INSTALLED_DIR} --with-libpcre=${CURRENT_INSTALLED_DIR}) + message(STATUS "Building Options: ${OPTIONS}") + + if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL Release) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + set(SOURCE_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/nmap-7.70) + vcpkg_execute_required_process( + COMMAND "./configure" ${OPTIONS} + WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} + LOGNAME config-${TARGET_TRIPLET}-rel + ) + + message(STATUS "Building ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND make + WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} + LOGNAME build-${TARGET_TRIPLET}-rel + ) + + message(STATUS "Installing ${TARGET_TRIPLET}-rel") + file(INSTALL ${SOURCE_PATH_RELEASE}/nmap DESTINATION ${CURRENT_PACKAGES_DIR}/tools) + endif() + + if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL Debug) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + set(SOURCE_PATH_DEBUG ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/nmap-7.70) + vcpkg_execute_required_process( + COMMAND "./configure" ${OPTIONS} + WORKING_DIRECTORY ${SOURCE_PATH_DEBUG} + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + + message(STATUS "Building ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND make + WORKING_DIRECTORY ${SOURCE_PATH_DEBUG} + LOGNAME build-${TARGET_TRIPLET}-dbg + ) + + message(STATUS "Installing ${TARGET_TRIPLET}-dbg") + file(INSTALL ${SOURCE_PATH_RELEASE}/nmap DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools) + endif() + + set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/nmap-7.70) endif() -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(RENAME ${CURRENT_PACKAGES_DIR}/COPYING ${CURRENT_PACKAGES_DIR}/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -- cgit v1.2.3 From dd8880cdd0bbdf7f39df442ce00fff1602a714fb Mon Sep 17 00:00:00 2001 From: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Date: Tue, 27 Aug 2019 14:51:29 -0700 Subject: [cgl] Add new port (#7810) --- ports/cgl/CMakeLists.txt | 143 ++++++++++++++++++++++++++++++++++++++++ ports/cgl/CONTROL | 5 ++ ports/cgl/Config.cmake.in | 5 ++ ports/cgl/fix-c1083-error.patch | 30 +++++++++ ports/cgl/portfile.cmake | 28 ++++++++ 5 files changed, 211 insertions(+) create mode 100644 ports/cgl/CMakeLists.txt create mode 100644 ports/cgl/CONTROL create mode 100644 ports/cgl/Config.cmake.in create mode 100644 ports/cgl/fix-c1083-error.patch create mode 100644 ports/cgl/portfile.cmake diff --git a/ports/cgl/CMakeLists.txt b/ports/cgl/CMakeLists.txt new file mode 100644 index 000000000..b3c1ca827 --- /dev/null +++ b/ports/cgl/CMakeLists.txt @@ -0,0 +1,143 @@ +cmake_minimum_required(VERSION 3.11) + +project(Cgl LANGUAGES C CXX) + +set(PROJECT_VERSION 0.60.2) +set(PROJECT_VERSION_MAJOR 0) +set(PROJECT_VERSION_MINOR 60) +set(PROJECT_VERSION_PATCH 2) + +set(CMAKE_CXX_STANDARD 14) + +set(INSTALL_BIN_DIR "bin" CACHE PATH "Path where exe and dll will be installed") +set(INSTALL_LIB_DIR "lib" CACHE PATH "Path where lib will be installed") +set(INSTALL_INCLUDE_DIR "include/Coin" CACHE PATH "Path where headers will be installed") +set(INSTALL_CMAKE_DIR "share/cgl" CACHE PATH "Path where cmake configs will be installed") + +# Make relative paths absolute (needed later on) +set(RELATIVE_INSTALL_INCLUDE_DIR ${INSTALL_INCLUDE_DIR}) +foreach(p LIB BIN INCLUDE CMAKE) + set(var INSTALL_${p}_DIR) + if(NOT IS_ABSOLUTE "${${var}}") + set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}") + endif() +endforeach() + +if(MSVC) + set( + CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} /bigobj /MP /wd4996 /wd4819 /wd4251 /wd4267 /wd4244 /wd4275" + ) +endif() + +if(APPLE) + set( + CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -Wno-inconsistent-missing-override -Wno-unused-command-line-argument -Wno-unused-result -Wno-exceptions" + ) + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" + CACHE STRING "Minimum OS X deployment version") +endif() + +find_package(CoinUtils REQUIRED) +find_package(Osi REQUIRED) + +file(GLOB CGL_SOURCES + Cgl/src/CglConfig.h + Cgl/src/*.hpp + Cgl/src/*.cpp + Cgl/src/CglAllDifferent/*.cpp + Cgl/src/CglAllDifferent/*.hpp + Cgl/src/CglBKClique/*.cpp + Cgl/src/CglBKClique/*.hpp + Cgl/src/CglClique/*.cpp + Cgl/src/CglClique/*.hpp + Cgl/src/CglCliqueMerging/*.cpp + Cgl/src/CglCliqueMerging/*.hpp + Cgl/src/CglDuplicateRow/*.cpp + Cgl/src/CglDuplicateRow/*.hpp + Cgl/src/CglFlowCover/*.cpp + Cgl/src/CglFlowCover/*.hpp + Cgl/src/CglGMI/*.cpp + Cgl/src/CglGMI/*.hpp + Cgl/src/CglGomory/*.cpp + Cgl/src/CglGomory/*.hpp + Cgl/src/CglKnapsackCover/*.cpp + Cgl/src/CglKnapsackCover/*.hpp + Cgl/src/CglLandP/*.cpp + Cgl/src/CglLandP/*.hpp + Cgl/src/CglLiftAndProject/*.cpp + Cgl/src/CglLiftAndProject/*.hpp + Cgl/src/CglMixedIntegerRounding/*.cpp + Cgl/src/CglMixedIntegerRounding/*.hpp + Cgl/src/CglMixedIntegerRounding2/*.cpp + Cgl/src/CglMixedIntegerRounding2/*.hpp + Cgl/src/CglOddHole/*.cpp + Cgl/src/CglOddHole/*.hpp + Cgl/src/CglOddHoleWC/*.cpp + Cgl/src/CglOddHoleWC/*.hpp + Cgl/src/CglPreProcess/*.cpp + Cgl/src/CglPreProcess/*.hpp + Cgl/src/CglProbing/*.cpp + Cgl/src/CglProbing/*.hpp + Cgl/src/CglRedSplit/*.cpp + Cgl/src/CglRedSplit/*.hpp + Cgl/src/CglRedSplit2/*.cpp + Cgl/src/CglRedSplit2/*.hpp + Cgl/src/CglResidualCapacity/*.cpp + Cgl/src/CglResidualCapacity/*.hpp + Cgl/src/CglSimpleRounding/*.cpp + Cgl/src/CglSimpleRounding/*.hpp + Cgl/src/CglTwomir/*.cpp + Cgl/src/CglTwomir/*.hpp + Cgl/src/CglZeroHalf/*.cpp + Cgl/src/CglZeroHalf/*.hpp) + +add_library(${PROJECT_NAME} ${CGL_SOURCES}) + +target_include_directories(${PROJECT_NAME} + PUBLIC + $ + $) + +if(MSVC) + target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) +endif() +target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_CMATH) +target_compile_definitions(${PROJECT_NAME} PUBLIC COIN_HAS_CLP) + +target_link_libraries(${PROJECT_NAME} PRIVATE Coin::CoinUtils Coin::Osi) + +install(DIRECTORY Cgl/src/ + DESTINATION ${INSTALL_INCLUDE_DIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hpp" + PATTERN "config_default.h" EXCLUDE) + +install(TARGETS ${PROJECT_NAME} + EXPORT "${PROJECT_NAME}Targets" + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin) + +include(CMakePackageConfigHelpers) + +set(version_config "${CMAKE_CURRENT_BINARY_DIR}/temp/${PROJECT_NAME}ConfigVersion.cmake") +set(project_config "${CMAKE_CURRENT_BINARY_DIR}/temp/${PROJECT_NAME}Config.cmake") +set(namespace "Coin::") + +write_basic_package_version_file("${version_config}" + COMPATIBILITY SameMajorVersion) + +configure_package_config_file("Config.cmake.in" + "${project_config}" + INSTALL_DESTINATION + "${INSTALL_CMAKE_DIR}") + +install(FILES "${project_config}" "${version_config}" + DESTINATION "${INSTALL_CMAKE_DIR}") + +install(EXPORT "${PROJECT_NAME}Targets" + NAMESPACE "${namespace}" + DESTINATION "${INSTALL_CMAKE_DIR}") \ No newline at end of file diff --git a/ports/cgl/CONTROL b/ports/cgl/CONTROL new file mode 100644 index 000000000..502193214 --- /dev/null +++ b/ports/cgl/CONTROL @@ -0,0 +1,5 @@ +Source: cgl +Version: 0.60.2-1 +Homepage: https://github.com/coin-or/Cgl +Description: The COIN-OR Cut Generation Library (Cgl) is a collection of cut generators that can be used with other COIN-OR packages that make use of cuts, such as, among others, the linear solver Clp or the mixed integer linear programming solvers Cbc or BCP. +Build-Depends: coinutils, osi, clp \ No newline at end of file diff --git a/ports/cgl/Config.cmake.in b/ports/cgl/Config.cmake.in new file mode 100644 index 000000000..a9af95692 --- /dev/null +++ b/ports/cgl/Config.cmake.in @@ -0,0 +1,5 @@ + +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +check_required_components("@PROJECT_NAME@") \ No newline at end of file diff --git a/ports/cgl/fix-c1083-error.patch b/ports/cgl/fix-c1083-error.patch new file mode 100644 index 000000000..bc5b62a00 --- /dev/null +++ b/ports/cgl/fix-c1083-error.patch @@ -0,0 +1,30 @@ +diff --git a/Cgl/src/CglLandP/CglLandP.cpp b/Cgl/src/CglLandP/CglLandP.cpp +index 2676790..af90a6e 100644 +--- a/Cgl/src/CglLandP/CglLandP.cpp ++++ b/Cgl/src/CglLandP/CglLandP.cpp +@@ -22,7 +22,7 @@ + #define CLONE_SI //Solver is cloned between two cuts + + #include "CoinTime.hpp" +-#include "CglGomory.hpp" ++#include "CglGomory/CglGomory.hpp" + #include "CoinFactorization.hpp" + #include + namespace LAP +diff --git a/Cgl/src/CglPreProcess/CglPreProcess.cpp b/Cgl/src/CglPreProcess/CglPreProcess.cpp +index 17cf372..8cb738f 100644 +--- a/Cgl/src/CglPreProcess/CglPreProcess.cpp ++++ b/Cgl/src/CglPreProcess/CglPreProcess.cpp +@@ -24,9 +24,9 @@ + #include "CoinHelperFunctions.hpp" + #include "CoinWarmStartBasis.hpp" + +-#include "CglProbing.hpp" +-#include "CglDuplicateRow.hpp" +-#include "CglClique.hpp" ++#include "CglProbing/CglProbing.hpp" ++#include "CglDuplicateRow/CglDuplicateRow.hpp" ++#include "CglClique/CglClique.hpp" + //#define PRINT_DEBUG 1 + //#define COIN_DEVELOP 1 + #ifdef COIN_DEVELOP diff --git a/ports/cgl/portfile.cmake b/ports/cgl/portfile.cmake new file mode 100644 index 000000000..932bb7fbb --- /dev/null +++ b/ports/cgl/portfile.cmake @@ -0,0 +1,28 @@ +include(vcpkg_common_functions) + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO coin-or/Cgl + REF releases/0.60.2 + SHA512 86db94638d586d2fb64cb55f72197f847731c710351168189647686c5229555c79bc411044ab1cc789a520577de2be3c2e8611221d743f9dbaabb71544d0fa66 + PATCHES fix-c1083-error.patch +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/Config.cmake.in DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From b8270c2a4bbe4d8730efdd6333108e744175b511 Mon Sep 17 00:00:00 2001 From: Ehsan Date: Wed, 28 Aug 2019 02:22:28 +0430 Subject: [fastcdr] Update library 1.0.10 (#7862) --- ports/fastcdr/CONTROL | 2 +- ports/fastcdr/portfile.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/fastcdr/CONTROL b/ports/fastcdr/CONTROL index e91ebcfe4..0981a55f4 100644 --- a/ports/fastcdr/CONTROL +++ b/ports/fastcdr/CONTROL @@ -1,3 +1,3 @@ Source: fastcdr -Version: 1.0.10 +Version: 1.0.10 Description: eProsima FastCDR is a C++ library that provides two serialization mechanisms. One is the standard CDR serialization mechanism, while the other is a faster implementation that modifies the standard. diff --git a/ports/fastcdr/portfile.cmake b/ports/fastcdr/portfile.cmake index 9f09bce06..ca29c1adf 100644 --- a/ports/fastcdr/portfile.cmake +++ b/ports/fastcdr/portfile.cmake @@ -3,8 +3,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO eProsima/Fast-CDR - REF 649b9a0e763f8a4cfdd41238b1495c58b7ea6660 - SHA512 9a72c60f59572ec95b320a44f10ba841cb66d3f71e4ebb2b8f00f42400ea9dd379d884937b047206cdeb19f7c298782b3557113b9fb6a1b79a3a9e3592cb1eb9 + REF v1.0.10 + SHA512 b79439b1d8be12e10c761b42cadce4b5e9e51be23a553a0276bcf84504e222149c6543cde149073f272f0374e82a3e0db6b7ad25e81858f744a8ce72512c47de HEAD_REF master PATCHES install-cmake.patch ) -- cgit v1.2.3 From 85d575c0ab9abbd111b819b1dfdec031c1a099b4 Mon Sep 17 00:00:00 2001 From: Lily <47812810+wangli28@users.noreply.github.com> Date: Wed, 28 Aug 2019 06:44:26 +0800 Subject: [moos-ui] Fix install path (#7812) --- ports/moos-ui/CONTROL | 4 +--- ports/moos-ui/portfile.cmake | 19 ++++++++----------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/ports/moos-ui/CONTROL b/ports/moos-ui/CONTROL index 08279ce15..8894e8b09 100644 --- a/ports/moos-ui/CONTROL +++ b/ports/moos-ui/CONTROL @@ -1,7 +1,5 @@ Source: moos-ui -Version: 10.0.1-1 +Version: 10.0.1-2 Description: set of user interface tools to use and leverage the MOOS project. Homepage: https://sites.google.com/site/moossoftware/ Build-Depends: moos-core - - diff --git a/ports/moos-ui/portfile.cmake b/ports/moos-ui/portfile.cmake index 3f4b880e2..55cbebb7f 100644 --- a/ports/moos-ui/portfile.cmake +++ b/ports/moos-ui/portfile.cmake @@ -19,19 +19,16 @@ vcpkg_configure_cmake( vcpkg_install_cmake() file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/MOOS) -if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/uPoke") - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/uPoke ${CURRENT_PACKAGES_DIR}/tools/MOOS/uPoke) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/iRemoteLite ${CURRENT_PACKAGES_DIR}/tools/MOOS/iRemoteLite) +if (VCPKG_TARGET_IS_WINDOWS) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/uPoke.exe ${CURRENT_PACKAGES_DIR}/tools/MOOS/uPoke.exe) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/iRemoteLite.exe ${CURRENT_PACKAGES_DIR}/tools/MOOS/iRemoteLite.exe) +else() + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/uPoke ${CURRENT_PACKAGES_DIR}/tools/MOOS/uPoke) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/iRemoteLite ${CURRENT_PACKAGES_DIR}/tools/MOOS/iRemoteLite) endif() +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/MOOS) -# file(RENAME ${CURRENT_PACKAGES_DIR}/bin/uMS ${CURRENT_PACKAGES_DIR}/tools/uMS) -# file(RENAME ${CURRENT_PACKAGES_DIR}/bin/uPlayback ${CURRENT_PACKAGES_DIR}/tools/uPlayback) -# file(RENAME ${CURRENT_PACKAGES_DIR}/bin/pShare ${CURRENT_PACKAGES_DIR}/tools/pShare) -#endif() - -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug) -endif() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug) file(WRITE ${CURRENT_PACKAGES_DIR}/include/fake_header_ui.h "// fake header to pass vcpkg post install check \n") file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "see moos-core for copyright\n" ) -- cgit v1.2.3 From b23e2fc941d9a1a9db99b47b25cf651204828e1c Mon Sep 17 00:00:00 2001 From: JackBoosY <47264268+JackBoosY@users.noreply.github.com> Date: Wed, 28 Aug 2019 06:45:25 +0800 Subject: [openni2]Add warning message when cannot find NETFXSDK. (#7809) * [openni2]Add warning message when cannot find NETFXSDK. * [openni2]Move warning at top. --- ports/openni2/CONTROL | 2 +- ports/openni2/portfile.cmake | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ports/openni2/CONTROL b/ports/openni2/CONTROL index 9dca0b47a..a68d575ba 100644 --- a/ports/openni2/CONTROL +++ b/ports/openni2/CONTROL @@ -1,5 +1,5 @@ Source: openni2 -Version: 2.2.0.33-9 +Version: 2.2.0.33-10 Build-Depends: kinectsdk1 Homepage: https://github.com/OpenNI/OpenNI2 Description: OpenNI is open source library for access to Natural Interaction (NI) devices such as RGB-D camera. diff --git a/ports/openni2/portfile.cmake b/ports/openni2/portfile.cmake index d5be0e3d4..b7064a12c 100644 --- a/ports/openni2/portfile.cmake +++ b/ports/openni2/portfile.cmake @@ -1,8 +1,15 @@ include(vcpkg_common_functions) + if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") message(FATAL_ERROR "Error: UWP builds are currently not supported.") endif() +find_path(COR_H_PATH cor.h) +if(COR_H_PATH MATCHES "NOTFOUND") + message(FATAL_ERROR "Could not find . Ensure the NETFXSDK is installed.") +endif() +get_filename_component(NETFXSDK_PATH "${COR_H_PATH}/../.." ABSOLUTE) + vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_from_github( @@ -11,13 +18,9 @@ vcpkg_from_github( REF 2.2-beta2 SHA512 60a3a3043679f3069aea869e92dc5881328ce4393d4140ea8d089027321ac501ae27d283657214e2834d216d0d49bf4f29a4b3d3e43df27a6ed21f889cd0083f HEAD_REF master -) - -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES "${CMAKE_CURRENT_LIST_DIR}/upgrade_projects.patch" - "${CMAKE_CURRENT_LIST_DIR}/inherit_from_parent_or_project_defaults.patch" - "${CMAKE_CURRENT_LIST_DIR}/replace_environment_variable.patch" + PATCHES upgrade_projects.patch + inherit_from_parent_or_project_defaults.patch + replace_environment_variable.patch ) file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) @@ -34,6 +37,7 @@ configure_file("${SOURCE_PATH}/Source/Drivers/Kinect/Kinect.vcxproj" "${SOURCE_P # Build OpenNI2 vcpkg_build_msbuild( PROJECT_PATH "${SOURCE_PATH}/OpenNI.sln" + OPTIONS "/p:DotNetSdkRoot=${NETFXSDK_PATH}/" ) # Install OpenNI2 -- cgit v1.2.3 From d143827ae8649ddcfd482a3fecfbebca4b740659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Wed, 28 Aug 2019 00:49:31 +0200 Subject: [pcre] Update download URL (#7666) * [pcre] Update download URL - ftp.csx.cam.ac.uk is no longer available. Use https://ftp.pcre.org/pub/pcre/ instead * [pcre] Fix typo in Description of CONTROL file --- ports/pcre/CONTROL | 2 +- ports/pcre/portfile.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/pcre/CONTROL b/ports/pcre/CONTROL index 46e041be2..5d0ac0af2 100644 --- a/ports/pcre/CONTROL +++ b/ports/pcre/CONTROL @@ -1,3 +1,3 @@ Source: pcre Version: 8.41-2 -Description: Perl Compatible Regular Expresions +Description: Perl Compatible Regular Expressions diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index ac99a478b..0df704075 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -10,7 +10,7 @@ set(PCRE_VERSION 8.41) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pcre-${PCRE_VERSION}) vcpkg_download_distfile(ARCHIVE - URLS "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${PCRE_VERSION}.zip" + URLS "https://ftp.pcre.org/pub/pcre/pcre-${PCRE_VERSION}.zip" "https://downloads.sourceforge.net/project/pcre/pcre/${PCRE_VERSION}/pcre-${PCRE_VERSION}.zip" FILENAME "pcre-${PCRE_VERSION}.zip" SHA512 a3fd57090a5d9ce9d608aeecd59f42f04deea5b86a5c5899bdb25b18d8ec3a89b2b52b62e325c6485a87411eb65f1421604f80c3eaa653bd7dbab05ad22795ea -- cgit v1.2.3 From 4fd3b5bfbb2edb97a553666842a6232f227f95b7 Mon Sep 17 00:00:00 2001 From: Phoebe <925731795@qq.com> Date: Wed, 28 Aug 2019 06:52:18 +0800 Subject: [abseil fix cmake config issue (#7745) --- ports/abseil/CONTROL | 2 +- ports/abseil/fix-config.patch | 26 ++++++++++++++++++++++++++ ports/abseil/portfile.cmake | 6 ++++-- 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 ports/abseil/fix-config.patch diff --git a/ports/abseil/CONTROL b/ports/abseil/CONTROL index b611fe9e7..63d5e26f0 100644 --- a/ports/abseil/CONTROL +++ b/ports/abseil/CONTROL @@ -1,5 +1,5 @@ Source: abseil -Version: 2019-05-08 +Version: 2019-05-08-1 Homepage: https://github.com/abseil/abseil-cpp Description: an open-source collection designed to augment the C++ standard library. Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google's own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives. diff --git a/ports/abseil/fix-config.patch b/ports/abseil/fix-config.patch new file mode 100644 index 000000000..daa5dd3a4 --- /dev/null +++ b/ports/abseil/fix-config.patch @@ -0,0 +1,26 @@ +diff --git a/CMake/abslConfig.cmake.in b/CMake/abslConfig.cmake.in +index 60847fa..4641d44 100644 +--- a/CMake/abslConfig.cmake.in ++++ b/CMake/abslConfig.cmake.in +@@ -4,4 +4,8 @@ include(FindThreads) + + @PACKAGE_INIT@ + ++include(CMakeFindDependencyMacro) ++ ++set_and_check(absl_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") ++ + include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +\ No newline at end of file +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e7587f7..3079534 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -132,6 +132,7 @@ if(ABSL_ENABLE_INSTALL) + CMake/abslConfig.cmake.in + "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" + INSTALL_DESTINATION "${ABSL_INSTALL_CONFIGDIR}" ++ PATH_VARS CMAKE_INSTALL_INCLUDEDIR + ) + install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" + DESTINATION "${ABSL_INSTALL_CONFIGDIR}" diff --git a/ports/abseil/portfile.cmake b/ports/abseil/portfile.cmake index 1c2993332..22f3bc349 100644 --- a/ports/abseil/portfile.cmake +++ b/ports/abseil/portfile.cmake @@ -12,7 +12,9 @@ vcpkg_from_github( REF aa468ad75539619b47979911297efbb629c52e44 SHA512 4254d8599103d8f06b03f60a0386eba07f314184217d0bca404d41fc0bd0a8df287fe6d07158d10cde096af3097aff2ecc1a5e8f7c3046ecf956b5fde709ad1d HEAD_REF master - PATCHES fix-usage-lnk-error.patch + PATCHES + fix-usage-lnk-error.patch + fix-config.patch ) vcpkg_configure_cmake( @@ -21,7 +23,7 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/absl) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/absl TARGET_PATH share/absl) vcpkg_copy_pdbs() -- cgit v1.2.3 From 408990caef15655705d407aff4f5edb32916add0 Mon Sep 17 00:00:00 2001 From: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Date: Tue, 27 Aug 2019 15:53:18 -0700 Subject: [minifb] Add new port (#7766) * [minifb] Add new port * Fix arm build error * Add fix-arm-build-error.patch file * Update fix-arm-build-error.patch file --- ports/minifb/CONTROL | 4 +++ ports/minifb/fix-arm-build-error.patch | 40 +++++++++++++++++++++++++ ports/minifb/fix-build-error.patch | 25 ++++++++++++++++ ports/minifb/fix-install-error.patch | 54 ++++++++++++++++++++++++++++++++++ ports/minifb/portfile.cmake | 32 ++++++++++++++++++++ 5 files changed, 155 insertions(+) create mode 100644 ports/minifb/CONTROL create mode 100644 ports/minifb/fix-arm-build-error.patch create mode 100644 ports/minifb/fix-build-error.patch create mode 100644 ports/minifb/fix-install-error.patch create mode 100644 ports/minifb/portfile.cmake diff --git a/ports/minifb/CONTROL b/ports/minifb/CONTROL new file mode 100644 index 000000000..cff3a97c0 --- /dev/null +++ b/ports/minifb/CONTROL @@ -0,0 +1,4 @@ +Source: minifb +Version: 2019-08-20-1 +Homepage: https://github.com/emoon/minifb +Description: MiniFB (Mini FrameBuffer) is a small cross platform library that makes it easy to render (32-bit) pixels in a window. diff --git a/ports/minifb/fix-arm-build-error.patch b/ports/minifb/fix-arm-build-error.patch new file mode 100644 index 000000000..66579d449 --- /dev/null +++ b/ports/minifb/fix-arm-build-error.patch @@ -0,0 +1,40 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 06ba472..0f5874c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -54,6 +54,27 @@ add_library(minifb STATIC + ${SrcLib} + ) + ++if (WIN32) ++add_executable(noise ++ tests/noise.c ++) ++target_link_libraries(noise minifb Gdi32.lib) ++ ++add_executable(input_events ++ tests/input_events.c ++) ++target_link_libraries(input_events minifb Gdi32.lib) ++ ++add_executable(input_events_cpp ++ tests/input_events_cpp.cpp ++) ++target_link_libraries(input_events_cpp minifb Gdi32.lib) ++ ++add_executable(multiple_windows ++ tests/multiple_windows.c ++) ++target_link_libraries(multiple_windows minifb Gdi32.lib) ++else() + add_executable(noise + tests/noise.c + ) +@@ -73,6 +94,7 @@ add_executable(multiple_windows + tests/multiple_windows.c + ) + target_link_libraries(multiple_windows minifb) ++endif() + + if (MSVC) + elseif (MINGW) diff --git a/ports/minifb/fix-build-error.patch b/ports/minifb/fix-build-error.patch new file mode 100644 index 000000000..e1a4c0775 --- /dev/null +++ b/ports/minifb/fix-build-error.patch @@ -0,0 +1,25 @@ +diff --git a/src/windows/WinMiniFB.c b/src/windows/WinMiniFB.c +index 84ed0cb..b33f252 100644 +--- a/src/windows/WinMiniFB.c ++++ b/src/windows/WinMiniFB.c +@@ -19,7 +19,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) + { + LRESULT res = 0; + +- SWindowData *window_data = (SWindowData *) GetWindowLongPtr(hWnd, GWL_USERDATA); ++ SWindowData *window_data = (SWindowData *) GetWindowLongPtr(hWnd, GWLP_USERDATA); + SWindowData_Win *window_data_win = 0x0; + if(window_data != 0x0) { + window_data_win = (SWindowData_Win *) window_data->specific; +diff --git a/tests/multiple_windows.c b/tests/multiple_windows.c +index 4b301c0..29276be 100644 +--- a/tests/multiple_windows.c ++++ b/tests/multiple_windows.c +@@ -1,6 +1,7 @@ + #include + #include + #include ++#define _USE_MATH_DEFINES + #include + + #define kUnused(var) (void) var; diff --git a/ports/minifb/fix-install-error.patch b/ports/minifb/fix-install-error.patch new file mode 100644 index 000000000..64f5af046 --- /dev/null +++ b/ports/minifb/fix-install-error.patch @@ -0,0 +1,54 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 06ba472..6dc7988 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,6 +17,12 @@ file(GLOB SrcMacOSX "src/macosx/*.c" + file(GLOB SrcWayland "src/wayland/*.c") + file(GLOB SrcX11 "src/x11/*.c") + ++file(GLOB HEADERS "include/*.h") ++file(GLOB HeaderWindows "src/windows/*.h") ++file(GLOB HeaderMacOSX "src/macosx/*.h") ++file(GLOB HeaderWayland "src/wayland/*.h") ++file(GLOB HeaderX11 "src/x11/*.h") ++ + if (NOT MSVC) + set (CMAKE_C_FLAGS "-g -Wall -Wextra -pedantic -Wno-switch -Wno-unused-function") + set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11") +@@ -34,19 +40,24 @@ if (MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + add_definitions(-D_WIN32_WINNT=0x0600) + list (APPEND SrcLib ${SrcWindows}) ++ list (APPEND HEADERS ${HeaderWindows}) + elseif (MINGW) + add_definitions(-D_WIN32_WINNT=0x0600) + list(APPEND SrcLib ${SrcWindows}) ++ list (APPEND HEADERS ${HeaderWindows}) + elseif (APPLE) + if(USE_METAL_API) + add_definitions(-DUSE_METAL_API) + endif() + list(APPEND SrcLib ${SrcMacOSX}) ++ list (APPEND HEADERS ${HeaderMacOSX}) + elseif (UNIX) + if(USE_WAYLAND_API) + list(APPEND SrcLib ${SrcWayland}) ++ list (APPEND HEADERS ${HeaderWayland}) + else() + list(APPEND SrcLib ${SrcX11}) ++ list (APPEND HEADERS ${HeaderX11}) + endif() + endif() + +@@ -112,3 +123,11 @@ elseif (UNIX) + target_link_libraries(multiple_windows -lX11) + endif() + endif() ++ ++install(TARGETS minifb ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib ++ ) ++ ++install(FILES ${HEADERS} DESTINATION include) diff --git a/ports/minifb/portfile.cmake b/ports/minifb/portfile.cmake new file mode 100644 index 000000000..d4ea8c676 --- /dev/null +++ b/ports/minifb/portfile.cmake @@ -0,0 +1,32 @@ +include(vcpkg_common_functions) + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + message(FATAL_ERROR "${PORT} currently doesn't supports UWP.") +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO emoon/minifb + REF 25a440f8226f12b8014d24288ad0587724005afc + SHA512 e54d86e43193d22263003a9539b11cc61cfd4a1b7093c982165cdd6e6f150b431a44e7d4dc8512b62b9853a7605e29cee19f85b8d25a34b3b530f9aa41a2f4a9 + HEAD_REF master + PATCHES + fix-install-error.patch + fix-build-error.patch + fix-arm-build-error.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) \ No newline at end of file -- cgit v1.2.3 From cb48082e5c2afdd9355c0ff1d625cceaa29e1102 Mon Sep 17 00:00:00 2001 From: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Date: Tue, 27 Aug 2019 15:56:20 -0700 Subject: [log4cpp] Add new port. (#7433) --- ports/log4cpp/CONTROL | 5 +++++ ports/log4cpp/fix-install-targets.patch | 13 ++++++++++++ ports/log4cpp/portfile.cmake | 36 +++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 ports/log4cpp/CONTROL create mode 100644 ports/log4cpp/fix-install-targets.patch create mode 100644 ports/log4cpp/portfile.cmake diff --git a/ports/log4cpp/CONTROL b/ports/log4cpp/CONTROL new file mode 100644 index 000000000..9706c1316 --- /dev/null +++ b/ports/log4cpp/CONTROL @@ -0,0 +1,5 @@ +Source: log4cpp +Version: 2.9.1-1 +Homepage: https://github.com/orocos-toolchain/log4cpp +Description: Log4cpp is library of C++ classes for flexible logging to files, syslog, IDSA and other destinations. It is modeled after the Log4j Java library, staying as close to their API as is reasonable. + diff --git a/ports/log4cpp/fix-install-targets.patch b/ports/log4cpp/fix-install-targets.patch new file mode 100644 index 000000000..49cdedf1d --- /dev/null +++ b/ports/log4cpp/fix-install-targets.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8db2287..529c18e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -159,7 +159,7 @@ INSTALL ( + INSTALL(TARGETS ${LOG4CPP_LIBRARY_NAME} + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +- RUNTIME DESTINATION lib) ++ RUNTIME DESTINATION bin) + + INSTALL(FILES package.xml DESTINATION share/log4cpp) + diff --git a/ports/log4cpp/portfile.cmake b/ports/log4cpp/portfile.cmake new file mode 100644 index 000000000..56688c6f7 --- /dev/null +++ b/ports/log4cpp/portfile.cmake @@ -0,0 +1,36 @@ +include(vcpkg_common_functions) + +if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") + message(FATAL_ERROR "${PORT} does not currently support UWP.") +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO orocos-toolchain/log4cpp + REF v2.9.1 + SHA512 5bd222c820a15c5d96587ac9fe864c3e2dc0fbce8389692be8dd41553ac0308002ad8d6f4ef3ef10af1d796f8ded410788d1a5d22f15505fac639da3f73e3518 + HEAD_REF master + PATCHES + fix-install-targets.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/pkgconfig TARGET_PATH share/${PORT}) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + +vcpkg_copy_pdbs() + +# Handle copyright +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) -- cgit v1.2.3 From 39d7ee57eb2625af524ea998306120a190786950 Mon Sep 17 00:00:00 2001 From: Thad House Date: Tue, 27 Aug 2019 16:05:04 -0700 Subject: [wpilib] Update wpilib port to allow opencv4 (#7927) * Update WPILib to allow OpenCV 4 support The existing version only supported OpenCV 3, OpenCV 4 support has been added recently * Update wpilib port to allow opencv4 Was only compatible with opencv3, and would fail to build with 4. Also had to update to include eigen, since we now depend on that as well * Use test package to ensure PR passes * Attempt to get mac working * Revert to upstream repo --- ports/wpilib/CONTROL | 6 +++--- ports/wpilib/portfile.cmake | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ports/wpilib/CONTROL b/ports/wpilib/CONTROL index a7542e8b8..b37784225 100644 --- a/ports/wpilib/CONTROL +++ b/ports/wpilib/CONTROL @@ -1,6 +1,6 @@ Source: wpilib -Version: 2019.5.1 -Build-Depends: libuv +Version: 2019.6.1 +Build-Depends: eigen3, libuv Description: WPILib is the software library package for the FIRST Robotics Competition. The core install includes wpiutil, a common utilies library, and ntcore, the base NetworkTables library. Feature: cameraserver @@ -8,5 +8,5 @@ Build-Depends: opencv Description: Enables the CameraServer and CSCore libraries for manipulating USB Cameras and HTTP Camera Streams Feature: allwpilib -Build-Depends: wpilib[cameraserver] opencv +Build-Depends: wpilib[cameraserver], opencv Description: Enables the simulation HAL, and the high level wpilibc library. diff --git a/ports/wpilib/portfile.cmake b/ports/wpilib/portfile.cmake index 314f0111b..4500400c7 100644 --- a/ports/wpilib/portfile.cmake +++ b/ports/wpilib/portfile.cmake @@ -3,8 +3,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wpilibsuite/allwpilib - REF 3dfb01d45b971ffdfeea50ce58653eff592807d9 - SHA512 188923cbe166f5812a24a06d8af56bda289aaed38231d45583d423e51e9cd23bb257ade02fdc26e8d0fdd6cdcb793282c04ac80ebad76f29fdbd0a3c1a10f05c + REF d10a1a797720014197c21dee38fdced73454dca4 + SHA512 a76e8652b6d6a921d466e08bcf162ee1b28c06af031b616b2333f8a9479ffd12d1c301182dac86e5d7d59909a21cbee4e551028393df80671336546c14ecf606 ) set(WITHOUT_JAVA ON) @@ -28,6 +28,7 @@ vcpkg_configure_cmake( -DWITHOUT_CSCORE=${WITHOUT_CSCORE} -DWITHOUT_ALLWPILIB=${WITHOUT_ALLWPILIB} -DUSE_VCPKG_LIBUV=ON + -DUSE_VCPKG_EIGEN=ON -DFLAT_INSTALL_WPILIB=ON ) vcpkg_install_cmake() -- cgit v1.2.3 From fc135e20eae801bcd6a20ddb8fba677f61dba5a5 Mon Sep 17 00:00:00 2001 From: zi-m <53815290+zi-m@users.noreply.github.com> Date: Wed, 28 Aug 2019 01:05:16 +0200 Subject: chartdir (#7912) --- ports/chartdir/CONTROL | 4 ++ ports/chartdir/Config.cmake.in | 21 +++++++++ ports/chartdir/chartdir.h | 6 +++ ports/chartdir/portfile.cmake | 96 ++++++++++++++++++++++++++++++++++++++++++ ports/chartdir/usage | 4 ++ 5 files changed, 131 insertions(+) create mode 100644 ports/chartdir/CONTROL create mode 100644 ports/chartdir/Config.cmake.in create mode 100644 ports/chartdir/chartdir.h create mode 100644 ports/chartdir/portfile.cmake create mode 100644 ports/chartdir/usage diff --git a/ports/chartdir/CONTROL b/ports/chartdir/CONTROL new file mode 100644 index 000000000..b34dadb6a --- /dev/null +++ b/ports/chartdir/CONTROL @@ -0,0 +1,4 @@ +Source: chartdir +Version: 6.3.1 +Homepage: https://www.advsofteng.com/ +Description: ChartDirector is a powerful chart component for creating professional looking charts for web and windows applications. diff --git a/ports/chartdir/Config.cmake.in b/ports/chartdir/Config.cmake.in new file mode 100644 index 000000000..d943c4a81 --- /dev/null +++ b/ports/chartdir/Config.cmake.in @@ -0,0 +1,21 @@ + +get_filename_component(_chartdir_root "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_chartdir_root "${_chartdir_root}" PATH) +get_filename_component(_chartdir_root "${_chartdir_root}" PATH) + +set(_chartdir_lib "${_chartdir_root}/lib/@CHARTDIR_LIB@") +if (EXISTS "${_chartdir_lib}") + + add_library(chartdir UNKNOWN IMPORTED) + set_target_properties(chartdir PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_chartdir_root}/include") + set_target_properties(chartdir PROPERTIES IMPORTED_LOCATION "${_chartdir_lib}") + set_property(TARGET chartdir APPEND PROPERTY IMPORTED_CONFIGURATIONS) + +else() + + set(chartdir_FOUND FALSE) + +endif() +unset(_chartdir_lib) + +unset(_chartdir_root) diff --git a/ports/chartdir/chartdir.h b/ports/chartdir/chartdir.h new file mode 100644 index 000000000..2fa308a07 --- /dev/null +++ b/ports/chartdir/chartdir.h @@ -0,0 +1,6 @@ +#ifndef __CHARTDIR_H__ +#define __CHARTDIR_H__ + +#include + +#endif // __CHARTDIR_H__ diff --git a/ports/chartdir/portfile.cmake b/ports/chartdir/portfile.cmake new file mode 100644 index 000000000..630d36c94 --- /dev/null +++ b/ports/chartdir/portfile.cmake @@ -0,0 +1,96 @@ +include(vcpkg_common_functions) + +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +if(TRIPLET_SYSTEM_ARCH MATCHES "arm" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR VCPKG_LIBRARY_LINKAGE STREQUAL static) + + set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +elseif(VCPKG_TARGET_IS_WINDOWS) + + vcpkg_download_distfile(ARCHIVE_FILE + URLS "http://www.advsofteng.net/chartdir_cpp_win.zip" + FILENAME "chartdir_cpp_win-6.3.1.zip" + SHA512 e9841d4416c833f57439a36cb981a9c320884c655f8278a22690f05a215c87f0bba83406b45e03ea384c015a4619852c7a9b36dcc9dbd7d531dee1c07b5cffe9 + ) + + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE_FILE} + REF 6.3.1 + ) + + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(LIBDIR "${SOURCE_PATH}/lib64") + else() + set(LIBDIR "${SOURCE_PATH}/lib32") + endif() + + file(COPY "${LIBDIR}/chartdir60.dll" DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + file(COPY "${LIBDIR}/chartdir60.lib" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(COPY "${LIBDIR}/chartdir60.dll" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(COPY "${LIBDIR}/chartdir60.lib" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + + set(CHARTDIR_LIB "chartdir60.lib") + +elseif(VCPKG_TARGET_IS_OSX) + + vcpkg_download_distfile(ARCHIVE_FILE + URLS "https://www.advsofteng.net/chartdir_cpp_mac.tar.gz" + FILENAME "chartdir_cpp_mac-6.3.1.tar.gz" + SHA512 50a6b8d80a65a1e723808ce6722c7ec8b1457f1c63d187ce487b71b7d1d820f64301729d034ca99ddcea13ec0db8dab9fd14262023c24a6f9ecf196a0cac800d + ) + + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE_FILE} + REF 6.3.1 + ) + + file(COPY "${SOURCE_PATH}/lib/libchartdir.6.dylib" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(COPY "${SOURCE_PATH}/lib/libchartdir.6.dylib" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + + set(CHARTDIR_LIB "libchartdir.6.dylib") + +elseif(VCPKG_TARGET_IS_LINUX) + + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + + vcpkg_download_distfile(ARCHIVE_FILE + URLS "http://www.advsofteng.net/chartdir_cpp_linux_64.tar.gz" + FILENAME "chartdir_cpp_linux_64-6.3.1.tar.gz" + SHA512 e6a3acee3cc5f38304ffa0d3704b1365fcc7a60c8bb688f121caa31efa568b74598b4e10379e84200888d9d8dc3cd7a6a24a944c2d63ca5a146162854c6222a9 + ) + + else() + + vcpkg_download_distfile(ARCHIVE_FILE + URLS "http://www.advsofteng.net/chartdir_cpp_linux.tar.gz" + FILENAME "chartdir_cpp_linux-6.3.1.tar.gz" + SHA512 0a2f2d7c8d53c2f06c302a837f286826b4f48cc5f5bdb55c4de23337bc4188d1652625aee2c8061561d9b5bdef5e0e2a4cdd176d44ca60c1f730e4f38299c5a0 + ) + + endif() + + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE_FILE} + REF 6.3.1 + ) + + file(COPY "${SOURCE_PATH}/lib/libchartdir.so.6.0.3" DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(COPY "${SOURCE_PATH}/lib/libchartdir.so.6.0.3" DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + + set(CHARTDIR_LIB "libchartdir.so.6.0.3") + + file(COPY ${SOURCE_PATH}/lib/fonts DESTINATION ${CURRENT_PACKAGES_DIR}/share/chartdir) + +endif() + +file(GLOB HEADERS "${SOURCE_PATH}/include/*.h") +file(COPY ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include/chartdir) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/chartdir.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +configure_file(${SOURCE_PATH}/LICENSE.TXT ${CURRENT_PACKAGES_DIR}/share/chartdir/copyright COPYONLY) +configure_file(${CMAKE_CURRENT_LIST_DIR}/Config.cmake.in ${CURRENT_PACKAGES_DIR}/share/chartdir/chartdir-config.cmake @ONLY) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/chartdir) diff --git a/ports/chartdir/usage b/ports/chartdir/usage new file mode 100644 index 000000000..a270b780e --- /dev/null +++ b/ports/chartdir/usage @@ -0,0 +1,4 @@ +The package chartdir provides CMake targets: + + find_package(chartdir CONFIG REQUIRED) + target_link_libraries(main PRIVATE chartdir) -- cgit v1.2.3 From a2e6a77b3b77050a488f391a78dc1e4f777e475c Mon Sep 17 00:00:00 2001 From: Phoebe Date: Tue, 27 Aug 2019 23:52:17 -0700 Subject: [outcome] Add new port --- ports/outcome/CONTROL | 6 ++++++ ports/outcome/portfile.cmake | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 ports/outcome/CONTROL create mode 100644 ports/outcome/portfile.cmake diff --git a/ports/outcome/CONTROL b/ports/outcome/CONTROL new file mode 100644 index 000000000..cdbbc204e --- /dev/null +++ b/ports/outcome/CONTROL @@ -0,0 +1,6 @@ +Source: outcome +Version: 2.1 +Homepage: https://github.com/ned14/outcome +Description: Provides very lightweight outcome and result (non-Boost edition) + + diff --git a/ports/outcome/portfile.cmake b/ports/outcome/portfile.cmake new file mode 100644 index 000000000..5ca0936a0 --- /dev/null +++ b/ports/outcome/portfile.cmake @@ -0,0 +1,17 @@ +# single header file + +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ned14/outcome + REF 525478ed519d7c3400d60110649c315d705a07ad #v2.1 + SHA512 cf05f7c09ced02fa5fe3d9ad6533358a2fb63e31b5d5be81c16c285250cd275467217b8f9364b4ff1947d8c4aa6a86e10cef310d8475dcd9f7a0a713f1a01c8e + HEAD_REF develop +) + +file(GLOB_RECURSE OUTCOME_HEADERS "${SOURCE_PATH}/single-header/*.hpp") + +file(INSTALL ${OUTCOME_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +file(INSTALL ${SOURCE_PATH}/Licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From eccf5f8e04464c91f061a3647f0a99b2a018b191 Mon Sep 17 00:00:00 2001 From: Phoebe Date: Tue, 27 Aug 2019 23:54:22 -0700 Subject: Remove blank lines --- ports/outcome/CONTROL | 4 +--- ports/outcome/portfile.cmake | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/outcome/CONTROL b/ports/outcome/CONTROL index cdbbc204e..a90346b67 100644 --- a/ports/outcome/CONTROL +++ b/ports/outcome/CONTROL @@ -1,6 +1,4 @@ Source: outcome Version: 2.1 Homepage: https://github.com/ned14/outcome -Description: Provides very lightweight outcome and result (non-Boost edition) - - +Description: Provides very lightweight outcome and result (non-Boost edition) \ No newline at end of file diff --git a/ports/outcome/portfile.cmake b/ports/outcome/portfile.cmake index 5ca0936a0..a9686b31c 100644 --- a/ports/outcome/portfile.cmake +++ b/ports/outcome/portfile.cmake @@ -11,7 +11,6 @@ vcpkg_from_github( ) file(GLOB_RECURSE OUTCOME_HEADERS "${SOURCE_PATH}/single-header/*.hpp") - file(INSTALL ${OUTCOME_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) file(INSTALL ${SOURCE_PATH}/Licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From 8008618cf9ece916daaf31de37c5d5131fff169e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Aug 2019 17:50:52 +0430 Subject: [liblsl] Fix installation --- ports/liblsl/fix-install.patch | 13 ------------- ports/liblsl/portfile.cmake | 8 ++++++-- 2 files changed, 6 insertions(+), 15 deletions(-) delete mode 100644 ports/liblsl/fix-install.patch diff --git a/ports/liblsl/fix-install.patch b/ports/liblsl/fix-install.patch deleted file mode 100644 index 66bfe0b18..000000000 --- a/ports/liblsl/fix-install.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6f2b0ff..c22360f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -184,7 +184,7 @@ else() - set(LSLPREFIX "LSL/") - endif() - --add_executable(lslver testing/lslver.c) -+add_library(lslver STATIC testing/lslver.c) - target_link_libraries(lslver PRIVATE lsl) - - install(TARGETS lsl lslver diff --git a/ports/liblsl/portfile.cmake b/ports/liblsl/portfile.cmake index 8009f37de..ecf840985 100644 --- a/ports/liblsl/portfile.cmake +++ b/ports/liblsl/portfile.cmake @@ -8,8 +8,6 @@ vcpkg_from_github( REF 1.13.0-b11 # NOTE: when updating version, also change it in the parameter to vcpkg_configure_cmake SHA512 212f28070b8239dc176d2e35bf4091896babbf7688e4cbe1c2bb0c3788f317ce2a80f92d4b008c6e577b01a09e8faf65228d396ff13e9ade0c1ffdc5e08cb9e5 HEAD_REF master - PATCHES - fix-install.patch ) vcpkg_configure_cmake( @@ -29,5 +27,11 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +if(WIN32) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/lslver.exe) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/lslver/) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/lslver.exe ${CURRENT_PACKAGES_DIR}/tools/lslver/lslver.exe) +endif() + file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblsl RENAME copyright) file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblsl) -- cgit v1.2.3 From 65d4bc146bf7c1c21989b680497b1f6f9a09c967 Mon Sep 17 00:00:00 2001 From: Victor Romero Date: Wed, 28 Aug 2019 11:47:17 -0700 Subject: [vcpkg install] Enable Download Mode (#7797) * [portfile functions] Override execute_process() to accept ALLOW_IN_DOWNLOAD_MODE option * [vcpkg install] Set VCPKG_DOWNLOAD_MODE when using --only-downloads option * [vcpkg_find_acquire_program] Allow in Download Mode * Don't stop when build fails for a package * Download sources for all packages in dependency graph * Improve output messages * Enable acquiring MSYS packages in download mode * Documentation * Update documentation * execute_process() always fails on Download Mode * Regenerate docs and fix formatting * Run clang-format * Use _execute_process on vcpkg_from_ helpers --- docs/maintainers/execute_process.md | 10 ++++ docs/maintainers/portfile-functions.md | 3 ++ docs/maintainers/vcpkg_common_definitions.md | 19 ++++++++ docs/maintainers/vcpkg_execute_required_process.md | 4 ++ docs/maintainers/vcpkg_fail_port_install.md | 34 +++++++++++++ scripts/cmake/execute_process.cmake | 19 ++++++++ scripts/cmake/vcpkg_acquire_msys.cmake | 8 ++-- scripts/cmake/vcpkg_apply_patches.cmake | 2 +- scripts/cmake/vcpkg_common_functions.cmake | 1 + scripts/cmake/vcpkg_download_distfile.cmake | 2 +- scripts/cmake/vcpkg_execute_required_process.cmake | 18 ++++++- scripts/cmake/vcpkg_extract_source_archive.cmake | 1 + scripts/cmake/vcpkg_find_acquire_program.cmake | 5 +- scripts/cmake/vcpkg_from_git.cmake | 5 +- scripts/cmake/vcpkg_from_gitlab.cmake | 2 +- scripts/cmake/vcpkg_test_cmake.cmake | 55 ---------------------- toolsrc/VERSION.txt | 2 +- toolsrc/include/vcpkg/build.h | 8 ++++ toolsrc/src/vcpkg/build.cpp | 39 +++++++++++---- toolsrc/src/vcpkg/commands.ci.cpp | 2 + toolsrc/src/vcpkg/commands.upgrade.cpp | 1 + toolsrc/src/vcpkg/export.cpp | 1 + toolsrc/src/vcpkg/install.cpp | 18 +++++-- 23 files changed, 181 insertions(+), 78 deletions(-) create mode 100644 docs/maintainers/execute_process.md create mode 100644 docs/maintainers/vcpkg_common_definitions.md create mode 100644 docs/maintainers/vcpkg_fail_port_install.md create mode 100644 scripts/cmake/execute_process.cmake diff --git a/docs/maintainers/execute_process.md b/docs/maintainers/execute_process.md new file mode 100644 index 000000000..cbb339509 --- /dev/null +++ b/docs/maintainers/execute_process.md @@ -0,0 +1,10 @@ +# execute_process + +Intercepts all calls to execute_process() inside portfiles and fails when Download Mode +is enabled. + +In order to execute a process in Download Mode call `_execute_process()` instead. + + +## Source +[scripts/cmake/execute_process.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/execute_process.cmake) diff --git a/docs/maintainers/portfile-functions.md b/docs/maintainers/portfile-functions.md index eadebf49a..bbd5d23ab 100644 --- a/docs/maintainers/portfile-functions.md +++ b/docs/maintainers/portfile-functions.md @@ -1,6 +1,7 @@ # Portfile helper functions +- [execute\_process](execute_process.md) - [vcpkg\_acquire\_msys](vcpkg_acquire_msys.md) - [vcpkg\_add\_to\_path](vcpkg_add_to_path.md) - [vcpkg\_apply\_patches](vcpkg_apply_patches.md) @@ -9,6 +10,7 @@ - [vcpkg\_check\_features](vcpkg_check_features.md) - [vcpkg\_check\_linkage](vcpkg_check_linkage.md) - [vcpkg\_clean\_msbuild](vcpkg_clean_msbuild.md) +- [vcpkg\_common\_definitions](vcpkg_common_definitions.md) - [vcpkg\_configure\_cmake](vcpkg_configure_cmake.md) - [vcpkg\_copy\_pdbs](vcpkg_copy_pdbs.md) - [vcpkg\_copy\_tool\_dependencies](vcpkg_copy_tool_dependencies.md) @@ -17,6 +19,7 @@ - [vcpkg\_execute\_required\_process](vcpkg_execute_required_process.md) - [vcpkg\_extract\_source\_archive](vcpkg_extract_source_archive.md) - [vcpkg\_extract\_source\_archive\_ex](vcpkg_extract_source_archive_ex.md) +- [vcpkg\_fail\_port\_install](vcpkg_fail_port_install.md) - [vcpkg\_find\_acquire\_program](vcpkg_find_acquire_program.md) - [vcpkg\_from\_bitbucket](vcpkg_from_bitbucket.md) - [vcpkg\_from\_git](vcpkg_from_git.md) diff --git a/docs/maintainers/vcpkg_common_definitions.md b/docs/maintainers/vcpkg_common_definitions.md new file mode 100644 index 000000000..3bb922b17 --- /dev/null +++ b/docs/maintainers/vcpkg_common_definitions.md @@ -0,0 +1,19 @@ +# vcpkg_common_definitions + +File contains helpful variabls for portfiles which are commonly needed or used. + +## The following variables are available: +```cmake +VCPKG_TARGET_IS_ with being one of the following: WINDOWS, UWP, LINUX, OSX, ANDROID, FREEBSD. only defined if +VCPKG_TARGET_STATIC_LIBRARY_PREFIX static library prefix for target (same as CMAKE_STATIC_LIBRARY_PREFIX) +VCPKG_TARGET_STATIC_LIBRARY_SUFFIX static library suffix for target (same as CMAKE_STATIC_LIBRARY_SUFFIX) +VCPKG_TARGET_SHARED_LIBRARY_PREFIX shared library prefix for target (same as CMAKE_SHARED_LIBRARY_PREFIX) +VCPKG_TARGET_SHARED_LIBRARY_SUFFIX shared library suffix for target (same as CMAKE_SHARED_LIBRARY_SUFFIX) +``` + +CMAKE_STATIC_LIBRARY_PREFIX, CMAKE_STATIC_LIBRARY_SUFFIX, CMAKE_SHARED_LIBRARY_PREFIX, CMAKE_SHARED_LIBRARY_SUFFIX are defined for the target so that +portfiles are able to use find_library calls to discover dependent libraries within the current triplet for ports. + + +## Source +[scripts/cmake/vcpkg_common_definitions.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_common_definitions.cmake) diff --git a/docs/maintainers/vcpkg_execute_required_process.md b/docs/maintainers/vcpkg_execute_required_process.md index 4b1a7e081..26a116782 100644 --- a/docs/maintainers/vcpkg_execute_required_process.md +++ b/docs/maintainers/vcpkg_execute_required_process.md @@ -11,6 +11,10 @@ vcpkg_execute_required_process( ) ``` ## Parameters +### ALLOW_IN_DOWNLOAD_MODE +Allows the command to execute in Download Mode. +[See execute_process() override](../../scripts/cmake/execute_process.cmake). + ### COMMAND The command to be executed, along with its arguments. diff --git a/docs/maintainers/vcpkg_fail_port_install.md b/docs/maintainers/vcpkg_fail_port_install.md new file mode 100644 index 000000000..b3b48ad5e --- /dev/null +++ b/docs/maintainers/vcpkg_fail_port_install.md @@ -0,0 +1,34 @@ +# vcpkg_fail_port_install + +Fails the current portfile with a (default) error message + +## Usage +```cmake +vcpkg_fail_port_install([MESSAGE ] [ON_TARGET [ ...]] +``` + +## Parameters +### MESSAGE +Additional failure message. If non is given a default message will be displayed depending on the failure condition + +### ALWAYS +will always fail early + +### ON_TARGET +targets for which the build should fail early. Valid targets are from VCPKG_IS_TARGET_ (see vcpkg_common_definitions.cmake) + +### ON_ARCH +architecture for which the build should fail early. + +### ON_CRT_LINKAGE +CRT linkage for which the build should fail early. + +### ON_LIBRARY_LINKAGE +library linkage for which the build should fail early. + +## Examples + +* [aws-lambda-cpp](https://github.com/Microsoft/vcpkg/blob/master/ports/aws-lambda-cpp/portfile.cmake) + +## Source +[scripts/cmake/vcpkg_fail_port_install.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_fail_port_install.cmake) diff --git a/scripts/cmake/execute_process.cmake b/scripts/cmake/execute_process.cmake new file mode 100644 index 000000000..90198e337 --- /dev/null +++ b/scripts/cmake/execute_process.cmake @@ -0,0 +1,19 @@ +## # execute_process +## +## Intercepts all calls to execute_process() inside portfiles and fails when Download Mode +## is enabled. +## +## In order to execute a process in Download Mode call `_execute_process()` instead. +## +if (NOT DEFINED OVERRIDEN_EXECUTE_PROCESS) +set(OVERRIDEN_EXECUTE_PROCESS ON) + +function(execute_process) + message(FATAL_ERROR +[[ + This command cannot be executed in Download Mode. + Halting portfile execution. +]]) +endfunction() + +endif() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index 09090db68..f1f09dc7e 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -81,15 +81,15 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) file(REMOVE_RECURSE ${TOOLPATH}/${TOOLSUBPATH}) file(MAKE_DIRECTORY ${TOOLPATH}) - execute_process( + _execute_process( COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH} WORKING_DIRECTORY ${TOOLPATH} ) - execute_process( + _execute_process( COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman-key --init;pacman-key --populate" WORKING_DIRECTORY ${TOOLPATH} ) - execute_process( + _execute_process( COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -Syu --noconfirm" WORKING_DIRECTORY ${TOOLPATH} ) @@ -104,6 +104,7 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) set(_ENV_ORIGINAL $ENV{PATH}) set(ENV{PATH} ${PATH_TO_ROOT}/usr/bin) vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "pacman -Sy --noconfirm --needed ${_am_PACKAGES}" WORKING_DIRECTORY ${TOOLPATH} LOGNAME msys-pacman-${TARGET_TRIPLET} @@ -116,6 +117,7 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) # Deal with a stale process created by MSYS if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE COMMAND TASKKILL /F /IM gpg-agent.exe /fi "memusage gt 2" WORKING_DIRECTORY ${SOURCE_PATH} ) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index ac0b78e20..9698917de 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -40,7 +40,7 @@ function(vcpkg_apply_patches) get_filename_component(ABSOLUTE_PATCH "${PATCH}" ABSOLUTE BASE_DIR "${CURRENT_PORT_DIR}") message(STATUS "Applying patch ${PATCH}") set(LOGNAME patch-${TARGET_TRIPLET}-${PATCHNUM}) - execute_process( + _execute_process( COMMAND ${GIT} --work-tree=. --git-dir=.git apply "${ABSOLUTE_PATCH}" --ignore-whitespace --whitespace=nowarn --verbose OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-out.log ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-err.log diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index e9e52bad8..5f4155e9d 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -1,3 +1,4 @@ +include(execute_process) include(vcpkg_acquire_msys) include(vcpkg_add_to_path) include(vcpkg_check_features) diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 72016b8c9..1fbff40e5 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -120,7 +120,7 @@ function(vcpkg_download_distfile VAR) list(APPEND request_headers "--header=${header}") endforeach() endif() - execute_process( + _execute_process( COMMAND ${ARIA2} ${vcpkg_download_distfile_URLS} -o temp/${vcpkg_download_distfile_FILENAME} -l download-${vcpkg_download_distfile_FILENAME}-detailed.log diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake index e65d1970a..f25a5b55e 100644 --- a/scripts/cmake/vcpkg_execute_required_process.cmake +++ b/scripts/cmake/vcpkg_execute_required_process.cmake @@ -11,6 +11,10 @@ ## ) ## ``` ## ## Parameters +## ### ALLOW_IN_DOWNLOAD_MODE +## Allows the command to execute in Download Mode. +## [See execute_process() override](../../scripts/cmake/execute_process.cmake). +## ## ### COMMAND ## The command to be executed, along with its arguments. ## @@ -30,10 +34,20 @@ ## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) include(vcpkg_prettify_command) function(vcpkg_execute_required_process) - cmake_parse_arguments(vcpkg_execute_required_process "" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN}) + cmake_parse_arguments(vcpkg_execute_required_process "ALLOW_IN_DOWNLOAD_MODE" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN}) set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log") set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-err.log") - execute_process( + + set(execute_process_function execute_process) + if (DEFINED VCPKG_DOWNLOAD_MODE AND NOT vcpkg_execute_required_process_ALLOW_IN_DOWNLOAD_MODE) + message(FATAL_ERROR +[[ +This command cannot be executed in Download Mode. +Halting portfile execution. +]]) + endif() + + _execute_process( COMMAND ${vcpkg_execute_required_process_COMMAND} OUTPUT_FILE ${LOG_OUT} ERROR_FILE ${LOG_ERR} diff --git a/scripts/cmake/vcpkg_extract_source_archive.cmake b/scripts/cmake/vcpkg_extract_source_archive.cmake index a55419b19..fbae94b55 100644 --- a/scripts/cmake/vcpkg_extract_source_archive.cmake +++ b/scripts/cmake/vcpkg_extract_source_archive.cmake @@ -41,6 +41,7 @@ function(vcpkg_extract_source_archive ARCHIVE) message(STATUS "Extracting source ${ARCHIVE}") file(MAKE_DIRECTORY ${WORKING_DIRECTORY}) vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE COMMAND ${CMAKE_COMMAND} -E tar xjf ${ARCHIVE} WORKING_DIRECTORY ${WORKING_DIRECTORY} LOGNAME extract diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index fed016c7b..aa8a70026 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -302,12 +302,12 @@ function(vcpkg_find_acquire_program VAR) if(ARCHIVE_EXTENSION STREQUAL ".msi") file(TO_NATIVE_PATH "${ARCHIVE_PATH}" ARCHIVE_NATIVE_PATH) file(TO_NATIVE_PATH "${PROG_PATH_SUBDIR}" DESTINATION_NATIVE_PATH) - execute_process( + _execute_process( COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH} WORKING_DIRECTORY ${DOWNLOADS} ) else() - execute_process( + _execute_process( COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH} WORKING_DIRECTORY ${PROG_PATH_SUBDIR} ) @@ -316,6 +316,7 @@ function(vcpkg_find_acquire_program VAR) if(DEFINED POST_INSTALL_COMMAND) vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE COMMAND ${POST_INSTALL_COMMAND} WORKING_DIRECTORY ${PROG_PATH_SUBDIR} LOGNAME ${VAR}-tool-post-install diff --git a/scripts/cmake/vcpkg_from_git.cmake b/scripts/cmake/vcpkg_from_git.cmake index 0db818f80..bad5384ca 100644 --- a/scripts/cmake/vcpkg_from_git.cmake +++ b/scripts/cmake/vcpkg_from_git.cmake @@ -74,16 +74,18 @@ function(vcpkg_from_git) find_program(GIT NAMES git git.cmd) # Note: git init is safe to run multiple times vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE COMMAND ${GIT} init git-tmp WORKING_DIRECTORY ${DOWNLOADS} LOGNAME git-init-${TARGET_TRIPLET} ) vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE COMMAND ${GIT} fetch ${_vdud_URL} ${_vdud_REF} --depth 1 -n WORKING_DIRECTORY ${DOWNLOADS}/git-tmp LOGNAME git-fetch-${TARGET_TRIPLET} ) - execute_process( + _execute_process( COMMAND ${GIT} rev-parse FETCH_HEAD OUTPUT_VARIABLE REV_PARSE_HEAD ERROR_VARIABLE REV_PARSE_HEAD @@ -100,6 +102,7 @@ function(vcpkg_from_git) file(MAKE_DIRECTORY "${DOWNLOADS}/temp") vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE COMMAND ${GIT} archive FETCH_HEAD -o "${TEMP_ARCHIVE}" WORKING_DIRECTORY ${DOWNLOADS}/git-tmp LOGNAME git-archive diff --git a/scripts/cmake/vcpkg_from_gitlab.cmake b/scripts/cmake/vcpkg_from_gitlab.cmake index 6bbe81ed6..05253289e 100644 --- a/scripts/cmake/vcpkg_from_gitlab.cmake +++ b/scripts/cmake/vcpkg_from_gitlab.cmake @@ -150,7 +150,7 @@ function(vcpkg_from_gitlab) endif() # There are issues with the Gitlab API project paths being URL-escaped, so we use git here to get the head revision - execute_process(COMMAND ${GIT} ls-remote + _execute_process(COMMAND ${GIT} ls-remote "${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}.git" "${_vdud_HEAD_REF}" RESULT_VARIABLE _git_result OUTPUT_VARIABLE _git_output diff --git a/scripts/cmake/vcpkg_test_cmake.cmake b/scripts/cmake/vcpkg_test_cmake.cmake index 20343bf64..eeb27867c 100644 --- a/scripts/cmake/vcpkg_test_cmake.cmake +++ b/scripts/cmake/vcpkg_test_cmake.cmake @@ -21,59 +21,4 @@ function(vcpkg_test_cmake) # 2. Select a generator in the same method as vcpkg_configure_cmake() as though the PREFER_NINJA flag was always passed. # 3. Fully emulate the toolchain file for the just-built package (just adding it to CMAKE_PREFIX_PATH is not enough). return() - - cmake_parse_arguments(_tc "MODULE" "PACKAGE_NAME" "" ${ARGN}) - - if(NOT DEFINED _tc_PACKAGE_NAME) - message(FATAL_ERROR "PACKAGE_NAME must be specified") - endif() - if(_tc_MODULE) - set(PACKAGE_TYPE MODULE) - else() - set(PACKAGE_TYPE CONFIG) - endif() - - if(VCPKG_PLATFORM_TOOLSET STREQUAL "v142") - message(STATUS "Skipping CMake integration test due to v142 / CMake interaction issues") - return() - endif() - - message(STATUS "Performing CMake integration test") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) - - #Generate Dummy source -# set(VCPKG_TEST_SOURCE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test/CMakeIntegration.cpp) -# file(WRITE ${VCPKG_TEST_SOURCE} "int main() \{\n") -# file(APPEND ${VCPKG_TEST_SOURCE} "return 0;}") - # Generate test source CMakeLists.txt - set(VCPKG_TEST_CMAKELIST ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test/CMakeLists.txt) - file(WRITE ${VCPKG_TEST_CMAKELIST} "cmake_minimum_required(VERSION 3.10)\n") - file(APPEND ${VCPKG_TEST_CMAKELIST} "set(CMAKE_PREFIX_PATH \"${CURRENT_PACKAGES_DIR};${CURRENT_INSTALLED_DIR}\")\n") - file(APPEND ${VCPKG_TEST_CMAKELIST} "\n") - file(APPEND ${VCPKG_TEST_CMAKELIST} "find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)\n") - #To properly test if the package is actually working haveway correctly we have to link all targets of a package to - #a test executable and than actually build it. This will not discover if every symbol exported by the library is available/linked - #but it will doscover if all files which are linked by a target actual exist. Problem is: How to discover all targets? -# file(APPEND ${VCPKG_TEST_CMAKELIST} "add_executable(${_tc_PACKAGE_NAME}_exe ${VCPKG_TEST_SOURCE})\n") -# file(APPEND ${VCPKG_TEST_CMAKELIST} "target_link_libraries(${_tc_PACKAGE_NAME}_exe PRIVATE ${_tc_PACKAGE_NAME})\n") - - if(DEFINED _VCPKG_CMAKE_GENERATOR) - set(VCPKG_CMAKE_TEST_GENERATOR "${_VCPKG_CMAKE_GENERATOR}") - else() - set(VCPKG_CMAKE_TEST_GENERATOR Ninja) - endif() - - # Run cmake config with a generated CMakeLists.txt - set(LOGPREFIX "${CURRENT_BUILDTREES_DIR}/test-cmake-${TARGET_TRIPLET}") - execute_process( - COMMAND ${CMAKE_COMMAND} -G ${VCPKG_CMAKE_TEST_GENERATOR} . - OUTPUT_FILE "${LOGPREFIX}-out.log" - ERROR_FILE "${LOGPREFIX}-err.log" - RESULT_VARIABLE error_code - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test - ) - if(error_code) - message(FATAL_ERROR "CMake integration test failed; unable to find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)") - endif() endfunction() diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 66247baf7..2dc424b6c 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"2019.08.23" +"2019.08.27" diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index 4f6397662..b535698dc 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -39,6 +39,12 @@ namespace vcpkg::Build YES }; + enum class OnlyDownloads + { + NO = 0, + YES + }; + enum class CleanBuildtrees { NO = 0, @@ -86,6 +92,7 @@ namespace vcpkg::Build { UseHeadVersion use_head_version; AllowDownloads allow_downloads; + OnlyDownloads only_downloads; CleanBuildtrees clean_buildtrees; CleanPackages clean_packages; CleanDownloads clean_downloads; @@ -103,6 +110,7 @@ namespace vcpkg::Build FILE_CONFLICTS, CASCADED_DUE_TO_MISSING_DEPENDENCIES, EXCLUDED, + DOWNLOADED }; static constexpr std::array BUILD_RESULT_VALUES = { diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index 9245ddfbc..e5c00b929 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -53,6 +53,7 @@ namespace vcpkg::Build::Command const Build::BuildPackageOptions build_package_options{ Build::UseHeadVersion::NO, Build::AllowDownloads::YES, + Build::OnlyDownloads::NO, Build::CleanBuildtrees::NO, Build::CleanPackages::NO, Build::CleanDownloads::NO, @@ -407,6 +408,11 @@ namespace vcpkg::Build {"VCPKG_CONCURRENCY", std::to_string(get_concurrency())}, }; + if (Util::Enum::to_bool(config.build_package_options.only_downloads)) + { + variables.push_back({"VCPKG_DOWNLOAD_MODE", "true"}); + } + if (!System::get_environment_variable("VCPKG_FORCE_SYSTEM_BINARIES").has_value()) { variables.push_back({"GIT", git_exe_path}); @@ -528,6 +534,7 @@ namespace vcpkg::Build const BuildPackageConfig& config) { auto& fs = paths.get_filesystem(); + #if defined(_WIN32) const fs::path& powershell_exe_path = paths.get_tool_exe("powershell-core"); if (!fs.exists(powershell_exe_path.parent_path() / "powershell.exe")) @@ -559,6 +566,14 @@ namespace vcpkg::Build #else const int return_code = System::cmd_execute_clean(command, env); #endif + // With the exception of empty packages, builds in "Download Mode" always result in failure. + if (config.build_package_options.only_downloads == Build::OnlyDownloads::YES) + { + // TODO: Capture executed command output and evaluate whether the failure was intended. + // If an unintended error occurs then return a BuildResult::DOWNLOAD_FAILURE status. + return BuildResult::DOWNLOADED; + } + const auto buildtimeus = timer.microseconds(); const auto spec_string = spec.to_string(); @@ -793,20 +808,23 @@ namespace vcpkg::Build const std::string& name = config.scf.core_paragraph->name; std::vector required_fspecs = compute_required_feature_specs(config, status_db); - std::vector required_fspecs_copy = required_fspecs; // extract out the actual package ids auto dep_pspecs = Util::fmap(required_fspecs, [](FeatureSpec const& fspec) { return fspec.spec(); }); Util::sort_unique_erase(dep_pspecs); // Find all features that aren't installed. This mutates required_fspecs. - Util::erase_remove_if(required_fspecs, [&](FeatureSpec const& fspec) { - return status_db.is_installed(fspec) || fspec.name() == name; - }); - - if (!required_fspecs.empty()) + // Skip this validation when running in Download Mode. + if (config.build_package_options.only_downloads != Build::OnlyDownloads::YES) { - return {BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES, std::move(required_fspecs)}; + Util::erase_remove_if(required_fspecs, [&](FeatureSpec const& fspec) { + return status_db.is_installed(fspec) || fspec.name() == name; + }); + + if (!required_fspecs.empty()) + { + return {BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES, std::move(required_fspecs)}; + } } const PackageSpec spec = @@ -817,7 +835,10 @@ namespace vcpkg::Build // dep_pspecs was not destroyed for (auto&& pspec : dep_pspecs) { - if (pspec == spec) continue; + if (pspec == spec || Util::Enum::to_bool(config.build_package_options.only_downloads)) + { + continue; + } const auto status_it = status_db.find_installed(pspec); Checks::check_exit(VCPKG_LINE_INFO, status_it != status_db.end()); dependency_abis.emplace_back( @@ -949,6 +970,7 @@ namespace vcpkg::Build 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"; static const std::string EXCLUDED_STRING = "EXCLUDED"; + static const std::string DOWNLOADED_STRING = "DOWNLOADED"; switch (build_result) { @@ -959,6 +981,7 @@ namespace vcpkg::Build case BuildResult::FILE_CONFLICTS: return FILE_CONFLICTS_STRING; case BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES: return CASCADED_DUE_TO_MISSING_DEPENDENCIES_STRING; case BuildResult::EXCLUDED: return EXCLUDED_STRING; + case BuildResult::DOWNLOADED: return DOWNLOADED_STRING; default: Checks::unreachable(VCPKG_LINE_INFO); } } diff --git a/toolsrc/src/vcpkg/commands.ci.cpp b/toolsrc/src/vcpkg/commands.ci.cpp index f0f162f5c..6e0a71adf 100644 --- a/toolsrc/src/vcpkg/commands.ci.cpp +++ b/toolsrc/src/vcpkg/commands.ci.cpp @@ -212,6 +212,7 @@ namespace vcpkg::Commands::CI const Build::BuildPackageOptions build_options = { Build::UseHeadVersion::NO, Build::AllowDownloads::YES, + Build::OnlyDownloads::NO, Build::CleanBuildtrees::YES, Build::CleanPackages::YES, Build::CleanDownloads::NO, @@ -356,6 +357,7 @@ namespace vcpkg::Commands::CI const Build::BuildPackageOptions install_plan_options = { Build::UseHeadVersion::NO, Build::AllowDownloads::YES, + Build::OnlyDownloads::NO, Build::CleanBuildtrees::YES, Build::CleanPackages::YES, Build::CleanDownloads::NO, diff --git a/toolsrc/src/vcpkg/commands.upgrade.cpp b/toolsrc/src/vcpkg/commands.upgrade.cpp index 1e64b2eb6..b1dbf6194 100644 --- a/toolsrc/src/vcpkg/commands.upgrade.cpp +++ b/toolsrc/src/vcpkg/commands.upgrade.cpp @@ -154,6 +154,7 @@ namespace vcpkg::Commands::Upgrade const Build::BuildPackageOptions install_plan_options = { Build::UseHeadVersion::NO, Build::AllowDownloads::YES, + Build::OnlyDownloads::NO, Build::CleanBuildtrees::NO, Build::CleanPackages::NO, Build::CleanDownloads::NO, diff --git a/toolsrc/src/vcpkg/export.cpp b/toolsrc/src/vcpkg/export.cpp index 5ceb47adf..349d9aefd 100644 --- a/toolsrc/src/vcpkg/export.cpp +++ b/toolsrc/src/vcpkg/export.cpp @@ -73,6 +73,7 @@ namespace vcpkg::Export static constexpr Build::BuildPackageOptions BUILD_OPTIONS = { Build::UseHeadVersion::NO, Build::AllowDownloads::YES, + Build::OnlyDownloads::NO, Build::CleanBuildtrees::NO, Build::CleanPackages::NO, Build::CleanDownloads::NO, diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp index 1812f1624..009965887 100644 --- a/toolsrc/src/vcpkg/install.cpp +++ b/toolsrc/src/vcpkg/install.cpp @@ -342,6 +342,13 @@ namespace vcpkg::Install return Build::build_package(paths, build_config, status_db); }(); + if (BuildResult::DOWNLOADED == result.code) + { + System::print2( + System::Color::success, "Downloaded sources for package ", display_name_with_features, "\n"); + return result; + } + if (result.code != Build::BuildResult::SUCCEEDED) { System::print2(System::Color::error, Build::create_error_message(result.code, action.spec), "\n"); @@ -467,16 +474,18 @@ namespace vcpkg::Install static constexpr StringLiteral OPTION_DRY_RUN = "--dry-run"; static constexpr StringLiteral OPTION_USE_HEAD_VERSION = "--head"; static constexpr StringLiteral OPTION_NO_DOWNLOADS = "--no-downloads"; + static constexpr StringLiteral OPTION_ONLY_DOWNLOADS = "--only-downloads"; static constexpr StringLiteral OPTION_RECURSE = "--recurse"; static constexpr StringLiteral OPTION_KEEP_GOING = "--keep-going"; static constexpr StringLiteral OPTION_XUNIT = "--x-xunit"; static constexpr StringLiteral OPTION_USE_ARIA2 = "--x-use-aria2"; static constexpr StringLiteral OPTION_CLEAN_AFTER_BUILD = "--clean-after-build"; - static constexpr std::array INSTALL_SWITCHES = {{ + static constexpr std::array INSTALL_SWITCHES = {{ {OPTION_DRY_RUN, "Do not actually build or install"}, {OPTION_USE_HEAD_VERSION, "Install the libraries on the command line using the latest upstream sources"}, {OPTION_NO_DOWNLOADS, "Do not download new sources"}, + {OPTION_ONLY_DOWNLOADS, "Download sources but don't build packages"}, {OPTION_RECURSE, "Allow removal of packages as part of installation"}, {OPTION_KEEP_GOING, "Continue installing packages on failure"}, {OPTION_USE_ARIA2, "Use aria2 to perform download tasks"}, @@ -631,10 +640,12 @@ namespace vcpkg::Install const bool dry_run = Util::Sets::contains(options.switches, OPTION_DRY_RUN); const bool use_head_version = Util::Sets::contains(options.switches, (OPTION_USE_HEAD_VERSION)); const bool no_downloads = Util::Sets::contains(options.switches, (OPTION_NO_DOWNLOADS)); + const bool only_downloads = Util::Sets::contains(options.switches, (OPTION_ONLY_DOWNLOADS)); const bool is_recursive = Util::Sets::contains(options.switches, (OPTION_RECURSE)); const bool use_aria2 = Util::Sets::contains(options.switches, (OPTION_USE_ARIA2)); const bool clean_after_build = Util::Sets::contains(options.switches, (OPTION_CLEAN_AFTER_BUILD)); - const KeepGoing keep_going = to_keep_going(Util::Sets::contains(options.switches, OPTION_KEEP_GOING)); + const KeepGoing keep_going = + to_keep_going(Util::Sets::contains(options.switches, OPTION_KEEP_GOING) || only_downloads); auto& fs = paths.get_filesystem(); @@ -647,11 +658,12 @@ namespace vcpkg::Install const Build::BuildPackageOptions install_plan_options = { Util::Enum::to_enum(use_head_version), Util::Enum::to_enum(!no_downloads), + Util::Enum::to_enum(only_downloads), clean_after_build ? Build::CleanBuildtrees::YES : Build::CleanBuildtrees::NO, clean_after_build ? Build::CleanPackages::YES : Build::CleanPackages::NO, clean_after_build ? Build::CleanDownloads::YES : Build::CleanDownloads::NO, download_tool, - GlobalState::g_binary_caching ? Build::BinaryCaching::YES : Build::BinaryCaching::NO, + (GlobalState::g_binary_caching && !only_downloads) ? Build::BinaryCaching::YES : Build::BinaryCaching::NO, Build::FailOnTombstone::NO, }; -- cgit v1.2.3 From 4b404e8cfbdde4277733adaacc399fa4e1b57320 Mon Sep 17 00:00:00 2001 From: Victor Romero Date: Wed, 28 Aug 2019 11:59:30 -0700 Subject: Revert "[vcpkg install] Enable Download Mode (#7797)" (#7949) This reverts commit 65d4bc146bf7c1c21989b680497b1f6f9a09c967. --- docs/maintainers/execute_process.md | 10 ---- docs/maintainers/portfile-functions.md | 3 -- docs/maintainers/vcpkg_common_definitions.md | 19 -------- docs/maintainers/vcpkg_execute_required_process.md | 4 -- docs/maintainers/vcpkg_fail_port_install.md | 34 ------------- scripts/cmake/execute_process.cmake | 19 -------- scripts/cmake/vcpkg_acquire_msys.cmake | 8 ++-- scripts/cmake/vcpkg_apply_patches.cmake | 2 +- scripts/cmake/vcpkg_common_functions.cmake | 1 - scripts/cmake/vcpkg_download_distfile.cmake | 2 +- scripts/cmake/vcpkg_execute_required_process.cmake | 18 +------ scripts/cmake/vcpkg_extract_source_archive.cmake | 1 - scripts/cmake/vcpkg_find_acquire_program.cmake | 5 +- scripts/cmake/vcpkg_from_git.cmake | 5 +- scripts/cmake/vcpkg_from_gitlab.cmake | 2 +- scripts/cmake/vcpkg_test_cmake.cmake | 55 ++++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- toolsrc/include/vcpkg/build.h | 8 ---- toolsrc/src/vcpkg/build.cpp | 39 ++++----------- toolsrc/src/vcpkg/commands.ci.cpp | 2 - toolsrc/src/vcpkg/commands.upgrade.cpp | 1 - toolsrc/src/vcpkg/export.cpp | 1 - toolsrc/src/vcpkg/install.cpp | 18 ++----- 23 files changed, 78 insertions(+), 181 deletions(-) delete mode 100644 docs/maintainers/execute_process.md delete mode 100644 docs/maintainers/vcpkg_common_definitions.md delete mode 100644 docs/maintainers/vcpkg_fail_port_install.md delete mode 100644 scripts/cmake/execute_process.cmake diff --git a/docs/maintainers/execute_process.md b/docs/maintainers/execute_process.md deleted file mode 100644 index cbb339509..000000000 --- a/docs/maintainers/execute_process.md +++ /dev/null @@ -1,10 +0,0 @@ -# execute_process - -Intercepts all calls to execute_process() inside portfiles and fails when Download Mode -is enabled. - -In order to execute a process in Download Mode call `_execute_process()` instead. - - -## Source -[scripts/cmake/execute_process.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/execute_process.cmake) diff --git a/docs/maintainers/portfile-functions.md b/docs/maintainers/portfile-functions.md index bbd5d23ab..eadebf49a 100644 --- a/docs/maintainers/portfile-functions.md +++ b/docs/maintainers/portfile-functions.md @@ -1,7 +1,6 @@ # Portfile helper functions -- [execute\_process](execute_process.md) - [vcpkg\_acquire\_msys](vcpkg_acquire_msys.md) - [vcpkg\_add\_to\_path](vcpkg_add_to_path.md) - [vcpkg\_apply\_patches](vcpkg_apply_patches.md) @@ -10,7 +9,6 @@ - [vcpkg\_check\_features](vcpkg_check_features.md) - [vcpkg\_check\_linkage](vcpkg_check_linkage.md) - [vcpkg\_clean\_msbuild](vcpkg_clean_msbuild.md) -- [vcpkg\_common\_definitions](vcpkg_common_definitions.md) - [vcpkg\_configure\_cmake](vcpkg_configure_cmake.md) - [vcpkg\_copy\_pdbs](vcpkg_copy_pdbs.md) - [vcpkg\_copy\_tool\_dependencies](vcpkg_copy_tool_dependencies.md) @@ -19,7 +17,6 @@ - [vcpkg\_execute\_required\_process](vcpkg_execute_required_process.md) - [vcpkg\_extract\_source\_archive](vcpkg_extract_source_archive.md) - [vcpkg\_extract\_source\_archive\_ex](vcpkg_extract_source_archive_ex.md) -- [vcpkg\_fail\_port\_install](vcpkg_fail_port_install.md) - [vcpkg\_find\_acquire\_program](vcpkg_find_acquire_program.md) - [vcpkg\_from\_bitbucket](vcpkg_from_bitbucket.md) - [vcpkg\_from\_git](vcpkg_from_git.md) diff --git a/docs/maintainers/vcpkg_common_definitions.md b/docs/maintainers/vcpkg_common_definitions.md deleted file mode 100644 index 3bb922b17..000000000 --- a/docs/maintainers/vcpkg_common_definitions.md +++ /dev/null @@ -1,19 +0,0 @@ -# vcpkg_common_definitions - -File contains helpful variabls for portfiles which are commonly needed or used. - -## The following variables are available: -```cmake -VCPKG_TARGET_IS_ with being one of the following: WINDOWS, UWP, LINUX, OSX, ANDROID, FREEBSD. only defined if -VCPKG_TARGET_STATIC_LIBRARY_PREFIX static library prefix for target (same as CMAKE_STATIC_LIBRARY_PREFIX) -VCPKG_TARGET_STATIC_LIBRARY_SUFFIX static library suffix for target (same as CMAKE_STATIC_LIBRARY_SUFFIX) -VCPKG_TARGET_SHARED_LIBRARY_PREFIX shared library prefix for target (same as CMAKE_SHARED_LIBRARY_PREFIX) -VCPKG_TARGET_SHARED_LIBRARY_SUFFIX shared library suffix for target (same as CMAKE_SHARED_LIBRARY_SUFFIX) -``` - -CMAKE_STATIC_LIBRARY_PREFIX, CMAKE_STATIC_LIBRARY_SUFFIX, CMAKE_SHARED_LIBRARY_PREFIX, CMAKE_SHARED_LIBRARY_SUFFIX are defined for the target so that -portfiles are able to use find_library calls to discover dependent libraries within the current triplet for ports. - - -## Source -[scripts/cmake/vcpkg_common_definitions.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_common_definitions.cmake) diff --git a/docs/maintainers/vcpkg_execute_required_process.md b/docs/maintainers/vcpkg_execute_required_process.md index 26a116782..4b1a7e081 100644 --- a/docs/maintainers/vcpkg_execute_required_process.md +++ b/docs/maintainers/vcpkg_execute_required_process.md @@ -11,10 +11,6 @@ vcpkg_execute_required_process( ) ``` ## Parameters -### ALLOW_IN_DOWNLOAD_MODE -Allows the command to execute in Download Mode. -[See execute_process() override](../../scripts/cmake/execute_process.cmake). - ### COMMAND The command to be executed, along with its arguments. diff --git a/docs/maintainers/vcpkg_fail_port_install.md b/docs/maintainers/vcpkg_fail_port_install.md deleted file mode 100644 index b3b48ad5e..000000000 --- a/docs/maintainers/vcpkg_fail_port_install.md +++ /dev/null @@ -1,34 +0,0 @@ -# vcpkg_fail_port_install - -Fails the current portfile with a (default) error message - -## Usage -```cmake -vcpkg_fail_port_install([MESSAGE ] [ON_TARGET [ ...]] -``` - -## Parameters -### MESSAGE -Additional failure message. If non is given a default message will be displayed depending on the failure condition - -### ALWAYS -will always fail early - -### ON_TARGET -targets for which the build should fail early. Valid targets are from VCPKG_IS_TARGET_ (see vcpkg_common_definitions.cmake) - -### ON_ARCH -architecture for which the build should fail early. - -### ON_CRT_LINKAGE -CRT linkage for which the build should fail early. - -### ON_LIBRARY_LINKAGE -library linkage for which the build should fail early. - -## Examples - -* [aws-lambda-cpp](https://github.com/Microsoft/vcpkg/blob/master/ports/aws-lambda-cpp/portfile.cmake) - -## Source -[scripts/cmake/vcpkg_fail_port_install.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_fail_port_install.cmake) diff --git a/scripts/cmake/execute_process.cmake b/scripts/cmake/execute_process.cmake deleted file mode 100644 index 90198e337..000000000 --- a/scripts/cmake/execute_process.cmake +++ /dev/null @@ -1,19 +0,0 @@ -## # execute_process -## -## Intercepts all calls to execute_process() inside portfiles and fails when Download Mode -## is enabled. -## -## In order to execute a process in Download Mode call `_execute_process()` instead. -## -if (NOT DEFINED OVERRIDEN_EXECUTE_PROCESS) -set(OVERRIDEN_EXECUTE_PROCESS ON) - -function(execute_process) - message(FATAL_ERROR -[[ - This command cannot be executed in Download Mode. - Halting portfile execution. -]]) -endfunction() - -endif() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index f1f09dc7e..09090db68 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -81,15 +81,15 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) file(REMOVE_RECURSE ${TOOLPATH}/${TOOLSUBPATH}) file(MAKE_DIRECTORY ${TOOLPATH}) - _execute_process( + execute_process( COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH} WORKING_DIRECTORY ${TOOLPATH} ) - _execute_process( + execute_process( COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman-key --init;pacman-key --populate" WORKING_DIRECTORY ${TOOLPATH} ) - _execute_process( + execute_process( COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -Syu --noconfirm" WORKING_DIRECTORY ${TOOLPATH} ) @@ -104,7 +104,6 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) set(_ENV_ORIGINAL $ENV{PATH}) set(ENV{PATH} ${PATH_TO_ROOT}/usr/bin) vcpkg_execute_required_process( - ALLOW_IN_DOWNLOAD_MODE COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "pacman -Sy --noconfirm --needed ${_am_PACKAGES}" WORKING_DIRECTORY ${TOOLPATH} LOGNAME msys-pacman-${TARGET_TRIPLET} @@ -117,7 +116,6 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) # Deal with a stale process created by MSYS if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") vcpkg_execute_required_process( - ALLOW_IN_DOWNLOAD_MODE COMMAND TASKKILL /F /IM gpg-agent.exe /fi "memusage gt 2" WORKING_DIRECTORY ${SOURCE_PATH} ) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index 9698917de..ac0b78e20 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -40,7 +40,7 @@ function(vcpkg_apply_patches) get_filename_component(ABSOLUTE_PATCH "${PATCH}" ABSOLUTE BASE_DIR "${CURRENT_PORT_DIR}") message(STATUS "Applying patch ${PATCH}") set(LOGNAME patch-${TARGET_TRIPLET}-${PATCHNUM}) - _execute_process( + execute_process( COMMAND ${GIT} --work-tree=. --git-dir=.git apply "${ABSOLUTE_PATCH}" --ignore-whitespace --whitespace=nowarn --verbose OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-out.log ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-err.log diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 5f4155e9d..e9e52bad8 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -1,4 +1,3 @@ -include(execute_process) include(vcpkg_acquire_msys) include(vcpkg_add_to_path) include(vcpkg_check_features) diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 1fbff40e5..72016b8c9 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -120,7 +120,7 @@ function(vcpkg_download_distfile VAR) list(APPEND request_headers "--header=${header}") endforeach() endif() - _execute_process( + execute_process( COMMAND ${ARIA2} ${vcpkg_download_distfile_URLS} -o temp/${vcpkg_download_distfile_FILENAME} -l download-${vcpkg_download_distfile_FILENAME}-detailed.log diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake index f25a5b55e..e65d1970a 100644 --- a/scripts/cmake/vcpkg_execute_required_process.cmake +++ b/scripts/cmake/vcpkg_execute_required_process.cmake @@ -11,10 +11,6 @@ ## ) ## ``` ## ## Parameters -## ### ALLOW_IN_DOWNLOAD_MODE -## Allows the command to execute in Download Mode. -## [See execute_process() override](../../scripts/cmake/execute_process.cmake). -## ## ### COMMAND ## The command to be executed, along with its arguments. ## @@ -34,20 +30,10 @@ ## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) include(vcpkg_prettify_command) function(vcpkg_execute_required_process) - cmake_parse_arguments(vcpkg_execute_required_process "ALLOW_IN_DOWNLOAD_MODE" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN}) + cmake_parse_arguments(vcpkg_execute_required_process "" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN}) set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log") set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-err.log") - - set(execute_process_function execute_process) - if (DEFINED VCPKG_DOWNLOAD_MODE AND NOT vcpkg_execute_required_process_ALLOW_IN_DOWNLOAD_MODE) - message(FATAL_ERROR -[[ -This command cannot be executed in Download Mode. -Halting portfile execution. -]]) - endif() - - _execute_process( + execute_process( COMMAND ${vcpkg_execute_required_process_COMMAND} OUTPUT_FILE ${LOG_OUT} ERROR_FILE ${LOG_ERR} diff --git a/scripts/cmake/vcpkg_extract_source_archive.cmake b/scripts/cmake/vcpkg_extract_source_archive.cmake index fbae94b55..a55419b19 100644 --- a/scripts/cmake/vcpkg_extract_source_archive.cmake +++ b/scripts/cmake/vcpkg_extract_source_archive.cmake @@ -41,7 +41,6 @@ function(vcpkg_extract_source_archive ARCHIVE) message(STATUS "Extracting source ${ARCHIVE}") file(MAKE_DIRECTORY ${WORKING_DIRECTORY}) vcpkg_execute_required_process( - ALLOW_IN_DOWNLOAD_MODE COMMAND ${CMAKE_COMMAND} -E tar xjf ${ARCHIVE} WORKING_DIRECTORY ${WORKING_DIRECTORY} LOGNAME extract diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index aa8a70026..fed016c7b 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -302,12 +302,12 @@ function(vcpkg_find_acquire_program VAR) if(ARCHIVE_EXTENSION STREQUAL ".msi") file(TO_NATIVE_PATH "${ARCHIVE_PATH}" ARCHIVE_NATIVE_PATH) file(TO_NATIVE_PATH "${PROG_PATH_SUBDIR}" DESTINATION_NATIVE_PATH) - _execute_process( + execute_process( COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH} WORKING_DIRECTORY ${DOWNLOADS} ) else() - _execute_process( + execute_process( COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH} WORKING_DIRECTORY ${PROG_PATH_SUBDIR} ) @@ -316,7 +316,6 @@ function(vcpkg_find_acquire_program VAR) if(DEFINED POST_INSTALL_COMMAND) vcpkg_execute_required_process( - ALLOW_IN_DOWNLOAD_MODE COMMAND ${POST_INSTALL_COMMAND} WORKING_DIRECTORY ${PROG_PATH_SUBDIR} LOGNAME ${VAR}-tool-post-install diff --git a/scripts/cmake/vcpkg_from_git.cmake b/scripts/cmake/vcpkg_from_git.cmake index bad5384ca..0db818f80 100644 --- a/scripts/cmake/vcpkg_from_git.cmake +++ b/scripts/cmake/vcpkg_from_git.cmake @@ -74,18 +74,16 @@ function(vcpkg_from_git) find_program(GIT NAMES git git.cmd) # Note: git init is safe to run multiple times vcpkg_execute_required_process( - ALLOW_IN_DOWNLOAD_MODE COMMAND ${GIT} init git-tmp WORKING_DIRECTORY ${DOWNLOADS} LOGNAME git-init-${TARGET_TRIPLET} ) vcpkg_execute_required_process( - ALLOW_IN_DOWNLOAD_MODE COMMAND ${GIT} fetch ${_vdud_URL} ${_vdud_REF} --depth 1 -n WORKING_DIRECTORY ${DOWNLOADS}/git-tmp LOGNAME git-fetch-${TARGET_TRIPLET} ) - _execute_process( + execute_process( COMMAND ${GIT} rev-parse FETCH_HEAD OUTPUT_VARIABLE REV_PARSE_HEAD ERROR_VARIABLE REV_PARSE_HEAD @@ -102,7 +100,6 @@ function(vcpkg_from_git) file(MAKE_DIRECTORY "${DOWNLOADS}/temp") vcpkg_execute_required_process( - ALLOW_IN_DOWNLOAD_MODE COMMAND ${GIT} archive FETCH_HEAD -o "${TEMP_ARCHIVE}" WORKING_DIRECTORY ${DOWNLOADS}/git-tmp LOGNAME git-archive diff --git a/scripts/cmake/vcpkg_from_gitlab.cmake b/scripts/cmake/vcpkg_from_gitlab.cmake index 05253289e..6bbe81ed6 100644 --- a/scripts/cmake/vcpkg_from_gitlab.cmake +++ b/scripts/cmake/vcpkg_from_gitlab.cmake @@ -150,7 +150,7 @@ function(vcpkg_from_gitlab) endif() # There are issues with the Gitlab API project paths being URL-escaped, so we use git here to get the head revision - _execute_process(COMMAND ${GIT} ls-remote + execute_process(COMMAND ${GIT} ls-remote "${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}.git" "${_vdud_HEAD_REF}" RESULT_VARIABLE _git_result OUTPUT_VARIABLE _git_output diff --git a/scripts/cmake/vcpkg_test_cmake.cmake b/scripts/cmake/vcpkg_test_cmake.cmake index eeb27867c..20343bf64 100644 --- a/scripts/cmake/vcpkg_test_cmake.cmake +++ b/scripts/cmake/vcpkg_test_cmake.cmake @@ -21,4 +21,59 @@ function(vcpkg_test_cmake) # 2. Select a generator in the same method as vcpkg_configure_cmake() as though the PREFER_NINJA flag was always passed. # 3. Fully emulate the toolchain file for the just-built package (just adding it to CMAKE_PREFIX_PATH is not enough). return() + + cmake_parse_arguments(_tc "MODULE" "PACKAGE_NAME" "" ${ARGN}) + + if(NOT DEFINED _tc_PACKAGE_NAME) + message(FATAL_ERROR "PACKAGE_NAME must be specified") + endif() + if(_tc_MODULE) + set(PACKAGE_TYPE MODULE) + else() + set(PACKAGE_TYPE CONFIG) + endif() + + if(VCPKG_PLATFORM_TOOLSET STREQUAL "v142") + message(STATUS "Skipping CMake integration test due to v142 / CMake interaction issues") + return() + endif() + + message(STATUS "Performing CMake integration test") + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) + + #Generate Dummy source +# set(VCPKG_TEST_SOURCE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test/CMakeIntegration.cpp) +# file(WRITE ${VCPKG_TEST_SOURCE} "int main() \{\n") +# file(APPEND ${VCPKG_TEST_SOURCE} "return 0;}") + # Generate test source CMakeLists.txt + set(VCPKG_TEST_CMAKELIST ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test/CMakeLists.txt) + file(WRITE ${VCPKG_TEST_CMAKELIST} "cmake_minimum_required(VERSION 3.10)\n") + file(APPEND ${VCPKG_TEST_CMAKELIST} "set(CMAKE_PREFIX_PATH \"${CURRENT_PACKAGES_DIR};${CURRENT_INSTALLED_DIR}\")\n") + file(APPEND ${VCPKG_TEST_CMAKELIST} "\n") + file(APPEND ${VCPKG_TEST_CMAKELIST} "find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)\n") + #To properly test if the package is actually working haveway correctly we have to link all targets of a package to + #a test executable and than actually build it. This will not discover if every symbol exported by the library is available/linked + #but it will doscover if all files which are linked by a target actual exist. Problem is: How to discover all targets? +# file(APPEND ${VCPKG_TEST_CMAKELIST} "add_executable(${_tc_PACKAGE_NAME}_exe ${VCPKG_TEST_SOURCE})\n") +# file(APPEND ${VCPKG_TEST_CMAKELIST} "target_link_libraries(${_tc_PACKAGE_NAME}_exe PRIVATE ${_tc_PACKAGE_NAME})\n") + + if(DEFINED _VCPKG_CMAKE_GENERATOR) + set(VCPKG_CMAKE_TEST_GENERATOR "${_VCPKG_CMAKE_GENERATOR}") + else() + set(VCPKG_CMAKE_TEST_GENERATOR Ninja) + endif() + + # Run cmake config with a generated CMakeLists.txt + set(LOGPREFIX "${CURRENT_BUILDTREES_DIR}/test-cmake-${TARGET_TRIPLET}") + execute_process( + COMMAND ${CMAKE_COMMAND} -G ${VCPKG_CMAKE_TEST_GENERATOR} . + OUTPUT_FILE "${LOGPREFIX}-out.log" + ERROR_FILE "${LOGPREFIX}-err.log" + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test + ) + if(error_code) + message(FATAL_ERROR "CMake integration test failed; unable to find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)") + endif() endfunction() diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 2dc424b6c..66247baf7 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"2019.08.27" +"2019.08.23" diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index b535698dc..4f6397662 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -39,12 +39,6 @@ namespace vcpkg::Build YES }; - enum class OnlyDownloads - { - NO = 0, - YES - }; - enum class CleanBuildtrees { NO = 0, @@ -92,7 +86,6 @@ namespace vcpkg::Build { UseHeadVersion use_head_version; AllowDownloads allow_downloads; - OnlyDownloads only_downloads; CleanBuildtrees clean_buildtrees; CleanPackages clean_packages; CleanDownloads clean_downloads; @@ -110,7 +103,6 @@ namespace vcpkg::Build FILE_CONFLICTS, CASCADED_DUE_TO_MISSING_DEPENDENCIES, EXCLUDED, - DOWNLOADED }; static constexpr std::array BUILD_RESULT_VALUES = { diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index e5c00b929..9245ddfbc 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -53,7 +53,6 @@ namespace vcpkg::Build::Command const Build::BuildPackageOptions build_package_options{ Build::UseHeadVersion::NO, Build::AllowDownloads::YES, - Build::OnlyDownloads::NO, Build::CleanBuildtrees::NO, Build::CleanPackages::NO, Build::CleanDownloads::NO, @@ -408,11 +407,6 @@ namespace vcpkg::Build {"VCPKG_CONCURRENCY", std::to_string(get_concurrency())}, }; - if (Util::Enum::to_bool(config.build_package_options.only_downloads)) - { - variables.push_back({"VCPKG_DOWNLOAD_MODE", "true"}); - } - if (!System::get_environment_variable("VCPKG_FORCE_SYSTEM_BINARIES").has_value()) { variables.push_back({"GIT", git_exe_path}); @@ -534,7 +528,6 @@ namespace vcpkg::Build const BuildPackageConfig& config) { auto& fs = paths.get_filesystem(); - #if defined(_WIN32) const fs::path& powershell_exe_path = paths.get_tool_exe("powershell-core"); if (!fs.exists(powershell_exe_path.parent_path() / "powershell.exe")) @@ -566,14 +559,6 @@ namespace vcpkg::Build #else const int return_code = System::cmd_execute_clean(command, env); #endif - // With the exception of empty packages, builds in "Download Mode" always result in failure. - if (config.build_package_options.only_downloads == Build::OnlyDownloads::YES) - { - // TODO: Capture executed command output and evaluate whether the failure was intended. - // If an unintended error occurs then return a BuildResult::DOWNLOAD_FAILURE status. - return BuildResult::DOWNLOADED; - } - const auto buildtimeus = timer.microseconds(); const auto spec_string = spec.to_string(); @@ -808,23 +793,20 @@ namespace vcpkg::Build const std::string& name = config.scf.core_paragraph->name; std::vector required_fspecs = compute_required_feature_specs(config, status_db); + std::vector required_fspecs_copy = required_fspecs; // extract out the actual package ids auto dep_pspecs = Util::fmap(required_fspecs, [](FeatureSpec const& fspec) { return fspec.spec(); }); Util::sort_unique_erase(dep_pspecs); // Find all features that aren't installed. This mutates required_fspecs. - // Skip this validation when running in Download Mode. - if (config.build_package_options.only_downloads != Build::OnlyDownloads::YES) - { - Util::erase_remove_if(required_fspecs, [&](FeatureSpec const& fspec) { - return status_db.is_installed(fspec) || fspec.name() == name; - }); + Util::erase_remove_if(required_fspecs, [&](FeatureSpec const& fspec) { + return status_db.is_installed(fspec) || fspec.name() == name; + }); - if (!required_fspecs.empty()) - { - return {BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES, std::move(required_fspecs)}; - } + if (!required_fspecs.empty()) + { + return {BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES, std::move(required_fspecs)}; } const PackageSpec spec = @@ -835,10 +817,7 @@ namespace vcpkg::Build // dep_pspecs was not destroyed for (auto&& pspec : dep_pspecs) { - if (pspec == spec || Util::Enum::to_bool(config.build_package_options.only_downloads)) - { - continue; - } + if (pspec == spec) continue; const auto status_it = status_db.find_installed(pspec); Checks::check_exit(VCPKG_LINE_INFO, status_it != status_db.end()); dependency_abis.emplace_back( @@ -970,7 +949,6 @@ namespace vcpkg::Build 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"; static const std::string EXCLUDED_STRING = "EXCLUDED"; - static const std::string DOWNLOADED_STRING = "DOWNLOADED"; switch (build_result) { @@ -981,7 +959,6 @@ namespace vcpkg::Build case BuildResult::FILE_CONFLICTS: return FILE_CONFLICTS_STRING; case BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES: return CASCADED_DUE_TO_MISSING_DEPENDENCIES_STRING; case BuildResult::EXCLUDED: return EXCLUDED_STRING; - case BuildResult::DOWNLOADED: return DOWNLOADED_STRING; default: Checks::unreachable(VCPKG_LINE_INFO); } } diff --git a/toolsrc/src/vcpkg/commands.ci.cpp b/toolsrc/src/vcpkg/commands.ci.cpp index 6e0a71adf..f0f162f5c 100644 --- a/toolsrc/src/vcpkg/commands.ci.cpp +++ b/toolsrc/src/vcpkg/commands.ci.cpp @@ -212,7 +212,6 @@ namespace vcpkg::Commands::CI const Build::BuildPackageOptions build_options = { Build::UseHeadVersion::NO, Build::AllowDownloads::YES, - Build::OnlyDownloads::NO, Build::CleanBuildtrees::YES, Build::CleanPackages::YES, Build::CleanDownloads::NO, @@ -357,7 +356,6 @@ namespace vcpkg::Commands::CI const Build::BuildPackageOptions install_plan_options = { Build::UseHeadVersion::NO, Build::AllowDownloads::YES, - Build::OnlyDownloads::NO, Build::CleanBuildtrees::YES, Build::CleanPackages::YES, Build::CleanDownloads::NO, diff --git a/toolsrc/src/vcpkg/commands.upgrade.cpp b/toolsrc/src/vcpkg/commands.upgrade.cpp index b1dbf6194..1e64b2eb6 100644 --- a/toolsrc/src/vcpkg/commands.upgrade.cpp +++ b/toolsrc/src/vcpkg/commands.upgrade.cpp @@ -154,7 +154,6 @@ namespace vcpkg::Commands::Upgrade const Build::BuildPackageOptions install_plan_options = { Build::UseHeadVersion::NO, Build::AllowDownloads::YES, - Build::OnlyDownloads::NO, Build::CleanBuildtrees::NO, Build::CleanPackages::NO, Build::CleanDownloads::NO, diff --git a/toolsrc/src/vcpkg/export.cpp b/toolsrc/src/vcpkg/export.cpp index 349d9aefd..5ceb47adf 100644 --- a/toolsrc/src/vcpkg/export.cpp +++ b/toolsrc/src/vcpkg/export.cpp @@ -73,7 +73,6 @@ namespace vcpkg::Export static constexpr Build::BuildPackageOptions BUILD_OPTIONS = { Build::UseHeadVersion::NO, Build::AllowDownloads::YES, - Build::OnlyDownloads::NO, Build::CleanBuildtrees::NO, Build::CleanPackages::NO, Build::CleanDownloads::NO, diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp index 009965887..1812f1624 100644 --- a/toolsrc/src/vcpkg/install.cpp +++ b/toolsrc/src/vcpkg/install.cpp @@ -342,13 +342,6 @@ namespace vcpkg::Install return Build::build_package(paths, build_config, status_db); }(); - if (BuildResult::DOWNLOADED == result.code) - { - System::print2( - System::Color::success, "Downloaded sources for package ", display_name_with_features, "\n"); - return result; - } - if (result.code != Build::BuildResult::SUCCEEDED) { System::print2(System::Color::error, Build::create_error_message(result.code, action.spec), "\n"); @@ -474,18 +467,16 @@ namespace vcpkg::Install static constexpr StringLiteral OPTION_DRY_RUN = "--dry-run"; static constexpr StringLiteral OPTION_USE_HEAD_VERSION = "--head"; static constexpr StringLiteral OPTION_NO_DOWNLOADS = "--no-downloads"; - static constexpr StringLiteral OPTION_ONLY_DOWNLOADS = "--only-downloads"; static constexpr StringLiteral OPTION_RECURSE = "--recurse"; static constexpr StringLiteral OPTION_KEEP_GOING = "--keep-going"; static constexpr StringLiteral OPTION_XUNIT = "--x-xunit"; static constexpr StringLiteral OPTION_USE_ARIA2 = "--x-use-aria2"; static constexpr StringLiteral OPTION_CLEAN_AFTER_BUILD = "--clean-after-build"; - static constexpr std::array INSTALL_SWITCHES = {{ + static constexpr std::array INSTALL_SWITCHES = {{ {OPTION_DRY_RUN, "Do not actually build or install"}, {OPTION_USE_HEAD_VERSION, "Install the libraries on the command line using the latest upstream sources"}, {OPTION_NO_DOWNLOADS, "Do not download new sources"}, - {OPTION_ONLY_DOWNLOADS, "Download sources but don't build packages"}, {OPTION_RECURSE, "Allow removal of packages as part of installation"}, {OPTION_KEEP_GOING, "Continue installing packages on failure"}, {OPTION_USE_ARIA2, "Use aria2 to perform download tasks"}, @@ -640,12 +631,10 @@ namespace vcpkg::Install const bool dry_run = Util::Sets::contains(options.switches, OPTION_DRY_RUN); const bool use_head_version = Util::Sets::contains(options.switches, (OPTION_USE_HEAD_VERSION)); const bool no_downloads = Util::Sets::contains(options.switches, (OPTION_NO_DOWNLOADS)); - const bool only_downloads = Util::Sets::contains(options.switches, (OPTION_ONLY_DOWNLOADS)); const bool is_recursive = Util::Sets::contains(options.switches, (OPTION_RECURSE)); const bool use_aria2 = Util::Sets::contains(options.switches, (OPTION_USE_ARIA2)); const bool clean_after_build = Util::Sets::contains(options.switches, (OPTION_CLEAN_AFTER_BUILD)); - const KeepGoing keep_going = - to_keep_going(Util::Sets::contains(options.switches, OPTION_KEEP_GOING) || only_downloads); + const KeepGoing keep_going = to_keep_going(Util::Sets::contains(options.switches, OPTION_KEEP_GOING)); auto& fs = paths.get_filesystem(); @@ -658,12 +647,11 @@ namespace vcpkg::Install const Build::BuildPackageOptions install_plan_options = { Util::Enum::to_enum(use_head_version), Util::Enum::to_enum(!no_downloads), - Util::Enum::to_enum(only_downloads), clean_after_build ? Build::CleanBuildtrees::YES : Build::CleanBuildtrees::NO, clean_after_build ? Build::CleanPackages::YES : Build::CleanPackages::NO, clean_after_build ? Build::CleanDownloads::YES : Build::CleanDownloads::NO, download_tool, - (GlobalState::g_binary_caching && !only_downloads) ? Build::BinaryCaching::YES : Build::BinaryCaching::NO, + GlobalState::g_binary_caching ? Build::BinaryCaching::YES : Build::BinaryCaching::NO, Build::FailOnTombstone::NO, }; -- cgit v1.2.3 From 20f7eb40a9a209dd0b240ae1a7a432ab50ad97f3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Aug 2019 23:30:48 +0430 Subject: Change WIN32 to VCPKG_TARGET_IS_WINDOWS --- ports/liblsl/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/liblsl/portfile.cmake b/ports/liblsl/portfile.cmake index ecf840985..bd1afddf1 100644 --- a/ports/liblsl/portfile.cmake +++ b/ports/liblsl/portfile.cmake @@ -27,7 +27,7 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -if(WIN32) +if(VCPKG_TARGET_IS_WINDOWS) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/lslver.exe) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/lslver/) file(RENAME ${CURRENT_PACKAGES_DIR}/bin/lslver.exe ${CURRENT_PACKAGES_DIR}/tools/lslver/lslver.exe) -- cgit v1.2.3 From e4afbff850130418c25590df2ad608e8bedff54d Mon Sep 17 00:00:00 2001 From: Lily <47812810+wangli28@users.noreply.github.com> Date: Thu, 29 Aug 2019 03:25:28 +0800 Subject: [ogdf] Update source link (#7846) --- ports/ogdf/CONTROL | 3 ++- ports/ogdf/portfile.cmake | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ports/ogdf/CONTROL b/ports/ogdf/CONTROL index fe2cf909c..f13c58507 100644 --- a/ports/ogdf/CONTROL +++ b/ports/ogdf/CONTROL @@ -1,3 +1,4 @@ Source: ogdf -Version: 2018-03-28-2 +Version: 2019-08-23 +Homepage: https://github.com/ogdf/ogdf Description: Open Graph Drawing Framework diff --git a/ports/ogdf/portfile.cmake b/ports/ogdf/portfile.cmake index 5ad5e72ca..b74295b35 100644 --- a/ports/ogdf/portfile.cmake +++ b/ports/ogdf/portfile.cmake @@ -1,11 +1,12 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/2018-03-28/OGDF-snapshot) -vcpkg_download_distfile(ARCHIVE - URLS "http://www.ogdf.net/lib/exe/fetch.php/tech%3aogdf-snapshot-2018-03-28.zip" - FILENAME "ogdf-2018-03-28.zip" - SHA512 a6ddb33bc51dca4d59fcac65ff66459043b11ce5303e9d40e4fc1756adf84a0af7d0ac7debab670111e7a145dcdd9373c0e350d5b7e831b169811f246b6e19b6 + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ogdf/ogdf + REF 8a103cf3a7dfff87fe8b7534575604bc53c0870c + SHA512 264e8586be7a18640f253eb7b289dd99f1f2fc42c4d2304ab12f7c6aa9c5754b710642e7296038aea0cd9368d732d0106501fefed800743b403adafff7e3f0b2 + HEAD_REF master ) -vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}/src/2018-03-28) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} -- cgit v1.2.3 From 2d60eea04554e783b0055a930dd9ca039a975fb7 Mon Sep 17 00:00:00 2001 From: Ehsan Date: Thu, 29 Aug 2019 00:40:44 +0430 Subject: [duktape] Update library to 2.4.0 (#7873) * Update pip hash * [duktape] Update library to 2.4.0 --- ports/duktape/CONTROL | 2 +- ports/duktape/portfile.cmake | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/duktape/CONTROL b/ports/duktape/CONTROL index 769e3bc82..650edce8c 100644 --- a/ports/duktape/CONTROL +++ b/ports/duktape/CONTROL @@ -1,5 +1,5 @@ Source: duktape -Version: 2.3.0-3 +Version: 2.4.0-3 Homepage: https://github.com/svaarala/duktape Description: Embeddable Javascript engine with a focus on portability and compact footprint. Build-Depends: diff --git a/ports/duktape/portfile.cmake b/ports/duktape/portfile.cmake index 5c855027f..9d9797f54 100644 --- a/ports/duktape/portfile.cmake +++ b/ports/duktape/portfile.cmake @@ -7,8 +7,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO svaarala/duktape - REF v2.3.0 - SHA512 dd715eab481b948cf71d3ad16d2544166eb53da0df8936a4ac9c33e1f1277ef6efe542782a4c7f689f6c0c8963d7094749af455ff6a8c59593aa56ebb57e5c6f + REF v2.4.0 + SHA512 5f42ff6faab8d49531423e199c032fd2de49524bab71f39d1cf822e6f9ee82a6089c9a93837ae7849d19a95693318a8480986e4672f6f73f3182b4902e6b2daa HEAD_REF master ) @@ -30,7 +30,7 @@ if(NOT EXISTS ${PYTHON2_DIR}/easy_install${EXECUTABLE_SUFFIX}) vcpkg_download_distfile(GET_PIP URLS "https://bootstrap.pypa.io/3.3/get-pip.py" FILENAME "tools/python/python2/get-pip.py" - SHA512 92e68525830bb23955a31cb19ebc3021ef16b6337eab83d5db2961b791283d2867207545faf83635f6027f2f7b7f8fee2c85f2cfd8e8267df25406474571c741 + SHA512 99520d223819708b8f6e4b839d1fa215e4e8adc7fcd0db6c25a0399cf2fa10034b35673cf450609303646d12497f301ef53b7e7cc65c78e7bce4af0c673555ad ) execute_process(COMMAND ${PYTHON2_DIR}/python${EXECUTABLE_SUFFIX} ${PYTHON2_DIR}/get-pip.py) endif() -- cgit v1.2.3 From f5c732b40d43f062278f247036b773477823813b Mon Sep 17 00:00:00 2001 From: Victor Romero Date: Wed, 28 Aug 2019 13:49:29 -0700 Subject: Download Mode (#7950) * [portfile functions] Override execute_process() to accept ALLOW_IN_DOWNLOAD_MODE option * [vcpkg install] Set VCPKG_DOWNLOAD_MODE when using --only-downloads option * [vcpkg_find_acquire_program] Allow in Download Mode * Don't stop when build fails for a package * Download sources for all packages in dependency graph * Improve output messages * Enable acquiring MSYS packages in download mode * Documentation * Update documentation * execute_process() always fails on Download Mode * Regenerate docs and fix formatting * Run clang-format * Use _execute_process on vcpkg_from_ helpers * Fix calls to _execute_process() when not in Download Mode --- docs/maintainers/execute_process.md | 10 ++++ docs/maintainers/portfile-functions.md | 3 ++ docs/maintainers/vcpkg_common_definitions.md | 19 ++++++++ docs/maintainers/vcpkg_execute_required_process.md | 4 ++ docs/maintainers/vcpkg_fail_port_install.md | 34 +++++++++++++ scripts/cmake/execute_process.cmake | 20 ++++++++ scripts/cmake/vcpkg_acquire_msys.cmake | 8 ++-- scripts/cmake/vcpkg_apply_patches.cmake | 2 +- scripts/cmake/vcpkg_common_functions.cmake | 1 + scripts/cmake/vcpkg_download_distfile.cmake | 2 +- scripts/cmake/vcpkg_execute_required_process.cmake | 18 ++++++- scripts/cmake/vcpkg_extract_source_archive.cmake | 1 + scripts/cmake/vcpkg_find_acquire_program.cmake | 5 +- scripts/cmake/vcpkg_from_git.cmake | 5 +- scripts/cmake/vcpkg_from_gitlab.cmake | 2 +- scripts/cmake/vcpkg_test_cmake.cmake | 55 ---------------------- toolsrc/VERSION.txt | 2 +- toolsrc/include/vcpkg/build.h | 8 ++++ toolsrc/src/vcpkg/build.cpp | 39 +++++++++++---- toolsrc/src/vcpkg/commands.ci.cpp | 2 + toolsrc/src/vcpkg/commands.upgrade.cpp | 1 + toolsrc/src/vcpkg/export.cpp | 1 + toolsrc/src/vcpkg/install.cpp | 18 +++++-- 23 files changed, 182 insertions(+), 78 deletions(-) create mode 100644 docs/maintainers/execute_process.md create mode 100644 docs/maintainers/vcpkg_common_definitions.md create mode 100644 docs/maintainers/vcpkg_fail_port_install.md create mode 100644 scripts/cmake/execute_process.cmake diff --git a/docs/maintainers/execute_process.md b/docs/maintainers/execute_process.md new file mode 100644 index 000000000..cbb339509 --- /dev/null +++ b/docs/maintainers/execute_process.md @@ -0,0 +1,10 @@ +# execute_process + +Intercepts all calls to execute_process() inside portfiles and fails when Download Mode +is enabled. + +In order to execute a process in Download Mode call `_execute_process()` instead. + + +## Source +[scripts/cmake/execute_process.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/execute_process.cmake) diff --git a/docs/maintainers/portfile-functions.md b/docs/maintainers/portfile-functions.md index eadebf49a..bbd5d23ab 100644 --- a/docs/maintainers/portfile-functions.md +++ b/docs/maintainers/portfile-functions.md @@ -1,6 +1,7 @@ # Portfile helper functions +- [execute\_process](execute_process.md) - [vcpkg\_acquire\_msys](vcpkg_acquire_msys.md) - [vcpkg\_add\_to\_path](vcpkg_add_to_path.md) - [vcpkg\_apply\_patches](vcpkg_apply_patches.md) @@ -9,6 +10,7 @@ - [vcpkg\_check\_features](vcpkg_check_features.md) - [vcpkg\_check\_linkage](vcpkg_check_linkage.md) - [vcpkg\_clean\_msbuild](vcpkg_clean_msbuild.md) +- [vcpkg\_common\_definitions](vcpkg_common_definitions.md) - [vcpkg\_configure\_cmake](vcpkg_configure_cmake.md) - [vcpkg\_copy\_pdbs](vcpkg_copy_pdbs.md) - [vcpkg\_copy\_tool\_dependencies](vcpkg_copy_tool_dependencies.md) @@ -17,6 +19,7 @@ - [vcpkg\_execute\_required\_process](vcpkg_execute_required_process.md) - [vcpkg\_extract\_source\_archive](vcpkg_extract_source_archive.md) - [vcpkg\_extract\_source\_archive\_ex](vcpkg_extract_source_archive_ex.md) +- [vcpkg\_fail\_port\_install](vcpkg_fail_port_install.md) - [vcpkg\_find\_acquire\_program](vcpkg_find_acquire_program.md) - [vcpkg\_from\_bitbucket](vcpkg_from_bitbucket.md) - [vcpkg\_from\_git](vcpkg_from_git.md) diff --git a/docs/maintainers/vcpkg_common_definitions.md b/docs/maintainers/vcpkg_common_definitions.md new file mode 100644 index 000000000..3bb922b17 --- /dev/null +++ b/docs/maintainers/vcpkg_common_definitions.md @@ -0,0 +1,19 @@ +# vcpkg_common_definitions + +File contains helpful variabls for portfiles which are commonly needed or used. + +## The following variables are available: +```cmake +VCPKG_TARGET_IS_ with being one of the following: WINDOWS, UWP, LINUX, OSX, ANDROID, FREEBSD. only defined if +VCPKG_TARGET_STATIC_LIBRARY_PREFIX static library prefix for target (same as CMAKE_STATIC_LIBRARY_PREFIX) +VCPKG_TARGET_STATIC_LIBRARY_SUFFIX static library suffix for target (same as CMAKE_STATIC_LIBRARY_SUFFIX) +VCPKG_TARGET_SHARED_LIBRARY_PREFIX shared library prefix for target (same as CMAKE_SHARED_LIBRARY_PREFIX) +VCPKG_TARGET_SHARED_LIBRARY_SUFFIX shared library suffix for target (same as CMAKE_SHARED_LIBRARY_SUFFIX) +``` + +CMAKE_STATIC_LIBRARY_PREFIX, CMAKE_STATIC_LIBRARY_SUFFIX, CMAKE_SHARED_LIBRARY_PREFIX, CMAKE_SHARED_LIBRARY_SUFFIX are defined for the target so that +portfiles are able to use find_library calls to discover dependent libraries within the current triplet for ports. + + +## Source +[scripts/cmake/vcpkg_common_definitions.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_common_definitions.cmake) diff --git a/docs/maintainers/vcpkg_execute_required_process.md b/docs/maintainers/vcpkg_execute_required_process.md index 4b1a7e081..26a116782 100644 --- a/docs/maintainers/vcpkg_execute_required_process.md +++ b/docs/maintainers/vcpkg_execute_required_process.md @@ -11,6 +11,10 @@ vcpkg_execute_required_process( ) ``` ## Parameters +### ALLOW_IN_DOWNLOAD_MODE +Allows the command to execute in Download Mode. +[See execute_process() override](../../scripts/cmake/execute_process.cmake). + ### COMMAND The command to be executed, along with its arguments. diff --git a/docs/maintainers/vcpkg_fail_port_install.md b/docs/maintainers/vcpkg_fail_port_install.md new file mode 100644 index 000000000..b3b48ad5e --- /dev/null +++ b/docs/maintainers/vcpkg_fail_port_install.md @@ -0,0 +1,34 @@ +# vcpkg_fail_port_install + +Fails the current portfile with a (default) error message + +## Usage +```cmake +vcpkg_fail_port_install([MESSAGE ] [ON_TARGET [ ...]] +``` + +## Parameters +### MESSAGE +Additional failure message. If non is given a default message will be displayed depending on the failure condition + +### ALWAYS +will always fail early + +### ON_TARGET +targets for which the build should fail early. Valid targets are from VCPKG_IS_TARGET_ (see vcpkg_common_definitions.cmake) + +### ON_ARCH +architecture for which the build should fail early. + +### ON_CRT_LINKAGE +CRT linkage for which the build should fail early. + +### ON_LIBRARY_LINKAGE +library linkage for which the build should fail early. + +## Examples + +* [aws-lambda-cpp](https://github.com/Microsoft/vcpkg/blob/master/ports/aws-lambda-cpp/portfile.cmake) + +## Source +[scripts/cmake/vcpkg_fail_port_install.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_fail_port_install.cmake) diff --git a/scripts/cmake/execute_process.cmake b/scripts/cmake/execute_process.cmake new file mode 100644 index 000000000..6d9bd6cfc --- /dev/null +++ b/scripts/cmake/execute_process.cmake @@ -0,0 +1,20 @@ +## # execute_process +## +## Intercepts all calls to execute_process() inside portfiles and fails when Download Mode +## is enabled. +## +## In order to execute a process in Download Mode call `_execute_process()` instead. +## +if (NOT DEFINED OVERRIDEN_EXECUTE_PROCESS) + set(OVERRIDEN_EXECUTE_PROCESS ON) + + if (DEFINED VCPKG_DOWNLOAD_MODE) + function(execute_process) + message(FATAL_ERROR "This command cannot be executed in Download Mode.\nHalting portfile execution.\n") + endfunction() + else() + function(execute_process) + _execute_process(${ARGV}) + endfunction() + endif() +endif() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index 09090db68..f1f09dc7e 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -81,15 +81,15 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) file(REMOVE_RECURSE ${TOOLPATH}/${TOOLSUBPATH}) file(MAKE_DIRECTORY ${TOOLPATH}) - execute_process( + _execute_process( COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH} WORKING_DIRECTORY ${TOOLPATH} ) - execute_process( + _execute_process( COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman-key --init;pacman-key --populate" WORKING_DIRECTORY ${TOOLPATH} ) - execute_process( + _execute_process( COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -Syu --noconfirm" WORKING_DIRECTORY ${TOOLPATH} ) @@ -104,6 +104,7 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) set(_ENV_ORIGINAL $ENV{PATH}) set(ENV{PATH} ${PATH_TO_ROOT}/usr/bin) vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "pacman -Sy --noconfirm --needed ${_am_PACKAGES}" WORKING_DIRECTORY ${TOOLPATH} LOGNAME msys-pacman-${TARGET_TRIPLET} @@ -116,6 +117,7 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) # Deal with a stale process created by MSYS if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE COMMAND TASKKILL /F /IM gpg-agent.exe /fi "memusage gt 2" WORKING_DIRECTORY ${SOURCE_PATH} ) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index ac0b78e20..9698917de 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -40,7 +40,7 @@ function(vcpkg_apply_patches) get_filename_component(ABSOLUTE_PATCH "${PATCH}" ABSOLUTE BASE_DIR "${CURRENT_PORT_DIR}") message(STATUS "Applying patch ${PATCH}") set(LOGNAME patch-${TARGET_TRIPLET}-${PATCHNUM}) - execute_process( + _execute_process( COMMAND ${GIT} --work-tree=. --git-dir=.git apply "${ABSOLUTE_PATCH}" --ignore-whitespace --whitespace=nowarn --verbose OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-out.log ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-err.log diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index e9e52bad8..5f4155e9d 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -1,3 +1,4 @@ +include(execute_process) include(vcpkg_acquire_msys) include(vcpkg_add_to_path) include(vcpkg_check_features) diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 72016b8c9..1fbff40e5 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -120,7 +120,7 @@ function(vcpkg_download_distfile VAR) list(APPEND request_headers "--header=${header}") endforeach() endif() - execute_process( + _execute_process( COMMAND ${ARIA2} ${vcpkg_download_distfile_URLS} -o temp/${vcpkg_download_distfile_FILENAME} -l download-${vcpkg_download_distfile_FILENAME}-detailed.log diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake index e65d1970a..f25a5b55e 100644 --- a/scripts/cmake/vcpkg_execute_required_process.cmake +++ b/scripts/cmake/vcpkg_execute_required_process.cmake @@ -11,6 +11,10 @@ ## ) ## ``` ## ## Parameters +## ### ALLOW_IN_DOWNLOAD_MODE +## Allows the command to execute in Download Mode. +## [See execute_process() override](../../scripts/cmake/execute_process.cmake). +## ## ### COMMAND ## The command to be executed, along with its arguments. ## @@ -30,10 +34,20 @@ ## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) include(vcpkg_prettify_command) function(vcpkg_execute_required_process) - cmake_parse_arguments(vcpkg_execute_required_process "" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN}) + cmake_parse_arguments(vcpkg_execute_required_process "ALLOW_IN_DOWNLOAD_MODE" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN}) set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log") set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-err.log") - execute_process( + + set(execute_process_function execute_process) + if (DEFINED VCPKG_DOWNLOAD_MODE AND NOT vcpkg_execute_required_process_ALLOW_IN_DOWNLOAD_MODE) + message(FATAL_ERROR +[[ +This command cannot be executed in Download Mode. +Halting portfile execution. +]]) + endif() + + _execute_process( COMMAND ${vcpkg_execute_required_process_COMMAND} OUTPUT_FILE ${LOG_OUT} ERROR_FILE ${LOG_ERR} diff --git a/scripts/cmake/vcpkg_extract_source_archive.cmake b/scripts/cmake/vcpkg_extract_source_archive.cmake index a55419b19..fbae94b55 100644 --- a/scripts/cmake/vcpkg_extract_source_archive.cmake +++ b/scripts/cmake/vcpkg_extract_source_archive.cmake @@ -41,6 +41,7 @@ function(vcpkg_extract_source_archive ARCHIVE) message(STATUS "Extracting source ${ARCHIVE}") file(MAKE_DIRECTORY ${WORKING_DIRECTORY}) vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE COMMAND ${CMAKE_COMMAND} -E tar xjf ${ARCHIVE} WORKING_DIRECTORY ${WORKING_DIRECTORY} LOGNAME extract diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index fed016c7b..aa8a70026 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -302,12 +302,12 @@ function(vcpkg_find_acquire_program VAR) if(ARCHIVE_EXTENSION STREQUAL ".msi") file(TO_NATIVE_PATH "${ARCHIVE_PATH}" ARCHIVE_NATIVE_PATH) file(TO_NATIVE_PATH "${PROG_PATH_SUBDIR}" DESTINATION_NATIVE_PATH) - execute_process( + _execute_process( COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH} WORKING_DIRECTORY ${DOWNLOADS} ) else() - execute_process( + _execute_process( COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH} WORKING_DIRECTORY ${PROG_PATH_SUBDIR} ) @@ -316,6 +316,7 @@ function(vcpkg_find_acquire_program VAR) if(DEFINED POST_INSTALL_COMMAND) vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE COMMAND ${POST_INSTALL_COMMAND} WORKING_DIRECTORY ${PROG_PATH_SUBDIR} LOGNAME ${VAR}-tool-post-install diff --git a/scripts/cmake/vcpkg_from_git.cmake b/scripts/cmake/vcpkg_from_git.cmake index 0db818f80..bad5384ca 100644 --- a/scripts/cmake/vcpkg_from_git.cmake +++ b/scripts/cmake/vcpkg_from_git.cmake @@ -74,16 +74,18 @@ function(vcpkg_from_git) find_program(GIT NAMES git git.cmd) # Note: git init is safe to run multiple times vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE COMMAND ${GIT} init git-tmp WORKING_DIRECTORY ${DOWNLOADS} LOGNAME git-init-${TARGET_TRIPLET} ) vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE COMMAND ${GIT} fetch ${_vdud_URL} ${_vdud_REF} --depth 1 -n WORKING_DIRECTORY ${DOWNLOADS}/git-tmp LOGNAME git-fetch-${TARGET_TRIPLET} ) - execute_process( + _execute_process( COMMAND ${GIT} rev-parse FETCH_HEAD OUTPUT_VARIABLE REV_PARSE_HEAD ERROR_VARIABLE REV_PARSE_HEAD @@ -100,6 +102,7 @@ function(vcpkg_from_git) file(MAKE_DIRECTORY "${DOWNLOADS}/temp") vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE COMMAND ${GIT} archive FETCH_HEAD -o "${TEMP_ARCHIVE}" WORKING_DIRECTORY ${DOWNLOADS}/git-tmp LOGNAME git-archive diff --git a/scripts/cmake/vcpkg_from_gitlab.cmake b/scripts/cmake/vcpkg_from_gitlab.cmake index 6bbe81ed6..05253289e 100644 --- a/scripts/cmake/vcpkg_from_gitlab.cmake +++ b/scripts/cmake/vcpkg_from_gitlab.cmake @@ -150,7 +150,7 @@ function(vcpkg_from_gitlab) endif() # There are issues with the Gitlab API project paths being URL-escaped, so we use git here to get the head revision - execute_process(COMMAND ${GIT} ls-remote + _execute_process(COMMAND ${GIT} ls-remote "${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}.git" "${_vdud_HEAD_REF}" RESULT_VARIABLE _git_result OUTPUT_VARIABLE _git_output diff --git a/scripts/cmake/vcpkg_test_cmake.cmake b/scripts/cmake/vcpkg_test_cmake.cmake index 20343bf64..eeb27867c 100644 --- a/scripts/cmake/vcpkg_test_cmake.cmake +++ b/scripts/cmake/vcpkg_test_cmake.cmake @@ -21,59 +21,4 @@ function(vcpkg_test_cmake) # 2. Select a generator in the same method as vcpkg_configure_cmake() as though the PREFER_NINJA flag was always passed. # 3. Fully emulate the toolchain file for the just-built package (just adding it to CMAKE_PREFIX_PATH is not enough). return() - - cmake_parse_arguments(_tc "MODULE" "PACKAGE_NAME" "" ${ARGN}) - - if(NOT DEFINED _tc_PACKAGE_NAME) - message(FATAL_ERROR "PACKAGE_NAME must be specified") - endif() - if(_tc_MODULE) - set(PACKAGE_TYPE MODULE) - else() - set(PACKAGE_TYPE CONFIG) - endif() - - if(VCPKG_PLATFORM_TOOLSET STREQUAL "v142") - message(STATUS "Skipping CMake integration test due to v142 / CMake interaction issues") - return() - endif() - - message(STATUS "Performing CMake integration test") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) - - #Generate Dummy source -# set(VCPKG_TEST_SOURCE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test/CMakeIntegration.cpp) -# file(WRITE ${VCPKG_TEST_SOURCE} "int main() \{\n") -# file(APPEND ${VCPKG_TEST_SOURCE} "return 0;}") - # Generate test source CMakeLists.txt - set(VCPKG_TEST_CMAKELIST ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test/CMakeLists.txt) - file(WRITE ${VCPKG_TEST_CMAKELIST} "cmake_minimum_required(VERSION 3.10)\n") - file(APPEND ${VCPKG_TEST_CMAKELIST} "set(CMAKE_PREFIX_PATH \"${CURRENT_PACKAGES_DIR};${CURRENT_INSTALLED_DIR}\")\n") - file(APPEND ${VCPKG_TEST_CMAKELIST} "\n") - file(APPEND ${VCPKG_TEST_CMAKELIST} "find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)\n") - #To properly test if the package is actually working haveway correctly we have to link all targets of a package to - #a test executable and than actually build it. This will not discover if every symbol exported by the library is available/linked - #but it will doscover if all files which are linked by a target actual exist. Problem is: How to discover all targets? -# file(APPEND ${VCPKG_TEST_CMAKELIST} "add_executable(${_tc_PACKAGE_NAME}_exe ${VCPKG_TEST_SOURCE})\n") -# file(APPEND ${VCPKG_TEST_CMAKELIST} "target_link_libraries(${_tc_PACKAGE_NAME}_exe PRIVATE ${_tc_PACKAGE_NAME})\n") - - if(DEFINED _VCPKG_CMAKE_GENERATOR) - set(VCPKG_CMAKE_TEST_GENERATOR "${_VCPKG_CMAKE_GENERATOR}") - else() - set(VCPKG_CMAKE_TEST_GENERATOR Ninja) - endif() - - # Run cmake config with a generated CMakeLists.txt - set(LOGPREFIX "${CURRENT_BUILDTREES_DIR}/test-cmake-${TARGET_TRIPLET}") - execute_process( - COMMAND ${CMAKE_COMMAND} -G ${VCPKG_CMAKE_TEST_GENERATOR} . - OUTPUT_FILE "${LOGPREFIX}-out.log" - ERROR_FILE "${LOGPREFIX}-err.log" - RESULT_VARIABLE error_code - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test - ) - if(error_code) - message(FATAL_ERROR "CMake integration test failed; unable to find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)") - endif() endfunction() diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 66247baf7..2dc424b6c 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"2019.08.23" +"2019.08.27" diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index 4f6397662..b535698dc 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -39,6 +39,12 @@ namespace vcpkg::Build YES }; + enum class OnlyDownloads + { + NO = 0, + YES + }; + enum class CleanBuildtrees { NO = 0, @@ -86,6 +92,7 @@ namespace vcpkg::Build { UseHeadVersion use_head_version; AllowDownloads allow_downloads; + OnlyDownloads only_downloads; CleanBuildtrees clean_buildtrees; CleanPackages clean_packages; CleanDownloads clean_downloads; @@ -103,6 +110,7 @@ namespace vcpkg::Build FILE_CONFLICTS, CASCADED_DUE_TO_MISSING_DEPENDENCIES, EXCLUDED, + DOWNLOADED }; static constexpr std::array BUILD_RESULT_VALUES = { diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index 9245ddfbc..e5c00b929 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -53,6 +53,7 @@ namespace vcpkg::Build::Command const Build::BuildPackageOptions build_package_options{ Build::UseHeadVersion::NO, Build::AllowDownloads::YES, + Build::OnlyDownloads::NO, Build::CleanBuildtrees::NO, Build::CleanPackages::NO, Build::CleanDownloads::NO, @@ -407,6 +408,11 @@ namespace vcpkg::Build {"VCPKG_CONCURRENCY", std::to_string(get_concurrency())}, }; + if (Util::Enum::to_bool(config.build_package_options.only_downloads)) + { + variables.push_back({"VCPKG_DOWNLOAD_MODE", "true"}); + } + if (!System::get_environment_variable("VCPKG_FORCE_SYSTEM_BINARIES").has_value()) { variables.push_back({"GIT", git_exe_path}); @@ -528,6 +534,7 @@ namespace vcpkg::Build const BuildPackageConfig& config) { auto& fs = paths.get_filesystem(); + #if defined(_WIN32) const fs::path& powershell_exe_path = paths.get_tool_exe("powershell-core"); if (!fs.exists(powershell_exe_path.parent_path() / "powershell.exe")) @@ -559,6 +566,14 @@ namespace vcpkg::Build #else const int return_code = System::cmd_execute_clean(command, env); #endif + // With the exception of empty packages, builds in "Download Mode" always result in failure. + if (config.build_package_options.only_downloads == Build::OnlyDownloads::YES) + { + // TODO: Capture executed command output and evaluate whether the failure was intended. + // If an unintended error occurs then return a BuildResult::DOWNLOAD_FAILURE status. + return BuildResult::DOWNLOADED; + } + const auto buildtimeus = timer.microseconds(); const auto spec_string = spec.to_string(); @@ -793,20 +808,23 @@ namespace vcpkg::Build const std::string& name = config.scf.core_paragraph->name; std::vector required_fspecs = compute_required_feature_specs(config, status_db); - std::vector required_fspecs_copy = required_fspecs; // extract out the actual package ids auto dep_pspecs = Util::fmap(required_fspecs, [](FeatureSpec const& fspec) { return fspec.spec(); }); Util::sort_unique_erase(dep_pspecs); // Find all features that aren't installed. This mutates required_fspecs. - Util::erase_remove_if(required_fspecs, [&](FeatureSpec const& fspec) { - return status_db.is_installed(fspec) || fspec.name() == name; - }); - - if (!required_fspecs.empty()) + // Skip this validation when running in Download Mode. + if (config.build_package_options.only_downloads != Build::OnlyDownloads::YES) { - return {BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES, std::move(required_fspecs)}; + Util::erase_remove_if(required_fspecs, [&](FeatureSpec const& fspec) { + return status_db.is_installed(fspec) || fspec.name() == name; + }); + + if (!required_fspecs.empty()) + { + return {BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES, std::move(required_fspecs)}; + } } const PackageSpec spec = @@ -817,7 +835,10 @@ namespace vcpkg::Build // dep_pspecs was not destroyed for (auto&& pspec : dep_pspecs) { - if (pspec == spec) continue; + if (pspec == spec || Util::Enum::to_bool(config.build_package_options.only_downloads)) + { + continue; + } const auto status_it = status_db.find_installed(pspec); Checks::check_exit(VCPKG_LINE_INFO, status_it != status_db.end()); dependency_abis.emplace_back( @@ -949,6 +970,7 @@ namespace vcpkg::Build 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"; static const std::string EXCLUDED_STRING = "EXCLUDED"; + static const std::string DOWNLOADED_STRING = "DOWNLOADED"; switch (build_result) { @@ -959,6 +981,7 @@ namespace vcpkg::Build case BuildResult::FILE_CONFLICTS: return FILE_CONFLICTS_STRING; case BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES: return CASCADED_DUE_TO_MISSING_DEPENDENCIES_STRING; case BuildResult::EXCLUDED: return EXCLUDED_STRING; + case BuildResult::DOWNLOADED: return DOWNLOADED_STRING; default: Checks::unreachable(VCPKG_LINE_INFO); } } diff --git a/toolsrc/src/vcpkg/commands.ci.cpp b/toolsrc/src/vcpkg/commands.ci.cpp index f0f162f5c..6e0a71adf 100644 --- a/toolsrc/src/vcpkg/commands.ci.cpp +++ b/toolsrc/src/vcpkg/commands.ci.cpp @@ -212,6 +212,7 @@ namespace vcpkg::Commands::CI const Build::BuildPackageOptions build_options = { Build::UseHeadVersion::NO, Build::AllowDownloads::YES, + Build::OnlyDownloads::NO, Build::CleanBuildtrees::YES, Build::CleanPackages::YES, Build::CleanDownloads::NO, @@ -356,6 +357,7 @@ namespace vcpkg::Commands::CI const Build::BuildPackageOptions install_plan_options = { Build::UseHeadVersion::NO, Build::AllowDownloads::YES, + Build::OnlyDownloads::NO, Build::CleanBuildtrees::YES, Build::CleanPackages::YES, Build::CleanDownloads::NO, diff --git a/toolsrc/src/vcpkg/commands.upgrade.cpp b/toolsrc/src/vcpkg/commands.upgrade.cpp index 1e64b2eb6..b1dbf6194 100644 --- a/toolsrc/src/vcpkg/commands.upgrade.cpp +++ b/toolsrc/src/vcpkg/commands.upgrade.cpp @@ -154,6 +154,7 @@ namespace vcpkg::Commands::Upgrade const Build::BuildPackageOptions install_plan_options = { Build::UseHeadVersion::NO, Build::AllowDownloads::YES, + Build::OnlyDownloads::NO, Build::CleanBuildtrees::NO, Build::CleanPackages::NO, Build::CleanDownloads::NO, diff --git a/toolsrc/src/vcpkg/export.cpp b/toolsrc/src/vcpkg/export.cpp index 5ceb47adf..349d9aefd 100644 --- a/toolsrc/src/vcpkg/export.cpp +++ b/toolsrc/src/vcpkg/export.cpp @@ -73,6 +73,7 @@ namespace vcpkg::Export static constexpr Build::BuildPackageOptions BUILD_OPTIONS = { Build::UseHeadVersion::NO, Build::AllowDownloads::YES, + Build::OnlyDownloads::NO, Build::CleanBuildtrees::NO, Build::CleanPackages::NO, Build::CleanDownloads::NO, diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp index 1812f1624..009965887 100644 --- a/toolsrc/src/vcpkg/install.cpp +++ b/toolsrc/src/vcpkg/install.cpp @@ -342,6 +342,13 @@ namespace vcpkg::Install return Build::build_package(paths, build_config, status_db); }(); + if (BuildResult::DOWNLOADED == result.code) + { + System::print2( + System::Color::success, "Downloaded sources for package ", display_name_with_features, "\n"); + return result; + } + if (result.code != Build::BuildResult::SUCCEEDED) { System::print2(System::Color::error, Build::create_error_message(result.code, action.spec), "\n"); @@ -467,16 +474,18 @@ namespace vcpkg::Install static constexpr StringLiteral OPTION_DRY_RUN = "--dry-run"; static constexpr StringLiteral OPTION_USE_HEAD_VERSION = "--head"; static constexpr StringLiteral OPTION_NO_DOWNLOADS = "--no-downloads"; + static constexpr StringLiteral OPTION_ONLY_DOWNLOADS = "--only-downloads"; static constexpr StringLiteral OPTION_RECURSE = "--recurse"; static constexpr StringLiteral OPTION_KEEP_GOING = "--keep-going"; static constexpr StringLiteral OPTION_XUNIT = "--x-xunit"; static constexpr StringLiteral OPTION_USE_ARIA2 = "--x-use-aria2"; static constexpr StringLiteral OPTION_CLEAN_AFTER_BUILD = "--clean-after-build"; - static constexpr std::array INSTALL_SWITCHES = {{ + static constexpr std::array INSTALL_SWITCHES = {{ {OPTION_DRY_RUN, "Do not actually build or install"}, {OPTION_USE_HEAD_VERSION, "Install the libraries on the command line using the latest upstream sources"}, {OPTION_NO_DOWNLOADS, "Do not download new sources"}, + {OPTION_ONLY_DOWNLOADS, "Download sources but don't build packages"}, {OPTION_RECURSE, "Allow removal of packages as part of installation"}, {OPTION_KEEP_GOING, "Continue installing packages on failure"}, {OPTION_USE_ARIA2, "Use aria2 to perform download tasks"}, @@ -631,10 +640,12 @@ namespace vcpkg::Install const bool dry_run = Util::Sets::contains(options.switches, OPTION_DRY_RUN); const bool use_head_version = Util::Sets::contains(options.switches, (OPTION_USE_HEAD_VERSION)); const bool no_downloads = Util::Sets::contains(options.switches, (OPTION_NO_DOWNLOADS)); + const bool only_downloads = Util::Sets::contains(options.switches, (OPTION_ONLY_DOWNLOADS)); const bool is_recursive = Util::Sets::contains(options.switches, (OPTION_RECURSE)); const bool use_aria2 = Util::Sets::contains(options.switches, (OPTION_USE_ARIA2)); const bool clean_after_build = Util::Sets::contains(options.switches, (OPTION_CLEAN_AFTER_BUILD)); - const KeepGoing keep_going = to_keep_going(Util::Sets::contains(options.switches, OPTION_KEEP_GOING)); + const KeepGoing keep_going = + to_keep_going(Util::Sets::contains(options.switches, OPTION_KEEP_GOING) || only_downloads); auto& fs = paths.get_filesystem(); @@ -647,11 +658,12 @@ namespace vcpkg::Install const Build::BuildPackageOptions install_plan_options = { Util::Enum::to_enum(use_head_version), Util::Enum::to_enum(!no_downloads), + Util::Enum::to_enum(only_downloads), clean_after_build ? Build::CleanBuildtrees::YES : Build::CleanBuildtrees::NO, clean_after_build ? Build::CleanPackages::YES : Build::CleanPackages::NO, clean_after_build ? Build::CleanDownloads::YES : Build::CleanDownloads::NO, download_tool, - GlobalState::g_binary_caching ? Build::BinaryCaching::YES : Build::BinaryCaching::NO, + (GlobalState::g_binary_caching && !only_downloads) ? Build::BinaryCaching::YES : Build::BinaryCaching::NO, Build::FailOnTombstone::NO, }; -- cgit v1.2.3