mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-30 12:08:53 +02:00
106 lines
2.5 KiB
Plaintext
106 lines
2.5 KiB
Plaintext
From 6b5f57906db0f0fd8a15fc60da2a791d9ea2bc36 Mon Sep 17 00:00:00 2001
|
|
From: Puck Meerburg <puck@puckipedia.nl>
|
|
Date: Mon, 5 Jan 2015 17:41:59 +0100
|
|
Subject: Apply original lmarbles patch
|
|
|
|
|
|
diff --git a/configure b/configure
|
|
index 543fb95..b012313 100755
|
|
--- a/configure
|
|
+++ b/configure
|
|
@@ -5154,7 +5154,7 @@ if test "${ac_cv_lib_m_main+set}" = set; then
|
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
|
else
|
|
ac_check_lib_save_LIBS=$LIBS
|
|
-LIBS="-lm $LIBS"
|
|
+LIBS="$LIBS"
|
|
cat >conftest.$ac_ext <<_ACEOF
|
|
/* confdefs.h. */
|
|
_ACEOF
|
|
@@ -5208,7 +5208,7 @@ if test $ac_cv_lib_m_main = yes; then
|
|
#define HAVE_LIBM 1
|
|
_ACEOF
|
|
|
|
- LIBS="-lm $LIBS"
|
|
+ LIBS="$LIBS"
|
|
|
|
else
|
|
{ { echo "$as_me:$LINENO: error: lib math is needed" >&5
|
|
--
|
|
1.8.3.4
|
|
|
|
|
|
From f837403562b62f6aa17a967597fe61e54499a7bb Mon Sep 17 00:00:00 2001
|
|
From: Puck Meerburg <puck@puckipedia.nl>
|
|
Date: Mon, 5 Jan 2015 17:54:53 +0100
|
|
Subject: Have lmarbles use find_directory for config
|
|
|
|
|
|
diff --git a/src/cfg.c b/src/cfg.c
|
|
index 2831c1b..4d713f5 100644
|
|
--- a/src/cfg.c
|
|
+++ b/src/cfg.c
|
|
@@ -25,6 +25,10 @@
|
|
#include <sys/stat.h>
|
|
#include <dirent.h>
|
|
|
|
+#ifdef __HAIKU__
|
|
+#include <FindDirectory.h>
|
|
+#endif
|
|
+
|
|
#ifdef _WIN32
|
|
#define MKDIR(d, p) mkdir(d)
|
|
#else
|
|
@@ -40,14 +44,16 @@ Cfg cfg;
|
|
void C_StPth()
|
|
{
|
|
DIR *dir;
|
|
-#ifdef _WIN32
|
|
+#if defined(__HAIKU__)
|
|
+ find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, c_pth, sizeof(c_pth) - 1);
|
|
+#elif defined(_WIN32)
|
|
snprintf( c_pth, sizeof(c_pth)-1, "%s/lgames", (getenv( "HOME" )?getenv( "HOME" ):".") );
|
|
#else
|
|
snprintf( c_pth, sizeof(c_pth)-1, "%s/.lgames", getenv( "HOME" ) );
|
|
#endif
|
|
/* create .lgames directory if not found */
|
|
if ( (dir = opendir( c_pth )) == 0 ) {
|
|
- fprintf( stderr, "Config directory ~/.lgames not found. Creating it.\n" );
|
|
+ fprintf( stderr, "Config directory %s not found. Creating it.\n", c_pth );
|
|
MKDIR( c_pth, S_IRWXU );
|
|
}
|
|
else
|
|
diff --git a/src/profile.c b/src/profile.c
|
|
index 218c856..9ebf47b 100644
|
|
--- a/src/profile.c
|
|
+++ b/src/profile.c
|
|
@@ -22,6 +22,10 @@
|
|
#include "cfg.h"
|
|
#include "file.h"
|
|
|
|
+#ifdef __HAIKU__
|
|
+#include <FindDirectory.h>
|
|
+#endif
|
|
+
|
|
// profiles //
|
|
DLst prfs;
|
|
// string list for the menu //
|
|
@@ -38,8 +42,13 @@ void Prf_Ini()
|
|
DL_Ini(&prfs);
|
|
prfs.flgs = DL_AUTODEL;
|
|
prfs.cb = Prf_Del;
|
|
-
|
|
+#ifdef __HAIKU__
|
|
+ find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, prf_pth,
|
|
+ sizeof(prf_pth) - 1);
|
|
+ strcat(prf_pth, "/lmarbles.prfs");
|
|
+#else
|
|
sprintf(prf_pth, "%s/lmarbles.prfs", PRF_DIR);
|
|
+#endif
|
|
}
|
|
|
|
/* terminate profiles; must be saved first */
|
|
--
|
|
1.8.3.4
|
|
|