summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoeLava2020-12-22 00:06:34 +0700
committerMoeLava2020-12-23 13:29:14 +0700
commit50ee5dba0605d7f422d445cecdd38f4a28cc615d (patch)
treee06ad1a31315425b258b2c6c2e41fb4ec8750b49
parentf2193622427b6e28a52339424d0d3a7bb194c24f (diff)
downloadaur-50ee5dba0605d7f422d445cecdd38f4a28cc615d.tar.gz
Packaging overhaul
- systemd service now has a grace period when restarting too many times - Daemon can be started without systemd by running "otd" - Add instructions and common error fixes to the install file
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD22
-rw-r--r--notes.install58
-rw-r--r--opentabletdriver.service10
-rwxr-xr-xotd19
-rwxr-xr-xotd-gui11
-rw-r--r--reload-systemd.install3
7 files changed, 96 insertions, 41 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e9af3383d35..0c2650c2463 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
pkgbase = opentabletdriver-git
pkgdesc = A cross-platform open source tablet driver
- pkgver = v0.4.1.r37.g5d4feb2
+ pkgver = v0.4.2.r282.g4372321
pkgrel = 2
url = https://github.com/InfinityGhost/OpenTabletDriver
- install = reload-systemd.install
+ install = notes.install
arch = x86_64
license = GPL
makedepends = git
@@ -22,14 +22,14 @@ pkgbase = opentabletdriver-git
source = otd-gui
source = opentabletdriver.service
source = OpenTabletDriver.desktop
- source = reload-systemd.install
+ source = notes.install
sha256sums = SKIP
sha256sums = SKIP
- sha256sums = 3b4e49ee69a632538869f0e21446da16d21aa5075241c5c35545cecb485134d8
- sha256sums = 0407c3d546a382a8715318a785e11140c11a94f44edef3f730cb0f27ed7cff62
- sha256sums = f115b727640f78a8d641fab5554305b6e064d73dc4c3f869db85bcaf412f98f1
+ sha256sums = f0f36182cbd8345b3a693fa8e4bff47d9e3d984ff7b1bfeeb9165d4b886d2180
+ sha256sums = 20aac1584a8e08b5a9add1d02ce38e60ddfede615227df6f25c7422217df82b0
+ sha256sums = 58db10ddb47008521e1d55e3758f7b30b78b7365d4fe3d14cbe339be2704301c
sha256sums = 4399359bf6107b612d10aaa06abb197db540b00a973cfec64c2b40d1fbbb2834
- sha256sums = 1570586c391e9d0d923cc7e6af01f92a9a95e04fd510cf5c33080a55656f2ad6
+ sha256sums = 63be4effd52af93cafc1b8cfd9ec0becd08bfcc6a6cb333d9e6e3072beb88e13
pkgname = opentabletdriver-git
diff --git a/PKGBUILD b/PKGBUILD
index a50fb6292ae..66b5e4c33e1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@ pkgname=opentabletdriver-git
_pkgname=OpenTabletDriver
_lpkgname=opentabletdriver
_spkgname=otd
-pkgver=v0.4.1.r37.g5d4feb2
+pkgver=v0.4.2.r282.g4372321
pkgrel=2
pkgdesc="A cross-platform open source tablet driver"
arch=('x86_64')
@@ -15,22 +15,22 @@ optdepends=('libxrandr: x11 display querying support' 'libx11')
makedepends=('git' 'dotnet-sdk-5.0')
provides=("opentabletdriver")
conflicts=("opentabletdriver")
-install="reload-systemd.install"
+install="notes.install"
source=('git+https://github.com/InfinityGhost/OpenTabletDriver'
'git+https://github.com/InfinityGhost/OpenTabletDriver-udev'
"$_spkgname"
"$_spkgname-gui"
"$_lpkgname.service"
"$_pkgname.desktop"
- "reload-systemd.install")
+ "notes.install")
sha256sums=('SKIP'
'SKIP'
- '3b4e49ee69a632538869f0e21446da16d21aa5075241c5c35545cecb485134d8'
- '0407c3d546a382a8715318a785e11140c11a94f44edef3f730cb0f27ed7cff62'
- 'f115b727640f78a8d641fab5554305b6e064d73dc4c3f869db85bcaf412f98f1'
+ 'f0f36182cbd8345b3a693fa8e4bff47d9e3d984ff7b1bfeeb9165d4b886d2180'
+ '20aac1584a8e08b5a9add1d02ce38e60ddfede615227df6f25c7422217df82b0'
+ '58db10ddb47008521e1d55e3758f7b30b78b7365d4fe3d14cbe339be2704301c'
'4399359bf6107b612d10aaa06abb197db540b00a973cfec64c2b40d1fbbb2834'
- '1570586c391e9d0d923cc7e6af01f92a9a95e04fd510cf5c33080a55656f2ad6')
+ '63be4effd52af93cafc1b8cfd9ec0becd08bfcc6a6cb333d9e6e3072beb88e13')
pkgver() {
cd "$srcdir/$_pkgname"
@@ -48,6 +48,7 @@ build() {
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
cd "$srcdir/$_pkgname"
+ PREFIX=$(git describe --long --tags | sed 's/-.*//;s/v//')
SUFFIX=$(git describe --long --tags | sed 's/^[^-]*-//;s/\([^-]*-g\)/r\1/;s/-/./g')
dotnet publish OpenTabletDriver.Daemon \
@@ -56,6 +57,7 @@ build() {
--runtime linux-x64 \
--self-contained false \
--output "./$_pkgname/out" \
+ /p:VersionPrefix="$PREFIX" \
/p:SuppressNETCoreSdkPreviewMessage=true \
/p:PublishTrimmed=false
@@ -66,6 +68,7 @@ build() {
--self-contained false \
--output "./$_pkgname/out" \
--version-suffix "$SUFFIX" \
+ /p:VersionPrefix="$PREFIX" \
/p:SuppressNETCoreSdkPreviewMessage=true \
/p:PublishTrimmed=false
@@ -76,6 +79,7 @@ build() {
--self-contained false \
--output "./$_pkgname/out" \
--version-suffix "$SUFFIX" \
+ /p:VersionPrefix="$PREFIX" \
/p:SuppressNETCoreSdkPreviewMessage=true \
/p:PublishTrimmed=false
@@ -89,7 +93,7 @@ build() {
dotnet "./$_pkgname.udev/out/$_pkgname.udev.dll" \
"$srcdir/$_pkgname/$_pkgname/Configurations" \
- "30-$_lpkgname.rules" > /dev/null
+ "90-$_lpkgname.rules" > /dev/null
}
package() {
@@ -106,7 +110,7 @@ package() {
sed -i "s/OTD_VERSION/$pkgver/" "$_pkgname.desktop"
install -Dm 644 -o root "$srcdir/$_pkgname/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname"
- install -Dm 644 -o root "$srcdir/$_pkgname-udev/30-$_lpkgname.rules" -t "$pkgdir/usr/lib/udev/rules.d"
+ install -Dm 644 -o root "$srcdir/$_pkgname-udev/90-$_lpkgname.rules" -t "$pkgdir/usr/lib/udev/rules.d"
install -Dm 644 -o root "$srcdir/$_pkgname/$_pkgname.UX/Assets/$_spkgname.png" -t "$pkgdir/usr/share/pixmaps"
cp -r "$srcdir/$_pkgname/$_pkgname/Configurations" "$pkgdir/usr/share/$_pkgname/"
diff --git a/notes.install b/notes.install
new file mode 100644
index 00000000000..e3964ca9d12
--- /dev/null
+++ b/notes.install
@@ -0,0 +1,58 @@
+BOLD='\033[1m'
+GREEN='\033[32m'
+RESET='\033[0m'
+
+msg_replug() {
+ echo -e "${BOLD}${GREEN}Replug${RESET} your tablet if it is connected. This will re-trigger the udev rules accordingly."
+ echo
+}
+
+msg_starting() {
+ echo "The daemon can be started with:"
+ echo -e " $ ${GREEN}otd${RESET}"
+ echo "You can fork it to the background and use output redirection to a log file if desired."
+ echo "A systemd user service is also provided and can be used instead:"
+ echo -e " $ ${GREEN}systemctl --user enable --now opentabletdriver.service${RESET}"
+ echo
+}
+
+msg_modules() {
+ echo "You will have to manually disable built-in kernel modules in order for this driver to work properly."
+ echo -e "This can be done by blacklisting the kernel module by creating a file in ${GREEN}/etc/modprobe.d/blacklist.conf${RESET} with a single line:"
+ echo -e " ${GREEN}blacklist <module>${RESET}"
+ echo "Where <module> is 'wacom' if you own a wacom tablet, and 'hid_uclogic' otherwise."
+ echo "To unload the module immediately, run:"
+ echo -e " $ ${GREEN}sudo rmmod <module>${RESET}"
+ echo
+}
+
+msg_faq() {
+ echo -e "In the case that you still have issues after following these instructions, the FAQ at ${GREEN}https://github.com/InfinityGhost/OpenTabletDriver/wiki/Linux-FAQ${RESET} may help."
+ echo
+}
+
+
+post_install() {
+ echo
+ echo -e "${BOLD}Welcome to OpenTabletDriver!${RESET}"
+ echo "In order to start using this driver, there are certain things that have to be configured manually."
+ echo
+ msg_replug
+ msg_starting
+ msg_modules
+ msg_faq
+}
+
+post_upgrade() {
+ if [ $(vercmp $2 'v0.4.2.r282.g4372321-2') -gt -1 ]
+ then
+ return 0
+ fi
+
+ echo
+ echo -e "${BOLD}Welcome to OpenTabletDriver!${RESET}"
+ echo "There are changes in the packaging compared to your previous version."
+ echo
+ echo "The method of starting the daemon has changed."
+ msg_starting
+}
diff --git a/opentabletdriver.service b/opentabletdriver.service
index 19c7983b30f..95dc3b116ac 100644
--- a/opentabletdriver.service
+++ b/opentabletdriver.service
@@ -1,10 +1,14 @@
[Unit]
Description=OpenTabletDriver Daemon
+After=graphical.target
+PartOf=graphical.target
+StartLimitIntervalSec=60
+StartLimitBurst=2
[Service]
-ExecStart=/usr/bin/dotnet /usr/share/OpenTabletDriver/OpenTabletDriver.Daemon.dll -c /usr/share/OpenTabletDriver/Configurations
+ExecStart=/usr/bin/otd
Restart=always
-RestartSec=30
+RestartSec=10s
[Install]
-WantedBy=default.target \ No newline at end of file
+WantedBy=graphical.target
diff --git a/otd b/otd
index a5538718440..246f692e41b 100755
--- a/otd
+++ b/otd
@@ -1,12 +1,13 @@
#!/bin/bash
-systemctl --user --quiet is-active opentabletdriver.service
-daemonactive=$?
-
-if [ $daemonactive != 0 ]
+cd /usr/share/OpenTabletDriver
+if [ $# -eq 0 ]
then
- echo "OpenTabletDriver Daemon not running, starting"
- systemctl --user start opentabletdriver.service
+ if [[ ! -v DISPLAY ]] && [[ ! -v WAYLAND_DISPLAY ]]
+ then
+ echo "DISPLAY and/or WAYLAND_DISPLAY is not set"
+ exit 1
+ fi
+ dotnet ./OpenTabletDriver.Daemon.dll -c ./Configurations
+else
+ dotnet ./OpenTabletDriver.Console.dll "$@"
fi
-
-cd /usr/share/OpenTabletDriver
-dotnet OpenTabletDriver.Console.dll "$@" \ No newline at end of file
diff --git a/otd-gui b/otd-gui
index c8d7599b220..8a71b9faf55 100755
--- a/otd-gui
+++ b/otd-gui
@@ -1,12 +1,3 @@
#!/bin/bash
-systemctl --user --quiet is-active opentabletdriver.service
-daemonactive=$?
-
-if [ $daemonactive != 0 ]
-then
- echo "OpenTabletDriver Daemon not running, starting"
- systemctl --user start opentabletdriver.service
-fi
-
cd /usr/share/OpenTabletDriver
-dotnet OpenTabletDriver.UX.Gtk.dll "$@" \ No newline at end of file
+dotnet ./OpenTabletDriver.UX.Gtk.dll "$@"
diff --git a/reload-systemd.install b/reload-systemd.install
deleted file mode 100644
index 460bf2c2fca..00000000000
--- a/reload-systemd.install
+++ /dev/null
@@ -1,3 +0,0 @@
-post_upgrade() {
- systemctl daemon-reload
-}