Merge pull request #16 from dangowrt/wayland-stack
authorMirko Vogt <mirko-openwrt@nanl.de>
Wed, 6 Oct 2021 23:45:52 +0000 (01:45 +0200)
committerGitHub <noreply@github.com>
Wed, 6 Oct 2021 23:45:52 +0000 (01:45 +0200)
 [RFC/WIP/POC] bring up Wayland graphics stack

25 files changed:
frameworks/wayland-protocols/Makefile [new file with mode: 0644]
frameworks/wayland/Makefile [new file with mode: 0644]
frameworks/wayland/patches/001-fix-wayland-scanner-detect.patch [new file with mode: 0644]
libs/cairo/Makefile [new file with mode: 0644]
libs/cairo/patches/001-musl-stacksize.patch [new file with mode: 0644]
libs/cairo/patches/002-CVE-2018-19876.patch [new file with mode: 0644]
libs/cairo/patches/003-pdf-flush.patch [new file with mode: 0644]
libs/cairo/patches/004-fix-mask-usage-in-image-compositor.patch [new file with mode: 0644]
libs/cairo/patches/005-composite_color_glyphs.patch [new file with mode: 0644]
libs/cairo/patches/006-cff-allow-empty-array-of-operands-for-certain-operat.patch [new file with mode: 0644]
libs/fribidi/Makefile [new file with mode: 0644]
libs/harfbuzz/Makefile [new file with mode: 0644]
libs/kmscube/Makefile [new file with mode: 0644]
libs/libxkbcommon/Makefile [new file with mode: 0644]
libs/libxkbcommon/patches/001-fix-wayland-scanner-detect.patch [new file with mode: 0644]
libs/mesa/Makefile [new file with mode: 0644]
libs/mesa/patches/001-fix-wayland-scanner-detect.patch [new file with mode: 0644]
libs/pango/Makefile [new file with mode: 0644]
libs/seatd/Makefile [new file with mode: 0644]
libs/wayland-utils/Makefile [new file with mode: 0644]
libs/wayland-utils/patches/001-fix-wayland-scanner-detect.patch [new file with mode: 0644]
libs/weston/Makefile [new file with mode: 0644]
libs/weston/patches/001-fix-wayland-scanner-detect.patch [new file with mode: 0644]
libs/weston/patches/100-timespec.patch [new file with mode: 0644]
libs/xkeyboard-config/Makefile [new file with mode: 0644]

