commit ba0663e2ac7e66c7a4f62a8cc8b1f1fd22b98b73 Author: Ronald Farrer Date: Tue Jul 27 12:35:19 2021 -0700 First commit. diff --git a/README.md b/README.md new file mode 100644 index 0000000..3a8c34a --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +Gentoo Linux Overlay with Linux Surface kernel and other utilities from linux-surface repo. + +# Information +- *gentoo-surface-sources* gentoo-sources with surface patchsets applied +- *iptsd* utility is needed for touchscreen support. Enable the user and system services after you install. +- *libwacom-surface* improves touchscreen support. +- *surface-control* commandline utility to control certain aspects of your surface device. + +This repo was initally forked from one by Parinthapat Parinz: https://github.com/Parinz/linux-surface-overlay + diff --git a/app-misc/surface-control/surface-control-9999.ebuild b/app-misc/surface-control/surface-control-9999.ebuild new file mode 100644 index 0000000..64e014f --- /dev/null +++ b/app-misc/surface-control/surface-control-9999.ebuild @@ -0,0 +1,29 @@ +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cargo git-r3 + +DESCRIPTION="Commandline utility to control certain aspects of your surface device." +HOMEPAGE="https://github.com/linux-surface/linux-surface" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +DEPEND="" +RDEPEND="${DEPEND}" +BDEPEND="" + +EGIT_REPO_URI="https://github.com/linux-surface/surface-control" +S="${WORKDIR}/surface-control-9999" + +src_unpack() { + git-r3_src_unpack + cargo_live_src_unpack +} + +src_compile() { + cargo_src_compile --locked +} diff --git a/dev-libs/libwacom-surface/files/1.9/01.patch b/dev-libs/libwacom-surface/files/1.9/01.patch new file mode 100644 index 0000000..562b2f5 --- /dev/null +++ b/dev-libs/libwacom-surface/files/1.9/01.patch @@ -0,0 +1,105 @@ +From c0eaf576f68b2a34136a7c1c3977ff8531d37504 Mon Sep 17 00:00:00 2001 +From: Dorian Stoll +Date: Sat, 27 Jun 2020 18:21:11 +0200 +Subject: [PATCH 01/11] Add support for BUS_VIRTUAL + +This is needed to support IPTS devices through the iptsd userspace +daemon. It exposes the touchscreen / stylus as uinput, since the parsing +of raw IPTS data needs to happen in userspace. + +Because these devices are not backed by an actual bus, they are created +as BUS_VIRTUAL. + +Signed-off-by: Dorian Stoll +--- + data/test_data_files.py | 2 +- + libwacom/libwacom-database.c | 4 ++++ + libwacom/libwacom.c | 5 +++++ + libwacom/libwacom.h | 1 + + test/test-tablet-validity.c | 1 + + 5 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/data/test_data_files.py b/data/test_data_files.py +index 5acdbac..cb5ca6d 100755 +--- a/data/test_data_files.py ++++ b/data/test_data_files.py +@@ -29,6 +29,6 @@ def test_device_match(tabletfile): + continue + + bus, vid, pid = match.split(':')[:3] # skip the name part of the match +- assert bus in ['usb', 'bluetooth', 'i2c', 'serial'], f'{tabletfile}: unknown bus type' ++ assert bus in ['usb', 'bluetooth', 'i2c', 'serial', 'virt'], f'{tabletfile}: unknown bus type' + assert re.match('[0-9a-f]{4}', vid), f'{tabletfile}: {vid} must be lowercase hex' + assert re.match('[0-9a-f]{4}', pid), f'{tabletfile}: {pid} must be lowercase hex' +diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c +index d57ef2d..17571b6 100644 +--- a/libwacom/libwacom-database.c ++++ b/libwacom/libwacom-database.c +@@ -130,6 +130,8 @@ bus_from_str (const char *str) + return WBUSTYPE_BLUETOOTH; + if (streq(str, "i2c")) + return WBUSTYPE_I2C; ++ if (streq(str, "virt")) ++ return WBUSTYPE_VIRTUAL; + return WBUSTYPE_UNKNOWN; + } + +@@ -148,6 +150,8 @@ bus_to_str (WacomBusType bus) + return "bluetooth"; + case WBUSTYPE_I2C: + return "i2c"; ++ case WBUSTYPE_VIRTUAL: ++ return "virt"; + } + g_assert_not_reached (); + } +diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c +index 062b313..7b97bb1 100644 +--- a/libwacom/libwacom.c ++++ b/libwacom/libwacom.c +@@ -147,6 +147,10 @@ get_bus_vid_pid (GUdevDevice *device, + *bus = WBUSTYPE_I2C; + retval = TRUE; + break; ++ case 6: ++ *bus = WBUSTYPE_VIRTUAL; ++ retval = TRUE; ++ break; + } + + out: +@@ -765,6 +769,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_VIRTUAL: bus_name = "virt"; break; + case WBUSTYPE_UNKNOWN: bus_name = "unknown"; break; + default: g_assert_not_reached(); break; + } +diff --git a/libwacom/libwacom.h b/libwacom/libwacom.h +index 1b9bc2c..24e99cd 100644 +--- a/libwacom/libwacom.h ++++ b/libwacom/libwacom.h +@@ -117,6 +117,7 @@ typedef enum { + WBUSTYPE_SERIAL, /**< Serial tablet */ + WBUSTYPE_BLUETOOTH, /**< Bluetooth tablet */ + WBUSTYPE_I2C, /**< I2C tablet */ ++ WBUSTYPE_VIRTUAL, /**< Virtual (uinput) tablet */ + } WacomBusType; + + /** +diff --git a/test/test-tablet-validity.c b/test/test-tablet-validity.c +index 9e5b02f..3883341 100644 +--- a/test/test-tablet-validity.c ++++ b/test/test-tablet-validity.c +@@ -179,6 +179,7 @@ assert_vidpid(WacomBusType bus, int vid, int pid) + break; + case WBUSTYPE_BLUETOOTH: + case WBUSTYPE_I2C: ++ case WBUSTYPE_VIRTUAL: + g_assert_cmpint(vid, >, 0); + g_assert_cmpint(pid, >, 0); + break; +-- +2.30.1 + diff --git a/dev-libs/libwacom-surface/files/1.9/02.patch b/dev-libs/libwacom-surface/files/1.9/02.patch new file mode 100644 index 0000000..7868073 --- /dev/null +++ b/dev-libs/libwacom-surface/files/1.9/02.patch @@ -0,0 +1,100 @@ +From 02df4e0f272dff001ee280ab93e8e1c4600375ff Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Sat, 1 Jun 2019 21:17:15 +0200 +Subject: [PATCH 02/11] Add support for Intel Management Engine bus + +Add support for devices connected via the Intel Management Engine (MEI). +This is required to support IPTS based devices, such as (among others) +the Microsoft Surface Books, Surface Pro 5 and 6, and Surface Laptops. +--- + data/test_data_files.py | 2 +- + libwacom/libwacom-database.c | 4 ++++ + libwacom/libwacom.c | 5 +++++ + libwacom/libwacom.h | 1 + + test/test-tablet-validity.c | 1 + + 5 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/data/test_data_files.py b/data/test_data_files.py +index cb5ca6d..466b18a 100755 +--- a/data/test_data_files.py ++++ b/data/test_data_files.py +@@ -29,6 +29,6 @@ def test_device_match(tabletfile): + continue + + bus, vid, pid = match.split(':')[:3] # skip the name part of the match +- assert bus in ['usb', 'bluetooth', 'i2c', 'serial', 'virt'], f'{tabletfile}: unknown bus type' ++ assert bus in ['usb', 'bluetooth', 'i2c', 'serial', 'virt', 'mei'], f'{tabletfile}: unknown bus type' + assert re.match('[0-9a-f]{4}', vid), f'{tabletfile}: {vid} must be lowercase hex' + assert re.match('[0-9a-f]{4}', pid), f'{tabletfile}: {pid} must be lowercase hex' +diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c +index 17571b6..4c6df4e 100644 +--- a/libwacom/libwacom-database.c ++++ b/libwacom/libwacom-database.c +@@ -132,6 +132,8 @@ bus_from_str (const char *str) + return WBUSTYPE_I2C; + if (streq(str, "virt")) + return WBUSTYPE_VIRTUAL; ++ if (strcmp (str, "mei") == 0) ++ return WBUSTYPE_MEI; + return WBUSTYPE_UNKNOWN; + } + +@@ -152,6 +154,8 @@ bus_to_str (WacomBusType bus) + return "i2c"; + case WBUSTYPE_VIRTUAL: + return "virt"; ++ case WBUSTYPE_MEI: ++ return "mei"; + } + g_assert_not_reached (); + } +diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c +index 7b97bb1..d84e8fa 100644 +--- a/libwacom/libwacom.c ++++ b/libwacom/libwacom.c +@@ -151,6 +151,10 @@ get_bus_vid_pid (GUdevDevice *device, + *bus = WBUSTYPE_VIRTUAL; + retval = TRUE; + break; ++ case 68: ++ *bus = WBUSTYPE_MEI; ++ retval = TRUE; ++ break; + } + + out: +@@ -770,6 +774,7 @@ static void print_match(int fd, const WacomMatch *match) + case WBUSTYPE_SERIAL: bus_name = "serial"; break; + case WBUSTYPE_I2C: bus_name = "i2c"; break; + case WBUSTYPE_VIRTUAL: bus_name = "virt"; break; ++ case WBUSTYPE_MEI: bus_name = "mei"; break; + case WBUSTYPE_UNKNOWN: bus_name = "unknown"; break; + default: g_assert_not_reached(); break; + } +diff --git a/libwacom/libwacom.h b/libwacom/libwacom.h +index 24e99cd..0eee2fd 100644 +--- a/libwacom/libwacom.h ++++ b/libwacom/libwacom.h +@@ -118,6 +118,7 @@ typedef enum { + WBUSTYPE_BLUETOOTH, /**< Bluetooth tablet */ + WBUSTYPE_I2C, /**< I2C tablet */ + WBUSTYPE_VIRTUAL, /**< Virtual (uinput) tablet */ ++ WBUSTYPE_MEI, /**< MEI */ + } WacomBusType; + + /** +diff --git a/test/test-tablet-validity.c b/test/test-tablet-validity.c +index 3883341..352bc43 100644 +--- a/test/test-tablet-validity.c ++++ b/test/test-tablet-validity.c +@@ -180,6 +180,7 @@ assert_vidpid(WacomBusType bus, int vid, int pid) + case WBUSTYPE_BLUETOOTH: + case WBUSTYPE_I2C: + case WBUSTYPE_VIRTUAL: ++ case WBUSTYPE_MEI: + g_assert_cmpint(vid, >, 0); + g_assert_cmpint(pid, >, 0); + break; +-- +2.30.1 + diff --git a/dev-libs/libwacom-surface/files/1.9/03.patch b/dev-libs/libwacom-surface/files/1.9/03.patch new file mode 100644 index 0000000..2fe0ed9 --- /dev/null +++ b/dev-libs/libwacom-surface/files/1.9/03.patch @@ -0,0 +1,33 @@ +From 29c9b7283741e717b61f07bdf14b678c13a6768d Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Tue, 18 Aug 2020 20:18:55 +0200 +Subject: [PATCH 03/11] data: Add Microsoft Surface pro 4 + +--- + data/surface-pro4.tablet | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + create mode 100644 data/surface-pro4.tablet + +diff --git a/data/surface-pro4.tablet b/data/surface-pro4.tablet +new file mode 100644 +index 0000000..1e0c67c +--- /dev/null ++++ b/data/surface-pro4.tablet +@@ -0,0 +1,14 @@ ++# This is for the Microsoft Surface Pro 4 ++ ++[Device] ++Name=Microsoft Surface Pro 4 ++Class=PenDisplay ++DeviceMatch=virt:1b96:006a;virt:1b96:0021;mei:1b96:006a;mei:1b96:0021 ++Width=10 ++Height=6 ++IntegratedIn=Display;System; ++ ++[Features] ++Stylus=true ++Touch=true ++Buttons=0 +-- +2.30.1 + diff --git a/dev-libs/libwacom-surface/files/1.9/04.patch b/dev-libs/libwacom-surface/files/1.9/04.patch new file mode 100644 index 0000000..ad295a5 --- /dev/null +++ b/dev-libs/libwacom-surface/files/1.9/04.patch @@ -0,0 +1,33 @@ +From ccfc97812543a3db11a2c3dcd0ed25903730dfe3 Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Tue, 18 Aug 2020 20:19:02 +0200 +Subject: [PATCH 04/11] data: Add Microsoft Surface pro 5 + +--- + data/surface-pro5.tablet | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + create mode 100644 data/surface-pro5.tablet + +diff --git a/data/surface-pro5.tablet b/data/surface-pro5.tablet +new file mode 100644 +index 0000000..b26af3a +--- /dev/null ++++ b/data/surface-pro5.tablet +@@ -0,0 +1,14 @@ ++# This is for the Microsoft Surface Pro 5 (2017) ++ ++[Device] ++Name=Microsoft Surface Pro 5 ++Class=PenDisplay ++DeviceMatch=virt:1b96:001f;mei:1b96:001f ++Width=10 ++Height=6 ++IntegratedIn=Display;System; ++ ++[Features] ++Stylus=true ++Touch=true ++Buttons=0 +-- +2.30.1 + diff --git a/dev-libs/libwacom-surface/files/1.9/05.patch b/dev-libs/libwacom-surface/files/1.9/05.patch new file mode 100644 index 0000000..45f4e4a --- /dev/null +++ b/dev-libs/libwacom-surface/files/1.9/05.patch @@ -0,0 +1,32 @@ +From df44bc318ba3be62d71a02f7ae5f7945e1bc84d1 Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Tue, 18 Aug 2020 20:19:07 +0200 +Subject: [PATCH 05/11] data: Add Microsoft Surface pro 6 + +--- + data/surface-pro6.tablet | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + create mode 100644 data/surface-pro6.tablet + +diff --git a/data/surface-pro6.tablet b/data/surface-pro6.tablet +new file mode 100644 +index 0000000..e97fad8 +--- /dev/null ++++ b/data/surface-pro6.tablet +@@ -0,0 +1,14 @@ ++# This is for the Microsoft Surface Pro 6 ++ ++[Device] ++Name=Microsoft Surface Pro 6 ++Class=PenDisplay ++DeviceMatch=virt:045e:001f;mei:045e:001f ++Width=10 ++Height=6 ++IntegratedIn=Display;System; ++ ++[Features] ++Stylus=true ++Touch=true ++Buttons=0 +-- +2.31.1 diff --git a/dev-libs/libwacom-surface/files/1.9/06.patch b/dev-libs/libwacom-surface/files/1.9/06.patch new file mode 100644 index 0000000..23f744e --- /dev/null +++ b/dev-libs/libwacom-surface/files/1.9/06.patch @@ -0,0 +1,33 @@ +From 0b12a623e70d877fa6bf1df615d06229f7b2eb83 Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Tue, 18 Aug 2020 20:19:13 +0200 +Subject: [PATCH 06/11] data: Add Microsoft Surface pro 7 + +--- + data/surface-pro7.tablet | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + create mode 100644 data/surface-pro7.tablet + +diff --git a/data/surface-pro7.tablet b/data/surface-pro7.tablet +new file mode 100644 +index 0000000..7961379 +--- /dev/null ++++ b/data/surface-pro7.tablet +@@ -0,0 +1,14 @@ ++# This is for the Microsoft Surface Pro 7 ++ ++[Device] ++Name=Microsoft Surface Pro 7 ++Class=PenDisplay ++DeviceMatch=virt:045e:099f;mei:045e:099f ++Width=10 ++Height=6 ++IntegratedIn=Display;System; ++ ++[Features] ++Stylus=false ++Touch=true ++Buttons=0 +-- +2.30.1 + diff --git a/dev-libs/libwacom-surface/files/1.9/07.patch b/dev-libs/libwacom-surface/files/1.9/07.patch new file mode 100644 index 0000000..cd594b9 --- /dev/null +++ b/dev-libs/libwacom-surface/files/1.9/07.patch @@ -0,0 +1,33 @@ +From da5c0255ab397bc5537861f9b48d3036f2fc8e98 Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Tue, 18 Aug 2020 20:19:38 +0200 +Subject: [PATCH 07/11] data: Add Microsoft Surface Book + +--- + data/surface-book.tablet | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + create mode 100644 data/surface-book.tablet + +diff --git a/data/surface-book.tablet b/data/surface-book.tablet +new file mode 100644 +index 0000000..e2a5401 +--- /dev/null ++++ b/data/surface-book.tablet +@@ -0,0 +1,14 @@ ++# This is for the Microsoft Surface Book (1) ++ ++[Device] ++Name=Microsoft Surface Book ++Class=PenDisplay ++DeviceMatch=virt:1b96:005e;mei:1b96:005e ++Width=11 ++Height=7 ++IntegratedIn=Display;System; ++ ++[Features] ++Stylus=true ++Touch=true ++Buttons=0 +-- +2.30.1 + diff --git a/dev-libs/libwacom-surface/files/1.9/08.patch b/dev-libs/libwacom-surface/files/1.9/08.patch new file mode 100644 index 0000000..2da32dd --- /dev/null +++ b/dev-libs/libwacom-surface/files/1.9/08.patch @@ -0,0 +1,33 @@ +From 3779329faa2e5e4d974ef2ad92dee3e0a8c90888 Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Tue, 18 Aug 2020 20:20:04 +0200 +Subject: [PATCH 08/11] data: Add Microsoft Surface Book 2 (13.5") + +--- + data/surface-book2-13.tablet | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + create mode 100644 data/surface-book2-13.tablet + +diff --git a/data/surface-book2-13.tablet b/data/surface-book2-13.tablet +new file mode 100644 +index 0000000..b13cb07 +--- /dev/null ++++ b/data/surface-book2-13.tablet +@@ -0,0 +1,14 @@ ++# This is for the Microsoft Surface Book 2 13.5-inch model ++ ++[Device] ++Name=Microsoft Surface Book 2 (13.5") ++Class=PenDisplay ++DeviceMatch=virt:045e:0021;mei:045e:0021 ++Width=11 ++Height=7 ++IntegratedIn=Display;System; ++ ++[Features] ++Stylus=true ++Touch=true ++Buttons=0 +-- +2.30.1 + diff --git a/dev-libs/libwacom-surface/files/1.9/09.patch b/dev-libs/libwacom-surface/files/1.9/09.patch new file mode 100644 index 0000000..676ac52 --- /dev/null +++ b/dev-libs/libwacom-surface/files/1.9/09.patch @@ -0,0 +1,33 @@ +From 13e81b74340251dba524b6f414e3452e93458929 Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Tue, 18 Aug 2020 20:20:13 +0200 +Subject: [PATCH 09/11] data: Add Microsoft Surface Book 2 (15") + +--- + data/surface-book2-15.tablet | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + create mode 100644 data/surface-book2-15.tablet + +diff --git a/data/surface-book2-15.tablet b/data/surface-book2-15.tablet +new file mode 100644 +index 0000000..ad98cc7 +--- /dev/null ++++ b/data/surface-book2-15.tablet +@@ -0,0 +1,14 @@ ++# This is for the Microsoft Surface Book 2 15-inch model ++ ++[Device] ++Name=Microsoft Surface Book 2 (15") ++Class=PenDisplay ++DeviceMatch=virt:045e:0020;mei:045e:0020 ++Width=12 ++Height=8 ++IntegratedIn=Display;System; ++ ++[Features] ++Stylus=true ++Touch=true ++Buttons=0 +-- +2.30.1 + diff --git a/dev-libs/libwacom-surface/files/1.9/10.patch b/dev-libs/libwacom-surface/files/1.9/10.patch new file mode 100644 index 0000000..3013c7c --- /dev/null +++ b/dev-libs/libwacom-surface/files/1.9/10.patch @@ -0,0 +1,33 @@ +From 84f8519285c39cf3b35175f94a38cd48b3a7d922 Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Tue, 18 Aug 2020 20:20:29 +0200 +Subject: [PATCH 10/11] data: Add Microsoft Surface Book 3 (13.5") + +--- + data/surface-book3-13.tablet | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + create mode 100644 data/surface-book3-13.tablet + +diff --git a/data/surface-book3-13.tablet b/data/surface-book3-13.tablet +new file mode 100644 +index 0000000..a33c9cb +--- /dev/null ++++ b/data/surface-book3-13.tablet +@@ -0,0 +1,14 @@ ++# This is for the Microsoft Surface Book 3 13.5-inch model ++ ++[Device] ++Name=Microsoft Surface Book 3 (13.5") ++Class=PenDisplay ++DeviceMatch=virt:045e:09b2;mei:045e:09b2 ++Width=11 ++Height=7 ++IntegratedIn=Display;System; ++ ++[Features] ++Stylus=false ++Touch=true ++Buttons=0 +-- +2.30.1 + diff --git a/dev-libs/libwacom-surface/files/1.9/11.patch b/dev-libs/libwacom-surface/files/1.9/11.patch new file mode 100644 index 0000000..41e2537 --- /dev/null +++ b/dev-libs/libwacom-surface/files/1.9/11.patch @@ -0,0 +1,33 @@ +From d105e4c6fd7512eefa4c703224a24cea19e0f457 Mon Sep 17 00:00:00 2001 +From: Maximilian Luz +Date: Tue, 18 Aug 2020 20:20:42 +0200 +Subject: [PATCH 11/11] data: Add Microsoft Surface Book 3 (15") + +--- + data/surface-book3-15.tablet | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + create mode 100644 data/surface-book3-15.tablet + +diff --git a/data/surface-book3-15.tablet b/data/surface-book3-15.tablet +new file mode 100644 +index 0000000..291321f +--- /dev/null ++++ b/data/surface-book3-15.tablet +@@ -0,0 +1,14 @@ ++# This is for the Microsoft Surface Book 3 15-inch model ++ ++[Device] ++Name=Microsoft Surface Book 3 (15") ++Class=PenDisplay ++DeviceMatch=virt:045e:09b1;mei:045e:09b1 ++Width=12 ++Height=8 ++IntegratedIn=Display;System; ++ ++[Features] ++Stylus=false ++Touch=true ++Buttons=0 +-- +2.30.1 + diff --git a/dev-libs/libwacom-surface/libwacom-surface-1.9.ebuild b/dev-libs/libwacom-surface/libwacom-surface-1.9.ebuild new file mode 100644 index 0000000..c70ea3f --- /dev/null +++ b/dev-libs/libwacom-surface/libwacom-surface-1.9.ebuild @@ -0,0 +1,80 @@ +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7..9} ) + +inherit eutils meson python-any-r1 toolchain-funcs udev + +DESCRIPTION="Library for identifying Wacom tablets and their model-specific features with patches from linux-surface" +HOMEPAGE="https://github.com/linux-surface/linux-surface" +SRC_URI="https://github.com/linuxwacom/libwacom/releases/download/libwacom-${PV}/libwacom-${PV}.tar.bz2" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc test" +RESTRICT="!test? ( test )" + +BDEPEND=" + virtual/pkgconfig + doc? ( app-doc/doxygen ) + test? ( + ${PYTHON_DEPS} + $(python_gen_any_dep ' + dev-python/python-libevdev[${PYTHON_USEDEP}] + dev-python/pyudev[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + ') + ) +" +RDEPEND=" + dev-libs/glib:2 + dev-libs/libgudev:= + !!dev-libs/libwacom +" +DEPEND="${RDEPEND}" + + +python_check_deps() { + has_version -b "dev-python/python-libevdev[${PYTHON_USEDEP}]" && + has_version -b "dev-python/pyudev[${PYTHON_USEDEP}]" && + has_version -b "dev-python/pytest[${PYTHON_USEDEP}]" +} + +pkg_setup() { + tc-ld-disable-gold # bug https://github.com/linuxwacom/libwacom/issues/170 + + if use test; then + python-any-r1_pkg_setup + fi +} + +S="${WORKDIR}/libwacom-${PV}" + +src_prepare() { + eapply "${FILESDIR}/1.9/01.patch" + eapply "${FILESDIR}/1.9/02.patch" + eapply "${FILESDIR}/1.9/03.patch" + eapply "${FILESDIR}/1.9/04.patch" + eapply "${FILESDIR}/1.9/05.patch" + eapply "${FILESDIR}/1.9/06.patch" + eapply "${FILESDIR}/1.9/07.patch" + eapply "${FILESDIR}/1.9/08.patch" + eapply "${FILESDIR}/1.9/09.patch" + eapply "${FILESDIR}/1.9/10.patch" + eapply "${FILESDIR}/1.9/11.patch" + + eapply_user +} + +src_configure() { + local emesonargs=( + $(meson_feature doc documentation) + $(meson_feature test tests) + -Dudev-dir=$(get_udevdir) + + ) + meson_src_configure +} diff --git a/metadata/layout.conf b/metadata/layout.conf new file mode 100644 index 0000000..8ee2400 --- /dev/null +++ b/metadata/layout.conf @@ -0,0 +1,4 @@ +masters = gentoo +thin-manifests = true +sign-manifests = false +use-manifests = false diff --git a/profiles/categories b/profiles/categories new file mode 100644 index 0000000..e28bbe5 --- /dev/null +++ b/profiles/categories @@ -0,0 +1,2 @@ +sys-kernel +sys-firmware diff --git a/profiles/repo_name b/profiles/repo_name new file mode 100644 index 0000000..0d4cdf6 --- /dev/null +++ b/profiles/repo_name @@ -0,0 +1 @@ +gentoo-linux-surface diff --git a/repositories.xml b/repositories.xml new file mode 100644 index 0000000..ad259a4 --- /dev/null +++ b/repositories.xml @@ -0,0 +1,14 @@ + + + + gentoo-linux-surface + Gentoo ebuilds to assist installation and running of Gentoo Linux on Microsoft Surface device. + https://github.com/CanuteTheGreat/gentoo-linux-surface-overlay + + Ronald Farrer + canutethegreat@gmail.com + + git://github.com/CanuteTheGreat/gentoo-linux-surface-overlay.git + https://github.com/CanuteTheGreat/gentoo-linux-surface-overlay/commits/master.atom + + diff --git a/sys-firmware/iptsd/files/meson.patch b/sys-firmware/iptsd/files/meson.patch new file mode 100644 index 0000000..d112cdf --- /dev/null +++ b/sys-firmware/iptsd/files/meson.patch @@ -0,0 +1,37 @@ +diff -Naur iptsd-master/meson.build edited_iptsd/meson.build +--- iptsd-master/meson.build 2021-04-24 20:12:52.070042255 +0700 ++++ edited_iptsd/meson.build 2021-04-24 20:08:27.490024110 +0700 +@@ -101,8 +101,7 @@ + configuration: conf + ) + +-service_manager = get_option('service_manager') +-if service_manager.contains('systemd') ++if get_option('systemd') + systemd = dependency('systemd') + unitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir') + +@@ -116,9 +115,7 @@ + ) + + install_data('etc/udev/50-ipts.rules', install_dir: rulesdir) +-endif +- +-if service_manager.contains('openrc') ++else + dependency('openrc') + openrcdir = join_paths(sysconfdir, 'init.d') + +diff -Naur iptsd-master/meson_options.txt edited_iptsd/meson_options.txt +--- iptsd-master/meson_options.txt 2021-04-24 20:11:30.566703332 +0700 ++++ edited_iptsd/meson_options.txt 2021-04-24 20:08:45.850025371 +0700 +@@ -1,8 +1,3 @@ +-option( +- 'service_manager', +- type: 'array', +- choices: ['systemd', 'openrc'], +- value: ['systemd'] +-) ++option('systemd', type: 'boolean', value: false) + option('sample_config', type: 'boolean', value: true) + option('debug_tool', type: 'boolean', value: true) diff --git a/sys-firmware/iptsd/iptsd-0.4.ebuild b/sys-firmware/iptsd/iptsd-0.4.ebuild new file mode 100644 index 0000000..4f7f877 --- /dev/null +++ b/sys-firmware/iptsd/iptsd-0.4.ebuild @@ -0,0 +1,49 @@ +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit meson +inherit eutils +inherit ninja-utils + +DESCRIPTION="Userspace daemon for Intel Precise Touch & Stylus" +HOMEPAGE="https://github.com/linux-surface/iptsd" +SRC_URI="https://github.com/linux-surface/iptsd/archive/refs/heads/master.zip" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="systemd" + +DEPEND="dev-libs/inih" +RDEPEND="${DEPEND}" +BDEPEND="dev-util/ninja sys-devel/gcc dev-util/meson" + +src_unpack() { + unpack ${DISTDIR}/master.zip +} + +S="${WORKDIR}/${PN}-master" + +src_prepare() { + eapply "${FILESDIR}/meson.patch" + eapply_user +} + +src_configure() { + local emesonargs=( + $(meson_use systemd) + ) + meson_src_configure +} + +src_compile() { + meson_src_compile + eninja -C ${WORKDIR}/${P}-build +} + +src_install() { + DESTDIR="${D}" eninja -C ${WORKDIR}/${P}-build install + #ninja -C ${WORKDIR}/${P}-build install +} diff --git a/sys-kernel/gentoo-surface-sources/gentoo-surface-sources-5.10.52.ebuild b/sys-kernel/gentoo-surface-sources/gentoo-surface-sources-5.10.52.ebuild new file mode 100644 index 0000000..478fcf0 --- /dev/null +++ b/sys-kernel/gentoo-surface-sources/gentoo-surface-sources-5.10.52.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" +ETYPE="sources" +K_SECURITY_UNSUPPORTED="1" +K_WANT_GENPATCHES="base extras experimental" +K_GENPATCHES_VER="10" + +inherit kernel-2 +inherit eutils +detect_version +detect_arch + +KEYWORDS="~amd64" +HOMEPAGE="https://github.com/linux-surface/linux-surface" +IUSE="experimental" +DESCRIPTION="Full sources including the Gentoo and Surface patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree." +SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} + https://raw.githubusercontent.com/linux-surface/linux-surface/master/patches/5.10/0001-surface3-oemb.patch + https://raw.githubusercontent.com/linux-surface/linux-surface/master/patches/5.10/0002-mwifiex.patch + https://raw.githubusercontent.com/linux-surface/linux-surface/master/patches/5.10/0003-ath10k.patch + https://raw.githubusercontent.com/linux-surface/linux-surface/master/patches/5.10/0004-ipts.patch + https://raw.githubusercontent.com/linux-surface/linux-surface/master/patches/5.10/0005-surface-sam-over-hid.patch + https://raw.githubusercontent.com/linux-surface/linux-surface/master/patches/5.10/0006-surface-sam.patch + https://raw.githubusercontent.com/linux-surface/linux-surface/master/patches/5.10/0007-surface-typecover.patch + https://raw.githubusercontent.com/linux-surface/linux-surface/master/patches/5.10/0008-surface-go-touchscreen.patch + https://raw.githubusercontent.com/linux-surface/linux-surface/master/patches/5.10/0009-cameras.patch -> 5.12-cameras.patch" + + +src_prepare() { + eapply "${DISTDIR}/0001-surface3-oemb.patch" + eapply "${DISTDIR}/0002-mwifiex.patch" + eapply "${DISTDIR}/0003-ath10k.patch" + eapply "${DISTDIR}/0004-ipts.patch" + eapply "${DISTDIR}/0005-surface-sam-over-hid.patch" + eapply "${DISTDIR}/0006-surface-sam.patch" + eapply "${DISTDIR}/0007-surface-typecover.patch" + eapply "${DISTDIR}/0008-surface-go-touchscreen.patch" + eapply "${DISTDIR}/0009-cameras.patch" + eapply_user +} + +pkg_setup() { + ewarn "" + ewarn "${PN} is *not* supported by the Gentoo Kernel Project in any way." + ewarn "If you need support, please contact the overlay developers directly." + ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with" + ewarn "the ebuilds. Thank you." + ewarn "" +} + +pkg_postinst() { + kernel-2_pkg_postinst + einfo "For more info on this patchset, and how to report problems, see:" + einfo "${HOMEPAGE}" +} + +pkg_postrm() { + kernel-2_pkg_postrm +}