unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies
@ 2019-08-08 20:02 Christopher Baines
  2019-08-08 20:23 ` [bug#36978] [PATCH 1/3] gnu: Add fifechan Christopher Baines
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Christopher Baines @ 2019-08-08 20:02 UTC (permalink / raw)
  To: 36978

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

This patch series adds the Unknown Horizons game, and a couple of it's
dependencies.


Christopher Baines (3):
  gnu: Add fifechan.
  gnu: Add fifengine.
  gnu: Add unknown-horizons.

 gnu/packages/games.scm | 127 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 127 insertions(+)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

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

* [bug#36978] [PATCH 1/3] gnu: Add fifechan.
  2019-08-08 20:02 [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies Christopher Baines
@ 2019-08-08 20:23 ` Christopher Baines
  2019-08-08 20:23   ` [bug#36978] [PATCH 2/3] gnu: Add fifengine Christopher Baines
  2019-08-08 20:23   ` [bug#36978] [PATCH 3/3] gnu: Add unknown-horizons Christopher Baines
  2019-08-23 21:09 ` [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies Ludovic Courtès
  2019-10-08 18:38 ` bug#36978: " Christopher Baines
  2 siblings, 2 replies; 14+ messages in thread
From: Christopher Baines @ 2019-08-08 20:23 UTC (permalink / raw)
  To: 36978

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

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 92df556970..8ee0ef94b3 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -2033,6 +2033,33 @@ 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))
+    (home-page "https://fifengine.github.io/fifechan/")
+    (synopsis "Cross platform GUI library designed 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 fizmo
   (package
     (name "fizmo")
-- 
2.22.0

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

* [bug#36978] [PATCH 2/3] gnu: Add fifengine.
  2019-08-08 20:23 ` [bug#36978] [PATCH 1/3] gnu: Add fifechan Christopher Baines
@ 2019-08-08 20:23   ` Christopher Baines
  2019-08-08 20:23   ` [bug#36978] [PATCH 3/3] gnu: Add unknown-horizons Christopher Baines
  1 sibling, 0 replies; 14+ messages in thread
From: Christopher Baines @ 2019-08-08 20:23 UTC (permalink / raw)
  To: 36978

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

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 8ee0ef94b3..f05efdd8a5 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -2060,6 +2060,52 @@ 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
+       #: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"))))
+    (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)))
+    (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")
-- 
2.22.0

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

* [bug#36978] [PATCH 3/3] gnu: Add unknown-horizons.
  2019-08-08 20:23 ` [bug#36978] [PATCH 1/3] gnu: Add fifechan Christopher Baines
  2019-08-08 20:23   ` [bug#36978] [PATCH 2/3] gnu: Add fifengine Christopher Baines
@ 2019-08-08 20:23   ` Christopher Baines
  1 sibling, 0 replies; 14+ messages in thread
From: Christopher Baines @ 2019-08-08 20:23 UTC (permalink / raw)
  To: 36978

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

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index f05efdd8a5..fa6b1f689b 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -2265,6 +2265,60 @@ 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
+     '(#:tests? #f
+       #: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)))))
+    (inputs
+     `(("fifengine" ,fifengine)
+       ("python:tk" ,python "tk")
+       ("python-pillow" ,python-pillow)
+       ("python-pyyaml" ,python-pyyaml)))
+    (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")
-- 
2.22.0

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

* [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies
  2019-08-08 20:02 [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies Christopher Baines
  2019-08-08 20:23 ` [bug#36978] [PATCH 1/3] gnu: Add fifechan Christopher Baines
@ 2019-08-23 21:09 ` Ludovic Courtès
  2019-08-25  6:09   ` Arun Isaac
  2019-10-08 18:38 ` bug#36978: " Christopher Baines
  2 siblings, 1 reply; 14+ messages in thread
From: Ludovic Courtès @ 2019-08-23 21:09 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 36978

Hi Chris,

Christopher Baines <mail@cbaines.net> skribis:

> This patch series adds the Unknown Horizons game, and a couple of it's
> dependencies.

Looks all good to me!  :-)

Ludo’.

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

* [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies
  2019-08-23 21:09 ` [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies Ludovic Courtès
@ 2019-08-25  6:09   ` Arun Isaac
  2019-08-26 11:17     ` Arun Isaac
                       ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Arun Isaac @ 2019-08-25  6:09 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 36978

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]


>> This patch series adds the Unknown Horizons game, and a couple of it's
>> dependencies.
>
> Looks all good to me!  :-)

fifengine and unknown-horizons do have tests, though. Could you try
packaging them?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies
  2019-08-25  6:09   ` Arun Isaac
@ 2019-08-26 11:17     ` Arun Isaac
  2019-09-01 13:02       ` Ludovic Courtès
  2019-10-06 18:18     ` [bug#36978] [PATCH v2 1/3] gnu: Add fifechan Christopher Baines
  2019-10-06 18:20     ` [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies Christopher Baines
  2 siblings, 1 reply; 14+ messages in thread
From: Arun Isaac @ 2019-08-26 11:17 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 36978


[-- Attachment #1.1: Type: text/plain, Size: 235 bytes --]


> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-fifechan.patch --]
[-- Type: text/x-patch, Size: 2560 bytes --]

From 8e0dc413770628873ca2bcca4b1127f1fc4de4fb Mon Sep 17 00:00:00 2001
From: Arun Isaac <arunisaac@systemreboot.net>
Date: Mon, 26 Aug 2019 16:40:28 +0530
Subject: [PATCH 1/3] gnu: Add fifechan.

* gnu/packages/game-development.scm (fifechan): New variable.
---
 gnu/packages/game-development.scm | 35 +++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 7eac935a69..6debaccb85 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -80,6 +80,7 @@
   #:use-module (gnu packages qt)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages stb)
+  #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
@@ -1539,3 +1540,37 @@ projects.")
 hardware from multiple vendors without requiring that applications have
 specific knowledge of the hardware they are targeting.")
     (license license:bsd-3)))
+
+(define-public fifechan
+  (package
+    (name "fifechan")
+    (version "0.1.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/fifengine/fifechan")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0hd34b9crs2hv0rxmvhn0m73q9ss4rxj2vq6ba2x01vqy1hrjfcg"))))
+    (build-system cmake-build-system)
+    (inputs
+     `(("sdl2-image" ,sdl2-image)))
+    (arguments
+     `(#:tests? #f))
+    (home-page "https://fifengine.github.io/fifechan/")
+    (synopsis "Lightweight 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 small yet powerful built in
+set of extendable GUI Widgets allowing users to create virtually unlimited
+types of widgets.  Fifechan supports rendering in SDL, OpenGL, or Allegro out
+of the box or it can be adapted to use any rendering engine the user requires.
+Events are pushed to Fifechan which allows users to use any input library they
+wish or they could use the built in input handling through either SDL input or
+Allegro input.  The primary goal for Fifechan is to keep it extendable,
+lightweight and still be powerful enough to use in all types of games out of
+the box.")
+    ;; FIXME: incorrect
+    (license license:lgpl2.1+)))
-- 
2.22.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0002-gnu-Add-fifengine.patch --]
[-- Type: text/x-patch, Size: 3444 bytes --]

From 1772e12b871aca615652e0e13bda2b11324c472f Mon Sep 17 00:00:00 2001
From: Arun Isaac <arunisaac@systemreboot.net>
Date: Mon, 26 Aug 2019 16:40:59 +0530
Subject: [PATCH 2/3] gnu: Add fifengine.

* gnu/packages/game-development.scm (fifengine): New variable.
---
 gnu/packages/game-development.scm | 65 +++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 6debaccb85..808d3d3ade 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1574,3 +1574,68 @@ lightweight and still be powerful enough to use in all types of games out of
 the box.")
     ;; FIXME: incorrect
     (license license:lgpl2.1+)))
+
+(define-public fifengine
+  (package
+    (name "fifengine")
+    (version "0.4.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/fifengine/fifengine")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0vi84daj8jmhqq9lhsc3qjbmp0r2askzlzr1iv1iwn8i2qircil4"))))
+    (build-system cmake-build-system)
+    (inputs
+     `(("boost" ,boost)
+       ("fifechan" ,fifechan)
+       ("glew" ,glew)
+       ("libvorbis" ,libvorbis)
+       ("openal" ,openal)
+       ("python" ,python)
+       ("sdl-union" ,(sdl-union (list sdl2 sdl2-image sdl2-ttf)))
+       ("tinyxml" ,tinyxml)))
+    (native-inputs
+     `(("python" ,python)
+       ("swig" ,swig)
+       ("xvfb" ,xorg-server)))
+    (arguments
+     `(#:configure-flags
+       (list (string-append "-DOPENALSOFT_INCLUDE_DIR="
+                            (assoc-ref %build-inputs "openal") "/include")
+             (string-append "-DPYTHON_SITE_PACKAGES="
+                            %output "/lib/python3.7/site-packages")
+             "-Dbuild-library=ON")
+       #:phases
+       (modify-phases %standard-phases
+         ;; Run tests after installation so that we can make use of the built
+         ;; python modules.
+         (delete 'check)
+         (add-after 'install 'check
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Set PYTHONPATH so that python finds the installed modules.
+             (setenv "PYTHONPATH"
+                     (string-append (getenv "PYTHONPATH") ":"
+                                    (assoc-ref outputs "out")
+                                    "/lib/python3.7/site-packages"))
+             ;; The tests require an X server.
+             (system "Xvfb :1 &")
+             (setenv "DISPLAY" ":1")
+             (setenv "XDG_RUNTIME_DIR" "/tmp")
+             ;; Run tests
+             (chdir "../source")
+             (invoke "python3" "run_tests.py" "-a"))))))
+    (home-page "https://www.fifengine.net/")
+    (synopsis "Cross platform game engine")
+    (description "FIFE is a cross-platform game engine.  It features
+hardware-accelerated 2D graphics, integrated GUI, audio support, lighting, map
+editor supporting top-down and isometric maps, pathfinding, virtual filesystem
+and more.  Games utilizing FIFE are programmed through Python scripting layer
+on top of the base C++ API.  Games can be also programmed using the C++ layer
+directly.")
+    ;; FIXME: incorrect license
+    (license license:lgpl2.1+)))
-- 
2.22.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.4: 0003-gnu-Add-unknown-horizons.patch --]
[-- Type: text/x-patch, Size: 3427 bytes --]

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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies
  2019-08-26 11:17     ` Arun Isaac
@ 2019-09-01 13:02       ` Ludovic Courtès
  0 siblings, 0 replies; 14+ messages in thread
From: Ludovic Courtès @ 2019-09-01 13:02 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 36978

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’.

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

* [bug#36978] [PATCH v2 1/3] gnu: Add fifechan.
  2019-08-25  6:09   ` Arun Isaac
  2019-08-26 11:17     ` Arun Isaac
@ 2019-10-06 18:18     ` Christopher Baines
  2019-10-06 18:18       ` [bug#36978] [PATCH v2 2/3] gnu: Add fifengine Christopher Baines
  2019-10-06 18:18       ` [bug#36978] [PATCH v2 3/3] gnu: Add unknown-horizons Christopher Baines
  2019-10-06 18:20     ` [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies Christopher Baines
  2 siblings, 2 replies; 14+ messages in thread
From: Christopher Baines @ 2019-10-06 18:18 UTC (permalink / raw)
  To: 36978

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

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index c0d8ce9c71..ebd21fb501 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -2027,6 +2027,33 @@ 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 fizmo
   (package
     (name "fizmo")
-- 
2.23.0

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

* [bug#36978] [PATCH v2 2/3] gnu: Add fifengine.
  2019-10-06 18:18     ` [bug#36978] [PATCH v2 1/3] gnu: Add fifechan Christopher Baines
@ 2019-10-06 18:18       ` Christopher Baines
  2019-10-06 18:18       ` [bug#36978] [PATCH v2 3/3] gnu: Add unknown-horizons Christopher Baines
  1 sibling, 0 replies; 14+ messages in thread
From: Christopher Baines @ 2019-10-06 18:18 UTC (permalink / raw)
  To: 36978

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

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index ebd21fb501..0ebf262126 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -2054,6 +2054,99 @@ 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")
-- 
2.23.0

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

* [bug#36978] [PATCH v2 3/3] gnu: Add unknown-horizons.
  2019-10-06 18:18     ` [bug#36978] [PATCH v2 1/3] gnu: Add fifechan Christopher Baines
  2019-10-06 18:18       ` [bug#36978] [PATCH v2 2/3] gnu: Add fifengine Christopher Baines
@ 2019-10-06 18:18       ` Christopher Baines
  1 sibling, 0 replies; 14+ messages in thread
From: Christopher Baines @ 2019-10-06 18:18 UTC (permalink / raw)
  To: 36978

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

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 0ebf262126..055ba216a3 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -2306,6 +2306,79 @@ 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
+     '(#:tests? #f
+       #: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")
-- 
2.23.0

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

* [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies
  2019-08-25  6:09   ` Arun Isaac
  2019-08-26 11:17     ` Arun Isaac
  2019-10-06 18:18     ` [bug#36978] [PATCH v2 1/3] gnu: Add fifechan Christopher Baines
@ 2019-10-06 18:20     ` Christopher Baines
  2019-10-07 21:19       ` Arun Isaac
  2 siblings, 1 reply; 14+ messages in thread
From: Christopher Baines @ 2019-10-06 18:20 UTC (permalink / raw)
  To: Arun Isaac; +Cc: Ludovic Courtès, 36978

[-- Attachment #1: Type: text/plain, Size: 627 bytes --]


Arun Isaac <arunisaac@systemreboot.net> writes:

>>> This patch series adds the Unknown Horizons game, and a couple of it's
>>> dependencies.
>>
>> Looks all good to me!  :-)
>
> fifengine and unknown-horizons do have tests, though. Could you try
> packaging them?

Thanks for taking a look Arun. I've finally got around to looking at
this again.

Thanks for sending over your patches, I've gone through them and tried
to merge the two sets of patches together.

The unknown-horizons tests seem fine, but the fifengine tests don't all
seem to run, so I've left them disabled. I don't really get what the
test runner is doing.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

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

* [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies
  2019-10-06 18:20     ` [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies Christopher Baines
@ 2019-10-07 21:19       ` Arun Isaac
  0 siblings, 0 replies; 14+ messages in thread
From: Arun Isaac @ 2019-10-07 21:19 UTC (permalink / raw)
  To: Christopher Baines; +Cc: Ludovic Courtès, 36978

[-- Attachment #1: Type: text/plain, Size: 350 bytes --]


> The unknown-horizons tests seem fine, but the fifengine tests don't all
> seem to run, so I've left them disabled. I don't really get what the
> test runner is doing.

Neither did I manage to completely figure out the fifengine tests. Hence
my incomplete patches. Please feel free to push without the tests or
with any other appropriate comments.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* bug#36978: [PATCH 0/3] Add Unknown Horizons and dependencies
  2019-08-08 20:02 [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies Christopher Baines
  2019-08-08 20:23 ` [bug#36978] [PATCH 1/3] gnu: Add fifechan Christopher Baines
  2019-08-23 21:09 ` [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies Ludovic Courtès
@ 2019-10-08 18:38 ` Christopher Baines
  2 siblings, 0 replies; 14+ messages in thread
From: Christopher Baines @ 2019-10-08 18:38 UTC (permalink / raw)
  To: 36978-done

[-- Attachment #1: Type: text/plain, Size: 560 bytes --]


Arun Isaac <arunisaac@systemreboot.net> writes:

>> The unknown-horizons tests seem fine, but the fifengine tests don't all
>> seem to run, so I've left them disabled. I don't really get what the
>> test runner is doing.
>
> Neither did I manage to completely figure out the fifengine tests. Hence
> my incomplete patches. Please feel free to push without the tests or
> with any other appropriate comments.

Ok, cool. I've pushed the patches now as
a1c1943b7c49dfb6aef9a98b2cbce0d31cbed08b.

Now I just need to work out how to play the game!

Thanks,

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

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

end of thread, other threads:[~2019-10-08 18:39 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-08 20:02 [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies Christopher Baines
2019-08-08 20:23 ` [bug#36978] [PATCH 1/3] gnu: Add fifechan Christopher Baines
2019-08-08 20:23   ` [bug#36978] [PATCH 2/3] gnu: Add fifengine Christopher Baines
2019-08-08 20:23   ` [bug#36978] [PATCH 3/3] gnu: Add unknown-horizons Christopher Baines
2019-08-23 21:09 ` [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies Ludovic Courtès
2019-08-25  6:09   ` Arun Isaac
2019-08-26 11:17     ` Arun Isaac
2019-09-01 13:02       ` Ludovic Courtès
2019-10-06 18:18     ` [bug#36978] [PATCH v2 1/3] gnu: Add fifechan Christopher Baines
2019-10-06 18:18       ` [bug#36978] [PATCH v2 2/3] gnu: Add fifengine Christopher Baines
2019-10-06 18:18       ` [bug#36978] [PATCH v2 3/3] gnu: Add unknown-horizons Christopher Baines
2019-10-06 18:20     ` [bug#36978] [PATCH 0/3] Add Unknown Horizons and dependencies Christopher Baines
2019-10-07 21:19       ` Arun Isaac
2019-10-08 18:38 ` bug#36978: " Christopher Baines

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).