diff --git a/frameworks/wayland-protocols/Makefile b/frameworks/wayland-protocols/Makefile
new file mode 100644 (file)
index 0000000..b5a159e
--- /dev/null
@@ -0,0 +1,49 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=wayland-protocols
+PKG_VERSION:=1.21
+PKG_RELEASE:=$(AUTORELEASE)
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://wayland.freedesktop.org/releases/
+PKG_HASH:=b99945842d8be18817c26ee77dafa157883af89268e15f4a5a1a1ff3ffa4cde5
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+PKG_BUILD_DEPENDS:=wayland
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/meson.mk
+
+MESON_ARGS += \
+       -Dtests=false
+
+define Package/wayland-protocols
+  SECTION:=libs
+  CATEGORY:=Video
+  SUBMENU:=Frameworks and Toolkits
+  TITLE:=wayland-protocols
+  URL:=https://wayland.freedesktop.org/
+  PKGARCH:=all
+endef
+
+define Package/wayland-protocols/description
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/share/wayland-protocols
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/wayland-protocols/* $(1)/usr/share/wayland-protocols
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/wayland-protocols/install
+       $(INSTALL_DIR) $(1)/usr/share/wayland-protocols
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/wayland-protocols/* $(1)/usr/share/wayland-protocols
+endef
+
+$(eval $(call BuildPackage,wayland-protocols))
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',
diff --git a/libs/cairo/Makefile b/libs/cairo/Makefile
new file mode 100644 (file)
index 0000000..dc3baf4
--- /dev/null
@@ -0,0 +1,75 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cairo
+PKG_VERSION:=1.16.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://cairo.freedesktop.org/releases/
+PKG_HASH:=5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=LGPL-2.1-or-later MPL-1.1
+PKG_LICENSE_FILES:=COPYING COPYING-LGPL-2.1 COPYING-MPL-1.1
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libcairo
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  TITLE:=cairo
+  URL:=https://cairo.freedesktop.org/
+  DEPENDS:=+libpng +libfreetype +fontconfig +libmesa +pixman +glib2 +libjpeg +zlib
+endef
+
+define Package/libcairo/description
+  Cairo is a 2D graphics library with support for multiple output devices.
+endef
+
+CONFIGURE_ARGS += \
+       --oldincludedir="$(STAGING_DIR)/usr/include" \
+       --x-includes="$(STAGING_DIR)/usr/include" \
+       --x-libraries="$(STAGING_DIR)/usr/lib" \
+       --without-x \
+       --without-gallium \
+       --enable-pdf \
+       --enable-png \
+       --enable-ps \
+       --enable-svg \
+       --enable-tee \
+       --enable-ft \
+       --enable-glesv3 \
+       --enable-test-surfaces=no \
+       --enable-drm=no \
+       --enable-gallium=no \
+       --enable-x=no \
+       --enable-xcb=no \
+       --enable-xlib-xrender=no \
+       --enable-xcb=no \
+       --enable-xlib-xcb=no \
+       --enable-xcb-shm=no
+
+define Package/libcairo/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib/cairo
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/cairo/*.so $(1)/usr/lib/cairo
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/cairo
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/cairo/*.h $(1)/usr/include/cairo
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib/cairo
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/cairo/*.so $(1)/usr/lib/cairo
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
+endef
+
+$(eval $(call BuildPackage,libcairo))
diff --git a/libs/cairo/patches/001-musl-stacksize.patch b/libs/cairo/patches/001-musl-stacksize.patch
new file mode 100644 (file)
index 0000000..3f97334
--- /dev/null
@@ -0,0 +1,23 @@
+Reduce the footprint of stack frame usage by turning
+some large(r) structures as `static __thread` instead.
+
+--- a/src/cairo-rectangular-scan-converter.c
++++ b/src/cairo-rectangular-scan-converter.c
+@@ -489,7 +489,7 @@ generate (cairo_rectangular_scan_convert
+         cairo_span_renderer_t *renderer,
+         rectangle_t **rectangles)
+ {
+-    sweep_line_t sweep_line;
++    static __thread sweep_line_t sweep_line;
+     rectangle_t *start, *stop;
+     cairo_status_t status;
+@@ -656,7 +656,7 @@ _cairo_rectangular_scan_converter_genera
+                                           cairo_span_renderer_t       *renderer)
+ {
+     cairo_rectangular_scan_converter_t *self = converter;
+-    rectangle_t *rectangles_stack[CAIRO_STACK_ARRAY_LENGTH (rectangle_t *)];
++    static __thread rectangle_t *rectangles_stack[CAIRO_STACK_ARRAY_LENGTH (rectangle_t *)];
+     rectangle_t **rectangles;
+     struct _cairo_rectangular_scan_converter_chunk *chunk;
+     cairo_status_t status;
diff --git a/libs/cairo/patches/002-CVE-2018-19876.patch b/libs/cairo/patches/002-CVE-2018-19876.patch
new file mode 100644 (file)
index 0000000..ea88bea
--- /dev/null
@@ -0,0 +1,25 @@
+From 90e85c2493fdfa3551f202ff10282463f1e36645 Mon Sep 17 00:00:00 2001
+From: Carlos Garcia Campos <cgarcia@igalia.com>
+Date: Mon, 19 Nov 2018 12:33:07 +0100
+Subject: [PATCH] ft: Use FT_Done_MM_Var instead of free when available in
+ cairo_ft_apply_variations
+
+Fixes a crash when using freetype >= 2.9
+---
+ src/cairo-ft-font.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/src/cairo-ft-font.c
++++ b/src/cairo-ft-font.c
+@@ -2393,7 +2393,11 @@ skip:
+ done:
+         free (coords);
+         free (current_coords);
++#if HAVE_FT_DONE_MM_VAR
++        FT_Done_MM_Var (face->glyph->library, ft_mm_var);
++#else
+         free (ft_mm_var);
++#endif
+     }
+ }
diff --git a/libs/cairo/patches/003-pdf-flush.patch b/libs/cairo/patches/003-pdf-flush.patch
new file mode 100644 (file)
index 0000000..4f56f9a
--- /dev/null
@@ -0,0 +1,28 @@
+From https://cgit.freedesktop.org/cairo/commit/?id=4c8813f0eaacc32c27126ad2296951a626300b89
+
+Fixes https://gitlab.freedesktop.org/cairo/cairo/issues/342
+
+From 4c8813f0eaacc32c27126ad2296951a626300b89 Mon Sep 17 00:00:00 2001
+From: Adrian Johnson <ajohnson@redneon.com>
+Date: Thu, 25 Oct 2018 18:46:17 +1030
+Subject: pdf: add missing flush
+
+Issue #342
+---
+ src/cairo-pdf-surface.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/src/cairo-pdf-surface.c
++++ b/src/cairo-pdf-surface.c
+@@ -7711,6 +7711,11 @@ _cairo_pdf_surface_mask (void                   *abstrac
+      * and most common, case to handle. */
+     if (_cairo_pattern_is_constant_alpha (mask, &extents.bounded, &alpha) &&
+       _can_paint_pattern (source)) {
++
++      status = _cairo_pdf_operators_flush (&surface->pdf_operators);
++      if (unlikely (status))
++          goto cleanup;
++
+       _cairo_output_stream_printf (surface->output, "q\n");
+       status = _cairo_pdf_surface_paint_pattern (surface,
+                                                  op,
diff --git a/libs/cairo/patches/004-fix-mask-usage-in-image-compositor.patch b/libs/cairo/patches/004-fix-mask-usage-in-image-compositor.patch
new file mode 100644 (file)
index 0000000..2c2e51f
--- /dev/null
@@ -0,0 +1,120 @@
+From 03a820b173ed1fdef6ff14b4468f5dbc02ff59be Mon Sep 17 00:00:00 2001
+From: Heiko Lewin <heiko.lewin@worldiety.de>
+Date: Tue, 15 Dec 2020 16:48:19 +0100
+Subject: [PATCH 1/3] Fix mask usage in image-compositor
+
+---
+ src/cairo-image-compositor.c                |   8 ++--
+ test/Makefile.sources                       |   1 +
+ test/bug-image-compositor.c                 |  39 ++++++++++++++++++++
+ test/reference/bug-image-compositor.ref.png | Bin 0 -> 185 bytes
+ 4 files changed, 44 insertions(+), 4 deletions(-)
+ create mode 100644 test/bug-image-compositor.c
+ create mode 100644 test/reference/bug-image-compositor.ref.png
+
+--- a/src/cairo-image-compositor.c
++++ b/src/cairo-image-compositor.c
+@@ -2601,14 +2601,14 @@ _inplace_src_spans (void *abstract_rende
+                   unsigned num_spans)
+ {
+     cairo_image_span_renderer_t *r = abstract_renderer;
+-    uint8_t *m;
++    uint8_t *m, *base = (uint8_t*)pixman_image_get_data(r->mask);
+     int x0;
+     if (num_spans == 0)
+       return CAIRO_STATUS_SUCCESS;
+     x0 = spans[0].x;
+-    m = r->_buf;
++    m = base;
+     do {
+       int len = spans[1].x - spans[0].x;
+       if (len >= r->u.composite.run_length && spans[0].coverage == 0xff) {
+@@ -2646,7 +2646,7 @@ _inplace_src_spans (void *abstract_rende
+                                     spans[0].x, y,
+                                     spans[1].x - spans[0].x, h);
+-          m = r->_buf;
++          m = base;
+           x0 = spans[1].x;
+       } else if (spans[0].coverage == 0x0) {
+           if (spans[0].x != x0) {
+@@ -2675,7 +2675,7 @@ _inplace_src_spans (void *abstract_rende
+ #endif
+           }
+-          m = r->_buf;
++          m = base;
+           x0 = spans[1].x;
+       } else {
+           *m++ = spans[0].coverage;
+--- /dev/null
++++ b/test/bug-image-compositor.c
+@@ -0,0 +1,66 @@
++/*
++ * Copyright © 2020 Uli Schlachter, Heiko Lewin
++ *
++ * Permission is hereby granted, free of charge, to any person
++ * obtaining a copy of this software and associated documentation
++ * files (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy,
++ * modify, merge, publish, distribute, sublicense, and/or sell copies
++ * of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
++ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
++ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
++ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
++ * SOFTWARE.
++ *
++ * Author: Uli Schlachter <psychon@znc.in>
++ * Author: Heiko Lewin <hlewin@gmx.de>
++ */
++#include "cairo-test.h"
++
++
++/* This test reproduces an overflow of a mask-buffer in cairo-image-compositor.c */
++
++static cairo_test_status_t
++draw (cairo_t *cr, int width, int height)
++{
++    cairo_set_source_rgb (cr, 0., 0., 0.);
++    cairo_paint (cr);
++
++    cairo_set_source_rgb (cr, 1., 1., 1.);
++    cairo_set_line_width (cr, 1.);
++
++    cairo_pattern_t *p = cairo_pattern_create_linear (0, 0, width, height);
++    cairo_pattern_add_color_stop_rgb (p, 0, 0.99, 1, 1);
++    cairo_pattern_add_color_stop_rgb (p, 1, 1, 1, 1);
++    cairo_set_source (cr, p);
++    cairo_pattern_destroy(p);
++
++    cairo_move_to (cr, 0.5, -1);
++    for (int i = 0; i < width; i+=3) {
++      cairo_rel_line_to (cr, 2, 2);
++      cairo_rel_line_to (cr, 1, -2);
++    }
++
++    cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
++    cairo_stroke (cr);
++
++    return CAIRO_TEST_SUCCESS;
++}
++
++
++CAIRO_TEST (bug_image_compositor,
++          "Crash in image-compositor",
++          "stroke, stress", /* keywords */
++          NULL, /* requirements */
++          10000, 1,
++          NULL, draw)
++          
diff --git a/libs/cairo/patches/005-composite_color_glyphs.patch b/libs/cairo/patches/005-composite_color_glyphs.patch
new file mode 100644 (file)
index 0000000..407e9b4
--- /dev/null
@@ -0,0 +1,56 @@
+From 79ad01724161502e8d9d2bd384ff1f0174e5df6e Mon Sep 17 00:00:00 2001
+From: Matthias Clasen <mclasen@redhat.com>
+Date: Thu, 30 May 2019 07:30:55 -0400
+Subject: [PATCH] Fix a thinko in composite_color_glyphs
+
+We can't just move around the contents of the
+passed-in string, we need to make a copy. This
+was showing up as memory corruption in pango.
+
+See https://gitlab.gnome.org/GNOME/pango/issues/346
+---
+ src/cairo-surface.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+Patch-Source: https://github.com/matthiasclasen/cairo/commit/79ad01724161502e8d9d2bd384ff1f0174e5df6e
+
+--- a/src/cairo-surface.c
++++ b/src/cairo-surface.c
+@@ -2820,6 +2820,7 @@ _cairo_surface_show_text_glyphs (cairo_s
+                                const cairo_clip_t             *clip)
+ {
+     cairo_int_status_t status;
++    char *utf8_copy = NULL;
+     TRACE ((stderr, "%s\n", __FUNCTION__));
+     if (unlikely (surface->status))
+@@ -2847,6 +2848,10 @@ _cairo_surface_show_text_glyphs (cairo_s
+     status = CAIRO_INT_STATUS_UNSUPPORTED;
+     if (_cairo_scaled_font_has_color_glyphs (scaled_font)) {
++        utf8_copy = malloc (sizeof (char) * utf8_len);
++        memcpy (utf8_copy, utf8, sizeof (char) * utf8_len);
++        utf8 = utf8_copy;
++
+         status = composite_color_glyphs (surface, op,
+                                          source,
+                                          (char *)utf8, &utf8_len,
+@@ -2861,6 +2866,8 @@ _cairo_surface_show_text_glyphs (cairo_s
+         if (num_glyphs == 0)
+             goto DONE;
+     }
++    else
++      utf8_copy = NULL;
+     /* The logic here is duplicated in _cairo_analysis_surface show_glyphs and
+      * show_text_glyphs.  Keep in synch. */
+@@ -2918,6 +2925,9 @@ DONE:
+       surface->serial++;
+     }
++    if (utf8_copy)
++        free (utf8_copy);
++
+     return _cairo_surface_set_error (surface, status);
+ }
diff --git a/libs/cairo/patches/006-cff-allow-empty-array-of-operands-for-certain-operat.patch b/libs/cairo/patches/006-cff-allow-empty-array-of-operands-for-certain-operat.patch
new file mode 100644 (file)
index 0000000..b750e46
--- /dev/null
@@ -0,0 +1,114 @@
+From ef959bc76e65ea0b0d4ba3ee50dfbce31c3484ad Mon Sep 17 00:00:00 2001
+From: Marek Kasik <mkasik@redhat.com>
+Date: Fri, 27 Mar 2020 19:39:46 +0100
+Subject: [PATCH] cff: Allow empty array of operands for certain operators
+
+Operators BlueValues, OtherBlues, FamilyBlues, FamilyOtherBlues,
+StemSnapH and StemSnapV have operands of type delta which can be
+a number or an array of delta-encoded numbers. This array can be
+empty according to freetype developers.
+This commit checks whether current operator is among those listed
+and permits empty operand in such case.
+---
+ src/cairo-cff-subset.c | 78 ++++++++++++++++++++++++++----------------
+ 1 file changed, 49 insertions(+), 29 deletions(-)
+
+Patch-Source: https://src.fedoraproject.org/rpms/cairo/blob/ba42ecc23bb1162a1951edc0209f9f48e87bba7e/f/0001-cff-Allow-empty-array-of-operands-for-certain-operat.patch
+See-Also: https://bugzilla.redhat.com/show_bug.cgi?id=1817958
+
+--- a/src/cairo-cff-subset.c
++++ b/src/cairo-cff-subset.c
+@@ -56,30 +56,36 @@
+ /* CFF Dict Operators. If the high byte is 0 the command is encoded
+  * with a single byte. */
+-#define BASEFONTNAME_OP  0x0c16
+-#define CIDCOUNT_OP      0x0c22
+-#define CHARSET_OP       0x000f
+-#define CHARSTRINGS_OP   0x0011
+-#define COPYRIGHT_OP     0x0c00
+-#define DEFAULTWIDTH_OP  0x0014
+-#define ENCODING_OP      0x0010
+-#define FAMILYNAME_OP    0x0003
+-#define FDARRAY_OP       0x0c24
+-#define FDSELECT_OP      0x0c25
+-#define FONTBBOX_OP      0x0005
+-#define FONTMATRIX_OP    0x0c07
+-#define FONTNAME_OP      0x0c26
+-#define FULLNAME_OP      0x0002
+-#define LOCAL_SUB_OP     0x0013
+-#define NOMINALWIDTH_OP  0x0015
+-#define NOTICE_OP        0x0001
+-#define POSTSCRIPT_OP    0x0c15
+-#define PRIVATE_OP       0x0012
+-#define ROS_OP           0x0c1e
+-#define UNIQUEID_OP      0x000d
+-#define VERSION_OP       0x0000
+-#define WEIGHT_OP        0x0004
+-#define XUID_OP          0x000e
++#define BASEFONTNAME_OP     0x0c16
++#define CIDCOUNT_OP         0x0c22
++#define CHARSET_OP          0x000f
++#define CHARSTRINGS_OP      0x0011
++#define COPYRIGHT_OP        0x0c00
++#define DEFAULTWIDTH_OP     0x0014
++#define ENCODING_OP         0x0010
++#define FAMILYNAME_OP       0x0003
++#define FDARRAY_OP          0x0c24
++#define FDSELECT_OP         0x0c25
++#define FONTBBOX_OP         0x0005
++#define FONTMATRIX_OP       0x0c07
++#define FONTNAME_OP         0x0c26
++#define FULLNAME_OP         0x0002
++#define LOCAL_SUB_OP        0x0013
++#define NOMINALWIDTH_OP     0x0015
++#define NOTICE_OP           0x0001
++#define POSTSCRIPT_OP       0x0c15
++#define PRIVATE_OP          0x0012
++#define ROS_OP              0x0c1e
++#define UNIQUEID_OP         0x000d
++#define VERSION_OP          0x0000
++#define WEIGHT_OP           0x0004
++#define XUID_OP             0x000e
++#define BLUEVALUES_OP       0x0006
++#define OTHERBLUES_OP       0x0007
++#define FAMILYBLUES_OP      0x0008
++#define FAMILYOTHERBLUES_OP 0x0009
++#define STEMSNAPH_OP        0x0c0c
++#define STEMSNAPV_OP        0x0c0d
+ #define NUM_STD_STRINGS 391
+@@ -615,13 +621,27 @@ cff_dict_create_operator (int
+       return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+     _cairo_dict_init_key (op, operator);
+-    op->operand = _cairo_malloc (size);
+-    if (unlikely (op->operand == NULL)) {
+-        free (op);
+-      return _cairo_error (CAIRO_STATUS_NO_MEMORY);
++    if (size != 0) {
++      op->operand = _cairo_malloc (size);
++      if (unlikely (op->operand == NULL)) {
++          free (op);
++          return _cairo_error (CAIRO_STATUS_NO_MEMORY);
++      }
++      memcpy (op->operand, operand, size);
++    } else {
++      op->operand = NULL;
++      /* Delta-encoded arrays can be empty. */
++      if (operator != BLUEVALUES_OP &&
++          operator != OTHERBLUES_OP &&
++          operator != FAMILYBLUES_OP &&
++          operator != FAMILYOTHERBLUES_OP &&
++          operator != STEMSNAPH_OP &&
++          operator != STEMSNAPV_OP) {
++          free (op);
++          return _cairo_error (CAIRO_STATUS_NO_MEMORY);
++      }
+     }
+-    memcpy (op->operand, operand, size);
+     op->operand_length = size;
+     op->operand_offset = -1;
diff --git a/libs/fribidi/Makefile b/libs/fribidi/Makefile
new file mode 100644 (file)
index 0000000..755ac33
--- /dev/null
@@ -0,0 +1,48 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fribidi
+PKG_VERSION:=1.0.10
+PKG_RELEASE:=$(AUTORELEASE)
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/fribidi/fribidi/releases/download/v1.0.10/
+PKG_HASH:=7f1c687c7831499bcacae5e8675945a39bacbad16ecaa945e9454a32df653c01
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/meson.mk
+
+MESON_ARGS += \
+       -Dtests=false
+
+define Package/fribidi
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  TITLE:=fribidi
+  URL:=https://github.com/fribidi/fribidi
+endef
+
+define Package/fribidi/description
+endef
+
+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/*.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/fribidi/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,fribidi))
diff --git a/libs/harfbuzz/Makefile b/libs/harfbuzz/Makefile
new file mode 100644 (file)
index 0000000..9b434e4
--- /dev/null
@@ -0,0 +1,51 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=harfbuzz
+PKG_VERSION:=2.9.0
+PKG_RELEASE:=$(AUTORELEASE)
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/harfbuzz/harfbuzz/releases/download/2.9.0/
+PKG_HASH:=3e1c2e1d2c65d56364fd16d1c41a06b2a35795496f78dfff635c2b7414b54c5a
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/meson.mk
+
+MESON_ARGS += \
+       -Dtests=disabled \
+       -Ddocs=disabled \
+       -Dbenchmark=disabled
+
+define Package/harfbuzz
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  TITLE:=hafbuzz
+  URL:=http://www.harfbuzz.org/
+  DEPENDS:=+icu +libfreetype +glib2
+endef
+
+define Package/harfbuzz/description
+endef
+
+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/*.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/harfbuzz/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,harfbuzz))
diff --git a/libs/kmscube/Makefile b/libs/kmscube/Makefile
new file mode 100644 (file)
index 0000000..25891d7
--- /dev/null
@@ -0,0 +1,37 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=kmscube
+PKG_RELEASE:=$(AUTORELEASE)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_DATE:=2021-02-07
+PKG_SOURCE_VERSION:=9f63f359fab1b5d8e862508e4e51c9dfe339ccb0
+PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mesa/kmscube
+PKG_MIRROR_HASH:=9b95a45789d81db6661be38d2c24181d7d90082edc5689225a6073d587f1235f
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=MIT
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/meson.mk
+
+define Package/kmscube
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  DEPENDS:=+glib2 +libmesa +libpng +gstreamer1-plugins-base +libgstreamer1 +libgst1allocators +libgst1video +libgst1app
+  TITLE:=kmscube KMS/DRM/EGL example
+  URL:=https://www.mesa3d.org
+endef
+
+define Package/kmscube/description
+endef
+
+define Package/kmscube/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,kmscube))
diff --git a/libs/libxkbcommon/Makefile b/libs/libxkbcommon/Makefile
new file mode 100644 (file)
index 0000000..58277e9
--- /dev/null
@@ -0,0 +1,56 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libxkbcommon
+PKG_VERSION:=1.3.0
+PKG_RELEASE:=$(AUTORELEASE)
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://xkbcommon.org/download/
+PKG_HASH:=7b09e098ea69bc3054f0c57a9a25fda571c4df22398811606e32b5fffeb75e7b
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_INSTALL:=1
+
+PKG_BUILD_DEPENDS:=wayland
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/meson.mk
+
+MESON_ARGS += \
+       -Denable-x11=false \
+       -Denable-docs=false \
+       -Denable-wayland=true \
+       -Dscanner_bin="$(STAGING_DIR_HOSTPKG)/bin/wayland-scanner"
+
+define Package/libxkbcommon
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=libxkbcommon
+  URL:=https://xkbcommon.org/
+  DEPENDS:=+libwayland +libxml2 +wayland-protocols
+endef
+
+define Package/libxkbcommon/description
+endef
+
+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/*.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/libxkbcommon/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/libexec/xkbcommon
+       $(CP) $(PKG_INSTALL_DIR)/usr/libexec/xkbcommon/* $(1)/usr/libexec/xkbcommon/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xkbcli $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libxkbcommon))
diff --git a/libs/libxkbcommon/patches/001-fix-wayland-scanner-detect.patch b/libs/libxkbcommon/patches/001-fix-wayland-scanner-detect.patch
new file mode 100644 (file)
index 0000000..0a41f83
--- /dev/null
@@ -0,0 +1,30 @@
+--- a/meson.build
++++ b/meson.build
+@@ -480,7 +480,11 @@ if build_tools
+ You can disable the Wayland xkbcli programs with -Denable-wayland=false.''')
+         endif
+-        wayland_scanner = find_program(wayland_scanner_dep.get_pkgconfig_variable('wayland_scanner'))
++        if (get_option('scanner_bin') == '')
++            wayland_scanner = find_program(wayland_scanner_dep.get_pkgconfig_variable('wayland_scanner'))
++        else
++            wayland_scanner = find_program(get_option('scanner_bin'))
++        endif
+         wayland_scanner_code_gen = generator(
+             wayland_scanner,
+             output: '@BASENAME@-protocol.c',
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -62,6 +62,12 @@ option(
+     description: 'Enable support for Wayland utility programs',
+ )
+ option(
++    'scanner_bin',
++    description: 'Path to wayland-scanner binary',
++    type: 'string',
++    value: ''
++)
++option(
+     'enable-xkbregistry',
+     type: 'boolean',
+     value: true,
diff --git a/libs/mesa/Makefile b/libs/mesa/Makefile
new file mode 100644 (file)
index 0000000..c61f558
--- /dev/null
@@ -0,0 +1,317 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mesa
+PKG_VERSION:=21.1.7
+PKG_RELEASE:=$(AUTORELEASE)
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://archive.mesa3d.org/
+PKG_HASH:=e9e67c10654f2e4bf15b944bb048007a614292aa4792b1b7512eb700b7b3a7bb
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_INSTALL:=1
+PKG_BUILD_DEPENDS:=Mako/host
+
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_LIBDRM_INTEL \
+       CONFIG_LIBDRM_NOUVEAU \
+       CONFIG_LIBDRM_RADEON
+
+TARGET_CPPFLAGS+=-Wno-format -Wno-format-security
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/meson.mk
+
+DRI_PLUGINS := \
+       armada-drm:@(aarch64||arm) \
+       etnaviv:@(aarch64||arm) \
+       exynos:@(aarch64||arm) \
+       hx8357d \
+       i915:@LIBDRM_INTEL \
+       i965:@LIBDRM_INTEL \
+       ili9225 \
+       ili9341 \
+       imx-dcss:@(aarch64||arm) \
+       imx-drm:@(aarch64||arm) \
+       ingenic-drm:@(aarch64||arm||mipsel) \
+       kgsl:@(aarch64||arm) \
+       kms_swrast \
+       lima:@(aarch64||arm) \
+       mcde:@arm \
+       mediatek:@(aarch64||arm) \
+       meson:@(aarch64||arm) \
+       mi0283qt \
+       msm:@(aarch64||arm) \
+       mxsfb-drm:@(aarch64||arm) \
+       nouveau:@LIBDRM_NOUVEAU \
+       nouveau_vieux:@LIBDRM_NOUVEAU \
+       panfrost:@(aarch64||arm) \
+       pl111:@(aarch64||arm) \
+       r200:@LIBDRM_RADEON \
+       r300:@LIBDRM_RADEON \
+       radeon:@LIBDRM_RADEON \
+       repaper \
+       rockchip:@(aarch64||arm) \
+       st7586 \
+       st7735r \
+       stm:@(aarch64||arm) \
+       sun4i-drm:@(aarch64||arm) \
+       swrast \
+       tegra:@((aarch64||arm)&&LIBDRM_NOUVEAU) \
+       vmwgfx:@(i386||i686||x86_64) \
+       virtio_gpu
+
+
+define Package/libxatracker
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  TITLE:=Mesa3D libxatracker
+  URL:=https://www.mesa3d.org
+  DEPENDS:=+libstdcpp +zlib +libdrm +libexpat
+endef
+
+define Package/libxatracker/description
+endef
+
+define Package/libglapi
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  TITLE:=Mesa3D libglapi
+  URL:=https://www.mesa3d.org
+  DEPENDS:=+libpthread +libatomic
+endef
+
+define Package/libglapi/description
+endef
+
+define Package/libmesa
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  DEPENDS:=+libglapi +libstdcpp +zlib +libdrm +libwayland +wayland-protocols
+  TITLE:=Mesa3D OpenGL and friends
+  URL:=https://www.mesa3d.org
+endef
+
+define Package/libmesa/description
+endef
+
+define Package/libosmesa
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  DEPENDS:=+libglapi +libstdcpp +zlib +libwayland +wayland-protocols
+  TITLE:=off-screen Mesa library
+  URL:=https://www.mesa3d.org
+endef
+
+define Package/libosmesa/description
+endef
+
+define Package/libvulkan-broadcom
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  DEPENDS:=libmesa @(arm||aarch64)
+  TITLE:=Broadcom Vulkan driver
+  URL:=https://www.mesa3d.org
+endef
+
+define Package/libvulkan-broadcom/description
+endef
+
+define Package/libvulkan-freedreno
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  DEPENDS:=libmesa @(arm||aarch64)
+  TITLE:=Freedreno Vulkan driver
+  URL:=https://www.mesa3d.org
+endef
+
+define Package/libvulkan-freedreno/description
+endef
+
+define Package/libvulkan-intel
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  DEPENDS:=libmesa @(i386||i686||x86_64)
+  TITLE:=Intel Vulkan driver
+  URL:=https://www.mesa3d.org
+endef
+
+define Package/libvulkan-intel/description
+endef
+
+define PluginGen
+define Package/libmesadri-$(subst _,-,$(firstword $(subst :, ,$(1))))
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  TITLE:=Mesa3D DRI $(firstword $(subst :, ,$(1))) plugin
+  URL:=https://www.mesa3d.org
+  DEPENDS:=libmesa $(wordlist 2,$(words $(subst :, ,$(1))),$(subst :, ,$(1)))
+endef
+endef
+
+$(foreach file,$(DRI_PLUGINS),$(eval $(call PluginGen,$(file))))
+
+DRI_DRIVERS:=
+GALLIUM_DRIVERS:=kmsro swrast vc4 virgl
+
+# requires LLVM:
+# VULKAN_DRIVERS:=swrast
+
+ifneq ($(CONFIG_LIBDRM_INTEL),)
+  DRI_DRIVERS+=i965
+  VULKAN_DRIVERS+=intel
+  GALLIUM_DRIVERS+=i915
+endif
+
+ifneq ($(CONFIG_LIBDRM_NOUVEAU),)
+  DRI_DRIVERS+=nouveau
+  GALLIUM_DRIVERS+=nouveau
+endif
+
+ifneq ($(CONFIG_LIBDRM_RADEON),)
+  DRI_DRIVERS+=r100 r200
+  GALLIUM_DRIVERS+=r300
+# r600 and radeonsi require LLVM
+endif
+
+ifeq ($(ARCH),x86_64)
+  GALLIUM_DRIVERS+=svga
+endif
+
+ifeq ($(ARCH),i386)
+  GALLIUM_DRIVERS+=svga
+endif
+
+ifeq ($(ARCH),i686)
+  GALLIUM_DRIVERS+=svga
+endif
+
+ifeq ($(ARCH),aarch64)
+  GALLIUM_DRIVERS+=freedreno etnaviv panfrost lima
+  VULKAN_DRIVERS+=broadcom freedreno
+ifneq ($(CONFIG_LIBDRM_NOUVEAU),)
+  GALLIUM_DRIVERS+=tegra
+endif
+endif
+
+ifeq ($(ARCH),arm)
+  GALLIUM_DRIVERS+=freedreno etnaviv panfrost lima
+  VULKAN_DRIVERS+=broadcom freedreno
+ifneq ($(CONFIG_LIBDRM_NOUVEAU),)
+  GALLIUM_DRIVERS+=tegra
+endif
+endif
+
+ifeq ($(ARCH),mips)
+  GALLIUM_DRIVERS+=etnaviv
+endif
+
+ifeq ($(ARCH),mipsel)
+  GALLIUM_DRIVERS+=etnaviv
+endif
+
+
+MESON_ARGS += \
+       -Dplatforms=wayland \
+       -Dglx=disabled \
+       -Ddri3=enabled \
+       -Degl=enabled \
+       -Dgbm=enabled \
+       -Dgles1=enabled \
+       -Dgles2=enabled \
+       -Dglvnd=false \
+       -Dopengl=true \
+       -Dandroid-stub=false \
+       -Ddri-drivers=$(subst $(space),$(comma),$(strip $(DRI_DRIVERS))) \
+       -Dgallium-drivers=$(subst $(space),$(comma),$(strip $(GALLIUM_DRIVERS))) \
+       -Dvulkan-drivers=$(subst $(space),$(comma),$(strip $(VULKAN_DRIVERS))) \
+       -Dosmesa=true \
+       -Dtools= \
+       -Dllvm=disabled \
+       -Dshared-glapi=enabled \
+       -Ddraw-use-llvm=false \
+       -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/dri
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/dri/* $(1)/usr/lib/dri/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
+endef
+
+define Package/libglapi/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libglapi.so* $(1)/usr/lib/
+endef
+
+define Package/libxatracker/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxatracker.so* $(1)/usr/lib/
+endef
+
+define Package/libmesa/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*GL*.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgbm.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/share/drirc.d
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/drirc.d/* $(1)/usr/share/drirc.d/
+endef
+
+define Package/libosmesa/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libOSMesa.so* $(1)/usr/lib/
+endef
+
+define Package/libvulkan-broadcom/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libvulkan_broadcom.so $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/share/vulkan/icd.d
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/vulkan/icd.d/broadcom_icd.generic.json $(1)/usr/share/vulkan/icd.d/
+endef
+
+define Package/libvulkan-freedreno/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libvulkan_freedreno.so $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/share/vulkan/icd.d
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/vulkan/icd.d/freedreno_icd.generic.json $(1)/usr/share/vulkan/icd.d/
+endef
+
+define Package/libvulkan-intel/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libvulkan_intel.so $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/share/vulkan/icd.d
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/vulkan/icd.d/intel_icd.generic.json $(1)/usr/share/vulkan/icd.d/
+endef
+
+define PluginInstall
+define Package/libmesadri-$(subst _,-,$(firstword $(subst :, ,$(1))))/install
+       $(INSTALL_DIR) $$(1)/usr/lib/dri
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/lib/dri/$(firstword $(subst :, ,$(1)))_dri.so \
+               $$(1)/usr/lib/dri
+endef
+endef
+
+$(foreach file,$(DRI_PLUGINS),$(eval $(call PluginInstall,$(file))))
+$(foreach file,$(DRI_PLUGINS),$(eval $(call BuildPackage,libmesadri-$(subst _,-,$(firstword $(subst :, ,$(file)))))))
+$(eval $(call BuildPackage,libxatracker))
+$(eval $(call BuildPackage,libglapi))
+$(eval $(call BuildPackage,libmesa))
+$(eval $(call BuildPackage,libosmesa))
+$(eval $(call BuildPackage,libvulkan-intel))
+$(eval $(call BuildPackage,libvulkan-broadcom))
+$(eval $(call BuildPackage,libvulkan-freedreno))
diff --git a/libs/mesa/patches/001-fix-wayland-scanner-detect.patch b/libs/mesa/patches/001-fix-wayland-scanner-detect.patch
new file mode 100644 (file)
index 0000000..482c6bc
--- /dev/null
@@ -0,0 +1,39 @@
+--- a/meson.build
++++ b/meson.build
+@@ -1830,12 +1830,17 @@ endif
+ # TODO: symbol mangling
+ if with_platform_wayland
+-  dep_wl_scanner = dependency('wayland-scanner', native: true)
+-  prog_wl_scanner = find_program(dep_wl_scanner.get_pkgconfig_variable('wayland_scanner'))
+-  if dep_wl_scanner.version().version_compare('>= 1.15')
+-    wl_scanner_arg = 'private-code'
++  if (get_option('scanner_bin') == '')
++    dep_wl_scanner = dependency('wayland-scanner', native: true)
++    prog_wl_scanner = find_program(dep_wl_scanner.get_pkgconfig_variable('wayland_scanner'))
++    if dep_wl_scanner.version().version_compare('>= 1.15')
++      wl_scanner_arg = 'private-code'
++    else
++      wl_scanner_arg = 'code'
++    endif
+   else
+-    wl_scanner_arg = 'code'
++    prog_wl_scanner = get_option('scanner_bin')
++    wl_scanner_arg = 'private-code'
+   endif
+   dep_wl_protocols = dependency('wayland-protocols', version : '>= 1.8')
+   dep_wayland_client = dependency('wayland-client', version : '>=1.18')
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -456,6 +456,11 @@ option(
+   value : 25,
+   description : 'Android Platform SDK version. Default: Nougat version.'
+ )
++option('scanner_bin',
++  description: 'Path to wayland-scanner binary',
++  type: 'string',
++  value: ''
++)
+ option(
+   'zstd',
+   type : 'combo',
diff --git a/libs/pango/Makefile b/libs/pango/Makefile
new file mode 100644 (file)
index 0000000..25c74f8
--- /dev/null
@@ -0,0 +1,59 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pango
+PKG_VERSION:=1.48.9
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GNOME/$(PKG_NAME)/1.48
+PKG_HASH:=a913657d3fe5aa04c03958a3b5d3fc859e891b75cd81b873a819330f6c0872aa
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=LGPL-2.0-or-later
+PKG_LICENSE_FILES:=COPYING
+PKG_CPE_ID:=cpe:/a:gnome:pango
+
+PKG_BUILD_DEPENDS:=glib2/host
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+include $(INCLUDE_DIR)/meson.mk
+
+define Package/libpango
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  TITLE:=libpango
+  URL:=https://www.pango.org/
+  DEPENDS:=+glib2 +fribidi +harfbuzz +libcairo $(ICONV_DEPENDS) $(INTL_DEPENDS)
+endef
+
+MESON_ARGS += \
+       -Dgnome=false \
+       -Dintrospection=disabled \
+       -Dvapi=disabled \
+       -Dgtk_doc=false \
+       -Dtests=false \
+       -Dinstalled_tests=false \
+       -Dsysprof=disabled
+
+define package/libpango/decription
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/include/pango-1.0/pango
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/pango-1.0/pango/*.h $(1)/usr/include/pango-1.0/pango/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
+
+endef
+
+define Package/libpango/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libpango))
diff --git a/libs/seatd/Makefile b/libs/seatd/Makefile
new file mode 100644 (file)
index 0000000..f2cd1db
--- /dev/null
@@ -0,0 +1,74 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=seatd
+PKG_VERSION:=0.5.0
+PKG_RELEASE:=$(AUTORELEASE)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://git.sr.ht/~kennylevinsen/seatd
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+PKG_MIRROR_HASH:=9b899307e8717dc21735b02c80ebc91d6925c6bc5037f4a438d01258f472bc77
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=MIT
+
+PKG_INSTALL:=1
+PKG_BUILD_DEPENDS:=wayland/host
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/meson.mk
+
+define Package/libseat
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  TITLE:=libseat
+  URL:=https://git.sr.ht/~kennylevinsen/seatd
+endef
+
+define Package/libseat/description
+endef
+
+define Package/seatd
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  TITLE:=seatd
+  URL:=https://git.sr.ht/~kennylevinsen/seatd
+  DEPENDS:=+libseat
+endef
+
+define Package/seatd/description
+endef
+
+MESON_ARGS += \
+       -Dlogind=disabled \
+       -Dseatd=enabled \
+       -Dbuiltin=disabled \
+       -Dserver=enabled \
+       -Dexamples=disabled \
+       -Dman-pages=disabled \
+       -Ddefaultpath="/tmp/run/seatd.sock"
+
+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/libseat/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
+endef
+
+define Package/seatd/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/seatd $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libseat))
+$(eval $(call BuildPackage,seatd))
+$(eval $(call HostBuild))
diff --git a/libs/wayland-utils/Makefile b/libs/wayland-utils/Makefile
new file mode 100644 (file)
index 0000000..f9bc237
--- /dev/null
@@ -0,0 +1,41 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=wayland-utils
+PKG_VERSION:=1.0.0
+PKG_RELEASE:=$(AUTORELEASE)
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://wayland.freedesktop.org/releases/
+PKG_HASH:=64fecc4c58e87ae9b302901abe10c2e8af69c7503c221a96ecd0700e0aa268c0
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+PKG_BUILD_DEPENDS:=wayland/host
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/meson.mk
+
+define Package/wayland-info
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  TITLE:=wayland-utils
+  URL:=https://wayland.freedesktop.org/
+  DEPENDS:=+libwayland +wayland-protocols
+endef
+
+define Package/wayland-info/description
+endef
+
+MESON_ARGS += \
+       -Dscanner_bin="$(STAGING_DIR_HOSTPKG)/bin/wayland-scanner"
+
+define Package/wayland-info/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wayland-info $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,wayland-info))
diff --git a/libs/wayland-utils/patches/001-fix-wayland-scanner-detect.patch b/libs/wayland-utils/patches/001-fix-wayland-scanner-detect.patch
new file mode 100644 (file)
index 0000000..5a4dcd8
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/wayland-info/meson.build
++++ b/wayland-info/meson.build
+@@ -1,5 +1,9 @@
+ dep_scanner = dependency('wayland-scanner', native: true)
+-prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner'))
++if (get_option('scanner_bin') == '')
++      prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner'))
++else
++      prog_scanner = find_program(get_option('scanner_bin'))
++endif
+ dep_wp = dependency('wayland-protocols', version: '>= 1.18')
+ dir_wp_base = dep_wp.get_pkgconfig_variable('pkgdatadir')
+--- /dev/null
++++ b/meson_options.txt
+@@ -0,0 +1,6 @@
++option(
++      'scanner_bin',
++      description: 'Path to wayland-scanner binary',
++      type: 'string',
++      value: ''
++)
diff --git a/libs/weston/Makefile b/libs/weston/Makefile
new file mode 100644 (file)
index 0000000..406b555
--- /dev/null
@@ -0,0 +1,89 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=weston
+PKG_RELEASE:=$(AUTORELEASE)
+
+#PKG_VERSION:=9.0.0
+#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+#PKG_SOURCE_URL:=https://wayland.freedesktop.org/releases/
+#PKG_HASH:=5cf5d6ce192e0eb15c1fc861a436bf21b5bb3b91dbdabbdebe83e1f83aa098fe
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://gitlab.freedesktop.org/wayland/weston.git
+PKG_SOURCE_DATE:=2021-08-13
+PKG_VERSION:=10.0.0~pre0-$(PKG_SOURCE_DATE)
+PKG_SOURCE_VERSION:=d259bbeccdd321b5327537ddcdde06b8c5671d48
+PKG_MIRROR_HASH:=45f6f7ff0a18f11222a09813064ef1a4bc6539eee4e73430d93ce38feea9c9cc
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+PKG_BUILD_DEPENDS:=wayland/host
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/meson.mk
+
+define Package/weston
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  TITLE:=weston
+  URL:=https://wayland.freedesktop.org/
+  DEPENDS:=+gstreamer1-plugins-base +libcairo +libevdev \
+       +libgst1allocators +libgst1app +libgst1video +libgstreamer1 +libinput \
+       +libmesa +libpango +libseat +libwayland +libwebp +libxkbcommon +pixman \
+       +seatd +wayland-protocols +xkeyboard-config
+endef
+
+define Package/weston/description
+endef
+
+MESON_ARGS += \
+       -Dlauncher-logind=false \
+       -Dweston-launch=false \
+       -Dlauncher-libseat=true \
+       -Dbackend-drm=true \
+       -Dbackend-drm-screencast-vaapi=false \
+       -Dbackend-headless=false \
+       -Dbackend-rdp=false \
+       -Dbackend-x11=false \
+       -Dxwayland=false \
+       -Dcolor-management-lcms=false \
+       -Dcolor-management-colord=false \
+       -Dsystemd=false \
+       -Dpipewire=false \
+       -Dtest-gl-renderer=false \
+       -Dtest-junit-xml=false \
+       -Ddemo-clients=true \
+       -Ddoc=false \
+       -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/weston/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/libweston-10
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libweston-10/*.so* $(1)/usr/lib/libweston-10/
+       $(INSTALL_DIR) $(1)/usr/lib/weston
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/weston/*.so* $(1)/usr/lib/weston/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/libexec
+       $(CP) $(PKG_INSTALL_DIR)/usr/libexec/* $(1)/usr/libexec/
+       $(INSTALL_DIR) $(1)/usr/share/libweston-10/protocols
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/libweston-10/protocols/* $(1)/usr/share/libweston-10/protocols/
+       $(INSTALL_DIR) $(1)/usr/share/weston
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/weston/* $(1)/usr/share/weston/
+endef
+
+$(eval $(call BuildPackage,weston))
diff --git a/libs/weston/patches/001-fix-wayland-scanner-detect.patch b/libs/weston/patches/001-fix-wayland-scanner-detect.patch
new file mode 100644 (file)
index 0000000..277c45b
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -242,3 +242,9 @@ option(
+       value: false,
+       description: 'Generate documentation'
+ )
++option(
++      'scanner_bin',
++      description: 'Path to wayland-scanner binary',
++      type: 'string',
++      value: ''
++)
+--- a/protocol/meson.build
++++ b/protocol/meson.build
+@@ -1,5 +1,9 @@
+ dep_scanner = dependency('wayland-scanner', native: true)
+-prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner'))
++if (get_option('scanner_bin') == '')
++      prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner'))
++else
++      prog_scanner = find_program(get_option('scanner_bin'))
++endif
+ dep_wp = dependency('wayland-protocols', version: '>= 1.19')
+ dir_wp_base = dep_wp.get_pkgconfig_variable('pkgdatadir')
diff --git a/libs/weston/patches/100-timespec.patch b/libs/weston/patches/100-timespec.patch
new file mode 100644 (file)
index 0000000..7c2c8f6
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/tests/timespec-test.c
++++ b/tests/timespec-test.c
+@@ -25,6 +25,7 @@
+ #include "config.h"
++#include <time.h>
+ #include <stdlib.h>
+ #include <stdint.h>
+ #include <stdio.h>
diff --git a/libs/xkeyboard-config/Makefile b/libs/xkeyboard-config/Makefile
new file mode 100644 (file)
index 0000000..4941389
--- /dev/null
@@ -0,0 +1,41 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=xkeyboard-config
+PKG_VERSION:=2.24
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://www.x.org/releases/individual/data/$(PKG_NAME)/
+PKG_HASH:=91b18580f46b4e4ea913707f6c8d68ab5286879c3a6591462f3b9e760d3ac4d7
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+PKG_BUILD_DEPENDS:=libxslt/host intltool/host perl-xml-parser/host
+
+include $(INCLUDE_DIR)/package.mk
+
+CONFIGURE_ARGS += --disable-runtime-deps
+
+define Package/xkeyboard-config
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=xkeyboard-config
+  URL:=https://www.freedesktop.org/wiki/Software/XKeyboardConfig/
+  DEPENDS:=+libxkbcommon $(INTL_DEPENDS)
+endef
+
+define Package/xkeyboard-config/description
+  The non-arch keyboard configuration database for X Window.
+endef
+
+define Package/xkeyboard-config/install
+       $(INSTALL_DIR) $(1)/usr/share/X11/xkb
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/X11/xkb/* $(1)/usr/share/X11/xkb/
+endef
+
+$(eval $(call BuildPackage,xkeyboard-config))