diff mbox series

[bug#66654] gnu: Add moonfish.

Message ID 7e8a3994730ad4b020d1f45ae65fac4ff3504b66.1697827234.git.zamfofex@twdb.moe
State New
Headers show
Series [bug#66654] gnu: Add moonfish. | expand

Commit Message

zamfofex Oct. 20, 2023, 6:40 p.m. UTC
* gnu/packages/games.scm (moonfish): New variable.
---
 gnu/packages/games.scm | 50 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)


base-commit: daeeaa221605726d8853b00261619ba039bd6db7
prerequisite-patch-id: fa910eaade316c0f90b10713e330b4a5094cf327
prerequisite-patch-id: 5c50cfc478757944497783ccb53f0bbdaaacedfc
prerequisite-patch-id: 1f0d9d1c7ae75a37170f7a6e3e4e6c3432c49981
prerequisite-patch-id: 17e3c302bf595929a92e1a4ef3be2af6686af253

Comments

Ricardo Wurmus Oct. 27, 2023, 11:52 a.m. UTC | #1
Thanks for your patience and the patch!

I’ve changed the arguments to use G-expressions and pushed the package
with commit c11b9133d29a815d947b556551563c8dc4a68a35.
diff mbox series

Patch

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 4d5b85248a..cd48130f08 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -10409,6 +10409,56 @@  (define-public stockfish
       (home-page "https://stockfishchess.org/")
       (license license:gpl3+))))
 
+(define-public moonfish
+  (let ((commit "69674e88a5393217a724b9390ff3c843bd0fc768")
+        (revision "1"))
+    (package
+      (name "moonfish")
+      (version (git-version "0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://git.sr.ht/~zamfofex/moonfish")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "10hfdjr6qi6ladmgq9h69v3zkarld9kjaav7q3y8w5fakljypjjb"))
+                (file-name (git-file-name name version))))
+      (build-system gnu-build-system)
+      (inputs (list bearssl cjson))
+      (outputs '("out" "tools"))
+      (arguments
+       `(#:make-flags '(,(string-append "CC="
+                                        (cc-for-target)))
+         #:tests? #f ;no check target
+         #:phases (modify-phases %standard-phases
+                    (delete 'configure) ;no configure script
+                    (replace 'install
+                      ;; no 'install' target
+                      (lambda _
+                        (let* ((out (assoc-ref %outputs "out"))
+                               (tools (assoc-ref %outputs "tools"))
+                               (out-bin (string-append out "/bin"))
+                               (tools-bin (string-append tools "/bin"))
+                               (tool (string-append tools-bin "/moonfish-")))
+                          (mkdir-p out-bin)
+                          (mkdir-p tools-bin)
+                          (copy-file "moonfish"
+                                     (string-append out-bin "/moonfish"))
+                          (copy-file "play"
+                                     (string-append tool "play"))
+                          (copy-file "lichess"
+                                     (string-append tool "lichess"))
+                          (copy-file "analyse"
+                                     (string-append tool "analyse"))))))))
+      (home-page "https://git.sr.ht/~zamfofex/moonfish")
+      (synopsis "Simple chess engine written in C")
+      (description
+       "moonfish is a toy UCI chess engine made for fun.  It is inspired by
+sunfish, but is written in C rather than Python.  It also has TUI tools for
+using any UCI engine and also to connect UCI engines to Lichess.")
+      (license license:agpl3+))))
+
 (define-public barrage
   (package
     (name "barrage")