summary refs log tree commit diff
path: root/gnu/packages/games.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/games.scm')
-rw-r--r--gnu/packages/games.scm192
1 files changed, 192 insertions, 0 deletions
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index c9527ddd44..d68f6aa451 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -2030,6 +2030,126 @@ some of the restrictions in the venerable Z-machine format.  This is the
 reference interpreter, using the Glk API.")
    (license license:expat)))
 
+(define-public fifechan
+  (package
+    (name "fifechan")
+    (version "0.1.5")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://codeload.github.com/fifengine/"
+                                  "fifechan/tar.gz/" version))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0wxs9vz5x9y8chghd8vp7vfk089lfb0qnzggi17zrqkrngs5zgi9"))))
+    (build-system cmake-build-system)
+    (inputs
+     `(("sdl2" ,sdl2)
+       ("sdl2-image" ,sdl2-image)
+       ("mesa" ,mesa)))
+    (arguments
+     '(#:tests? #f))                    ; No included tests
+    (home-page "https://fifengine.github.io/fifechan/")
+    (synopsis "Cross platform GUI library specifically for games")
+    (description
+     "Fifechan is a lightweight cross platform GUI library written in C++
+specifically designed for games.  It has a built in set of extendable GUI
+Widgets, and allows users to create more.")
+    (license license:lgpl2.1+)))
+
+(define-public fifengine
+  (package
+    (name "fifengine")
+    (version "0.4.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://codeload.github.com/fifengine/"
+                                  "fifengine/tar.gz/" version))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1y4grw25cq5iqlg05rnbyxw1njl11ypidnlsm3qy4sm3xxdvb0p8"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f            ; TODO The test running fails to run some tests.
+       #:modules ((srfi srfi-1)
+                  (guix build cmake-build-system)
+                  (guix build utils))
+       #:configure-flags
+       (list
+        (string-append "-DOPENALSOFT_INCLUDE_DIR="
+                       (assoc-ref %build-inputs "openal")
+                       "/include/AL")
+        (string-append "-DPYTHON_SITE_PACKAGES="
+                       (assoc-ref %outputs "out")
+                       "/lib/python3.7/site-packages"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-run_tests.py
+           (lambda _
+             ;; Patch the test runner to exit with a status of 1 if any test
+             ;; fails, to allow detecting failures.
+             (substitute* "run_tests.py"
+               (("ERROR\\. One or more tests failed!'\\)")
+                "ERROR. One or more tests failed!')
+\t\texit(1)"))
+             #t))
+         ;; Run tests after installation so that we can make use of the built
+         ;; python modules.
+         (delete 'check)
+         (add-after 'install 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (define python-version
+               (let* ((version     (last (string-split
+                                          (assoc-ref inputs "python")
+                                          #\-)))
+                      (components  (string-split version #\.))
+                      (major+minor (take components 2)))
+                 (string-join major+minor ".")))
+
+             (when tests?
+               ;; Set PYTHONPATH so that python finds the installed modules.
+               (setenv "PYTHONPATH"
+                       (string-append (getenv "PYTHONPATH") ":"
+                                      (assoc-ref outputs "out")
+                                      "/lib/python"
+                                      python-version
+                                      "/site-packages"))
+               ;; The tests require an X server.
+               (system "Xvfb :1 &")
+               (setenv "DISPLAY" ":1")
+               (setenv "XDG_RUNTIME_DIR" "/tmp")
+               ;; Run tests
+               (chdir ,(string-append "../" name "-" version))
+               (invoke "python3" "run_tests.py" "-a"))
+             #t)))))
+    (inputs
+     `(("sdl2" ,sdl2)
+       ("sdl2-image" ,sdl2-image)
+       ("sdl2-ttf" ,sdl2-ttf)
+       ("tinyxml" ,tinyxml)
+       ("openal" ,openal)
+       ("libogg" ,libogg)
+       ("glew" ,glew)
+       ("libvorbis" ,libvorbis)
+       ("boost" ,boost)
+       ("fifechan" ,fifechan)
+       ("swig" ,swig)
+       ("python" ,python)))
+    (native-inputs
+     `(("python" ,python)
+       ("swig" ,swig)
+       ("xvfb" ,xorg-server)))
+    (propagated-inputs
+     `(("python-future" ,python-future)))
+    (home-page "https://www.fifengine.net/")
+    (synopsis "FIFE is a multi-platform isometric game engine written in C++")
+    (description
+     "@acronym{FIFE, Flexible Isometric Free Engine} is a multi-platform
+isometric game engine.  Python bindings are included allowing users to create
+games using Python as well as C++.")
+    (license license:lgpl2.1+)))
+
 (define-public fizmo
   (package
     (name "fizmo")
@@ -2189,6 +2309,78 @@ against each other or just trying to beat the computer; single-player mode is
 also available.")
     (license license:gpl3+)))
 
+(define-public unknown-horizons
+  (package
+    (name "unknown-horizons")
+    (version "2019.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://codeload.github.com/unknown-horizons/"
+                                  "unknown-horizons/tar.gz/" version))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1n747p7h0qp48szgp262swg0xh8kxy1bw8ag1qczs4i26hyzs5x4"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'set-HOME
+           (lambda _
+             (setenv "HOME" "/tmp")))
+         (add-after 'build 'build-extra
+           (lambda _
+             (invoke "python3" "./setup.py" "build_i18n")
+             (invoke "python3" "horizons/engine/generate_atlases.py" "2048")
+             #t))
+         (add-after 'install 'patch
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (substitute* (string-append out "/bin/unknown-horizons")
+                 (("os\\.chdir\\(get\\_content\\_dir\\_parent_path\\(\\)\\)")
+                  (string-append "os.chdir(\""
+                                 (assoc-ref outputs "out")
+                                 "/share/unknown-horizons\")"))))
+             #t))
+         ;; 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)))))
+    (inputs
+     `(("fifengine" ,fifengine)
+       ("python:tk" ,python "tk")
+       ("python-pillow" ,python-pillow)
+       ("python-pyyaml" ,python-pyyaml)))
+    (native-inputs
+     `(("intltool" ,intltool)
+
+       ;; Required for tests
+       ("python-greenlet" ,python-greenlet)
+       ("python-polib" ,python-polib)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-mock" ,python-pytest-mock)))
+    (home-page "http://unknown-horizons.org/")
+    (synopsis "Isometric realtime strategy, economy and city building simulation")
+    (description
+     "Unknown Horizons is a 2D realtime strategy simulation 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.")
+    (license (list
+              license:gpl2+        ; Covers code
+              license:expat        ; tests/dummy.py, ext/polib.py
+              license:cc-by-sa3.0  ; Covers some media content
+              license:cc-by3.0     ; Covers some media content
+              license:bsd-3))))    ; horizons/ext/speaklater.py
+
 (define-public gnujump
   (package
     (name "gnujump")