orpheus.scm 4.0 KB

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