diff options
author | Shea Levy <shea@shealevy.com> | 2011-12-21 18:18:15 +0000 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2011-12-21 18:18:15 +0000 |
commit | f821677f67d00c2e8a3b1c9347185f20fe043e94 (patch) | |
tree | a79aef931b549f6ebbb6545979cfd746845e99a9 /pkgs/games/beret | |
parent | e1a96b2b88fae1d9f9eadcfb11950701be1fb430 (diff) |
beret: Store game status in home directory
svn path=/nixpkgs/trunk/; revision=31021
Diffstat (limited to 'pkgs/games/beret')
-rw-r--r-- | pkgs/games/beret/default.nix | 4 | ||||
-rw-r--r-- | pkgs/games/beret/use-home-dir.patch | 48 |
2 files changed, 51 insertions, 1 deletions
diff --git a/pkgs/games/beret/default.nix b/pkgs/games/beret/default.nix index dd6fc9be71e6..e41e88fc1b06 100644 --- a/pkgs/games/beret/default.nix +++ b/pkgs/games/beret/default.nix @@ -9,7 +9,9 @@ stdenv.mkDerivation { NIX_CFLAGS_LINK = "-lgcc_s"; - patchPhase = '' + patches = [ ./use-home-dir.patch ]; + + postPatch = '' sed -i 's@RESOURCE_PATH ""@RESOURCE_PATH "'$out'/share/"@' game.c ''; diff --git a/pkgs/games/beret/use-home-dir.patch b/pkgs/games/beret/use-home-dir.patch new file mode 100644 index 000000000000..c8597a0303b8 --- /dev/null +++ b/pkgs/games/beret/use-home-dir.patch @@ -0,0 +1,48 @@ +diff -Naur beret-beret-orig/game.c beret-beret/game.c +--- beret-beret-orig/game.c 2011-12-17 18:51:32.000000000 -0500 ++++ beret-beret/game.c 2011-12-21 13:16:37.047511020 -0500 +@@ -10,12 +10,10 @@ + #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+-#ifdef __APPLE__
+ #include <sys/stat.h>
+ #include <unistd.h>
+ #include <errno.h>
+ #include <pwd.h>
+-#endif
+
+ #define CAMSCROLL 15
+ #define SCR_WIDTH 780
+@@ -88,12 +86,8 @@ + #define DIRSEP "/"
+ #endif
+
+-#ifdef __APPLE__
+-#define SUPPORT_PATH "Library/Application Support/Beret/"
+-#define RESOURCE_PATH "Beret.app/Contents/Resources/"
+-#else
++#define SUPPORT_PATH ".beret"
+ #define RESOURCE_PATH ""
+-#endif
+
+ #define QUITMOD_WIN KMOD_ALT
+ #define QUITKEY_WIN SDLK_F4
+@@ -812,7 +806,6 @@ +
+ int init() {
+
+- #ifdef __APPLE__
+ char filestr[512];
+ // Get the home directory of the user.
+ struct passwd *pwd = getpwuid(getuid());
+@@ -827,9 +820,6 @@ + sprintf(filestr, "%s/saves", support_path);
+ mkdir(filestr, S_IRWXU);
+ }
+- #else
+- sprintf(support_path, "");
+- #endif
+
+ if (SDL_Init(SDL_INIT_EVERYTHING) == -1) {
+ printf("Error: couldn't initialize SDL\n");
|