diff mbox series

[bug#40364] gnu: Add gnome-chess

Message ID 20200401040053.9054-1-jackhill@jackhill.us
State Accepted
Delegated to: Christopher Baines
Headers show
Series [bug#40364] gnu: Add gnome-chess | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Jack Hill April 1, 2020, 4 a.m. UTC
* gnu/packages/games.scm (gnome-chess): New variable.
---
 gnu/packages/games.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

Comments

Christopher Baines April 1, 2020, 7:36 a.m. UTC | #1
Jack Hill <jackhill@jackhill.us> writes:

> * gnu/packages/games.scm (gnome-chess): New variable.
> ---
>  gnu/packages/games.scm | 40 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 40 insertions(+)

Thanks for the patch Jack!

> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
> index e818b851f4..dbc9e899b8 100644
> --- a/gnu/packages/games.scm
> +++ b/gnu/packages/games.scm
> @@ -49,6 +49,7 @@
>  ;;; Copyright © 2020 Alberto Eleuterio Flores Guerrero <barbanegra+guix@posteo.mx>
>  ;;; Copyright © 2020 Naga Malleswari <nagamalli@riseup.net>
>  ;;; Copyright © 2020 Vitaliy Shatrov <D0dyBo0D0dyBo0@protonmail.com>
> +;;; Copyright © 2020 Jack Hill <jackhill@jackhill.us>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -1095,6 +1096,45 @@ destroying an ancient book using a special wand.")
>      ;; license.  The whole package is released under GPLv3+.
>      (license license:gpl3+)))
>
> +(define-public gnome-chess
> +  (package
> +    (name "gnome-chess")
> +    (version "3.36.0")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "mirror://gnome/sources/" name "/"
> +                                  (version-major+minor version)  "/"
> +                                  name "-" version ".tar.xz"))
> +              (sha256
> +               (base32
> +                "1a9fgi749gy1f60vbcyrqqkab9vqs42hji70q73k1xx8rv0agmg0"))))
> +    (build-system meson-build-system)
> +    (arguments
> +     '(#:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'skip-gtk-update-icon-cache
> +           ;; Don't create 'icon-theme.cache'.
> +           (lambda _
> +             (substitute* "meson_post_install.py"
> +               (("gtk-update-icon-cache") "true"))
> +             #t))))

It would be good to wrap gnome-chess to include it's own share directory
in the XDG_DATA_DIRS environment variable. Without that, I can't just
run it [1], but when I set that variable correctly [2], it works :)

1:
→ /gnu/store/jv8jpq23iic13j7zdl8mdc30vcv508wh-gnome-chess-3.36.0/bin/gnome-chess

(gnome-chess:10039): GLib-GIO-ERROR **: 08:31:52.482: Settings schema 'org.gnome.Chess' is not installed
Trace/breakpoint trap

2:
→ XDG_DATA_DIRS="$XDG_DATA_DIRS:/gnu/store/jv8jpq23iic13j7zdl8mdc30vcv508wh-gnome-chess-3.36.0/share" /gnu/store/jv8jpq23iic13j7zdl8mdc30vcv508wh-gnome-chess-3.36.0/bin/gnome-chess


This wrapping is something that would automatically be done through the
glib-or-gtk-build-system, but maybe not automatically through the meson
build system.

> +    (inputs
> +     `(("gtk+" ,gtk+)
> +       ("librsvg" ,librsvg)))
> +    (native-inputs
> +     `(("gettext" ,gettext-minimal)
> +       ("glib:bin" ,glib "bin") ; for desktop-file-validate and appstream-util
> +       ("itstool" ,itstool)
> +       ("pkg-config" ,pkg-config)
> +       ("vala" ,vala)))
> +    (home-page "https://wiki.gnome.org/Apps/Chess")
> +    (synopsis "Chess board for GNOME")
> +    (description "GNOME Chess provides a 2D board for playing chess games
> +against human or computer players.  It supports loading and saving games in
> +Portable Game Notation.  To play against a computer, install a chess engine
> +such as chess or stockfish.")
> +    (license license:gpl3+)))
> +
>  (define-public gnubg
>    (package
>      (name "gnubg")

Apart from the wrapping I mentioned above, this looks good to me :)

Thanks,

Chris
Nicolas Goaziou April 1, 2020, 8:27 a.m. UTC | #2
Hello,

Christopher Baines <mail@cbaines.net> writes:

> This wrapping is something that would automatically be done through the
> glib-or-gtk-build-system, but maybe not automatically through the meson
> build system.

I think the meson build system has a #:glib-or-gtk? parameter to do
that.

Regards,
diff mbox series

Patch

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index e818b851f4..dbc9e899b8 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -49,6 +49,7 @@ 
 ;;; Copyright © 2020 Alberto Eleuterio Flores Guerrero <barbanegra+guix@posteo.mx>
 ;;; Copyright © 2020 Naga Malleswari <nagamalli@riseup.net>
 ;;; Copyright © 2020 Vitaliy Shatrov <D0dyBo0D0dyBo0@protonmail.com>
+;;; Copyright © 2020 Jack Hill <jackhill@jackhill.us>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1095,6 +1096,45 @@  destroying an ancient book using a special wand.")
     ;; license.  The whole package is released under GPLv3+.
     (license license:gpl3+)))
 
+(define-public gnome-chess
+  (package
+    (name "gnome-chess")
+    (version "3.36.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://gnome/sources/" name "/"
+                                  (version-major+minor version)  "/"
+                                  name "-" version ".tar.xz"))
+              (sha256
+               (base32
+                "1a9fgi749gy1f60vbcyrqqkab9vqs42hji70q73k1xx8rv0agmg0"))))
+    (build-system meson-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'skip-gtk-update-icon-cache
+           ;; Don't create 'icon-theme.cache'.
+           (lambda _
+             (substitute* "meson_post_install.py"
+               (("gtk-update-icon-cache") "true"))
+             #t)))))
+    (inputs
+     `(("gtk+" ,gtk+)
+       ("librsvg" ,librsvg)))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("glib:bin" ,glib "bin") ; for desktop-file-validate and appstream-util
+       ("itstool" ,itstool)
+       ("pkg-config" ,pkg-config)
+       ("vala" ,vala)))
+    (home-page "https://wiki.gnome.org/Apps/Chess")
+    (synopsis "Chess board for GNOME")
+    (description "GNOME Chess provides a 2D board for playing chess games
+against human or computer players.  It supports loading and saving games in
+Portable Game Notation.  To play against a computer, install a chess engine
+such as chess or stockfish.")
+    (license license:gpl3+)))
+
 (define-public gnubg
   (package
     (name "gnubg")