+ #:use-module (gnu packages zip)
+ #:use-module ((srfi srfi-1) #:select (last)))
+
+(define-public cmus
+ (package
+ (name "cmus")
+ (version "2.7.1")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/" name "/" name "/archive/v"
+ version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0raixgjavkm7hxppzsc5zqbfbh2bhjcmbiplhnsxsmyj8flafyc1"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ; cmus does not include tests
+ #:phases
+ (modify-phases %standard-phases
+ (replace
+ 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+
+ ;; It's an idiosyncratic configure script that doesn't
+ ;; understand --prefix=..; it wants prefix=.. instead.
+ (zero?
+ (system* "./configure"
+ (string-append "prefix=" out)))))))))
+ ;; TODO: cmus optionally supports the following formats, which haven't yet
+ ;; been added to Guix:
+ ;;
+ ;; - Roar, libroar
+ ;;
+ ;; - DISCID_LIBS, apparently different from cd-discid which is included in
+ ;; Guix. See <http://sourceforge.net/projects/discid/>
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("alsa-lib" ,alsa-lib)
+ ("ao" ,ao)
+ ("ffmpeg" ,ffmpeg)
+ ("flac" ,flac)
+ ("jack" ,jack-1)
+ ("libcddb" ,libcddb)
+ ("libcdio-paranoia" ,libcdio-paranoia)
+ ("libcue" ,libcue)
+ ("libmad" ,libmad)
+ ("libmodplug" ,libmodplug)
+ ("libmpcdec" ,libmpcdec)
+ ("libsamplerate" ,libsamplerate)
+ ("libvorbis" ,libvorbis)
+ ("ncurses" ,ncurses)
+ ("opusfile" ,opusfile)
+ ("pulseaudio" ,pulseaudio)
+ ("wavpack" ,wavpack)))
+ (home-page "https://cmus.github.io/")
+ (synopsis "Small console music player")
+ (description "Cmus is a small and fast console music player. It supports
+many input formats and provides a customisable Vi-style user interface.")
+ (license license:gpl2+)))
+
+(define-public hydrogen
+ (package
+ (name "hydrogen")
+ (version "0.9.5.1")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://sourceforge/hydrogen/Hydrogen/"
+ (version-prefix version 3) "%20Sources/"
+ "hydrogen-" version ".tar.gz"))
+ (sha256
+ (base32
+ "1fvyp6gfzcqcc90dmaqbm11p272zczz5pfz1z4lj33nfr7z0bqgb"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ;no "check" target
+ #:phases
+ ;; TODO: Add scons-build-system and use it here.
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'scons-propagate-environment
+ (lambda _
+ ;; By design, SCons does not, by default, propagate
+ ;; environment variables to subprocesses. See:
+ ;; <http://comments.gmane.org/gmane.linux.distributions.nixos/4969>
+ ;; Here, we modify the Sconstruct file to arrange for
+ ;; environment variables to be propagated.
+ (substitute* "Sconstruct"
+ (("^env = Environment\\(")
+ "env = Environment(ENV=os.environ, "))))
+ (replace 'build
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (zero? (system* "scons"
+ (string-append "prefix=" out)
+ "lrdf=0" ; cannot be found
+ "lash=1")))))
+ (add-before
+ 'install
+ 'fix-img-install
+ (lambda _
+ ;; The whole ./data/img directory is copied to the target first.
+ ;; Scons complains about existing files when we try to install all
+ ;; images a second time.
+ (substitute* "Sconstruct"
+ (("os.path.walk\\(\"./data/img/\",install_images,env\\)") ""))
+ #t))
+ (replace 'install (lambda _ (zero? (system* "scons" "install")))))))
+ (native-inputs
+ `(("scons" ,scons)
+ ("python" ,python-2)
+ ("pkg-config" ,pkg-config)))
+ (inputs
+ `(("zlib" ,zlib)
+ ("libtar" ,libtar)
+ ("alsa-lib" ,alsa-lib)
+ ("jack" ,jack-1)
+ ("lash" ,lash)
+ ;;("lrdf" ,lrdf) ;FIXME: cannot be found by scons
+ ("qt" ,qt-4)
+ ("libsndfile" ,libsndfile)))
+ (home-page "http://www.hydrogen-music.org")
+ (synopsis "Drum machine")
+ (description
+ "Hydrogen is an advanced drum machine for GNU/Linux. Its main goal is to
+enable professional yet simple and intuitive pattern-based drum programming.")
+ (license license:gpl2+)))
+
+(define-public klick
+ (package
+ (name "klick")
+ (version "0.12.2")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://das.nasophon.de/download/klick-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0hmcaywnwzjci3pp4xpvbijnnwvibz7gf9xzcdjbdca910y5728j"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ;no "check" target
+ #:phases
+ ;; TODO: Add scons-build-system and use it here.
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'build
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (mkdir-p out)
+ (zero? (system* "scons" (string-append "PREFIX=" out))))))
+ (replace 'install (lambda _ (zero? (system* "scons" "install")))))))
+ (inputs
+ `(("boost" ,boost)
+ ("jack" ,jack-1)
+ ("libsndfile" ,libsndfile)
+ ("libsamplerate" ,libsamplerate)
+ ("liblo" ,liblo)
+ ("rubberband" ,rubberband)))
+ (native-inputs
+ `(("scons" ,scons)
+ ("python" ,python-2)
+ ("pkg-config" ,pkg-config)))
+ (home-page "http://das.nasophon.de/klick/")
+ (synopsis "Metronome for JACK")
+ (description
+ "klick is an advanced command-line based metronome for JACK. It allows
+you to define complex tempo maps for entire songs or performances.")
+ (license license:gpl2+)))