pingus: save settings in B_USER_SETTINGS_DIRECTORY/pingus/

This commit is contained in:
Jerome Duval
2017-09-21 21:46:56 +02:00
parent e9f2859bd1
commit 22478e665a
2 changed files with 53 additions and 2 deletions

View File

@@ -0,0 +1,50 @@
From 8a29e8c8dc97c3f2d911f5dc57160ff519e0d21b Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 21 Sep 2017 21:16:29 +0200
Subject: Haiku patch
diff --git a/SConscript b/SConscript
index 54b6468..b862fc7 100644
--- a/SConscript
+++ b/SConscript
@@ -261,6 +261,9 @@ class Project:
#if sys.platform == "darwin":
# self.env.StaticLibrary("sdlmain", ["src/macosx/SDLmain.m"], [ 'SDL' ])
+ if sys.platform == 'haiku1':
+ self.conf.env.Append(LIBS = ['be'])
+
self.env.Default(self.env.Program('pingus', ['src/main.cpp', libpingus]))
# build test and utils
diff --git a/src/util/system.cpp b/src/util/system.cpp
index 8b80140..649be87 100644
--- a/src/util/system.cpp
+++ b/src/util/system.cpp
@@ -42,6 +42,11 @@
#define F_OK 0
#endif
+#ifdef __HAIKU__
+# include <FindDirectory.h>
+# include <Path.h>
+#endif
+
#include "pingus/globals.hpp"
#include "util/log.hpp"
#include "util/pathname.hpp"
@@ -299,6 +304,10 @@ System::find_userdir()
return tmpstr;
+#elif defined(__HAIKU__)
+ BPath settingsDir;
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, &settingsDir) == B_OK)
+ return std::string(settingsDir.Path()) + "/pingus/";
#else /* !WIN32 */
char* homedir = getenv("HOME");
--
2.13.1

View File

@@ -4,9 +4,10 @@ other operating systems supported by SDL. It is covered under the GPL."
HOMEPAGE="https://pingus.seul.org"
COPYRIGHT="1998-2011 Ingo Ruhnke"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://github.com/Pingus/pingus/archive/v0.7.6.tar.gz"
REVISION="2"
SOURCE_URI="https://github.com/Pingus/pingus/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="c4cd89e1d350d2472f32de5f6266ac9f3658a3620eace3f79efac45db4323b65"
PATCHES="pingus-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"