Subject: [bug#66601] (@ (gnu packages wm) wlroots): expose "protocol" dir

From: Ludovic Courtès <[email-masked]>
Date: Wed, 22 Nov 2023 15:43:23 +0100

Hi Grigory,

Grigory Shepelev <[email-masked]> skribis:

> I needed to tweak something in Sway and could not find its xml wayland
> protocol files. It was hidden in the package source. Exposed them to the
> build.
> diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
> index 8576d0297d..45ef9cb073 100644
> --- a/gnu/packages/wm.scm
> +++ b/gnu/packages/wm.scm
> @@ -1648,7 +1648,15 @@ (define-public wlroots
>               (substitute* "backend/drm/meson.build"
>                 (("/usr/share/hwdata/pnp.ids")
>                  (string-append (assoc-ref (or native-inputs inputs) "hwdata")
> -                               "/share/hwdata/pnp.ids"))))))))
> +                               "/share/hwdata/pnp.ids")))))
> +         (add-after 'install 'copy-protocols
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (mkdir-p "protocols")
> +             (copy-recursively
> +              "protocol" ;; why singular?!
> +              (string-append (assoc-ref outputs "out")
> +                             "/protocols"))

/protocol(s) is a non-standard directory (should it be
/share/sway/protocols?).

Also, it seems to me that this kind of change belongs upstream.  Could
you check why it’s not there and/or how other distros deal with it?

Thanks,
Ludo’.