+
+(define-public perl-musicbrainz-discid
+ (package
+ (name "perl-musicbrainz-discid")
+ (version "0.04")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://cpan/authors/id/N/NJ/NJH/MusicBrainz-DiscID-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1i4qk1qfcmxdibqkyfjrrjdq2zk42vjcz590qgiyc47fi9p6xx1j"))))
+ (build-system perl-build-system)
+ (native-inputs `(("pkg-config" ,pkg-config)
+ ("which" ,which)))
+ (inputs `(("libdiscid" ,libdiscid)))
+ (home-page "https://metacpan.org/release/MusicBrainz-DiscID")
+ (synopsis "Perl interface to the MusicBrainz libdiscid library")
+ (description
+ "The @code{MusicBrainz::DiscID} module is a Perl interface to the
+MusicBrainz libdiscid library, allowing you to manipulate digital audio
+compact disc (CDDA) identifiers.")
+ (license license:gpl2)))
+
+(define-public perl-webservice-musicbrainz
+ (package
+ (name "perl-webservice-musicbrainz")
+ (version "1.0.4")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://cpan/authors/id/B/BF/BFAIST/WebService-MusicBrainz-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "182z3xjajk6s7k5xm3kssjy3hqx2qbnq4f8864hma098ryy2ph3a"))))
+ (build-system perl-build-system)
+ (arguments
+ ;; Tests try to connect to http://musicbrainz.org.
+ '(#:tests? #f))
+ (native-inputs
+ `(("perl-module-build" ,perl-module-build)))
+ (propagated-inputs
+ `(("perl-mojolicious" ,perl-mojolicious)))
+ (home-page "https://metacpan.org/release/WebService-MusicBrainz")
+ (synopsis "Web service API to the MusicBrainz database")
+ (description
+ "This module searches the MusicBrainz database through their web service
+at @code{musicbrainz.org}.")
+ (license license:perl-license)))
+
+(define-public clyrics
+ (package
+ (name "clyrics")
+ (version "0.10")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/trizen/clyrics.git")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1qvj4dyipkkdccx5hci4z0q23i54ldk6hh7x5m35a7f70rrj6fbk"))))
+ (build-system trivial-build-system)
+ (inputs
+ `(("bash" ,bash) ;for the wrapped program
+ ("perl" ,perl)
+ ("perl-www-mechanize" ,perl-www-mechanize)
+ ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
+ ;; Required or else LWP will fail with "GET https://www.google.com/ ==>
+ ;; 500 Can't verify SSL peers without knowing which Certificate
+ ;; Authorities to trust".
+ ("perl-mozilla-ca" ,perl-mozilla-ca)))
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder (begin
+ (use-modules (guix build utils)
+ (ice-9 match)
+ (srfi srfi-26))
+ (let* ((source (assoc-ref %build-inputs "source"))
+ (output (assoc-ref %outputs "out")))
+ (setenv "PATH"
+ (string-append
+ (assoc-ref %build-inputs "bash") "/bin" ":"
+ (assoc-ref %build-inputs "perl") "/bin" ":"))
+ (copy-recursively source (getcwd))
+ (patch-shebang "clyrics")
+ (substitute* "clyrics"
+ (("/usr/share") output))
+ (install-file "clyrics" (string-append output "/bin"))
+ (wrap-program (string-append output "/bin/clyrics")
+ `("PERL5LIB" ":" =
+ ,(delete
+ ""
+ (map (match-lambda
+ (((? (cut string-prefix? "perl-" <>) name) . dir)
+ (string-append dir "/lib/perl5/site_perl"))
+ (_ ""))
+ %build-inputs))))
+ (copy-recursively "plugins" (string-append output "/clyrics"))
+ #t))))
+ (home-page "https://github.com/trizen/clyrics")
+ (synopsis "Extensible lyrics fetcher")
+ (description
+ "Clyrics is an extensible command-line tool to fetch the lyrics of songs.
+It can be used in daemon mode along with the Music-on-Console (MOC) and cmus
+console music players.")
+ (license license:gpl3+)))
+
+(define-public demlo
+ (let ((commit "fe9ec4c8ac2fa995ec18e6ac86d50d46df06ec01")
+ (revision "0"))
+ (package
+ (name "demlo")
+ (version (git-version "3.8" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url
+ "https://gitlab.com/ambrevar/demlo")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1afkbqhzn6da7zaf5ab7dvyqj1izqhzprwfb4hw448fllda9bdvk"))))
+ (build-system go-build-system)
+ (native-inputs
+ `(("lua" ,lua)
+ ("go-github-com-mattn-go-isatty" ,go-github-com-mattn-go-isatty)
+ ("go-github-com-mattn-go-colorable" ,go-github-com-mattn-go-colorable)
+ ("go-github-com-aarzilli-golua" ,go-github-com-aarzilli-golua)
+ ("go-gitlab-com-ambrevar-damerau" ,go-gitlab-com-ambrevar-damerau)
+ ("go-gitlab-com-ambrevar-golua-unicode" ,go-gitlab-com-ambrevar-golua-unicode)
+ ("go-github-com-mgutz-ansi" ,go-github-com-mgutz-ansi)
+ ("go-github-com-michiwend-gomusicbrainz" ,go-github-com-michiwend-gomusicbrainz)
+ ("go-github-com-stevedonovan-luar" ,go-github-com-stevedonovan-luar)
+ ("go-github-com-wtolson-go-taglib" ,go-github-com-wtolson-go-taglib)
+ ("go-github-com-yookoala-realpath" ,go-github-com-yookoala-realpath)))
+ (inputs
+ `(("chromaprint" ,chromaprint)
+ ("ffmpeg" ,ffmpeg)))
+ (arguments
+ `(#:import-path "gitlab.com/ambrevar/demlo"
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'wrap-program
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (ffmpeg (assoc-ref inputs "ffmpeg"))
+ (chromaprint (assoc-ref inputs "chromaprint")))
+ (wrap-program (string-append out "/bin/demlo")
+ `("XDG_DATA_DIRS" ":" prefix (,out))
+ `("PATH" ":" prefix
+ ,(map (lambda (dir)
+ (string-append dir "/bin:"
+ dir "/sbin"))
+ (list ffmpeg chromaprint))))
+ #t)))
+ (add-after 'install-source 'install-scripts
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (root (string-append out "/src/gitlab.com/ambrevar/demlo"))
+ (xdg-data-dirs (string-append out "/demlo")))
+ (copy-recursively (string-append root "/actions")
+ (string-append xdg-data-dirs "/actions"))
+ (copy-recursively (string-append root "/scripts")
+ (string-append xdg-data-dirs "/scripts"))
+ (install-file (string-append root "/config.lua") xdg-data-dirs)
+ ;; TODO: Test fish completion.
+ (install-file (string-append root "/completion/demlo.fish")
+ (string-append out "/share/fish/vendor_completions.d"))
+ #t))))))
+ (home-page "https://gitlab.com/ambrevar/demlo")
+ (synopsis "Dynamic and extensible music library organizer")
+ (description "Demlo is a music library organizer. It can encode, fix
+case, change folder hierarchy according to tags or file properties, tag from
+an online database, copy covers while ignoring duplicates or those below a
+quality threshold, and much more. It makes it possible to manage your
+libraries uniformly and dynamically. You can write your own rules to fit your
+needs best.
+
+Demlo can address any of these recurring music library issues (and much more):
+
+@itemize
+@item Fix the lack of folder structure.
+@item Normalize tags, fix their case, chose which tags to keep and which to
+discard.
+@item Handle lossy and lossless audio differently.
+@item Handle mp3 id3tags hell...
+@item Handle multiple covers, whether embedded and/or external, resize covers,
+discard bad quality ones.
+@end itemize\n")
+ (license license:expat))))
+
+(define-public lpd8editor
+ (package
+ (name "lpd8editor")
+ (version "0.0.12")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/charlesfleche/lpd8editor.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1v3fz8h1zs7kkl80faah79pp6yqwz0j7bkv3dbmh2hp42zbfiz1q"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'setenv
+ (lambda _
+ (setenv "INSTALL_PREFIX"
+ (assoc-ref %outputs "out"))))
+ (delete 'configure) ; no configure script
+ (add-before 'build 'qmake
+ (lambda _ (invoke "qmake"))))))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("alsa" ,alsa-lib)
+ ("qtbase" ,qtbase)
+ ("qtsvg" ,qtsvg)))
+ (synopsis "Graphical editor for the Akai LPD8 MIDI controller")
+ (description "lpd8editor is a graphical patch editor for the Akai LPD8 MIDI
+controller.")
+ (home-page "https://github.com/charlesfleche/lpd8editor")
+ (license license:expat)))