gnu: python-pandas: Fix build on 32-bit.
[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 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
32 (define-public orpheus
33 (package
34 (name "orpheus")
35 (version "1.6")
36 (source
37 (origin
38 (method url-fetch)
39 (uri (string-append "http://thekonst.net/download/orpheus-"
40 version ".tar.gz"))
41 (sha256
42 (base32
43 "1xbgxq8fybwhm51nw9hvvrgi873qzkc2qvmy15d2m2hw2yqa99hq"))
44 (patches (search-patches "orpheus-cast-errors-and-includes.patch"))))
45 (build-system gnu-build-system)
46 (inputs
47 `(("ncurses" ,ncurses)
48 ("libvorbis" ,libvorbis)
49 ("vorbis-tools" ,vorbis-tools)
50 ("mpg321" ,mpg321)
51 ;; TODO: add ghttp
52 ("libxml2" ,libxml2)
53 ("which" ,which)))
54 (arguments
55 `(#:phases
56 (modify-phases %standard-phases
57 (replace 'configure
58 (lambda* (#:key outputs #:allow-other-keys)
59 ;; This old `configure' script does not support variables passed as
60 ;; arguments.
61 (let ((out (assoc-ref outputs "out")))
62 (setenv "CONFIG_SHELL" (which "bash"))
63 (setenv "SHELL" (which "bash"))
64 (setenv "LIBS" "-logg") ;doesn't declare its use of libogg
65 (zero?
66 (system* "./configure" (string-append "--prefix=" out)
67 ,@(if (string=? "mips64el-linux"
68 (%current-system))
69 '("--host=mips64el-unknown-linux-gnu")
70 '())
71 )))))
72 (add-after 'configure 'configure-players
73 (lambda* (#:key inputs #:allow-other-keys)
74 ;; To avoid propagating the mpg321 and vorbis-tools inputs, we can
75 ;; make the orpheus application execute the needed players from the
76 ;; store.
77 (let ((ogg123 (string-append (assoc-ref inputs "vorbis-tools")
78 "/bin/ogg123"))
79 (mpg321 (string-append (assoc-ref inputs "mpg321")
80 "/bin/mpg321"))
81 (which (string-append (assoc-ref inputs "which")
82 "/bin/which")))
83 (substitute* "src/orpheusconf.cc"
84 (("ogg123") ogg123)
85 (("which") which)
86 (("mpg321") mpg321))
87 #t)))
88 (add-before 'build 'patch-shells
89 (lambda _
90 (substitute* '("src/mp3track.cc"
91 "src/streamtrack.cc"
92 "src/oggtrack.cc")
93 (("/bin/sh") (which "sh")))
94 #t)))))
95 (home-page "http://thekonst.net/en/orpheus")
96 (synopsis "Text-mode audio player")
97 (description
98 "Orpheus is a light-weight text mode menu- and window-driven audio player
99 application for CDs, internet stream broadcasts, and files in MP3 and Vorbis
100 OGG format.")
101 (license gpl2+)))