diff --git a/games-puzzle/lbreakout2/lbreakout2-2.6.4.recipe b/games-puzzle/lbreakout2/lbreakout2-2.6.4.recipe index 515ed45e6..faca43760 100644 --- a/games-puzzle/lbreakout2/lbreakout2-2.6.4.recipe +++ b/games-puzzle/lbreakout2/lbreakout2-2.6.4.recipe @@ -14,8 +14,7 @@ LICENSE="GNU GPL v2" COPYRIGHT="2001-2011 Michael Speck" ARCHITECTURES="x86_gcc2 ?x86 ?x86_64" -PATCHES="lbreakout2-2.6.4.patch" -GLOBAL_WRITABLE_FILES="var/lbreakout2.hscr keep-old" +PATCHES="lbreakout2-2.6.4.patchset" PROVIDES=" lbreakout2 = $portVersion @@ -58,5 +57,10 @@ BUILD() INSTALL() { make install + + rm $localStateDir/lbreakout2.hscr + rm -rf $dataDir/applications + rm -rf $dataDir/icons + addAppDeskbarSymlink $binDir/lbreakout2 LBreakout2 } diff --git a/games-puzzle/lbreakout2/patches/lbreakout2-2.6.4.patch b/games-puzzle/lbreakout2/patches/lbreakout2-2.6.4.patch deleted file mode 100644 index 796ec586a..000000000 --- a/games-puzzle/lbreakout2/patches/lbreakout2-2.6.4.patch +++ /dev/null @@ -1,107 +0,0 @@ ---- lbreakout2-2.6.4/configure.orig 2012-06-19 21:49:30.000000000 +0200 -+++ lbreakout2-2.6.4/configure 2014-07-13 22:23:51.202375168 +0200 -@@ -11392,7 +11392,7 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lm $LIBS" -+LIBS=" $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF -@@ -11446,7 +11446,7 @@ - #define HAVE_LIBM 1 - _ACEOF - -- LIBS="-lm $LIBS" -+ LIBS=" $LIBS" - - else - { { echo "$as_me:$LINENO: error: lib math is needed" >&5 - ---- lbreakout2-2.6.4/client/chart.c.org 2014-08-23 14:15:06.036700160 +0200 -+++ lbreakout2-2.6.4/client/chart.c 2014-08-23 14:11:54.634650624 +0200 -@@ -213,6 +213,7 @@ - } - printf( _("Saving highscore chart in: %s\n"), chart_path ); - /* compute size and position stuff of highscore */ -+ { - char *cheader = _("Name Level Score"); - chart_pos.w = stk_font_string_width( ccfont, cheader ); - chart_pos.h = ccfont->height + chart_gap + /* title + gap */ -@@ -220,6 +221,7 @@ - chart_gap + /*gap between caption and entries */ - ccfont->height; /* caption size */ - chart_level_offset = stk_font_string_width( ccfont, _("name.-----") ) + stk_font_string_width( ccfont, _("Level") ) / 2; /* level offset centered */ -+ } - } - /* - ==================================================================== -@@ -344,6 +346,7 @@ - chart->name ); - /* caption */ - ccfont->align = STK_FONT_ALIGN_LEFT | STK_FONT_ALIGN_TOP; -+ { - char *cheader = _("Name Level Score"); - stk_font_write( ccfont, stk_display, - chart_pos.x, chart_pos.y + ccfont->height + chart_gap, -1, -@@ -370,6 +373,7 @@ - chart_pos.x + chart_pos.w, entry_offset, -1, number_buffer ); - /* change offset */ - entry_offset += font->height; -+ } - } - stk_display_store_rect( &chart_pos ); - } -@@ -389,6 +393,7 @@ - - /* caption */ - ccfont->align = STK_FONT_ALIGN_LEFT | STK_FONT_ALIGN_TOP; -+ { - char *cheader = _("Name Level Score"); - stk_font_write( ccfont, stk_display, px, py, -1, cheader ); - -@@ -416,6 +421,7 @@ - /* change offset */ - entry_offset += font->height - 1; - } -+ } - { SDL_Rect region = { x, y, w, h }; - stk_display_store_rect( ®ion ); } - } ---- /dev/null 2014-09-02 10:55:51.858924000 +0200 -+++ lbreakout2-2.6.4/LBreakout2.rdef 2014-09-02 09:38:25.879230976 +0200 -@@ -0,0 +1,33 @@ -+resource app_signature "application/x-vnd-lbreakout"; -+ -+resource app_flags B_SINGLE_LAUNCH; -+ -+resource app_version { -+ major = 2, -+ middle = 6, -+ minor = 4, -+ -+ /* 0 = development 1 = alpha 2 = beta -+ 3 = gamma 4 = golden master 5 = final */ -+ variety = 5, -+ -+ internal = 0, -+ -+ short_info = "LBreakout2 arcade game.", -+ long_info = "LBreakout2 is a fun breakout-style arcade game." -+}; -+ -+resource vector_icon { -+ $"6E63696605020106023D5738B7D6E13769AC3CF83249ADC94642AAFFA5040400" -+ $"FF9E9E02000205B6B6DB3925EEBD5FCABAE8BF4A54944AC9EB00846C1BFF34B6" -+ $"9627FF77DBCD5CF983C9C088FFFE6A5716FF020106023B7084B697593638963A" -+ $"F2BB4202AB49ECC600AAD2A5F440503F050001010000850502044C24C62E24C2" -+ $"E124442C44B62144B96E4C34C2E134C62E34542C54B96E54B6210604AF303937" -+ $"3C2B3A2948243E2D4A48584E450204B6C93AB8A73AB4EA3AB365C0BFB365BEE0" -+ $"B365C29DB6C94BB4EA4BB8A74B32C0BF32C29D32BEE006033E402E5037423A50" -+ $"374438493B3F330606BE0F3039233D27352242294822452948445654574E5C5B" -+ $"504E4555474642090A0401042028220A0301041001178500040A020102024000" -+ $"000000000000003FC3C3400000BDC3C30A010101000A02010202404DAB000000" -+ $"000000404DAB4A26D645D13D0A000100000A0301001001178100040A03010300" -+ $"0A030103023EC27B0000000000003EC27B46388E46B10D" -+}; diff --git a/games-puzzle/lbreakout2/patches/lbreakout2-2.6.4.patchset b/games-puzzle/lbreakout2/patches/lbreakout2-2.6.4.patchset new file mode 100644 index 000000000..02dd8bc98 --- /dev/null +++ b/games-puzzle/lbreakout2/patches/lbreakout2-2.6.4.patchset @@ -0,0 +1,601 @@ +From 4bb650564a24ec9d6915684c3370caa293bdd002 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Mon, 12 Jan 2015 18:11:27 +0000 +Subject: [PATCH 1/3] applying patch lbreakout2-2.6.4.patch + +--- + LBreakout2.rdef | 33 +++++++++++++++++++++++++++++++++ + client/chart.c | 6 ++++++ + configure | 4 ++-- + 3 files changed, 41 insertions(+), 2 deletions(-) + create mode 100644 LBreakout2.rdef + +diff --git a/LBreakout2.rdef b/LBreakout2.rdef +new file mode 100644 +index 0000000..6b165ae +--- /dev/null ++++ b/LBreakout2.rdef +@@ -0,0 +1,33 @@ ++resource app_signature "application/x-vnd-lbreakout"; ++ ++resource app_flags B_SINGLE_LAUNCH; ++ ++resource app_version { ++ major = 2, ++ middle = 6, ++ minor = 4, ++ ++ /* 0 = development 1 = alpha 2 = beta ++ 3 = gamma 4 = golden master 5 = final */ ++ variety = 5, ++ ++ internal = 0, ++ ++ short_info = "LBreakout2 arcade game.", ++ long_info = "LBreakout2 is a fun breakout-style arcade game." ++}; ++ ++resource vector_icon { ++ $"6E63696605020106023D5738B7D6E13769AC3CF83249ADC94642AAFFA5040400" ++ $"FF9E9E02000205B6B6DB3925EEBD5FCABAE8BF4A54944AC9EB00846C1BFF34B6" ++ $"9627FF77DBCD5CF983C9C088FFFE6A5716FF020106023B7084B697593638963A" ++ $"F2BB4202AB49ECC600AAD2A5F440503F050001010000850502044C24C62E24C2" ++ $"E124442C44B62144B96E4C34C2E134C62E34542C54B96E54B6210604AF303937" ++ $"3C2B3A2948243E2D4A48584E450204B6C93AB8A73AB4EA3AB365C0BFB365BEE0" ++ $"B365C29DB6C94BB4EA4BB8A74B32C0BF32C29D32BEE006033E402E5037423A50" ++ $"374438493B3F330606BE0F3039233D27352242294822452948445654574E5C5B" ++ $"504E4555474642090A0401042028220A0301041001178500040A020102024000" ++ $"000000000000003FC3C3400000BDC3C30A010101000A02010202404DAB000000" ++ $"000000404DAB4A26D645D13D0A000100000A0301001001178100040A03010300" ++ $"0A030103023EC27B0000000000003EC27B46388E46B10D" ++}; +diff --git a/client/chart.c b/client/chart.c +index 68e9f44..8fbd8c6 100644 +--- a/client/chart.c ++++ b/client/chart.c +@@ -213,6 +213,7 @@ void chart_load() + } + printf( _("Saving highscore chart in: %s\n"), chart_path ); + /* compute size and position stuff of highscore */ ++ { + char *cheader = _("Name Level Score"); + chart_pos.w = stk_font_string_width( ccfont, cheader ); + chart_pos.h = ccfont->height + chart_gap + /* title + gap */ +@@ -220,6 +221,7 @@ void chart_load() + chart_gap + /*gap between caption and entries */ + ccfont->height; /* caption size */ + chart_level_offset = stk_font_string_width( ccfont, _("name.-----") ) + stk_font_string_width( ccfont, _("Level") ) / 2; /* level offset centered */ ++ } + } + /* + ==================================================================== +@@ -344,6 +346,7 @@ void chart_show( Set_Chart *chart, int x, int y, int w, int h ) + chart->name ); + /* caption */ + ccfont->align = STK_FONT_ALIGN_LEFT | STK_FONT_ALIGN_TOP; ++ { + char *cheader = _("Name Level Score"); + stk_font_write( ccfont, stk_display, + chart_pos.x, chart_pos.y + ccfont->height + chart_gap, -1, +@@ -370,6 +373,7 @@ void chart_show( Set_Chart *chart, int x, int y, int w, int h ) + chart_pos.x + chart_pos.w, entry_offset, -1, number_buffer ); + /* change offset */ + entry_offset += font->height; ++ } + } + stk_display_store_rect( &chart_pos ); + } +@@ -389,6 +393,7 @@ void chart_show_compact( Set_Chart *chart, int x, int y, int w, int h ) + + /* caption */ + ccfont->align = STK_FONT_ALIGN_LEFT | STK_FONT_ALIGN_TOP; ++ { + char *cheader = _("Name Level Score"); + stk_font_write( ccfont, stk_display, px, py, -1, cheader ); + +@@ -416,6 +421,7 @@ void chart_show_compact( Set_Chart *chart, int x, int y, int w, int h ) + /* change offset */ + entry_offset += font->height - 1; + } ++ } + { SDL_Rect region = { x, y, w, h }; + stk_display_store_rect( ®ion ); } + } +diff --git a/configure b/configure +index e3da323..eb8b692 100755 +--- a/configure ++++ b/configure +@@ -11392,7 +11392,7 @@ if test "${ac_cv_lib_m_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lm $LIBS" ++LIBS=" $LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -11446,7 +11446,7 @@ if test $ac_cv_lib_m_main = yes; then + #define HAVE_LIBM 1 + _ACEOF + +- LIBS="-lm $LIBS" ++ LIBS=" $LIBS" + + else + { { echo "$as_me:$LINENO: error: lib math is needed" >&5 +-- +1.8.3.4 + + +From 9c323258dc4be15ba6299abb40af19b76dbe80b8 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Tue, 13 Jan 2015 16:19:54 +0000 +Subject: [PATCH 2/3] Relocate save files, high scores and config + +--- + client/chart.c | 4 ++++ + client/config.c | 17 +++++++++++++++++ + client/editor.c | 20 ++++++++++++++++++++ + client/lbreakout.h | 2 ++ + client/main.c | 17 +++++++++++++++++ + client/manager.c | 31 +++++++++++++++++++++++++++++++ + client/slot.c | 36 ++++++++++++++++++++++++++++++++++-- + client/theme.c | 38 ++++++++++++++++++++++++++++++++++++-- + game/levels.c | 42 ++++++++++++++++++++++++++++++++++++++++-- + 9 files changed, 201 insertions(+), 6 deletions(-) + +diff --git a/client/chart.c b/client/chart.c +index 8fbd8c6..6dfe30e 100644 +--- a/client/chart.c ++++ b/client/chart.c +@@ -202,15 +202,19 @@ void chart_load() + if ( charts ) list_delete( charts ); charts = 0; + charts = list_create( LIST_AUTO_DELETE, chart_set_delete ); + /* load highscore */ ++#ifndef __HAIKU__ + if ( !chart_load_from_path( HI_DIR ) ) { + fprintf( stderr, _("Unable to access highscore chart in '%s'.\n"), HI_DIR ); + fprintf( stderr, _("Trying to use config directory '%s'.\n"), config.dir_name ); ++#endif + if ( !chart_load_from_path( config.dir_name ) ) { + fprintf( stderr, _("Unable to access highscore chart in config directory... won't be " + "able to save any results. Sorry.\n") ); + return; + } ++#ifndef __HAIKU__ + } ++#endif + printf( _("Saving highscore chart in: %s\n"), chart_path ); + /* compute size and position stuff of highscore */ + { +diff --git a/client/config.c b/client/config.c +index 83a924c..7b2ed81 100644 +--- a/client/config.c ++++ b/client/config.c +@@ -21,6 +21,11 @@ + #include + #include + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "config.h" + #include "../common/parser.h" + +@@ -38,7 +43,19 @@ Config config; + void config_check_dir() + { + char level_dir[512]; ++#ifdef __HAIKU__ ++ dev_t volume = dev_for_path("/boot"); ++ if ( find_directory( B_USER_SETTINGS_DIRECTORY, volume, false, ++ config.dir_name, sizeof(config.dir_name)-1 ) == B_OK && ++ strlen(config.dir_name) + strlen(CONFIG_DIR_NAME) ++ < sizeof(config.dir_name)-1 ) { ++ strcat(config.dir_name, "/"); ++ strcat(config.dir_name, CONFIG_DIR_NAME); ++ } else ++ snprintf( config.dir_name, sizeof(config.dir_name)-1, "%s/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); ++#else + snprintf( config.dir_name, sizeof(config.dir_name)-1, "%s/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); ++#endif + /* test and create .lgames */ + if ( opendir( config.dir_name ) == 0 ) { + fprintf( stderr, "couldn't find/open config directory '%s'\n", config.dir_name ); +diff --git a/client/editor.c b/client/editor.c +index e182081..81a4b7c 100644 +--- a/client/editor.c ++++ b/client/editor.c +@@ -15,6 +15,11 @@ + * * + ***************************************************************************/ + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "lbreakout.h" + #include "../game/game.h" + #include "game.h" +@@ -722,7 +727,22 @@ int editor_init( char *file_name ) + { + FILE *file = 0; + /* set full file name */ ++#ifdef __HAIKU__ ++ dev_t volume = dev_for_path("/boot"); ++ if ( find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, ++ edit_file_name, sizeof(edit_file_name)-1 ) == B_OK && ++ strlen(edit_file_name) + strlen(CONFIG_DIR_NAME) + strlen(file_name) ++ < sizeof(edit_file_name) - 18 ) { ++ strcat(edit_file_name, "/"); ++ strcat(edit_file_name, CONFIG_DIR_NAME); ++ strcat(edit_file_name, "/lbreakout2-levels/"); ++ strcat(edit_file_name, file_name); ++ } else ++ snprintf( edit_file_name, sizeof(edit_file_name)-1, "%s/%s/lbreakout2-levels/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, file_name ); ++ fprintf( stderr, "HAIKU: Saving at %s\n", edit_file_name); ++#else + snprintf( edit_file_name, sizeof(edit_file_name)-1, "%s/%s/lbreakout2-levels/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, file_name ); ++#endif + /* test this file for write access. use append to keep contents */ + if ( ( file = fopen( edit_file_name, "a" ) ) == 0 ) { + fprintf( stderr, "Permission to write to file '%s' denied.\n", edit_file_name ); +diff --git a/client/lbreakout.h b/client/lbreakout.h +index 4b0090c..8ab9cd6 100644 +--- a/client/lbreakout.h ++++ b/client/lbreakout.h +@@ -48,6 +48,8 @@ Global definitions for LBreakout and general system includes. + /* config directory name in home directory */ + #ifdef _WIN32 + #define CONFIG_DIR_NAME "lgames" ++#elif __HAIKU__ ++#define CONFIG_DIR_NAME "LGames" + #else + #define CONFIG_DIR_NAME ".lgames" + #endif +diff --git a/client/main.c b/client/main.c +index 81e7f57..7f29cfc 100644 +--- a/client/main.c ++++ b/client/main.c +@@ -23,6 +23,11 @@ + #include + #endif + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "lbreakout.h" + #include "../game/game.h" + #include "file.h" +@@ -198,7 +203,19 @@ int main(int argc, char *argv[]) + /* new set? */ + if ( strequal( NEW_SET, edit_set ) ) { + editor_file = calloc( 16, sizeof( char ) ); ++#ifdef __HAIKU__ ++ if ( find_directory(B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ path, sizeof(path)-1 ) == B_OK && ++ strlen(path) + strlen(CONFIG_DIR_NAME) ++ < sizeof(path) - 18 ) { ++ strcat(path, "/"); ++ strcat(path, CONFIG_DIR_NAME); ++ strcat(path, "/lbreakout2-levels"); ++ } else ++ snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels", getenv( "HOME" )? getenv("HOME"):".", CONFIG_DIR_NAME ); ++#else + snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels", getenv( "HOME" )? getenv("HOME"):".", CONFIG_DIR_NAME ); ++#endif + if ( !enter_string( font, _("Set Name:"), editor_file, 12 ) || !file_check( path, editor_file, "w" ) ) { + free( editor_file ); + break; +diff --git a/client/manager.c b/client/manager.c +index 5c94c38..9cbbcdd 100644 +--- a/client/manager.c ++++ b/client/manager.c +@@ -15,6 +15,11 @@ + * * + ***************************************************************************/ + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "manager.h" + #include "../game/game.h" + #include "file.h" +@@ -278,7 +283,19 @@ void levelsets_load_names() + delete_text( text ); + } + /* parse home directory */ ++#ifdef __HAIKU__ ++ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ level_dir, sizeof(level_dir)-1 ) == B_OK && ++ strlen(level_dir) + strlen(CONFIG_DIR_NAME) ++ < sizeof(level_dir)-19 ) { ++ strcat(level_dir, "/"); ++ strcat(level_dir, CONFIG_DIR_NAME); ++ strcat(level_dir, "/lbreakout2-levels"); ++ } else ++ snprintf( level_dir, sizeof(level_dir)-1, "%s/%s/lbreakout2-levels", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); ++#else + snprintf( level_dir, sizeof(level_dir)-1, "%s/%s/lbreakout2-levels", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); ++#endif + if ( ( text = get_file_list( level_dir, 0, level_dir ) ) ) { + for ( i = 0; i < text->count; i++ ) { + /* filter stuff */ +@@ -353,7 +370,21 @@ void cb_delete_set() + return; + } + /* get file name + path */ ++#ifdef __HAIKU__ ++ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ fname, sizeof(fname)-1 ) == B_OK && ++ strlen(fname) + strlen(CONFIG_DIR_NAME) ++ + strlen(levelset_names_home[config.levelset_id_home]) ++ < sizeof(fname)-19 ) { ++ strcat(fname, "/"); ++ strcat(fname, CONFIG_DIR_NAME); ++ strcat(fname, "/lbreakout2-levels/"); ++ strcat(fname, levelset_names_home[config.levelset_id_home]); ++ } else ++ snprintf( fname, sizeof(fname)-1,"%s/%s/lbreakout2-levels/%s", getenv( "HOME" ), CONFIG_DIR_NAME, levelset_names_home[config.levelset_id_home] ); ++#else + snprintf( fname, sizeof(fname)-1,"%s/%s/lbreakout2-levels/%s", getenv( "HOME" ), CONFIG_DIR_NAME, levelset_names_home[config.levelset_id_home] ); ++#endif + remove( fname ); + levelsets_load_names(); /* reinit name lists and configs indices */ + /* reassign these name lists as position in memory has changed */ +diff --git a/client/slot.c b/client/slot.c +index 238d4c8..a32805a 100644 +--- a/client/slot.c ++++ b/client/slot.c +@@ -15,15 +15,34 @@ + * * + ***************************************************************************/ + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "lbreakout.h" + #include "slot.h" + + static FILE *open_slot( int id, char *mode ) + { + char fname[512]; +- snprintf( fname, 511, "%s/%s/lbr2_save_%d", +- (getenv( "HOME" )?getenv( "HOME" ):"."), ++#ifdef __HAIKU__ ++ dev_t volume = dev_for_path("/boot"); ++ if ( find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, ++ fname, sizeof(fname)-1 ) == B_OK && strlen(fname) + ++ strlen(CONFIG_DIR_NAME) < sizeof(fname) - 16 ) { ++ off_t len = strlen(fname); ++ snprintf( fname+len, 511-len, "/%s/lbr2_save_%d", CONFIG_DIR_NAME, id); ++ } else ++ snprintf( fname, 511, "%s/%s/lbr2_save_%d", ++ (getenv( "HOME" )?getenv( "HOME" ):"."), + CONFIG_DIR_NAME, id ); ++ fprintf( stderr, "HAIKU: Accessing savefile at %s\n", fname ); ++#else ++ snprintf( fname, 511, "%s/%s/lbr2_save_%d", ++ (getenv( "HOME" )?getenv( "HOME" ):"."), ++ CONFIG_DIR_NAME, id ); ++#endif + //printf( "accessing '%s' in mode '%s'\n", fname, mode ); + return fopen( fname, mode ); + } +@@ -62,9 +81,22 @@ int slot_save( int slot_id, GameSlot *gs ) + int slot_delete( int slot_id ) + { + char fname[512]; ++#ifdef __HAIKU__ ++ dev_t volume = dev_for_path("/boot"); ++ if ( find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, ++ fname, sizeof(fname)-1 ) == B_OK && strlen(fname) + ++ strlen(CONFIG_DIR_NAME) < sizeof(fname) - 16 ) { ++ off_t len = strlen(fname); ++ snprintf( fname+len, 511-len, "/%s/lbr2_save_%d", CONFIG_DIR_NAME, slot_id); ++ } else ++ snprintf( fname, 511, "%s/%s/lbr2_save_%d", ++ (getenv( "HOME" )?getenv( "HOME" ):"."), ++ CONFIG_DIR_NAME, slot_id ); ++#else + snprintf( fname, 511, "%s/%s/lbr2_save_%d", + (getenv( "HOME" )?getenv( "HOME" ):"."), + CONFIG_DIR_NAME, slot_id ); ++#endif + if ( remove(fname) != 0 ) + { + fprintf( stderr, "ERROR: couldn't delete file %s\n", fname ); +diff --git a/client/theme.c b/client/theme.c +index ad6de96..a0e1b8e 100644 +--- a/client/theme.c ++++ b/client/theme.c +@@ -15,6 +15,11 @@ + * * + ***************************************************************************/ + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include + #include + #include +@@ -133,10 +138,25 @@ static char theme_dir[512]; + static char theme_path[512]; + void theme_set_dir( char *name ) + { +- if ( name[0] == '~' ) ++ if ( name[0] == '~' ) { ++#ifdef __HAIKU__ ++ dev_t volume = dev_for_path("/boot"); ++ if ( find_directory( B_USER_SETTINGS_DIRECTORY, volume, false, ++ theme_dir, sizeof(theme_dir)-1 ) == B_OK && ++ strlen(theme_dir) + strlen(CONFIG_DIR_NAME) + strlen(name) ++ < sizeof(theme_dir)-19 ) { ++ strcat(theme_dir, "/"); ++ strcat(theme_dir, CONFIG_DIR_NAME); ++ strcat(theme_dir, "/lbreakout2-themes/"); ++ strcat(theme_dir, name + (off_t)1); ++ } else ++ snprintf( theme_dir, sizeof(theme_dir)-1, "%s/%s/lbreakout2-themes/%s", ++ (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, name + 1 ); ++#else + snprintf( theme_dir, sizeof(theme_dir)-1, "%s/%s/lbreakout2-themes/%s", + (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, name + 1 ); +- else { ++#endif ++ } else { + if ( STRCMP( SRC_DIR, "." ) ) { + getcwd( theme_dir, 511 ); + strcat( theme_dir, "/gfx/" ); +@@ -327,6 +347,20 @@ void theme_get_list() + closedir( hdir ); + } + /* home theme directory */ ++#ifdef __HAIKU__ ++ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ dir, sizeof(dir)-1 ) == B_OK && ++ strlen(dir) + strlen(CONFIG_DIR_NAME) ++ < sizeof(dir)-19 ) { ++ strcat(dir, "/"); ++ strcat(dir, CONFIG_DIR_NAME); ++ strcat(dir, "/lbreakout2-themes"); ++ } else ++ snprintf( dir, sizeof(dir)-1, "%s/%s/lbreakout2-themes", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); ++#else ++ snprintf( dir, sizeof(dir)-1, "%s/%s/lbreakout2-themes", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); ++#endif ++ + snprintf( dir, sizeof(dir)-1, "%s/%s/lbreakout2-themes", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); + if ( ( hdir = opendir( dir ) ) != 0 ) { + while ( ( entry = readdir( hdir ) ) ) { +diff --git a/game/levels.c b/game/levels.c +index a93a633..0d728ac 100644 +--- a/game/levels.c ++++ b/game/levels.c +@@ -15,6 +15,11 @@ + * * + ***************************************************************************/ + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "levels.h" + + /* +@@ -66,9 +71,26 @@ FILE *levelset_open( const char *fname, char *mode ) + FILE *file; + char path[512]; + if ( fname[0] == '~' ) { +- snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s", +- (getenv( "HOME" )?getenv( "HOME" ):"."), ++#ifdef __HAIKU__ ++ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ path, sizeof(path)-1 ) == B_OK && ++ strlen(path) + strlen(CONFIG_DIR_NAME) ++ + strlen(fname) ++ < sizeof(path)-19 ) { ++ strcat(path, "/"); ++ strcat(path, CONFIG_DIR_NAME); ++ strcat(path, "/lbreakout2-levels/"); ++ strcat(path, fname + 1); ++ } else ++ snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s", ++ (getenv( "HOME" )?getenv( "HOME" ):"."), ++ CONFIG_DIR_NAME, fname + 1 ); ++ fprintf ( stderr, "HAIKU: opening %s\n", path ); ++#else ++ snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s", ++ (getenv( "HOME" )?getenv( "HOME" ):"."), + CONFIG_DIR_NAME, fname + 1 ); ++#endif + } + else + if ( fname[0] != '/' ) /* keep global pathes */ +@@ -276,9 +298,25 @@ int levelset_save( LevelSet *set, char *fname ) + + if ( set == 0 || set->count == 0 ) return 0; + ++#ifdef __HAIKU__ ++ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ path, sizeof(path)-1 ) == B_OK && ++ strlen(path) + strlen(CONFIG_DIR_NAME) ++ + strlen(fname) ++ < sizeof(path)-19 ) { ++ strcat(path, "/"); ++ strcat(path, CONFIG_DIR_NAME); ++ strcat(path, "/lbreakout2-levels/"); ++ strcat(path, (fname[0]=='~') ? fname + 1 : fname); ++ } else ++ snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s", ++ (getenv( "HOME" )?getenv( "HOME" ):"."), ++ CONFIG_DIR_NAME, (fname[0]=='~')?fname+1:fname ); ++#else + snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s", + (getenv( "HOME" )?getenv( "HOME" ):"."), + CONFIG_DIR_NAME, (fname[0]=='~')?fname+1:fname ); ++#endif + if ( ( file = fopen( path, "w" ) ) == 0 ) { + fprintf( stderr, "couldn't open %s\n", path ); + return 0; +-- +1.8.3.4 + + +From 18758854c84c8fc8e12ce85ecf441b278aaa0d59 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Wed, 14 Jan 2015 18:23:21 +0000 +Subject: [PATCH 3/3] Add updated icon + +--- + LBreakout2.rdef | 23 ++++++++++++----------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +diff --git a/LBreakout2.rdef b/LBreakout2.rdef +index 6b165ae..69a4652 100644 +--- a/LBreakout2.rdef ++++ b/LBreakout2.rdef +@@ -18,16 +18,17 @@ resource app_version { + }; + + resource vector_icon { +- $"6E63696605020106023D5738B7D6E13769AC3CF83249ADC94642AAFFA5040400" +- $"FF9E9E02000205B6B6DB3925EEBD5FCABAE8BF4A54944AC9EB00846C1BFF34B6" +- $"9627FF77DBCD5CF983C9C088FFFE6A5716FF020106023B7084B697593638963A" +- $"F2BB4202AB49ECC600AAD2A5F440503F050001010000850502044C24C62E24C2" ++ $"6E63696605020106023D5FC8326AB4B225F53CFFCE4A14594559B7FFA5040400" ++ $"FF9E9E02000205B6B6DB3925EEBD5FCABAE8BF4A54944AC9EB00FFCD22FF34EA" ++ $"BE26FF77F1D806F983E5D882FFFEC2A43EFF020106023B7084B697593638963A" ++ $"F2BB44015549CCC600AAD2A5F440503F050001010000850502044C24C62E24C2" + $"E124442C44B62144B96E4C34C2E134C62E34542C54B96E54B6210604AF303937" +- $"3C2B3A2948243E2D4A48584E450204B6C93AB8A73AB4EA3AB365C0BFB365BEE0" +- $"B365C29DB6C94BB4EA4BB8A74B32C0BF32C29D32BEE006033E402E5037423A50" +- $"374438493B3F330606BE0F3039233D27352242294822452948445654574E5C5B" +- $"504E4555474642090A0401042028220A0301041001178500040A020102024000" +- $"000000000000003FC3C3400000BDC3C30A010101000A02010202404DAB000000" +- $"000000404DAB4A26D645D13D0A000100000A0301001001178100040A03010300" +- $"0A030103023EC27B0000000000003EC27B46388E46B10D" ++ $"3C2B3A2948243E2D4A48584E450204B6C93AB86F3AB5223AB3CBC0BFB3CBBEE0" ++ $"B3CBC29DB6C94BB5224BB86F4B31C0BF31C29D31BEE006033E402E5037423A50" ++ $"374438493B3F330606BE0F3039243D28352342294822452948445653574D5C5A" ++ $"504E4555474642090A040104023FFB5DB90A98390A983FFB5D4347234571E30A" ++ $"03010430222001178500040A020102024000000000000000003FC3C3430000BD" ++ $"C3C30A0101012022200A02010202404DAB000000000000404DAB4A46D645D13D" ++ $"0A0001002022200A03010030222001178100040A0301032022200A030103023E" ++ $"C27B0000000000003EC27B46B88E46B10D" + }; +-- +1.8.3.4 + diff --git a/games-puzzle/lgeneral/lgeneral-1.2.3.recipe b/games-puzzle/lgeneral/lgeneral-1.2.3.recipe index 1190b4406..265623f01 100644 --- a/games-puzzle/lgeneral/lgeneral-1.2.3.recipe +++ b/games-puzzle/lgeneral/lgeneral-1.2.3.recipe @@ -14,7 +14,7 @@ LICENSE="GNU GPL v2" COPYRIGHT="Michael Speck, Leo Savernik, Peter Ivanyi" ARCHITECTURES="x86_gcc2 ?x86 ?x86_64" -PATCHES="lgeneral-1.2.3.patch" +PATCHES="lgeneral-1.2.3.patchset" PROVIDES=" lgeneral = $portVersion @@ -58,6 +58,9 @@ BUILD() INSTALL() { make install + + rm -rf $dataDir/applications + rm -rf $dataDir/icons $binDir/lgc-pg -s ./pg-data addAppDeskbarSymlink $binDir/lgeneral LGeneral diff --git a/games-puzzle/lgeneral/patches/lgeneral-1.2.3.patch b/games-puzzle/lgeneral/patches/lgeneral-1.2.3.patch deleted file mode 100644 index 1719eb095..000000000 --- a/games-puzzle/lgeneral/patches/lgeneral-1.2.3.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- lgeneral-1.2.3/configure.org 2012-04-20 20:50:03.000000000 +0200 -+++ lgeneral-1.2.3/configure 2014-07-14 16:31:39.049283072 +0200 -@@ -5314,7 +5314,7 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lm $LIBS" -+LIBS="$LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF -@@ -5368,7 +5368,7 @@ - #define HAVE_LIBM 1 - _ACEOF - -- LIBS="-lm $LIBS" -+ LIBS="$LIBS" - - else - { { echo "$as_me:$LINENO: error: maths library is needed" >&5 diff --git a/games-puzzle/lgeneral/patches/lgeneral-1.2.3.patchset b/games-puzzle/lgeneral/patches/lgeneral-1.2.3.patchset new file mode 100644 index 000000000..2f740fdbd --- /dev/null +++ b/games-puzzle/lgeneral/patches/lgeneral-1.2.3.patchset @@ -0,0 +1,89 @@ +From a7b2bc562fb3a4403fefc4061b8730f27bade615 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Mon, 12 Jan 2015 20:01:38 +0000 +Subject: [PATCH 1/2] applying patch lgeneral-1.2.3.patch + +--- + configure | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 846e301..e6073fd 100755 +--- a/configure ++++ b/configure +@@ -5314,7 +5314,7 @@ if test "${ac_cv_lib_m_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lm $LIBS" ++LIBS="$LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -5368,7 +5368,7 @@ if test $ac_cv_lib_m_main = yes; then + #define HAVE_LIBM 1 + _ACEOF + +- LIBS="-lm $LIBS" ++ LIBS="$LIBS" + + else + { { echo "$as_me:$LINENO: error: maths library is needed" >&5 +-- +1.8.3.4 + + +From b29a7822ee12df83585548077267afe2be0c78e1 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Wed, 14 Jan 2015 20:15:41 +0000 +Subject: [PATCH 2/2] Move main config + +--- + src/config.c | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/src/config.c b/src/config.c +index 5baa759..b44e162 100644 +--- a/src/config.c ++++ b/src/config.c +@@ -22,6 +22,13 @@ + #include + #include + #include ++ ++#ifdef __HAIKU__ ++#include ++#include ++#include ++#endif ++ + #include "sdl.h" + #include "config.h" + #include "parser.h" +@@ -32,13 +39,21 @@ Config config; + /* check if config directory exists; if not create it and set config_dir */ + void check_config_dir_name() + { ++ size_t length; + struct stat info; + #ifndef INSTALLDIR + /* if no installation store config to current directory not home */ + sprintf( config.dir_name, "." ); +-#else ++#elif __HAIKU__ ++ find_directory(B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ config.dir_name, sizeof(config.dir_name) - 1); ++ length = strlen(config.dir_name); ++ snprintf(config.dir_name + length, sizeof(config.dir_name) - (1 + length), ++ "/LGames"); ++ fprintf( stderr, "HAIKU: Config path is %s\n", config.dir_name); ++#else + sprintf( config.dir_name, "%s/.lgames", getenv( "HOME" ) ); +-#endif ++#endif + if ( stat( config.dir_name, &info ) != 0 ) { + int res; + +-- +1.8.3.4 + diff --git a/games-puzzle/lmarbles/lmarbles-1.0.8.recipe b/games-puzzle/lmarbles/lmarbles-1.0.8.recipe index 96660a6f6..37059d4b2 100644 --- a/games-puzzle/lmarbles/lmarbles-1.0.8.recipe +++ b/games-puzzle/lmarbles/lmarbles-1.0.8.recipe @@ -13,7 +13,6 @@ REVISION="2" LICENSE="GNU GPL v2" COPYRIGHT="2000 Michael Speck" ARCHITECTURES="x86_gcc2 ?x86 ?x86_64" -GLOBAL_WRITABLE_FILES="var/lmarbles.prfs keep-old" PATCHES="lmarbles-1.0.8.patchset" PROVIDES=" @@ -52,6 +51,11 @@ INSTALL() make install mkdir -p $appsDir mv $binDir/lmarbles $appsDir/LMarbles + + rm $localStateDir/lmarbles.prfs + rm -rf $dataDir/applications + rm -rf $dataDir/icons + addAppDeskbarSymlink $appsDir/LMarbles LMarbles mimeset -f $appsDir/LMarbles } diff --git a/games-puzzle/lmarbles/patches/lmarbles-1.0.8.patchset b/games-puzzle/lmarbles/patches/lmarbles-1.0.8.patchset index ae0e5c29e..898a87f1a 100644 --- a/games-puzzle/lmarbles/patches/lmarbles-1.0.8.patchset +++ b/games-puzzle/lmarbles/patches/lmarbles-1.0.8.patchset @@ -1,8 +1,11 @@ -From 6b5f57906db0f0fd8a15fc60da2a791d9ea2bc36 Mon Sep 17 00:00:00 2001 +From 9045675625d6ca5bc0c56bbd2be5498ab99776b9 Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Mon, 5 Jan 2015 17:41:59 +0100 -Subject: Apply original lmarbles patch +Subject: [PATCH 1/3] Apply original lmarbles patch +--- + configure | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 543fb95..b012313 100755 @@ -30,11 +33,15 @@ index 543fb95..b012313 100755 1.8.3.4 -From f837403562b62f6aa17a967597fe61e54499a7bb Mon Sep 17 00:00:00 2001 +From a5a1d08c9a5754c3f790088cec87de41a6ac84c5 Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Mon, 5 Jan 2015 17:54:53 +0100 -Subject: Have lmarbles use find_directory for config +Subject: [PATCH 2/3] Have lmarbles use find_directory for config +--- + src/cfg.c | 10 ++++++++-- + src/profile.c | 11 ++++++++++- + 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/cfg.c b/src/cfg.c index 2831c1b..4d713f5 100644 @@ -103,3 +110,71 @@ index 218c856..9ebf47b 100644 -- 1.8.3.4 + +From b956be01acbcbf76175ee3a2303f87a99e501320 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Wed, 14 Jan 2015 18:38:13 +0000 +Subject: [PATCH 3/3] Move lmarbles config to LGames folder + +--- + src/cfg.c | 6 +++++- + src/profile.c | 6 +++++- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/src/cfg.c b/src/cfg.c +index 4d713f5..d9ec8f0 100644 +--- a/src/cfg.c ++++ b/src/cfg.c +@@ -27,6 +27,7 @@ + + #ifdef __HAIKU__ + #include ++#include + #endif + + #ifdef _WIN32 +@@ -45,7 +46,10 @@ void C_StPth() + { + DIR *dir; + #if defined(__HAIKU__) +- find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, c_pth, sizeof(c_pth) - 1); ++ size_t length; ++ 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" ); + #elif defined(_WIN32) + snprintf( c_pth, sizeof(c_pth)-1, "%s/lgames", (getenv( "HOME" )?getenv( "HOME" ):".") ); + #else +diff --git a/src/profile.c b/src/profile.c +index 9ebf47b..927f217 100644 +--- a/src/profile.c ++++ b/src/profile.c +@@ -24,6 +24,7 @@ + + #ifdef __HAIKU__ + #include ++#include + #endif + + // profiles // +@@ -39,13 +40,16 @@ extern Cfg cfg; + /* initialize dyn list and source path */ + void Prf_Ini() + { ++ size_t length; + DL_Ini(&prfs); + prfs.flgs = DL_AUTODEL; + prfs.cb = Prf_Del; + #ifdef __HAIKU__ + find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, prf_pth, + sizeof(prf_pth) - 1); +- strcat(prf_pth, "/lmarbles.prfs"); ++ length = strlen(prf_pth); ++ snprintf(prf_pth + length, sizeof(prf_pth)-(1+length), ++ "/LGames/lmarbles.prfs"); + #else + sprintf(prf_pth, "%s/lmarbles.prfs", PRF_DIR); + #endif +-- +1.8.3.4 + diff --git a/games-puzzle/lpairs/lpairs-1.0.4.recipe b/games-puzzle/lpairs/lpairs-1.0.4.recipe index b8708741c..18f6dd1a2 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 @@ -43,5 +43,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 + diff --git a/games-puzzle/ltris/ltris-1.0.19.recipe b/games-puzzle/ltris/ltris-1.0.19.recipe index 46899f909..b89bbc0ca 100644 --- a/games-puzzle/ltris/ltris-1.0.19.recipe +++ b/games-puzzle/ltris/ltris-1.0.19.recipe @@ -11,8 +11,7 @@ LICENSE="GNU GPL v2" COPYRIGHT="2002-2011 Michael Speck" ARCHITECTURES="x86_gcc2 ?x86 ?x86_64" -PATCHES="ltris-1.0.19.patch" -GLOBAL_WRITABLE_FILES="var/ltris.hscr keep-old" +PATCHES="ltris-1.0.19.patchset" PROVIDES=" ltris = $portVersion @@ -48,5 +47,11 @@ BUILD() INSTALL() { make install + + # Clean up some unnecessary things from the package + rm $localStateDir/ltris.hscr + rm -rf $dataDir/applications + rm -rf $dataDir/icons + addAppDeskbarSymlink $binDir/ltris LTris } diff --git a/games-puzzle/ltris/patches/ltris-1.0.19.patch b/games-puzzle/ltris/patches/ltris-1.0.19.patch deleted file mode 100644 index 3a4a239e7..000000000 --- a/games-puzzle/ltris/patches/ltris-1.0.19.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- /dev/null 2014-09-03 18:56:15.136019000 +0200 -+++ ltris-1.0.19/LTris.rdef 2014-09-03 17:14:27.000000000 +0200 -@@ -0,0 +1,37 @@ -+resource app_signature "application/x-vnd-ltris"; -+ -+resource app_flags B_SINGLE_LAUNCH; -+ -+resource app_version { -+ major = 1, -+ middle = 0, -+ minor = 19, -+ -+ /* 0 = development 1 = alpha 2 = beta -+ 3 = gamma 4 = golden master 5 = final */ -+ variety = 5, -+ -+ internal = 0, -+ -+ short_info = "LTris is a tetris clone.", -+ long_info = "LTris is a tetris clone: differently shaped blocks are falling down the rectangular playing field." -+}; -+ -+resource vector_icon { -+ $"6E6369660A05000200060239BCD5357062B86B6C3CA1364826E049473700C0BE" -+ $"33FF6A6925020006023C15033A71ACB873493A166346BF9949CB5C00FFFC1BFF" -+ $"CDCB16020006023A39972E8567AFC35B3B523345A11E4863C900CECC1BFF9E9D" -+ $"150392901702001602399F0E3686A9B98DF63C8C42488EEB4924C900C2FF5A02" -+ $"0016023C15033A71ACB873493A166347FF994A15AE00FAFFD7020016023C9D60" -+ $"377C1EB78C243CA9674705BF48FA9100DAFFB30578040174060A04223E224A2D" -+ $"4F2D420A042D422D4F334B333F0A04223E2D42333F283B0A1C224A223E233D22" -+ $"3C222F282D2E2F2E2735243F283F2A41294B2D4B394A3B4B3C5740574C51504B" -+ $"4E4B5545593A543A483B473344334B2D4F0A072D513A4F455B5159575A605337" -+ $"420A04463F533E35332E351B0A090104000A0001031001178403040A01010100" -+ $"0A020100000A040102000A05010120382A0A06010020382A0A08010220382A0A" -+ $"0101012020120A0201002020120A0301022020120A010101202C170A02010020" -+ $"2C170A040102202C170A05010120381C0A06010020381C0A08010220381C0A05" -+ $"01012044210A0601002044210A0701022044210A090105000A010101202C090A" -+ $"020100202C090A030102202C090A05010120380E0A06010020380E0A07010220" -+ $"380E" -+}; diff --git a/games-puzzle/ltris/patches/ltris-1.0.19.patchset b/games-puzzle/ltris/patches/ltris-1.0.19.patchset new file mode 100644 index 000000000..7a5d753f0 --- /dev/null +++ b/games-puzzle/ltris/patches/ltris-1.0.19.patchset @@ -0,0 +1,187 @@ +From 3afd9f9500c8cc0a9cc7d8f09128e4c44b5c2538 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Mon, 12 Jan 2015 20:53:30 +0000 +Subject: [PATCH 1/2] Original resource definition file + +--- + LTris.rdef | 37 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + create mode 100644 LTris.rdef + +diff --git a/LTris.rdef b/LTris.rdef +new file mode 100644 +index 0000000..b1cea42 +--- /dev/null ++++ b/LTris.rdef +@@ -0,0 +1,37 @@ ++resource app_signature "application/x-vnd.lgames.ltris"; ++ ++resource app_flags B_SINGLE_LAUNCH; ++ ++resource app_version { ++ major = 1, ++ middle = 0, ++ minor = 19, ++ ++ /* 0 = development 1 = alpha 2 = beta ++ 3 = gamma 4 = golden master 5 = final */ ++ variety = 5, ++ ++ internal = 0, ++ ++ short_info = "LTris is a tetris clone.", ++ long_info = "LTris is a tetris clone: differently shaped blocks are falling down the rectangular playing field." ++}; ++ ++resource vector_icon { ++ $"6E6369660A05000200060239BCD5357062B86B6C3CA1364826E049473700C0BE" ++ $"33FF6A6925020006023C15033A71ACB873493A166346BF9949CB5C00FFFC1BFF" ++ $"CDCB16020006023A39972E8567AFC35B3B523345A11E4863C900CECC1BFF9E9D" ++ $"150392901702001602399F0E3686A9B98DF63C8C42488EEB4924C900C2FF5A02" ++ $"0016023C15033A71ACB873493A166347FF994A15AE00FAFFD7020016023C9D60" ++ $"377C1EB78C243CA9674705BF48FA9100DAFFB30578040174060A04223E224A2D" ++ $"4F2D420A042D422D4F334B333F0A04223E2D42333F283B0A1C224A223E233D22" ++ $"3C222F282D2E2F2E2735243F283F2A41294B2D4B394A3B4B3C5740574C51504B" ++ $"4E4B5545593A543A483B473344334B2D4F0A072D513A4F455B5159575A605337" ++ $"420A04463F533E35332E351B0A090104000A0001031001178403040A01010100" ++ $"0A020100000A040102000A05010120382A0A06010020382A0A08010220382A0A" ++ $"0101012020120A0201002020120A0301022020120A010101202C170A02010020" ++ $"2C170A040102202C170A05010120381C0A06010020381C0A08010220381C0A05" ++ $"01012044210A0601002044210A0701022044210A090105000A010101202C090A" ++ $"020100202C090A030102202C090A05010120380E0A06010020380E0A07010220" ++ $"380E" ++}; +-- +1.8.3.4 + + +From c735a348244339d0e12c90a027e20cce1de18370 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Mon, 12 Jan 2015 22:16:46 +0000 +Subject: [PATCH 2/2] Move settings and highscores to B_USER_SETTINGS_DIRECTORY + +--- + src/chart.c | 4 ++++ + src/config.c | 18 +++++++++++++++++- + src/config.h | 4 ++++ + src/manager.c | 20 ++++++++++++++++++++ + 4 files changed, 45 insertions(+), 1 deletion(-) + +diff --git a/src/chart.c b/src/chart.c +index 87d8e03..8cee31d 100644 +--- a/src/chart.c ++++ b/src/chart.c +@@ -189,15 +189,19 @@ void chart_load() + if ( charts ) list_delete( charts ); charts = 0; + charts = list_create( LIST_AUTO_DELETE, chart_set_delete ); + /* load highscore */ ++#ifndef __HAIKU__ + if ( !chart_load_from_path( HI_DIR ) ) { + fprintf( stderr, "Unable to access highscore chart in '%s'.\n", HI_DIR ); + fprintf( stderr, "Trying to use config directory '%s'.\n", config.dir_name ); ++#endif + if ( !chart_load_from_path( config.dir_name ) ) { + fprintf( stderr, "Unable to access highscore chart in config directory... won't be " + "able to save any results. Sorry.\n" ); + return; + } ++#ifndef __HAIKU__ + } ++#endif + printf( "Saving highscore chart in: %s\n", chart_path ); + /* load resources */ + cfont = load_fixed_font( "f_small_yellow.bmp", 32, 96, 8 ); +diff --git a/src/config.c b/src/config.c +index 00f7e9c..c4d6ea0 100644 +--- a/src/config.c ++++ b/src/config.c +@@ -23,6 +23,11 @@ + #include + #include + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "sdl.h" + #include "config.h" + #include "parser.h" +@@ -40,7 +45,18 @@ void config_check_dir() + { + #ifdef DISABLE_INSTALL + sprintf( config.dir_name, "." ); +-#else ++#elif __HAIKU__ ++ dev_t volume = dev_for_path("/boot"); ++ if ( find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, ++ config.dir_name, sizeof(config.dir_name)-1 ) == B_OK && ++ strlen(config.dir_name) + strlen(CONFIG_DIR_NAME) ++ < sizeof(config.dir_name)-1 ) { ++ strcat(config.dir_name, "/"); ++ strcat(config.dir_name, CONFIG_DIR_NAME); ++ } else ++ snprintf( config.dir_name, sizeof(config.dir_name)-1, "%s/%s", getenv( "HOME" ), CONFIG_DIR_NAME ); ++ fprintf( stderr, "HAIKU: Config directory is '%s'\n", config.dir_name ); ++#else + snprintf( config.dir_name, sizeof(config.dir_name)-1, "%s/%s", getenv( "HOME" ), CONFIG_DIR_NAME ); + #endif + if ( opendir( config.dir_name ) == 0 ) { +diff --git a/src/config.h b/src/config.h +index ee52a64..491ed64 100644 +--- a/src/config.h ++++ b/src/config.h +@@ -99,7 +99,11 @@ typedef struct { + } Config; + + /* config directory name in home directory */ ++#ifdef __HAIKU__ ++#define CONFIG_DIR_NAME "LGames" ++#else + #define CONFIG_DIR_NAME ".lgames" ++#endif + + /* set config to default */ + void config_reset(); +diff --git a/src/manager.c b/src/manager.c +index b8cc411..de07f73 100644 +--- a/src/manager.c ++++ b/src/manager.c +@@ -19,6 +19,11 @@ + #include "../config.h" + #endif + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "ltris.h" + #include "manager.h" + #include "chart.h" +@@ -143,7 +148,22 @@ void cb_delete_set() + return; + } + /* get file name + path */ ++#ifdef __HAIKU__ ++ dev_t volume = dev_for_path("/boot"); ++ if ( find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, ++ fname, sizeof(config.dir_name)-1 ) == B_OK && ++ strlen(fname) + strlen(CONFIG_DIR_NAME) ++ + strlen(levelset_home_names[config.levelset_home_id]) ++ < sizeof(fname)-9 ) { ++ strcat(fname, "/"); ++ strcat(fname, CONFIG_DIR_NAME); ++ strcat(fname, "/levels/"); ++ strcat(fname, levelset_home_names[config.levelset_home_id]); ++ } else ++ snprintf( fname, sizeof(fname)-1, "%s/%s/levels/%s", getenv( "HOME" ), CONFIG_DIR_NAME, levelset_home_names[config.levelset_home_id] ); ++#else + snprintf( fname, sizeof(fname)-1, "%s/%s/levels/%s", getenv( "HOME" ), CONFIG_DIR_NAME, levelset_home_names[config.levelset_home_id] ); ++#endif + remove( fname ); + levelsets_load_names(); /* reinit name lists and configs indices */ + /* reassign these name lists as position in memory has changed */ +-- +1.8.3.4 +