Subject: [PATCH 2/2] gnu: Add whipper.

From: Vinicius Monego <[email-masked]>
Date: Thu, 14 Oct 2021 16:00:36 +0000

* gnu/packages/cdrom.scm (whipper): New variable.
---
 gnu/packages/cdrom.scm | 61 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/cdrom.scm b/gnu/packages/cdrom.scm
index 47de11eec9..4c467dd1fb 100644
--- a/gnu/packages/cdrom.scm
+++ b/gnu/packages/cdrom.scm
@@ -69,9 +69,12 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages perl-web)
+  #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages image)
   #:use-module (gnu packages photo)
+  #:use-module (gnu packages serialization)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages video)
@@ -637,6 +640,64 @@ from an audio CD.")
 (CD Input and Control library).")
     (license gpl3+)))
 
+(define-public whipper
+  (package
+    (name "whipper")
+    (version "0.10.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/whipper-team/whipper")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "00cq03cy5dyghmibsdsq5sdqv3bzkzhshsng74bpnb5lasxp3ia5"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'cdparanoia
+           (lambda _
+             ;; Fix cdparanoia executable name.
+             (substitute* "whipper/program/cdparanoia.py"
+               (("cd-paranoia") "cdparanoia"))))
+         (add-before 'check 'set-home
+           ;; Tests need a writable HOME.
+           (lambda _
+             (setenv "HOME" (getcwd))))
+         (add-before 'check 'skip-failing-test
+           ;; This test apparently relies on live data that changes over time:
+           ;; https://github.com/whipper-team/whipper/issues/515.
+           (lambda _
+             (substitute* "whipper/test/test_common_accurip.py"
+               (("test_AccurateRipResponse_parses_correctly")
+                "_test_AccurateRipResponse_parses_correctly")))))))
+    (native-inputs
+     `(("gobject-introspection" ,gobject-introspection)
+       ("python-setuptools-scm" ,python-setuptools-scm)
+       ("python-twisted" ,python-twisted)))
+    (inputs
+     `(("cdparanoia" ,cdparanoia)
+       ("cdrdao" ,cdrdao)
+       ("flac" ,flac)
+       ("libdiscid" ,libdiscid)
+       ("libsndfile" ,libsndfile)
+       ("sox" ,sox)))
+    (propagated-inputs
+     `(("python-discid" ,python-discid)
+       ("python-musicbrainzngs" ,python-musicbrainzngs)
+       ("python-mutagen" ,python-mutagen)
+       ("python-pycdio" ,python-pycdio)
+       ("python-pygobject" ,python-pygobject)
+       ("python-ruamel.yaml" ,python-ruamel.yaml)))
+    (home-page "https://github.com/whipper-team/whipper")
+    (synopsis "CD-DA ripper preferring accuracy over speed")
+    (description "Whipper is a CD-DA ripper forked from the morituri project
+(CDDA ripper aiming for accuracy over speed), which development seems to have
+halted.")
+    (license gpl3+)))
+
 (define-public abcde
   (package
     (name "abcde")
-- 
2.30.2