aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/wayland
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/wayland')
-rw-r--r--vcpkg/ports/wayland/cross-build.diff14
-rw-r--r--vcpkg/ports/wayland/portfile.cmake59
-rw-r--r--vcpkg/ports/wayland/vcpkg.json31
3 files changed, 104 insertions, 0 deletions
diff --git a/vcpkg/ports/wayland/cross-build.diff b/vcpkg/ports/wayland/cross-build.diff
new file mode 100644
index 0000000..103ef3a
--- /dev/null
+++ b/vcpkg/ports/wayland/cross-build.diff
@@ -0,0 +1,14 @@
+diff --git a/src/meson.build b/src/meson.build
+index a8a1d2b..5190cdd 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -78,8 +78,7 @@ if get_option('scanner')
+ endif
+
+ if meson.is_cross_build() or not get_option('scanner')
+- scanner_dep = dependency('wayland-scanner', native: true, version: meson.project_version())
+- wayland_scanner_for_build = find_program(scanner_dep.get_variable(pkgconfig: 'wayland_scanner'))
++ wayland_scanner_for_build = find_program('wayland_scanner')
+ else
+ wayland_scanner_for_build = wayland_scanner
+ endif
diff --git a/vcpkg/ports/wayland/portfile.cmake b/vcpkg/ports/wayland/portfile.cmake
new file mode 100644
index 0000000..e1ab2a6
--- /dev/null
+++ b/vcpkg/ports/wayland/portfile.cmake
@@ -0,0 +1,59 @@
+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)
+ return()
+endif()
+
+
+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
+ REPO wayland/wayland
+ REF ${VERSION}
+ SHA512 454a4d7cab9fb9eafe3505114e9dfafed94c985fb7f156eb2d67f258bf2bf8418598ab75c237aa75fabe81a811981dbc72363870f2f81ddcbfb3adfaa95d4947
+ HEAD_REF master
+ PATCHES
+ cross-build.diff
+)
+
+set(BINARIES "")
+set(OPTIONS "")
+if(VCPKG_CROSSCOMPILING)
+ list(APPEND BINARIES "wayland_scanner = ['${CURRENT_HOST_INSTALLED_DIR}/tools/${PORT}/wayland-scanner${VCPKG_HOST_EXECUTABLE_SUFFIX}']")
+ list(APPEND OPTIONS -Dscanner=false)
+endif()
+
+vcpkg_configure_meson(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${OPTIONS}
+ -Ddocumentation=false
+ -Ddtd_validation=false
+ -Dtests=false
+ ADDITIONAL_BINARIES
+ ${BINARIES}
+)
+vcpkg_install_meson()
+vcpkg_fixup_pkgconfig()
+
+if(NOT VCPKG_CROSSCOMPILING)
+ vcpkg_copy_tools(TOOL_NAMES wayland-scanner AUTO_CLEAN)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/wayland-scanner.pc" "bindir=\${prefix}/bin" "bindir=\${prefix}/tools/${PORT}")
+ if(NOT VCPKG_BUILD_TYPE)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/wayland-scanner.pc" "bindir=\${prefix}/bin" "bindir=\${prefix}/../tools/${PORT}")
+ endif()
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
diff --git a/vcpkg/ports/wayland/vcpkg.json b/vcpkg/ports/wayland/vcpkg.json
new file mode 100644
index 0000000..9c57f0a
--- /dev/null
+++ b/vcpkg/ports/wayland/vcpkg.json
@@ -0,0 +1,31 @@
+{
+ "name": "wayland",
+ "version": "1.23.1",
+ "description": "Core Wayland window system code and protocol",
+ "homepage": "https://wayland.freedesktop.org",
+ "license": "MIT",
+ "supports": "!(windows | osx)",
+ "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",
+ {
+ "name": "vcpkg-tool-meson",
+ "host": true
+ },
+ {
+ "name": "wayland",
+ "host": true,
+ "features": [
+ "force-build"
+ ]
+ }
+ ]
+ }
+ }
+}