(define-module (crn packages erlang-xyz) #:use-module (gnu packages) #:use-module (gnu packages erlang) #:use-module (gnu packages erlang-xyz) #:use-module (guix build-system rebar) #:use-module (guix download) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix utils)) (define-public reading-heap (package (name "reading-heap") (version "0.1.2") (source (origin (method git-fetch) (uri (git-reference (url "https://codeberg.org/languidnights/reading_heap") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1inn3sgk0c9wavpslf1qk0xlsf8zqp67azlq544x1i48mpmbdsh1")))) (build-system rebar-build-system) (inputs (list erlang-cowboy erlang-ranch erlang-cowlib)) (arguments (list #:phases #~(modify-phases %standard-phases (add-after 'unpack 'set-environment (lambda* (#:key inputs #:allow-other-keys) (let ((ranch (assoc-ref inputs "erlang-ranch")) (cowboy (assoc-ref inputs "erlang-cowboy")) (cowlib (assoc-ref inputs "erlang-cowlib"))) (setenv "ERL_LIBS" (string-append ranch "/lib/erlang/lib:" cowboy "/lib/erlang/lib:" cowlib "/lib/erlang/lib"))))) (add-before 'build 'build-more (lambda _ (invoke "rebar3" "release" "--include-erts" "false"))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let* ((reading-heap "_build/default/rel/reading_heap") (out (assoc-ref outputs "out"))) (copy-recursively reading-heap out) (install-file "config/vm.args" (string-append out "/releases/" #$version "/")))))))) (synopsis "Media Queue Manager") (description "Manage your media consumption queue with erlang and heaps") (home-page "https://codeberg.org/languidnights/reading_heap") (license license:agpl3)))