Package Details: mtkclient-git 2.1.3.r18.g0fdbe49-2

Git Clone URL: https://aur.archlinux.org/mtkclient-git.git (read-only, click to copy)
Package Base: mtkclient-git
Description: Unofficial MTK reverse engineering and flash tool
Upstream URL: https://github.com/bkerler/mtkclient
Licenses: GPL-3.0-only
Conflicts: mtkclient
Provides: mtkclient
Submitter: BenTheTechGuy
Maintainer: xiota
Last Packager: xiota
Votes: 8
Popularity: 0.38
First Submitted: 2022-06-11 21:15 (UTC)
Last Updated: 2026-03-13 22:27 (UTC)

Latest Comments

« First ‹ Previous 1 2 3

taotieren commented on 2022-12-20 03:14 (UTC)

# Maintainer: Ben Westover <kwestover.kw@gmail.com>
# Maintainer: taotieren <admin@taotieren.com>

pkgname=mtkclient-git
pkgver=1.9.r50.g5714a30
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+${url}.git")
sha256sums=('SKIP')

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)
        sed -i '/usb/d' pyproject.toml
        sed -i '/usb/d' requirements.txt
}

build() {
        cd mtkclient
        python -m build --wheel --no-isolation
}

package() {
        cd mtkclient
        python -m installer --destdir="$pkgdir" dist/*.whl
        install -Dm644 Setup/Linux/50-android.rules "${pkgdir}"/etc/udev/rules.d/50-android.rules
        install -Dm644 Setup/Linux/51-edl.rules "${pkgdir}"/etc/udev/rules.d/51-edl.rules
        mkdir -pv "${pkgdir}"/usr/share/doc/${pkgname%-git}
        mv "${pkgdir}"/usr/LICENSE "${pkgdir}"/usr/README.md "${pkgdir}"/usr/share/doc/${pkgname%-git}
}
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"
    groupadd dialout
    usermod -a -G lock,uucp,dialout,plugdev $(whoami)
    udevadm trigger
    udevadm control --reload-rules
}

post_upgrade() {
  post_install
}

post_remove() {
  post_install
}


taotieren commented on 2022-09-08 02:40 (UTC) (edited on 2022-09-08 02:40 (UTC) by taotieren)

PKKBUILD patch

package() {
    cd mtkclient-$pkgver
    python -m installer --destdir="$pkgdir" dist/*.whl
    install -Dm644 Setup/Linux/50-android.rules "${pkgdir}"/etc/udev/rules.d/50-android.rules
    install -Dm644 Setup/Linux/51-edl.rules "${pkgdir}"/etc/udev/rules.d/51-edl.rules
}

mtkclient.install patch

post_install() {
    groupadd dialout
    usermod -a -G lock,uucp,dialout,plugdev $(whoami)
    udevadm trigger
    udevadm control --reload-rules
}

post_upgrade() {
  post_install
}

post_remove() {
  post_install
}