Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg] Add keyword Supports to Feature in CONTROL file and manifest #12160

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
52ebeca
Add supports_expression and parse it in Feature
Jun 30, 2020
6f92161
[apr] Add supports to feature private-headers
Jun 30, 2020
8a45e8e
bump version
Jun 30, 2020
69d5e5d
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/…
Jul 9, 2020
e59bee0
Change the way to analysis the keyword "Supports"
Jul 9, 2020
24ca11c
Test all features of the selected port
Jul 10, 2020
ea991cb
Apply clang format.
Jul 10, 2020
f0dab1e
Use clang-format
Jul 10, 2020
cea22c6
Re-trigger CI test
Jul 10, 2020
347ee2a
Add Suuports to feature x11
Jul 10, 2020
496481d
remove test code
Jul 10, 2020
214f2d0
Re-trigger CI test
Jul 10, 2020
408c3f4
Revert changes and re-trigger hunspell test
Jul 10, 2020
645996e
Move code to create_feature_install_plan
Jul 13, 2020
0c6172f
change the insert function
Jul 13, 2020
1e0c89b
clang-format
Jul 13, 2020
e10c86f
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/…
Jul 13, 2020
7d158e0
Remove unuse function
Jul 13, 2020
b5fca5d
Re-trigger CI test
Jul 13, 2020
b5a2760
Correct supports
Jul 13, 2020
d3b4b19
add support for supports in features in vcpkg.json
strega-nil Jul 15, 2020
faa0f38
format hunspell/vcpkg.json
strega-nil Jul 15, 2020
6efd7db
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/…
Jul 20, 2020
dccfc53
Merge branch 'dev/jack/add_supports_to_feature' of https://github.com…
Jul 20, 2020
73c346e
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/…
Sep 8, 2020
3840de8
Revert project file changes
Sep 8, 2020
3254816
Add Supports to valid field when parsing manifest
Sep 9, 2020
019b845
Add parsing keyword Support code
Sep 9, 2020
75c1c5e
format manifest
Sep 9, 2020
1fdcb4a
clang-format
Sep 9, 2020
330fced
Merge branch 'master' into dev/jack/add_supports_to_feature
JackBoosY Sep 16, 2020
be7c66a
Add supports expression to array features
strega-nil Sep 16, 2020
9b3a84e
Merge branch 'master' into dev/jack/add_supports_to_feature
JackBoosY Oct 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions ports/hunspell/CONTROL

This file was deleted.

13 changes: 13 additions & 0 deletions ports/hunspell/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "hunspell",
"version-string": "1.7.0",
"port-version": 3,
"description": "The most popular spellchecking library.",
"homepage": "https://github.com/hunspell/hunspell",
"features": {
"tools": {
"description": "Build hunspell tools",
"supports": "windows"
}
}
}
2 changes: 2 additions & 0 deletions ports/ixwebsocket/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: ixwebsocket
Version: 9.6.2
Port-Version: 1
Build-Depends: zlib
Homepage: https://github.com/machinezone/IXWebSocket
Description: Lightweight WebSocket Client and Server + HTTP Client and Server
Expand All @@ -20,3 +21,4 @@ Description: SSL support (mbedTLS)

Feature: sectransp
Description: SSL support (sectransp)
Supports: osx
3 changes: 2 additions & 1 deletion ports/libtorrent/CONTROL
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ Description: build with libiconv on Windows
Feature: python
Build-Depends: boost-python, libtorrent[deprfun]
Description: build the python bindings in bindings/python directory
Supports: !windows

Feature: test
Build-Depends: libtorrent[deprfun]
Description: build the libtorrent tests

Feature: tools
Description: build the tools in the tools directory
Description: build the tools in the tools directory
1 change: 1 addition & 0 deletions toolsrc/include/vcpkg/sourceparagraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ namespace vcpkg
std::string name;
std::vector<std::string> description;
std::vector<Dependency> dependencies;
PlatformExpression::Expr supports_expression;

Json::Object extra_info;

Expand Down
22 changes: 21 additions & 1 deletion toolsrc/src/vcpkg/sourceparagraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,21 @@ namespace vcpkg
fpgh->description = Strings::split(parser.required_field(SourceParagraphFields::DESCRIPTION), '\n');
trim_all(fpgh->description);

auto supports_expr = parser.optional_field(SourceParagraphFields::SUPPORTS);
if (!supports_expr.empty())
{
auto maybe_expr = PlatformExpression::parse_platform_expression(
supports_expr, PlatformExpression::MultipleBinaryOperators::Allow);
if (auto expr = maybe_expr.get())
{
fpgh->supports_expression = std::move(*expr);
}
else
{
parser.add_type_error(SourceParagraphFields::SUPPORTS, "a platform expression");
}
}

auto maybe_dependencies =
parse_dependencies_list(parser.optional_field(SourceParagraphFields::BUILD_DEPENDS), origin);
if (maybe_dependencies.has_value())
Expand Down Expand Up @@ -517,10 +532,11 @@ namespace vcpkg
constexpr static StringLiteral NAME = "name";
constexpr static StringLiteral DESCRIPTION = "description";
constexpr static StringLiteral DEPENDENCIES = "dependencies";
constexpr static StringLiteral SUPPORTS = "supports";

virtual Span<const StringView> valid_fields() const override
{
static const StringView t[] = {DESCRIPTION, DEPENDENCIES};
static const StringView t[] = {DESCRIPTION, DEPENDENCIES, SUPPORTS};
return t;
}

Expand All @@ -539,6 +555,7 @@ namespace vcpkg
r.required_object_field(
type_name(), obj, DESCRIPTION, feature->description, Json::ParagraphDeserializer::instance);
r.optional_object_field(obj, DEPENDENCIES, feature->dependencies, DependencyArrayDeserializer::instance);
r.optional_object_field(obj, SUPPORTS, feature->supports_expression, PlatformExprDeserializer{});

return std::move(feature);
}
Expand All @@ -559,6 +576,7 @@ namespace vcpkg
FeatureDeserializer::NAME,
FeatureDeserializer::DESCRIPTION,
FeatureDeserializer::DEPENDENCIES,
FeatureDeserializer::SUPPORTS,
};
return t;
}
Expand Down Expand Up @@ -1204,6 +1222,8 @@ namespace vcpkg
}

serialize_paragraph(feature_obj, FeatureDeserializer::DESCRIPTION, feature->description, true);
serialize_optional_string(
feature_obj, FeatureDeserializer::SUPPORTS, to_string(feature->supports_expression));

if (!feature->dependencies.empty() || debug)
{
Expand Down