LPairs: Move config to user settings directory

This commit is contained in:
Markus Himmel
2015-01-14 19:51:18 +00:00
parent 31a7d8caa9
commit ad1fa2ba92
3 changed files with 77 additions and 12 deletions

View File

@@ -10,7 +10,7 @@ LICENSE="GNU GPL v2"
COPYRIGHT="2001 Michael Speck"
ARCHITECTURES="x86_gcc2 ?x86 ?x86_64"
PATCHES="lpairs-1.0.4.patch"
PATCHES="lpairs-1.0.4.patchset"
PROVIDES="
lpairs = $portVersion
@@ -46,5 +46,8 @@ INSTALL()
{
make install
rm -rf $dataDir/applications
rm -rf $dataDir/icons
addAppDeskbarSymlink $binDir/lpairs LPairs
}

View File

@@ -1,11 +0,0 @@
--- lpairs-1.0.4/configure.org 2014-08-25 20:17:46.978059264 +0200
+++ lpairs-1.0.4/configure 2014-08-25 20:13:42.108265472 +0200
@@ -13034,7 +13034,7 @@
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.

View File

@@ -0,0 +1,73 @@
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