NXEngine: new recipe (#1641)

This commit is contained in:
miqlas
2017-09-19 07:58:45 +02:00
committed by Jérôme Duval
parent 537e1b3414
commit 976cb7bcc5
2 changed files with 129 additions and 0 deletions

View File

@@ -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
}

View File

@@ -0,0 +1,68 @@
From 82fd9718e1b3faf8f1d018b5c584c016efc36ff5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
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 <SDL/SDL_mixer.h>
#endif
+#ifdef __HAIKU__
+#include <libgen.h>
+#endif
+
#include <stdarg.h>
#include <unistd.h>
#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