From 976cb7bcc5f67545859b20079afe7c2c6b0dfe78 Mon Sep 17 00:00:00 2001 From: miqlas Date: Tue, 19 Sep 2017 07:58:45 +0200 Subject: [PATCH] NXEngine: new recipe (#1641) --- games-arcade/nxengine/nxengine-1.0.0.4.recipe | 61 +++++++++++++++++ .../patches/nxengine-1.0.0.4.patchset | 68 +++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 games-arcade/nxengine/nxengine-1.0.0.4.recipe create mode 100644 games-arcade/nxengine/patches/nxengine-1.0.0.4.patchset diff --git a/games-arcade/nxengine/nxengine-1.0.0.4.recipe b/games-arcade/nxengine/nxengine-1.0.0.4.recipe new file mode 100644 index 000000000..fcae5e49f --- /dev/null +++ b/games-arcade/nxengine/nxengine-1.0.0.4.recipe @@ -0,0 +1,61 @@ +SUMMARY="An open-source rewrite engine of the Cave Story" +DESCRIPTION="The platform-adventure game focuses on an amnesiac protagonist \ +who awakens in a cave. Through his explorations, he discovers a plot by the \ +Doctor, a megalomaniac who intends to force the inhabitants of the cave to \ +fight for him in his bid to conquer the world. The protagonist is thrust \ +into the position of savior as he endeavors to defeat the Doctor." +HOMEPAGE="https://github.com/EXL/NXEngine/" +COPYRIGHT="2017 Retroguru" +LICENSE="GNU GPL v3" +REVISION="1" +SOURCE_URI="https://github.com/EXL/NXEngine/archive/v$portVersion-Rev4.tar.gz" +SOURCE_URI_2="http://www.cavestory.org/downloads/LIN64-NXEngine-$portVersion-Rev-4.tar.gz" # Game Data +CHECKSUM_SHA256="d467c112e81d4c56337ebf6968bd8bd781bce9140f674e72009a5274d2c15784" +CHECKSUM_SHA256_2="ddc1f69349bd4239adc6485e0377b503425a7960bbd6696c1b30ea6ed11e1851" +SOURCE_DIR="NXEngine-$portVersion-Rev4" +SOURCE_DIR_2="NXEngine" +PATCHES="nxengine-$portVersion.patchset" + +ARCHITECTURES="!x86_gcc2 x86 x86_64" + +PROVIDES=" + nxengine = $portVersion + app:nxengine = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libfreetype$secondaryArchSuffix + lib:libsdl$secondaryArchSuffix + lib:libSDL_mixer$secondaryArchSuffix + lib:libSDL_ttf$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libfreetype$secondaryArchSuffix + devel:libsdl$secondaryArchSuffix + devel:libSDL_mixer$secondaryArchSuffix + devel:libSDL_ttf$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:gcc$secondaryArchSuffix + cmd:make + cmd:qmake >= 5 + " + +BUILD() +{ + mkdir -p build_haiku && cd build_haiku + qmake .. + make $jobArgs +} + +INSTALL() +{ + cd build_haiku + mkdir -p $appsDir/NXEngine + cp NXEngine $appsDir/NXEngine + cp -r $sourceDir2/* $appsDir/NXEngine + rm -rf $appsDir/NXEngine/nx + addAppDeskbarSymlink $appsDir/NXEngine/NXEngine +} diff --git a/games-arcade/nxengine/patches/nxengine-1.0.0.4.patchset b/games-arcade/nxengine/patches/nxengine-1.0.0.4.patchset new file mode 100644 index 000000000..339fba223 --- /dev/null +++ b/games-arcade/nxengine/patches/nxengine-1.0.0.4.patchset @@ -0,0 +1,68 @@ +From 82fd9718e1b3faf8f1d018b5c584c016efc36ff5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= +Date: Sat, 16 Sep 2017 10:09:57 +0200 +Subject: Haiku patches + + +diff --git a/NXEngine.pro b/NXEngine.pro +index 23e23e4..54069c4 100644 +--- a/NXEngine.pro ++++ b/NXEngine.pro +@@ -55,6 +55,8 @@ win32-g++ | linux-g++ | linux-g++-64 { + } + } linux-arm-gnueabi-g++ { + DEFINES += _320X240 _MOTOMAGX _SDL_MIXER ++} haiku { ++ DEFINES += _BSD_SOURCE + } + + # Debug +@@ -93,6 +95,8 @@ win32-g++: { + } linux-arm-gnueabi-g++: { + INCLUDEPATH += /opt/toolchains/motomagx/arm-eabi2/include + INCLUDEPATH += /opt/toolchains/motomagx/arm-eabi2/include/SDL ++} haiku { ++ INCLUDEPATH += $$system(finddir B_SYSTEM_HEADERS_DIRECTORY)/SDL + } + + # Librares +@@ -105,6 +109,8 @@ win32-g++ { + LIBS += -lSDLmain -lSDL -lSDL_ttf -lSDL_mixer + } linux-arm-gnueabi-g++ { + LIBS += $$system(sdl-config --libs) -lSDL_mixer -lSDL_ttf -lstdc++ -lm -lfreetype ++} haiku { ++ LIBS += $$system(sdl-config --libs) -lSDL_mixer -lSDL_ttf -lfreetype + } + + # Win32 Icon +diff --git a/main.cpp b/main.cpp +index 026cbac..e76f0d0 100644 +--- a/main.cpp ++++ b/main.cpp +@@ -5,6 +5,10 @@ + #include + #endif + ++#ifdef __HAIKU__ ++#include ++#endif ++ + #include + #include + #include "graphics/safemode.h" +@@ -27,6 +31,12 @@ int flipacceltime = 0; + + int main(int argc, char *argv[]) + { ++ ++#ifdef __HAIKU__ ++ // To make it able to start from Tracker ++ chdir(dirname(argv[0])); ++#endif ++ + bool inhibit_loadfade = false; + bool error = false; + bool freshstart; +-- +2.14.1 +