diff --git a/community/libwacom/APKBUILD b/community/libwacom/APKBUILD index c2d625e60ff2acb2215824180adf688454e8a64d..6fa2b9078b66b26118cf61443578c41e6f534afe 100644 --- a/community/libwacom/APKBUILD +++ b/community/libwacom/APKBUILD @@ -1,37 +1,34 @@ # Contributor: Ivan Tham <pickfire@riseup.net> # Maintainer: Ivan Tham <pickfire@riseup.net> pkgname=libwacom -pkgver=0.32 +pkgver=0.33 pkgrel=0 pkgdesc="Library to help implement Wacom tablet settings" url="https://github.com/linuxwacom/libwacom/wiki" arch="all" license="MIT" -depends="" makedepends="libgudev-dev libxml2-dev glib-dev" checkdepends="bash findutils" -install="" subpackages="$pkgname-dev $pkgname-doc" -source="https://github.com/linuxwacom/libwacom/releases/download/$pkgname-$pkgver/$pkgname-$pkgver.tar.bz2" -builddir="$srcdir"/$pkgname-$pkgver +source="https://github.com/linuxwacom/libwacom/releases/download/libwacom-$pkgver/libwacom-$pkgver.tar.bz2 + fix-parsing-of-matching-strings-when-using-musl.patch + " build() { - cd "$builddir" ./configure --prefix=/usr --disable-static make } check() { - cd "$builddir" make check } package() { - cd "$builddir" make DESTDIR="$pkgdir" install install -dm755 "$pkgdir"/usr/lib/udev/rules.d/ tools/generate-udev-rules > "$pkgdir"/usr/lib/udev/rules.d/65-libwacom.rules } -sha512sums="d7001bb355d4b269e61bf95f0b71621088e76d6894a4a1d002b6a0904a20dd75e0b4fb85368fd20ccafbbfbb1c7ff17150a39962554c8f27f9fcad48c397125b libwacom-0.32.tar.bz2" +sha512sums="de4d9cf3b5f4d87a159ba8ee617bafce9d13b67dc23d9dc67efd57317b0df2079dd0de328bc800de47f14ee49ea82bb842e34297cef23ba336c1ddca3afa826d libwacom-0.33.tar.bz2 +5f3f87e21b94ece374e994f1daafc911baf7efa1dfad9e2ef41d86a9422a0d778525fffde775235aa8f8ea8d12e3d7130caf1981353a990784af9b0c0ddf8aa1 fix-parsing-of-matching-strings-when-using-musl.patch" diff --git a/community/libwacom/fix-parsing-of-matching-strings-when-using-musl.patch b/community/libwacom/fix-parsing-of-matching-strings-when-using-musl.patch new file mode 100644 index 0000000000000000000000000000000000000000..26ce1229c4ed9630a82d0816b363cfb220a133f6 --- /dev/null +++ b/community/libwacom/fix-parsing-of-matching-strings-when-using-musl.patch @@ -0,0 +1,47 @@ +From ef7229064e88dfea3889c7d6cba80c1edc70470b Mon Sep 17 00:00:00 2001 +From: Jason Gerecke <jason.gerecke@wacom.com> +Date: Wed, 17 Jul 2019 10:55:08 -0700 +Subject: [PATCH] Fix parsing of match strings when using musl + +Several tests fail when running on a system with the musl libc library +with the error "Duplicate match of 'usb:256c:006e' on device 'Huion H420'". +The root cause appears to be musl's handling of '%63c' in our format string. +Specifically, unlike glibc which interprets this to mean "read up to 63 +characters", musl interprets it as "read exactly 63 characters". + +This commit tweaks our format string to extract the first three required +fields and probe (with ':%n') to see if more data follows. In such a case +we can directly strdup the remainder of the string. + +Ref: https://github.com/linuxwacom/libwacom/issues/85 +Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> +--- + libwacom/libwacom-database.c | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c +index 61572ec..c34a4f6 100644 +--- a/libwacom/libwacom-database.c ++++ b/libwacom/libwacom-database.c +@@ -147,14 +147,13 @@ make_match_string (const char *name, WacomBusType bus, int vendor_id, int produc + static gboolean + match_from_string(const char *str, WacomBusType *bus, int *vendor_id, int *product_id, char **name) + { +- int rc = 1; +- char busstr[64], namestr[64]; ++ int rc = 1, len = 0; ++ char busstr[64]; + +- memset(namestr, 0, sizeof(namestr)); +- +- rc = sscanf(str, "%63[^:]:%x:%x:%63c", busstr, vendor_id, product_id, namestr); +- if (rc == 4) { +- *name = g_strdup(namestr); ++ rc = sscanf(str, "%63[^:]:%x:%x:%n", busstr, vendor_id, product_id, &len); ++ if (len > 0) { ++ /* Grumble grumble scanf handling of %n */ ++ *name = g_strdup(str+len); + } else if (rc == 3) { + *name = NULL; + } else { +