[PATCH] gnu: gst-plugins/selection: Make #:configure-flags optional.

OpenSubmitted by Jack Hill.
Details
2 participants
  • Jack Hill
  • Liliana Marie Prikler
Owner
unassigned
Severity
normal
J
J
Jack Hill wrote on 22 Dec 2021 04:34
(address . guix-patches@gnu.org)
20211222033442.14793-1-jackhill@jackhill.us
* gnu/packages/gstreamer.scm (gst-plugins/selection): Provide the empyt list
as a default value for #:configure-flags.
---
gnu/packages/gstreamer.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm
index 87adb7c92a..1f6a56e30d 100644
--- a/gnu/packages/gstreamer.scm
+++ b/gnu/packages/gstreamer.scm
@@ -1034,7 +1034,7 @@ (define-public gst-editing-services
     (license license:gpl2+)))
 
 (define-public gst-plugins/selection
-  (lambda* (pkg #:key plugins configure-flags)
+  (lambda* (pkg #:key plugins (configure-flags '()))
     "Build PKG with only PLUGINS enabled.  Optionally, if CONFIGURE-FLAGS are
 given, also pass them to the build system instead of the ones used by PKG."
     (package/inherit pkg
-- 
2.34.0
L
L
Liliana Marie Prikler wrote on 24 Dec 2021 01:44
c7613fc39eca1b7d4c71db0bc602af857df59502.camel@gmail.com
Hi,

Am Dienstag, dem 21.12.2021 um 22:34 -0500 schrieb Jack Hill:
Toggle quote (2 lines)
> * gnu/packages/gstreamer.scm (gst-plugins/selection): Provide the
> empyt list as a default value for #:configure-flags.
The current implementation ought to copy pre-existing configure-flags
as-is if you don't supply flags on your own. I personally believe
that's preferable over an empty value, that will probably be reset.
WDYT?
J
J
Jack Hill wrote on 24 Dec 2021 06:17
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)(address . 52730@debbugs.gnu.org)
alpine.DEB.2.21.2112240013490.9433@marsh.hcoop.net
On Fri, 24 Dec 2021, Liliana Marie Prikler wrote:

Toggle quote (11 lines)
> Hi,
>
> Am Dienstag, dem 21.12.2021 um 22:34 -0500 schrieb Jack Hill:
>> * gnu/packages/gstreamer.scm (gst-plugins/selection): Provide the
>> empyt list as a default value for #:configure-flags.

> The current implementation ought to copy pre-existing configure-flags
> as-is if you don't supply flags on your own. I personally believe
> that's preferable over an empty value, that will probably be reset.
> WDYT?

Yes, I agree that the current implementation ought to, but it doesn't.
Instead it complains:

"""
ice-9/psyntax.scm:2794:12: In procedure syntax-violation:
Syntax error:
unknown location: quote: bad syntax in form quote
"""

I'll see about a v2.

Thanks!
Jack
J
J
Jack Hill wrote on 24 Dec 2021 07:37
Re: [bug#52730] [PATCH] gnu: gst-plugins/selection: Make #:configure-flags optional.
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
alpine.DEB.2.21.2112240132370.9433@marsh.hcoop.net
On Fri, 24 Dec 2021, Jack Hill wrote:

Toggle quote (26 lines)
>
>
> On Fri, 24 Dec 2021, Liliana Marie Prikler wrote:
>
>> Hi,
>>
>> Am Dienstag, dem 21.12.2021 um 22:34 -0500 schrieb Jack Hill:
>>> * gnu/packages/gstreamer.scm (gst-plugins/selection): Provide the
>>> empyt list as a default value for #:configure-flags.
>
>> The current implementation ought to copy pre-existing configure-flags
>> as-is if you don't supply flags on your own. I personally believe
>> that's preferable over an empty value, that will probably be reset.
>> WDYT?
>
> Yes, I agree that the current implementation ought to, but it doesn't.
> Instead it complains:
>
> """
> ice-9/psyntax.scm:2794:12: In procedure syntax-violation:
> Syntax error:
> unknown location: quote: bad syntax in form quote
> """
>
> I'll see about a v2.

I've looked at it for a little bit now, but I'm afraid that I'm stuck. I
tried setting the default to #f (which may have been happening implicitly
anyway):

```
(define-public gst-plugins/selection
(lambda* (pkg #:key plugins (configure-flags #f))
"Build PKG with only PLUGINS enabled. Optionally, if CONFIGURE-FLAGS are
given, also pass them to the build system instead of the ones used by PKG."
(package/inherit pkg
(arguments
(substitute-keyword-arguments (package-arguments pkg)
((#:configure-flags flags `(,@(or configure-flags '())))
`(append
(list
,@(map (lambda (plugin)
(string-append "-D" plugin "=enabled"))
plugins))
(list ,@(or configure-flags flags))))
((#:phases phases)
`(modify-phases ,phases
(add-after 'unpack 'disable-auto-plugins
(lambda _
(substitute* "meson_options.txt"
(("'auto'") "'disabled'")))))))))))
```

but that still gives me the "bad syntax in form quote" message. I can keep
thinking about it, but if someone else knows the solution, I'd be happy to
learn from you :)

Best,
Jack
L
L
Liliana Marie Prikler wrote on 24 Dec 2021 08:56
(name . Jack Hill)(address . jackhill@jackhill.us)(address . 52730@debbugs.gnu.org)
a4d48c487a9d1572b58bea5c0791d724d2a352a7.camel@gmail.com
Hi Jack,

Am Freitag, dem 24.12.2021 um 01:37 -0500 schrieb Jack Hill:
Toggle quote (5 lines)
> On Fri, 24 Dec 2021, Jack Hill wrote:
>
> I've looked at it for a little bit now, but I'm afraid that I'm
> stuck. I tried setting the default to #f (which may have been
> happening implicitly anyway):
Yes, if you don't supply an optional argument in Guile (or I guess in
Scheme generally), that argument gets #f as value.

Toggle quote (28 lines)
> ```
> (define-public gst-plugins/selection
>    (lambda* (pkg #:key plugins (configure-flags #f))
>      "Build PKG with only PLUGINS enabled.  Optionally, if CONFIGURE-
> FLAGS are
> given, also pass them to the build system instead of the ones used by
> PKG."
>      (package/inherit pkg
>        (arguments
>         (substitute-keyword-arguments (package-arguments pkg)
>           ((#:configure-flags flags `(,@(or configure-flags '())))
>            `(append
>              (list
>               ,@(map (lambda (plugin)
>                        (string-append "-D" plugin "=enabled"))
>                      plugins))
>              (list ,@(or configure-flags flags))))
>            ((#:phases phases)
>             `(modify-phases ,phases
>                (add-after 'unpack 'disable-auto-plugins
>                  (lambda _
>                    (substitute* "meson_options.txt"
>                      (("'auto'") "'disabled'")))))))))))
> ```
>
> but that still gives me the "bad syntax in form quote" message. I can
> keep thinking about it, but if someone else knows the solution, I'd
> be happy to learn from you :)
I swear this used to work before the c-u-f merge. There might be a
problem mixing this with gexps or something I didn't account for back
then.
?