Subject: [PATCH 049/228] gnu: Add rust-pcap-1.

From: Herman Rimm <[email-masked]>
Date: Sun, 18 Feb 2024 22:02:47 +0100

* gnu/packages/crates-io.scm (rust-pcap-1): Add variable.
(rust-pcap-0.7): Inherit rust-pcap-1.

Change-Id: I00cfe081f4414616c7524af5093ebd639c8cd37f
---
 gnu/packages/crates-io.scm | 41 ++++++++++++++++++++++++++++++++------
 1 file changed, 35 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 604bc2f752..24469da2e7 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -46310,8 +46310,42 @@ (define-public rust-pathdiff-0.2
 path.")
     (license (list license:asl2.0 license:expat))))
 
+(define-public rust-pcap-1
+  (package
+    (name "rust-pcap")
+    (version "1.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "pcap" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1hrpgjxy53rvi9xbizr9nm70qgsb9pzfwah9bnirq791kpgjyibp"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-bitflags" ,rust-bitflags-1)
+                       ("rust-errno" ,rust-errno-0.2)
+                       ("rust-etherparse" ,rust-etherparse-0.13)
+                       ("rust-futures" ,rust-futures-0.3)
+                       ("rust-gat-std" ,rust-gat-std-0.1)
+                       ("rust-libc" ,rust-libc-0.2)
+                       ("rust-libloading" ,rust-libloading-0.6)
+                       ("rust-pkg-config" ,rust-pkg-config-0.3)
+                       ("rust-regex" ,rust-regex-1)
+                       ("rust-tokio" ,rust-tokio-1)
+                       ("rust-tun-tap" ,rust-tun-tap-0.1)
+                       ("rust-windows-sys" ,rust-windows-sys-0.36))
+       #:cargo-development-inputs (("rust-eui48" ,rust-eui48-1)
+                                   ("rust-tempdir" ,rust-tempdir-0.3))))
+    (home-page "https://github.com/rust-pcap/pcap")
+    (synopsis "Packet capture API around (w)pcap")
+    (description
+     "This package provides a packet capture API around pcap/wpcap.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-pcap-0.7
   (package
+    (inherit rust-pcap-1)
     (name "rust-pcap")
     (version "0.7.0")
     (source
@@ -46322,7 +46356,6 @@ (define-public rust-pcap-0.7
        (sha256
         (base32 "14blflnbj87z3ajlj1hszsl6k7rwa338y4aw2yjm2j0xdpjvj4pr"))))
     (native-inputs (list libpcap))
-    (build-system cargo-build-system)
     (arguments
      `(#:tests? #f  ; can't find crate for `futures`
        #:cargo-inputs
@@ -46332,11 +46365,7 @@ (define-public rust-pcap-0.7
         ("rust-mio" ,rust-mio-0.6)
         ("rust-tokio-core" ,rust-tokio-core-0.1))
        #:cargo-development-inputs
-       (("rust-tempdir" ,rust-tempdir-0.3))))
-    (home-page "https://github.com/rust-pcap/pcap")
-    (synopsis "Packet capture API around pcap/wpcap")
-    (description "This package provides a packet capture API around pcap/wpcap.")
-    (license (list license:expat license:asl2.0))))
+       (("rust-tempdir" ,rust-tempdir-0.3))))))
 
 (define-public rust-pcap-sys-0.1
   (package
-- 
2.41.0