[wayland] add ports for wayland. (#26475)

* add wayland

* format manifest

* uncomment the library guard

* v db

* add missing policy

* v db
This commit is contained in:
Alexander Neumann 2022-08-26 23:07:10 +02:00 committed by GitHub
parent 3163230192
commit e85b5bb95a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 184 additions and 0 deletions

View File

@ -0,0 +1,36 @@
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
if(NOT X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES AND NOT VCPKG_TARGET_IS_WINDOWS)
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()
vcpkg_from_gitlab(
GITLAB_URL https://gitlab.freedesktop.org
OUT_SOURCE_PATH SOURCE_PATH
REPO wayland/wayland-protocols
REF cd153943618bcf157896a6d0f1154d0ad62078a7 #1.23
SHA512 aae49d168e467d554ada638887511fa696a9fae900c93067d97f9e3d405068dc87883933f09ca2a3ef8a04631fdcffb629c178ec6e4c247f0c2ff6c1aaaaa952
HEAD_REF master
)
set(ENV{ACLOCAL} "aclocal -I ${CURRENT_INSTALLED_DIR}/share/wayland/aclocal/")
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
)
vcpkg_install_make()
if(EXISTS "${CURRENT_PACKAGES_DIR}/share/${PORT}/pkgconfig")
file(INSTALL "${CURRENT_PACKAGES_DIR}/share/${PORT}/pkgconfig/" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/")
file(INSTALL "${CURRENT_PACKAGES_DIR}/share/${PORT}/pkgconfig/" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/${PORT}/pkgconfig/")
endif()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
# Handle copyright
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
endif()

View File

@ -0,0 +1,10 @@
{
"name": "wayland-protocols",
"version": "1.23",
"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"
]
}

View File

@ -0,0 +1,65 @@
if(NOT X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES AND NOT VCPKG_TARGET_IS_WINDOWS)
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()
vcpkg_from_gitlab(
GITLAB_URL https://gitlab.freedesktop.org
OUT_SOURCE_PATH SOURCE_PATH
REPO wayland/wayland
REF e60398b1755bfcdf09f040d3769131fe0d9762fc #1.19.0
SHA512 f2f7dd9ff71e99cf3621ab45160f59b679de763e3fdef6fcef7e14947ad43ed7a86845a213c75bb7117fdda11a51035566225a12d3eb33e8c3fe2e4456eb801d
HEAD_REF master
PATCHES tests.patch
)
vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS -Ddtd_validation=false
-Ddocumentation=false
-Dtests=false
)
vcpkg_install_meson()
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/" AND VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}wayland-private${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}"
DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}wayland-util${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}"
DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/" AND VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}wayland-private${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}"
DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}wayland-util${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}"
DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
endif()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
# Handle copyright
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/wayland-scanner${VCPKG_TARGET_EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/wayland-scanner${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(RENAME "${CURRENT_PACKAGES_DIR}/share/aclocal" "${CURRENT_PACKAGES_DIR}/share/${PORT}/aclocal")
if(VCPKG_LIBRARY_LINKAGE STREQUAL static OR NOT VCPKG_TARGET_IS_WINDOWS)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
set(_file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/wayland-scanner.pc")
if(EXISTS "${_file}")
file(READ "${_file}" _contents)
string(REPLACE "bindir=\${prefix}/bin" "bindir=\${prefix}/tools/${PORT}" _contents "${_contents}")
file(WRITE "${_file}" "${_contents}")
endif()
set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/wayland-scanner.pc")
if(EXISTS "${_file}")
file(READ "${_file}" _contents)
string(REPLACE "bindir=\${prefix}/bin" "bindir=\${prefix}/../tools/${PORT}" _contents "${_contents}")
file(WRITE "${_file}" "${_contents}")
endif()
endif()

30
ports/wayland/tests.patch Normal file
View File

@ -0,0 +1,30 @@
diff --git a/meson.build b/meson.build
index 11c35fa67..26d69ade5 100644
--- a/meson.build
+++ b/meson.build
@@ -91,7 +91,9 @@ subdir('src')
if get_option('libraries')
subdir('cursor')
subdir('egl')
- subdir('tests')
+ if get_option('tests')
+ subdir('tests')
+ endif
if get_option('documentation')
subdir('doc')
endif
diff --git a/meson_options.txt b/meson_options.txt
index de588d137..dc6ea1d8a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,6 +10,10 @@ option('documentation',
description: 'Build the documentation (requires Doxygen, dot, xmlto, xsltproc)',
type: 'boolean',
value: 'true')
+option('tests',
+ description: 'Build the tests',
+ type: 'boolean',
+ value: 'true')
option('dtd_validation',
description: 'Validate the protocol DTD (requires libxml2)',
type: 'boolean',

17
ports/wayland/vcpkg.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "wayland",
"version": "1.19.0",
"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
}
]
}

View File

@ -7648,6 +7648,14 @@
"baseline": "5.5.0", "baseline": "5.5.0",
"port-version": 0 "port-version": 0
}, },
"wayland": {
"baseline": "1.19.0",
"port-version": 0
},
"wayland-protocols": {
"baseline": "1.23",
"port-version": 0
},
"websocketpp": { "websocketpp": {
"baseline": "0.8.2", "baseline": "0.8.2",
"port-version": 2 "port-version": 2

View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "c50a34c552f4b5bc2b867c5732ad0c27cfa8996a",
"version": "1.23",
"port-version": 0
}
]
}

9
versions/w-/wayland.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "353490d29b62e597126db445b5f2a49301002f5b",
"version": "1.19.0",
"port-version": 0
}
]
}