summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yellowsquid/packages.scm16
-rw-r--r--yellowsquid/packages/vosk.scm10
2 files changed, 20 insertions, 6 deletions
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