diff options
author | Mark Wagie | 2024-12-29 10:51:41 -0700 |
---|---|---|
committer | Mark Wagie | 2024-12-29 10:51:41 -0700 |
commit | a75c10068ee1445cfac8789faeae2ac012931da7 (patch) | |
tree | 7caabbda072b3e772eba8cadc14f5c12b4eaf348 | |
parent | 929214fdbc749111c460ebb0a32d009d0e26d148 (diff) | |
download | aur-a75c10068ee1445cfac8789faeae2ac012931da7.tar.gz |
use static patch
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | PKGBUILD | 8 | ||||
-rw-r--r-- | autokey.patch | 25 | ||||
-rw-r--r-- | imghdr.patch | 28 |
5 files changed, 36 insertions, 32 deletions
@@ -1,7 +1,7 @@ pkgbase = autokey pkgdesc = A desktop automation utility for Linux and X11 pkgver = 0.96.0 - pkgrel = 7 + pkgrel = 8 url = https://github.com/autokey/autokey arch = any license = GPL-3.0-or-later @@ -11,9 +11,9 @@ pkgbase = autokey makedepends = python-setuptools makedepends = python-wheel source = autokey-0.96.0.tar.gz::https://github.com/autokey/autokey/archive/v0.96.0.tar.gz - source = https://github.com/autokey/autokey/pull/997.patch + source = imghdr.patch sha256sums = 40341fc4cd9703a34264e9191b5938fc7ed5a6f357992d91e492975d89933acd - sha256sums = 3d5a186daafda423e7653c1b38a2e5076150dc9a61aa678763b71f15060765c9 + sha256sums = 67d6fb46df85ae8ac820ee76da099fb84c3d5e723720bfe9feba5054b8d0954a pkgname = autokey-common pkgdesc = A desktop automation utility for Linux and X11 - common data diff --git a/.gitignore b/.gitignore index ddc1e73638b1..2d0dfa55ddf6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ !.SRCINFO !autokey.patch !.nvchecker.toml +!imghdr.patch @@ -8,7 +8,7 @@ pkgname=( ) pkgbase=autokey pkgver=0.96.0 -pkgrel=7 +pkgrel=8 pkgdesc="A desktop automation utility for Linux and X11" arch=('any') url="https://github.com/autokey/autokey" @@ -21,15 +21,15 @@ makedepends=( 'python-wheel' ) source=("$pkgbase-$pkgver.tar.gz::https://github.com/autokey/autokey/archive/v$pkgver.tar.gz" - 'https://github.com/autokey/autokey/pull/997.patch') + 'imghdr.patch') sha256sums=('40341fc4cd9703a34264e9191b5938fc7ed5a6f357992d91e492975d89933acd' - '3d5a186daafda423e7653c1b38a2e5076150dc9a61aa678763b71f15060765c9') + '67d6fb46df85ae8ac820ee76da099fb84c3d5e723720bfe9feba5054b8d0954a') prepare() { cd "$pkgbase-$pkgver" # https://github.com/autokey/autokey/issues/961 - patch -Np1 -i ../997.patch + patch -Np1 -i ../imghdr.patch } build() { diff --git a/autokey.patch b/autokey.patch deleted file mode 100644 index 3c0c5b4d80a8..000000000000 --- a/autokey.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- src/autokey-0.95.10/lib/autokey/interface.py -+++ src/autokey-0.95.10/lib/autokey/interface.py -@@ -751,6 +751,10 @@ class XInterfaceBase(threading.Thread): - - focus = self.localDisplay.get_input_focus().focus - -+ # Patch from https://code.google.com/archive/p/autokey/issues/278 -+ self.localDisplay.flush() -+ time.sleep(0.01) -+ - for char in string: - try: - keyCodeList = self.localDisplay.keysym_to_keycodes(ord(char)) -@@ -796,6 +800,11 @@ class XInterfaceBase(threading.Thread): - self.__enqueue(self.__sendKey, keyName) - - def __sendKey(self, keyName): -+ -+ # Patch from https://code.google.com/archive/p/autokey/issues/278 -+ self.localDisplay.flush() -+ time.sleep(0.01) -+ - logger.debug("Send special key: [%r]", keyName) - self.__sendKeyCode(self.__lookupKeyCode(keyName)) - diff --git a/imghdr.patch b/imghdr.patch new file mode 100644 index 000000000000..598a025d6a61 --- /dev/null +++ b/imghdr.patch @@ -0,0 +1,28 @@ +diff --unified --recursive --text a/lib/autokey/scripting/highlevel.py b/lib/autokey/scripting/highlevel.py +--- a/lib/autokey/scripting/highlevel.py 2022-06-05 17:28:30.000000000 -0600 ++++ b/lib/autokey/scripting/highlevel.py 2024-12-29 10:49:03.302436869 -0700 +@@ -6,7 +6,7 @@ + import os + import subprocess + import tempfile +-import imghdr ++import magic + import struct + + +@@ -72,10 +72,11 @@ + @returns: (width, height). + @raise Exception: Raised if the file is not a png + """ +- if not imghdr.what(filepath) == 'png': +- raise Exception("not PNG") +- head = open(filepath, 'rb').read(24) +- return struct.unpack('!II', head[16:24]) ++ with open(filepath, 'rb') as f: ++ if not magic.detect_from_fobj(f).mime_type == "image/png": ++ raise Exception("not PNG") ++ head = f.read(24) ++ return struct.unpack('!II', head[16:24]) + + + def mouse_move(x: int, y: int, display: str=''): |