unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: polyakov@liltechdude.xyz
To: 46378@debbugs.gnu.org
Cc: Dmitry Polyakov <polyakov@liltechdude.xyz>,
	leo.prikler@student.tugraz.at
Subject: [bug#46378] [PATCH] gnu: Add instead.
Date: Wed,  4 Aug 2021 17:29:12 +0500	[thread overview]
Message-ID: <20210804122912.20268-1-polyakov@liltechdude.xyz> (raw)
In-Reply-To: <87o8gv58h0.fsf@liltechdude.xyz>

From: Dmitry Polyakov <polyakov@liltechdude.xyz>

* gnu/local.mk (dist_patch_DATA):
  Register the patch.

* gnu/packages/patches/instead-use-games-path.patch:
  New file.
---
 gnu/local.mk                                  |  2 +
 gnu/packages/game-development.scm             | 52 +++++++++++++++++++
 .../patches/instead-use-games-path.patch      | 32 ++++++++++++
 3 files changed, 86 insertions(+)
 create mode 100644 gnu/packages/patches/instead-use-games-path.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index e849480..0c45ae5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -43,6 +43,7 @@
 # Copyright © 2021 Philip McGrath <philip@philipmcgrath.com>
 # Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
 # Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
+# Copyright © 2021 Dmitry Polyakov <polyakov@liltechdude.xyz>
 #
 # This file is part of GNU Guix.
 #
@@ -1261,6 +1262,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/imagemagick-WriteTHUMBNAILImage-fix.patch	\
   %D%/packages/patches/inetutils-hurd.patch			\
   %D%/packages/patches/inkscape-poppler-0.76.patch		\
+  %D%/packages/patches/instead-use-games-path.patch		\
   %D%/packages/patches/inkscape-1.1-fix-build-witch-gcc7.5.patch	\
   %D%/packages/patches/intel-xed-fix-nondeterminism.patch	\
   %D%/packages/patches/intltool-perl-compatibility.patch	\
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index e1593c0..4164b20 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -21,6 +21,7 @@
 ;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;; Copyright © 2021 Alexandru-Sergiu Marton <brown121407@posteo.ro>
+;;; Copyright © 2021 Dmitry Polyakov <polyakov@liltechdude.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2115,6 +2116,57 @@ upon which people base their games, ports to new platforms, and other
 projects.")
       (license license:gpl2))))
 
+(define-public instead
+  (package
+    (name "instead")
+    (version "3.3.5")
+    (build-system cmake-build-system)
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/instead-hub/instead")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "02j8cw623j51qmr4991i5hsbrzmnp0qfzds8m6nwwr15sjv3hv1g"))
+       (patches
+        (search-patches
+         "instead-use-games-path.patch"))))
+    (arguments
+     '(#:configure-flags
+       (list (string-append
+              "-DLUA_INCLUDE_DIR="
+              (assoc-ref %build-inputs "luajit") "/include/luajit-2.1/")
+             "-DWITH_LUAJIT=1"
+             "-DWITH_GTK3=1")
+       #:tests? #f))
+    (inputs
+     `(("sdl2-images" ,sdl2-image)
+       ("sdl2-ttf" ,sdl2-ttf)
+       ("lua" ,lua)
+       ("pkg-config" ,pkg-config)
+       ("sdl2-mixer" ,sdl2-mixer)
+       ("luajit" ,luajit)
+       ("gtk+",gtk+)))
+    (home-page "https://instead3.syscall.ru/")
+    (synopsis "Text adventure interpreter")
+    (description "The STEAD (Simple TExt ADventures) interpreter provide
+functionality to play games that combine visual novels, text adventures
+and classic quests of 1990-s.  STEAD games feature:
+@enumerate
+@item Very simple source code of the stories. (based on LUA)
+@item Graphical game interface
+@item Supports music and images
+@item Theme support - a game may change the interface look
+@end enumerate")
+    (license license:gpl2)
+    (native-search-paths
+     (list (search-path-specification
+            (variable "INSTEAD_GAMES_PATH")
+            (separator #f)                        ;single entry
+            (files '("share/instead/games")))))))
+
 (define-public openvr
   (package
     (name "openvr")
diff --git a/gnu/packages/patches/instead-use-games-path.patch b/gnu/packages/patches/instead-use-games-path.patch
new file mode 100644
index 0000000..52e96ed
--- /dev/null
+++ b/gnu/packages/patches/instead-use-games-path.patch
@@ -0,0 +1,32 @@
+From 8b350daa847dd8e131d9e6b5b4434ce68a7903d0 Mon Sep 17 00:00:00 2001
+From: Dmitry Polyakov <polyakov@liltechdude.xyz>
+Date: Wed, 4 Aug 2021 15:46:33 +0500
+Subject: [PATCH] [PATCH] Add support for INSTEAD_GAMES_PATH
+
+In certain cases, the user needs to determinate by himself where the
+games will be stored. Using an environment variable is the most common
+way to provide the user with this capability.
+---
+ src/main.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/main.c b/src/main.c
+index ba0ada1d..b05497b8 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -394,6 +394,12 @@ int instead_main(int argc, char *argv[])
+ 	setdir(game_cwd);
+ 	profile_load(NULL);
+ 
++	char *gamespath_env = NULL;
++
++	if (gamespath_env = getenv("INSTEAD_GAMES_PATH"), gamespath_env != NULL) {
++	  games_sw = strdup(gamespath_env);
++	}
++
+ 	for (i = 1; i < argc; i++) {
+ 		if (lua_sw) /* during load profile */
+ 			break;
+-- 
+2.32.0
+
-- 
2.32.0





  parent reply	other threads:[~2021-08-04 12:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08  7:23 [bug#46378] [PATCH] gnu: Add instead Dmitry Polyakov
2021-02-08 12:46 ` Leo Prikler
2021-02-08 13:04   ` Dmitry Polyakov
2021-02-08 14:11 ` polyakov
2021-02-08 15:46   ` Leo Prikler
2021-02-08 17:15     ` Dmitry Polyakov
2021-02-08 17:43       ` Leo Prikler
2021-08-04 12:29 ` polyakov [this message]
2021-08-04 13:50   ` bug#46378: " Leo Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210804122912.20268-1-polyakov@liltechdude.xyz \
    --to=polyakov@liltechdude.xyz \
    --cc=46378@debbugs.gnu.org \
    --cc=leo.prikler@student.tugraz.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).