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(+)
@@ -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