From 8d7fbabad03573307485ca89d87af41bf75056b4 Mon Sep 17 00:00:00 2001 From: hashirama Date: Sun, 30 Jun 2024 19:37:10 -0400 Subject: [PATCH] fix impd by spacecadet --- ajatt/packages/audio.scm | 67 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 3 deletions(-) diff --git a/ajatt/packages/audio.scm b/ajatt/packages/audio.scm index c7979ec..6c09e9d 100644 --- a/ajatt/packages/audio.scm +++ b/ajatt/packages/audio.scm @@ -2,9 +2,14 @@ #:use-module (gnu packages video) #:use-module (guix build-system copy) #:use-module (guix git-download) + #:use-module (gnu packages) #:use-module (guix download) #:use-module (guix packages) #:use-module (guix gexp) + #:use-module (guix build-system gnu) + #:use-module (gnu packages pcre) + #:use-module (gnu packages perl) + #:use-module (guix search-paths) #:use-module ((guix licenses) #:prefix license:)) @@ -28,6 +33,52 @@ (license license:gpl3))) + +(define-public grep + (package + (name "grep") + (version "3.8") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/grep/grep-" + version ".tar.xz")) + (sha256 + (base32 + "10n3mc9n1xmg85hpxyr4wiqzfp27ffxzwhvkv021j27vnk0pr3a9")) + (patches (search-patches "grep-timing-sensitive-test.patch")))) + (build-system gnu-build-system) + (native-inputs (list perl)) ;some of the tests require it + (inputs (list pcre2)) + (arguments + `(#:configure-flags + (list "--enable-perl-regexp") + #:phases + (modify-phases %standard-phases + (add-after 'install 'fix-egrep-and-fgrep + ;; Patch 'egrep' and 'fgrep' to execute 'grep' via its + ;; absolute file name instead of searching for it in $PATH. + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (substitute* (list (string-append bin "/egrep") + (string-append bin "/fgrep")) + (("^exec grep") + (string-append "exec " bin "/grep")))))) + ))) + (synopsis "Print lines matching a pattern") + (description + "grep is a tool for finding text inside files. Text is found by +matching a pattern provided by the user in one or many files. The pattern +may be provided as a basic or extended regular expression, or as fixed +strings. By default, the matching text is simply printed to the screen, +however the output can be greatly customized to include, for example, line +numbers. GNU grep offers many extensions over the standard utility, +including, for example, recursive directory searching.") + (license license:gpl3+) + (home-page "https://www.gnu.org/software/grep/"))) + + + (define-public impd (package (name "impd") @@ -44,12 +95,22 @@ (build-system copy-build-system) (arguments (list #:install-plan - #~'(("impd" "bin/")))) - (inputs (list ffmpeg)) + #~'(("impd" "bin/")) + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'make-wrapper + (lambda* (#:key inputs outputs #:allow-other-keys) + (wrap-program (string-append (assoc-ref outputs "out") "/bin/impd") + `("PATH" ":" prefix + (,(string-append (assoc-ref inputs "grep") + "/bin"))))))))) + (inputs (list grep)) + ;; (propagated-inputs (list ffmpeg)) ;; TODO fix this, since we need ffmpeg at runtime (home-page "https://github.com/Ajatt-Tools/impd") (synopsis "AJATT-style passive listening and condensed audio without bloat.") (description "AJATT-style passive listening and condensed audio without bloat.") (license license:gpl3))) -navidrome-bin + +impd