orpheus.scm 4.1 KB

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