From ef46cb840f4088bc2a97145f71f8dc606c393dd8 Mon Sep 17 00:00:00 2001 From: Reed Wade Date: Wed, 23 Dec 2020 15:03:26 +0100 Subject: [PATCH] New package: wtype-0.3 --- srcpkgs/wtype/patches/fix_reallocarray.patch | 39 ++++++++++++++++++++ srcpkgs/wtype/template | 17 +++++++++ 2 files changed, 56 insertions(+) create mode 100644 srcpkgs/wtype/patches/fix_reallocarray.patch create mode 100644 srcpkgs/wtype/template diff --git a/srcpkgs/wtype/patches/fix_reallocarray.patch b/srcpkgs/wtype/patches/fix_reallocarray.patch new file mode 100644 index 00000000000..30468f26135 --- /dev/null +++ b/srcpkgs/wtype/patches/fix_reallocarray.patch @@ -0,0 +1,39 @@ +From fb8cb526470308d36b28c33620fcb74916f952e8 Mon Sep 17 00:00:00 2001 +From: Josef Gajdusek +Date: Mon, 28 Dec 2020 20:45:36 +0100 +Subject: [PATCH] Do not use reallocarray + +Not available in musl. + +Closes #20 + +Signed-off-by: Reed Wade +--- + main.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/main.c b/main.c +index cbdbb0f..cec1cc2 100644 +--- main.c ++++ main.c +@@ -1,6 +1,4 @@ + +-#define _GNU_SOURCE +- + #include + #include + #include +@@ -140,8 +138,8 @@ unsigned int get_key_code(struct wtype *wtype, wchar_t ch) + return i; + } + } +- wtype->keymap = reallocarray( +- wtype->keymap, ++wtype->keymap_len, sizeof(wtype->keymap[0]) ++ wtype->keymap = realloc( ++ wtype->keymap, ++wtype->keymap_len * sizeof(wtype->keymap[0]) + ); + wtype->keymap[wtype->keymap_len - 1] = ch; + return wtype->keymap_len - 1; +-- +2.29.2 + diff --git a/srcpkgs/wtype/template b/srcpkgs/wtype/template new file mode 100644 index 00000000000..962c7cf82be --- /dev/null +++ b/srcpkgs/wtype/template @@ -0,0 +1,17 @@ +# Template file for 'wtype' +pkgname=wtype +version=0.3 +revision=1 +build_style=meson +hostmakedepends="pkg-config wayland-devel" +makedepends="libxkbcommon-devel wayland-devel" +short_desc="Wayland version of xdotool" +maintainer="Stacy Harper " +license="MIT" +homepage="https://github.com/atx/wtype" +distfiles="https://github.com/atx/${pkgname}/archive/v${version}.tar.gz" +checksum=35615e61e57576a240d10308f9101ceb2ec7b3554fac60119b1416b84c1694b2 + +post_install() { + vlicense LICENSE +}