Subject: [bug#78539] [PATCH 13/13] gnu: Add [email-masked]

From: David Hoppenbrouwers <[email-masked]>
Date: Wed, 21 May 2025 18:19:55 +0200

Change-Id: I222fb1efdaa8311a5ff8ac45a873262ceed04dd5
---
 gnu/packages/flashing-tools.scm | 43 +++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/flashing-tools.scm b/gnu/packages/flashing-tools.scm
index e99a38ec2d..db2481b7d5 100644
--- a/gnu/packages/flashing-tools.scm
+++ b/gnu/packages/flashing-tools.scm
@@ -32,6 +32,7 @@
 
 (define-module (gnu packages flashing-tools)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system cargo)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
@@ -53,6 +54,9 @@ (define-module (gnu packages flashing-tools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages crates-apple)
+  #:use-module (gnu packages crates-io)
+  #:use-module (gnu packages crates-shell)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages embedded)
@@ -682,6 +686,45 @@ (define-public wally-cli
 @url{https://ergodox-ez.com/,ZSA keyboards}.")
       (license license:expat))))
 
+(define-public wlink
+  (package
+    (name "wlink")
+    (version "0.1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "wlink" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "05l6h5d4w181sg00nq0l1808l0zc4fdda6syvgm7ba31glj7xkd4"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:install-source? #f
+       #:cargo-inputs (("rust-anyhow" ,rust-anyhow-1)
+                       ("rust-bitfield" ,rust-bitfield-0.17)
+                       ("rust-clap" ,rust-clap-4)
+                       ("rust-hex" ,rust-hex-0.4)
+                       ("rust-ihex" ,rust-ihex-3)
+                       ("rust-log" ,rust-log-0.4)
+                       ("rust-nu-pretty-hex" ,rust-nu-pretty-hex-0.100)
+                       ("rust-rusb" ,rust-rusb-0.9)
+                       ("rust-simplelog" ,rust-simplelog-0.12)
+                       ("rust-thiserror" ,rust-thiserror-2)
+                       ("rust-object" ,rust-object-0.36)
+                       ("rust-indicatif" ,rust-indicatif-0.17)
+                       ("rust-serialport" ,rust-serialport-4)
+                       ("rust-libloading" ,rust-libloading-0.8)
+                       ("rust-chrono" ,rust-chrono-0.4)
+                       ("rust-clap-verbosity-flag" ,rust-clap-verbosity-flag-2))))
+    (native-inputs (list pkg-config))
+    (inputs (list eudev libusb))
+    (home-page "https://github.com/ch32-rs/wlink")
+    (synopsis "Unofficial WCH-Link command line tool")
+    (description
+     "This package is an unofficial command line tool for use with WCH-Link.
+NOTE: This tool is still in development and not ready for production use.")
+    (license (list license:asl2.0 license:expat))))
+
 (define-public qdl
   (let ((commit "13681fcb359c9f9c32a17a91d3dd20df2e413b6d")
         (revision "1"))
-- 
2.49.0