From 62c097ba3a2dc90d55c7064ca9c28094354a7eb4 Mon Sep 17 00:00:00 2001
From: Markus Himmel <markus@himmel-villmar.de>
Date: Wed, 14 Jan 2015 19:19:28 +0000
Subject: [PATCH 1/2] applying patch lpairs-1.0.4.patch

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 4dcecb1..a1908af 100755
--- a/configure
+++ b/configure
@@ -13034,7 +13034,7 @@ fi
 localedir=$datadir/locale
 locdir_flag="-DLOCALEDIR=\\\"$localedir\\\""
 
-inst_dir=$datadir/games/lpairs
+inst_dir=$datadir/lpairs
 inst_flag="-DSRC_DIR=\\\"$inst_dir/\\\""
 
 # Check whether --enable-install was given.
-- 
1.8.3.4


From 563cfd6ddafe187d5555f801c539a16bccf960e0 Mon Sep 17 00:00:00 2001
From: Markus Himmel <markus@himmel-villmar.de>
Date: Wed, 14 Jan 2015 19:36:34 +0000
Subject: [PATCH 2/2] Move config to LGames folder in user settings

---
 lpairs/cfg.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lpairs/cfg.c b/lpairs/cfg.c
index 301878a..a786e39 100644
--- a/lpairs/cfg.c
+++ b/lpairs/cfg.c
@@ -15,6 +15,11 @@
  *                                                                         *
  ***************************************************************************/
 
+#ifdef __HAIKU__
+#include <FindDirectory.h>
+#include <fs_info.h>
+#endif
+
 #include <SDL/SDL.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -32,10 +37,18 @@ Cfg cfg;
 */
 void C_StPth(char *p)
 {
+    size_t length;
     memset( c_pth, 0, sizeof( c_pth ) );
     if (p[0] == '~') {
+#ifdef __HAIKU__
+        find_directory(B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false,
+            c_pth, sizeof(c_pth) - 1);
+        length = strlen(c_pth);
+        snprintf(c_pth+length, sizeof(c_pth)-(1+length), "/LGames%s", p+1);
+#else
         snprintf(c_pth, sizeof(c_pth)-1, "%s%s",
             home_dir, p+1);
+#endif
     }
     else
         strncpy(c_pth, p, sizeof(c_pth)-1);
-- 
1.8.3.4

