all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 52e96ed81a1b351988076b9288559030e13ae9e3 922 bytes (raw)
name: gnu/packages/patches/instead-use-games-path.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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


debug log:

solving 52e96ed ...
found 52e96ed in https://yhetil.org/guix/20210804122912.20268-1-polyakov@liltechdude.xyz/

applying [1/1] https://yhetil.org/guix/20210804122912.20268-1-polyakov@liltechdude.xyz/
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

1:24: space before tab in indent.
 	setdir(game_cwd);
1:25: space before tab in indent.
 	profile_load(NULL);
1:26: trailing whitespace.
 
1:33: space before tab in indent.
 	for (i = 1; i < argc; i++) {
1:34: space before tab in indent.
 		if (lua_sw) /* during load profile */
Checking patch gnu/packages/patches/instead-use-games-path.patch...
Applied patch gnu/packages/patches/instead-use-games-path.patch cleanly.
warning: squelched 3 whitespace errors
warning: 8 lines add whitespace errors.

index at:
100644 52e96ed81a1b351988076b9288559030e13ae9e3	gnu/packages/patches/instead-use-games-path.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.