Subject: [PATCH 10/64] gnu: Add rust-alsa.

From: Steve George <[email-masked]>
Date: Mon, 23 Oct 2023 23:20:55 +0100

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

-- >8 --
This version is needed by spotifyd which is my goal.
Version 0.6 is needed now for librespot-playback for this series.
So that 0.6 can inherit from 0.7 I've put them together here.
---
 gnu/packages/crates-io.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 697718ca1f..158111abad 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -3092,6 +3092,44 @@ (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
+  (package
+    (name "rust-alsa")
+    (version "0.7.0")
+    (source (origin
+              (method url-fetch)
+              (uri (crate-uri "alsa" version))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0i2ypsk1zarf4hbfagqfmhfskqhr6v5gp237c2skyrjrf08wj4l5"))))
+    (build-system cargo-build-system)
+    (arguments
+     (list #:cargo-test-flags `(list "--lib"
+                                     "--bins"
+                                     "--tests"
+                                     "--"
+                                     "--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-bitflags" ,rust-bitflags-1)
+                            ("rust-alsa-sys" ,rust-alsa-sys-0.3)
+                            ("rust-libc" ,rust-libc-0.2)
+                            ("rust-nix" ,rust-nix-0.24))))
+    (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.")
+    (license license:expat)))
+
 (define-public rust-alsa-sys-0.3
   (package
     (name "rust-alsa-sys")
-- 
2.41.0