From ad1fa2ba9213cc5ce7923d2e49e38c4e9313890b Mon Sep 17 00:00:00 2001 From: Markus Himmel Date: Wed, 14 Jan 2015 19:51:18 +0000 Subject: [PATCH] LPairs: Move config to user settings directory --- games-puzzle/lpairs/lpairs-1.0.4.recipe | 5 +- .../lpairs/patches/lpairs-1.0.4.patch | 11 --- .../lpairs/patches/lpairs-1.0.4.patchset | 73 +++++++++++++++++++ 3 files changed, 77 insertions(+), 12 deletions(-) delete mode 100644 games-puzzle/lpairs/patches/lpairs-1.0.4.patch create mode 100644 games-puzzle/lpairs/patches/lpairs-1.0.4.patchset diff --git a/games-puzzle/lpairs/lpairs-1.0.4.recipe b/games-puzzle/lpairs/lpairs-1.0.4.recipe index 137eeec41..cd69887de 100644 --- a/games-puzzle/lpairs/lpairs-1.0.4.recipe +++ b/games-puzzle/lpairs/lpairs-1.0.4.recipe @@ -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 } diff --git a/games-puzzle/lpairs/patches/lpairs-1.0.4.patch b/games-puzzle/lpairs/patches/lpairs-1.0.4.patch deleted file mode 100644 index c9f820fbf..000000000 --- a/games-puzzle/lpairs/patches/lpairs-1.0.4.patch +++ /dev/null @@ -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. diff --git a/games-puzzle/lpairs/patches/lpairs-1.0.4.patchset b/games-puzzle/lpairs/patches/lpairs-1.0.4.patchset new file mode 100644 index 000000000..967dab056 --- /dev/null +++ b/games-puzzle/lpairs/patches/lpairs-1.0.4.patchset @@ -0,0 +1,73 @@ +From 62c097ba3a2dc90d55c7064ca9c28094354a7eb4 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +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 +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 ++#include ++#endif ++ + #include + #include + #include +@@ -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 +