| 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 | `(("ncurses" ,ncurses) |
| 49 | ("libvorbis" ,libvorbis) |
| 50 | ("vorbis-tools" ,vorbis-tools) |
| 51 | ("mpg321" ,mpg321) |
| 52 | ;; TODO: add ghttp |
| 53 | ("libxml2" ,libxml2) |
| 54 | ("which" ,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 (string-append (assoc-ref inputs "vorbis-tools") |
| 80 | "/bin/ogg123")) |
| 81 | (mpg321 (string-append (assoc-ref inputs "mpg321") |
| 82 | "/bin/mpg321")) |
| 83 | (which (string-append (assoc-ref inputs "which") |
| 84 | "/bin/which"))) |
| 85 | (substitute* "src/orpheusconf.cc" |
| 86 | (("ogg123") ogg123) |
| 87 | (("which") which) |
| 88 | (("mpg321") mpg321)) |
| 89 | #t))) |
| 90 | (add-before 'build 'patch-shells |
| 91 | (lambda _ |
| 92 | (substitute* '("src/mp3track.cc" |
| 93 | "src/streamtrack.cc" |
| 94 | "src/oggtrack.cc") |
| 95 | (("/bin/sh") (which "sh"))) |
| 96 | #t))))) |
| 97 | (home-page "http://thekonst.net/en/orpheus") |
| 98 | (synopsis "Text-mode audio player") |
| 99 | (description |
| 100 | "Orpheus is a light-weight text mode menu- and window-driven audio player |
| 101 | application for CDs, internet stream broadcasts, and files in MP3 and Vorbis |
| 102 | OGG format.") |
| 103 | (license gpl2+))) |