From df67feb35079d8609f2fdd58924f0e365574e56e Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Tue, 28 Jan 2014 21:43:52 +0100 Subject: [PATCH] Add recipe for Rocks'n'Diamonds. --- .../patches/rocksndiamonds-3.3.1.2.patchset | 86 +++++++++++++++++++ .../rocksndiamonds-3.3.1.2.recipe | 71 +++++++++++++++ 2 files changed, 157 insertions(+) create mode 100644 games-arcade/rocksndiamonds/patches/rocksndiamonds-3.3.1.2.patchset create mode 100644 games-arcade/rocksndiamonds/rocksndiamonds-3.3.1.2.recipe diff --git a/games-arcade/rocksndiamonds/patches/rocksndiamonds-3.3.1.2.patchset b/games-arcade/rocksndiamonds/patches/rocksndiamonds-3.3.1.2.patchset new file mode 100644 index 000000000..b7c633931 --- /dev/null +++ b/games-arcade/rocksndiamonds/patches/rocksndiamonds-3.3.1.2.patchset @@ -0,0 +1,86 @@ +From ba88fe1ad26fc936fcfece46929b4b1eebb091c1 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Tue, 28 Jan 2014 20:36:56 +0100 +Subject: remove hardcoded -lm and add -lnetwork. + + +diff --git a/src/Makefile b/src/Makefile +index a67cd14..8493bb9 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -53,6 +53,11 @@ EXTRA_LDFLAGS = -lnsl -lsocket -R$(XLIB_PATH) + PLATFORM = unix + endif + ++ifeq ($(PLATFORM),haiku) # native compiling to Haiku ++EXTRA_LDFLAGS = -lnetwork ++PLATFORM = unix ++endif ++ + ifeq ($(PLATFORM),macosx) # native compiling to Mac OS X + EXTRA_LDFLAGS = -lstdc++ + PLATFORM = unix +@@ -163,7 +168,7 @@ OPTIONS = -O3 -Wall + endif + + CFLAGS = $(OPTIONS) $(SYS_CFLAGS) $(EXTRA_CFLAGS) $(CONFIG) +-LDFLAGS = $(SYS_LDFLAGS) $(EXTRA_LDFLAGS) -lm ++LDFLAGS = $(SYS_LDFLAGS) $(EXTRA_LDFLAGS) + + + SRCS = main.c \ +-- +1.8.3.4 + + +From 142ac2bc985591b85860f6fea82b5161fc4446e9 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Tue, 28 Jan 2014 21:10:09 +0100 +Subject: Store user files at the right place. + + +diff --git a/src/main.c b/src/main.c +index aaa3a5b..03723fb 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -13,6 +13,9 @@ + + #include "libgame/libgame.h" + ++#include ++#include ++ + #include "main.h" + #include "init.h" + #include "game.h" +@@ -5588,11 +5591,27 @@ int main(int argc, char *argv[]) + { + char * window_title_string = getWindowTitleString(); + ++#ifdef __HAIKU__ ++ char datadir[256]; ++ find_directory(B_USER_SETTINGS_DIRECTORY, 0, true, datadir, sizeof(datadir)); ++ strcat(datadir,"/rocksndiamonds"); ++ find_directory(B_USER_DIRECTORY, 0, true, datadir, sizeof(datadir)); ++ char* ptr = datadir; ++ while(*ptr != 0) ptr++; ++ ptr++; ++ mkdir(ptr, 0770); ++ InitProgramInfo(argv[0], ptr, ptr, ++ PROGRAM_TITLE_STRING, window_title_string, ICON_TITLE_STRING, ++ X11_ICON_FILENAME, X11_ICONMASK_FILENAME, SDL_ICON_FILENAME, ++ MSDOS_POINTER_FILENAME, ++ COOKIE_PREFIX, FILENAME_PREFIX, GAME_VERSION_ACTUAL); ++#else + InitProgramInfo(argv[0], USERDATA_DIRECTORY, USERDATA_DIRECTORY_UNIX, + PROGRAM_TITLE_STRING, window_title_string, ICON_TITLE_STRING, + X11_ICON_FILENAME, X11_ICONMASK_FILENAME, SDL_ICON_FILENAME, + MSDOS_POINTER_FILENAME, + COOKIE_PREFIX, FILENAME_PREFIX, GAME_VERSION_ACTUAL); ++#endif + + InitExitMessageFunction(DisplayExitMessage); + InitExitFunction(CloseAllAndExit); +-- +1.8.3.4 + diff --git a/games-arcade/rocksndiamonds/rocksndiamonds-3.3.1.2.recipe b/games-arcade/rocksndiamonds/rocksndiamonds-3.3.1.2.recipe new file mode 100644 index 000000000..b95b6575c --- /dev/null +++ b/games-arcade/rocksndiamonds/rocksndiamonds-3.3.1.2.recipe @@ -0,0 +1,71 @@ +SUMMARY="Arcade style game in the style of Boulder Dash." +HOMEPAGE="http://www.artsoft.org/rocksndiamonds/" +LICENSE="GNU GPL v2" +COPYRIGHT="2001-2013 Artsoft Entertainment" +SRC_URI="http://www.artsoft.org/RELEASES/unix/rocksndiamonds/rocksndiamonds-3.3.1.2.tar.gz" +CHECKSUM_MD5="9fb7d125a314f55c5148c0e47f9ebb42" +REVISION="1" +ARCHITECTURES="x86" +if [ $effectiveTargetArchitecture != x86_gcc2 ]; then + # x86_gcc2 is fine as primary target architecture as long as we're building + # for a different secondary architecture. + ARCHITECTURES="$ARCHITECTURES x86_gcc2" +fi +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + rocksndiamonds = $portVersion + app:rocksndiamonds = $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + lib:libsdl$secondaryArchSuffix + lib:libsdl_image$secondaryArchSuffix + lib:libsdl_mixer$secondaryArchSuffix + lib:libsdl_net$secondaryArchSuffix +# lib:libz$secondaryArchSuffix + lib:libsmpeg$secondaryArchSuffix + " +BUILD_REQUIRES=" + devel:libsdl$secondaryArchSuffix + devel:libsdl_image$secondaryArchSuffix + devel:libsdl_mixer$secondaryArchSuffix + devel:libsdl_net$secondaryArchSuffix +# devel:libz$secondaryArchSuffix + devel:libsmpeg$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:make + " + +PATCHES="rocksndiamonds-$portVersion.patchset" +BUILD() +{ + # Parallel build doesn't work. + PLATFORM=haiku make sdl +} + +INSTALL() +{ + destdir=$appsDir/"Rocks'n'Diamonds" + mkdir -p $destdir + cp -r rocksndiamonds sounds graphics levels music $destdir + addAppDeskbarSymlink $destdir/rocksndiamonds "Rocks'n'Diamonds" +} + +# ----- DESCRIPTION ----------------------------------------------------------- + +DESCRIPTION=" +- network multiplayer games (upto 4 players) +- local multiplayer games (upto 4 players) +- soft scrolling with 50 frames per second +- freely customizable keyboard and joystick support +- stereo sound effects and music +- music modules and fullscreen in SDL version +- contains levels to play Boulder Dash, Emerald Mine and Sokoban +- lots of additional levels available (over 10.000) +"