Subject: [PATCH] Add new cl-out123

From: Sharlatan Hellseher <[email-masked]>
Date: Fri, 29 Jan 2021 13:59:34 +0000

Hi Guix team!

It's part of radiance dependencies, packaged with few tweaks.

Regards

-- 
… наш разум - превосходная объяснительная машина которая способна
найти смысл почти в чем угодно, истолковать любой феномен, но
совершенно не в состоянии принять мысль о непредсказуемости.
From 159527cf6dcc2074c425e3e1fd0f34b37f8bc049 Mon Sep 17 00:00:00 2001
From: Sharlatan Hellseher <[email-masked]>
Date: Fri, 29 Jan 2021 13:56:22 +0000
Subject: [PATCH] gnu: Add cl-out123

* gnu/packages/lisp-xyz.scm
  (sbcl-cl-out123, cl-out123, ecl-cl-out123): New variables
---
 gnu/packages/lisp-xyz.scm | 64 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index bc959502be..b9302114cd 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -69,6 +69,7 @@
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages lisp)
   #:use-module (gnu packages maths)
+  #:use-module (gnu packages mp3)
   #:use-module (gnu packages networking)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -10460,6 +10461,69 @@ online linear classification written in Common Lisp.")
 (define-public ecl-cl-online-learning
   (sbcl-package->ecl-package sbcl-cl-online-learning))
 
+(define-public sbcl-cl-out123
+  (let ((commit "6b58d3f8c2a28ad09059ac4c60fb3c781b9b421b")
+        (revision "1"))
+    (package
+      (name "sbcl-cl-out123")
+      (version (git-version "1.0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/Shirakumo/cl-out123")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0mdwgfax6sq68wvdgjjp78i40ah7wqkpqnvaq8a1c509k7ghdgv1"))))
+      (build-system asdf-build-system/sbcl)
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           ;; NOTE: (Sharlatan-20210127T215142+0000): Project includes compiled
+           ;; libraries in `static' which are available in Guix under `mpg123'
+           ;; package - removing whole `static' directory.
+           (add-after 'unpack 'clean-up
+             (lambda _
+               (delete-file-recursively "static")
+               #t))
+           (add-after 'unpack 'fix-paths
+             (lambda* (#:key inputs #:allow-other-keys)
+               (substitute* "low-level.lisp"
+                 (("libout123.so" all) (string-append
+                                        (assoc-ref inputs "libout123")
+                                        "/lib/" all)))))
+           ;; NOTE: (Sharlatan-20210129T134529+0000): ECL package `ext' has no
+           ;; exported macro `without-interrupts' it's moved to `mp' package
+           ;; https://github.com/Shirakumo/cl-out123/issues/2
+           ;; https://gitlab.com/embeddable-common-lisp/ecl/-/blob/develop/src/lsp/mp.lsp
+           (add-after 'unpack 'fix-ecl-package-name
+             (lambda _
+               (substitute* "wrapper.lisp"
+                 (("ext:without-interrupts.*") "mp:without-interrupts\n"))
+               #t)))))
+      (inputs
+       `(("libout123" ,mpg123)
+         ("cffi" ,sbcl-cffi)
+         ("trivial-features" ,sbcl-trivial-features)
+         ("trivial-garbage" ,sbcl-trivial-garbage)
+         ("documentation-utils" ,sbcl-documentation-utils)
+         ("bordeaux-threads" ,sbcl-bordeaux-threads)))
+      (home-page "https://shirakumo.github.io/cl-out123/")
+      (synopsis "Bindings to libout123, allowing cross-platform audio output")
+      (description
+       "This is a bindings library to @code{libout123} which allows easy
+cross-platform audio playback.
+
+This package produces 1 system: @code{CL-OUT123}")
+      (license license:zlib))))
+
+(define-public ecl-cl-out123
+  (sbcl-package->ecl-package sbcl-cl-out123))
+
+(define-public cl-out123
+  (sbcl-package->cl-source-package sbcl-cl-out123))
+
 (define-public sbcl-cl-random-forest
   (let ((commit "fedb36ce99bb6f4d7e3a7dd6d8b058f331308f91")
         (revision "1"))
-- 
2.30.0