unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#38344] [PATCH] gnu: Add qgo.
@ 2019-11-23 12:56 Guillaume Le Vaillant
  2019-11-24 11:37 ` Guillaume Le Vaillant
  0 siblings, 1 reply; 4+ messages in thread
From: Guillaume Le Vaillant @ 2019-11-23 12:56 UTC (permalink / raw)
  To: 38344; +Cc: Guillaume Le Vaillant

* gnu/packages/games.scm (qgo): New variable.
---
 gnu/packages/games.scm | 71 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 3d825cbe61..e97af7609e 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -7809,3 +7809,74 @@ remake of that series or any other game.")
 the AlphaGo Zero paper.  The current best network weights file for the engine
 can be downloaded from @url{https://zero.sjeng.org/best-network}.")
    (license license:gpl3+)))
+
+(define-public qgo
+  (let ((commit "2a4212d473372bb531fdc5c919a20dd96819f9b0")
+        (revision "0"))
+    (package
+      (name "qgo")
+      (version (git-version "2.1.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/pzorin/qgo.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0v03g0wp9vqzdn6ppxrhvabbz32ww83ipkk7178f8fqhm7ndvsbj"))))
+      (build-system gnu-build-system)
+      (native-inputs
+       `(("qttools" ,qttools)))
+      (inputs
+       `(("gnugo" ,gnugo)
+         ("qtbase" ,qtbase)
+         ("qtmultimedia" ,qtmultimedia)))
+      (arguments
+       `(#:modules ((guix build gnu-build-system)
+                    (guix build qt-utils)
+                    (guix build utils))
+         #:imported-modules (,@%gnu-build-system-modules
+                             (guix build qt-utils))
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'fix-paths
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (substitute* "src/src.pro"
+                 (("= /usr/")
+                  (string-append "= " (assoc-ref outputs "out") "/"))
+                 (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
+                  (string-append (assoc-ref inputs "qttools") "/bin/lrelease")))
+               (substitute* "src/defines.h"
+                 (("/usr/games/")
+                  (string-append (assoc-ref inputs "gnugo") "/bin/"))
+                 (("/usr/share/")
+                  (string-append (assoc-ref outputs "out") "/share/")))
+               (substitute* "src/main.cpp"
+                 (("QCoreApplication::applicationDirPath\\(\\)\\+\"")
+                  (string-append "\"" (assoc-ref outputs "out") "/share/qgo")))
+               #t))
+           (replace 'configure
+             (lambda _
+               (invoke "qmake" "src")))
+           (add-after 'install 'install-translations
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((dest (string-append (assoc-ref outputs "out")
+                                          "/share/qgo/translations")))
+                 (for-each (lambda (file)
+                             (install-file file dest))
+                           (find-files "../source/src/translations/"
+                                       "qgo_.*\\.qm")))
+               #t))
+           (add-after 'install-translations 'wrap-program
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 (wrap-qt-program out "qgo"))
+               #t)))))
+      (synopsis "Qt GUI to play the game of Go")
+      (description
+       "This is a Go client.  It supports playing online at IGS-compatible
+servers and locally against GTP-compliant engines like @code{gnugo}.
+It also has rudimentary support for editing SGF files.")
+      (home-page "https://github.com/pzorin/qgo")
+      (license license:gpl2+))))
-- 
2.24.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-02  9:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-23 12:56 [bug#38344] [PATCH] gnu: Add qgo Guillaume Le Vaillant
2019-11-24 11:37 ` Guillaume Le Vaillant
2019-11-24 15:17   ` [bug#38344] [PATCH v2] gnu: Add q5go Guillaume Le Vaillant
2019-12-02  9:17     ` bug#38344: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).