[PATCH] gnu: Add gnome-chess

  • Done
  • quality assurance status badge
Details
3 participants
  • Jack Hill
  • Christopher Baines
  • Nicolas Goaziou
Owner
unassigned
Submitted by
Jack Hill
Severity
normal
J
J
Jack Hill wrote on 1 Apr 2020 06:00
(address . guix-patches@gnu.org)(name . Jack Hill)(address . jackhill@jackhill.us)
20200401040053.9054-1-jackhill@jackhill.us
* gnu/packages/games.scm (gnome-chess): New variable.
---
gnu/packages/games.scm | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)

Toggle diff (60 lines)
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")
--
2.25.1
C
C
Christopher Baines wrote on 1 Apr 2020 09:36
87d08rac9f.fsf@cbaines.net
Jack Hill <jackhill@jackhill.us> writes:

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

Thanks for the patch Jack!

Toggle quote (39 lines)
> 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.

Toggle quote (21 lines)
> + (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
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl6ERGxfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XebnhAAi6jfjYnmQMdiFj+3FzA/LGtztdrIXjSiOWCRra/uiGatBTIQ1sbFc12h
Bt0tjAACn77C0kdIVO+MHvqXbHGC3v4mnvSQny373+TTIa8QsLNHRBXdxImI7y2N
3FiEjMOfklHPPTrHQAsGzWrMbw1Xbr1vTx3dD8uv6mzyGt8MxNy8FGy9RG4a3KqU
QpCWbBeRaVvERH1O+YZwTUDSHqbJ5TiP+x960INc06HaDN50E2peLOXDE5BjajRR
5QkXYUXDNdMlWdg9o8GMfFjhuFRH8Am1cQFFav+Ubyw/2Gf/apC0cRRxfQIKW8hs
NJt3d+fvxBVvUx2r4M/szaQcAJDdEohUqC5nnaocQAb8owhO6bV5DtdvNRJBbsaw
1IF9GzVomEUK0l6LPp1PzHRCT158kbg7DfBnqHGiLJp4UgBx4AqW5/e1y1kd8g4y
eVgykmctl4TdATqIDaahCxxz9vsYZFFyRlW+3s/esWe4D23k3hCyX+s9DL2U8/GL
kldiEQXLcOzU/o7yHXqHWwkhDSkldxpRqf1fq/JXeNc+Rw72cjpzs9FWFl3xnChW
vMtW83pYw4VG5FWi4D9+ByYpFB31r2bPagvOzv/zeF/MvA+YIGh+bLZj9RcFu6uM
xRddvtRJKfxDapPLyYH3QQmGarNs4DH4rUt37g725V/dzRlrKVk=
=UGxl
-----END PGP SIGNATURE-----

N
N
Nicolas Goaziou wrote on 1 Apr 2020 10:27
(name . Christopher Baines)(address . mail@cbaines.net)
874ku34nlm.fsf@nicolasgoaziou.fr
Hello,

Christopher Baines <mail@cbaines.net> writes:

Toggle quote (4 lines)
> 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,

--
Nicolas Goaziou
J
J
Jack Hill wrote on 1 Apr 2020 16:32
[PATCH v2] gnu: Add gnome-chess
(address . 40364@debbugs.gnu.org)
20200401143207.13357-1-jackhill@jackhill.us
* gnu/packages/games.scm (gnome-chess): New variable.
---

Thanks for the review and suggestion. I've added the #glib-or-gtk? #t
argument, and it looks like the wrapping happens correctly.

gnu/packages/games.scm | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)

Toggle diff (61 lines)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index e818b851f4..8a24dad33d 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,46 @@ 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
+ '(#:glib-or-gtk? #t
+ #: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")
--
2.25.1
C
C
Christopher Baines wrote on 1 Apr 2020 19:30
(name . Jack Hill)(address . jackhill@jackhill.us)
878sjf9kr3.fsf@cbaines.net
Jack Hill <jackhill@jackhill.us> writes:

Toggle quote (6 lines)
> * gnu/packages/games.scm (gnome-chess): New variable.
> ---
>
> Thanks for the review and suggestion. I've added the #glib-or-gtk? #t
> argument, and it looks like the wrapping happens correctly.

Great, I've pushed this as 63406c0bfd0d016098ef593dcc8bfc412df36bea.

Thanks for the patch!
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl6Ez7BfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XeK+hAAg2NTcsMGaWlizxQkZH5v6POqY/c+CzaLG4BvwO+nMnYmUkKEzlezzxOq
nObWDLFOrU9e2QbXq1wHTucksKc6IP8hDPAHx890xiGDr10RvsMRwngU94tg4c3+
taqxoOTQnbhx4UzvCLtYmTInLw4sAdVDWgZ4fsBujskYQn7pg6f4hmzUuycKPd80
QNkvCOZdhu3w2PKesW6328y6C9CB6h0idIv+vqaUpxj3n4phEJE+wUIobRqPu2GE
l44Sz/xg3YPQuL4fzjs1gqh8lsHCFl7+nLerQPYaNdht8p9yXpBOc0D5oPX3KxMQ
rZ1mmJFKkLgnQ+kocwoKnETx5dfw+rFRktMgC3HbIgjJvcOOmJF3lnGYCAJsTtLc
PTp+BvDgpdW3rfRpHPjn6LAn5jELJsAJIcjWhtt54s0gCyxbEfX/fHaA3aEqtx5V
A1UcKyWzPSeuQ1oaj4sOQIddhl4U0x/v2W+TUEjdAYpc+IkNlMp/O5JJh3EXdvx5
P4w42LGCuGtXrNpMAY8esNs2mkpc9umXPY+MzstFzorGsBUZFlevbAhqI5X/XUqM
MpJs2yblzixbPAmR86S3zorQc2Hbu2DhwNXZ5ee0DvlCMJCzq6KPsm116bc4uZUe
tb0R1XSfVp9TzQHzuApjsUwWL6qi6X6a7dV1/HyHq7GegeP9qUg=
=n4QM
-----END PGP SIGNATURE-----

Closed
?