wayland: add package
authorDaniel Golle <daniel@makrotopia.org>
Sun, 22 Aug 2021 20:03:07 +0000 (21:03 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Wed, 6 Oct 2021 23:09:16 +0000 (00:09 +0100)
Add wayland framework package and host build.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
frameworks/wayland/Makefile [new file with mode: 0644]
frameworks/wayland/patches/001-fix-wayland-scanner-detect.patch [new file with mode: 0644]

diff --git a/frameworks/wayland/Makefile b/frameworks/wayland/Makefile
new file mode 100644 (file)
index 0000000..05be356
--- /dev/null
@@ -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 <daniel@makrotopia.org>
+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 (file)
index 0000000..b9d462f
--- /dev/null
@@ -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',