+ (license license:bsd-2))))
+
+(define-public heimdall
+ (package
+ (name "heimdall")
+ (version "1.4.2")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/BenjaminDobell/Heimdall.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1ygn4snvcmi98rgldgxf5hwm7zzi1zcsihfvm6awf9s6mpcjzbqz"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:build-type "Release"
+ #:tests? #f ; no tests
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch-invocations
+ (lambda* (#:key outputs #:allow-other-keys)
+ (substitute* '("heimdall-frontend/source/aboutform.cpp"
+ "heimdall-frontend/source/mainwindow.cpp")
+ (("start[(]\"heimdall\"")
+ (string-append "start(\"" (assoc-ref outputs "out")
+ "/bin/heimdall\"")))
+ #t))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
+ (lib (string-append (assoc-ref outputs "out") "/lib")))
+ (install-file "bin/heimdall" bin)
+ (install-file "bin/heimdall-frontend" bin)
+ (install-file "libpit/libpit.a" lib)
+ #t))))))
+ (inputs
+ `(("libusb" ,libusb)
+ ("qtbase" ,qtbase)
+ ("zlib" ,zlib)))
+ (home-page "https://glassechidna.com.au/heimdall/")
+ (synopsis "Flash firmware onto Samsung mobile devices")
+ (description "@command{heimdall} is a tool suite used to flash firmware (aka
+ROMs) onto Samsung mobile devices. Heimdall connects to a mobile device over
+USB and interacts with low-level software running on the device, known as Loke.
+Loke and Heimdall communicate via the custom Samsung-developed protocol typically
+referred to as the \"Odin 3 protocol\".")
+ (license license:expat)))
+
+(define-public ifdtool
+ (package
+ (name "ifdtool")
+ (version "4.9")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/coreboot/coreboot.git")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0jidj29jh6p65d17k304wlzhxvp4p3c2namgcdwg2sxq8jfr0zlm"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags
+ (list "CC=gcc"
+ "INSTALL=install"
+ (string-append "PREFIX=" (assoc-ref %outputs "out")))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'chdir
+ (lambda _
+ (chdir "util/ifdtool")
+ #t))
+ (delete 'configure)) ; no configure script
+ #:tests? #f)) ; no test suite
+ (home-page "https://github.com/corna/me_cleaner/")
+ (synopsis "Intel Firmware Descriptor dumper")
+ (description "This package provides @command{ifdtool}, a program to
+dump Intel Firmware Descriptor data of an image file.")
+ (license license:gpl2)))
+
+(define-public intelmetool
+ (package
+ (name "intelmetool")
+ (version "4.7")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://review.coreboot.org/p/coreboot")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0nw555i0fm5kljha9h47bk70ykbwv8ddfk6qhz6kfqb79vzhy4h2"))))
+ (build-system gnu-build-system)
+ (inputs
+ `(("pciutils" ,pciutils)
+ ("zlib" ,zlib)))
+ (arguments
+ `(#:make-flags
+ (list "CC=gcc"
+ "INSTALL=install"
+ (string-append "PREFIX=" (assoc-ref %outputs "out")))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'chdir
+ (lambda _
+ (chdir "util/intelmetool")
+ #t))
+ (delete 'configure)
+ (delete 'check))))
+ (home-page "https://github.com/zamaudio/intelmetool")
+ (synopsis "Intel Management Engine tools")
+ (description "This package provides tools for working with Intel
+Management Engine (ME). You need to @code{sudo rmmod mei_me} and
+@code{sudo rmmod mei} before using this tool. Also pass
+@code{iomem=relaxed} to the Linux kernel command line.")
+ (license license:gpl2)
+
+ ;; This is obviously an Intel thing, plus it requires <cpuid.h>.
+ (supported-systems '("x86_64-linux" "i686-linux"))))
+
+(define-public me-cleaner
+ (package
+ (name "me-cleaner")
+ (version "1.2")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/corna/me_cleaner.git")
+ (commit (string-append "v" version))))
+ (sha256
+ (base32
+ "1bdj2clm13ir441vn7sv860xsc5gh71ja5lc2wn0gggnff0adxj4"))
+ (file-name (git-file-name name version))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'install-documentation
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (man (string-append out "/share/man/man1")))
+ (install-file "man/me_cleaner.1" man)
+ #t))))))
+ (home-page "https://github.com/corna/me_cleaner")
+ (synopsis "Intel ME cleaner")
+ (description "This package provides tools for disabling Intel
+ME as far as possible (it only edits ME firmware image files).")
+ (license license:gpl3+)
+
+ ;; This is an Intel thing.
+ (supported-systems '("x86_64-linux" "i686-linux"))))
+
+(define-public uefitool
+ (package
+ (name "uefitool")
+ (version "0.27.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/LongSoft/UEFITool.git")
+ (commit version)))
+ (sha256
+ (base32
+ "1i1p823qld927p4f1wcphqcnivb9mq7fi5xmzibxc3g9zzgnyc2h"))
+ (file-name (git-file-name name version))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda _
+ (invoke "qmake" "-makefile")))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (install-file "UEFITool" (string-append (assoc-ref outputs "out")
+ "/bin"))
+ #t)))))
+ (inputs
+ `(("qtbase" ,qtbase)))
+ (home-page "https://github.com/LongSoft/UEFITool/")
+ (synopsis "UEFI image editor")
+ (description "@code{uefitool} is a graphical image file editor for
+Unifinished Extensible Firmware Interface (UEFI) images.")
+ (license license:bsd-2)))