From 0419db1882f70ed9838911c5696f1b6169736c72 Mon Sep 17 00:00:00 2001 From: Chloe Brown Date: Fri, 1 Jul 2022 13:52:26 +0100 Subject: Improve patching infrastructure. --- yellowsquid/packages.scm | 16 ++++++++++++++++ yellowsquid/packages/vosk.scm | 10 ++++------ 2 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 yellowsquid/packages.scm diff --git a/yellowsquid/packages.scm b/yellowsquid/packages.scm new file mode 100644 index 0000000..2ac194c --- /dev/null +++ b/yellowsquid/packages.scm @@ -0,0 +1,16 @@ +(define-module (yellowsquid packages) + #:use-module ((gnu packages) :prefix gnu:) + #:use-module (srfi srfi-1) + #:export (search-patches)) + +(define %channel-root + (find (lambda (path) + (file-exists? (string-append path "/yellowsquid/packages.scm"))) + %load-path)) + +(define-syntax-rule (search-patches file-name ...) + (parameterize + ((gnu:%patch-path + (cons (string-append %channel-root "/yellowsquid/packages/patches") + (gnu:%patch-path)))) + (list (gnu:search-patch file-name) ...))) diff --git a/yellowsquid/packages/vosk.scm b/yellowsquid/packages/vosk.scm index 80a224e..b69c507 100644 --- a/yellowsquid/packages/vosk.scm +++ b/yellowsquid/packages/vosk.scm @@ -1,5 +1,4 @@ (define-module (yellowsquid packages vosk) - #:use-module (gnu packages) #:use-module (gnu packages audio) #:use-module (gnu packages libffi) #:use-module (gnu packages machine-learning) @@ -13,7 +12,8 @@ #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) - #:use-module (srfi srfi-26)) + #:use-module (srfi srfi-26) + #:use-module (yellowsquid packages)) (define-public openfst-1.7.2 (package @@ -70,8 +70,7 @@ (base32 "1inmw0wd0zvbz83cwk6x8svwycgxzzd9vd0n12xgjc4ypqlk8fk9")) (patches - (parameterize ((%patch-path (map (cut string-append <> "/yellowsquid/packages/patches") %load-path))) - (search-patches "vosk-makefile.patch"))))) + (search-patches "vosk-makefile.patch")))) (build-system python-build-system) (inputs (list openfst-1.7.2+far+lookahead+ngram kaldi-501de70 @@ -113,8 +112,7 @@ programming languages.") (sha256 (base32 "1lx8lgsqgs8qrss583wcyk7n0hv3xyr7wrwnvxhfjvpjx6jflmmx")) - (patches (parameterize ((%patch-path (map (cut string-append <> "/yellowsquid/packages/patches") %load-path))) - (search-patches "nerd-dictation-setup.patch")) ) + (patches (search-patches "nerd-dictation-setup.patch")) (snippet #~(rename-file "nerd-dictation" "nerd_dictation.py")))) (build-system python-build-system) (arguments -- cgit v1.2.3