summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Westover2022-06-11 17:15:26 -0400
committerBen Westover2022-06-11 17:15:26 -0400
commitaf9d1f4d27a65f1cc0b25a37d75b2faace2b6bca (patch)
tree2be1866cf14571de2464d01b99e23ef50284af83
downloadaur-af9d1f4d27a65f1cc0b25a37d75b2faace2b6bca.tar.gz
addpkg: mtkclient-git
-rw-r--r--.SRCINFO30
-rw-r--r--PKGBUILD39
-rw-r--r--mtkclient.install3
-rw-r--r--usb.patch24
4 files changed, 96 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..f72fdacbdcf7
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,30 @@
+pkgbase = mtkclient-git
+ pkgdesc = Unofficial MTK reverse engineering and flash tool
+ pkgver = 1.52.r201.ga92d6cd
+ pkgrel = 1
+ url = https://github.com/bkerler/mtkclient
+ install = mtkclient.install
+ arch = any
+ license = GPL
+ makedepends = git
+ makedepends = python-build
+ makedepends = python-installer
+ makedepends = python-wheel
+ makedepends = python-setuptools
+ depends = libusb
+ depends = python
+ depends = python-pyusb
+ depends = python-pyserial
+ depends = python-pycryptodome
+ depends = python-colorama
+ depends = python-mock
+ depends = shiboken6
+ depends = pyside6
+ provides = mtkclient
+ conflicts = mtkclient
+ source = git+https://github.com/bkerler/mtkclient.git
+ source = usb.patch
+ sha256sums = SKIP
+ sha256sums = 304b558e4d20e4a9b6df125b4eda55c010b1ec3be8dccc9de48c1aafeae60b52
+
+pkgname = mtkclient-git
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..af148e0c3564
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,39 @@
+# Maintainer: Ben Westover <kwestover.kw@gmail.com>
+
+pkgname=mtkclient-git
+pkgver=1.52.r201.ga92d6cd
+pkgrel=1
+pkgdesc="Unofficial MTK reverse engineering and flash tool"
+arch=('any')
+url="https://github.com/bkerler/mtkclient"
+license=('GPL')
+depends=('libusb' 'python' 'python-pyusb' 'python-pyserial' 'python-pycryptodome' 'python-colorama' 'python-mock' 'shiboken6' 'pyside6')
+makedepends=('git' 'python-build' 'python-installer' 'python-wheel' 'python-setuptools')
+conflicts=('mtkclient')
+provides=('mtkclient')
+install=mtkclient.install
+source=("git+https://github.com/bkerler/mtkclient.git"
+ "usb.patch")
+sha256sums=('SKIP'
+ '304b558e4d20e4a9b6df125b4eda55c010b1ec3be8dccc9de48c1aafeae60b52')
+
+pkgver() {
+ cd mtkclient
+ git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd mtkclient
+ # Remove problematic "usb" dependency (package already depends on pyusb)
+ cat ../usb.patch | patch -p1
+}
+
+build() {
+ cd mtkclient
+ python -m build --wheel --no-isolation
+}
+
+package() {
+ cd mtkclient
+ python -m installer --destdir="$pkgdir" dist/*.whl
+}
diff --git a/mtkclient.install b/mtkclient.install
new file mode 100644
index 000000000000..3a302d07ff7c
--- /dev/null
+++ b/mtkclient.install
@@ -0,0 +1,3 @@
+post_install() {
+ echo -e "\033[1;32m==>\033[0m \033[1mInstall the correct udev rules with the instructions at \e[4mhttps://github.com/bkerler/mtkclient#install-rules"
+}
diff --git a/usb.patch b/usb.patch
new file mode 100644
index 000000000000..34e6f989c2fb
--- /dev/null
+++ b/usb.patch
@@ -0,0 +1,24 @@
+diff --git a/pyproject.toml b/pyproject.toml
+index 9a0199a..a2e0af9 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -5,7 +5,6 @@ requires = [
+ "pyusb",
+ "pycryptodome",
+ "colorama",
+- "usb",
+ "shiboken6",
+ "pyside6",
+ "mock"
+diff --git a/requirements.txt b/requirements.txt
+index ade5059..4ef9d06 100644
+--- a/requirements.txt
++++ b/requirements.txt
+@@ -2,7 +2,6 @@ wheel
+ pyusb
+ pycryptodome
+ colorama
+-usb
+ shiboken6
+ pyside6
+ mock