gnu: python-deepmerge: Use pyproject-build-system.
[jackhill/guix/guix.git] / gnu / packages / orpheus.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2014, 2018 Efraim Flashner <efraim@flashner.co.il>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages orpheus)
21 #:use-module (guix licenses)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages ncurses)
27 #:use-module (gnu packages mp3)
28 #:use-module (gnu packages base)
29 #:use-module (gnu packages xiph)
30 #:use-module (gnu packages xml)
31 #:use-module (ice-9 match))
32
33 (define-public orpheus
34 (package
35 (name "orpheus")
36 (version "1.6")
37 (source
38 (origin
39 (method url-fetch)
40 (uri (string-append "http://thekonst.net/download/orpheus-"
41 version ".tar.gz"))
42 (sha256
43 (base32
44 "1xbgxq8fybwhm51nw9hvvrgi873qzkc2qvmy15d2m2hw2yqa99hq"))
45 (patches (search-patches "orpheus-cast-errors-and-includes.patch"))))
46 (build-system gnu-build-system)
47 (inputs
48 (list ncurses
49 libvorbis
50 vorbis-tools
51 mpg321
52 ;; TODO: add ghttp
53 libxml2
54 which))
55 (arguments
56 `(#:phases
57 (modify-phases %standard-phases
58 (replace 'configure
59 (lambda* (#:key outputs #:allow-other-keys)
60 ;; This old `configure' script does not support variables passed as
61 ;; arguments.
62 (let ((out (assoc-ref outputs "out")))
63 (setenv "CONFIG_SHELL" (which "bash"))
64 (setenv "SHELL" (which "bash"))
65 (setenv "LIBS" "-logg") ;doesn't declare its use of libogg
66 (invoke "./configure"
67 (string-append "--prefix=" out)
68 ,@(match (%current-system)
69 ("mips64el-linux"
70 '("--host=mips64el-unknown-linux-gnu"))
71 ("aarch64-linux"
72 '("--build=aarch64-unknown-linux-gnu"))
73 (_ `()))))))
74 (add-after 'configure 'configure-players
75 (lambda* (#:key inputs #:allow-other-keys)
76 ;; To avoid propagating the mpg321 and vorbis-tools inputs, we can
77 ;; make the orpheus application execute the needed players from the
78 ;; store.
79 (let ((ogg123 (search-input-file inputs "/bin/ogg123"))
80 (mpg321 (search-input-file inputs "/bin/mpg321"))
81 (which (search-input-file inputs "/bin/which")))
82 (substitute* "src/orpheusconf.cc"
83 (("ogg123") ogg123)
84 (("which") which)
85 (("mpg321") mpg321))
86 #t)))
87 (add-before 'build 'patch-shells
88 (lambda _
89 (substitute* '("src/mp3track.cc"
90 "src/streamtrack.cc"
91 "src/oggtrack.cc")
92 (("/bin/sh") (which "sh")))
93 #t)))))
94 (home-page "http://thekonst.net/en/orpheus")
95 (synopsis "Text-mode audio player")
96 (description
97 "Orpheus is a light-weight text mode menu- and window-driven audio player
98 application for CDs, internet stream broadcasts, and files in MP3 and Vorbis
99 OGG format.")
100 (license gpl2+)))