Skip to content

Commit

Permalink
[wayland,wayland-protocols] Add force-build feature 💪 (#28628)
Browse files Browse the repository at this point in the history
* [wayland] Add force-build feature

* [wayland-protocols] Add force-build feature
  • Loading branch information
vicroms committed Jan 10, 2023
1 parent d8e1f40 commit c30de8e
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 13 deletions.
11 changes: 10 additions & 1 deletion ports/wayland-protocols/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)

if(NOT X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES AND NOT VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"force-build" FORCE_BUILD
)

if(NOT X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES AND NOT VCPKG_TARGET_IS_WINDOWS AND NOT FORCE_BUILD)
message(STATUS "Utils and libraries provided by '${PORT}' should be provided by your system! Install the required packages or force vcpkg libraries by setting X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES")
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
else()

if (NOT FORCE_BUILD OR NOT X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES)
message(FATAL_ERROR "To build wayland libraries the `force-build` feature must be enabled and the X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES triplet variable must be set.")
endif()

vcpkg_from_gitlab(
GITLAB_URL https://gitlab.freedesktop.org
OUT_SOURCE_PATH SOURCE_PATH
Expand Down
19 changes: 18 additions & 1 deletion ports/wayland-protocols/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
{
"name": "wayland-protocols",
"version": "1.31",
"port-version": 1,
"description": "wayland-protocols contains Wayland protocols that add functionality not available in the Wayland core protocol.",
"homepage": "https://wayland.freedesktop.org",
"license": "MIT",
"dependencies": [
"wayland"
]
],
"features": {
"force-build": {
"description": [
"Build wayland libraries instead of depending on system ones.",
"Requires triplet variable X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES to be set."
],
"dependencies": [
{
"name": "wayland",
"features": [
"force-build"
]
}
]
}
}
}
12 changes: 11 additions & 1 deletion ports/wayland/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
if(NOT X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES AND NOT VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"force-build" FORCE_BUILD
)

if(NOT X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES AND NOT VCPKG_TARGET_IS_WINDOWS AND NOT FORCE_BUILD)
message(STATUS "Utils and libraries provided by '${PORT}' should be provided by your system! Install the required packages or force vcpkg libraries by setting X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES")
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
else()


if (NOT FORCE_BUILD OR NOT X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES)
message(FATAL_ERROR "To build wayland libraries the `force-build` feature must be enabled and the X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES triplet variable must be set.")
endif()

vcpkg_from_gitlab(
GITLAB_URL https://gitlab.freedesktop.org
OUT_SOURCE_PATH SOURCE_PATH
Expand Down
25 changes: 17 additions & 8 deletions ports/wayland/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
{
"name": "wayland",
"version": "1.21.0",
"port-version": 1,
"description": "Core Wayland window system code and protocol",
"homepage": "https://wayland.freedesktop.org",
"license": "MIT",
"supports": "!(windows | osx)",
"dependencies": [
"expat",
"libffi",
"libxml2",
{
"name": "vcpkg-tool-meson",
"host": true
"features": {
"force-build": {
"description": [
"Build wayland libraries instead of depending on system ones.",
"Requires triplet variable X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES to be set."
],
"dependencies": [
"expat",
"libffi",
"libxml2",
{
"name": "vcpkg-tool-meson",
"host": true
}
]
}
]
}
}
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8066,11 +8066,11 @@
},
"wayland": {
"baseline": "1.21.0",
"port-version": 0
"port-version": 1
},
"wayland-protocols": {
"baseline": "1.31",
"port-version": 0
"port-version": 1
},
"websocketpp": {
"baseline": "0.8.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/w-/wayland-protocols.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4f541a93fca9beb61d50adbcfc375b746997cd7c",
"version": "1.31",
"port-version": 1
},
{
"git-tree": "a47f6381ef380391595319d483f3e81098fce826",
"version": "1.31",
Expand Down
5 changes: 5 additions & 0 deletions versions/w-/wayland.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "7a320b0e7a8409b2a369eaf7b613bfc738835cc5",
"version": "1.21.0",
"port-version": 1
},
{
"git-tree": "638381423adec9c24b18a622ef02d1f75f102428",
"version": "1.21.0",
Expand Down

0 comments on commit c30de8e

Please sign in to comment.