From 304bf8877e4e401724cde02d4f20d53072bf0f59 Mon Sep 17 00:00:00 2001 From: Petr Hodina Date: Tue, 13 Dec 2022 23:00:21 +0100 Subject: [PATCH 4/4] gnu: Add mtkclient. * gnu/local.mk: Add patch. * gnu/packages/patches/mtkclient-remove-usb.patch: New file. diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index a9bf6fa6ba..50e9bbcdfa 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -123,6 +123,7 @@ (define-module (gnu packages engineering) #:use-module (gnu packages multiprecision) #:use-module (gnu packages mpi) #:use-module (gnu packages ncurses) + #:use-module (gnu packages openstack) #:use-module (gnu packages parallel) #:use-module (gnu packages pcre) #:use-module (gnu packages perl) @@ -1330,6 +1331,45 @@ (define-public libredwg replacement for the OpenDWG libraries.") (license license:gpl3+))) +(define-public mtkclient + (package + (name "mtkclient") + (version "1.52") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/bkerler/mtkclient/archive/refs/tags/" + version ".tar.gz")) + (patches (search-patches + "mtkclient-remove-usb.patch")) + (sha256 + (base32 + "1wlz9sipwzgfph57jzmnjlhhsmphfcnl9y0rvpa2wfb5rg6n74ss")))) + (build-system python-build-system) + (arguments + (list #:tests? #f ;no test suite + #:phases #~(modify-phases %standard-phases + (add-after 'install 'install-udev-rules + (lambda* _ + (let ((udev (string-append #$output "/lib/udev.d"))) + (mkdir-p udev) + (install-file "Setup/Linux/50-android.rules" + udev) + (install-file "Setup/Linux/51-edl.rules" udev))))))) + (native-inputs (list python-keystone-engine)) + (inputs (list python-pyusb + python-pycryptodome + python-colorama + python-capstone + python-mock + python-pyserial + libusb)) + (home-page "https://github.com/bkerler/mtkclient") + (synopsis "MTK reverse engineering and flash tool") + (description "This package provides a tool for reading/writing flash +Mediatek chips.") + (license license:gpl3+))) + (define-public minicom (package (name "minicom") diff --git a/gnu/packages/patches/mtkclient-remove-usb.patch b/gnu/packages/patches/mtkclient-remove-usb.patch new file mode 100644 index 0000000000..44105d1884 --- /dev/null +++ b/gnu/packages/patches/mtkclient-remove-usb.patch @@ -0,0 +1,44 @@ +From d1ade84a4d320fd26cc77414f53d87293f41a70f Mon Sep 17 00:00:00 2001 +From: Petr Hodina +Date: Mon, 14 Nov 2022 14:08:43 +0100 +Subject: [PATCH] Remove usb. + + +diff --git a/pyproject.toml b/pyproject.toml +index 348cdce..36d4168 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -4,7 +4,6 @@ requires = [ + "wheel", + "pyusb", + "pycryptodome", +- "colorama", +- "usb" ++ "colorama" + ] + build-backend = "setuptools.build_meta" +diff --git a/requirements.txt b/requirements.txt +index 946fe9a..cde3398 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -2,5 +2,3 @@ wheel + pyusb + pycryptodome + colorama +-usb +- +diff --git a/setup.py b/setup.py +index 9031d23..3bd7cd9 100755 +--- a/setup.py ++++ b/setup.py +@@ -22,7 +22,6 @@ setup( + license='MIT License', + install_requires=[ + 'colorama', +- 'usb', + 'pyusb', + 'pycryptodome' + ], +-- +2.37.2 + -- 2.38.1