guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: gnu: Add instead.


From: guix-commits
Subject: 01/03: gnu: Add instead.
Date: Wed, 4 Aug 2021 09:46:10 -0400 (EDT)

leoprikler pushed a commit to branch master
in repository guix.

commit 2e0ddc74f6641ec1e286f7f81eaf5bf6644eed52
Author: Dmitry Polyakov <polyakov@liltechdude.xyz>
AuthorDate: Wed Aug 4 17:29:12 2021 +0500

    gnu: Add instead.
    
    * gnu/packages/game-development.scm (instead): New variable.
    * gnu/packages/patches/instead-use-games-path.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Register it here.
---
 gnu/local.mk                                      |  2 +
 gnu/packages/game-development.scm                 | 51 +++++++++++++++++++++++
 gnu/packages/patches/instead-use-games-path.patch | 32 ++++++++++++++
 3 files changed, 85 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index e6a2f73..82e5fbc 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..dbe5ac6 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,56 @@ 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"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           (delete-file-recursively "src/zlib")))))
+    (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
+     `(("gtk+",gtk+)
+       ("lua" ,lua)
+       ("luajit" ,luajit)
+       ("pkg-config" ,pkg-config)
+       ("sdl2-images" ,sdl2-image)
+       ("sdl2-ttf" ,sdl2-ttf)
+       ("sdl2-mixer" ,sdl2-mixer)
+       ("zlib" ,zlib)))
+    (home-page "https://instead3.syscall.ru/";)
+    (synopsis "Text adventure interpreter")
+    (description "The STEAD (Simple TExt ADventures) interpreter provides
+functionality to play games that mix elements of visual novels, interactive
+fiction and classic point-and-click adventures.")
+    (native-search-paths
+     (list (search-path-specification
+            (variable "INSTEAD_GAMES_PATH")
+            (separator #f)                        ;single entry
+            (files '("share/instead/games")))))
+    (license license:expat)))
+
 (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..783fd21
--- /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] Add support for INSTEAD_GAMES_PATH
+
+In some setups, users might prefer to determine on their own the path in
+which games are located.  This patch enables them to do so by setting
+the “INSTEAD_GAMES_PATH” environmnent variable.
+---
+ 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
+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]