From 88e653326865d11c2b28aa2f1540215ab9314401 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 22 Aug 2021 21:03:07 +0100 Subject: [PATCH] wayland: add package Add wayland framework package and host build. Signed-off-by: Daniel Golle --- frameworks/wayland/Makefile | 80 +++++++++++++++++++ .../001-fix-wayland-scanner-detect.patch | 30 +++++++ 2 files changed, 110 insertions(+) create mode 100644 frameworks/wayland/Makefile create mode 100644 frameworks/wayland/patches/001-fix-wayland-scanner-detect.patch diff --git a/frameworks/wayland/Makefile b/frameworks/wayland/Makefile new file mode 100644 index 0000000..05be356 --- /dev/null +++ b/frameworks/wayland/Makefile @@ -0,0 +1,80 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=wayland +PKG_VERSION:=1.19.0 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://wayland.freedesktop.org/releases/ +PKG_HASH:=baccd902300d354581cd5ad3cc49daa4921d55fb416a5883e218750fef166d15 + +PKG_MAINTAINER:=Daniel Golle +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING + +PKG_INSTALL:=1 +PKG_BUILD_DEPENDS:=libffi/host libxml2/host expat/host wayland/host + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/meson.mk + +define Package/libwayland + SECTION:=libs + CATEGORY:=Video + SUBMENU:=Frameworks and Toolkits + TITLE:=wayland + URL:=https://wayland.freedesktop.org/ + DEPENDS:=+libexpat +libffi +endef + +define Package/libwayland/description +endef + +define Package/wayland-scanner + SECTION:=libs + CATEGORY:=Video + SUBMENU:=Frameworks and Toolkits + TITLE:=wayland + URL:=https://wayland.freedesktop.org/ + DEPENDS:=+libxml2 +libexpat +endef + +define Package/wayland-scanner/description +endef + +MESON_HOST_ARGS += \ + -Dscanner=true \ + -Dlibraries=false \ + -Ddocumentation=false \ + -Ddtd_validation=true + +MESON_ARGS += \ + -Dscanner=true \ + -Dlibraries=true \ + -Ddocumentation=false \ + -Ddtd_validation=true \ + -Dscanner_bin="$(STAGING_DIR_HOSTPKG)/bin/wayland-scanner" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig +endef + +define Package/libwayland/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/ +endef + +define Package/wayland-scanner/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wayland-scanner $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libwayland)) +$(eval $(call BuildPackage,wayland-scanner)) +$(eval $(call HostBuild)) diff --git a/frameworks/wayland/patches/001-fix-wayland-scanner-detect.patch b/frameworks/wayland/patches/001-fix-wayland-scanner-detect.patch new file mode 100644 index 0000000..b9d462f --- /dev/null +++ b/frameworks/wayland/patches/001-fix-wayland-scanner-detect.patch @@ -0,0 +1,30 @@ +--- a/src/meson.build ++++ b/src/meson.build +@@ -59,8 +59,12 @@ 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_pkgconfig_variable('wayland_scanner')) ++ if (get_option('scanner_bin') != '') ++ wayland_scanner_for_build = get_option('scanner_bin') ++ else ++ scanner_dep = dependency('wayland-scanner', native: true, version: meson.project_version()) ++ wayland_scanner_for_build = find_program(scanner_dep.get_pkgconfig_variable('wayland_scanner')) ++ endif + else + wayland_scanner_for_build = wayland_scanner + endif +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -6,6 +6,10 @@ option('scanner', + description: 'Compile wayland-scanner binary', + type: 'boolean', + value: 'true') ++option('scanner_bin', ++ description: 'Path to wayland-scanner binary', ++ type: 'string', ++ value: '') + option('documentation', + description: 'Build the documentation (requires Doxygen, dot, xmlto, xsltproc)', + type: 'boolean', -- 2.30.2