From 54771bc76533f634dd4b5dc58402931c89c07bd4 Mon Sep 17 00:00:00 2001
From: Jaeme Sifat <jaeme@runbox.com>
Date: Wed, 25 Oct 2023 13:10:30 -0400
Subject: [PATCH] gnu: Add rust-alsa-0.8.

* gnu/packages/crates-io.scm (rust-alsa-0.8): New variable.
* gnu/packages/crates-io.scm (rust-alsa-0.7): Inherit rust-alsa-0.8.

Signed-off-by: Jaeme Sifat <jaeme@runbox.com>
Change-Id: I4c94ca99f12185e1c47f9e03b7bc3157f92d202d
---
 gnu/packages/crates-io.scm | 47 +++++++++++++++++++++++++++++++-------
 1 file changed, 39 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index fc26147157..aa7152b134 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -3094,17 +3094,17 @@ (define-public rust-allocator-api2-0.2
     (description "Mirror of Rust's allocator API.")
     (license (list license:expat license:asl2.0))))
 
-(define-public rust-alsa-0.7
+(define-public rust-alsa-0.8
   (package
     (name "rust-alsa")
-    (version "0.7.1")
+    (version "0.8.1")
     (source (origin
               (method url-fetch)
               (uri (crate-uri "alsa" version))
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "0iwbdgb6lr81iji9sr4f91mys24pia5avnkgbkv8kxzhvkc2lmp2"))))
+                "02pzlq2q8ml28ikvkvm77bwdqmi22d6ak1qvrc0cr6yjb9adwd6f"))))
     (build-system cargo-build-system)
     (arguments
      (list #:cargo-test-flags `(list "--release"
@@ -3121,18 +3121,49 @@ (define-public rust-alsa-0.7
                                      "--skip=seq::seq_portsubscribeiter"
                                      "--skip=seq::seq_subscribe")
            #:cargo-inputs `(("rust-alsa-sys" ,rust-alsa-sys-0.3)
-                            ("rust-bitflags" ,rust-bitflags-1)
+                            ("rust-bitflags" ,rust-bitflags-2)
                             ("rust-libc" ,rust-libc-0.2)
-                            ("rust-nix" ,rust-nix-0.24))))
+                            ("rust-nix" ,rust-nix-0.26))))
     (native-inputs (list pkg-config alsa-lib))
     (home-page "https://github.com/diwic/alsa-rs")
     (synopsis "Thin and safe wrapper around ALSA")
     (description
-     "A thin and safe wrapper around ALSA.  Provides APIs for
-many parts of ALSA including audio playback, audio recording, HCtl API, raw
-MIDI and MIDI sequencer.")
+     "A thin and safe wrapper around ALSA.  Provides APIs for many parts of
+ALSA including audio playback, audio recording, HCtl API, raw MIDI and MIDI
+sequencer.")
     (license license:expat)))
 
+(define-public rust-alsa-0.7
+  (package
+    (inherit rust-alsa-0.8)
+    (name "rust-alsa")
+    (version "0.7.1")
+    (source (origin
+              (method url-fetch)
+              (uri (crate-uri "alsa" version))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0iwbdgb6lr81iji9sr4f91mys24pia5avnkgbkv8kxzhvkc2lmp2"))))
+    (arguments
+     (list #:cargo-test-flags `(list "--release"
+                                     ;; Not the doc tests.
+                                     "--lib" "--bins" "--tests"
+                                     "--"
+                                     ;; These try to use the audio interface
+                                     "--skip=pcm::drop"
+                                     "--skip=pcm::info_from_default"
+                                     "--skip=pcm::playback_to_default"
+                                     "--skip=pcm::record_from_default"
+                                     "--skip=seq::print_seqs"
+                                     "--skip=seq::seq_loopback"
+                                     "--skip=seq::seq_portsubscribeiter"
+                                     "--skip=seq::seq_subscribe")
+           #:cargo-inputs `(("rust-alsa-sys" ,rust-alsa-sys-0.3)
+                            ("rust-bitflags" ,rust-bitflags-1)
+                            ("rust-libc" ,rust-libc-0.2)
+                            ("rust-nix" ,rust-nix-0.24))))))
+
 (define-public rust-alsa-0.6
   (package
     (inherit rust-alsa-0.7)
-- 
2.41.0

