From c389e0fbedf93b329f8be312e7feeeef822694c7 Mon Sep 17 00:00:00 2001
From: Abdur-Raheem Idowu <abdurraheemidowu@gmail.com>
Date: Sat, 28 Dec 2019 13:39:31 +0000
Subject: SDL include fix


diff --git a/Makefile b/Makefile
index ea9b75a..8fc1184 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@ CC = gcc
 
 
 # dj2016-10 Add L -I/usr/local/include/SDL in process of getting this working on Mac OS X - not sure if this is 'bad' to just have both /usr/include and /usr/local/include??
-INCLUDEDIRS= -I/usr/include/SDL -I/usr/local/include/SDL 
+INCLUDEDIRS= $(shell sdl-config --cflags --libs)
 
 #CCFLAGS = -O -Wall $(INCLUDEDIRS)
 
-- 
2.19.0


From 4f03ac77591909627d4bfec5f4fc6062bd09acda Mon Sep 17 00:00:00 2001
From: Abdur-Raheem Idowu <abdurraheemidowu@gmail.com>
Date: Sat, 28 Dec 2019 13:45:45 +0000
Subject: Fixed settings directory


diff --git a/src/djstring.cpp b/src/djstring.cpp
index 76237f9..2ba7187 100644
--- a/src/djstring.cpp
+++ b/src/djstring.cpp
@@ -22,6 +22,11 @@ Copyright (C) 1998-2018 David Joffe
 #include <errno.h>//mkpath
 #endif
 
+#ifdef __HAIKU__
+#include <Path.h>
+#include <FindDirectory.h>
+#endif
+
 char *djStrDeepCopy( const char * src )
 {
 	if (!src)
@@ -284,6 +289,12 @@ std::string djGetFolderUserSettings()
 #ifdef WIN32
 	std::string s = getenv("APPDATA");
 	djAppendPathS(s, "DaveGnukem");
+#elif __HAIKU__
+	std::string s;
+	BPath * s_path = new BPath();
+	find_directory(B_USER_SETTINGS_DIRECTORY, s_path);
+	djAppendPathS(s, s_path->Path());
+	djAppendPathS(s, "gnukem");
 #else
 	std::string s = getenv("HOME");
 	djAppendPathS(s, ".gnukem");//?
-- 
2.19.0


From bb94c635c1e851035c26f0c9d2f007404fa91007 Mon Sep 17 00:00:00 2001
From: Abdur-Raheem Idowu <abdurraheemidowu@gmail.com>
Date: Sat, 28 Dec 2019 13:49:27 +0000
Subject: Added required lib for FindDirectory.h and Path.h


diff --git a/Makefile b/Makefile
index 8fc1184..3ffde58 100644
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@ CCFLAGS = -Wall -Wno-switch -DDEBUG $(INCLUDEDIRS)
 #Release version:
 #CCFLAGS = -O -Wall -I/usr/local/include -DHAVE_SOUND $(INCLUDEDIRS)
 
-LIBS = -lSDL -lSDLmain -lSDL_mixer -lpthread 
+LIBS = -lSDL -lSDLmain -lSDL_mixer -lpthread -lbe
 BIN = davegnukem
 
 
-- 
2.19.0


From 7c303c8f0519dbf007e30a90e3931208fa31dbc0 Mon Sep 17 00:00:00 2001
From: Abdur-Raheem Idowu <abdurraheemidowu@gmail.com>
Date: Sun, 29 Dec 2019 16:07:14 +0000
Subject: Allows launch from deskbar and tracker


diff --git a/src/main.cpp b/src/main.cpp
index 183b95a..9c44cc5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -38,6 +38,11 @@ Copyright (C) 1995-2018 David Joffe
 #include "sys_log.h"
 #include "sys_error.h"
 
+#ifdef __HAIKU__
+#include <libgen.h>
+#include <unistd.h>
+#endif
+
 #ifdef __APPLE__
 #include <mach-o/dyld.h>//_NSGetExecutablePath
 #include <sys/stat.h>//For djFolderExists stuff
@@ -114,6 +119,15 @@ CMenu mainMenu ( "main.cpp:mainMenu" );
 // This is the 'main' function. The big cheese.
 int main ( int argc, char** argv )
 {
+
+#ifdef __HAIKU__
+	char* binpath = realpath(argv[0], NULL);
+	if (binpath != NULL) {
+		chdir(dirname(binpath));
+		free(binpath);
+	}
+#endif
+
 	// Check commandline args
 	bool bfullscreen = false;
 	bool b640 = false;
-- 
2.19.0

