unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Nicolas Graves <ngraves@ngraves.fr>, 58140@debbugs.gnu.org
Subject: [bug#58140] [PATCH 2/6] gnu: Add kaldi-for-vosk.
Date: Wed, 28 Sep 2022 23:05:26 +0200	[thread overview]
Message-ID: <0bc80789-0841-abb4-01ba-8e994a594cea@telenet.be> (raw)
In-Reply-To: <20220928115755.6292-2-ngraves@ngraves.fr>


[-- Attachment #1.1.1: Type: text/plain, Size: 3375 bytes --]

 >+            (add-after 'unpack 'chdir
 >+              (lambda _ (chdir "src") #t))

Trailing #t haven't been required since a long time.

On 28-09-2022 13:57, Nicolas Graves via Guix-patches via wrote:
> +                (when (not (or (string-prefix? "x86_64" system)
> +                               (string-prefix? "i686" system)))
> +                  (substitute* "makefiles/linux_openblas.mk"
> +                    (("-msse -msse2") "")))

You are testing for the system it is being compiled on ('system'), not 
the system it is being compiled for ('target').  For cross-compilation, 
usually the latter is required.  You may find
#$@(if (target-x86?) #~((substitute* ...) #~())
useful, it automatically handles cross-compilation, both 32-bit and 
64-bit, a hypothetical i786 it it ever starts existing, i586 if we ever 
lower the requirements ...

> +                     (string-append "OPENBLASROOT=\"" #$openblas "\""))

#$PACKAGE does not compose with --with-input.  I recommend doing 
something like
(dirname (dirname (search-input-file inputs "lib/libblas.so")))
instead.  Likewise for other uses of #$PACKAGE.

> +                  (setenv "OPENFST_VER" #$(package-version openfst))

I recommend referring to 'openfst' with 'this-package-input', that way 
when --with-input or --with-latest is used to change it to something 
with a different version, the version should still be detetcxed properly.

> +                (substitute* "./Makefile"
> +                  (("USE_SHARED\\?=0")
> +                   "USE_SHARED?=1")

IIUC, ?=0 means that 0 is the default, you can override it by setting 
#:make-flags.

> dialects - English, 

I think one of the special dashes (en dashes, em dashes, figure dash? 
Don't know which one) would be appropriate here.

> +(define-public python-nerd-dictation
> +  (let* ((commit "53ab129a5ee0f8b5df284e8cf2229219b732c59e")
> +         (revision "0"))
> +    (package
> +      (name "python-nerd-dictation")
> +      (version (git-version "0" revision commit))

Going by <https://github.com/ideasman42/nerd-dictation>, 'python-' is 
not part of its name, you can drop the prefix AFAICT.

> +      (synopsis "Offline speech-to-text for desktop Linux")

If it's Linux only, you can use the 'supported-systems' field for that, 
see (gnu packages linux) for examples.

> +                        #$(file-append bash-minimal "/bin/bash")

You can use 'search-input-file' to avoid depending on input labels.

> +          (let* ((out (assoc-ref %outputs "out"))

If you are using G-exps, you can replace (assoc-ref %outputs "out") with 
its G-exp equivalent #$output.

> +(define openfst-for-vosk
> +  (package
> +    (inherit openfst)
> +    (version "1.8.0")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "http://www.openfst.org/twiki/pub/FST/"
> +                           "FstDownload/openfst-" version ".tar.gz"))
> +       (sha256
> +        (base32 "0h2lfhhihg63b804hrcljnkggijbjmp84i5g8q735wb09y9z2c4p"))))

Why select an older version?  Would keeping the original (and more 
up-to-date) version work?  To avoid a name conflict between the openfst 
(which would be inconvenient for "guix show", "guix install", "guix 
shell"), you can override the 'name' field.

Greetings,
Maxime.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

  reply	other threads:[~2022-09-28 21:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 11:34 [bug#58140] Simple offline text-to-speech incoming ! Nicolas Graves via Guix-patches via
2022-09-28 11:57 ` [bug#58140] [PATCH 1/6] gnu: Add openfst-for-vosk Nicolas Graves via Guix-patches via
2022-09-28 11:57   ` [bug#58140] [PATCH 2/6] gnu: Add kaldi-for-vosk Nicolas Graves via Guix-patches via
2022-09-28 21:05     ` Maxime Devos [this message]
2022-09-29  6:44       ` ( via Guix-patches via
2022-09-29  8:20       ` Nicolas Graves via Guix-patches via
2022-09-29  9:32         ` Maxime Devos
2022-09-28 11:57   ` [bug#58140] [PATCH 3/6] gnu: Add vosk-api Nicolas Graves via Guix-patches via
2022-09-28 11:57   ` [bug#58140] [PATCH 4/6] gnu: Add python-vosk Nicolas Graves via Guix-patches via
2022-09-28 11:57   ` [bug#58140] [PATCH 5/6] gnu: Add python-nerd-dictation Nicolas Graves via Guix-patches via
2022-09-28 11:57   ` [bug#58140] [PATCH 6/6] gnu: Add python-nerd-dictation/wayland Nicolas Graves via Guix-patches via
2022-09-28 17:58 ` [bug#58140] Simple offline text-to-speech incoming ! Denis 'GNUtoo' Carikli
2022-09-28 20:07   ` Nicolas Graves via Guix-patches via
2022-09-28 21:30 ` [bug#58140] [PATCH 6/6 v2] gnu: Add python-nerd-dictation/wayland Nicolas Graves via Guix-patches via
2022-09-28 21:39   ` Maxime Devos
2022-09-29  9:00 ` [bug#58140] [PATCH v3 1/6] gnu: Add openfst-for-vosk Nicolas Graves via Guix-patches via
2022-09-29  9:00   ` [bug#58140] [PATCH v3 2/6] gnu: Add kaldi-for-vosk Nicolas Graves via Guix-patches via
2022-09-29  9:00   ` [bug#58140] [PATCH v3 3/6] gnu: Add vosk-api Nicolas Graves via Guix-patches via
2022-09-29  9:00   ` [bug#58140] [PATCH v3 4/6] gnu: Add python-vosk Nicolas Graves via Guix-patches via
2022-09-29  9:00   ` [bug#58140] [PATCH v3 5/6] gnu: Add python-nerd-dictation Nicolas Graves via Guix-patches via
2022-09-29  9:00   ` [bug#58140] [PATCH v3 6/6] gnu: Add python-nerd-dictation/wayland Nicolas Graves via Guix-patches via
2022-09-29  9:02 ` [bug#58140] [PATCH v4 1/2] gnu: Add nerd-dictation Nicolas Graves via Guix-patches via
2022-09-29  9:02   ` [bug#58140] [PATCH v4 2/2] gnu: Add nerd-dictation/wayland Nicolas Graves via Guix-patches via
2022-10-17  8:46     ` bug#58140: Simple offline text-to-speech incoming ! Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0bc80789-0841-abb4-01ba-8e994a594cea@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=58140@debbugs.gnu.org \
    --cc=ngraves@ngraves.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).