aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO26
-rw-r--r--.gitignore1
-rw-r--r--LICENSE21
-rw-r--r--PKGBUILD52
-rw-r--r--README.md24
-rw-r--r--mei-bus.patch57
-rw-r--r--surface-tablet-data.patch20
7 files changed, 201 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..0d9b0f4fade1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+pkgbase = libwacom-surface
+ pkgdesc = Patched libwacom for Microsoft Surface devices
+ pkgver = 0.32
+ pkgrel = 1
+ url = https://github.com/geoffholden/libwacom
+ arch = x86_64
+ license = MIT
+ makedepends = git
+ makedepends = libxml2
+ depends = glib2
+ depends = systemd
+ depends = libgudev
+ provides = libwacom=0.32
+ conflicts = libwacom
+ source = mei-bus.patch
+ source = surface-tablet-data.patch
+ source = https://github.com/linuxwacom/libwacom/releases/download/libwacom-0.32/libwacom-0.32.tar.bz2
+ source = https://github.com/linuxwacom/libwacom/releases/download/libwacom-0.32/libwacom-0.32.tar.bz2.sig
+ validpgpkeys = 3C2C43D9447D5938EF4551EBE23B7E70B467F0BF
+ sha256sums = 1e5301bf93bf75352e559b89fbb84aca2d3edb5ec2951dd848546404f9d8fb7f
+ sha256sums = 32f7a27225af200430c2f3d5e497f9ee51bda5a4921647472879d62e890551ad
+ sha256sums = 6b9dab8bce0471b839c89d34a1b30839de2c24db03796fa8d572817830f85380
+ sha256sums = SKIP
+
+pkgname = libwacom-surface
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..9881fec21af4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.tar.*
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000000..1e6edd665f3e
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Maximilian Luz
+
+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.
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..7e9cba493def
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,52 @@
+pkgname=libwacom-surface
+pkgver=0.30
+pkgrel=1
+pkgdesc="Patched libwacom for Microsoft Surface devices"
+arch=('x86_64')
+url="https://github.com/geoffholden/libwacom"
+license=('MIT')
+depends=('glib2' 'systemd' 'libgudev')
+makedepends=('git' 'libxml2')
+validpgpkeys=('3C2C43D9447D5938EF4551EBE23B7E70B467F0BF')
+conflicts=('libwacom')
+provides=("libwacom=${pkgver}")
+
+source=(
+ 'mei-bus.patch'
+ 'surface-tablet-data.patch'
+ "https://github.com/linuxwacom/libwacom/releases/download/libwacom-${pkgver}/libwacom-${pkgver}.tar.bz2"{,.sig}
+)
+sha256sums=(
+ '1e5301bf93bf75352e559b89fbb84aca2d3edb5ec2951dd848546404f9d8fb7f'
+ '32f7a27225af200430c2f3d5e497f9ee51bda5a4921647472879d62e890551ad'
+ '523408680514c0f01052e478503d8e89f86d72ddc7129fdd63988c221c492259'
+ 'SKIP'
+)
+
+prepare() {
+ cd "libwacom-${pkgver}"
+ patch -p0 -i "${srcdir}/mei-bus.patch"
+ patch -Np0 -i "${srcdir}/surface-tablet-data.patch" || true
+ # If the patched source has been cached this will fail to apply, ignore that with `|| true`
+ # XXX: There must be a better option?
+}
+
+build() {
+ cd "libwacom-${pkgver}"
+ ./configure --prefix="/usr"
+ make
+}
+
+check() {
+ cd "libwacom-${pkgver}"
+ make check
+}
+
+package() {
+ cd "libwacom-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+ install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -m755 -d "${pkgdir}/usr/lib/udev/rules.d"
+ cd "tools"
+ ./generate-udev-rules > "${pkgdir}/usr/lib/udev/rules.d/65-libwacom.rules"
+}
diff --git a/README.md b/README.md
new file mode 100644
index 000000000000..ac03902f22ec
--- /dev/null
+++ b/README.md
@@ -0,0 +1,24 @@
+# Patches for `libwacom` to support Microsoft Surface Devices
+
+Patches to support Microsoft Surface Devices with `libwacom` and respective Arch Linux package.
+This package is basically Geoff Holden's [fork][libwacom-geoffholden] of [`libwacom`][libwacom] in patch-form with a `PKGBUILD` for Arch Linux.
+
+## Instructions
+
+### Arch Linux
+
+Simply use the provided `PKGBUILD`, i.e. clone this repository and then, inside this source directory, run
+
+```shell
+makepkg
+sudo pacman -U *.tar.xz
+```
+
+Note: This package replaces the core `libwacom` package.
+
+### Manual installation
+
+Download [`libwacom`][libwacom], apply the patches, and compile.
+
+[libwacom]: https://github.com/linuxwacom/libwacom
+[libwacom-geoffholden]: https://github.com/geoffholden/libwacom
diff --git a/mei-bus.patch b/mei-bus.patch
new file mode 100644
index 000000000000..1dc84e820d9a
--- /dev/null
+++ b/mei-bus.patch
@@ -0,0 +1,57 @@
+diff --git libwacom/libwacom-database.c libwacom/libwacom-database.c
+index 1da9adf..e121c88 100644
+--- libwacom/libwacom-database.c
++++ libwacom/libwacom-database.c
+@@ -112,6 +112,8 @@ bus_from_str (const char *str)
+ return WBUSTYPE_BLUETOOTH;
+ if (strcmp (str, "i2c") == 0)
+ return WBUSTYPE_I2C;
++ if (strcmp (str, "mei") == 0)
++ return WBUSTYPE_MEI;
+ return WBUSTYPE_UNKNOWN;
+ }
+
+@@ -130,6 +132,8 @@ bus_to_str (WacomBusType bus)
+ return "bluetooth";
+ case WBUSTYPE_I2C:
+ return "i2c";
++ case WBUSTYPE_MEI:
++ return "mei";
+ }
+ g_assert_not_reached ();
+ }
+diff --git libwacom/libwacom.c libwacom/libwacom.c
+index b813d5e..884a37b 100644
+--- libwacom/libwacom.c
++++ libwacom/libwacom.c
+@@ -144,6 +144,10 @@ get_bus_vid_pid (GUdevDevice *device,
+ *bus = WBUSTYPE_I2C;
+ retval = TRUE;
+ break;
++ case 68:
++ *bus = WBUSTYPE_MEI;
++ retval = TRUE;
++ break;
+ }
+
+ out:
+@@ -736,6 +740,7 @@ static void print_match(int fd, const WacomMatch *match)
+ case WBUSTYPE_USB: bus_name = "usb"; break;
+ case WBUSTYPE_SERIAL: bus_name = "serial"; break;
+ case WBUSTYPE_I2C: bus_name = "i2c"; break;
++ case WBUSTYPE_MEI: bus_name = "mei"; break;
+ case WBUSTYPE_UNKNOWN: bus_name = "unknown"; break;
+ default: g_assert_not_reached(); break;
+ }
+diff --git libwacom/libwacom.h libwacom/libwacom.h
+index bb968e7..24ab9f3 100644
+--- libwacom/libwacom.h
++++ libwacom/libwacom.h
+@@ -116,6 +116,7 @@ typedef enum {
+ WBUSTYPE_SERIAL, /**< Serial tablet */
+ WBUSTYPE_BLUETOOTH, /**< Bluetooth tablet */
+ WBUSTYPE_I2C, /**< I2C tablet */
++ WBUSTYPE_MEI, /**< MEI */
+ } WacomBusType;
+
+ /**
diff --git a/surface-tablet-data.patch b/surface-tablet-data.patch
new file mode 100644
index 000000000000..423fc9f1289f
--- /dev/null
+++ b/surface-tablet-data.patch
@@ -0,0 +1,20 @@
+diff --git data/surface.tablet data/surface.tablet
+new file mode 100644
+index 0000000..401fd62
+--- /dev/null
++++ data/surface.tablet
+@@ -0,0 +1,14 @@
++# Microsoft Surface Pro/Surface Book
++
++[Device]
++Name=Microsoft Surface Pro/Book
++DeviceMatch=mei:1b96:006a;mei:1b96:001F;mei:1b96:005e;mei:1b96:0020
++Class=ISDV4
++Width=10
++Height=6
++IntegratedIn=Display;System
++
++[Features]
++Stylus=true
++Touch=true
++Buttons=0