From 62c33b5faffc5d316fee3097335dff5cda726d4a Mon Sep 17 00:00:00 2001 From: Humdinger Date: Sat, 16 Jul 2016 09:53:44 +0200 Subject: [PATCH] New recipe for updated LBreakout2 version 2.6.5 Pulled the rdef out of the patchset into additional-files. Added the I-O-M icon file to the additional-files. Re-created the patchset as the old one didn't apply cleanly anymore. Removed the $localStateDir as otherwise there was a stray var folder in the hpkg. --- .../additional-files/LBreakout2.iom | Bin 0 -> 8986 bytes .../additional-files/lbreakout2.rdef | 34 ++ .../lbreakout2/lbreakout2-2.6.5.recipe | 70 +++ .../patches/lbreakout2-2.6.5.patchset | 503 ++++++++++++++++++ 4 files changed, 607 insertions(+) create mode 100644 games-puzzle/lbreakout2/additional-files/LBreakout2.iom create mode 100644 games-puzzle/lbreakout2/additional-files/lbreakout2.rdef create mode 100644 games-puzzle/lbreakout2/lbreakout2-2.6.5.recipe create mode 100644 games-puzzle/lbreakout2/patches/lbreakout2-2.6.5.patchset diff --git a/games-puzzle/lbreakout2/additional-files/LBreakout2.iom b/games-puzzle/lbreakout2/additional-files/LBreakout2.iom new file mode 100644 index 0000000000000000000000000000000000000000..a392b4fd4ce98a564c074dfd7fec8c5e0504dfc8 GIT binary patch literal 8986 zcmeHMe{3AZ6`spEc6!9b1y>0Pm~C200znW!2oU5pCb2;{v0K{(mGI+YpW}t|-R17$ z5DCQbBLUntZloY8A<|;v3YAEpqLu&>PD6wX0fhQTV?`~EP>TSe#8j!2s8x>do7vf$ zJ@3Jy$chjd>1l7ic{B6&dvD%6uWwq_*?QxumZbtM0x4B#Lkoq7Vti(W4!Uw)MAVAb z*3MO24 z`N`nNsFOvwx{?){(tsh`h4`2V&e}UT&@%|8wx^=6y=f} zQ8Se$XZB>$>10nK*()MwWZddWW%BHAfVp9qe+G7kWgf95TM+a07ztwj3gAJ^uK^y! z{1$H=Kl9sNTr$szYZC>J_##OD3#0*JflJC=kgFk$%^vYW?1sW2NYNHz(p9chB=PVa zM&E~YKo(&c|B_|m5f|Sw;*;rKkNA0#r4yx6T!<;4CBn4@_Zy5!w0Z*ScYfQQZ&Ve%I2JV8RWYVlVOdw z0yi1fcoDeCFmcMOkf3b-wu?)KncNV8B-!Iw=ar(3Ta_F`EYL`H+=**y)KG=gF&85>ici#o=hr}!-y!Y%O!f9B(CeHpd5yl7ch%ujiyB# zUN*Q^8q61&4`EXV&k-xznpaSd!E8aOqhEx-$>N<7BVH%E+S^(*J^)+=GwLhj#qR^o zppJq96W?K{_3vOMYHJ*h-KFN>#EO#v$@uT#h+()qqjZXi)`GHEfnz3v|?P8^Ky z6}z^KbUz&bfBp8uyDoij?47@TVhx@+fP63P_eN|R&qJ@gJ0GP886K^vDV28YC}sNk z@=0E!MJkHIrfgEi7V4yAE}KcIJxGm{?oZ~Nf>p77qz62NanAuP5;mUPpmk~T$CIvK z%y@bkYtMy^UOdqstUJ`p_C8>Q(@W3|WA8YYn2vB_ST;f`!%5?tFcuU}tgC{;>1p6W z;l$%W{A-5On&);O`sbfU$NFmyJeM?e^mN>qW1W|Cmt&8-MOqBTF9K^KVFtQ_sBB5S^S!<55#4dVFd(L z*f6^}WSEUjW0)~*O$jqrSt`tq9zA+GYZ-~^%d*y!lON8#@R9xTxwq`N{=HXsj=k2= z{l^#gJrf_8KdWWpiE$>QJ-cEJHlJ7ZEpx-{_kSHN*&T5+w7R=DsBnUBzD76=Lpw|s zSO7gHdVQJjM4>BlB!8Q?pstXJ>&t^y@iglSX-WlCzVNm}EsROLyTY1u26WkiOu|Qo za>8V$%l9XGGaKDthT)q5WKoxtV0;+Eo`oLYS967*aszJ8rt1>M#nU7Njkw%KY{S$r zyNqI%nU}c&>EPX>@@C9;-2#?Y@k@hw4YMv`J~cf^y6ADP8O7fXW?67CaK2d-#Q?uR z@J%UqLzMpaWLZFrcI2zzzi@F`jaj*5pVXH1pzg>ZF+5Un?6&&RbA}h#{m8OTdYuphPTCrD^3GZ(Cg7zH+uM4KAazk z=r+Ijnxc%j(rVqwW!Y9lhVRG9D zY@IHj@QhUR$s&ve`D7jNAntjXg7C*(yzCQ3pyv~Iq)!-M{F~|YDXHd>Q*}yml|DJ= zt$%%V=fHoaWG;>Wbbqn_#jBd_n#&)_ef)US$y5NtAy3J(h@R;>B`g@L`D8K1f=&tV zjG)u7z6w6%;^k8UpnOW$k*9=v$^Rvtx?^$^Zi6t1YbDYx6AVpeBOT1ZJm`ute~~~P zW`m&1gswG<5SH(B2`{F~qHHNJMZLc$+mFSAin17t3UbxiRq!P)UUn6&@Ddt+D_8ML z5nW}SuFR&pGCLMG>o0l$AH=^AmD#s9zxfUgJ6?X1|5`b9`R%kz9~EFmP+*z6)%)*2+9~!O2tsUjV?MtDFD; literal 0 HcmV?d00001 diff --git a/games-puzzle/lbreakout2/additional-files/lbreakout2.rdef b/games-puzzle/lbreakout2/additional-files/lbreakout2.rdef new file mode 100644 index 000000000..f33511cc3 --- /dev/null +++ b/games-puzzle/lbreakout2/additional-files/lbreakout2.rdef @@ -0,0 +1,34 @@ +resource app_signature "application/x-vnd.lgames.lbreakout2"; + +resource app_flags B_SINGLE_LAUNCH; + +resource app_version { + major = 2, + middle = 6, + minor = 5, + + /* 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 { + $"6E63696605020106023D5FC8326AB4B225F53CFFCE4A14594559B7FFA5040400" + $"FF9E9E02000205B6B6DB3925EEBD5FCABAE8BF4A54944AC9EB00FFCD22FF34EA" + $"BE26FF77F1D806F983E5D882FFFEC2A43EFF020106023B7084B697593638963A" + $"F2BB44015549CCC600AAD2A5F440503F050001010000850502044C24C62E24C2" + $"E124442C44B62144B96E4C34C2E134C62E34542C54B96E54B6210604AF303937" + $"3C2B3A2948243E2D4A48584E450204B6C93AB86F3AB5223AB3CBC0BFB3CBBEE0" + $"B3CBC29DB6C94BB5224BB86F4B31C0BF31C29D31BEE006033E402E5037423A50" + $"374438493B3F330606BE0F3039243D28352342294822452948445653574D5C5A" + $"504E4555474642090A040104023FFB5DB90A98390A983FFB5D4347234571E30A" + $"03010430222001178500040A020102024000000000000000003FC3C3430000BD" + $"C3C30A0101012022200A02010202404DAB000000000000404DAB4A46D645D13D" + $"0A0001002022200A03010030222001178100040A0301032022200A030103023E" + $"C27B0000000000003EC27B46B88E46B10D" +}; diff --git a/games-puzzle/lbreakout2/lbreakout2-2.6.5.recipe b/games-puzzle/lbreakout2/lbreakout2-2.6.5.recipe new file mode 100644 index 000000000..38478b607 --- /dev/null +++ b/games-puzzle/lbreakout2/lbreakout2-2.6.5.recipe @@ -0,0 +1,70 @@ +SUMMARY="A fun breakout-style arcade game" +DESCRIPTION="The successor to LBreakout offers you a new challenge in more \ +than 50 levels with loads of new bonuses (goldshower, joker, explosive balls, \ +bonus magnet), maluses (chaos, darkness, weak balls, malus magnet) \ +and special bricks (growing bricks, explosive bricks, regenerative bricks). +If you are hungry for more you can create your own levelsets with the \ +integrated level editor. +There is also an experimental two player mode (via LAN) available." +HOMEPAGE="http://lgames.sourceforge.net/" +COPYRIGHT="2001-2015 Michael Speck" +LICENSE="GNU GPL v2" +REVISION="1" +SOURCE_URI="https://sourceforge.net/projects/lgames/files/lbreakout2/2.6/lbreakout2-$portVersion.tar.gz" +CHECKSUM_SHA256="9104d6175553da3442dc6a5fc407a669e2f5aff3eedc5d30409eb003b7a78d6f" +PATCHES="lbreakout2-$portVersion.patchset" +ADDITIONAL_FILES="lbreakout2.rdef" + +ARCHITECTURES="x86_gcc2 ?x86 ?x86_64" + +PROVIDES=" + lbreakout2 = $portVersion + cmd:lbreakout2 = $portVersion + cmd:lbreakout2server = $portVersion + " +REQUIRES=" + haiku + lib:libsdl + lib:libsdl_mixer + lib:libsdl_net_1.2 + lib:libpng + lib:libz + lib:libintl + " + +BUILD_REQUIRES=" + haiku_devel + devel:libsdl + devel:libsdl_mixer + devel:libsdl_net_1.2 + devel:libintl + devel:libz + devel:libpng + " +BUILD_PREREQUIRES=" + cmd:make + cmd:gcc + cmd:ld + cmd:libtoolize + " + +BUILD() +{ + libtoolize --force --copy --install + LDFLAGS="-lintl -lnetwork" runConfigure ./configure --with-docdir=$documentationDir + make $jobArgs +} + +INSTALL() +{ + make install + + addResourcesToBinaries $portDir/additional-files/lbreakout2.rdef \ + $binDir/lbreakout2 + + rm -rf $localStateDir + rm -rf $dataDir/applications + rm -rf $dataDir/icons + + addAppDeskbarSymlink $binDir/lbreakout2 LBreakout2 +} diff --git a/games-puzzle/lbreakout2/patches/lbreakout2-2.6.5.patchset b/games-puzzle/lbreakout2/patches/lbreakout2-2.6.5.patchset new file mode 100644 index 000000000..79c6ce474 --- /dev/null +++ b/games-puzzle/lbreakout2/patches/lbreakout2-2.6.5.patchset @@ -0,0 +1,503 @@ +From a2d2c254f96fe00ed597632009108674aca5316f Mon Sep 17 00:00:00 2001 +From: Humdinger +Date: Sat, 16 Jul 2016 09:26:26 +0200 +Subject: Relocate save files, high scores and config + +Originally by Markus Himmel. + +diff --git a/client/chart.c b/client/chart.c +index 68e9f44..7da0542 100644 +--- a/client/chart.c ++++ b/client/chart.c +@@ -202,17 +202,22 @@ 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 */ ++ { + 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 +225,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 +350,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 +377,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,12 +397,13 @@ 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 ); + + /* get entry offset */ + entry_offset = ( ccfont->height + 2) + py; +- ++ + /* entries */ + for ( i = 0; i < CHART_ENTRY_COUNT; i++ ) { + font = cfont; +@@ -416,6 +425,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/client/config.c b/client/config.c +index 83a924c..42faa07 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]; +- snprintf( config.dir_name, sizeof(config.dir_name)-1, "%s/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); ++#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..ff8503e 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 */ +- snprintf( edit_file_name, sizeof(edit_file_name)-1, "%s/%s/lbreakout2-levels/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, 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..c798bc1 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 */ +- snprintf( level_dir, sizeof(level_dir)-1, "%s/%s/lbreakout2-levels", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); ++#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 */ +- snprintf( fname, sizeof(fname)-1,"%s/%s/lbreakout2-levels/%s", getenv( "HOME" ), CONFIG_DIR_NAME, levelset_names_home[config.levelset_id_home] ); ++#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..b1ef0a3 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,19 @@ 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..2d7e84c 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 */ +@@ -275,10 +297,25 @@ int levelset_save( LevelSet *set, char *fname ) + int i, j, k; + + 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; +-- +2.7.0 + + +From 01b2e359745bf090fe5c17c65ff29f2a794ecee2 Mon Sep 17 00:00:00 2001 +From: Humdinger +Date: Sat, 16 Jul 2016 09:31:55 +0200 +Subject: Changes to configure + +Remove -lm, originally by Markus Himmel. + +diff --git a/configure b/configure +index 6f899f5..5f1dc4c 100755 +--- a/configure ++++ b/configure +@@ -8573,7 +8573,7 @@ if ${ac_cv_lib_m_main+:} false; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lm $LIBS" ++LIBS="$LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +@@ -8602,7 +8602,7 @@ if test "x$ac_cv_lib_m_main" = xyes; then : + #define HAVE_LIBM 1 + _ACEOF + +- LIBS="-lm $LIBS" ++ LIBS="$LIBS" + + else + as_fn_error $? "lib math is needed" "$LINENO" 5 +-- +2.7.0 +