waypipe works very fine.
guix build --with-configure-flag="jq=CFLAGS=-O3" jq
If you want it to be permanent, then you can use a guix home profile (that's a declarative configuration of your home directory) with a patch function in the package list there: (define llama-tune
(options->transformation `((tune . "znver3")))) ; Zen 3
(home-environment
(packages (list (llama-tune (specification->package "llama")))))
or: (define jq-patch
(options->transformation `((with-configure-flag . "jq=CFLAGS=-O3"))))
[...] (jq-patch (specification->package "jq"))
[...]