diff mbox

[bug#36978,0/3] Add Unknown Horizons and dependencies

Message ID cu75zmkkwgb.fsf@systemreboot.net
State Accepted
Headers show

Commit Message

Arun Isaac Aug. 26, 2019, 11:17 a.m. UTC
> fifengine and unknown-horizons do have tests, though. Could you try
> packaging them?

I had some WIP on packaging unknown-horizons and dependencies. I have
attached my unfinished patches. Perhaps that could be of some use to
you.

Comments

Ludovic Courtès Sept. 1, 2019, 1:02 p.m. UTC | #1
Hello Arun,

Arun Isaac <arunisaac@systemreboot.net> skribis:

> I had some WIP on packaging unknown-horizons and dependencies. I have
> attached my unfinished patches. Perhaps that could be of some use to
> you.

Neat!  I think Chris or you should definitely merge both patch sets so
we can go ahead.

Thanks,
Ludo’.
diff mbox

Patch

From cb3f833c38e948d1b45513124a786e81a2f70911 Mon Sep 17 00:00:00 2001
From: Arun Isaac <arunisaac@systemreboot.net>
Date: Mon, 26 Aug 2019 16:41:45 +0530
Subject: [PATCH 3/3] gnu: Add unknown-horizons.

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

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 870becc50b..f49b451bbd 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -7637,3 +7637,70 @@  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 unknown-horizons
+  (package
+    (name "unknown-horizons")
+    (version "2019.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/unknown-horizons/unknown-horizons")
+             (commit version)))
+       (sha256
+        (base32
+         "1khq9ajwi0fmphsjpa024v1px47mcjzvvx2vnrpz1fkis34y83h0"))))
+    (build-system python-build-system)
+    (inputs
+     `(("fifengine" ,fifengine)
+       ("python:tk" ,python "tk")
+       ("python-future" ,python-future)
+       ("python-pyyaml" ,python-pyyaml)))
+    (native-inputs
+     `(("intltool" ,intltool)
+       ;; required during the generate-atlases phase
+       ("python-pillow" ,python-pillow)
+
+       ;; required for tests
+       ("python-greenlet" ,python-greenlet)
+       ("python-polib" ,python-polib)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-mock" ,python-pytest-mock)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "run_uh.py"
+               (("options = \\[\\]")
+                (string-append "options = ['" (assoc-ref outputs "out")
+                               "/share/unknown-horizons']")))
+             #t))
+         (add-before 'build 'set-home
+           (lambda _
+             (setenv "HOME" "/tmp")
+             #t))
+         (add-before 'build 'generate-atlases
+           (lambda _
+             (invoke "python3" "horizons/engine/generate_atlases.py" "2048")))
+         ;; TODO: Run gui tests as well
+         (replace 'check
+           (lambda _
+             (substitute* "horizons/constants.py"
+               (("IS_DEV_VERSION = False")
+                "IS_DEV_VERSION = True"))
+             (invoke "pytest" "tests")
+             (substitute* "horizons/constants.py"
+               (("IS_DEV_VERSION = True")
+                "IS_DEV_VERSION = False"))
+             #t)))))
+    (home-page "http://unknown-horizons.org")
+    (synopsis "2D realtime strategy simulation game")
+    (description "Unknown Horizons is a 2D realtime strategy simulation game
+with an emphasis on economy and city building.  Expand your small settlement
+to a strong and wealthy colony, collect taxes and supply your inhabitants with
+valuable goods.  Increase your power with a well balanced economy and with
+strategic trade and diplomacy.")
+    ;; FIXME: fix license
+    (license license:gpl2)))
-- 
2.22.0