diff --git a/ports/wayland-protocols/portfile.cmake b/ports/wayland-protocols/portfile.cmake new file mode 100644 index 0000000000..402c598562 --- /dev/null +++ b/ports/wayland-protocols/portfile.cmake @@ -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() diff --git a/ports/wayland-protocols/vcpkg.json b/ports/wayland-protocols/vcpkg.json new file mode 100644 index 0000000000..b85b39d12f --- /dev/null +++ b/ports/wayland-protocols/vcpkg.json @@ -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" + ] +} diff --git a/ports/wayland/portfile.cmake b/ports/wayland/portfile.cmake new file mode 100644 index 0000000000..effb141191 --- /dev/null +++ b/ports/wayland/portfile.cmake @@ -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() diff --git a/ports/wayland/tests.patch b/ports/wayland/tests.patch new file mode 100644 index 0000000000..b58d55e2d7 --- /dev/null +++ b/ports/wayland/tests.patch @@ -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', diff --git a/ports/wayland/vcpkg.json b/ports/wayland/vcpkg.json new file mode 100644 index 0000000000..2cb6f90cac --- /dev/null +++ b/ports/wayland/vcpkg.json @@ -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 + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index ead246c2c9..85d6b838a6 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7648,6 +7648,14 @@ "baseline": "5.5.0", "port-version": 0 }, + "wayland": { + "baseline": "1.19.0", + "port-version": 0 + }, + "wayland-protocols": { + "baseline": "1.23", + "port-version": 0 + }, "websocketpp": { "baseline": "0.8.2", "port-version": 2 diff --git a/versions/w-/wayland-protocols.json b/versions/w-/wayland-protocols.json new file mode 100644 index 0000000000..8407bb223c --- /dev/null +++ b/versions/w-/wayland-protocols.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "c50a34c552f4b5bc2b867c5732ad0c27cfa8996a", + "version": "1.23", + "port-version": 0 + } + ] +} diff --git a/versions/w-/wayland.json b/versions/w-/wayland.json new file mode 100644 index 0000000000..eca73e1770 --- /dev/null +++ b/versions/w-/wayland.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "353490d29b62e597126db445b5f2a49301002f5b", + "version": "1.19.0", + "port-version": 0 + } + ] +}